From 75cf3db9607aaefd818d89f255bf0e9f52622255 Mon Sep 17 00:00:00 2001
From: zhoulinf <2507241354@qq.com>
Date: Mon, 1 Dec 2025 11:30:32 +0800
Subject: [PATCH] =?UTF-8?q?bugfix=20=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/kpi.js | 10 ++++
src/views/kpi/kpiCaseNew.vue | 89 ++++++++++++++++++++++++++++--------
src/views/kpi/kpiIndex.vue | 39 ++++++++--------
3 files changed, 100 insertions(+), 38 deletions(-)
diff --git a/src/api/kpi.js b/src/api/kpi.js
index 7fb4ed8e..3203c200 100644
--- a/src/api/kpi.js
+++ b/src/api/kpi.js
@@ -83,6 +83,16 @@ export function getDriverName(key) {
});
}
+export function getVehicleName(key) {
+ return request({
+ url: '/supplier/select/vehicle',
+ method: 'GET',
+ params: {
+ key: key ,
+ }
+ });
+}
+
// 车辆 总览
export function vehicleTotalInfo(data) {
return request({
diff --git a/src/views/kpi/kpiCaseNew.vue b/src/views/kpi/kpiCaseNew.vue
index 35dd8e86..f716e556 100644
--- a/src/views/kpi/kpiCaseNew.vue
+++ b/src/views/kpi/kpiCaseNew.vue
@@ -107,6 +107,27 @@
+
+
+
+
+
+
@@ -149,7 +170,8 @@ import {
vehicleTotalInfo,
vehicleInfoBySupplier,
vehicleInfoByVehicle,
- getKpiDetailsData
+ getKpiDetailsData,
+ getVehicleName
} from "@/api/kpi.js"
import {kpiMixins} from "@/utils/kpiMixins"
import {myMixins} from "@/utils/myMixins";
@@ -190,6 +212,7 @@ export default {
selectOption: [],
driverId:'',//68517
driverName:'',
+ vehicleId: '',
driverselectLoading: false,
driverselectOption: [],
leftArr:'<<<',
@@ -304,12 +327,15 @@ export default {
]
}
},
- async getVehicleInfoByVehicle(type) {
+ async getVehicleInfoByVehicle(type, vehicleId) {
let res = await vehicleInfoByVehicle({
startTime: this.startTime,
endTime: this.endTime,
statisticsType: type,
supplierId: this.supplierId,
+ pageNum: this.pageNum,
+ pageSize: this.pageSize,
+ vehicleId
});
this.detailList = res.data?.map(item => {
let formatVal =item.createTime ? dayjs(item.createTime).format('DD') : '';
@@ -346,17 +372,6 @@ export default {
{label: '在线时长', prop: 'onlineDuration'},
]
}
-
- /* this.detailList = res.data?.map(item => {
-
- item.timeoutRate=this.formatPercentage(item.timeoutRate) || 0;
- let formatVal = dayjs(new Date(item.statisticsTime)).format('DD');
- let formatVal1 = dayjs(new Date(item.statisticsTime)).format('MM');
- return {...item, date: formatVal, month: formatVal1 + '月'};
- });*/
-
-
- console.log('rererewrew', res);
},
async getSupplierKpiByOrigin(type) {
let result = await getKpiDetailsData({
@@ -449,6 +464,21 @@ export default {
this.selectOption = [];
}
},
+ async driverremoteMethod(query){
+ if (query !== '') {
+ this.driverselectLoading = true;
+ try {
+ const result = await getVehicleName(query);
+ this.driverselectOption = result.data || []
+ } catch (error) {
+ this.driverselectOption = [];
+ } finally {
+ this.driverselectLoading = false;
+ }
+ } else {
+ this.driverselectOption = [];
+ }
+ },
async selectSupplierNameHandle() { // 下拉切换服务商时调用的接口
if( this.active == 0 ) {
await this.getVehicleTotalInfo();
@@ -462,7 +492,23 @@ export default {
} else if(this.active == 4){
await this.getVehicleInfoByVehicle(1);
} else if(this.active == 5) {
- await this.getVehicleInfoByVehicle(2);
+ if( this.vehicleId ) {
+ await this.getVehicleInfoByVehicle(2, this.vehicleId);
+ } else {
+ this.labelList = [
+ {label: '车辆名称', prop: 'vehicleName'},
+ {label: '日期', prop: 'statisticsTime'},
+ {label: '案件量', prop: 'orderCount'},
+ {label: '完成量', prop: 'finishOrderCount'},
+ {label: '取消量', prop: 'cancelOrderCount'},
+ {label: '取消率', prop: 'cancelRate'},
+ {label: '上游聚合量', prop: 'upMixinCount'},
+ {label: '中道聚合量', prop: 'zdJuheOrderCount'},
+ {label: '传统派工量', prop: 'traditionOrderCount'},
+ {label: '在线时长', prop: 'onlineDuration'},
+ ];
+ this.detailList = [];
+ }
} else if(this.active == 6) {
await this.getSupplierKpiByOrigin(1);
} else if(this.active == 7) {
@@ -544,7 +590,7 @@ export default {
yAxisIndex: 0, // 绑定左Y轴
stack: 'order', // 堆积分组(同组内数据堆积)
data: seriesData['完成量'],
- itemStyle: { color: '#4895ef' }, // 柱状图颜色
+ itemStyle: { color: '#4299e1' }, // 柱状图颜色
label: {
show: true, // 显示数值标签
position: 'insideTop', // 标签位置:柱顶内部
@@ -560,7 +606,7 @@ export default {
yAxisIndex: 0, // 绑定左Y轴
stack: 'order', // 与「线上订单」同堆积组
data: seriesData['取消量'],
- itemStyle: { color: '#38b2ac' }, // 柱状图颜色
+ itemStyle: { color: '#ed8936' }, // 柱状图颜色
label: {
show: true,
position: 'insideTop',
@@ -576,12 +622,12 @@ export default {
data: seriesData['在线率'],
symbol: 'circle', // 标记点形状:圆形
symbolSize: 6, // 标记点大小
- lineStyle: { color: '#e53e3e', width: 2 }, // 线条样式
- itemStyle: { color: '#e53e3e' }, // 标记点颜色
+ lineStyle: { color: '#48bb78', width: 2 }, // 线条样式
+ itemStyle: { color: '#48bb78' }, // 标记点颜色
label: {
show: true, // 显示数值标签
position: 'top', // 标签位置:点上方
- color: '#e53e3e',
+ color: '#48bb78',
fontSize: 10
}
}
@@ -632,6 +678,11 @@ export default {
type: 'pie',
radius: ['75%'], // 增大饼图半径范围
data: charData,
+ color: [
+ '#1890FF', // 中道聚合案件 - 蓝色(ECharts默认主色)
+ '#FAAD14', // 上游聚合案件 - 黄色(ECharts默认辅助色)
+ '#52C41A' // 传统派工案件 - 绿色(ECharts默认成功色)
+ ],
label: {
show: false // 隐藏文本标签[citation:1]
},
diff --git a/src/views/kpi/kpiIndex.vue b/src/views/kpi/kpiIndex.vue
index a4857bb3..d3002c83 100644
--- a/src/views/kpi/kpiIndex.vue
+++ b/src/views/kpi/kpiIndex.vue
@@ -39,7 +39,7 @@
{{ leftArr }}
- >>>
+ >>>