fix(wms/coil/info): 调整入库天数计算的截止日期逻辑

根据卷料状态切换使用当前时间或出库时间作为计算截止日期
This commit is contained in:
2026-05-22 13:07:53 +08:00
parent a9edc8fcf3
commit 80fbe70ab7

View File

@@ -1249,8 +1249,14 @@ export default {
const inboundTime = this.getInboundTime();
if (!inboundTime) return 0;
const inboundDate = new Date(inboundTime);
const today = new Date();
const diffTime = today.getTime() - inboundDate.getTime();
let endDate;
if (this.coilInfo.status == 1) {
endDate = new Date(this.coilInfo.exportTime);
} else {
endDate = new Date();
}
// const today = new Date();
const diffTime = endDate.getTime() - inboundDate.getTime();
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
return Math.max(0, diffDays);
},