Переглянути джерело

Merge remote-tracking branch 'origin/master'

lipenghui 1 місяць тому
батько
коміт
13dea149c1

+ 4 - 2
src/views/pms/iotmainworkorder/DeviceAlarmBomList.vue

@@ -200,8 +200,9 @@ const handleClose = () => {
 // 计算 距离下次保养运行时长 H
 const calculateTimePeriod = (item: IotMaintenanceBomVO) => {
   if (item.runningTimeRule === 0) {
+    const totalRunVal = item.totalRunTime ?? item.tempTotalRunTime;
     const next = Number(item.nextRunningTime) || 0;
-    const totalRun = Number(item.totalRunTime) || 0;
+    const totalRun = totalRunVal != null ? Number(totalRunVal) : 0;
     const lastRun = Number(item.lastRunningTime) || 0;
     const result = next - (totalRun - lastRun);
     return Number(result.toFixed(2));
@@ -214,8 +215,9 @@ const calculateTimePeriod = (item: IotMaintenanceBomVO) => {
 // 计算 距离下次保养公里数 KM
 const calculateKiloPeriod = (item: IotMaintenanceBomVO) => {
   if (item.mileageRule === 0) {
+    const totalRunVal = item.totalMileage ?? item.tempTotalMileage;
     const next = Number(item.nextRunningKilometers) || 0;
-    const totalRun = Number(item.totalMileage) || 0;
+    const totalRun = totalRunVal != null ? Number(totalRunVal) : 0;
     const lastRun = Number(item.lastRunningKilometers) || 0;
     const result = next - (totalRun - lastRun);
     return Number(result.toFixed(2));