diff --git a/package.json b/package.json index 47f30a8..c9f0083 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wms-pda", - "version": "1.0.143", + "version": "1.0.144", "private": true, "description": "天豹云仓 WMS_PDA(uni-app Vue2 + @vue/cli 4.5)", "scripts": { diff --git a/src/manifest.json b/src/manifest.json index f080bfd..c7031d0 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name" : "WMS_PDA", "appid" : "__UNI__0B3DAD3", "description" : "多平台快速开发的UI框架", - "versionName" : "1.0.142", - "versionCode" : 1000142, + "versionName" : "1.0.144", + "versionCode" : 1000144, "transformPx" : false, "app-plus" : { "statusbar" : { diff --git a/src/pages/work/order/gBWaveStrategy.vue b/src/pages/work/order/gBWaveStrategy.vue index 31658bd..84bd308 100644 --- a/src/pages/work/order/gBWaveStrategy.vue +++ b/src/pages/work/order/gBWaveStrategy.vue @@ -448,10 +448,11 @@ try { const params = this.buildWaveStrategyListParams(); const response = await this.$http('order.wave.waveStrategyList', params); - const parsedList = this.parseWaveStrategyResponse(response); + const parsedList = this.parseWaveStrategyResponse(response) + .filter(item => !item.disabled); parsedList.sort((a, b) => Number(b.matchedOrderCountFiltered) - Number(a.matchedOrderCountFiltered)); this.strategyList = parsedList; - const firstEnabled = this.strategyList.find(item => !item.disabled); + const firstEnabled = this.strategyList[0]; this.currentStrategyId = firstEnabled?.id || ''; } catch (error) { this.currentStrategyId = ''; diff --git a/src/pages/work/order/order-review-comps/ReviewDetail.vue b/src/pages/work/order/order-review-comps/ReviewDetail.vue index edb218c..5989c2b 100644 --- a/src/pages/work/order/order-review-comps/ReviewDetail.vue +++ b/src/pages/work/order/order-review-comps/ReviewDetail.vue @@ -127,7 +127,7 @@ {{'、'}} {{ item.location || '--' }} - + SN: {{ snCountOf(item) }}/{{ item.planQty || 0 }} {{ isSnComplete(item) ? '已完成' : '录入' }} @@ -211,7 +211,7 @@ - + SN 录入 {{ snPopupItemName }} @@ -223,7 +223,7 @@ {{ sn }} - 删除 + 删除 暂无SN,请扫描或输入 @@ -233,6 +233,20 @@ + + + + 删除SN + + 确定要删除该SN码吗? + + + 取消 + 删除 + + + + @@ -359,7 +373,10 @@ import voice from '@/core/utils/voice'; // SN(序列号)录入弹窗状态 showSnPopup: false, snInputValue: '', - snPopupIndex: -1 + snPopupIndex: -1, + // SN 删除二次确认弹窗状态 + showSnDeleteConfirm: false, + pendingDeleteSn: '' }; }, computed: { @@ -557,7 +574,7 @@ import voice from '@/core/utils/voice'; // 新录入的 SN 放在最前面,最新显示在列表顶部 const nextList = [raw, ...list]; this.$emit('updateSnList', idx, nextList); - this.$emit('speakDataConsistent', item); + this.$emit('speakSnRecorded', item); if (nextList.length >= planQty) { this.markBarcodeMatched(String(item.id || '')); uni.showToast({ title: `SN录入完成(${nextList.length}/${planQty})`, icon: 'success' }); @@ -565,17 +582,42 @@ import voice from '@/core/utils/voice'; this.closeSnPopup(); } } else { - voice.speak('数据一致'); + voice.speak('录入成功'); } return true; }, + requestDeleteSn(code) { + const raw = this.normalizeBarcode(code); + if (!raw) return; + this.pendingDeleteSn = raw; + this.showSnDeleteConfirm = true; + }, + cancelDeleteSn() { + this.showSnDeleteConfirm = false; + this.pendingDeleteSn = ''; + }, + confirmDeleteSn() { + this.showSnDeleteConfirm = false; + const removed = this.removeSn(this.pendingDeleteSn); + this.pendingDeleteSn = ''; + if (removed) { + uni.showToast({ title: '删除成功', icon: 'success' }); + voice.speak('删除成功'); + } else { + uni.showToast({ title: '删除失败', icon: 'none' }); + voice.speak('删除失败'); + } + }, removeSn(code) { const idx = this.snPopupIndex; - if (idx < 0 || idx >= this.goodsList.length) return; + if (idx < 0 || idx >= this.goodsList.length) return false; const item = this.goodsList[idx]; const raw = this.normalizeBarcode(code); const list = (Array.isArray(item.snList) ? item.snList : []).map(v => String(v ?? '').trim()).filter(Boolean); const nextList = list.filter(v => v !== raw); + if (nextList.length === list.length) { + return false; + } this.$emit('updateSnList', idx, nextList); const matchedId = String(item.id || ''); if (matchedId && this.matchedGoodsState[matchedId] && nextList.length < Number(item.planQty || 0)) { @@ -585,6 +627,7 @@ import voice from '@/core/utils/voice'; this.matchedGoodsState[matchedId] = false; } } + return true; }, normalizeBarcode(value) { return String(value || '').replace(/\s+/g, '').toUpperCase(); @@ -721,11 +764,7 @@ import voice from '@/core/utils/voice'; }); if (matchIndices.length === 0) { - // 当前商品为需SN商品且未录满时,扫描结果作为SN录入 - const currentItem = this.goodsList[this.currentGoodsIndex]; - if (this.isSnItem(currentItem) && !this.isSnComplete(currentItem)) { - return this.addSn(code, this.currentGoodsIndex); - } + // 未匹配到商品条码时不直接录入 SN,避免误录;SN 仅在录入弹窗打开时录入 voice.speak('无记录'); return false; } @@ -1600,7 +1639,8 @@ import voice from '@/core/utils/voice'; .list-card-row--matched .list-card-label, .list-card-row--matched .list-card-value, .list-card-row--matched .list-card-name, - .list-card-row--matched .list-card-tag { + .list-card-row--matched .list-card-tag, + .list-card-row--matched .list-card-space { color: #ffffff; } @@ -1991,26 +2031,27 @@ import voice from '@/core/utils/voice'; .sn-popup { padding: 40rpx 32rpx 32rpx; background: #ffffff; - border-radius: 20rpx 20rpx 0 0; + border-radius: 20px 20px 0 0; + overflow: hidden; box-sizing: border-box; } .sn-popup__title { - font-size: 42rpx; - font-weight: 600; + font-size: 40rpx; + font-weight: bold; color: #303133; text-align: center; } .sn-popup__subtitle { - font-size: 32rpx; + font-size: 36rpx; color: #909399; text-align: center; margin-top: 12rpx; } .sn-popup__progress { - font-size: 34rpx; + font-size: 38rpx; color: #303133; text-align: center; margin-top: 20rpx; @@ -2018,8 +2059,9 @@ import voice from '@/core/utils/voice'; } .sn-popup__progress-num { + font-size: 38rpx; color: #2979ff; - font-weight: 600; + font-weight: bold; } .sn-popup__input-row { @@ -2046,7 +2088,7 @@ import voice from '@/core/utils/voice'; border-radius: 12rpx; background: #2979ff; color: #ffffff; - font-size: 34rpx; + font-size: 36rpx; } .sn-popup__list { @@ -2064,13 +2106,17 @@ import voice from '@/core/utils/voice'; } .sn-popup__item-text { - font-size: 32rpx; + flex: 1; + min-width: 0; + font-size: 34rpx; color: #303133; word-break: break-all; } .sn-popup__item-del { - font-size: 30rpx; + flex-shrink: 0; + white-space: nowrap; + font-size: 36rpx; color: #f56c6c; padding-left: 24rpx; } @@ -2078,7 +2124,7 @@ import voice from '@/core/utils/voice'; .sn-popup__empty { padding: 40rpx 0; text-align: center; - font-size: 32rpx; + font-size: 34rpx; color: #c0c4cc; } @@ -2102,6 +2148,67 @@ import voice from '@/core/utils/voice'; border: 1rpx solid #dcdfe6; } + /* SN 删除二次确认弹窗 */ + .sn-delete-confirm-popup { + width: 640rpx; + padding: 40rpx 32rpx 32rpx; + background: #ffffff; + border-radius: 20rpx; + box-sizing: border-box; + } + + .sn-delete-confirm-popup__title { + font-size: 42rpx; + font-weight: 600; + color: #303133; + text-align: center; + margin-bottom: 32rpx; + } + + .sn-delete-confirm-popup__body { + margin-bottom: 36rpx; + padding: 24rpx; + background: #f5f7fa; + border-radius: 12rpx; + } + + .sn-delete-confirm-popup__text { + font-size: 36rpx; + color: #303133; + line-height: 1.6; + } + + .sn-delete-confirm-popup__actions { + display: flex; + align-items: center; + } + + .sn-delete-confirm-popup__btn { + flex: 1; + height: 88rpx; + border-radius: 12rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 36rpx; + font-weight: 500; + } + + .sn-delete-confirm-popup__btn + .sn-delete-confirm-popup__btn { + margin-left: 20rpx; + } + + .sn-delete-confirm-popup__btn--cancel { + background: #f5f7fa; + color: #606266; + border: 1rpx solid #dcdfe6; + } + + .sn-delete-confirm-popup__btn--confirm { + background: #f56c6c; + color: #ffffff; + } + /* 列表卡片 SN 进度 */ .sn-progress-row { display: flex; @@ -2110,14 +2217,14 @@ import voice from '@/core/utils/voice'; } .sn-progress-row__label { - font-size: 30rpx; - color: #606266; + font-size: 38rpx; + color: #000000; } .sn-progress-row__value { - font-size: 30rpx; + font-size: 38rpx; color: #2979ff; - font-weight: 600; + font-weight: bold; } .sn-progress-row__value--done { @@ -2126,10 +2233,25 @@ import voice from '@/core/utils/voice'; .sn-progress-row__btn { margin-left: auto; - font-size: 28rpx; + font-size: 36rpx; color: #2979ff; border: 1rpx solid #2979ff; border-radius: 8rpx; padding: 4rpx 16rpx; } + + .sn-progress-row--done { + background: #07c160; + border-radius: 8rpx; + } + + .sn-progress-row--done .sn-progress-row__label, + .sn-progress-row--done .sn-progress-row__value { + color: #ffffff; + } + + .sn-progress-row--done .sn-progress-row__btn { + color: #ffffff; + border-color: #ffffff; + } diff --git a/src/pages/work/order/order-review.vue b/src/pages/work/order/order-review.vue index c2b6ed1..5530243 100644 --- a/src/pages/work/order/order-review.vue +++ b/src/pages/work/order/order-review.vue @@ -69,6 +69,7 @@ @reprint="handleReprint" @goodsItemClick="handleGoodsItemClick" @speakDataConsistent="handleSpeakDataConsistent" + @speakSnRecorded="handleSpeakSnRecorded" /> @@ -1421,6 +1422,20 @@ import ReviewDetail from './order-review-comps/ReviewDetail.vue'; } this.recheckReqChain = chain.catch(() => {}); }, + // 子组件(ReviewDetail)SN 录入成功播报统一入口:先播报"录入成功",再播报该商品的复核要求内容 + handleSpeakSnRecorded(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 })); + } + this.recheckReqChain = chain.catch(() => {}); + }, loadScanQuantity() { try { const stored = uni.getStorageSync('review_scan_quantity'); diff --git a/src/pages/work/order/scatter-wave-strategy.vue b/src/pages/work/order/scatter-wave-strategy.vue index b2d9bad..7f2ba52 100644 --- a/src/pages/work/order/scatter-wave-strategy.vue +++ b/src/pages/work/order/scatter-wave-strategy.vue @@ -451,10 +451,11 @@ try { const params = this.buildWaveStrategyListParams(); const response = await this.$http('order.wave.waveStrategyList', params); - const parsedList = this.parseWaveStrategyResponse(response); + const parsedList = this.parseWaveStrategyResponse(response) + .filter(item => !item.disabled); parsedList.sort((a, b) => Number(b.matchedOrderCountFiltered) - Number(a.matchedOrderCountFiltered)); this.strategyList = parsedList; - const firstEnabled = this.strategyList.find(item => !item.disabled); + const firstEnabled = this.strategyList[0]; this.currentStrategyId = firstEnabled?.id || ''; } catch (error) { this.currentStrategyId = '';