From d685dd5c538295f4ba4b1776f80334d0cd7d33d8 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Thu, 9 Oct 2025 11:24:39 +0800 Subject: [PATCH] =?UTF-8?q?fix(dms):=E4=BF=AE=E5=A4=8D=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=BB=B4=E4=BF=9D=E6=95=B0=E9=87=8F=E7=BB=9F=E8=AE=A1=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 注释掉旧的维保统计加载函数调用 - 更改维保数量来源为列表接口返回数据 - 修改维保数量计算方式,兼容不同返回结构- 避免因后端统计口径差异导致的数量不准确问题 --- src/views/dms/dmsBillsMaintInstance/index.vue | 2 +- src/views/dms/prodBaseMachineInfo/index.vue | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/views/dms/dmsBillsMaintInstance/index.vue b/src/views/dms/dmsBillsMaintInstance/index.vue index c8c5173..5d2a3bb 100644 --- a/src/views/dms/dmsBillsMaintInstance/index.vue +++ b/src/views/dms/dmsBillsMaintInstance/index.vue @@ -296,7 +296,7 @@ const columns = ref([ { key: 3, label: `流程定义`, visible: false }, { key: 4, label: `保养单号`, visible: true }, { key: 5, label: `保养组别`, visible: true }, - { key: 6, label: `保养负责人`, visible: true }, + { key: 6, label: `保养负责人`, visible: false }, { key: 7, label: `保养级别`, visible: true }, { key: 8, label: `计划保养时间`, visible: true }, { key: 9, label: `实际开始时间`, visible: true }, diff --git a/src/views/dms/prodBaseMachineInfo/index.vue b/src/views/dms/prodBaseMachineInfo/index.vue index aa2c0b5..f065ac7 100644 --- a/src/views/dms/prodBaseMachineInfo/index.vue +++ b/src/views/dms/prodBaseMachineInfo/index.vue @@ -1444,7 +1444,7 @@ const viewDetails = async (machine) => { // 加载详情数据 await Promise.all([ loadTechnicalParams(machine.machineId), - loadMaintenanceStats(machine.machineId), + // loadMaintenanceStats(machine.machineId), loadAlarmList(machine.machineId) ]); }; @@ -1534,7 +1534,7 @@ const loadLifecycleTypes = async () => { purchaseCount, installCount, debuggingCount, - maintCount, // 使用新的后端接口 + maintListRes, // 使用列表接口计算维保数量 faultCount, inspectCount, // 使用新的后端接口 alarmCount @@ -1542,7 +1542,7 @@ const loadLifecycleTypes = async () => { getPurchaseCount({ machineId }).catch(() => ({ data: 0 })), getInstallCount({ machineId }).catch(() => ({ data: 0 })), getDebuggingCount({ machineId }).catch(() => ({ data: 0 })), - countMaintInstancesByMachineId(machineId).catch(() => ({ data: 0 })), + getMaintInstancesByMachineId(machineId).catch(() => ({ data: [], rows: [] })), getFaultInstanceCount({ machineId }).catch(() => ({ data: 0 })), countInspectInstancesByMachineId(machineId).catch(() => ({ data: 0 })), getAlarmInfoCount({ deviceId: machineId }).catch(() => ({ data: 0 })) @@ -1558,7 +1558,8 @@ const loadLifecycleTypes = async () => { type.count = (installCount.data || 0) + (debuggingCount.data || 0); break; case 'maintenance': - type.count = maintCount.data || 0; + // 兼容不同返回结构,使用列表长度作为维保数量,避免后端统计口径差异 + type.count = ((maintListRes?.data ?? maintListRes?.rows) || []).length || 0; break; case 'fault': type.count = faultCount.data || 0;