diff --git a/src/pages/order/index.vue b/src/pages/order/index.vue index 7e5d5f1..7e494ce 100644 --- a/src/pages/order/index.vue +++ b/src/pages/order/index.vue @@ -2,7 +2,7 @@ - + @@ -159,8 +159,9 @@ v-for="(order, index) in displayOrders" :key="order.barcode || index" :class="['table-row', index % 2 === 1 ? 'table-row--alt' : '', isProductScanned(order) ? 'detail-row--scanned' : '']" - @longpress="handleLongPressProduct(order)" - @click="handleProductRowClick(order)" + @click.prevent="handleProductRowClick(order)" + @contextmenu.prevent="handleNoBarcodeReviewDirect(order)" + @longtap = "handleProductRowClick(order)" > {{ order.basketNo || '-' }} {{ order.quantity }} @@ -351,8 +352,8 @@ - - + + @@ -479,6 +480,7 @@ import { unlockWavePlatformPrintDataByGroup, sendPrint, } from '@/api/order' +import { diagDrop, diagNote } from '@/core/scan-diag' // 扫码枪识别参数 // 无回车结束符时:停止输入超过该毫秒数视为一次完整扫码,自动提交 @@ -2680,11 +2682,21 @@ export default { uni.showToast({ title: '保存失败,请重试', icon: 'none' }) } }, - // 点击商品明细行:当“是否称重=称重”且商品已全部扫完时(含点取消后),重新弹出称重(复核前),可继续称重并走复核流程 + // 点击商品明细行(单击): + // ① 可无条码复核的行(未复核 + 本行未扫完)→ 弹确认窗:关闭 / 无条码复核 + // ② 其余情况沿用原逻辑(复核后称重待完成 → 重新弹称重;否则走 autoOpenWeighAfterScan) handleProductRowClick(order) { if (!order) { return } + if (this.canNoBarcodeReview(order)) { + diagNote('no-barcode-review-open', { + item: order?.productName || order?.barcode || '', + source: 'click', + }) + this.openNoBarcodeReview(order) + return + } // 复核后称重待完成(团购自动发货,取消称重后):点商品行直接重新弹普通称重 if (this.pmPostReviewWeighPending) { this.weighReviewMode = false @@ -2694,21 +2706,44 @@ export default { } this.autoOpenWeighAfterScan() }, - // 无条码复核:长按商品明细行弹窗,将该商品标记为已复核(已扫=总数) - handleLongPressProduct(order) { + // 无条码复核:单击商品行弹窗确认(详见 handleProductRowClick),右键直接执行(见 handleNoBarcodeReviewDirect) + handleNoBarcodeReviewDirect(order) { + // 事件到没到、被哪个条件拦住,都留痕 + diagNote('no-barcode-review-direct', { + item: order?.productName || order?.barcode || '', + locked: this.reviewLocked, + scanned: this.isProductScanned(order), + }) if (!order) { return } // 已复核订单/波次(波次级锁定):禁止无条码复核 if (this.reviewLocked) { + diagDrop('无条码复核-blocked', { reason: 'review-locked' }) uni.showToast({ title: '该订单已复核,无法无条码复核', icon: 'none' }) return } // 已扫完(数量>0 且已扫>=总数)的行:无条码复核无意义,直接不弹窗 if (this.isProductScanned(order)) { + diagDrop('无条码复核-blocked', { reason: 'already-scanned' }) uni.showToast({ title: '该商品已全部复核', icon: 'none' }) return } + this.openNoBarcodeReview(order) + this.confirmNoBarcodeReview() + }, + // 本行能否无条码复核(单击弹窗与右键直执行共用同一判据) + canNoBarcodeReview(order) { + if (!order) { + return false + } + if (this.reviewLocked || this.isProductScanned(order)) { + return false + } + return (Number(order.quantity) || 0) > 0 + }, + // 打开无条码复核确认窗(不执行,等点“无条码复核”) + openNoBarcodeReview(order) { this.noBarcodeReviewTarget = order this.noBarcodeReviewVisible = true }, @@ -3151,26 +3186,21 @@ export default {