This commit is contained in:
2026-10-27 17:39:28 +08:00
parent b913a931ff
commit dd64f443cf
12 changed files with 277 additions and 144 deletions
@@ -9,7 +9,8 @@ const escapeHtml = (value: string) => value.replace(/[&<>"']/g, char => ({ '&':
/** Generate labels in memory only. The later order request carries these same identities. */
export function prepareTransferCartonLabels(rows: PrintableCargoRow[], newMark: () => string = () => {
const bytes = crypto.getRandomValues(new Uint8Array(16))
// 采用短箱码,业务前缀保留 BX,SKU/品名等业务信息继续单独打印,避免把业务字段拼进唯一箱码。
const bytes = crypto.getRandomValues(new Uint8Array(6))
return `BX-${Array.from(bytes, byte => byte.toString(16).padStart(2, '0')).join('').toUpperCase()}`
}) {
const total = rows.reduce((sum, row) => sum + Number(row.expectedPackageCount || 0), 0)