fix(dms):修复设备维保数量统计逻辑

- 注释掉旧的维保统计加载函数调用
- 更改维保数量来源为列表接口返回数据
- 修改维保数量计算方式,兼容不同返回结构- 避免因后端统计口径差异导致的数量不准确问题
master
zangch@mesnac.com 2 months ago
parent c72033ca9a
commit d685dd5c53

@ -296,7 +296,7 @@ const columns = ref<FieldOption[]>([
{ 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 },

@ -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;

Loading…
Cancel
Save