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