Commit 3c5b0ee6 by Jaxon

Merge branch 'feature/performance-overview' into 'SAAS+V5.8.2'

Feature/performance overview

See merge request !13
2 parents 858a488b 59476f09
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"glsx-common": "^2.1.0", "glsx-common": "^2.1.0",
"lib-flexible": "^0.3.2", "lib-flexible": "^0.3.2",
"lodash-es": "^4.18.1", "lodash-es": "^4.18.1",
"qs": "^6.15.2",
"sha1": "^1.1.1", "sha1": "^1.1.1",
"storejs": "^1.1.0", "storejs": "^1.1.0",
"vant": "^2.12.21", "vant": "^2.12.21",
......
...@@ -26,6 +26,9 @@ importers: ...@@ -26,6 +26,9 @@ importers:
lodash-es: lodash-es:
specifier: ^4.18.1 specifier: ^4.18.1
version: 4.18.1 version: 4.18.1
qs:
specifier: ^6.15.2
version: 6.15.2
sha1: sha1:
specifier: ^1.1.1 specifier: ^1.1.1
version: 1.1.1 version: 1.1.1
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<div id="app" :class="$route.meta.showTabBar ? 'tab-bar-page' : ''"> <div id="app" :class="$route.meta.showTabBar ? 'tab-bar-page' : ''">
<template v-if="showWindow"> <template v-if="showWindow">
<transition name="fade"> <transition name="fade">
<keep-alive v-if="$route.meta.keepAlive"> <keep-alive>
<router-view></router-view> <router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive> </keep-alive>
</transition> </transition>
<transition name="fade"> <transition name="fade">
...@@ -55,10 +55,10 @@ export default { ...@@ -55,10 +55,10 @@ export default {
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: calc(env(safe-area-inset-bottom) / 1.5); padding-bottom: calc(env(safe-area-inset-bottom));
background-color: transparent; background-color: transparent;
} }
.tab-bar-page { .tab-bar-page {
padding-bottom: calc(46px + (env(safe-area-inset-bottom) / 1.5)) !important; padding-bottom: calc(50px + (env(safe-area-inset-bottom))) !important;
} }
</style> </style>
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
// @button-primary-background-color: @green; // @button-primary-background-color: @green;
// @button-primary-border-color: @green; // @button-primary-border-color: @green;
// @button-info-color: @white; // @button-info-color: @white;
// @button-info-background-color: @blue; @button-info-background-color: #2c66f7;
// @button-info-border-color: @blue; // @button-info-border-color: @blue;
// @button-danger-color: @white; // @button-danger-color: @white;
// @button-danger-background-color: @red; // @button-danger-background-color: @red;
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
// @button-warning-border-color: @orange; // @button-warning-border-color: @orange;
// @button-border-width: @border-width-base; // @button-border-width: @border-width-base;
// @button-border-radius: @border-radius-sm; // @button-border-radius: @border-radius-sm;
// @button-round-border-radius: @border-radius-max; @button-round-border-radius: 8px;
// @button-plain-background-color: @white; // @button-plain-background-color: @white;
// @button-disabled-opacity: @disabled-opacity; // @button-disabled-opacity: @disabled-opacity;
......
<template> <template>
<van-action-sheet :close-on-click-action="false" <van-action-sheet get-container="body"
:close-on-click-action="false"
:close-on-click-overlay="false"
:closeable="false"
:title="title"
:value="visible" :value="visible"
@closed="handleClosed" @closed="handleClosed"
@input="updateVisible"> @input="updateVisible">
...@@ -50,9 +54,18 @@ ...@@ -50,9 +54,18 @@
</template> </template>
<script> <script>
import { ActionSheet } from "vant";
export default { export default {
name: "RegionPicker", name: "RegionPicker",
components: {
[ActionSheet.name]: ActionSheet,
},
props: { props: {
title: {
type: String,
default: "门店区域",
},
value: { value: {
type: [String, Number], type: [String, Number],
default: "", default: "",
...@@ -73,11 +86,11 @@ export default { ...@@ -73,11 +86,11 @@ export default {
}, },
labelKey: { labelKey: {
type: String, type: String,
default: "name", default: "label",
}, },
valueKey: { valueKey: {
type: String, type: String,
default: "code", default: "value",
}, },
}, },
data() { data() {
...@@ -124,6 +137,8 @@ export default { ...@@ -124,6 +137,8 @@ export default {
visible: { visible: {
immediate: true, immediate: true,
handler(val) { handler(val) {
console.log(val);
if (val) { if (val) {
this.initPanelState(); this.initPanelState();
} }
...@@ -152,8 +167,9 @@ export default { ...@@ -152,8 +167,9 @@ export default {
return this.normalizedOptions.find(item => item.value === value) || null; return this.normalizedOptions.find(item => item.value === value) || null;
}, },
handleSelect(item) { handleSelect(item) {
this.tempValue = item.value; const isSameRegion = this.tempValue === item.value;
this.$emit("select", item); this.tempValue = isSameRegion ? "" : item.value;
this.$emit("select", isSameRegion ? null : item);
}, },
handleCancel() { handleCancel() {
this.keyword = ""; this.keyword = "";
...@@ -184,6 +200,16 @@ export default { ...@@ -184,6 +200,16 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .van-action-sheet {
&__header {
font-weight: 500;
font-size: 16px;
line-height: 20px;
text-align: center;
color: #000000e5;
padding: 16px;
}
}
.region-sheet { .region-sheet {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -191,13 +217,15 @@ export default { ...@@ -191,13 +217,15 @@ export default {
background: #ffffff; background: #ffffff;
&__search { &__search {
padding: 12px 12px 0; ::v-deep .van-search {
padding: 12px 16px 4px !important;
}
} }
&__list { &__list {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
padding: 8px 12px 16px; padding: 0px 16px 12px;
} }
&__item { &__item {
...@@ -231,8 +259,7 @@ export default { ...@@ -231,8 +259,7 @@ export default {
&__footer { &__footer {
display: flex; display: flex;
column-gap: 12px; column-gap: 12px;
padding: 12px; padding: 8px 16px;
border-top: 1px solid #f2f3f5;
} }
&__button { &__button {
......
...@@ -49,10 +49,6 @@ export default { ...@@ -49,10 +49,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
/* van-tabbar-item 默认图标大小比较小,我们稍微调整大一点点确保和设计图相似 */ /* van-tabbar-item 默认图标大小比较小,我们稍微调整大一点点确保和设计图相似 */
:deep(.van-tabbar-item__icon img) { :deep(.van-tabbar-item__icon img) {
height: 24px;
}
.tab-icon {
height: 20px; height: 20px;
width: 20px; width: 20px;
} }
......
<template> <template>
<router-view /> <div class="route-outlet">
<keep-alive>
<router-view v-if="$route.meta.keepAlive" />
</keep-alive>
<router-view v-if="!$route.meta.keepAlive" />
</div>
</template> </template>
<script> <script>
......
...@@ -13,6 +13,7 @@ export const performance = [ ...@@ -13,6 +13,7 @@ export const performance = [
meta: { meta: {
title: "业绩概览", title: "业绩概览",
showTabBar: true, showTabBar: true,
keepAlive: true,
}, },
}, },
{ {
...@@ -20,7 +21,17 @@ export const performance = [ ...@@ -20,7 +21,17 @@ export const performance = [
name: "supervisorOutlet", name: "supervisorOutlet",
component: () => import("@/views/performance/view/supervisorOutlet/index.vue"), component: () => import("@/views/performance/view/supervisorOutlet/index.vue"),
meta: { meta: {
title: "门店业绩", title: "督导门店",
keepAlive: false,
},
},
{
path: "supervisor-outlet-staff",
name: "supervisorOutletStaff",
component: () => import("@/views/performance/view/supervisorOutletStaff/index.vue"),
meta: {
title: "督导门店驻店",
keepAlive: false,
}, },
}, },
], ],
......
...@@ -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">
<template v-if="list.data && list.data.length">
<StatisticsItem v-for="(item, index) in list.data" <StatisticsItem v-for="(item, index) in list.data"
:key="index" :key="index"
class="statistics-item" class="statistics-item"
:data="item" :data="item"
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList" :schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:title="item.merchantName" :title="item.merchantName"
@tap="handleTapItem"> @tap="handleTapItem(item)">
<template #sub-title="{ data }"> <template #sub-title="{ data }">
<div class="sub-title-wrapper"> <div class="sub-title-wrapper">
<div class="staff-label"> <div class="staff-label">
{{ getStaffLength(data) }}名驻店人员 {{ getStaffLength(data) }}名驻店人员
</div> </div>
<WarnList :list="item.warnList" />
</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">
<template v-if="list.data && list.data.length">
<StatisticsItem v-for="(item, index) in list.data" <StatisticsItem v-for="(item, index) in list.data"
:key="index" :key="index"
class="statistics-item" class="statistics-item"
:data="item" :data="item"
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList" :schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:sub-title="getItemSubTitle(item)" :sub-title="item.merchantName"
:title="item.supervisorName" :title="item.supervisorName"
@tap="handleTapItem" /> @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,
},
];
<template> <template>
<div class="page-container" :style="{ backgroundImage: `url(${pageBgUrl})` }">
<van-pull-refresh v-model="list.loading" <van-pull-refresh v-model="list.loading"
class="pull-refresh-wrapper"
@refresh="handleResetList"> @refresh="handleResetList">
<div class="filter-wrapper"> <div class="filter-wrapper">
<div class="brand-filter"> <div class="brand-filter">
<BrandTabs :list="options.brandTypeList" /> <BrandTabs v-model="list.query.supervisorId"
:list="options.brandTypeList"
@change="getData()" />
</div> </div>
<div class="date-filter"> <div class="date-filter">
<DateSearch show-date-type-filter <DateTypeTabs v-model="list.query.dateType" />
:is-sticky="false" <DatePicker v-model="list.query.date"
:tab-selected="3" style="margin-left:16px"
@search="search"> :type="options.dateType[list.query.dateType]"
</DateSearch> @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 /> <SearchInput v-model="list.query.searchKeyword"
placeholder="搜索门店名称"
@input="throttledFilterSearchKeyword" />
</div> </div>
</div> </div>
<div class="list-wrapper"> <div class="list-wrapper">
<div class="title-wrapper"> <div class="title-wrapper">
督导 - 门店列表 <div>
督导-门店列表
</div>
</div> </div>
<div class="container-wrapper"> <div :key="list.query.statDimension" class="container-wrapper">
<StatisticsItem v-for="(item, index) in 10" <template v-if="list.data && list.data.length">
<StatisticsItem v-for="(item, index) in list.data"
:key="index" :key="index"
class="statistics-item" class="statistics-item"
:schema="options.supervisorSchemaList" :data="item"
@tap="handleTapItem" /> :schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:title="item.merchantName"
@tap="handleTapItem(item)">
<template #sub-title="{ data }">
<div class="sub-title-wrapper">
<div class="staff-label text-hide">
{{ getStaffLength(data) }}名驻店人员
</div> </div>
<WarnList :list="item.warnList" />
</div> </div>
</van-pull-refresh> </template>
</StatisticsItem>
</template>
<template v-else>
<Empty description="暂无门店" />
</template>
</div> </div>
</div>
</van-pull-refresh>
</template> </template>
<script> <script>
import DateSearch from "@/components/dateSearch/dateSearch.vue"; import dayjs from "dayjs";
import { cloneDeep, keyBy, throttle } from "lodash-es";
import { Empty } from "vant";
import { getRegionList } from "@/api/region";
import DatePicker from "@/components/datePicker/index.vue";
import DateTypeTabs from "@/components/dateTypeTabs/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 { getSupervisorStorePerformance } from "@/views/performance/api";
import BrandTabs from "@/views/performance/components/brandTabs/index.vue";
import StatisticsItem from "@/views/performance/components/statisticsItem/statisticsItem.vue"; import StatisticsItem from "@/views/performance/components/statisticsItem/statisticsItem.vue";
import BrandTabs from "../../components/brandTabs/index.vue"; import WarnList from "@/views/performance/components/warnList/index.vue";
import { staticInfoList, storeWarnList } from "@/views/performance/constant/performance";
import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data";
export default { export default {
name: "PerformanceOverview", name: "StorePerformance",
components: { components: {
Empty,
SvgIcon,
BrandTabs, BrandTabs,
DateSearch, DatePicker,
DateTypeTabs,
StaticInfo, StaticInfo,
SearchInput, SearchInput,
StatisticsItem, StatisticsItem,
WarnList,
}, },
data() { data() {
console.log(" keyBy(storeWarnList, \"key\"),", keyBy(storeWarnList, "key"));
return { return {
pageBgUrl: "https://img02.glsx.com.cn/weapp/resource/supervise-wecom/page-bg.png", throttledFilterSearchKeyword: null,
options: { options: {
brandTypeList: [], brandTypeList: [
staticInfoList: [], { key: undefined, label: "" },
supervisorSchemaList: [], ],
storeWarnList: keyBy(storeWarnList, "key"),
staticInfoList,
supervisorSchemaList,
supervisorCommonSchemaList,
regionList: [],
dateType: {
// "date" | "week" | "year-month"
0: "date",
1: "week",
2: "year-month",
},
}, },
list: { list: {
loading: false, loading: false,
statistics: {},
originData: [],
data: [], data: [],
query: {
supervisorId: undefined,
dateType: 0,
statDimension: "1",
searchKeyword: "",
date: {
startDayjs: dayjs(),
},
},
}, },
}; };
}, },
created() {
const { query: _query = "{}", supervisorId, supervisorName } = this.$route.query;
const query = JSON.parse(_query);
this.list.query.supervisorId = supervisorId;
if (query.statDimension) {
this.list.query.statDimension = query.statDimension;
console.log("this.list.query.statDimension", this.list.query.statDimension);
}
const statDimensionLabel = this.list.query.statDimension === "1" ? "问界鸿蒙" : "通用品牌";
this.options.brandTypeList[0].key = supervisorId;
this.options.brandTypeList[0].label = `督导${supervisorName}-${statDimensionLabel}`;
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.throttledFilterSearchKeyword = throttle(() => {
this.list.data = this.filterSearchKeyword();
}, 300);
},
async mounted() {
},
beforeDestroy() {
this.throttledFilterSearchKeyword?.cancel?.();
},
methods: { methods: {
handleTapItem() { getStaffLength(row) {
return row?.staffCount || 0;
},
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 data = await getSupervisorStorePerformance(this.getQuery());
this.$set(this.list, "statistics", data?.statistics || {});
this.list.originData = cloneDeep(data.storeList);
this.list.data = this.afterGetData(data.storeList);
} finally {
this.$loading.hide();
}
},
afterGetData(list) {
return this.filterSearchKeyword();
},
filterSearchKeyword() {
const keyword = (this.list.query.searchKeyword || "").trim();
if (!keyword) {
return this.list.originData;
}
return this.list.originData.filter(item => item?.merchantName?.includes(keyword));
},
handleTapItem(row) {
this.$router.push({ this.$router.push({
name: "supervisorOutlet", name: "supervisorOutletStaff",
query: {
merchantId: row.merchantId,
merchantName: row.merchantName,
supervisorName: this.$route.query.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,
},
}),
},
}); });
}, },
handleResetList() { async handleResetList() {
this.list.loading = true; this.list.loading = true;
await this.getData();
setTimeout(() => {
this.list.loading = false; this.list.loading = false;
}, 3000);
}, },
search() {}, search() {},
}, },
...@@ -87,55 +227,27 @@ export default { ...@@ -87,55 +227,27 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-container { .pull-refresh-wrapper {
height: 100%;
background-position: 0 0;
background-size: 100% 240px;
background-repeat: no-repeat;
background-color: #f2f3f7;
box-sizing: border-box;
overflow: hidden;
::v-deep .van-pull-refresh {
height: 100%; height: 100%;
overflow: auto !important; overflow: auto !important;
box-sizing: border-box; box-sizing: border-box;
} background-color: #f2f3f7;
}
::v-deep .van-tabs { .filter-wrapper {
.van-tab {
flex: none;
font-weight: 500;
line-height: 20px;
margin-left: 16px;
&:first-child {
margin-left: 0;
}
&__text {
}
&--active {
color: var(--themeColor);
}
}
&__wrap {
background-color: transparent;
padding: 0 12px;
}
&__nav {
background-color: transparent;
}
&__line {
bottom: 18px;
width: 18px;
}
}
.filter-wrapper {
padding: 0 12px; padding: 0 12px;
background-color: white;
.brand-filter { .brand-filter {
padding: 6px 0; padding: 6px 0;
} }
.date-filter { .date-filter {
padding: 8px 0; padding: 8px 0;
width: 100%;
display: flex;
align-items: center;
::v-deep .tab-section {
background: #f3f3f4;
}
} }
.static-wrapper { .static-wrapper {
padding: 8px 0; padding: 8px 0;
...@@ -152,8 +264,8 @@ export default { ...@@ -152,8 +264,8 @@ export default {
} }
} }
} }
} }
.list-wrapper { .list-wrapper {
padding: 0 12px 20px; padding: 0 12px 20px;
> .title-wrapper { > .title-wrapper {
...@@ -162,6 +274,11 @@ export default { ...@@ -162,6 +274,11 @@ export default {
line-height: 14px; line-height: 14px;
color: #000000e5; color: #000000e5;
padding: 8px 0; padding: 8px 0;
display: flex;
justify-content: space-between;
> .region {
color: #00000066;
}
} }
.container-wrapper { .container-wrapper {
margin-top: 4px; margin-top: 4px;
...@@ -171,6 +288,18 @@ export default { ...@@ -171,6 +288,18 @@ export default {
margin-top: 0; margin-top: 0;
} }
} }
.sub-title-wrapper {
display: flex;
align-items: center;
.staff-label {
font-weight: 400;
font-size: 12px;
line-height: 20px;
color: #00000066;
}
.warn-wrapper {
margin-left: 8px;
}
} }
} }
} }
......
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!