From 533ad0a8567badceebc4321af94ce4e7695df276 Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Fri, 3 Jul 2026 15:56:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E5=A4=8D?= =?UTF-8?q?=E6=A0=B8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work/order/order-review-comps/ReviewDetail.vue | 14 +++++++++++++- pages/work/order/order-review.vue | 13 ++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/pages/work/order/order-review-comps/ReviewDetail.vue b/pages/work/order/order-review-comps/ReviewDetail.vue index ee3249c..627190f 100644 --- a/pages/work/order/order-review-comps/ReviewDetail.vue +++ b/pages/work/order/order-review-comps/ReviewDetail.vue @@ -250,7 +250,9 @@ import voice from '@/core/utils/voice'; viewMode: savedMode, showMultiMatchPopup: false, multiMatchFirst: {}, - pendingScanCode: '' + pendingScanCode: '', + _lastScanCode: '', + _lastScanTime: 0 }; }, computed: { @@ -350,6 +352,14 @@ import voice from '@/core/utils/voice'; const code = this.normalizeBarcode(scanCode); if (!code) return false; + // 基于时间的去重:1.5 秒内相同条码跳过,防止广播重复触发导致弹窗多次 + const now = Date.now(); + if (code === this._lastScanCode && (now - this._lastScanTime) < 1500) { + return true; + } + this._lastScanCode = code; + this._lastScanTime = now; + // 多商品匹配弹窗已打开且扫描相同条码时,跳过避免重复提示 if (this.showMultiMatchPopup && this.pendingScanCode === code) { return true; @@ -517,6 +527,8 @@ import voice from '@/core/utils/voice'; this.showMultiMatchPopup = false; this.multiMatchFirst = {}; this.pendingScanCode = ''; + this._lastScanCode = ''; + this._lastScanTime = 0; }, /** * 多商品匹配时,选择第一个商品进行处理 diff --git a/pages/work/order/order-review.vue b/pages/work/order/order-review.vue index fe69748..7b80076 100644 --- a/pages/work/order/order-review.vue +++ b/pages/work/order/order-review.vue @@ -1988,6 +1988,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; this.scannedPackageId = ''; this.scannedPackageMaterial = null; this.suggestedPkg = this.detailInfo?.suggestedPkg || null; + console.log('[packageBinding] 推荐包材数据:', JSON.stringify(this.suggestedPkg)); this.showPackageBindingPopup = true; return; } @@ -2004,6 +2005,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; this.scannedPackageId = ''; this.scannedPackageMaterial = null; this.suggestedPkg = this.detailInfo?.suggestedPkg || null; + console.log('[packageBinding] 推荐包材数据(handleGoodsItemClick):', JSON.stringify(this.suggestedPkg)); this.showPackageBindingPopup = true; }, 350); return; @@ -2065,15 +2067,6 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; uni.hideLoading(); uni.showToast({ title: '包材匹配成功:' + (matched.material_name || trimmed), icon: 'success' }); this.speakVoice('数据一致'); - } else if (list.length > 0) { - // 没有精确匹配,但有模糊结果:取第一条 - const first = list[0]; - this.scannedPackageMaterial = first; - this.scannedPackageCode = String(first.material_code || ''); - this.scannedPackageId = String(first.id || ''); - uni.hideLoading(); - uni.showToast({ title: '匹配到包材:' + (first.material_name || trimmed), icon: 'success' }); - this.speakVoice('数据一致'); } else { this.scannedPackageMaterial = null; uni.hideLoading(); @@ -2136,6 +2129,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; } } // 并发提交:复核确认 + 包材绑定 + console.log('[packageBinding] 最终绑定数据 - finalPackageCode:', finalPackageCode, 'waybillNo:', waybillNo, 'scannedPackageCode:', this.scannedPackageCode, 'scannedPackageId:', this.scannedPackageId, 'suggestedPkg:', JSON.stringify(this.suggestedPkg)); const promises = [this.callConfirmRecheckInternal()]; if (finalPackageCode && waybillNo) { promises.push( @@ -2252,6 +2246,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; this.scannedPackageId = ''; this.scannedPackageMaterial = null; this.suggestedPkg = this.detailInfo?.suggestedPkg || null; + console.log('[packageBinding] 推荐包材数据(handleConfirmRecheck):', JSON.stringify(this.suggestedPkg)); this.showPackageBindingPopup = true; return; }