fix(pda): stage sealed pallet scans for atomic batch picking

This commit is contained in:
2026-09-09 12:29:46 +08:00
parent 0745e9600c
commit b19cecb54f
10 changed files with 136 additions and 11 deletions
+5 -1
View File
@@ -61,7 +61,7 @@ export function submitStates(items, states) {
}
export function classifyScan(items, states, scanCode, scannedBoxCodes = {}) {
const item = items.find((entry) => (entry.boxCodes || []).includes(scanCode)) || null
const item = items.find((entry) => isPalletItem(entry) ? entry.palletNo === scanCode : (entry.boxCodes || []).includes(scanCode)) || null
if (!item) return { type: 'unknown', item: null }
if (scannedBoxCodes[scanCode]) return { type: 'processed', item, status: states[item.id] || ITEM_STATUS.PARTIAL }
@@ -70,3 +70,7 @@ export function classifyScan(items, states, scanCode, scannedBoxCodes = {}) {
return { type: 'processed', item, status }
}
export function isPalletItem(item) {
return item?.unitType === 'PALLET' || item?.indivisible === true
}