From 001f9ebee96300e50b69733603b4186324cc4c08 Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Mon, 13 Jul 2026 17:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=8D=E6=A0=B8=E5=8F=91?= =?UTF-8?q?=E8=B4=A7=E7=9A=84=E6=95=A3=E5=8D=95D=E5=9E=8B=E6=B3=A2?= =?UTF-8?q?=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/work/order/order-review.vue | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/pages/work/order/order-review.vue b/pages/work/order/order-review.vue index 35410d9..9ebdde4 100644 --- a/pages/work/order/order-review.vue +++ b/pages/work/order/order-review.vue @@ -1223,6 +1223,11 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; const matchedOrder = this.findOrderByProductBarcode(text); if (matchedOrder) { this.goPickGoodsDetail(matchedOrder); + return; + } + // 商品条码未匹配时,尝试用车号/运单号查询后端(支持扫拣货车进入下一个波次) + if (this.printStationId || this.printMode === 'noPrint') { + this.requestScanOrder(text); } else { uni.showToast({ title: '未找到匹配的商品', icon: 'none' }); this.speakVoice('无记录'); @@ -2611,10 +2616,39 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; data: { waveGroups } }); console.log('[autoPrint] 自动打印发送成功'); + // 同步更新订单列表中的打印状态 + this.updateOrderPrintStatus(item); } catch (error) { console.warn('[autoPrint] 自动打印失败:', error?.message || error); } }, + updateOrderPrintStatus(item) { + if (!item || !Array.isArray(this.orderList) || !this.orderList.length) return; + if (this.listType === 'single') { + const itemId = String(item.id || item.orderId || item.recordId || ''); + if (!itemId) return; + this.orderList = this.orderList.map(o => { + const oId = String(o.id || o.orderId || ''); + if (oId === itemId) { + return { ...o, isPrinted: true }; + } + return o; + }); + } else if (this.listType === 'group') { + // 团单模式:减少对应波次的未打印数量 + const waveNo = String(item.waveNo || item.wave_no || ''); + const itemId = String(item.id || item.orderId || item.recordId || ''); + this.orderList = this.orderList.map(o => { + const oId = String(o.id || o.orderId || ''); + const oWaveNo = String(o.waveNo || ''); + if (oId === itemId || (waveNo && oWaveNo === waveNo)) { + const currentUnprinted = Number(o.unprintedCount || 0); + return { ...o, unprintedCount: Math.max(0, currentUnprinted - 1) }; + } + return o; + }); + } + }, async handlePrintOrder(item) { if (!item) { uni.showToast({ title: '打印数据无效', icon: 'none' }); @@ -2656,6 +2690,9 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; throw new Error(sendResponse?.message || sendResponse?.msg || '打印发送失败'); } + // 同步更新订单列表中的打印状态 + this.updateOrderPrintStatus(item); + uni.hideLoading(); uni.showToast({ title: '打印已发送', icon: 'success' }); } catch (error) {