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 @@
"glsx-common": "^2.1.0",
"lib-flexible": "^0.3.2",
"lodash-es": "^4.18.1",
"qs": "^6.15.2",
"sha1": "^1.1.1",
"storejs": "^1.1.0",
"vant": "^2.12.21",
......
......@@ -26,6 +26,9 @@ importers:
lodash-es:
specifier: ^4.18.1
version: 4.18.1
qs:
specifier: ^6.15.2
version: 6.15.2
sha1:
specifier: ^1.1.1
version: 1.1.1
......
......@@ -2,8 +2,8 @@
<div id="app" :class="$route.meta.showTabBar ? 'tab-bar-page' : ''">
<template v-if="showWindow">
<transition name="fade">
<keep-alive v-if="$route.meta.keepAlive">
<router-view></router-view>
<keep-alive>
<router-view v-if="$route.meta.keepAlive"></router-view>
</keep-alive>
</transition>
<transition name="fade">
......@@ -55,10 +55,10 @@ export default {
height: 100%;
overflow: hidden;
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;
}
.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>
......@@ -145,7 +145,7 @@
// @button-primary-background-color: @green;
// @button-primary-border-color: @green;
// @button-info-color: @white;
// @button-info-background-color: @blue;
@button-info-background-color: #2c66f7;
// @button-info-border-color: @blue;
// @button-danger-color: @white;
// @button-danger-background-color: @red;
......@@ -155,7 +155,7 @@
// @button-warning-border-color: @orange;
// @button-border-width: @border-width-base;
// @button-border-radius: @border-radius-sm;
// @button-round-border-radius: @border-radius-max;
@button-round-border-radius: 8px;
// @button-plain-background-color: @white;
// @button-disabled-opacity: @disabled-opacity;
......
<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"
@closed="handleClosed"
@input="updateVisible">
......@@ -50,9 +54,18 @@
</template>
<script>
import { ActionSheet } from "vant";
export default {
name: "RegionPicker",
components: {
[ActionSheet.name]: ActionSheet,
},
props: {
title: {
type: String,
default: "门店区域",
},
value: {
type: [String, Number],
default: "",
......@@ -73,11 +86,11 @@ export default {
},
labelKey: {
type: String,
default: "name",
default: "label",
},
valueKey: {
type: String,
default: "code",
default: "value",
},
},
data() {
......@@ -124,6 +137,8 @@ export default {
visible: {
immediate: true,
handler(val) {
console.log(val);
if (val) {
this.initPanelState();
}
......@@ -152,8 +167,9 @@ export default {
return this.normalizedOptions.find(item => item.value === value) || null;
},
handleSelect(item) {
this.tempValue = item.value;
this.$emit("select", item);
const isSameRegion = this.tempValue === item.value;
this.tempValue = isSameRegion ? "" : item.value;
this.$emit("select", isSameRegion ? null : item);
},
handleCancel() {
this.keyword = "";
......@@ -184,6 +200,16 @@ export default {
</script>
<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 {
display: flex;
flex-direction: column;
......@@ -191,13 +217,15 @@ export default {
background: #ffffff;
&__search {
padding: 12px 12px 0;
::v-deep .van-search {
padding: 12px 16px 4px !important;
}
}
&__list {
flex: 1;
overflow-y: auto;
padding: 8px 12px 16px;
padding: 0px 16px 12px;
}
&__item {
......@@ -231,8 +259,7 @@ export default {
&__footer {
display: flex;
column-gap: 12px;
padding: 12px;
border-top: 1px solid #f2f3f5;
padding: 8px 16px;
}
&__button {
......
......@@ -49,10 +49,6 @@ export default {
<style lang="scss" scoped>
/* van-tabbar-item 默认图标大小比较小,我们稍微调整大一点点确保和设计图相似 */
:deep(.van-tabbar-item__icon img) {
height: 24px;
}
.tab-icon {
height: 20px;
width: 20px;
}
......
<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>
<script>
......
......@@ -13,6 +13,7 @@ export const performance = [
meta: {
title: "业绩概览",
showTabBar: true,
keepAlive: true,
},
},
{
......@@ -20,7 +21,17 @@ export const performance = [
name: "supervisorOutlet",
component: () => import("@/views/performance/view/supervisorOutlet/index.vue"),
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 = {}) {
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 = {}) {
// return api.post("dj.api.supervisor.management.store.performance", data, "supervisorUrl");
// }
......@@ -4,7 +4,8 @@
:key="item.name"
class="col-wrapper van-col-wrapper"
:style="item.colStyle">
<Tooltip :content="item.tips"
<Tooltip v-if="item.tips"
:content="item.tips"
:hide-after="1500"
:options="{
triggers: ['click'],
......@@ -30,6 +31,25 @@
</div>
</div>
</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>
......
......@@ -6,7 +6,7 @@
}"
@click="handleTapItem">
<div class="title-wrapper">
<div class="title-label-wrapper text-hide">
<div class="title-label-wrapper ">
<div class="main-label text-hide">
{{ title }}
</div>
......@@ -30,7 +30,7 @@
</div>
</div>
</slot>
<slot name="title-info-icon">
<slot v-if="beTap" name="title-info-icon">
<van-icon color="#000000E5"
name="arrow"
:size="16" />
......@@ -204,12 +204,13 @@ export default {
overflow: hidden;
.title-label-wrapper {
flex-shrink: 0;
width: calc(50% - 16px);
flex: 1;
font-weight: 500;
font-size: 14px;
line-height: 22px;
color: rgba(0, 0, 0, 0.9);
margin-right: 16px;
overflow: hidden;
.sub-label {
font-weight: 400;
font-size: 10px;
......@@ -218,7 +219,7 @@ export default {
}
}
.title-info-wrapper {
flex: 1;
max-width: calc(50%);
flex-shrink: 0;
display: flex;
align-items: center;
......
......@@ -52,7 +52,7 @@ export const supervisorSchemaList = [
{
name: "displayPeaceOfMindAfterSalesRate",
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,
},
{
......@@ -71,51 +71,22 @@ export const supervisorSchemaList = [
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: "staffCount",
label: "管理驻店",
col: 6,
style: "color: #000000E5;",
special: true,
},
{
name: "totalStoreCount",
label: "辖区门店",
col: 6,
style: "color: #000000E5;",
special: true,
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px",
},
{
name: "yellowStoreCount",
label: "需关注门店",
col: 6,
style: "color: #FF9D0A;",
special: true,
name: "displayDeliveryCount",
label: "交付数",
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px",
},
{
name: "redStoreCount",
label: "预警门店",
col: 6,
style: "color: #F24724;",
special: true,
name: "displayPreSalesTouchCount",
label: "触客数",
colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px",
},
{
name: "displayTouchConversionRate",
label: "触客成交率",
......@@ -144,27 +115,28 @@ export const supervisorCommonSchemaList = [
{
name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交",
colStyle: "width:50%",
style: "margin-bottom: 4px;",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayPeaceOfMindAfterSalesRate",
name: "displayEquityProductAfterSalesRate",
label: "权益商品售后成交/总成交",
colStyle: "width:50%",
style: "margin-bottom: 4px;",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-right:0; margin-bottom:4px",
isMore: true,
},
{
name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交",
colStyle: "width:50%",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)",
colStyle: "width:50%",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
];
......@@ -16,8 +16,8 @@
@change="getData()" />
</div>
<div class="static-wrapper">
<StaticInfo :list="options.staticInfoList" />
<div v-if="[1, 2].includes(list.query.dateType)" class="static-wrapper">
<StaticInfo :data="list.statistics" :list="options.staticInfoList" />
</div>
<div class="search-wrapper">
<SearchInput v-model="list.query.searchKeyword"
......@@ -32,28 +32,42 @@
门店列表
</div>
<div class="region" @click="handleShowRegionPicker">
<span>筛选门店区域</span>
<span>{{ picker.region.label }}</span>
<SvgIcon color="#A2A6B1"
name="triangle-down"
size="16" />
<RegionPicker v-model="list.query.region"
:options="options.regionList"
:visible="picker.region.show"
@cancel="handleCancelRegionPicker"
@confirm="handleChangeRegion" />
</div>
</div>
<div :key="list.query.statDimension" class="container-wrapper">
<StatisticsItem v-for="(item, index) in list.data"
:key="index"
class="statistics-item"
:data="item"
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:title="item.merchantName"
@tap="handleTapItem">
<template #sub-title="{ data }">
<div class="sub-title-wrapper">
<div class="staff-label">
{{ getStaffLength(data) }}名驻店人员
<template v-if="list.data && list.data.length">
<StatisticsItem v-for="(item, index) in list.data"
:key="index"
class="statistics-item"
:data="item"
: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">
{{ getStaffLength(data) }}名驻店人员
</div>
<WarnList :list="item.warnList" />
</div>
</div>
</template>
</StatisticsItem>
</template>
</StatisticsItem>
</template>
<template v-else>
<Empty description="暂无门店" />
</template>
</div>
</div>
</van-pull-refresh>
......@@ -62,14 +76,17 @@
<script>
import dayjs from "dayjs";
import { cloneDeep, 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 RegionPicker from "@/components/regionPicker/index.vue";
import SearchInput from "@/components/searchBar/index.vue";
import StaticInfo from "@/components/staticInfo/index.vue";
import SvgIcon from "@/components/svgIcon/index.vue";
import { getStorePerformance } from "@/views/performance/api";
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 BrandTabs from "../brandTabs/index.vue";
import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data";
......@@ -77,6 +94,7 @@ import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data";
export default {
name: "StorePerformance",
components: {
Empty,
SvgIcon,
BrandTabs,
DatePicker,
......@@ -84,10 +102,18 @@ export default {
StaticInfo,
SearchInput,
StatisticsItem,
RegionPicker,
WarnList,
},
data() {
return {
throttledFilterSearchKeyword: null,
picker: {
region: {
show: false,
label: "筛选门店区域",
},
},
options: {
brandTypeList,
staticInfoList,
......@@ -131,15 +157,33 @@ export default {
this.throttledFilterSearchKeyword?.cancel?.();
},
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() {
const data = await getRegionList({});
console.log(data);
const { districts } = await getRegionList({});
this.options.regionList = districts[0].districts.map(item => ({
label: item.name,
value: item.code,
}));
},
handleShowRegionPicker() {
this.picker.region.show = true;
},
getStaffLength(row) {
return row?.length || 0;
return row?.staffCount || 0;
},
getItemSubTitle(rows) {
return rows?.storeList?.map(i => i.merchantName).join("、");
......@@ -175,11 +219,23 @@ export default {
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({
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() {
......@@ -250,12 +306,17 @@ export default {
}
}
.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;
}
}
}
}
......
......@@ -75,27 +75,29 @@ export const supervisorSchemaList = [
{
name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交",
colStyle: "width:50%",
style: "margin-bottom: 4px;",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交",
colStyle: "width:50%",
style: "margin-bottom: 4px;",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-right:0;margin-bottom:4px ",
isMore: true,
},
{
name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交",
colStyle: "width:50%",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交",
colStyle: "width:50%",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
];
......@@ -175,27 +177,27 @@ export const supervisorCommonSchemaList = [
{
name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交",
colStyle: "width:50%",
style: "margin-bottom: 4px;",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayPeaceOfMindAfterSalesRate",
label: "权益商品售后成交/总成交",
colStyle: "width:50%",
style: "margin-bottom: 4px;",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-right:0; margin-bottom:4px",
isMore: true,
},
{
name: "displayEquityAfterSalesRate",
label: "权益售后成交/总成交",
colStyle: "width:50%",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ",
isMore: true,
},
{
name: "displayEquityAvgUnitPrice",
label: "权益平均客单价(元)",
colStyle: "width:50%",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px",
isMore: true,
},
];
......@@ -29,14 +29,19 @@
督导列表
</div>
<div :key="list.query.statDimension" class="container-wrapper">
<StatisticsItem v-for="(item, index) in list.data"
:key="index"
class="statistics-item"
:data="item"
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:sub-title="getItemSubTitle(item)"
:title="item.supervisorName"
@tap="handleTapItem" />
<template v-if="list.data && list.data.length">
<StatisticsItem v-for="(item, index) in list.data"
:key="index"
class="statistics-item"
:data="item"
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:sub-title="item.merchantName"
:title="item.supervisorName"
@tap="handleTapItem(item)" />
</template>
<template v-else>
<Empty description="暂无督导" />
</template>
</div>
</div>
</van-pull-refresh>
......@@ -45,6 +50,8 @@
<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";
......@@ -61,9 +68,9 @@ export default {
BrandTabs,
DatePicker,
DateTypeTabs,
StaticInfo,
SearchInput,
StatisticsItem,
Empty,
},
data() {
return {
......@@ -142,9 +149,22 @@ export default {
return this.list.originData.filter(item => item?.supervisorName?.includes(keyword));
},
handleTapItem() {
handleTapItem(row) {
this.$router.push({
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() {
......
<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 = [
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 @@
</template>
<script>
import StoreTabItem from "../components/storeTabItem";
import SupervisorTabItem from "../components/supervisorTabItem";
import StoreTabItem from "../components/storeTabItem/index.vue";
import SupervisorTabItem from "../components/supervisorTabItem/index.vue";
export default {
name: "PerformanceOverview",
......@@ -47,11 +47,15 @@ export default {
background-color: #f2f3f7;
box-sizing: border-box;
overflow: hidden;
::v-deep .van-tabs {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
overflow-y: hidden;
box-sizing: border-box;
min-height: 0;
.van-tab {
flex: none;
font-weight: 500;
......@@ -65,21 +69,48 @@ export default {
&--active {
color: var(--themeColor);
}
&__pane-wrapper {
height: 100%;
overflow: hidden;
box-sizing: border-box;
}
&__pane {
height: 100%;
overflow-y: hidden;
box-sizing: border-box;
}
// &__pane-wrapper {
// box-sizing: border-box;
// // height: 100%;
// // overflow: hidden;
// // overflow-y: hidden;
// &:not(&--inactive) {
// }
// }
}
&__wrap {
background-color: transparent;
padding: 0 12px;
box-sizing: border-box;
overflow: hidden;
}
&__content {
flex: 1;
height: 100%;
overflow: hidden;
overflow-y: hidden;
box-sizing: border-box;
flex-shrink: 0;
flex-basis: 0;
}
&__track {
box-sizing: border-box;
}
&__nav {
background-color: transparent;
flex-shrink: 0;
flex-basis: 0;
}
&__line {
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!