|
@@ -216,9 +216,12 @@ const calculateTimePeriod = (item: IotMaintenanceBomVO) => {
|
|
|
const next = Number(item.nextRunningTime) || 0;
|
|
|
const totalRun = Number(item.totalRunTime) || 0;
|
|
|
const lastRun = Number(item.lastRunningTime) || 0;
|
|
|
- return next - (totalRun - lastRun);
|
|
|
+ const result = next - (totalRun - lastRun);
|
|
|
+ return Number(result.toFixed(2));
|
|
|
}
|
|
|
- return item.timePeriod; // 保持原始值
|
|
|
+ return typeof item.timePeriod === 'number'
|
|
|
+ ? Number(item.timePeriod.toFixed(2))
|
|
|
+ : item.timePeriod;
|
|
|
};
|
|
|
|
|
|
// 计算 距离下次保养公里数 KM
|
|
@@ -227,9 +230,12 @@ const calculateKiloPeriod = (item: IotMaintenanceBomVO) => {
|
|
|
const next = Number(item.nextRunningKilometers) || 0;
|
|
|
const totalRun = Number(item.totalMileage) || 0;
|
|
|
const lastRun = Number(item.lastRunningKilometers) || 0;
|
|
|
- return next - (totalRun - lastRun);
|
|
|
+ const result = next - (totalRun - lastRun);
|
|
|
+ return Number(result.toFixed(2));
|
|
|
}
|
|
|
- return item.kilometerCycle; // 保持原始值
|
|
|
+ return typeof item.kilometerCycle === 'number'
|
|
|
+ ? Number(item.kilometerCycle.toFixed(2))
|
|
|
+ : item.kilometerCycle;
|
|
|
};
|
|
|
|
|
|
// 计算下次保养日期
|