fix(pda): 修复海外作业兼容性并完善扫码与装车收尾

This commit is contained in:
2026-11-06 21:02:54 +08:00
parent fd6c1511ce
commit 31f2ba0c85
14 changed files with 227 additions and 30 deletions
+25
View File
@@ -25,6 +25,31 @@ function page(overrides = {}) {
return { vm, definition, deps }
}
test('carton resolution keeps the selected broadcast target until the operator changes it', async t => {
store.resetReceivingSession()
store.setCurrentReceiving(sessionValue())
const { vm } = page({ resolveCurrentCarton: async cartonMark => ({ cartonMark, inboundCode: 'IN-A', destinationType: 'FBA' }) })
t.after(() => vm.suspendReceiving())
vm.activeTarget = 'carton'
store.receiving.resolvedPallet = { palletCode: 'OLD-PALLET', compatible: true, version: 1 }
await vm.resolveCarton('IN-A#1')
assert.equal(vm.activeTarget, 'carton')
assert.equal(vm.resolvedPallet, null)
assert.equal(store.receiving.resolvedCarton.cartonMark, 'IN-A#1')
vm.activeTarget = 'pallet'
await vm.resolveCarton('IN-A#2')
assert.equal(vm.activeTarget, 'pallet')
})
test('receiving broadcast targets use larger tap areas and show an inactive selection hint', () => {
const operation = readFileSync(new URL('../src/pages/operation/operation.vue', import.meta.url), 'utf8')
const input = readFileSync(new URL('../src/components/ScanTargetInput.vue', import.meta.url), 'utf8')
for (const name of ['carton', 'pallet']) assert.match(operation, new RegExp(`<ScanTargetInput name="${name}"[^>]* large `))
assert.match(input, /@tap="\$emit\('activate', name\)"/)
assert.match(input, /scan-target-input-large \{ height: 64px/)
assert.match(input, /active \? '当前扫码' : '点按选中'/)
})
test('camera resume retains all unsigned uploads by role and clears them across session or identity changes', async () => {
store.resetReceivingSession()
const unsigned = sessionValue({ status: 'WAIT_SIGN', photos: [], domesticLoadingPhotos: [] })