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