Commit 798ad234 by Jaxon

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

Feature/performance overview

See merge request !14
2 parents 6c753560 ce1517b4
...@@ -53,12 +53,13 @@ export default { ...@@ -53,12 +53,13 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
#app { #app {
height: 100%; height: 100%;
width: 100%;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
padding-bottom: calc(env(safe-area-inset-bottom)); padding-bottom: calc(env(safe-area-inset-bottom));
background-color: transparent; background-color: white;
} }
.tab-bar-page { .tab-bar-page {
padding-bottom: calc(50px + (env(safe-area-inset-bottom))) !important; padding-bottom: calc(46px + (env(safe-area-inset-bottom))) !important;
} }
</style> </style>
@use "./normalize.scss"; @use "./normalize.scss";
@use "./sprite.scss"; @use "./sprite.scss";
html, html,
body #app { body,
#app {
color: #333333; color: #333333;
font-family: Arial, Helvetica, "STHeiti STXihei", "Microsoft YaHei", Tohoma, sans-serif; font-family: Arial, Helvetica, "STHeiti STXihei", "Microsoft YaHei", Tohoma, sans-serif;
background-color: #fff; background-color: #fff;
......
...@@ -224,7 +224,10 @@ export default { ...@@ -224,7 +224,10 @@ export default {
const nextValue = this.normalizeValueByType(this.value, this.type); const nextValue = this.normalizeValueByType(this.value, this.type);
this.applyValueState(nextValue, this.type); this.applyValueState(nextValue, this.type);
if (this.shouldEmitNormalizedValue(this.value, nextValue)) { if (this.shouldEmitNormalizedValue(this.value, nextValue)) {
this.emitValueChange(nextValue); this.emitValueChange(nextValue, {
emitChange: false,
emitSearch: false,
});
} }
}, },
normalizeWeekValue(value) { normalizeWeekValue(value) {
...@@ -371,11 +374,10 @@ export default { ...@@ -371,11 +374,10 @@ export default {
this.rightCurrent = target.isSame(dayjs().startOf("day"), "day"); this.rightCurrent = target.isSame(dayjs().startOf("day"), "day");
this.leftCurrent = target.isSame(dayjs(this.minDate).startOf("day"), "day"); this.leftCurrent = target.isSame(dayjs(this.minDate).startOf("day"), "day");
}, },
getParams() { getParams(value = this.currentValue || this.normalizeValueByType(this.value, this.type)) {
const obj = {}; const obj = {};
const currentValue = this.currentValue || this.normalizeValueByType(this.value, this.type); obj.startDay = value?.startDate || "";
obj.startDay = currentValue?.startDate || ""; obj.endDay = value?.endDate || "";
obj.endDay = currentValue?.endDate || "";
obj.timeDimension = this.timeDimension; obj.timeDimension = this.timeDimension;
return obj; return obj;
}, },
...@@ -394,10 +396,15 @@ export default { ...@@ -394,10 +396,15 @@ export default {
|| !rawDate.isSame(normalizedValue.date, "day"); || !rawDate.isSame(normalizedValue.date, "day");
}, },
emitValueChange(value, extra = {}) { emitValueChange(value, extra = {}) {
const { emitChange = true, emitSearch = true, confirm = false } = extra;
this.$emit("input", value); this.$emit("input", value);
this.$emit("change", value); if (emitChange) {
this.$emit("search", this.getParams()); this.$emit("change", value);
if (extra.confirm) { }
if (emitSearch) {
this.$emit("search", this.getParams(value));
}
if (confirm) {
this.$emit("confirm", value); this.$emit("confirm", value);
} }
}, },
......
...@@ -78,12 +78,12 @@ export default { ...@@ -78,12 +78,12 @@ export default {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
width: 139px; height: 28px;
display: flex; display: flex;
align-items: center; align-items: center;
background: #ffffff; background: #ffffff;
border-radius: 28px; border-radius: 28px;
font-size: 13px; font-size: 12px;
color: #999999; color: #999999;
padding: 2px; padding: 2px;
flex-shrink: 0; flex-shrink: 0;
...@@ -107,11 +107,14 @@ export default { ...@@ -107,11 +107,14 @@ export default {
z-index: 1; z-index: 1;
flex: 1; flex: 1;
text-align: center; text-align: center;
line-height: 26px; font-weight: 500;
font-size: 12px;
height: 24px;
border-radius: 24px; border-radius: 24px;
transition: color 0.25s ease; transition: color 0.25s ease;
flex-shrink: 0; flex-shrink: 0;
box-sizing: border-box;
padding: 4px 0;
&.active { &.active {
color: #2c66f7; color: #2c66f7;
font-weight: 500; font-weight: 500;
......
...@@ -12,3 +12,10 @@ export default { ...@@ -12,3 +12,10 @@ export default {
name: "RouteOutlet", name: "RouteOutlet",
}; };
</script> </script>
<style scoped>
.route-outlet {
box-sizing: border-box;
height: 100%;
}
</style>
...@@ -42,22 +42,23 @@ ...@@ -42,22 +42,23 @@
:data="data" :data="data"
:schema="specialSchema"> :schema="specialSchema">
</SpecialItem> </SpecialItem>
<GridItem :data="data" :schema="defaultSchema"></GridItem> <div class="container-wrapper">
<GridItem :data="data" :schema="defaultSchema"></GridItem>
<div class="container" gutter="4"> <div class="container" gutter="4">
<div v-show="showMoreToggle" span="24"> <div v-show="showMoreToggle" span="24">
<div class="more-collapse" <div class="more-collapse"
:style="{ :style="{
height: expanded ? (`${moreHeight}px`) : '0px', height: expanded ? (`${moreHeight}px`) : '0px',
}"> }">
<div class="more-inner"> <div class="more-inner">
<GridItem :data="data" :schema="moreSchema"></GridItem> <GridItem :data="data" :schema="moreSchema"></GridItem>
</div>
</div> </div>
</div> <!-- 用来记录高度 -->
<!-- 用来记录高度 --> <div class="more-measure">
<div class="more-measure"> <div ref="moreMeasureInner" class="more-inner">
<div ref="moreMeasureInner" class="more-inner"> <GridItem :data="data" :schema="moreSchema"></GridItem>
<GridItem :data="data" :schema="moreSchema"></GridItem> </div>
</div> </div>
</div> </div>
</div> </div>
...@@ -199,13 +200,13 @@ export default { ...@@ -199,13 +200,13 @@ export default {
> .title-wrapper { > .title-wrapper {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 8px; padding: 0 8px 8px;
border-bottom: 1px solid #eeeef0; border-bottom: 1px solid #eeeef0;
overflow: hidden; overflow: hidden;
.title-label-wrapper { .title-label-wrapper {
flex-shrink: 0; flex-shrink: 0;
flex: 1; flex: 1;
font-weight: 500; font-weight: 600;
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);
...@@ -213,8 +214,8 @@ export default { ...@@ -213,8 +214,8 @@ export default {
overflow: hidden; overflow: hidden;
.sub-label { .sub-label {
font-weight: 400; font-weight: 400;
font-size: 10px; font-size: 12px;
line-height: 16px; line-height: 20px;
color: #00000066; color: #00000066;
} }
} }
...@@ -263,11 +264,27 @@ export default { ...@@ -263,11 +264,27 @@ export default {
} }
} }
} }
.container { .container-wrapper {
overflow: hidden;
box-sizing: border-box;
border-radius: 8px; border-radius: 8px;
margin-top: 4px; overflow: hidden;
width: 100%;
> .row-wrapper {
}
.container {
overflow: hidden;
box-sizing: border-box;
margin-top: 4px;
.more-collapse {
::v-deep .col-wrapper {
&:last-child {
border-bottom-right-radius: 8px;
}
&:nth-last-child(2) {
border-bottom-left-radius: 8px;
}
}
}
}
} }
} }
......
...@@ -3,8 +3,7 @@ export const supervisorSchemaList = [ ...@@ -3,8 +3,7 @@ export const supervisorSchemaList = [
{ {
name: "displayTotalOutput", name: "displayTotalOutput",
label: "总产值(万)", label: "总产值(万)",
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px", colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px;border-top-left-radius: 8px",
}, },
{ {
name: "displayDeliveryCount", name: "displayDeliveryCount",
...@@ -14,7 +13,7 @@ export const supervisorSchemaList = [ ...@@ -14,7 +13,7 @@ export const supervisorSchemaList = [
{ {
name: "displayPreSalesTouchCount", name: "displayPreSalesTouchCount",
label: "触客数", label: "触客数",
colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px", colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px;border-top-right-radius: 8px;",
}, },
{ {
...@@ -73,7 +72,7 @@ export const supervisorCommonSchemaList = [ ...@@ -73,7 +72,7 @@ export const supervisorCommonSchemaList = [
{ {
name: "displayTotalOutput", name: "displayTotalOutput",
label: "总产值(万)", label: "总产值(万)",
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px", colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px;border-top-left-radius: 8px",
}, },
{ {
...@@ -84,7 +83,8 @@ export const supervisorCommonSchemaList = [ ...@@ -84,7 +83,8 @@ export const supervisorCommonSchemaList = [
{ {
name: "displayPreSalesTouchCount", name: "displayPreSalesTouchCount",
label: "触客数", label: "触客数",
colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px", colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px;border-top-right-radius: 8px;",
}, },
{ {
...@@ -93,7 +93,7 @@ export const supervisorCommonSchemaList = [ ...@@ -93,7 +93,7 @@ export const supervisorCommonSchemaList = [
colStyle: "flex: 0 auto;", colStyle: "flex: 0 auto;",
}, },
{ {
name: "displayPeaceOfMindRate", name: "displayWarrantyRate",
label: "延保", label: "延保",
colStyle: "flex:1", colStyle: "flex:1",
tips: "延保触客转化率", tips: "延保触客转化率",
......
<template> <template>
<van-pull-refresh v-model="list.loading" <van-pull-refresh v-model="list.refreshing"
class="pull-refresh-wrapper" class="pull-refresh-wrapper"
@refresh="handleResetList"> @refresh="handleResetList">
<div class="filter-wrapper"> <div class="filter-wrapper">
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
@change="getData()" /> @change="getData()" />
</div> </div>
<div class="date-filter"> <div class="date-filter">
<DateTypeTabs v-model="list.query.dateType" /> <DateTypeTabs v-model="list.query.dateType" style="flex:1 auto" />
<DatePicker v-model="list.query.date" <DatePicker v-model="list.query.date"
style="margin-left:16px" style="margin-left:16px"
:type="options.dateType[list.query.dateType]" :type="options.dateType[list.query.dateType]"
@change="getData()" /> @change="handleDatePickerChange" />
</div> </div>
<div v-if="[1, 2].includes(list.query.dateType)" class="static-wrapper"> <div v-if="[1, 2].includes(list.query.dateType)" class="static-wrapper">
...@@ -63,9 +63,15 @@ ...@@ -63,9 +63,15 @@
</div> </div>
</template> </template>
</StatisticsItem> </StatisticsItem>
<div class="last-tips">
到底了~
</div>
</template> </template>
<template v-else> <template v-else>
<Empty description="暂无门店" /> <Empty v-if="list.data.length === 0 && !list.loading && !list.refreshing"
description="暂无数据"
image-size="100"
:image="`${IMG_URL}icon-empty.png`" />
</template> </template>
</div> </div>
...@@ -87,12 +93,12 @@ import SvgIcon from "@/components/svgIcon/index.vue"; ...@@ -87,12 +93,12 @@ 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 WarnList from "@/views/performance/components/warnList/index.vue";
import { brandTypeList, staticInfoList } from "@/views/performance/constant/performance"; import { BASE_IMG_URL, 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";
export default { export default {
name: "StorePerformance", name: "StoreTabItem",
components: { components: {
Empty, Empty,
SvgIcon, SvgIcon,
...@@ -105,9 +111,18 @@ export default { ...@@ -105,9 +111,18 @@ export default {
RegionPicker, RegionPicker,
WarnList, WarnList,
}, },
inject: {
// 自定义内部变量名
getPageActive: {
from: "getPageActive", // 来自 provide 的 key
default: () => true, // 没传时的默认值
},
},
data() { data() {
return { return {
throttledFilterSearchKeyword: null, throttledFilterSearchKeyword: null,
IMG_URL: BASE_IMG_URL,
picker: { picker: {
region: { region: {
show: false, show: false,
...@@ -129,6 +144,7 @@ export default { ...@@ -129,6 +144,7 @@ export default {
}, },
list: { list: {
loading: false, loading: false,
refreshing: false,
statistics: {}, statistics: {},
originData: [], originData: [],
data: [], data: [],
...@@ -157,6 +173,10 @@ export default { ...@@ -157,6 +173,10 @@ export default {
this.throttledFilterSearchKeyword?.cancel?.(); this.throttledFilterSearchKeyword?.cancel?.();
}, },
methods: { methods: {
async handleDatePickerChange(e) {
console.log("e", e);
await this.getData();
},
async handleChangeRegion(row) { async handleChangeRegion(row) {
console.log(row); console.log(row);
if (!row) { if (!row) {
...@@ -197,6 +217,10 @@ export default { ...@@ -197,6 +217,10 @@ export default {
}; };
}, },
async getData() { async getData() {
if (!this.getPageActive()) {
return;
}
this.list.loading = true;
this.$loading.show(); this.$loading.show();
try { try {
this.list.data = []; this.list.data = [];
...@@ -208,6 +232,7 @@ export default { ...@@ -208,6 +232,7 @@ export default {
this.list.data = this.afterGetData(data.storeList); this.list.data = this.afterGetData(data.storeList);
} finally { } finally {
this.$loading.hide(); this.$loading.hide();
this.list.loading = false;
} }
}, },
afterGetData(list) { afterGetData(list) {
...@@ -239,9 +264,12 @@ export default { ...@@ -239,9 +264,12 @@ export default {
}); });
}, },
async handleResetList() { async handleResetList() {
this.list.loading = true; this.list.refreshing = true;
await this.getData(); try {
this.list.loading = false; await this.getData();
} finally {
this.list.refreshing = false;
}
}, },
search() {}, search() {},
}, },
...@@ -249,7 +277,13 @@ export default { ...@@ -249,7 +277,13 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pull-refresh-wrapper { .last-tips {
color: #969799;
font-size: 14px;
line-height: 50px;
text-align: center;
}
.pull-refresh-wrapper {
height: 100%; height: 100%;
overflow: auto !important; overflow: auto !important;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -155,7 +155,7 @@ export const supervisorCommonSchemaList = [ ...@@ -155,7 +155,7 @@ export const supervisorCommonSchemaList = [
colStyle: "flex: 0 auto;", colStyle: "flex: 0 auto;",
}, },
{ {
name: "displayPeaceOfMindRate", name: "displayWarrantyRate",
label: "延保", label: "延保",
colStyle: "flex:1", colStyle: "flex:1",
tips: "延保触客转化率", tips: "延保触客转化率",
...@@ -182,7 +182,7 @@ export const supervisorCommonSchemaList = [ ...@@ -182,7 +182,7 @@ export const supervisorCommonSchemaList = [
isMore: true, isMore: true,
}, },
{ {
name: "displayPeaceOfMindAfterSalesRate", name: "displayEquityProductAfterSalesRate",
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,
......
<template> <template>
<van-pull-refresh v-model="list.loading" <van-pull-refresh v-model="list.refreshing"
class="pull-refresh-wrapper" 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 v-model="list.query.statDimension" <BrandTabs v-model="list.query.statDimension"
:list="options.brandTypeList" :list="options.brandTypeList"
@change="getData()" /> @change="handleBrandTabsChange" />
</div> </div>
<div class="date-filter"> <div class="date-filter">
<DateTypeTabs v-model="list.query.dateType" /> <DateTypeTabs v-model="list.query.dateType" style="flex:1 auto" />
<DatePicker v-model="list.query.date" <DatePicker v-model="list.query.date"
style="margin-left:16px" style="margin-left:16px"
:type="options.dateType[list.query.dateType]" :type="options.dateType[list.query.dateType]"
@change="getData()" /> @change="handleDatePickerChange" />
</div> </div>
<!-- <div class="static-wrapper"> <!-- <div class="static-wrapper">
...@@ -38,9 +38,15 @@ ...@@ -38,9 +38,15 @@
:sub-title="item.merchantName" :sub-title="item.merchantName"
:title="item.supervisorName" :title="item.supervisorName"
@tap="handleTapItem(item)" /> @tap="handleTapItem(item)" />
<div class="last-tips">
到底了~
</div>
</template> </template>
<template v-else> <template v-else>
<Empty description="暂无督导" /> <Empty v-if="list.data.length === 0 && !list.loading && !list.refreshing"
description="暂无数据"
image-size="100"
:image="`${IMG_URL}icon-empty.png`" />
</template> </template>
</div> </div>
</div> </div>
...@@ -58,12 +64,12 @@ import SearchInput from "@/components/searchBar/index.vue"; ...@@ -58,12 +64,12 @@ import SearchInput from "@/components/searchBar/index.vue";
import StaticInfo from "@/components/staticInfo/index.vue"; import StaticInfo from "@/components/staticInfo/index.vue";
import { getSupervisorPerformance } from "@/views/performance/api"; import { getSupervisorPerformance } from "@/views/performance/api";
import StatisticsItem from "@/views/performance/components/statisticsItem/statisticsItem.vue"; import StatisticsItem from "@/views/performance/components/statisticsItem/statisticsItem.vue";
import { brandTypeList, staticInfoList } from "@/views/performance/constant/performance"; import { BASE_IMG_URL, 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";
export default { export default {
name: "PerformanceOverview", name: "SupervisorTabItem",
components: { components: {
BrandTabs, BrandTabs,
DatePicker, DatePicker,
...@@ -72,9 +78,17 @@ export default { ...@@ -72,9 +78,17 @@ export default {
StatisticsItem, StatisticsItem,
Empty, Empty,
}, },
inject: {
// 自定义内部变量名
getPageActive: {
from: "getPageActive", // 来自 provide 的 key
default: () => true, // 没传时的默认值
},
},
data() { data() {
return { return {
throttledFilterSearchKeyword: null, throttledFilterSearchKeyword: null,
IMG_URL: BASE_IMG_URL,
options: { options: {
brandTypeList, brandTypeList,
staticInfoList, staticInfoList,
...@@ -89,6 +103,7 @@ export default { ...@@ -89,6 +103,7 @@ export default {
}, },
list: { list: {
loading: false, loading: false,
refreshing: false,
originData: [], originData: [],
data: [], data: [],
query: { query: {
...@@ -108,6 +123,7 @@ export default { ...@@ -108,6 +123,7 @@ export default {
}, 300); }, 300);
}, },
async mounted() { async mounted() {
await this.getData();
}, },
beforeDestroy() { beforeDestroy() {
this.throttledFilterSearchKeyword?.cancel?.(); this.throttledFilterSearchKeyword?.cancel?.();
...@@ -125,7 +141,10 @@ export default { ...@@ -125,7 +141,10 @@ export default {
}; };
}, },
async getData() { async getData() {
console.log("??"); if (!this.getPageActive()) {
return;
}
this.list.loading = true;
this.$loading.show(); this.$loading.show();
try { try {
this.list.data = []; this.list.data = [];
...@@ -136,6 +155,7 @@ export default { ...@@ -136,6 +155,7 @@ export default {
this.list.data = this.afterGetData(list); this.list.data = this.afterGetData(list);
} finally { } finally {
this.$loading.hide(); this.$loading.hide();
this.list.loading = false;
} }
}, },
afterGetData(list) { afterGetData(list) {
...@@ -149,6 +169,14 @@ export default { ...@@ -149,6 +169,14 @@ export default {
return this.list.originData.filter(item => item?.supervisorName?.includes(keyword)); return this.list.originData.filter(item => item?.supervisorName?.includes(keyword));
}, },
async handleDatePickerChange(e) {
console.log("handleDatePickerChange", e);
await this.getData();
},
async handleBrandTabsChange(e) {
console.log("handleBrandTabsChange", e);
await this.getData();
},
handleTapItem(row) { handleTapItem(row) {
this.$router.push({ this.$router.push({
name: "supervisorOutlet", name: "supervisorOutlet",
...@@ -168,9 +196,12 @@ export default { ...@@ -168,9 +196,12 @@ export default {
}); });
}, },
async handleResetList() { async handleResetList() {
this.list.loading = true; this.list.refreshing = true;
await this.getData(); try {
this.list.loading = false; await this.getData();
} finally {
this.list.refreshing = false;
}
}, },
search() {}, search() {},
}, },
...@@ -178,7 +209,13 @@ export default { ...@@ -178,7 +209,13 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pull-refresh-wrapper { .last-tips {
color: #969799;
font-size: 14px;
line-height: 50px;
text-align: center;
}
.pull-refresh-wrapper {
height: 100%; height: 100%;
overflow: auto !important; overflow: auto !important;
box-sizing: border-box; box-sizing: border-box;
...@@ -212,7 +249,7 @@ export default { ...@@ -212,7 +249,7 @@ export default {
} }
} }
.list-wrapper { .list-wrapper {
padding: 0 12px 20px; padding: 0 12px 0;
> .title-wrapper { > .title-wrapper {
font-weight: 400; font-weight: 400;
......
...@@ -18,6 +18,7 @@ export const brandTypeList = [ ...@@ -18,6 +18,7 @@ export const brandTypeList = [
}, },
}, },
]; ];
export const BASE_IMG_URL = "https://img02.glsx.com.cn/weapp/resource/supervise-wecom/";
export const staticInfoList = [ export const staticInfoList = [
{ {
...@@ -58,6 +59,5 @@ export const storeWarnList = [ ...@@ -58,6 +59,5 @@ export const storeWarnList = [
key: 5, key: 5,
label: "黄色", label: "黄色",
style: "background-color:#FF9D0A;color:white", style: "background-color:#FF9D0A;color:white",
}, },
]; ];
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
<div class="page-container" <div class="page-container"
lazy-render lazy-render
:style="{ backgroundImage: `url(${pageBgUrl})` }"> :style="{ backgroundImage: `url(${pageBgUrl})` }">
<van-tabs animated> <van-tabs v-model="tabs.active"
animated
lazy-render>
<van-tab title="督导业绩"> <van-tab title="督导业绩">
<SupervisorTabItem /> <SupervisorTabItem />
</van-tab> </van-tab>
...@@ -24,11 +26,31 @@ export default { ...@@ -24,11 +26,31 @@ export default {
SupervisorTabItem, SupervisorTabItem,
StoreTabItem, StoreTabItem,
}, },
provide() {
return {
getPageActive: () => {
return this.isPageActive;
},
};
},
data() { data() {
return { return {
isPageActive: false,
tabs: {
active: 0,
},
pageBgUrl: "https://img02.glsx.com.cn/weapp/resource/supervise-wecom/page-bg.png", pageBgUrl: "https://img02.glsx.com.cn/weapp/resource/supervise-wecom/page-bg.png",
}; };
}, },
activated() {
console.log("当前页面激活了 ✅");
this.isPageActive = true;
},
// 页面被隐藏时触发
deactivated() {
console.log("当前页面离开了 ❌");
this.isPageActive = false;
},
created() { created() {
}, },
async mounted() { async mounted() {
...@@ -58,16 +80,23 @@ export default { ...@@ -58,16 +80,23 @@ export default {
min-height: 0; min-height: 0;
.van-tab { .van-tab {
flex: none; flex: none;
font-weight: 500;
line-height: 20px; line-height: 20px;
margin-left: 16px; margin-left: 16px;
font-size: 14px;
font-weight: 600;
transition: font-size 200ms;
&:first-child { &:first-child {
margin-left: 0; margin-left: 0;
} }
&__text { &__text {
color: #333333;
} }
&--active { &--active {
color: var(--themeColor); font-size: 17px !important;
.van-tab__text {
color: var(--themeColor);
}
} }
&__pane-wrapper { &__pane-wrapper {
height: 100%; height: 100%;
......
...@@ -3,7 +3,8 @@ export const supervisorSchemaList = [ ...@@ -3,7 +3,8 @@ export const supervisorSchemaList = [
{ {
name: "displayTotalOutput", name: "displayTotalOutput",
label: "总产值(万)", label: "总产值(万)",
colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px", colStyle: "flex: 1 0 calc((100% - 16px) / 3);margin-bottom:4px;margin-top:8px;border-top-left-radius: 8px",
}, },
{ {
name: "displayDeliveryCount", name: "displayDeliveryCount",
...@@ -13,7 +14,8 @@ export const supervisorSchemaList = [ ...@@ -13,7 +14,8 @@ export const supervisorSchemaList = [
{ {
name: "displayPreSalesTouchCount", name: "displayPreSalesTouchCount",
label: "触客数", label: "触客数",
colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px", colStyle: "flex: 1 0 calc((100%) / 3);margin-right:0;margin-bottom:4px;margin-top:8px;border-top-right-radius: 8px;",
}, },
{ {
...@@ -90,7 +92,7 @@ export const supervisorCommonSchemaList = [ ...@@ -90,7 +92,7 @@ export const supervisorCommonSchemaList = [
colStyle: "flex: 0 auto;", colStyle: "flex: 0 auto;",
}, },
{ {
name: "displayPeaceOfMindRate", name: "displayWarrantyRate",
label: "延保", label: "延保",
colStyle: "flex:1", colStyle: "flex:1",
tips: "延保触客转化率", tips: "延保触客转化率",
...@@ -115,7 +117,7 @@ export const supervisorCommonSchemaList = [ ...@@ -115,7 +117,7 @@ export const supervisorCommonSchemaList = [
isMore: true, isMore: true,
}, },
{ {
name: "displayPeaceOfMindAfterSalesRate", name: "displayEquityProductAfterSalesRate",
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",
......
<template> <template>
<van-pull-refresh v-model="list.loading" <van-pull-refresh v-model="list.refreshing"
class="pull-refresh-wrapper" 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 v-model="list.query.supervisorId" <BrandTabs v-model="list.query.supervisorId"
:list="options.brandTypeList" :list="options.brandTypeList"
@change="getData()" /> @change="handleBrandTabsChange" />
</div> </div>
<div class="date-filter"> <div class="date-filter">
<DateTypeTabs v-model="list.query.dateType" /> <DateTypeTabs v-model="list.query.dateType" style="flex:1 auto" />
<DatePicker v-model="list.query.date" <DatePicker v-model="list.query.date"
style="margin-left:16px" style="margin-left:16px"
:type="options.dateType[list.query.dateType]" :type="options.dateType[list.query.dateType]"
@change="getData()" /> @change="handleDatePickerChange" />
</div> </div>
<div v-if="[1, 2].includes(list.query.dateType)" class="static-wrapper"> <div v-if="[1, 2].includes(list.query.dateType)" class="static-wrapper">
...@@ -50,9 +50,15 @@ ...@@ -50,9 +50,15 @@
</div> </div>
</template> </template>
</StatisticsItem> </StatisticsItem>
<div class="last-tips">
到底了~
</div>
</template> </template>
<template v-else> <template v-else>
<Empty description="暂无门店" /> <Empty v-if="list.data.length === 0 && !list.loading && !list.refreshing"
description="暂无数据"
image-size="100"
:image="`${IMG_URL}icon-empty.png`" />
</template> </template>
</div> </div>
...@@ -74,11 +80,11 @@ import { getSupervisorStorePerformance } from "@/views/performance/api"; ...@@ -74,11 +80,11 @@ import { getSupervisorStorePerformance } from "@/views/performance/api";
import BrandTabs from "@/views/performance/components/brandTabs/index.vue"; 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 WarnList from "@/views/performance/components/warnList/index.vue"; import WarnList from "@/views/performance/components/warnList/index.vue";
import { staticInfoList, storeWarnList } from "@/views/performance/constant/performance"; import { BASE_IMG_URL, staticInfoList, storeWarnList } from "@/views/performance/constant/performance";
import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data"; import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data";
export default { export default {
name: "StorePerformance", name: "SupervisorOutlet",
components: { components: {
Empty, Empty,
SvgIcon, SvgIcon,
...@@ -91,10 +97,9 @@ export default { ...@@ -91,10 +97,9 @@ export default {
WarnList, WarnList,
}, },
data() { data() {
console.log(" keyBy(storeWarnList, \"key\"),", keyBy(storeWarnList, "key"));
return { return {
throttledFilterSearchKeyword: null, throttledFilterSearchKeyword: null,
IMG_URL: BASE_IMG_URL,
options: { options: {
brandTypeList: [ brandTypeList: [
{ key: undefined, label: "" }, { key: undefined, label: "" },
...@@ -113,6 +118,7 @@ export default { ...@@ -113,6 +118,7 @@ export default {
}, },
list: { list: {
loading: false, loading: false,
refreshing: false,
statistics: {}, statistics: {},
originData: [], originData: [],
data: [], data: [],
...@@ -153,7 +159,7 @@ export default { ...@@ -153,7 +159,7 @@ export default {
}, 300); }, 300);
}, },
async mounted() { async mounted() {
await this.getData();
}, },
beforeDestroy() { beforeDestroy() {
this.throttledFilterSearchKeyword?.cancel?.(); this.throttledFilterSearchKeyword?.cancel?.();
...@@ -174,6 +180,7 @@ export default { ...@@ -174,6 +180,7 @@ export default {
}; };
}, },
async getData() { async getData() {
this.list.loading = true;
this.$loading.show({ delay: 0 }); this.$loading.show({ delay: 0 });
try { try {
this.list.data = []; this.list.data = [];
...@@ -185,8 +192,17 @@ export default { ...@@ -185,8 +192,17 @@ export default {
this.list.data = this.afterGetData(data.storeList); this.list.data = this.afterGetData(data.storeList);
} finally { } finally {
this.$loading.hide(); this.$loading.hide();
this.list.loading = false;
} }
}, },
async handleDatePickerChange(e) {
console.log("handleDatePickerChange", e);
await this.getData();
},
async handleBrandTabsChange(e) {
console.log("handleBrandTabsChange", e);
await this.getData();
},
afterGetData(list) { afterGetData(list) {
return this.filterSearchKeyword(); return this.filterSearchKeyword();
}, },
...@@ -217,9 +233,12 @@ export default { ...@@ -217,9 +233,12 @@ export default {
}); });
}, },
async handleResetList() { async handleResetList() {
this.list.loading = true; this.list.refreshing = true;
await this.getData(); try {
this.list.loading = false; await this.getData();
} finally {
this.list.refreshing = false;
}
}, },
search() {}, search() {},
}, },
...@@ -227,7 +246,13 @@ export default { ...@@ -227,7 +246,13 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pull-refresh-wrapper { .last-tips {
color: #969799;
font-size: 14px;
line-height: 50px;
text-align: center;
}
.pull-refresh-wrapper {
height: 100%; height: 100%;
overflow: auto !important; overflow: auto !important;
box-sizing: border-box; box-sizing: border-box;
......
...@@ -21,55 +21,53 @@ export const supervisorSchemaList = [ ...@@ -21,55 +21,53 @@ export const supervisorSchemaList = [
{ {
name: "displayVehicleWarrantyRate", name: "displayVehicleWarrantyRate",
label: "整车延保", label: "整车延保",
colStyle: "flex: 0 auto;margin-top:8px", colStyle: "flex: 0 auto;margin-bottom:4px;margin-top:8px;border-top-left-radius: 8px",
tips: "整车延保触客转化率", tips: "整车延保触客转化率",
}, },
{ {
name: "displayPeaceOfMindRate", name: "displayPeaceOfMindRate",
label: "安心包", label: "安心包",
colStyle: "flex:1;margin-top:8px", colStyle: "flex: 1 1 20%;margin-bottom:4px;margin-top:8px",
tips: "安心包触客转化率", tips: "安心包触客转化率",
}, },
{ {
name: "displayBatteryWarrantyRate", name: "displayBatteryWarrantyRate",
label: "电池", label: "电池",
colStyle: "flex:1;margin-top:8px", colStyle: "flex: 1 1 15%;margin-bottom:4px;margin-top:8px",
tips: "电池延保触客转化率", tips: "电池延保触客转化率",
}, },
{ {
name: "displayTireInsuranceRate", name: "displayTireInsuranceRate",
label: "轮胎", label: "轮胎",
colStyle: "flex:1;margin-top:8px", colStyle: "flex: 1 1 15%;margin-right:0;margin-bottom:4px;margin-top:8px;border-top-right-radius: 8px;",
tips: "轮胎险触客转化率", tips: "轮胎险触客转化率",
}, },
{ {
name: "displayVehicleWarrantyAfterSalesRate", name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交", label: "整车延保售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ", colStyle: "flex: 1 0 calc((100% - 6px) / 2); ",
isMore: true,
}, },
{ {
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% - 6px) / 2); margin-right:0; ",
isMore: true,
}, },
{ {
name: "displayBatteryAfterSalesRate", name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交", label: "电池售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ", colStyle: "flex: 1 0 calc((100% - 6px) / 2); ",
isMore: true, isMore: true,
}, },
{ {
name: "displayTireInsuranceAfterSalesRate", name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交", label: "轮胎售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px", colStyle: "flex: 1 0 calc((100% - 6px) / 2); margin-right:0; ",
isMore: true, isMore: true,
}, },
...@@ -98,41 +96,42 @@ export const supervisorCommonSchemaList = [ ...@@ -98,41 +96,42 @@ export const supervisorCommonSchemaList = [
{ {
name: "displayTouchConversionRate", name: "displayTouchConversionRate",
label: "触客成交率", label: "触客成交率",
colStyle: "flex: 0 auto;margin-top:8px", colStyle: "flex: 0 auto;margin-bottom:4px;margin-top:8px;border-top-left-radius: 8px",
}, },
{ {
name: "displayPeaceOfMindRate", name: "displayWarrantyRate",
label: "延保", label: "延保",
colStyle: "flex:1;margin-top:8px", colStyle: "flex: 1 1 15%;margin-bottom:4px;margin-top:8px",
tips: "延保触客转化率", tips: "延保触客转化率",
}, },
{ {
name: "displayEquityProductRate", name: "displayEquityProductRate",
label: "权益商品", label: "权益商品",
colStyle: "flex:1;margin-top:8px", colStyle: "flex: 1 1 20%;margin-bottom:4px;margin-top:8px",
tips: "权益商品触客转化率", tips: "权益商品触客转化率",
}, },
{ {
name: "displayEquityRate", name: "displayEquityRate",
label: "权益", label: "权益",
colStyle: "flex:1;margin-top:8px", colStyle: "flex: 1 1 15%;margin-right:0;margin-bottom:4px;margin-top:8px;border-top-right-radius: 8px;",
tips: "权益触客转化率", tips: "权益触客转化率",
}, },
{ {
name: "displayWarrantyAfterSalesRate", name: "displayWarrantyAfterSalesRate",
label: "延保售后成交/总成交", label: "延保售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2);margin-bottom:4px ", colStyle: "flex: 1 0 calc((100% - 6px) / 2); ",
isMore: true,
}, },
{ {
name: "displayEquityProductAfterSalesRate", name: "displayEquityProductAfterSalesRate",
label: "权益商品售后成交/总成交", label: "权益商品售后成交/总成交",
colStyle: "flex: 1 0 calc((100% - 8px) / 2); margin-right:0; margin-bottom:4px", colStyle: "flex: 1 0 calc((100% - 6px) / 2); margin-right:0; ",
isMore: true,
}, },
{ {
name: "displayEquityAfterSalesRate", name: "displayEquityAfterSalesRate",
......
<template> <template>
<van-pull-refresh v-model="list.loading" <van-pull-refresh v-model="list.refreshing"
class="pull-refresh-wrapper" 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 v-model="list.query.statDimension" <BrandTabs v-model="list.query.statDimension"
:list="options.brandTypeList" :list="options.brandTypeList"
@change="getData()" /> @change="handleBrandTabsChange" />
</div> </div>
<div class="date-filter"> <div class="date-filter">
<DateTypeTabs v-model="list.query.dateType" /> <DateTypeTabs v-model="list.query.dateType" style="flex:1 auto" />
<DatePicker v-model="list.query.date" <DatePicker v-model="list.query.date"
style="margin-left:16px" style="margin-left:16px"
:type="options.dateType[list.query.dateType]" :type="options.dateType[list.query.dateType]"
@change="getData()" /> @change="handleDatePickerChange" />
</div> </div>
<!-- <div class="static-wrapper"> <!-- <div class="static-wrapper">
...@@ -40,9 +40,15 @@ ...@@ -40,9 +40,15 @@
:schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList" :schema="list.query.statDimension === '1' ? options.supervisorSchemaList : options.supervisorCommonSchemaList"
:sub-title="item.merchantName" :sub-title="item.merchantName"
:title="item.employeeName" /> :title="item.employeeName" />
<div class="last-tips">
到底了~
</div>
</template> </template>
<template v-else> <template v-else>
<Empty description="暂无驻店销售" /> <Empty v-if="list.data.length === 0 && !list.loading && !list.refreshing"
description="暂无数据"
image-size="100"
:image="`${IMG_URL}icon-empty.png`" />
</template> </template>
</div> </div>
...@@ -62,12 +68,12 @@ import StaticInfo from "@/components/staticInfo/index.vue"; ...@@ -62,12 +68,12 @@ import StaticInfo from "@/components/staticInfo/index.vue";
import { getSupervisorStoreStaffPerformance } from "@/views/performance/api"; import { getSupervisorStoreStaffPerformance } from "@/views/performance/api";
import BrandTabs from "@/views/performance/components/brandTabs/index.vue"; 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 { staticInfoList } from "@/views/performance/constant/performance"; import { BASE_IMG_URL, staticInfoList } from "@/views/performance/constant/performance";
import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data"; import { supervisorCommonSchemaList, supervisorSchemaList } from "./index.data";
export default { export default {
name: "PerformanceOverview", name: "SupervisorOutletStaff",
components: { components: {
BrandTabs, BrandTabs,
DatePicker, DatePicker,
...@@ -80,6 +86,7 @@ export default { ...@@ -80,6 +86,7 @@ export default {
data() { data() {
return { return {
throttledFilterSearchKeyword: null, throttledFilterSearchKeyword: null,
IMG_URL: BASE_IMG_URL,
options: { options: {
brandTypeList: [ brandTypeList: [
{ key: undefined, label: "" }, { key: undefined, label: "" },
...@@ -96,6 +103,7 @@ export default { ...@@ -96,6 +103,7 @@ export default {
}, },
list: { list: {
loading: false, loading: false,
refreshing: false,
originData: [], originData: [],
data: [], data: [],
query: { query: {
...@@ -134,12 +142,20 @@ export default { ...@@ -134,12 +142,20 @@ export default {
}, 300); }, 300);
}, },
async mounted() { async mounted() {
await this.getData();
}, },
beforeDestroy() { beforeDestroy() {
this.throttledFilterSearchKeyword?.cancel?.(); this.throttledFilterSearchKeyword?.cancel?.();
}, },
methods: { methods: {
async handleDatePickerChange(e) {
console.log("handleDatePickerChange", e);
await this.getData();
},
async handleBrandTabsChange(e) {
console.log("handleBrandTabsChange", e);
await this.getData();
},
getItemSubTitle(rows) { getItemSubTitle(rows) {
return rows?.storeList?.map(i => i.merchantName).join("、"); return rows?.storeList?.map(i => i.merchantName).join("、");
}, },
...@@ -153,6 +169,8 @@ export default { ...@@ -153,6 +169,8 @@ export default {
}, },
async getData() { async getData() {
this.$loading.show({ delay: 0 }); this.$loading.show({ delay: 0 });
this.list.loading = true;
try { try {
this.list.data = []; this.list.data = [];
this.list.originData = []; this.list.originData = [];
...@@ -162,6 +180,7 @@ export default { ...@@ -162,6 +180,7 @@ export default {
this.list.data = this.afterGetData(list); this.list.data = this.afterGetData(list);
} finally { } finally {
this.$loading.hide(); this.$loading.hide();
this.list.loading = false;
} }
}, },
afterGetData(list) { afterGetData(list) {
...@@ -172,7 +191,6 @@ export default { ...@@ -172,7 +191,6 @@ export default {
if (!keyword) { if (!keyword) {
return this.list.originData; return this.list.originData;
} }
return this.list.originData.filter(item => item?.employeeName?.includes(keyword)); return this.list.originData.filter(item => item?.employeeName?.includes(keyword));
}, },
handleTapItem(row) { handleTapItem(row) {
...@@ -186,9 +204,12 @@ export default { ...@@ -186,9 +204,12 @@ export default {
}); });
}, },
async handleResetList() { async handleResetList() {
this.list.loading = true; this.list.refreshing = true;
await this.getData(); try {
this.list.loading = false; await this.getData();
} finally {
this.list.refreshing = false;
}
}, },
search() {}, search() {},
}, },
...@@ -196,7 +217,13 @@ export default { ...@@ -196,7 +217,13 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pull-refresh-wrapper { .last-tips {
color: #969799;
font-size: 14px;
line-height: 50px;
text-align: center;
}
.pull-refresh-wrapper {
height: 100%; height: 100%;
overflow: auto !important; overflow: auto !important;
box-sizing: border-box; box-sizing: border-box;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!