fix: localize overseas inventory ledger

This commit is contained in:
2026-09-04 17:46:15 +08:00
parent bc6629d400
commit 39ade43a72
6 changed files with 58 additions and 9 deletions
@@ -22,6 +22,24 @@ const statusLabels: Record<string, string> = {
CANCELLED: '已取消',
}
const inventoryBusinessTypeLabels: Record<string, string> = {
IN_TRANSIT: '在途入账',
STOCK_IN: '入库',
STOCK_IN_TRANSIT_RELEASE: '在途库存转入',
HOLD: '库存暂扣',
RELEASE: '解除暂扣',
ALLOCATE: '库存分配',
UNALLOCATE: '取消分配',
PICK: '拣货',
SHIP: '出库',
ADJUST: '库存调整',
STOCKTAKE_ADJUST: '盘点调整',
PALLET_ASSEMBLE: '组托',
PALLET_DISASSEMBLE: '拆托',
PALLET_SWAP: '换托',
PALLET_UNBIND: '解托',
}
function text(value: unknown) {
const normalized = String(value ?? '').trim()
return normalized || '—'
@@ -45,6 +63,11 @@ export function lastMileOrderTypeLabel(value: unknown) {
return orderTypeLabels[code] || text(code)
}
export function inventoryBusinessTypeLabel(value: unknown) {
const code = String(value ?? '').trim()
return inventoryBusinessTypeLabels[code] || text(code)
}
export function lastMileOrderReference(value: unknown, emptyLabel = '—') {
const serverValue = value == null ? '' : String(value)
return serverValue || emptyLabel