fix(wms/coil/info): 调整入库天数计算的截止日期逻辑
根据卷料状态切换使用当前时间或出库时间作为计算截止日期
This commit is contained in:
@@ -1249,8 +1249,14 @@ export default {
|
|||||||
const inboundTime = this.getInboundTime();
|
const inboundTime = this.getInboundTime();
|
||||||
if (!inboundTime) return 0;
|
if (!inboundTime) return 0;
|
||||||
const inboundDate = new Date(inboundTime);
|
const inboundDate = new Date(inboundTime);
|
||||||
const today = new Date();
|
let endDate;
|
||||||
const diffTime = today.getTime() - inboundDate.getTime();
|
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));
|
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||||
return Math.max(0, diffDays);
|
return Math.max(0, diffDays);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user