This commit is contained in:
SunYF
2026-10-26 16:32:35 +08:00
parent 4b14f9540a
commit f86feb2271
99 changed files with 1652 additions and 521 deletions
+15
View File
@@ -17,4 +17,19 @@ export function fmtDateOnly(v) {
const s = String(v)
if (/^\d+$/.test(s)) return fmtTime(Number(s)).slice(0, 10)
return s.slice(0, 10)
}
// 批次友好显示(2026-10-21 批次号收口:批次号退居系统内部编号,选批界面显示
// 「{入库日期}入库 · 可用{数量}件 · {供应商}」;数量=可用量(quantity−lockedQty),与出库/备料校验同口径;
// 同物料同日多批时 nth>1,末尾加「第N批」)
export function friendlyBatchLabel(opt, nth) {
const parts = []
const date = fmtDateOnly(opt.createdAt)
if (date && date !== '-') parts.push(`${date}入库`)
const avail = (Number(opt.quantity) || 0) - (Number(opt.lockedQty) || 0)
parts.push(`可用${avail}件`)
if (opt.supplier) parts.push(opt.supplier)
let label = parts.join(' · ')
if (nth > 1) label += `(第${nth}批)`
return label
}