diff --git a/pages/packing/packMode.vue b/pages/packing/packMode.vue
index e5c6764..c1fe3d1 100644
--- a/pages/packing/packMode.vue
+++ b/pages/packing/packMode.vue
@@ -155,7 +155,7 @@
、
{{ orderItemBarcode(item) || item.item_code || '--' }}
- 打包要求:{{ itemPackingRequirement(item) }}
+ {{ itemPackingRequirement(item) }}
@@ -477,10 +477,11 @@ export default {
packWaitRemain: 0, // 大团购打包时长闸门:剩余等待秒数(倒计时展示,<=0 隐藏)
packWaitTimer: null, // 大团购打包时长闸门:倒计时 interval 句柄
packWaveScope: null, // 当前「打包中」任务波次范围(0=未分配 1=大团购 2=散单 3=小团购 4=单品单件)
- packReqChain: null, // 打包要求语音播报串行队列(核实播报排队用)
+ packReqChain: null, // 语音播报串行队列(核实命中后:数据一致 → 该商品打包要求 → 执行打包)
// 团购核实:商品行已扫计数(key=商品行id/序号 → 已扫次数),达 plan_qty 视为已核实
groupVerified: {},
groupSubmitting: false, // 团购提交开始打包防重入
+ groupPackQueued: false, // 团购全部核实后:语音播报结束前排队执行打包(防止播报期间被误判为上报失败重传)
groupAutoSubmitted: false, // 团购全部核实后是否已自动提交开始打包
// 无条码复核弹窗(团单)
noBarcodePopupOpen: false,
@@ -700,6 +701,7 @@ export default {
if (!this.groupAllVerified) return false;
if (!this.groupAutoSubmitted) return false;
if (this.hasActivePack) return false;
+ if (this.groupPackQueued) return false;
return !this.groupSubmitting;
},
// 输入框占位:按实际流程提示(未绑定操作员 → 扫工牌绑定;团购核实中 → 扫商品条码;否则 → 运单查询)
@@ -826,30 +828,23 @@ export default {
return Promise.resolve(false);
}
},
- // 语音播报商品打包要求(查询订单成功后调用,多条要求去重后串行播报,记录完成 Promise 供核实播报排队)
- speakPackingRequirements(items) {
- if (!Array.isArray(items) || !items.length) return;
- const reqs = [];
- items.forEach((it) => {
- const v = String((it && it.packing_requirements) || '').trim();
- if (v && reqs.indexOf(v) === -1) reqs.push(v);
- });
- if (!reqs.length) return;
- // 串行链:上一条播完再播下一条,最终 resolve 表示全部打包要求播报完成
- let chain = Promise.resolve();
- reqs.forEach((text) => {
- chain = chain.then(() => this.speakTextAsync(`${text}`));
- });
- this.packReqChain = chain;
- },
- // 核实播报:排队到打包要求播报完成之后,避免打断打包要求播报
- speakAfterPackRequirements(text = '') {
- const chain = this.packReqChain;
- if (chain && typeof chain.then === 'function') {
- this.packReqChain = chain.then(() => this.speakTextAsync(`${text}`)).catch(() => {});
- } else {
- this.speakText(`${text}`);
+ // 核实命中商品后的语音与打包顺序:播报「数据一致」→ 播报该商品打包要求 →(全部核实后)执行打包
+ afterItemVerified(item) {
+ let chain = this.packReqChain && typeof this.packReqChain.then === 'function'
+ ? this.packReqChain
+ : Promise.resolve();
+ chain = chain.then(() => this.speakTextAsync('数据一致'));
+ const req = String((item && item.packing_requirements) || '').trim();
+ if (req) {
+ chain = chain.then(() => this.speakTextAsync(req));
}
+ // 全部商品核实完成:先置提交标记,等语音播报结束后再执行打包(避免播报被提交打断)
+ if (this.groupAllVerified) {
+ this.groupAutoSubmitted = true;
+ this.groupPackQueued = true;
+ chain = chain.then(() => this.handleSubmitGroupPack());
+ }
+ this.packReqChain = chain.catch(() => {});
},
// 清理广播自愈定时器(页面隐藏/卸载时避免残留定时器误注册广播)
clearBcastHealTimer() {
@@ -1103,7 +1098,7 @@ export default {
const name = String(item.item_name || '商品').trim();
// 团单:条码比对命中一次即标记该商品已完成(数量一次扫满)
this.markItemVerified(item, i);
- this.speakAfterPackRequirements('数据一致');
+ this.afterItemVerified(item);
uni.showToast({ title: `${name} 已核实`, icon: 'none' });
return true;
}
@@ -1143,7 +1138,7 @@ export default {
const info = this.noBarcodeItem;
if (!info) return;
this.markItemVerified(info.item, info.idx);
- this.speakAfterPackRequirements('数据一致');
+ this.afterItemVerified(info.item);
this.noBarcodePopupOpen = false;
// 延迟清空,避免关闭动画期间文案闪变
setTimeout(() => {
@@ -1194,6 +1189,7 @@ export default {
}
} finally {
this.groupSubmitting = false;
+ this.groupPackQueued = false;
}
},
// 打包上报失败后的手动重传:扫描商品条码/长按商品触发(保持核实状态,凭原 key 重新上报)
@@ -1452,8 +1448,6 @@ export default {
this.packContextKey = String(data?.key || '').trim();
// 查询成功:清空输入框,方便连续扫描下一单
this.orderBarcode = '';
- // 语音播报商品打包要求
- this.speakPackingRequirements(data?.items);
// 团购:初始化商品核实状态(不自动上报,全部核实后将自动提交开始打包)
this.groupVerified = {};
this.groupAutoSubmitted = false;
diff --git a/pages/work/order/order-review-comps/ReviewDetail.vue b/pages/work/order/order-review-comps/ReviewDetail.vue
index 9d9645c..5335dbe 100644
--- a/pages/work/order/order-review-comps/ReviewDetail.vue
+++ b/pages/work/order/order-review-comps/ReviewDetail.vue
@@ -65,7 +65,6 @@
{{ item.scannedQty || 0 }}
- 复核要求:
{{ item.packageRequirement }}
@@ -128,7 +127,6 @@
{{ item.location || '--' }}
- 复核要求:
{{ item.packageRequirement }}
@@ -548,8 +546,8 @@ import voice from '@/core/utils/voice';
voice.speak('超出订单数');
}
this.$emit('updateScannedQty', matchIndex, newScanned);
- // 扫码匹配成功即播报"数据一致"(排队到复核要求播报完成后)
- this.$emit('speakDataConsistent');
+ // 复核命中商品:先播报"数据一致",再播报命中商品的复核要求
+ this.$emit('speakDataConsistent', matchedItem);
// 已扫数量达到计划数量时,标记为已匹配(显示绿底和"已匹配"状态)
if (newScanned >= maxQty) {
const matchedId = String(matchedItem?.id || '');
@@ -601,8 +599,8 @@ import voice from '@/core/utils/voice';
// 更新已扫数量
this.$emit('updateScannedQty', matchIndex, newScanned);
- // 扫码匹配成功即播报"数据一致"(排队到复核要求播报完成后)
- this.$emit('speakDataConsistent');
+ // 复核命中商品:先播报"数据一致",再播报命中商品的复核要求
+ this.$emit('speakDataConsistent', matchedItem);
// 已扫数量达到计划数量时,才标记为已匹配
if (newScanned >= maxQty) {
@@ -668,7 +666,7 @@ import voice from '@/core/utils/voice';
// 标记当前商品条码匹配
this.$emit('barcodeMatched', matchId);
uni.showToast({ title: `已标记为已复核(${planQty}/${planQty})`, icon: 'success' });
- this.$emit('speakDataConsistent');
+ this.$emit('speakDataConsistent', item);
},
handleListLongPress(item, index) {
if (this.isReadOnly) return;
@@ -836,8 +834,8 @@ import voice from '@/core/utils/voice';
const newScanned = Math.min(currentScanned + addQty, maxQty);
this.$emit('updateScannedQty', targetIdx, newScanned);
- // 扫码匹配成功即播报"数据一致"(排队到复核要求播报完成后)
- this.$emit('speakDataConsistent');
+ // 复核命中商品:先播报"数据一致",再播报命中商品的复核要求
+ this.$emit('speakDataConsistent', matchedItem);
if (newScanned >= maxQty) {
const matchedId = String(matchedItem?.id || '');
diff --git a/pages/work/order/order-review.vue b/pages/work/order/order-review.vue
index 019c45e..2f83e6b 100644
--- a/pages/work/order/order-review.vue
+++ b/pages/work/order/order-review.vue
@@ -493,6 +493,8 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
orderList: [],
listType: '', packingRequirements: '',
recheckReqChain: null,
+ // 已播报过复核要求的商品 id(同一商品在本订单内仅播报一次复核要求)
+ spokenReqItemIds: [],
pickMode: '',
totalOrders: 0,
taskId: '',
@@ -1146,33 +1148,36 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
speakVoice(text) {
voice.speak(text, { minInterval: 800 });
},
- // 语音播报复核要求(进入详情后调用,去重后串行播报,记录链供后续播报排队,参考打包模式页 speakPackingRequirements)
- speakRecheckRequirements(items) {
+ // 进入详情时语音播报"免复核商品"的打包要求(need_recheck=N 且含打包要求),按文本去重后串行播报一次
+ speakNoRecheckPackRequirements(items) {
if (!Array.isArray(items) || !items.length) return;
const reqs = [];
items.forEach((it) => {
+ if (String((it && it.need_recheck) || '').trim().toUpperCase() !== 'N') return;
const v = String((it && it.packageRequirement) || '').trim();
if (v && v !== '--' && reqs.indexOf(v) === -1) reqs.push(v);
});
if (!reqs.length) return;
- let chain = Promise.resolve();
+ const prev = this.recheckReqChain;
+ let chain = (prev && typeof prev.then === 'function') ? prev : Promise.resolve();
reqs.forEach((text) => {
chain = chain.then(() => voice.speak(`${text}`, { minInterval: 800 }));
});
- this.recheckReqChain = chain;
+ this.recheckReqChain = chain.catch(() => {});
},
- // 复核要求播报完成后再播报(避免打断复核要求播报)
- speakAfterRecheckRequirements(text = '') {
- const chain = this.recheckReqChain;
- if (chain && typeof chain.then === 'function') {
- this.recheckReqChain = chain.then(() => voice.speak(`${text}`, { minInterval: 800 })).catch(() => {});
- } else {
- voice.speak(`${text}`, { minInterval: 800 });
+ // 子组件(ReviewDetail)数据一致播报统一入口:复核命中商品后先播报"数据一致",再播报命中商品的复核要求内容
+ handleSpeakDataConsistent(item) {
+ const prev = this.recheckReqChain;
+ let chain = (prev && typeof prev.then === 'function') ? prev : Promise.resolve();
+ chain = chain.then(() => voice.speak('数据一致', { minInterval: 800 }));
+ const req = String((item && item.packageRequirement) || '').trim();
+ const itemId = String((item && item.id) || '').trim();
+ // 同一商品(按商品 id 去重)仅播报一次复核要求内容,商品数量>1 时多次扫码不再重复播报
+ if (req && req !== '--' && itemId && !this.spokenReqItemIds.includes(itemId)) {
+ this.spokenReqItemIds.push(itemId);
+ chain = chain.then(() => voice.speak(`${req}`, { minInterval: 800 }));
}
- },
- // 子组件(ReviewDetail)数据一致播报统一入口:排队到复核要求播报完成后
- handleSpeakDataConsistent() {
- this.speakAfterRecheckRequirements('数据一致');
+ this.recheckReqChain = chain.catch(() => {});
},
loadScanQuantity() {
try {
@@ -2627,6 +2632,10 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
// 设置详情数据
this.detailGoodsList = goodsList;
+ // 进入新订单时重置"已播报复核要求商品"记录,确保本订单内每件商品只播一次复核要求
+ this.spokenReqItemIds = [];
+ // 进入详情时语音播报"免复核商品"的打包要求(按文本去重,播报一次)
+ this.speakNoRecheckPackRequirements(goodsList);
this.detailInfo = {
recordId: String(item.id || ''),
orderId: Number(item.id || item.orderId || 0),
@@ -2665,9 +2674,6 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
this.showDetailView = true;
this.listExpanded = false;
- // 进入详情后语音播报复核要求(去重串行播报)
- this.speakRecheckRequirements(this.detailGoodsList);
-
// 团购模式:进入含拦截单的波次时自动弹出拦截信息提示(含波次号、运单号)
// 每个波次本次会话只自动弹 1 次(按 waveId/waveNo 去重);已复核波次仅展示只读详情,不自动弹窗
if (
@@ -3098,7 +3104,7 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue';
this.scannedPackageId = String(matched.id || '');
uni.hideLoading();
uni.showToast({ title: '包材匹配成功:' + (matched.material_name || trimmed), icon: 'success' });
- this.speakAfterRecheckRequirements('数据一致');
+ this.speakVoice('数据一致');
} else {
this.scannedPackageMaterial = null;
uni.hideLoading();
diff --git a/pages/work/order/picking.vue b/pages/work/order/picking.vue
index 2f339bc..0d86c00 100644
--- a/pages/work/order/picking.vue
+++ b/pages/work/order/picking.vue
@@ -87,7 +87,6 @@
{{ selectedPickItem.packingRequirements }}
- 拣货要求:
{{ selectedPickItem.pickRequirements }}
@@ -232,6 +231,20 @@
+
+
+
+
+