Commit ef8a8a3a by Jaxon

feat: 督导统计 业务开发

1 parent 4d2cefec
...@@ -10,6 +10,15 @@ export function getStorePerformance(data = {}) { ...@@ -10,6 +10,15 @@ export function getStorePerformance(data = {}) {
return api.post("dj.api.supervisor.management.store.performance", data, "supervisorUrl"); return api.post("dj.api.supervisor.management.store.performance", data, "supervisorUrl");
} }
// 盯防门店业绩接口
export function getSupervisorStorePerformance(data = {}) {
return api.post("dj.api.supervisor.store.performance", data, "supervisorUrl");
}
export function getSupervisorStoreStaffPerformance(data = {}) {
return api.post("dj.api.supervisor.store.performance.by.merchant", data, "supervisorUrl");
}
// export function getStorePerformance(data = {}) { // export function getStorePerformance(data = {}) {
// return api.post("dj.api.supervisor.management.store.performance", data, "supervisorUrl"); // return api.post("dj.api.supervisor.management.store.performance", data, "supervisorUrl");
// } // }
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
:key="item.name" :key="item.name"
class="col-wrapper van-col-wrapper" class="col-wrapper van-col-wrapper"
:style="item.colStyle"> :style="item.colStyle">
<Tooltip :content="item.tips" <Tooltip v-if="item.tips"
:content="item.tips"
:hide-after="1500" :hide-after="1500"
:options="{ :options="{
triggers: ['click'], triggers: ['click'],
...@@ -30,6 +31,25 @@ ...@@ -30,6 +31,25 @@
</div> </div>
</div> </div>
</Tooltip> </Tooltip>
<div v-else
class="item-wrapper"
:class="{ special: item.special }"
:style="item.style">
<div class="label">
<div class="text-hide" style="margin-right:2px">
{{ item.label }}
</div>
<SvgIcon v-if="item.tips"
class="icon"
color="#DCDDE1"
name="form-tips"
size="16px" />
</div>
<div class="value text-hide ">
{{ getValue(item.name) }}
</div>
</div>
</div> </div>
</div> </div>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
}" }"
@click="handleTapItem"> @click="handleTapItem">
<div class="title-wrapper"> <div class="title-wrapper">
<div class="title-label-wrapper text-hide"> <div class="title-label-wrapper ">
<div class="main-label text-hide"> <div class="main-label text-hide">
{{ title }} {{ title }}
</div> </div>
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</div> </div>
</div> </div>
</slot> </slot>
<slot name="title-info-icon"> <slot v-if="beTap" name="title-info-icon">
<van-icon color="#000000E5" <van-icon color="#000000E5"
name="arrow" name="arrow"
:size="16" /> :size="16" />
...@@ -204,12 +204,13 @@ export default { ...@@ -204,12 +204,13 @@ export default {
overflow: hidden; overflow: hidden;
.title-label-wrapper { .title-label-wrapper {
flex-shrink: 0; flex-shrink: 0;
width: calc(50% - 16px); flex: 1;
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
line-height: 22px; line-height: 22px;
color: rgba(0, 0, 0, 0.9); color: rgba(0, 0, 0, 0.9);
margin-right: 16px; margin-right: 16px;
overflow: hidden;
.sub-label { .sub-label {
font-weight: 400; font-weight: 400;
font-size: 10px; font-size: 10px;
...@@ -218,7 +219,7 @@ export default { ...@@ -218,7 +219,7 @@ export default {
} }
} }
.title-info-wrapper { .title-info-wrapper {
flex: 1; max-width: calc(50%);
flex-shrink: 0; flex-shrink: 0;
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -52,7 +52,7 @@ export const supervisorSchemaList = [ ...@@ -52,7 +52,7 @@ export const supervisorSchemaList = [
{ {
name: "displayPeaceOfMindAfterSalesRate", name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交", label: "安心包售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-right:0; margin-bottom:4px",
isMore: true, isMore: true,
}, },
{ {
...@@ -71,51 +71,22 @@ export const supervisorSchemaList = [ ...@@ -71,51 +71,22 @@ export const supervisorSchemaList = [
export const supervisorCommonSchemaList = [ export const supervisorCommonSchemaList = [
{ {
name: "displayDeliveryCount",
label: "交付数",
col: 8,
titleInfo: true,
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
titleInfo: true,
},
{
name: "displayTotalOutput", name: "displayTotalOutput",
label: "总产值(万)", label: "总产值(万)",
col: 8, colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px",
titleInfo: true,
},
{
name: "staffCount",
label: "管理驻店",
col: 6,
style: "color: #000000E5;",
special: true,
},
{
name: "totalStoreCount",
label: "辖区门店",
col: 6,
style: "color: #000000E5;",
special: true,
}, },
{ {
name: "yellowStoreCount", name: "displayDeliveryCount",
label: "需关注门店", label: "交付数",
col: 6, colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px",
style: "color: #FF9D0A;",
special: true,
}, },
{ {
name: "redStoreCount", name: "displayPreSalesTouchCount",
label: "预警门店", label: "触客数",
col: 6, colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px",
style: "color: #F24724;",
special: true,
}, },
{ {
name: "displayTouchConversionRate", name: "displayTouchConversionRate",
label: "触客成交率", label: "触客成交率",
...@@ -144,27 +115,28 @@ export const supervisorCommonSchemaList = [ ...@@ -144,27 +115,28 @@ export const supervisorCommonSchemaList = [
{ {
name: "displayWarrantyAfterSalesRate", name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交", label: "延保售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
style: "margin-bottom: 4px;",
isMore: true, isMore: true,
}, },
{ {
name: "displayPeaceOfMindAfterSalesRate", name: "displayEquityProductAfterSalesRate",
label: "权益商品售后成交/总成交", label: "权益商品售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-right:0; margin-bottom:4px",
style: "margin-bottom: 4px;",
isMore: true, isMore: true,
}, },
{ {
name: "displayEquityAfterSalesRate", name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交", label: "权益售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true, isMore: true,
}, },
{ {
name: "displayEquityAvgUnitPrice", name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)", label: "权益平均客单价(元)",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true, isMore: true,
}, },
]; ];
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
@change="getData()" /> @change="getData()" />
</div> </div>
<div class="static-wrapper"> <div v-if="[1, 2].includes(list.query.dateType)" class="static-wrapper">
<StaticInfo :list="options.staticInfoList" /> <StaticInfo :data="list.statistics" :list="options.staticInfoList" />
</div> </div>
<div class="search-wrapper"> <div class="search-wrapper">
<SearchInput v-model="list.query.searchKeyword" <SearchInput v-model="list.query.searchKeyword"
...@@ -32,28 +32,42 @@ ...@@ -32,28 +32,42 @@
门店列表 门店列表
</div> </div>
<div class="region" @click="handleShowRegionPicker"> <div class="region" @click="handleShowRegionPicker">
<span>筛选门店区域</span> <span>{{ picker.region.label }}</span>
<SvgIcon color="#A2A6B1" <SvgIcon color="#A2A6B1"
name="triangle-down" name="triangle-down"
size="16" /> size="16" />
<RegionPicker v-model="list.query.region"
:options="options.regionList"
:visible="picker.region.show"
@cancel="handleCancelRegionPicker"
@confirm="handleChangeRegion" />
</div> </div>
</div> </div>
<div :key="list.query.statDimension" class="container-wrapper"> <div :key="list.query.statDimension" class="container-wrapper">
<StatisticsItem v-for="(item, index) in list.data" <template v-if="list.data && list.data.length">
:key="index" <StatisticsItem v-for="(item, index) in list.data"
class="statistics-item" :key="index"
:data="item" class="statistics-item"
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList" :data="item"
:title="item.merchantName" :schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
@tap="handleTapItem"> :title="item.merchantName"
<template #sub-title="{ data }"> @tap="handleTapItem(item)">
<div class="sub-title-wrapper"> <template #sub-title="{ data }">
<div class="staff-label"> <div class="sub-title-wrapper">
{{ getStaffLength(data) }}名驻店人员 <div class="staff-label">
{{ getStaffLength(data) }}名驻店人员
</div>
<WarnList :list="item.warnList" />
</div> </div>
</div> </template>
</template> </StatisticsItem>
</StatisticsItem> </template>
<template v-else>
<Empty description="暂无门店" />
</template>
</div> </div>
</div> </div>
</van-pull-refresh> </van-pull-refresh>
...@@ -62,14 +76,17 @@ ...@@ -62,14 +76,17 @@
<script> <script>
import dayjs from "dayjs"; import dayjs from "dayjs";
import { cloneDeep, throttle } from "lodash-es"; import { cloneDeep, throttle } from "lodash-es";
import { Empty } from "vant";
import { getRegionList } from "@/api/region"; import { getRegionList } from "@/api/region";
import DatePicker from "@/components/datePicker/index.vue"; import DatePicker from "@/components/datePicker/index.vue";
import DateTypeTabs from "@/components/dateTypeTabs/index.vue"; import DateTypeTabs from "@/components/dateTypeTabs/index.vue";
import RegionPicker from "@/components/regionPicker/index.vue";
import SearchInput from "@/components/searchBar/index.vue"; import SearchInput from "@/components/searchBar/index.vue";
import StaticInfo from "@/components/staticInfo/index.vue"; import StaticInfo from "@/components/staticInfo/index.vue";
import SvgIcon from "@/components/svgIcon/index.vue"; import SvgIcon from "@/components/svgIcon/index.vue";
import { getStorePerformance } from "@/views/performance/api"; import { getStorePerformance } from "@/views/performance/api";
import StatisticsItem from "@/views/performance/components/statisticsItem/statisticsItem.vue"; import StatisticsItem from "@/views/performance/components/statisticsItem/statisticsItem.vue";
import WarnList from "@/views/performance/components/warnList/index.vue";
import { brandTypeList, staticInfoList } from "@/views/performance/constant/performance"; import { brandTypeList, staticInfoList } from "@/views/performance/constant/performance";
import BrandTabs from "../brandTabs/index.vue"; import BrandTabs from "../brandTabs/index.vue";
import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data"; import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data";
...@@ -77,6 +94,7 @@ import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data"; ...@@ -77,6 +94,7 @@ import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data";
export default { export default {
name: "StorePerformance", name: "StorePerformance",
components: { components: {
Empty,
SvgIcon, SvgIcon,
BrandTabs, BrandTabs,
DatePicker, DatePicker,
...@@ -84,10 +102,18 @@ export default { ...@@ -84,10 +102,18 @@ export default {
StaticInfo, StaticInfo,
SearchInput, SearchInput,
StatisticsItem, StatisticsItem,
RegionPicker,
WarnList,
}, },
data() { data() {
return { return {
throttledFilterSearchKeyword: null, throttledFilterSearchKeyword: null,
picker: {
region: {
show: false,
label: "筛选门店区域",
},
},
options: { options: {
brandTypeList, brandTypeList,
staticInfoList, staticInfoList,
...@@ -131,15 +157,33 @@ export default { ...@@ -131,15 +157,33 @@ export default {
this.throttledFilterSearchKeyword?.cancel?.(); this.throttledFilterSearchKeyword?.cancel?.();
}, },
methods: { methods: {
async handleChangeRegion(row) {
console.log(row);
if (!row) {
this.list.query.region = undefined;
this.picker.region.label = "筛选门店区域";
} else {
this.list.query.region = row.value;
this.picker.region.label = row.label;
}
this.picker.region.show = false;
await this.getData();
},
handleCancelRegionPicker() {
this.picker.region.show = false;
},
async getRegionOptions() { async getRegionOptions() {
const data = await getRegionList({}); const { districts } = await getRegionList({});
console.log(data); this.options.regionList = districts[0].districts.map(item => ({
label: item.name,
value: item.code,
}));
}, },
handleShowRegionPicker() { handleShowRegionPicker() {
this.picker.region.show = true;
}, },
getStaffLength(row) { getStaffLength(row) {
return row?.length || 0; return row?.staffCount || 0;
}, },
getItemSubTitle(rows) { getItemSubTitle(rows) {
return rows?.storeList?.map(i => i.merchantName).join("、"); return rows?.storeList?.map(i => i.merchantName).join("、");
...@@ -175,11 +219,23 @@ export default { ...@@ -175,11 +219,23 @@ export default {
return this.list.originData; return this.list.originData;
} }
return this.list.originData.filter(item => item?.supervisorName?.includes(keyword)); return this.list.originData.filter(item => item?.merchantName?.includes(keyword));
}, },
handleTapItem() { handleTapItem(row) {
this.$router.push({ this.$router.push({
name: "supervisorOutlet", name: "supervisorOutletStaff",
query: {
merchantId: row.merchantId,
merchantName: row.merchantName,
query: JSON.stringify({
statDimension: this.list.query.statDimension,
dateType: this.list.query.dateType,
date: {
startDate: this.list.query.date.startDate,
endDate: this.list.query.date.endDate,
},
}),
},
}); });
}, },
async handleResetList() { async handleResetList() {
...@@ -250,12 +306,17 @@ export default { ...@@ -250,12 +306,17 @@ export default {
} }
} }
.sub-title-wrapper { .sub-title-wrapper {
display: flex;
align-items: center;
.staff-label { .staff-label {
font-weight: 400; font-weight: 400;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
color: #00000066; color: #00000066;
} }
.warn-wrapper {
margin-left: 8px;
}
} }
} }
} }
......
...@@ -75,27 +75,29 @@ export const supervisorSchemaList = [ ...@@ -75,27 +75,29 @@ export const supervisorSchemaList = [
{ {
name: "displayVehicleWarrantyAfterSalesRate", name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交", label: "整车延保售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
style: "margin-bottom: 4px;",
isMore: true, isMore: true,
}, },
{ {
name: "displayPeaceOfMindAfterSalesRate", name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交", label: "安心包售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-right:0;margin-bottom:4px ",
style: "margin-bottom: 4px;",
isMore: true, isMore: true,
}, },
{ {
name: "displayBatteryAfterSalesRate", name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交", label: "电池售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true, isMore: true,
}, },
{ {
name: "displayTireInsuranceAfterSalesRate", name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交", label: "轮胎售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true, isMore: true,
}, },
]; ];
...@@ -175,27 +177,27 @@ export const supervisorCommonSchemaList = [ ...@@ -175,27 +177,27 @@ export const supervisorCommonSchemaList = [
{ {
name: "displayWarrantyAfterSalesRate", name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交", label: "延保售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
style: "margin-bottom: 4px;",
isMore: true, isMore: true,
}, },
{ {
name: "displayPeaceOfMindAfterSalesRate", name: "displayPeaceOfMindAfterSalesRate",
label: "权益商品售后成交/总成交", label: "权益商品售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-right:0; margin-bottom:4px",
style: "margin-bottom: 4px;",
isMore: true, isMore: true,
}, },
{ {
name: "displayEquityAfterSalesRate", name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交", label: "权益售后成交/总成交",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true, isMore: true,
}, },
{ {
name: "displayEquityAvgUnitPrice", name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)", label: "权益平均客单价(元)",
colStyle: "width:50%", colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true, isMore: true,
}, },
]; ];
...@@ -29,14 +29,19 @@ ...@@ -29,14 +29,19 @@
督导列表 督导列表
</div> </div>
<div :key="list.query.statDimension" class="container-wrapper"> <div :key="list.query.statDimension" class="container-wrapper">
<StatisticsItem v-for="(item, index) in list.data" <template v-if="list.data && list.data.length">
:key="index" <StatisticsItem v-for="(item, index) in list.data"
class="statistics-item" :key="index"
:data="item" class="statistics-item"
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList" :data="item"
:sub-title="getItemSubTitle(item)" :schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:title="item.supervisorName" :sub-title="item.merchantName"
@tap="handleTapItem" /> :title="item.supervisorName"
@tap="handleTapItem(item)" />
</template>
<template v-else>
<Empty description="暂无督导" />
</template>
</div> </div>
</div> </div>
</van-pull-refresh> </van-pull-refresh>
...@@ -45,6 +50,8 @@ ...@@ -45,6 +50,8 @@
<script> <script>
import dayjs from "dayjs"; import dayjs from "dayjs";
import { cloneDeep, throttle } from "lodash-es"; import { cloneDeep, throttle } from "lodash-es";
import { Empty } from "vant";
import DatePicker from "@/components/datePicker/index.vue"; import DatePicker from "@/components/datePicker/index.vue";
import DateTypeTabs from "@/components/dateTypeTabs/index.vue"; import DateTypeTabs from "@/components/dateTypeTabs/index.vue";
import SearchInput from "@/components/searchBar/index.vue"; import SearchInput from "@/components/searchBar/index.vue";
...@@ -61,9 +68,9 @@ export default { ...@@ -61,9 +68,9 @@ export default {
BrandTabs, BrandTabs,
DatePicker, DatePicker,
DateTypeTabs, DateTypeTabs,
StaticInfo,
SearchInput, SearchInput,
StatisticsItem, StatisticsItem,
Empty,
}, },
data() { data() {
return { return {
...@@ -142,9 +149,22 @@ export default { ...@@ -142,9 +149,22 @@ export default {
return this.list.originData.filter(item => item?.supervisorName?.includes(keyword)); return this.list.originData.filter(item => item?.supervisorName?.includes(keyword));
}, },
handleTapItem() { handleTapItem(row) {
this.$router.push({ this.$router.push({
name: "supervisorOutlet", name: "supervisorOutlet",
query: {
supervisorId: row.supervisorId,
supervisorName: row.supervisorName,
query: JSON.stringify({
statDimension: this.list.query.statDimension,
dateType: this.list.query.dateType,
date: {
startDate: this.list.query.date.startDate,
endDate: this.list.query.date.endDate,
},
}),
},
}); });
}, },
async handleResetList() { async handleResetList() {
......
<template>
<div v-if="list && list.length" class="warn-wrapper">
<div v-for="warn in list"
:key="warn"
class="warn-item"
:style="storeWarnList[warn].style">
{{ storeWarnList[warn].label }}
</div>
</div>
</template>
<script>
import { keyBy } from "lodash-es";
import { storeWarnList } from "@/views/performance/constant/performance";
export default {
name: "",
props: {
list: {
type: Array,
default: () => ([]),
},
},
data() {
return {
storeWarnList: keyBy(storeWarnList, "key"),
};
},
computed: {
},
mounted() {
},
methods: {
},
};
</script>
<style scoped lang="scss">
.warn-wrapper {
display: flex;
align-content: center;
column-gap: 6px;
.warn-item {
padding: 2px 4px;
border-radius: 3px;
font-weight: 400;
font-size: 9px;
line-height: 9px;
text-align: center;
}
}
</style>
...@@ -37,3 +37,27 @@ export const staticInfoList = [ ...@@ -37,3 +37,27 @@ export const staticInfoList = [
label: "预警门店数", label: "预警门店数",
}, },
]; ];
export const storeWarnList = [
{
key: 2,
label: "兜底",
style: "background-color:#FFF5E7;color:#FF9D0A",
},
{
key: 3,
label: "生态",
style: "color:#F24724;background-color:#FEECE8",
},
{
key: 4,
label: "红色",
style: "background-color:#EE3140;color:white",
},
{
key: 5,
label: "黄色",
style: "background-color:#FF9D0A;color:white",
},
];
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
</template> </template>
<script> <script>
import StoreTabItem from "../components/storeTabItem"; import StoreTabItem from "../components/storeTabItem/index.vue";
import SupervisorTabItem from "../components/supervisorTabItem"; import SupervisorTabItem from "../components/supervisorTabItem/index.vue";
export default { export default {
name: "PerformanceOverview", name: "PerformanceOverview",
...@@ -47,11 +47,15 @@ export default { ...@@ -47,11 +47,15 @@ export default {
background-color: #f2f3f7; background-color: #f2f3f7;
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
::v-deep .van-tabs { ::v-deep .van-tabs {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
overflow-y: hidden;
box-sizing: border-box;
min-height: 0;
.van-tab { .van-tab {
flex: none; flex: none;
font-weight: 500; font-weight: 500;
...@@ -65,21 +69,48 @@ export default { ...@@ -65,21 +69,48 @@ export default {
&--active { &--active {
color: var(--themeColor); color: var(--themeColor);
} }
&__pane-wrapper {
height: 100%;
overflow: hidden;
box-sizing: border-box;
}
&__pane { &__pane {
height: 100%; height: 100%;
overflow-y: hidden; overflow-y: hidden;
box-sizing: border-box;
} }
// &__pane-wrapper {
// box-sizing: border-box;
// // height: 100%;
// // overflow: hidden;
// // overflow-y: hidden;
// &:not(&--inactive) {
// }
// }
} }
&__wrap { &__wrap {
background-color: transparent; background-color: transparent;
padding: 0 12px; padding: 0 12px;
box-sizing: border-box;
overflow: hidden;
} }
&__content { &__content {
flex: 1; flex: 1;
height: 100%;
overflow: hidden; overflow: hidden;
overflow-y: hidden;
box-sizing: border-box;
flex-shrink: 0;
flex-basis: 0;
}
&__track {
box-sizing: border-box;
} }
&__nav { &__nav {
background-color: transparent; background-color: transparent;
flex-shrink: 0;
flex-basis: 0;
} }
&__line { &__line {
bottom: 18px; bottom: 18px;
......
export const supervisorSchemaList = [
{
name: "displayTotalOutput",
label: "总产值(万)",
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px",
},
{
name: "displayDeliveryCount",
label: "交付数",
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px",
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px",
},
{
name: "displayVehicleWarrantyRate",
label: "整车延保",
colStyle: "flex: 0 auto;",
tips: "整车延保触客转化率",
},
{
name: "displayPeaceOfMindRate",
label: "安心包",
colStyle: "flex:1",
tips: "安心包触客转化率",
},
{
name: "displayBatteryWarrantyRate",
label: "电池",
colStyle: "flex:1",
tips: "电池延保触客转化率",
},
{
name: "displayTireInsuranceRate",
label: "轮胎",
colStyle: "flex:1",
tips: "轮胎险触客转化率",
},
{
name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
{
name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
];
export const supervisorCommonSchemaList = [
{
name: "displayTotalOutput",
label: "总产值(万)",
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px",
},
{
name: "displayDeliveryCount",
label: "交付数",
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px",
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px",
},
{
name: "displayTouchConversionRate",
label: "触客成交率",
colStyle: "flex: 0 auto;",
},
{
name: "displayPeaceOfMindRate",
label: "延保",
colStyle: "flex:1",
tips: "延保触客转化率",
},
{
name: "displayEquityProductRate",
label: "权益商品",
colStyle: "flex:1",
tips: "权益商品触客转化率",
},
{
name: "displayEquityRate",
label: "权益",
colStyle: "flex:1",
tips: "权益触客转化率",
},
{
name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "权益商品售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
{
name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
];
export const supervisorSchemaList = [
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
titleInfo: true,
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
titleInfo: true,
},
{
name: "displayTotalOutput",
label: "总产值(万)",
col: 8,
titleInfo: true,
},
{
name: "displayVehicleWarrantyRate",
label: "整车延保",
colStyle: "flex: 0 auto;margin-top:8px",
tips: "整车延保触客转化率",
},
{
name: "displayPeaceOfMindRate",
label: "安心包",
colStyle: "flex:1;margin-top:8px",
tips: "安心包触客转化率",
},
{
name: "displayBatteryWarrantyRate",
label: "电池",
colStyle: "flex:1;margin-top:8px",
tips: "电池延保触客转化率",
},
{
name: "displayTireInsuranceRate",
label: "轮胎",
colStyle: "flex:1;margin-top:8px",
tips: "轮胎险触客转化率",
},
{
name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
{
name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
];
export const supervisorCommonSchemaList = [
{
name: "displayDeliveryCount",
label: "交付数",
col: 8,
titleInfo: true,
},
{
name: "displayPreSalesTouchCount",
label: "触客数",
col: 8,
titleInfo: true,
},
{
name: "displayTotalOutput",
label: "总产值(万)",
col: 8,
titleInfo: true,
},
{
name: "displayTouchConversionRate",
label: "触客成交率",
colStyle: "flex: 0 auto;margin-top:8px",
},
{
name: "displayPeaceOfMindRate",
label: "延保",
colStyle: "flex:1;margin-top:8px",
tips: "延保触客转化率",
},
{
name: "displayEquityProductRate",
label: "权益商品",
colStyle: "flex:1;margin-top:8px",
tips: "权益商品触客转化率",
},
{
name: "displayEquityRate",
label: "权益",
colStyle: "flex:1;margin-top:8px",
tips: "权益触客转化率",
},
{
name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayEquityProductAfterSalesRate",
label: "权益商品售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
{
name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
];
<template>
<van-pull-refresh v-model="list.loading"
class="pull-refresh-wrapper"
@refresh="handleResetList">
<div class="filter-wrapper">
<div class="brand-filter">
<BrandTabs v-model="list.query.statDimension"
:list="options.brandTypeList"
@change="getData()" />
</div>
<div class="date-filter">
<DateTypeTabs v-model="list.query.dateType" />
<DatePicker v-model="list.query.date"
style="margin-left:16px"
:type="options.dateType[list.query.dateType]"
@change="getData()" />
</div>
<!-- <div class="static-wrapper">
<StaticInfo :data="list.statistics" :list="options.staticInfoList" />
</div> -->
<div class="search-wrapper">
<SearchInput v-model="list.query.searchKeyword"
placeholder="搜索驻店销售姓名..."
@input="throttledFilterSearchKeyword" />
</div>
</div>
<div class="list-wrapper">
<div class="title-wrapper">
{{ $route.query.supervisorName ? '督导-' : '' }}门店-驻店列表
</div>
<div :key="list.query.statDimension" class="container-wrapper">
<template v-if="list.data && list.data.length">
<StatisticsItem v-for="(item, index) in list.data"
:key="index"
class="statistics-item"
:be-tap="false"
:data="item"
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:sub-title="item.merchantName"
:title="item.employeeName" />
</template>
<template v-else>
<Empty description="暂无驻店销售" />
</template>
</div>
</div>
</van-pull-refresh>
</template>
<script>
import dayjs from "dayjs";
import { cloneDeep, throttle } from "lodash-es";
import { Empty } from "vant";
import DatePicker from "@/components/datePicker/index.vue";
import DateTypeTabs from "@/components/dateTypeTabs/index.vue";
import SearchInput from "@/components/searchBar/index.vue";
import StaticInfo from "@/components/staticInfo/index.vue";
import { getSupervisorStoreStaffPerformance } from "@/views/performance/api";
import BrandTabs from "@/views/performance/components/brandTabs/index.vue";
import StatisticsItem from "@/views/performance/components/statisticsItem/statisticsItem.vue";
import { staticInfoList } from "@/views/performance/constant/performance";
import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data";
export default {
name: "PerformanceOverview",
components: {
BrandTabs,
DatePicker,
DateTypeTabs,
StaticInfo,
SearchInput,
StatisticsItem,
Empty,
},
data() {
return {
throttledFilterSearchKeyword: null,
options: {
brandTypeList: [
{ key: undefined, label: "" },
],
staticInfoList,
supervisorSchemaList,
supervisorCommonSchemaList,
dateType: {
// "date" | "week" | "year-month"
0: "date",
1: "week",
2: "year-month",
},
},
list: {
loading: false,
originData: [],
data: [],
query: {
merchantId: undefined,
dateType: 0,
statDimension: "1",
searchKeyword: "",
date: {
startDayjs: dayjs(),
},
},
},
};
},
created() {
const { query: _query = "{}", merchantId, merchantName, supervisorName } = this.$route.query;
const query = JSON.parse(_query);
if (query.statDimension) {
this.list.query.statDimension = query.statDimension;
}
if (query.dateType) {
this.list.query.dateType = query.dateType;
}
if (query.date && query.date.endDate && query.date.startDate) {
this.list.query.date.startDayjs = dayjs(query.date.startDate);
}
this.list.query.merchantId = merchantId;
const statDimensionLabel = this.list.query.statDimension === "1" ? "问界鸿蒙" : "通用品牌";
this.options.brandTypeList[0].key = merchantId;
const supervisorNameLabel = supervisorName ? `督导${supervisorName}-` : "";
this.options.brandTypeList[0].label = `${supervisorNameLabel}${statDimensionLabel}-${merchantName}`;
this.throttledFilterSearchKeyword = throttle(() => {
this.list.data = this.filterSearchKeyword();
}, 300);
},
async mounted() {
},
beforeDestroy() {
this.throttledFilterSearchKeyword?.cancel?.();
},
methods: {
getItemSubTitle(rows) {
return rows?.storeList?.map(i => i.merchantName).join("、");
},
getQuery() {
return {
...this.list.query,
startDate: this.list.query.date.startDate,
endDate: this.list.query.date.endDate,
date: undefined,
};
},
async getData() {
this.$loading.show({ delay: 0 });
try {
this.list.data = [];
this.list.originData = [];
await this.$nextTick();
const list = await getSupervisorStoreStaffPerformance(this.getQuery());
this.list.originData = cloneDeep(list);
this.list.data = this.afterGetData(list);
} finally {
this.$loading.hide();
}
},
afterGetData(list) {
return this.filterSearchKeyword();
},
filterSearchKeyword(list) {
const keyword = (this.list.query.searchKeyword || "").trim();
if (!keyword) {
return this.list.originData;
}
return this.list.originData.filter(item => item?.employeeName?.includes(keyword));
},
handleTapItem(row) {
this.$router.push({
name: "supervisorOutlet",
query: {
supervisorId: row.supervisorId,
supervisorName: row.supervisorName,
statDimension: this.list.query.statDimension,
},
});
},
async handleResetList() {
this.list.loading = true;
await this.getData();
this.list.loading = false;
},
search() {},
},
};
</script>
<style lang="scss" scoped>
.pull-refresh-wrapper {
height: 100%;
overflow: auto !important;
box-sizing: border-box;
background-color: #f2f3f7;
}
.filter-wrapper {
background-color: white;
padding: 0 12px;
.brand-filter {
padding: 6px 0;
}
.date-filter {
padding: 8px 0;
width: 100%;
display: flex;
align-items: center;
::v-deep .tab-section {
background: #f3f3f4;
}
}
.static-wrapper {
padding: 8px 0;
::v-deep .static-info {
padding: 0;
}
}
.search-wrapper {
padding: 8px 0;
.search-bar-wrapper {
padding: 0;
::v-deep .van-search {
padding: 0;
}
}
}
}
.list-wrapper {
padding: 0 12px 20px;
> .title-wrapper {
font-weight: 400;
font-size: 14px;
line-height: 14px;
color: #000000e5;
padding: 8px 0;
}
.container-wrapper {
margin-top: 4px;
.statistics-item {
margin-top: 8px;
&:first-child {
margin-top: 0;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!