修改复核发货页面
This commit is contained in:
parent
de85ae5a1e
commit
0d9397a904
@ -353,9 +353,11 @@ import voice from '@/core/utils/voice';
|
||||
const code = this.normalizeBarcode(scanCode);
|
||||
if (!code) return false;
|
||||
|
||||
// 基于时间的去重:1.5 秒内相同条码跳过,防止广播重复触发导致弹窗多次
|
||||
// 基于时间的去重:300ms 内相同条码跳过,防止广播重复触发导致弹窗多次
|
||||
const now = Date.now();
|
||||
if (code === this._lastScanCode && (now - this._lastScanTime) < 1500) {
|
||||
const elapsed = now - this._lastScanTime;
|
||||
if (code === this._lastScanCode && elapsed < 300) {
|
||||
console.log('[ReviewDetail][handleScanCode] 去重拦截,相同条码:', code, '间隔(ms):', elapsed);
|
||||
return true;
|
||||
}
|
||||
this._lastScanCode = code;
|
||||
@ -396,6 +398,7 @@ import voice from '@/core/utils/voice';
|
||||
}
|
||||
if (matchIndex === -1) {
|
||||
uni.showToast({ title: '所有匹配商品已复核完成', icon: 'none' });
|
||||
voice.speak('超出订单数');
|
||||
return true;
|
||||
}
|
||||
this.currentGoodsIndex = matchIndex;
|
||||
@ -404,6 +407,10 @@ import voice from '@/core/utils/voice';
|
||||
const currentScanned = matchedItem?.scannedQty || 0;
|
||||
const addQty = Math.min(this.scanQty || 1, maxQty - currentScanned);
|
||||
const newScanned = Math.min(currentScanned + addQty, maxQty);
|
||||
// 扫描数量超过剩余数量时语音提示
|
||||
if ((this.scanQty || 1) > (maxQty - currentScanned)) {
|
||||
voice.speak('超出订单数');
|
||||
}
|
||||
this.$emit('updateScannedQty', matchIndex, newScanned);
|
||||
const allDone = this.goodsList.every((item, idx) => {
|
||||
const qty = idx === matchIndex ? newScanned : (item.scannedQty || 0);
|
||||
@ -447,12 +454,18 @@ import voice from '@/core/utils/voice';
|
||||
// 已复核完成的商品,不再增加数量
|
||||
if (currentScanned >= maxQty) {
|
||||
uni.showToast({ title: '该商品已复核完成', icon: 'none' });
|
||||
voice.speak('超出订单数');
|
||||
return true;
|
||||
}
|
||||
|
||||
const addQty = Math.min(this.scanQty || 1, maxQty - currentScanned);
|
||||
const newScanned = Math.min(currentScanned + addQty, maxQty);
|
||||
|
||||
// 扫描数量超过剩余数量时语音提示
|
||||
if ((this.scanQty || 1) > (maxQty - currentScanned)) {
|
||||
voice.speak('超出订单数');
|
||||
}
|
||||
|
||||
// 更新已扫数量
|
||||
this.$emit('updateScannedQty', matchIndex, newScanned);
|
||||
// 所有商品都已完成扫描时才播报"数据一致"
|
||||
|
||||
@ -196,7 +196,6 @@
|
||||
<text class="settings-label">打印模式</text>
|
||||
<view class="settings-options">
|
||||
<text
|
||||
v-if="listType !== 'single'"
|
||||
class="settings-option"
|
||||
:class="{ 'settings-option--active': printMode === 'printFirst' }"
|
||||
@click="printMode = 'printFirst'; saveSettings(); showSettingsPopup = false"
|
||||
@ -519,10 +518,6 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
return g;
|
||||
},
|
||||
effectivePrintMode() {
|
||||
// 散单模式只走先复核后打印或不打印
|
||||
if (this.listType === 'single' && this.printMode !== 'noPrint') {
|
||||
return 'reviewFirst';
|
||||
}
|
||||
return this.printMode;
|
||||
}
|
||||
},
|
||||
@ -1121,6 +1116,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
return;
|
||||
}
|
||||
this.keyword = scanText;
|
||||
console.log('[OrderReview][handleBroadcastResult] 广播扫描值:', scanText);
|
||||
const matched = this.$refs.reviewDetail.handleScanCode(scanText);
|
||||
setTimeout(() => { this.keyword = ''; }, 300);
|
||||
if (!matched) {
|
||||
@ -1169,6 +1165,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
if (this.$refs.reviewDetail.showMultiMatchPopup) {
|
||||
return;
|
||||
}
|
||||
console.log('[OrderReview][handleSearch] 搜索框扫描值:', text);
|
||||
const matched = this.$refs.reviewDetail.handleScanCode(text);
|
||||
if (!matched) {
|
||||
uni.showToast({ title: '条码不匹配', icon: 'none' });
|
||||
@ -1289,6 +1286,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
|
||||
if (this.$refs.reviewDetail.showMultiMatchPopup) {
|
||||
return;
|
||||
}
|
||||
console.log('[OrderReview][handleCameraScan] 摄像头扫描值:', scanResult);
|
||||
const matched = this.$refs.reviewDetail.handleScanCode(scanResult);
|
||||
if (!matched) {
|
||||
uni.showToast({ title: '条码不匹配', icon: 'none' });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user