Commit bf335f0e by sunhaiwei

库存账本页面添加到期时间和提前预警天数字段

parent eae30358
...@@ -321,9 +321,15 @@ ...@@ -321,9 +321,15 @@
const timeDiff = dqsjDate.getTime() - now.getTime(); const timeDiff = dqsjDate.getTime() - now.getTime();
const dayDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)); // 向上取整(比如剩余1.2天算2天) const dayDiff = Math.ceil(timeDiff / (1000 * 60 * 60 * 24)); // 向上取整(比如剩余1.2天算2天)
// 5. 判断:天数差 < 提前预警天数 需要预警(变红) // 5. 判断:天数差 < 提前预警天数且数量>0 需要预警(变红)
// 补充:如果到期时间已过(dayDiff < 0),也强制变红 // 补充:如果到期时间已过(dayDiff < 0),也强制变红
return dayDiff < record.tqyjts || dayDiff < 0; let isNeedWarn = false;
if (record.sl && record.sl > 0) {
if (dayDiff < record.tqyjts || dayDiff < 0) {
isNeedWarn = true;
}
}
return isNeedWarn;
} }
function handleSuccess() { function handleSuccess() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment