From f5dc84b3c24d61019cadee7de6fe5a5da11d1c68 Mon Sep 17 00:00:00 2001
From: ouyangxq <775153912@qq.com>
Date: Fri, 23 Oct 2026 18:45:48 +0800
Subject: [PATCH] fix(pda): clarify outbound identifiers and receiving displays
---
src/pages/operation/operation.vue | 13 ++++++-------
src/pages/outbound/outbound.vue | 4 ++--
tests/fulfillment-workflows.test.mjs | 9 +++++++++
3 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/src/pages/operation/operation.vue b/src/pages/operation/operation.vue
index af25943..111e944 100644
--- a/src/pages/operation/operation.vue
+++ b/src/pages/operation/operation.vue
@@ -3,7 +3,7 @@
- {{ pageTitle }}{{ pageSubtitle }}
+ {{ pageTitle }}
正在恢复当前柜作业…
@@ -42,7 +42,7 @@
- 国内装柜照片(只读)现场对照国内装柜过程与封柜状态{{ domesticPhotoCount }} / 5
+ 国内装柜照片(只读){{ domesticPhotoCount }} / 5
@@ -52,7 +52,7 @@
- 卸货签收照片三个固定槽位各拍摄 1 张现场照片{{ uploadedPhotoCount }} / 3
+ 卸货签收照片{{ uploadedPhotoCount }} / 3
@@ -61,7 +61,7 @@
{{ step.label }}{{ photoSlots[index]?.fileId ? '已上传' : '必传' }}
- {{ photoStateLabel(photoSlots[index]) }}
+ {{ photoStateLabel(photoSlots[index]) }}
{{ photoSlots[index].errorMessage || '请重试' }}
@@ -160,8 +160,7 @@
canSubmitReceipt() { if (!this.activeInbound || !this.resolvedPallet?.compatible) return false; if (this.activeInbound.destinationType === 'FBA') { const count = Number(this.packageCount); return Number.isInteger(count) && count > 0 } return Boolean(this.activeInbound.cartonMark) },
allInboundsReconciled() { const values = this.current?.inbounds || []; return values.length > 0 && !this.current?.hasDifference && values.every((item) => Number(item.pendingPackages) === 0) },
canFinishOnsite() { return Boolean(this.current && ['SIGNED', 'RECEIVING'].includes(this.current.status)) },
- pageTitle() { return { candidates: '待卸货集装箱', detail: '柜号详情', sign: '拆柜拍照签收', receive: '当前柜收货', completed: '入库完成' }[this.phase] },
- pageSubtitle() { return { candidates: '选择集装箱后拍摄 3 张照片完成签收', detail: '', sign: '完成现场取证后进入收货', receive: '扫描箱码定位入仓码后开始收货', completed: '' }[this.phase] }
+ pageTitle() { return { candidates: '待卸货集装箱', detail: '柜号详情', sign: '拆柜拍照签收', receive: '当前柜收货', completed: '入库完成' }[this.phase] }
},
onLoad(options) { this.moduleKey = options.module || 'query'; const key = options.op || (this.moduleKey === 'inbound' ? 'receiving' : 'inventoryQuery'); this.operationName = ({ receiving: '拆柜收货', stocktake: '库存盘点', move: '商品移库', pallet: '托盘管理', relabelReceive: '换标列表', relabelExecute: '换标执行', relabelReview: '换标复核', inventoryQuery: '库存查询', locationQuery: '库位查询', palletQuery: '托盘查询' })[key] || '库存查询' },
onShow() { if (!requireSession()) return; this.user = session.currentUser; this._pageActive = true; this.startScanner(); if (this.inboundMode && (!this.bootstrapped || this.phase === 'candidates' || this._resumeReceiving)) { if (!this.busy) { this._resumeReceiving = false; this.bootstrap() } } },
@@ -175,7 +174,7 @@
receivingWarehouseLabel(item) { const code = String(item?.overseasWarehouseCode || '').trim(); const name = String(item?.overseasWarehouseName || '').trim(); return code && name ? `${code} · ${name}` : '—' },
validateReceivingWarehouse(value, label) { return assertReceivingWarehouse(value, this.user, label) },
async refreshBoundWarehouse() { this.user = applyWarehouseProfile(await getCurrentWarehouseProfile()); return this.user },
- photoStateLabel(photo) { if (photo?.status === 'uploading') return '正在上传…'; if (photo?.status === 'error') return photo.errorMessage || (photo.fileId ? '重拍失败,已保留原图' : '上传失败,请重试'); return photo?.fileId ? '点击左侧照片可查看大图' : '请拍摄现场照片' },
+ photoStateLabel(photo) { if (photo?.status === 'uploading') return '正在上传…'; if (photo?.status === 'error') return photo.errorMessage || (photo.fileId ? '重拍失败,已保留原图' : '上传失败,请重试'); return '' },
startScanner() { this.stopScanner(); this._stopScanner = startScanBroadcast({ onScan: (value) => this.handleHardwareScan(value), onError: (error) => { this.error = error; this.showToast('硬件扫码接收器异常,请检查扫描服务', 'warning') } }) }, stopScanner() { if (typeof this._stopScanner === 'function') this._stopScanner(); this._stopScanner = null },
handleHardwareScan(value) { if (!this._pageActive || this.loading) return; const scan = { value: String(value || '').trim(), target: this.activeTarget }; if (!scan.value) return; if (!this.inboundMode) return this.showToast('该功能缺少海外 PDA 专用接口,扫码未提交', 'warning'); if (this.phase === 'candidates') return this.showToast('请直接点击待卸货集装箱进入详情', 'warning'); if (this.phase !== 'receive') return; if (this.busy || this.activeTarget === 'quantity') { if (this.scanQueue.length >= 100) return this.showToast('扫码队列已满,请先处理当前托盘', 'warning'); this.scanQueue.push(scan); return this.showToast(`已排队 ${this.scanQueue.length} 个扫码`, 'warning') } return this.dispatchHardwareScan(scan) },
dispatchHardwareScan(scan) { if (!this._pageActive || this.loading) return; const palletWorkflowActive = Boolean(this.activeInbound || this.resolvedPallet); const target = palletWorkflowActive ? 'pallet' : scan.target; console.info('[Overseas PDA scan] dispatch', { value: scan.value, target, queuedTarget: scan.target }); if (target === 'pallet') { this.palletInput = scan.value; return this.resolvePallet(scan.value) } this.cartonInput = scan.value; return this.resolveCarton(scan.value) },
diff --git a/src/pages/outbound/outbound.vue b/src/pages/outbound/outbound.vue
index 88453dd..0d6189f 100644
--- a/src/pages/outbound/outbound.vue
+++ b/src/pages/outbound/outbound.vue
@@ -16,14 +16,14 @@
待处理出库任务{{ tasks.length }} 个任务
-
+
暂无出库任务可刷新列表,或扫描任务号恢复未完成作业。
废弃订单{{ discardOrderCount }} 个订单
- {{ current.taskNo || '—' }}{{ statusLabel(current.status) }}出库单 {{ current.outboundNo || '—' }} · {{ taskType(current) }}{{ plannedPackages }}计划箱数{{ pickedPackages }}已拣箱数{{ remainingPackages }}待拣箱数
+ {{ current.outboundNo || '—' }}{{ statusLabel(current.status) }}{{ taskType(current) }} · 任务号 {{ current.taskNo || '—' }}{{ plannedPackages }}计划箱数{{ pickedPackages }}已拣箱数{{ remainingPackages }}待拣箱数
diff --git a/tests/fulfillment-workflows.test.mjs b/tests/fulfillment-workflows.test.mjs
index 866bee3..26c9f00 100644
--- a/tests/fulfillment-workflows.test.mjs
+++ b/tests/fulfillment-workflows.test.mjs
@@ -23,6 +23,15 @@ test('dispatch network failures show recovery guidance and retain diagnostics',
const read = (path) => readFile(new URL(path, import.meta.url), 'utf8')
+test('outbound list and detail lead with the outbound number and label the task number separately', async () => {
+ const page = await read('../src/pages/outbound/outbound.vue')
+ assert.match(page, /class="business-code">\{\{ task\.outboundNo \|\| '—' \}\}/)
+ assert.match(page, /class="business-code">\{\{ current\.outboundNo \|\| '—' \}\}/)
+ assert.match(page, /任务号 \{\{ task\.taskNo \|\| '—' \}\}/)
+ assert.match(page, /任务号 \{\{ current\.taskNo \|\| '—' \}\}/)
+ assert.match(page, /@tap="openTask\(task\.taskNo\)"/)
+})
+
test('native dispatch versions preserve explicit zero and reject missing or invalid versions', () => {
assert.equal(requireDispatchVersion(0), 0)
assert.equal(requireDispatchVersion('9007199254740993'), '9007199254740993')