修改订单复核页面
This commit is contained in:
parent
6de6c0db7a
commit
533ad0a856
@ -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;
|
||||
},
|
||||
/**
|
||||
* 多商品匹配时,选择第一个商品进行处理
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user