feat: support flexible dropship pallet scanning

This commit is contained in:
2026-09-11 12:12:40 +08:00
parent cc94755035
commit de1524a794
3 changed files with 29 additions and 28 deletions
+6 -6
View File
@@ -19,7 +19,7 @@ test('dropship palletization adapter uses only the dedicated production PDA cont
const api = await read('../api/pda-dropship.js')
for (const route of [
'/tasks/pending', '/cartons/resolve', '/cartons/count',
'/pallets/create-and-bind', '/print'
'/pallets/bind-pending', '/seal', '/print'
]) assert.match(api, new RegExp(route.replaceAll('/', '\\/')))
assert.match(api, /apiDownload/)
assert.match(api, /application\\\/pdf/)
@@ -27,14 +27,14 @@ test('dropship palletization adapter uses only the dedicated production PDA cont
assert.match(api, /tasks\/pending\?\$\{params\.join\('&'\)\}/)
assert.match(api, /warehouseId=\$\{encodeURIComponent\(warehouseId\)\}/)
assert.match(api, /operationId\('count'/)
assert.match(api, /operationId\('create-bind'/)
assert.match(api, /operationId\('bind'/)
assert.match(api, /function stableId\(value\)[\s\S]*?String\(value \?\? ''\)\.trim\(\)/)
assert.match(api, /warehouseId: stableId\(warehouseId\)/)
assert.match(api, /warehouseId: stableId\(payload\.warehouseId\)/)
assert.doesNotMatch(api, /customerId|tenantId|inboundId/)
})
test('palletization UI generates and prints the final pallet number only after inbound work is complete', async () => {
test('palletization UI accepts carton and pre-generated pallet scans in either order', async () => {
const [tasks, work] = await Promise.all([
read('../pages/dropship-tasks/dropship-tasks.vue'),
read('../pages/dropship-palletization/dropship-palletization.vue')
@@ -43,15 +43,15 @@ test('palletization UI generates and prints the final pallet number only after i
assert.match(tasks, /\.search-card\s*\{[^}]*display:\s*flex;[^}]*box-shadow:\s*none;/)
assert.match(tasks, /\.task-list\s*\{[^}]*overflow:\s*hidden;[^}]*border-radius:\s*7px;/)
assert.match(tasks, /\.task-card\s*\{[^}]*margin:\s*0;[^}]*border-radius:\s*0;[^}]*box-shadow:\s*none;/)
for (const text of ['一件代发入库', '领取并开始入库', '扫箱清点', '差异说明', '完成入库并生成托盘码', '托盘码与打印', '打印托盘码']) assert.match(work, new RegExp(text))
for (const text of ['一件代发入库', '领取并开始入库', '扫托盘或扫箱', '差异说明', '预生成托盘码', '打印托盘码', '封托']) assert.match(work, new RegExp(text))
for (const text of ['绑定到扫描托盘', '生成 DP 托盘并绑定', '确认封托']) assert.doesNotMatch(work, new RegExp(text))
assert.match(work, /class="task-summary-card"/)
assert.match(work, /\.task-summary-card\s*\{\s*display:\s*block;/)
assert.doesNotMatch(work, /class="summary-card"/)
assert.match(work, /startScanBroadcast/)
assert.match(work, /quantityDiffers[\s\S]*?ACCEPT_VARIANCE/)
assert.match(work, /allCartonsCounted\(\)[\s\S]*?countedCartons[\s\S]*?totalCartons/)
assert.match(work, /pallet\.status !== 'SEALED'/)
assert.match(work, /bindDropshipPendingCartons/)
assert.match(work, /palletNo: this\.currentPallet/)
assert.match(work, /downloadDropshipPalletLabel/)
assert.match(work, /formatApiError/)
assert.doesNotMatch(work, /Number\(this\.warehouseId\)/)