提交
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user