Commit 2a9f87c4 by Jaxon

feat(督导统计): 业务开发

1 parent a7475128
<template>
<div class="row-wrapper">
<div v-for="item in schema"
:key="item.name"
class="col-wrapper van-col-wrapper"
:style="item.colStyle">
<Tooltip :content="item.tips"
:hide-after="1500"
:options="{
triggers: ['click'],
placement: 'top',
autoHide: true,
disabled: !item.tips,
}">
<div 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>
</Tooltip>
</div>
</div>
<!-- <van-row gutter="4">
<van-col v-for="item in schema"
:key="item.name"
class="van-col-wrapper"
:span="item.col">
</van-col>
</van-row> -->
</template>
<script>
import { get } from "lodash-es";
import { Col, Divider, Icon, Row } from "vant";
import SvgIcon from "@/components/svgIcon/index.vue";
import Tooltip from "@/components/tooltip/index.vue";
export default {
name: "",
components: {
[Col.name]: Col,
[Row.name]: Row,
[Divider.name]: Divider,
[Icon.name]: Icon,
SvgIcon,
Tooltip,
},
props: {
schema: {
type: Array,
default: () => ([]),
},
data: {
type: Object,
default: () => ({}),
},
},
data() {
return {
};
},
computed: {
},
mounted() {
},
methods: {
getValue(path) {
return get(this.data, path);
},
},
};
</script>
<style scoped lang="scss">
.row-wrapper {
display: flex;
align-items: center;
}
.van-col-wrapper {
overflow: hidden;
flex-shrink: 0;
margin-right: 4px;
&:last-child {
margin-right: 0;
}
.item-wrapper {
background: #f8f8f8;
padding: 8px 12px;
overflow: hidden;
box-sizing: border-box;
.label {
font-weight: 400;
font-size: 12px;
line-height: 20px;
color: rgba(0, 0, 0, 0.26);
display: flex;
align-items: center;
flex-wrap: nowrap;
flex-shrink: 0;
.icon {
flex-shrink: 0;
}
}
.value {
margin-top: 4px;
font-family: numberNor;
font-weight: 500;
font-size: 16px;
line-height: 20px;
color: var(--themeColor);
flex-shrink: 0;
}
}
}
</style>
<template>
<van-row gutter="4">
<van-col v-for="item in schema"
:key="item.name"
class="van-col-wrapper"
:span="item.col">
<div class="item-wrapper"
:class="{ special: item.special }"
:style="item.style">
<div class="value text-hide ">
{{ getValue(item.name) }}
</div>
<div class="label text-hide ">
{{ item.label }}
</div>
</div>
</van-col>
</van-row>
</template>
<script>
import { get } from "lodash-es";
import { Col, Divider, Icon, Row } from "vant";
export default {
name: "",
components: {
[Col.name]: Col,
[Row.name]: Row,
[Divider.name]: Divider,
[Icon.name]: Icon,
},
props: {
schema: {
type: Array,
default: () => ([]),
},
data: {
type: Object,
default: () => ({}),
},
},
data() {
return {
};
},
computed: {
},
mounted() {
},
methods: {
getValue(path) {
return get(this.data, path);
},
},
};
</script>
<style scoped lang="scss">
.van-col-wrapper {
overflow: hidden;
.item-wrapper {
background: #fff;
padding: 6px 8px;
overflow: hidden;
box-sizing: border-box;
text-align: center;
.label {
font-weight: 400;
font-size: 12px;
line-height: 16px;
color: #00000042;
margin-top: 5px;
}
.value {
font-family: numberBold;
font-weight: 700;
font-style: Bold;
line-height: 20px;
font-size: 20px;
}
}
}
</style>
...@@ -8,22 +8,23 @@ ...@@ -8,22 +8,23 @@
<div class="title-wrapper"> <div class="title-wrapper">
<div class="title-label-wrapper text-hide"> <div class="title-label-wrapper text-hide">
<div class="main-label text-hide"> <div class="main-label text-hide">
張三 {{ title }}
</div> </div>
<div class="sub-label text-hide"> <div v-if="subTitle" class="sub-label text-hide">
北京博福汽车4S店北京博福汽车4S店北京博福汽车4S店北京博福汽车4S店北京博福汽车4S店北京博福汽车4S店 {{ subTitle }}
</div> </div>
</div> </div>
<div class="title-info-wrapper"> <div class="title-info-wrapper">
<slot name="title-info"> <slot name="title-info">
<div v-for="item in titleInfoSchema" <div v-for="item in titleInfoSchema"
:key="item.key" :key="item.key"
class="info-item-wrapper"> class="info-item-wrapper"
@click.stop>
<div class="value"> <div class="value">
77 {{ getValue(item.name) }}
</div> </div>
<div class="label"> <div class="label">
交付数 {{ item.label }}
</div> </div>
</div> </div>
</slot> </slot>
...@@ -34,65 +35,29 @@ ...@@ -34,65 +35,29 @@
</slot> </slot>
</div> </div>
</div> </div>
<van-row class="container" gutter="4"> <SpecialItem style="margin: 8px 0"
<van-col v-for="item in defaultSchema" :data="data"
:key="item.name" :schema="specialSchema">
class="van-col-wrapper" </SpecialItem>
:span="item.col"> <GridItem :data="data" :schema="defaultSchema"></GridItem>
<div class="item-wrapper" :style="item.style"> <div class="container" gutter="4">
<div class="label text-hide "> <div v-show="showMoreToggle" span="24">
{{ item.label }}
</div>
<div class="value text-hide ">
{{ item.name }}
</div>
</div>
</van-col>
<van-col v-if="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">
<van-row gutter="4"> <GridItem :data="data" :schema="moreSchema"></GridItem>
<van-col v-for="item in moreSchema"
:key="item.name"
class="van-col-wrapper"
:span="item.col">
<div class="item-wrapper" :style="item.style">
<div class="label text-hide ">
{{ item.label }}
</div>
<div class="value text-hide ">
{{ item.name }}
</div>
</div>
</van-col>
</van-row>
</div> </div>
</div> </div>
<!-- 用来记录高度 --> <!-- 用来记录高度 -->
<div class="more-measure"> <div class="more-measure">
<div ref="moreMeasureInner" class="more-inner"> <div ref="moreMeasureInner" class="more-inner">
<van-row gutter="4"> <GridItem :data="data" :schema="moreSchema"></GridItem>
<van-col v-for="item in moreSchema"
:key="item.name"
class="van-col-wrapper"
:span="item.col">
<div class="item-wrapper" :style="item.style">
<div class="label text-hide ">
{{ item.label }}
</div>
<div class="value text-hide ">
{{ item.name }}
</div>
</div>
</van-col>
</van-row>
</div> </div>
</div> </div>
</van-col> </div>
</van-row> </div>
<div v-if="showMoreToggle" <div v-if="showMoreToggle"
class="toggle-wrapper" class="toggle-wrapper"
:class="{ 'is-expanded': expanded }" :class="{ 'is-expanded': expanded }"
...@@ -106,7 +71,11 @@ ...@@ -106,7 +71,11 @@
</template> </template>
<script> <script>
import { get } from "lodash-es";
import { Col, Divider, Icon, Row } from "vant"; import { Col, Divider, Icon, Row } from "vant";
import Tooltip from "@/components/tooltip/index.vue";
import GridItem from "./gridItem.vue";
import SpecialItem from "./specialItem.vue";
export default { export default {
name: "", name: "",
...@@ -115,12 +84,26 @@ export default { ...@@ -115,12 +84,26 @@ export default {
[Row.name]: Row, [Row.name]: Row,
[Divider.name]: Divider, [Divider.name]: Divider,
[Icon.name]: Icon, [Icon.name]: Icon,
GridItem,
SpecialItem,
}, },
props: { props: {
title: {
type: String,
default: "",
},
subTitle: {
type: String,
default: "",
},
schema: { schema: {
type: Array, type: Array,
default: () => ([]), default: () => ([]),
}, },
data: {
type: Object,
default: () => ({}),
},
beTap: { beTap: {
type: Boolean, type: Boolean,
default: true, default: true,
...@@ -138,14 +121,17 @@ export default { ...@@ -138,14 +121,17 @@ export default {
}, },
computed: { computed: {
defaultSchema() { defaultSchema() {
return this.schema.filter(item => (!item.isMore && !item.titleInfo)); return this.schema.filter(item => (!item.isMore && !item.titleInfo && !item.special));
}, },
moreSchema() { moreSchema() {
return this.schema.filter(item => item.isMore && !item.titleInfo); return this.schema.filter(item => item.isMore);
}, },
titleInfoSchema() { titleInfoSchema() {
return this.schema.filter(item => item.titleInfo); return this.schema.filter(item => item.titleInfo);
}, },
specialSchema() {
return this.schema.filter(item => (item.special));
},
showMoreToggle() { showMoreToggle() {
return this.hasMore && this.moreSchema.length > 0; return this.hasMore && this.moreSchema.length > 0;
}, },
...@@ -163,6 +149,9 @@ export default { ...@@ -163,6 +149,9 @@ export default {
this.updateMoreHeight(); this.updateMoreHeight();
}, },
methods: { methods: {
getValue(path) {
return get(this.data, path);
},
handleTapItem() { handleTapItem() {
this.$emit("tap"); this.$emit("tap");
}, },
...@@ -176,7 +165,7 @@ export default { ...@@ -176,7 +165,7 @@ export default {
updateMoreHeight() { updateMoreHeight() {
this.$nextTick(() => { this.$nextTick(() => {
const moreMeasureInner = this.$refs.moreMeasureInner; const moreMeasureInner = this.$refs.moreMeasureInner;
this.moreHeight = moreMeasureInner ? moreMeasureInner.clientHeight + 28 : 0; this.moreHeight = moreMeasureInner ? moreMeasureInner.clientHeight + 22 : 0;
}); });
}, },
}, },
...@@ -273,35 +262,10 @@ export default { ...@@ -273,35 +262,10 @@ export default {
overflow: hidden; overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
border-radius: 8px; border-radius: 8px;
margin-top: 8px; margin-top: 4px;
} }
} }
.van-col-wrapper {
overflow: hidden;
.item-wrapper {
background: #f8f8f8;
padding: 8px 12px;
overflow: hidden;
box-sizing: border-box;
.label {
font-weight: 400;
font-size: 12px;
line-height: 20px;
color: rgba(0, 0, 0, 0.26);
}
.value {
margin-top: 4px;
font-family: numberNor;
font-weight: 500;
font-size: 16px;
line-height: 20px;
color: var(--themeColor);
}
}
}
.toggle-wrapper { .toggle-wrapper {
background-image: linear-gradient( background-image: linear-gradient(
to bottom, to bottom,
......
...@@ -2,7 +2,7 @@ export const brandTypeList = [ ...@@ -2,7 +2,7 @@ export const brandTypeList = [
{ {
showIconOnActiveOnly: true, showIconOnActiveOnly: true,
icon: "brand-icon|svg", icon: "brand-icon|svg",
key: "0", key: "1",
label: "问界鸿蒙-延保权益", label: "问界鸿蒙-延保权益",
style: { style: {
backgroundColor: "#fff", backgroundColor: "#fff",
...@@ -11,7 +11,7 @@ export const brandTypeList = [ ...@@ -11,7 +11,7 @@ export const brandTypeList = [
{ {
showIconOnActiveOnly: true, showIconOnActiveOnly: true,
icon: "brand-icon|svg", icon: "brand-icon|svg",
key: "1", key: "2",
label: "通用品牌-延保权益", label: "通用品牌-延保权益",
style: { style: {
backgroundColor: "#fff", backgroundColor: "#fff",
...@@ -40,91 +40,102 @@ export const staticInfoList = [ ...@@ -40,91 +40,102 @@ export const staticInfoList = [
export const supervisorSchemaList = [ export const supervisorSchemaList = [
{ {
name: "brandType", name: "displayDeliveryCount",
label: "交付数", label: "交付数",
col: 8, col: 8,
titleInfo: true, titleInfo: true,
}, },
{ {
name: "brandType2", name: "displayPreSalesTouchCount",
label: "触客数", label: "触客数",
col: 8, col: 8,
titleInfo: true, titleInfo: true,
}, },
{ {
name: "brandType3", name: "displayTotalOutput",
label: "总产值(万)", label: "总产值(万)",
col: 8, col: 8,
titleInfo: true, titleInfo: true,
}, },
{ {
name: "brandType", name: "staffCount",
label: "总产值", label: "管理驻店",
col: 8, col: 6,
style: "margin-bottom: 4px", style: "color: #000000E5;",
special: true,
}, },
{ {
name: "brandType", name: "totalStoreCount",
label: "交付数", label: "辖区门店",
col: 8, col: 6,
style: "margin-bottom: 4px", style: "color: #000000E5;",
special: true,
}, },
{ {
name: "brandType", name: "yellowStoreCount",
label: "触客数", label: "需关注门店",
col: 8, col: 6,
style: "margin-bottom: 4px", style: "color: #FF9D0A;",
special: true,
}, },
{ {
name: "brandType", name: "redStoreCount",
label: "整车延保", label: "预警门店",
col: 6, col: 6,
style: "margin-bottom: 4px", style: "color: #F24724;",
special: true,
},
{
name: "displayVehicleWarrantyRate",
label: "整车延保",
colStyle: "flex: 0 auto;",
tips: "整车延保触客转化率",
}, },
{ {
name: "brandType", name: "displayPeaceOfMindRate",
label: "安心包", label: "安心包",
col: 6, colStyle: "flex:1",
style: "margin-bottom: 4px", tips: "安心包触客转化率",
}, },
{ {
name: "brandType", name: "displayBatteryWarrantyRate",
label: "电池", label: "电池",
col: 6, colStyle: "flex:1",
style: "margin-bottom: 4px", tips: "电池延保触客转化率",
}, },
{ {
name: "brandType", name: "displayTireInsuranceRate",
label: "轮胎", label: "轮胎",
col: 6, colStyle: "flex:1",
style: "margin-bottom: 4px", tips: "轮胎险触客转化率",
}, },
{ {
name: "brandType", name: "displayVehicleWarrantyAfterSalesRate",
label: "整车延保售后成交/总成交", label: "整车延保售后成交/总成交",
col: 12, colStyle: "width:50%",
style: "margin-bottom: 4px;",
isMore: true, isMore: true,
style: "margin-bottom: 4px",
}, },
{ {
name: "brandType", name: "displayPeaceOfMindAfterSalesRate",
label: "安心包售后成交/总成交", label: "安心包售后成交/总成交",
col: 12, colStyle: "width:50%",
style: "margin-bottom: 4px;",
isMore: true, isMore: true,
style: "margin-bottom: 4px",
}, },
{ {
name: "brandType", name: "displayBatteryAfterSalesRate",
label: "电池售后成交/总成交", label: "电池售后成交/总成交",
col: 12, colStyle: "width:50%",
isMore: true, isMore: true,
}, },
{ {
name: "brandType", name: "displayTireInsuranceAfterSalesRate",
label: "轮胎售后成交/总成交", label: "轮胎售后成交/总成交",
col: 12, colStyle: "width:50%",
isMore: true, isMore: true,
}, },
]; ];
...@@ -8,20 +8,20 @@ ...@@ -8,20 +8,20 @@
</van-tabs> </van-tabs>
<div class="filter-wrapper"> <div class="filter-wrapper">
<div class="brand-filter"> <div class="brand-filter">
<BrandTabs :list="options.brandTypeList" /> <BrandTabs v-model="list.query.statDimension" :list="options.brandTypeList" />
</div> </div>
<div class="date-filter"> <div class="date-filter">
<DateSearch show-date-type-filter <DateTypeTabs v-model="list.query.dateType" />
:is-sticky="false" <DatePicker v-model="list.query.date"
:tab-selected="3" style="margin-left:16px"
@search="search"> :type="options.dateType[list.query.dateType]" />
</DateSearch>
</div> </div>
<div class="static-wrapper"> <!-- <div class="static-wrapper">
<StaticInfo :list="options.staticInfoList" /> <StaticInfo :list="options.staticInfoList" />
</div> </div> -->
<div class="search-wrapper"> <div class="search-wrapper">
<SearchInput /> <SearchInput v-model="list.query.searchKeyword" />
</div> </div>
</div> </div>
...@@ -30,10 +30,13 @@ ...@@ -30,10 +30,13 @@
督导列表 督导列表
</div> </div>
<div class="container-wrapper"> <div class="container-wrapper">
<StatisticsItem v-for="(item, index) in 10" <StatisticsItem v-for="(item, index) in list.data"
:key="index" :key="index"
class="statistics-item" class="statistics-item"
:data="item"
:schema="options.supervisorSchemaList" :schema="options.supervisorSchemaList"
:sub-title="getItemSubTitle(item)"
:title="item.supervisorName"
@tap="handleTapItem" /> @tap="handleTapItem" />
</div> </div>
</div> </div>
...@@ -43,7 +46,10 @@ ...@@ -43,7 +46,10 @@
</template> </template>
<script> <script>
import DateSearch from "@/components/dateSearch/dateSearch.vue"; import dayjs from "dayjs";
import { cloneDeep, get } from "lodash-es";
import DatePicker from "@/components/datePicker/index.vue";
import DateTypeTabs from "@/components/dateTypeTabs/index.vue";
import SearchInput from "@/components/searchBar/index.vue"; import SearchInput from "@/components/searchBar/index.vue";
import StaticInfo from "@/components/staticInfo/index.vue"; import StaticInfo from "@/components/staticInfo/index.vue";
import { getSupervisorPerformance } from "@/views/performance/api"; import { getSupervisorPerformance } from "@/views/performance/api";
...@@ -55,7 +61,8 @@ export default { ...@@ -55,7 +61,8 @@ export default {
name: "PerformanceOverview", name: "PerformanceOverview",
components: { components: {
BrandTabs, BrandTabs,
DateSearch, DatePicker,
DateTypeTabs,
StaticInfo, StaticInfo,
SearchInput, SearchInput,
StatisticsItem, StatisticsItem,
...@@ -67,10 +74,24 @@ export default { ...@@ -67,10 +74,24 @@ export default {
brandTypeList, brandTypeList,
staticInfoList, staticInfoList,
supervisorSchemaList, supervisorSchemaList,
dateType: {
// "date" | "week" | "year-month"
0: "date",
1: "week",
2: "year-month",
},
}, },
list: { list: {
loading: false, loading: false,
data: [], data: [],
query: {
dateType: 0,
statDimension: 1,
searchKeyword: "",
date: {
startDayjs: dayjs(),
},
},
}, },
}; };
}, },
...@@ -78,20 +99,38 @@ export default { ...@@ -78,20 +99,38 @@ export default {
await this.getData(); await this.getData();
}, },
methods: { methods: {
log() {
console.log("this.list.query", this.list.query);
},
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() { async getData() {
await getSupervisorPerformance(); this.list.data = await getSupervisorPerformance(this.getQuery());
},
afterGetData() {
},
filterSearchKeyword(list) {
}, },
handleTapItem() { handleTapItem() {
this.$router.push({ this.$router.push({
name: "supervisorOutlet", name: "supervisorOutlet",
}); });
}, },
handleResetList() { async handleResetList() {
this.list.loading = true; this.list.loading = true;
await this.getData();
setTimeout(() => { this.list.loading = false;
this.list.loading = false;
}, 3000);
}, },
search() {}, search() {},
}, },
...@@ -148,6 +187,9 @@ export default { ...@@ -148,6 +187,9 @@ export default {
} }
.date-filter { .date-filter {
padding: 8px 0; padding: 8px 0;
width: 100%;
display: flex;
align-items: center;
} }
.static-wrapper { .static-wrapper {
padding: 8px 0; padding: 8px 0;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!