task#14196,数据显示优化

This commit is contained in:
2024-07-08 14:24:31 +08:00
parent 39603134fb
commit 4be4015e30

View File

@ -2,7 +2,7 @@
<div class="wrap"> <div class="wrap">
<div v-if="isMobile" class="headWrap"> <div v-if="isMobile" class="headWrap">
<div class="title">KPI.数据看板</div> <div class="title">KPI.数据看板</div>
<div class="titleName">{{ current }}-{{indexData && indexData.supplierName}}</div> <div class="titleName">{{ current }}-{{supplierName}}</div>
</div> </div>
<div v-else class="webHeadWrap" :style="'justify-content:'+(isZd==1 ? 'space-between':'center')"> <div v-else class="webHeadWrap" :style="'justify-content:'+(isZd==1 ? 'space-between':'center')">
<div class="empty" v-if="isZd==1"></div> <div class="empty" v-if="isZd==1"></div>
@ -156,6 +156,16 @@
<div :class="{'comTab':true}"> <div :class="{'comTab':true}">
<noFit-table :is-mobile='isMobile' :table-data="detailList" :label-list="labelList"></noFit-table> <noFit-table :is-mobile='isMobile' :table-data="detailList" :label-list="labelList"></noFit-table>
</div> </div>
<!-- <el-pagination
v-if="active !== 2"
small
:current-page.sync="pageNum"
:page-size.sync="pageSize"
@current-change="getKpiData"
@size-change="getKpiData"
layout="prev, pager, next"
:total="total">
</el-pagination>-->
</div> </div>
<div v-loading="loadingData" class="contentWrap monthTotal" v-if="[5,6,7,8,9].includes(active)"> <div v-loading="loadingData" class="contentWrap monthTotal" v-if="[5,6,7,8,9].includes(active)">
<div :class="{'comTab':true,'detailTable':isMobile}"> <div :class="{'comTab':true,'detailTable':isMobile}">
@ -223,6 +233,7 @@ export default {
isMobile: false, isMobile: false,
isZd: '', isZd: '',
current: dayjs(new Date()).format('M'), current: dayjs(new Date()).format('M'),
supplierName:'',
value: '1', value: '1',
options: [ options: [
{value: '1', label: '师傅接单时效'}, {value: '1', label: '师傅接单时效'},
@ -232,9 +243,10 @@ export default {
pageSize: 10, pageSize: 10,
total: 0, total: 0,
swithVal: true, swithVal: true,
supplierId:'', supplierId:'',//1128
selectLoading: false, selectLoading: false,
selectOption: [], selectOption: [],
driverId:'',//68517
} }
}, },
async mounted() { async mounted() {
@ -727,6 +739,7 @@ export default {
supplierId: this.supplierId, supplierId: this.supplierId,
}); });
this.indexData = res.data; this.indexData = res.data;
this.supplierName=res.data?.supplierName
} else if ([1, 2].includes(this.active)) { } else if ([1, 2].includes(this.active)) {
let res = await getStatisticsKpi({ let res = await getStatisticsKpi({
startTime: this.active === 1 ? this.startMonthTime : this.startTime, startTime: this.active === 1 ? this.startMonthTime : this.startTime,
@ -736,20 +749,23 @@ export default {
}) })
this.detailList = res.data?.map(item => { this.detailList = res.data?.map(item => {
let formatVal = dayjs(item.statisticsDate).format('DD'); let formatVal = dayjs(item.statisticsDate).format('DD');
let formatVal1 = dayjs(item.statisticsDate).format('MM'); let formatVal1 = dayjs(item.statisticsDate).format('M');
return {...item, date: formatVal, month: formatVal1}; return {...item, date: formatVal, month: (formatVal1 == this.current) ? '本月' : (formatVal1 + '月')};
}); });
this.loading = false this.loading = false
this.detailList?.map(item => { this.detailList?.map(item => {
this.xAxisArr.unshift(item.month) this.xAxisArr.push(item.month)
}) })
this.xAxisArr[this.xAxisArr.length - 1] = '本月'
await this.twoTabHanldeData() await this.twoTabHanldeData()
} else if ([3, 4].includes(this.active)) { } else if ([3, 4].includes(this.active)) {
let res = await getDriverStatisticsKpi({ let res = await getDriverStatisticsKpi({
startTime: this.startTime , startTime: this.startTime ,
endTime: this.endTime, endTime: this.endTime,
statisticsType: this.active === 3 ? 1 : 2, statisticsType: this.active === 3 ? 1 : 2,
driverId: 68517, driverId: this.driverId,
/* pageNum: this.pageNum,
pageSize: this.pageSize*/
}) })
this.detailList = res.data this.detailList = res.data
this.loading = false; this.loading = false;
@ -879,10 +895,10 @@ export default {
if (this.active === 1) { if (this.active === 1) {
if (this.activeIndex === 0) {//接单指标 if (this.activeIndex === 0) {//接单指标
this.detailList?.map(item => { this.detailList?.map(item => {
this.v1.unshift(item.dispatchOrderCount) this.v1.push(item.dispatchOrderCount)
this.v2.unshift(item.refuseOrderRate) this.v2.push(item.refuseOrderRate)
this.v3.unshift(item.timeoutOrderRate) this.v3.push(item.timeoutOrderRate)
this.v4.unshift(item.cancelrate) this.v4.push(item.cancelrate)
}) })
this.labelList = [ this.labelList = [
{label: '月', prop: 'month'}, {label: '月', prop: 'month'},
@ -897,9 +913,9 @@ export default {
] ]
} else if (this.activeIndex === 1) { } else if (this.activeIndex === 1) {
this.detailList?.map(item => { this.detailList?.map(item => {
this.v1.unshift(item.customerEvaluateRate) this.v1.push(item.customerEvaluateRate)
this.v2.unshift(item.customerSatisfaction) this.v2.push(item.customerSatisfaction)
this.v3.unshift(item.complainOrderRate) this.v3.push(item.complainOrderRate)
}) })
this.labelList = [ this.labelList = [
{label: '月', prop: 'month'}, {label: '月', prop: 'month'},
@ -910,12 +926,12 @@ export default {
] ]
} else if (this.activeIndex === 2) { } else if (this.activeIndex === 2) {
this.detailList?.map(item => { this.detailList?.map(item => {
this.v1.unshift(item.appRate) this.v1.push(item.appRate)
this.v2.unshift(item.threeMinutesContactRate) this.v2.push(item.threeMinutesContactRate)
this.v3.unshift(item.pinganPolymerizationSuccessRate) this.v3.push(item.pinganPolymerizationSuccessRate)
this.v4.unshift(item.zhonghuaPolymerizationSuccessRate) this.v4.push(item.zhonghuaPolymerizationSuccessRate)
this.v5.unshift(item.zdPolymerizationSuccessRate) this.v5.push(item.zdPolymerizationSuccessRate)
this.v6.unshift(item.polymerizationSuccessRate) this.v6.push(item.polymerizationSuccessRate)
}) })
this.labelList = [ this.labelList = [
{label: '月', prop: 'month'}, {label: '月', prop: 'month'},
@ -930,32 +946,32 @@ export default {
if (this.isMobile) { if (this.isMobile) {
if (this.value == 1) { if (this.value == 1) {
this.detailList?.map(item => { this.detailList?.map(item => {
this.v1.unshift(item.receiving) this.v1.push(item.receiving)
this.v2.unshift(item.threeMinutesReceivingRate) this.v2.push(item.threeMinutesReceivingRate)
}) })
} else { } else {
this.detailList?.map(item => { this.detailList?.map(item => {
this.v1.unshift(item.arriving) this.v1.push(item.arriving)
this.v2.unshift(item.polymerizationSuccessArriving) this.v2.push(item.polymerizationSuccessArriving)
this.v3.unshift(item.fortyMinutesArrivalRate) this.v3.push(item.fortyMinutesArrivalRate)
}) })
} }
} else { } else {
this.detailList?.map(item => { this.detailList?.map(item => {
this.v1.unshift(item.receiving) this.v1.push(item.receiving)
this.v2.unshift(item.threeMinutesReceivingRate) this.v2.push(item.threeMinutesReceivingRate)
}) })
if (this.swithVal) { if (this.swithVal) {
this.detailList?.map(item => { this.detailList?.map(item => {
this.v3.unshift(item.trailArriving) this.v3.push(item.trailArriving)
this.v4.unshift(item.trailPolymerizationSuccessArriving) this.v4.push(item.trailPolymerizationSuccessArriving)
this.v5.unshift(item.trailFortyMinutesArrivalRate) this.v5.push(item.trailFortyMinutesArrivalRate)
}) })
} else { } else {
this.detailList?.map(item => { this.detailList?.map(item => {
this.v3.unshift(item.minorArriving) this.v3.push(item.minorArriving)
this.v4.unshift(item.minorPolymerizationSuccessArriving) this.v4.push(item.minorPolymerizationSuccessArriving)
this.v5.unshift(item.minorFortyMinutesArrivalRate) this.v5.push(item.minorFortyMinutesArrivalRate)
}) })
} }
} }