From 076b2836cfaec527c84fc15554bca8005063373c Mon Sep 17 00:00:00 2001 From: liufumingren Date: Sun, 27 Sep 2026 03:15:04 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E5=9B=A2=E5=8D=95=E6=97=A0?= =?UTF-8?q?=E6=9D=A1=E7=A0=81=E5=A4=8D=E6=A0=B8=E6=94=B9=E3=80=8C=E5=8D=95?= =?UTF-8?q?=E5=87=BB=E5=BC=B9=E7=AA=97=20+=20=E5=8F=B3=E9=94=AE=E7=9B=B4?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E3=80=8D=EF=BC=8C=E5=B9=B6=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E5=88=B0=E5=85=A8=E5=B1=80=E6=8E=92=E7=89=88=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除 longpress/touchstart/touchend/touchcancel 及 LONG_PRESS 常量、productRowTouch 状态(实测与框架 longpress 合成相互干扰) - 单击商品行弹确认窗(关闭 / 无条码复核);右键直接执行复核,不再有整单拦截 - 行级判定:已核实 / 已扫码 / 数量为 0 给出提示;诊点 no-barcode-review-open / no-barcode-review-direct - 行高/字号/圆角/间距切换 base.css token;renderjs 统一为 #ifndef APP-PLUS 包裹 --- src/pages/order/index.vue | 991 +++++++++++++++++++------------------- 1 file changed, 495 insertions(+), 496 deletions(-) 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 {