From 257e58c024775f2e1523d2e1cb40d882c91c1920 Mon Sep 17 00:00:00 2001 From: liuyihe <2513762445@qq.com> Date: Thu, 24 Sep 2026 11:38:51 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouse-transfer/warehouse-transfer.vue | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/pages/warehouse-transfer/warehouse-transfer.vue b/src/pages/warehouse-transfer/warehouse-transfer.vue index f8afaad..a205dbe 100644 --- a/src/pages/warehouse-transfer/warehouse-transfer.vue +++ b/src/pages/warehouse-transfer/warehouse-transfer.vue @@ -126,7 +126,7 @@ export default { watch: { pallets: { deep: true, handler() { if (!this.submitting) this.pendingKey = '' } } }, - onShow() { if (requireSession()) { this.user = session.currentUser; restoreWarehouseWork(`${this.user.id}:${this.user.warehouseId}`); this.startScanner(); this.loadCandidates().then(() => { const activeNo = String(warehouseWork.warehouseTransfer.currentNo || ''); const taskNo = this.pendingTaskNo || activeNo; if (this.entryMode === 'work' && taskNo) { const active = this.candidates.find((item) => String(item.transferNo) === taskNo); if (active) { this.pendingTaskNo = ''; void this.select(active) } } }) } }, + onShow() { if (requireSession()) { this.user = session.currentUser; restoreWarehouseWork(`${this.user.id}:${this.user.warehouseId}`); this.startScanner(); this.loadCandidates().then(() => { const activeNo = String(warehouseWork.warehouseTransfer.currentNo || ''); const taskNo = this.pendingTaskNo || activeNo; if (this.entryMode === 'work' && taskNo) { const active = this.candidates.find((item) => String(item.transferNo) === taskNo); if (active) { const fromExplicitTask = Boolean(this.pendingTaskNo); this.pendingTaskNo = ''; void this.select(active, fromExplicitTask) } } }) } }, onLoad(options) { this.entryMode = options?.mode === 'list' ? 'list' : 'work'; this.pendingTaskNo = String(options?.task || '') }, onHide() { this.stopScanner() }, beforeUnmount() { this.stopScanner() }, @@ -163,12 +163,24 @@ export default { catch (error) { this.error = error; pallet.busy = false } }, async printDraftPallet(pallet) { if (!pallet.labelDownloadPath) { this.error = new Error('服务端未返回托盘标签下载地址'); return }; await this.openLabelPdf(() => downloadWarehouseTransferPalletLabel(pallet.labelDownloadPath)) }, - async loadCandidates() { this.loading = true; this.error = null; try { const activeNo = String(warehouseWork.warehouseTransfer.currentNo || ''); this.candidates = (await listWarehouseTransferCandidates()).map((item) => String(item.transferNo) === activeNo && item.status === 'WAIT_PDA_RECEIVING' ? { ...item, status: 'PARTIALLY_RECEIVED' } : item) } catch (e) { this.error = e } finally { this.loading = false } }, - async select(item) { + async loadCandidates() { + this.loading = true; this.error = null + try { + const activeNo = String(warehouseWork.warehouseTransfer.currentNo || '') + const measuredStatuses = new Set(['WAIT_PDA_RECEIVING', 'APPROVED', 'ALLOCATED', 'PARTIALLY_RECEIVED']) + this.candidates = (await listWarehouseTransferCandidates()).map((item) => String(item.transferNo) === activeNo && item.status === 'WAIT_PDA_RECEIVING' ? { ...item, status: 'PARTIALLY_RECEIVED' } : item) + // 服务端已完成当前单但设备在提交响应前断网时,本地 currentNo 会遗留。 + // 候选已成功读取且当前单不再可测,清掉本地锁,允许继续下一票。 + if (activeNo && !this.candidates.some((item) => String(item.transferNo) === activeNo && measuredStatuses.has(String(item.status)))) { + resetWarehouseDomain('warehouseTransfer') + } + } catch (e) { this.error = e } finally { this.loading = false } + }, + async select(item, fromExplicitTask = false) { if (this.detailLoading || this.submitting) return const requestedNo = String(item?.transferNo || '') const activeNo = String(warehouseWork.warehouseTransfer.currentNo || '') - if (!activeNo) { + if (!activeNo && !fromExplicitTask) { const result = await new Promise((resolve) => uni.showModal({ title: '开始测量', content: `确认开始测量转运单 ${requestedNo} 吗?开始后本设备需先完成该单,才能选择下一单。`, confirmText: '确认开始', cancelText: '取消', success: resolve, fail: () => resolve({ confirm: false }) })) if (!result.confirm) return } -- 2.54.0 From c4b1d281dca51b5d5162d744e88fe63f79c56620 Mon Sep 17 00:00:00 2001 From: liuyihe <2513762445@qq.com> Date: Thu, 24 Sep 2026 12:06:44 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/warehouse-transfer/warehouse-transfer.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/warehouse-transfer/warehouse-transfer.vue b/src/pages/warehouse-transfer/warehouse-transfer.vue index a205dbe..4569f4c 100644 --- a/src/pages/warehouse-transfer/warehouse-transfer.vue +++ b/src/pages/warehouse-transfer/warehouse-transfer.vue @@ -23,8 +23,9 @@ 正在读取转运明细请稍候,不要重复选择