diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue
index e3e9d70..c0f106e 100644
--- a/src/pages/index/index.vue
+++ b/src/pages/index/index.vue
@@ -11,9 +11,16 @@
/>
+
+
+
+
+
+
{{ getActiveMenuTitle() || '请选择功能菜单' }}
该菜单页面尚未配置({{ activeMenuPath }})
diff --git a/src/pages/order/index.vue b/src/pages/order/index.vue
index 7e494ce..6f95a3f 100644
--- a/src/pages/order/index.vue
+++ b/src/pages/order/index.vue
@@ -136,7 +136,11 @@
- 商品明细
+
+ 订单数:{{ currentOrderCount || '-' }}
+ 篮号:{{ basketSummary || '-' }}
+ 商品明细
+
已扫{{ scannedCount }}/{{ totalCount }}件
@@ -150,7 +154,7 @@
图片
条码
规格
- 打包要求
+ 打包要求
@@ -173,7 +177,7 @@
{{ order.barcode }}
{{ order.spec }}
- {{ order.packingRequirements }}
+ {{ order.packingRequirements }}
@@ -283,6 +287,68 @@
+
+
+
+
+
+
+
+
+
+ 📷
+
+
+ {{ item.productName || '-' }}
+ 条码:{{ item.barcode || '-' }}
+ 规格:{{ item.spec || item.location || item.basketNo || '-' }}
+ 数量 {{ item.quantity || 0 }} / 已扫 {{ item.scannedQty || 0 }}
+
+
+
+
+
+
+
+
+
+
+ ✕
+
+
+
+ 双击或双指缩放查看
+
+
@@ -575,6 +641,33 @@ export default {
selectedPendingOrderKey: '',
currentOrderHeader: null,
currentWaybillInfo: null,
+ // 复核命中播报:同单内已播过复核要求的商品条码(去重,切单/清空时重置)
+ spokenRecheckKeys: [],
+ // 库内有相同商品(共享条码 has_shared_barcode)弹窗状态
+ sharedBarcodeDrawerVisible: false,
+ sharedBarcodeMatches: [],
+ sharedBarcodeCode: '',
+ sharedBarcodeSelectedIndex: -1,
+ sharedBarcodeDismissed: [],
+ // 共享条码弹窗图片加载失败标记(index → true,用于显示占位图标)
+ sharedBarcodeImgError: {},
+ // 共享条码弹窗商品图片预览(自绘全屏预览,避免 uni.previewImage 图片被放大)
+ sharedImagePreviewVisible: false,
+ sharedImagePreviewUrl: '',
+ // 图片预览缩放状态(1~5 倍)与拖动偏移
+ sharedImageScale: 1,
+ sharedImageOffsetX: 0,
+ sharedImageOffsetY: 0,
+ // 预览手势临时状态(非渲染数据)
+ previewPinchDistance: 0,
+ previewPinchStartScale: 1,
+ previewPanStartX: 0,
+ previewPanStartY: 0,
+ previewPanStartOffsetX: 0,
+ previewPanStartOffsetY: 0,
+ previewPanMoved: false,
+ previewLastClickAt: 0,
+ previewCloseTimer: null,
// 右侧顶部操作区
selectedPrinter: '',
selectedPrinterId: '',
@@ -661,6 +754,12 @@ export default {
hasSelection() {
return !!(this.selectedPendingOrderKey || this.selectedWaveKey)
},
+ // 图片预览缩放样式:先平移后缩放(transform-origin 居中)
+ sharedImageStyle() {
+ return {
+ transform: `translate(${this.sharedImageOffsetX}px, ${this.sharedImageOffsetY}px) scale(${this.sharedImageScale})`,
+ }
+ },
// 称重弹窗标题:复核前自动称重模式显示“称重(复核前)”,手动点“称重”按钮仍为“称重”
weighDialogTitle() {
return this.weighReviewMode ? '称重(复核前)' : '称重'
@@ -704,6 +803,35 @@ export default {
showBasketColumn() {
return this.scanListType === 'single' && Number(this.currentPickMode) === 3
},
+ // 商品明细标签行左侧:团购模式显示当前波次订单总数(total_orders / order_count)
+ currentOrderCount() {
+ if (this.scanListType !== 'group' || !this.currentOrderHeader) {
+ return ''
+ }
+ return this.getRowValue(this.currentOrderHeader, ['total_orders', 'order_count', 'orderCount'])
+ },
+ // 商品明细标签行左侧:当前明细行的篮号(box_no 去重后合并,散单/团购均显示)
+ basketSummary() {
+ const rows = Array.isArray(this.displayOrders) ? this.displayOrders : []
+ const values = []
+ const seen = new Set()
+ for (const row of rows) {
+ const value = String(row?.basketNo ?? '').trim()
+ if (value && !seen.has(value)) {
+ seen.add(value)
+ values.push(value)
+ }
+ }
+ return values.join('、')
+ },
+ // 打包要求列:只要有一个商品带打包要求(recheck_requirements)就显示,全部为空时整列隐藏
+ showPackColumn() {
+ const rows = Array.isArray(this.displayOrders) ? this.displayOrders : []
+ return rows.some((row) => {
+ const value = String(row?.packingRequirements ?? '').trim()
+ return value !== ''
+ })
+ },
// 团购模式:波次推荐包材名称(suggested_package_material.name;非对象时兜底已格式化串)
recommendedPackageMaterialName() {
const info = this.selectedPackageMaterialInfo
@@ -720,6 +848,7 @@ export default {
this.confirmReviewVisible ||
this.batchReviewVisible ||
this.packageMaterialDialogVisible ||
+ this.sharedBarcodeDrawerVisible ||
this.settingsVisible
)
},
@@ -785,10 +914,13 @@ export default {
productName: this.getRowValue(row, ['productName', 'product_name', 'goods_name', 'sku_name', 'item_name']),
color: this.getRowValue(row, ['color', 'color_name']),
spec: this.getRowValue(row, ['sku_property', 'spec', 'spec_name', 'size', 'sku_spec']),
+ location: this.getRowValue(row, ['location', 'location_code', 'loc_code', 'stock_location', 'storage_location', '库位']),
image,
- packingRequirements: this.getRowValue(row, ['packing_requirements', 'packingRequirements', 'pack_requirements']),
+ packingRequirements: this.getRowValue(row, ['recheck_requirements', 'recheckRequirements']),
// 篮号(pick_mode=3 散单分播,明细行 box_no 等字段)
basketNo: this.getRowValue(row, ['box_no', 'boxNo', 'basket_no', 'basketNo', 'seed_no', 'seedNo']),
+ // 共享条码:库内存在相同条码的其它商品(has_shared_barcode,布尔)
+ hasSharedBarcode: !!this.getRowValue(row, ['has_shared_barcode', 'hasSharedBarcode']),
scannedQty: this.getRowValue(row, ['scanned_qty', 'scannedQty', 'scan_qty', 'scanQty', 'scanned_count', 'scannedCount']) || 0,
}
},
@@ -810,10 +942,13 @@ export default {
},
normalizeOrderDetailItem(item) {
const snapshot = this.parseItemSnapshot(this.getRowValue(item, ['item_snapshot', 'itemSnapshot']))
- return this.normalizeOrderRow({
+ const merged = {
...item,
...snapshot,
- })
+ }
+ // 共享条码:优先取行内(stockItem)的 has_shared_barcode,否则取快照(rawItem)的,默认 false
+ merged.has_shared_barcode = !!(item?.has_shared_barcode ?? snapshot?.has_shared_barcode ?? false)
+ return this.normalizeOrderRow(merged)
},
handleConfirm() {
// 提交后重置扫码快速输入标记,下一轮输入重新识别手动/扫码
@@ -1280,23 +1415,265 @@ export default {
if (!barcode) {
return
}
- const target = this.displayOrders.find((order) => order.barcode === barcode)
- if (target) {
- target.scannedQty = (Number(target.scannedQty) || 0) + 1
- this.syncDetailStats(this.currentOrderHeader, this.displayOrders)
- this.keyword = ''
- uni.showToast({
- title: '匹配成功',
- icon: 'none',
- })
- // 商品明细全部扫完时:按“是否称重=称重”自动进入称重(复核前)
- this.autoOpenWeighAfterScan()
- } else {
- uni.showToast({
- title: '未找到该条码',
- icon: 'none',
- })
+ const code = this.normalizeScanBarcode(barcode)
+ // 查找所有条码匹配的商品(兼容单值/分号、逗号分隔的多值条码)
+ const matches = this.displayOrders.filter((order) => this.isBarcodeMatched(order, code))
+ if (matches.length === 0) {
+ uni.showToast({ title: '无记录', icon: 'none' })
+ return
}
+ // 命中共享条码商品(has_shared_barcode,库内存在同条码的其它商品):弹出「库内有相同商品」抽屉
+ const sharedItem = matches.find((order) => this.isSharedBarcode(order))
+ if (sharedItem) {
+ // 已关闭过该条码的弹窗:不再弹出,自动分配到第一个未扫完的共享条码商品
+ if (this.sharedBarcodeDismissed.includes(code)) {
+ const target = this.pickSharedTarget(matches)
+ if (target) {
+ this.applyScannedMatch(target)
+ } else {
+ uni.showToast({ title: '超出订单数', icon: 'none' })
+ }
+ return
+ }
+ this.sharedBarcodeMatches = matches
+ this.sharedBarcodeCode = code
+ this.sharedBarcodeSelectedIndex = matches.indexOf(sharedItem)
+ this.sharedBarcodeImgError = {}
+ this.keyword = ''
+ this.sharedBarcodeDrawerVisible = true
+ uni.showToast({ title: '库内有相同商品', icon: 'none' })
+ return
+ }
+ // 无共享条码:按原逻辑累加第一个匹配商品
+ this.applyScannedMatch(matches[0])
+ },
+ // 条码归一化:去空白 + 大写,供比对
+ normalizeScanBarcode(value) {
+ return String(value || '').replace(/\s+/g, '').toUpperCase()
+ },
+ // 商品条码是否命中(兼容单值/分号、逗号分隔的多值条码)
+ isBarcodeMatched(order, code) {
+ if (!order || !code) {
+ return false
+ }
+ const raw = String(order?.barcode ?? '').trim()
+ if (!raw) {
+ return false
+ }
+ return raw
+ .split(/[;,,|\s]+/)
+ .some((part) => this.normalizeScanBarcode(part) === code)
+ },
+ // 是否为共享条码商品(has_shared_barcode)
+ isSharedBarcode(order) {
+ return !!order?.hasSharedBarcode
+ },
+ // 累加一个匹配商品的已扫数量(原 handleBarcodeMatch 命中逻辑)
+ applyScannedMatch(target) {
+ if (!target) {
+ return
+ }
+ target.scannedQty = (Number(target.scannedQty) || 0) + 1
+ this.syncDetailStats(this.currentOrderHeader, this.displayOrders)
+ this.keyword = ''
+ // 复核命中商品:播报「数据一致」,并按商品去重追加该商品复核要求
+ this.speakDataConsistent(target)
+ // 关闭自动发货(手动发货)且商品全部扫完时:播报「全部商品已扫描完成」
+ if (this.settingShipMode === 'manual' && this.allProductsScanned) {
+ uni.showToast({ title: '全部商品已扫描完成', icon: 'none' })
+ }
+ // 商品明细全部扫完时:按“是否称重=称重”自动进入称重(复核前)
+ this.autoOpenWeighAfterScan()
+ },
+ // 共享条码已关闭后:自动分配到第一个未扫完的共享条码商品,否则第一个未扫完的匹配商品
+ pickSharedTarget(matches) {
+ const list = Array.isArray(matches) ? matches : []
+ const notFull = (order) => (Number(order?.quantity) || 0) > (Number(order?.scannedQty) || 0)
+ return (
+ list.find((order) => this.isSharedBarcode(order) && notFull(order)) ||
+ list.find((order) => notFull(order)) ||
+ null
+ )
+ },
+ // 库内有相同商品:点击商品卡片即视为确认,对选中商品累加扫描数量并关闭
+ confirmSharedBarcodeItem(index) {
+ const matches = this.sharedBarcodeMatches || []
+ const target = index >= 0 ? matches[index] : null
+ this.sharedBarcodeDrawerVisible = false
+ this.sharedBarcodeMatches = []
+ this.sharedBarcodeSelectedIndex = -1
+ this.sharedBarcodeCode = ''
+ this.sharedBarcodeImgError = {}
+ if (target) {
+ this.applyScannedMatch(target)
+ }
+ this.scheduleScanInputFocus(150)
+ },
+ // 图片加载失败:显示占位图标
+ onSharedImageError(index) {
+ this.$set(this.sharedBarcodeImgError, index, true)
+ },
+ // 点击商品图片:自绘全屏预览(mode=aspectFit,避免 uni.previewImage 被放大)
+ previewSharedImage(src) {
+ if (!src) {
+ return
+ }
+ this.sharedImagePreviewUrl = src
+ this.resetPreviewZoom()
+ this.sharedImagePreviewVisible = true
+ },
+ // 关闭商品图片预览
+ closeSharedImagePreview() {
+ if (this.previewCloseTimer) {
+ clearTimeout(this.previewCloseTimer)
+ this.previewCloseTimer = null
+ }
+ this.sharedImagePreviewVisible = false
+ this.sharedImagePreviewUrl = ''
+ this.resetPreviewZoom()
+ },
+ // 复位预览缩放与拖动偏移
+ resetPreviewZoom() {
+ this.sharedImageScale = 1
+ this.sharedImageOffsetX = 0
+ this.sharedImageOffsetY = 0
+ this.previewPinchDistance = 0
+ this.previewPinchStartScale = 1
+ this.previewPanMoved = false
+ this.previewLastClickAt = 0
+ },
+ // 缩放范围限制:1 ~ 5 倍
+ clampPreviewScale(value) {
+ return Math.min(5, Math.max(1, Number(value) || 1))
+ },
+ // 双击切换缩放(放大到 2.5 倍,或恢复 1 倍)
+ togglePreviewZoom() {
+ if (this.sharedImageScale > 1.01) {
+ this.resetPreviewZoom()
+ } else {
+ this.sharedImageScale = 2.5
+ }
+ },
+ // 计算两指间距离
+ getPreviewTouchDistance(touches) {
+ if (!touches || touches.length < 2) {
+ return 0
+ }
+ const dx = touches[0].clientX - touches[1].clientX
+ const dy = touches[0].clientY - touches[1].clientY
+ return Math.sqrt(dx * dx + dy * dy)
+ },
+ onPreviewTouchStart(e) {
+ const touches = e && e.touches ? e.touches : []
+ if (touches.length >= 2) {
+ this.previewPinchDistance = this.getPreviewTouchDistance(touches)
+ this.previewPinchStartScale = this.sharedImageScale
+ return
+ }
+ if (touches.length === 1) {
+ const touch = touches[0]
+ this.previewPanStartX = touch.clientX
+ this.previewPanStartY = touch.clientY
+ this.previewPanStartOffsetX = this.sharedImageOffsetX
+ this.previewPanStartOffsetY = this.sharedImageOffsetY
+ this.previewPanMoved = false
+ }
+ },
+ onPreviewTouchMove(e) {
+ const touches = e && e.touches ? e.touches : []
+ if (touches.length >= 2 && this.previewPinchDistance > 0) {
+ const distance = this.getPreviewTouchDistance(touches)
+ this.sharedImageScale = this.clampPreviewScale(
+ this.previewPinchStartScale * (distance / this.previewPinchDistance)
+ )
+ return
+ }
+ if (touches.length === 1 && this.sharedImageScale > 1.01) {
+ const touch = touches[0]
+ const deltaX = touch.clientX - this.previewPanStartX
+ const deltaY = touch.clientY - this.previewPanStartY
+ if (Math.abs(deltaX) > 3 || Math.abs(deltaY) > 3) {
+ this.previewPanMoved = true
+ }
+ this.sharedImageOffsetX = this.previewPanStartOffsetX + deltaX
+ this.sharedImageOffsetY = this.previewPanStartOffsetY + deltaY
+ }
+ },
+ onPreviewTouchEnd() {
+ this.previewPinchDistance = 0
+ this.previewPinchStartScale = 1
+ },
+ // 点击预览区:单击延时关闭(等待双击判定),双击切换缩放
+ onPreviewStageClick() {
+ if (this.previewPanMoved) {
+ this.previewPanMoved = false
+ return
+ }
+ const now = Date.now()
+ if (now - this.previewLastClickAt < 400) {
+ if (this.previewCloseTimer) {
+ clearTimeout(this.previewCloseTimer)
+ this.previewCloseTimer = null
+ }
+ this.previewLastClickAt = 0
+ this.togglePreviewZoom()
+ return
+ }
+ this.previewLastClickAt = now
+ this.previewCloseTimer = setTimeout(() => {
+ this.previewCloseTimer = null
+ this.closeSharedImagePreview()
+ }, 400)
+ },
+ // 桌面端滚轮缩放
+ onPreviewWheel(e) {
+ if (!e) {
+ return
+ }
+ if (e.cancelable) {
+ e.preventDefault()
+ }
+ const delta = e.deltaY || 0
+ if (!delta) {
+ return
+ }
+ const factor = delta > 0 ? 0.9 : 1.1
+ this.sharedImageScale = this.clampPreviewScale(this.sharedImageScale * factor)
+ },
+ // 关闭抽屉:将当前条码加入已忽略列表,后续相同条码不再弹窗
+ closeSharedBarcodeDrawer() {
+ const code = this.sharedBarcodeCode
+ this.sharedBarcodeDrawerVisible = false
+ this.sharedBarcodeMatches = []
+ this.sharedBarcodeSelectedIndex = -1
+ this.sharedBarcodeCode = ''
+ this.sharedBarcodeImgError = {}
+ if (code && !this.sharedBarcodeDismissed.includes(code)) {
+ this.sharedBarcodeDismissed.push(code)
+ }
+ this.scheduleScanInputFocus(150)
+ },
+ // 重置共享条码弹窗状态(切单/清空时调用)
+ resetSharedBarcodeState() {
+ this.sharedBarcodeDrawerVisible = false
+ this.sharedBarcodeMatches = []
+ this.sharedBarcodeCode = ''
+ this.sharedBarcodeSelectedIndex = -1
+ this.sharedBarcodeDismissed = []
+ this.sharedBarcodeImgError = {}
+ },
+ // 复核命中商品:播报「数据一致」;该商品带复核要求时,同单内只播一次「数据一致,{复核要求}」
+ speakDataConsistent(order) {
+ const key = String(order?.barcode ?? '').trim()
+ const requirement = String(order?.packingRequirements ?? '').trim()
+ let text = '数据一致'
+ if (requirement && (!key || !this.spokenRecheckKeys.includes(key))) {
+ if (key) {
+ this.spokenRecheckKeys.push(key)
+ }
+ text = `数据一致,${requirement}`
+ }
+ uni.showToast({ title: text, icon: 'none' })
},
handleScanQtyPlus() {
this.scanQty = (Number(this.scanQty) || 0) + 1
@@ -1359,14 +1736,16 @@ export default {
uni.showToast({
title: '查询失败',
icon: 'none',
+ silentVoice: true,
})
}
},
applyScanResult(payload) {
const list = Array.isArray(payload?.list) ? payload.list : []
if (list.length === 0) {
+ const message = payload?.msg || payload?.message || '未找到对应订单'
uni.showToast({
- title: payload?.msg || payload?.message || '未找到对应订单',
+ title: this.resolveScanOrderErrorVoice(message),
icon: 'none',
})
}
@@ -1399,6 +1778,32 @@ export default {
// 记录拣货任务 ID,供刷新按钮按 task_id 调用 scanTask
this.currentTaskId = this.extractTaskId(payload, list)
+
+ // 默认选中第一行,右侧立即展示其商品明细(不再需要手动点第一行)
+ this.autoSelectFirstResult()
+ },
+ // 扫码/查询订单错误文案 → 语音播报文案映射
+ resolveScanOrderErrorVoice(message) {
+ const text = String(message || '').trim()
+ if (text.includes('未拣货')) {
+ return '订单未拣货,不允许复核'
+ }
+ if (text.includes('关键词不能为空') || text.includes('关键词为空')) {
+ return '扫描关键词不能为空'
+ }
+ return '未找到对应订单'
+ },
+ // 默认选中左侧复核列表第一行,展示其商品明细
+ autoSelectFirstResult() {
+ const rows = Array.isArray(this.scanOrderList) ? this.scanOrderList : []
+ if (rows.length === 0) {
+ return
+ }
+ if (this.scanListType === 'group') {
+ this.handleWaveClick(rows[0])
+ } else {
+ this.handleScanOrderClick(rows[0])
+ }
},
// 将本地缓存的已复核订单/波次按原位置插回列表,保证保留已复核数据且位置不变
mergeReviewedKeptItems(list) {
@@ -1437,6 +1842,8 @@ export default {
this.interceptMode = false
this.interceptLocked = false
this.interceptTarget = null
+ this.spokenRecheckKeys = []
+ this.resetSharedBarcodeState()
this.selectedPendingOrderKey = ''
this.selectedWaveKey = ''
this.selectedOrderNo = ''
@@ -1492,12 +1899,12 @@ export default {
handleConfirmReview() {
// 已复核订单/波次:确认复核按钮已禁用,此处兜底拦截重复操作
if (this.reviewLocked) {
- uni.showToast({ title: '该订单已复核,无需重复操作', icon: 'none' })
+ uni.showToast({ title: '该订单已复核,无需重复操作', icon: 'none', silentVoice: true })
return
}
// 已拦截订单:确认拦截按钮已禁用,此处兜底拦截重复操作
if (this.interceptLocked) {
- uni.showToast({ title: '该订单已拦截,无需重复操作', icon: 'none' })
+ uni.showToast({ title: '该订单已拦截,无需重复操作', icon: 'none', silentVoice: true })
return
}
// 拦截确认模式下,弹窗确认后执行拦截;否则执行确认复核
@@ -1518,7 +1925,7 @@ export default {
}
// 商品未全部扫完:不可确认复核(按钮已禁用,此处兜底拦截)
if (!this.allProductsScanned) {
- uni.showToast({ title: '请先扫完所有商品,再进行复核', icon: 'none' })
+ uni.showToast({ title: '请先扫完所有商品,再进行复核', icon: 'none', silentVoice: true })
return
}
// 确认复核:打开自绘确认弹窗(样式参考称重弹窗),确认后调用接口
@@ -1545,14 +1952,14 @@ export default {
if (this.scanListType === 'group') {
const waveId = this.getRowValue(this.currentOrderHeader, ['wave_id', 'waveId'])
if (waveId === '') {
- uni.showToast({ title: '未找到波次ID,无法复核', icon: 'none' })
+ uni.showToast({ title: '未找到波次ID,无法复核', icon: 'none', silentVoice: true })
return false
}
params = { wave_id: waveId }
} else {
const orderId = this.getScanOrderId(this.currentOrderHeader)
if (orderId === '') {
- uni.showToast({ title: '未找到订单ID,无法复核', icon: 'none' })
+ uni.showToast({ title: '未找到订单ID,无法复核', icon: 'none', silentVoice: true })
return false
}
params = { order_id: orderId }
@@ -1578,7 +1985,7 @@ export default {
})
return false
}
- uni.showToast({ title: '确认复核成功', icon: 'success' })
+ uni.showToast({ title: '发货成功', icon: 'success' })
// 本地标记为已复核并缓存(服务端 scanOrder/scanTask 后续查询会去掉已复核数据,缓存用于回填)
this.keepReviewedItem()
// 复核后不刷新列表,本地联动更新左侧底部“剩余未复核”统计
@@ -1592,7 +1999,7 @@ export default {
}
return true
} catch (error) {
- uni.showToast({ title: '复核失败,请重试', icon: 'none' })
+ uni.showToast({ title: '网络异常,请检查网络', icon: 'none' })
return false
}
},
@@ -1740,7 +2147,7 @@ export default {
const orderNo = this.interceptTarget?.orderNo || this.selectedOrderNo || ''
const orderId = this.interceptTarget?.orderId ?? ''
if (orderId === '' || orderId === null || orderId === undefined) {
- uni.showToast({ title: '订单ID为空,无法拦截', icon: 'none' })
+ uni.showToast({ title: '订单ID为空,无法拦截', icon: 'none', silentVoice: true })
return
}
try {
@@ -1768,7 +2175,7 @@ export default {
confirmText: '确定',
})
} else {
- uni.showToast({ title: `拦截成功:${successCount} 单`, icon: 'none' })
+ uni.showToast({ title: `拦截成功:${successCount} 单`, icon: 'none', silentVoice: true })
}
// 拦截完成,退出拦截确认模式
@@ -1787,7 +2194,7 @@ export default {
}
} catch (error) {
// 接口调用失败:保留拦截确认模式,便于重试
- uni.showToast({ title: '拦截失败,请重试', icon: 'none' })
+ uni.showToast({ title: '拦截失败,请重试', icon: 'none', silentVoice: true })
}
},
handleClear() {
@@ -1796,13 +2203,13 @@ export default {
this.keyword = ''
this.reviewedKeepList = []
this.clearSelection()
- uni.showToast({ title: '已清空', icon: 'none' })
+ uni.showToast({ title: '已清空', icon: 'none', silentVoice: true })
},
// 刷新左侧列表;showToast=false 时静默刷新(拦截成功后自动同步,不弹提示打扰)
handleRefresh(showToast = true) {
const notify = (title) => {
if (showToast) {
- uni.showToast({ title, icon: 'none' })
+ uni.showToast({ title, icon: 'none', silentVoice: true })
}
}
// 优先按拣货任务 ID 拉取复核扫描视图;无任务 ID 时回退到关键词查询
@@ -1978,7 +2385,7 @@ export default {
this.batchResultDone = true
this.batchReviewError = ''
} catch (error) {
- uni.showToast({ title: '批量复核失败,请重试', icon: 'none' })
+ uni.showToast({ title: '批量复核失败,请重试', icon: 'none', silentVoice: true })
}
},
// 团购批量复核后:若某波次下所有订单均已复核,标记整波已复核并缓存(刷新回填保留已复核波次)
@@ -2057,18 +2464,18 @@ export default {
}
},
handleSingleReviewList() {
- uni.showToast({ title: '散单复核列表', icon: 'none' })
+ uni.showToast({ title: '散单复核列表', icon: 'none', silentVoice: true })
},
// 面单补打:先取打印数据(团购/散单模式区分),再发送到所选打印台
async handleRePrintLabel() {
// 未选中订单时提示
if (!this.hasSelection) {
- uni.showToast({ title: '请先在左侧选择订单', icon: 'none' })
+ uni.showToast({ title: '请先在左侧选择订单', icon: 'none', silentVoice: true })
return
}
// 未选择打印台时提示
if (!this.selectedPrinterId) {
- uni.showToast({ title: '未选择打印台,无法补打', icon: 'none' })
+ uni.showToast({ title: '未选择打印台,无法补打', icon: 'none', silentVoice: true })
return
}
// 防止重复点击
@@ -2113,13 +2520,12 @@ export default {
throw new Error(response?.message || response?.msg || '打印发送失败')
}
uni.hideLoading()
- uni.showToast({ title: '面单补打已发送', icon: 'success' })
+ uni.showToast({ title: '打印成功', icon: 'success' })
// 静默刷新左侧列表,同步服务端打印状态
this.handleRefresh(false)
} catch (error) {
uni.hideLoading()
- const message = String(error?.message || error?.msg || error?.errMsg || '补打失败')
- uni.showToast({ title: message, icon: 'none' })
+ uni.showToast({ title: '打印失败', icon: 'none' })
} finally {
this.printSending = false
this.scheduleScanInputFocus(150)
@@ -2306,7 +2712,7 @@ export default {
handleWeigh() {
// 未选中订单时提示先选择
if (!this.hasSelection) {
- uni.showToast({ title: '请先在左侧选择订单', icon: 'none' })
+ uni.showToast({ title: '请先在左侧选择订单', icon: 'none', silentVoice: true })
return
}
// 手动称重:非复核前自动称重模式,标题保持“称重”
@@ -2331,16 +2737,16 @@ export default {
// 包材绑定:仅团购波次,按波次首单运单号(first_waybill_no)绑定包材
handleAddPackageMaterial() {
if (!this.hasSelection) {
- uni.showToast({ title: '请先在左侧选择订单', icon: 'none' })
+ uni.showToast({ title: '请先在左侧选择订单', icon: 'none', silentVoice: true })
return
}
if (this.scanListType !== 'group') {
- uni.showToast({ title: '仅团购波次支持包材绑定', icon: 'none' })
+ uni.showToast({ title: '仅团购波次支持包材绑定', icon: 'none', silentVoice: true })
return
}
const waybill = this.getWaveRepresentWaybill(this.currentOrderHeader)
if (!waybill) {
- uni.showToast({ title: '未找到波次运单号,无法绑定包材', icon: 'none' })
+ uni.showToast({ title: '未找到波次运单号,无法绑定包材', icon: 'none', silentVoice: true })
return
}
this.pmBindWaybill = waybill
@@ -2396,7 +2802,7 @@ export default {
async handlePackageMaterialSearch() {
const keyword = (this.packageMaterialInput || '').trim()
if (keyword === '') {
- uni.showToast({ title: '请扫描或输入包材条码', icon: 'none' })
+ uni.showToast({ title: '请扫描或输入包材条码', icon: 'none', silentVoice: true })
return
}
if (this.pmSearching) {
@@ -2418,15 +2824,16 @@ export default {
this.packageMaterialInput = item.material_name || item.material_code || keyword
this.pmSearchList = []
this.pmSearched = false
+ uni.showToast({ title: '数据一致', icon: 'none' })
} else if (list.length > 1) {
this.pmSelectedMaterial = null
- uni.showToast({ title: `命中 ${list.length} 条,请选择`, icon: 'none' })
+ uni.showToast({ title: `命中 ${list.length} 条,请选择`, icon: 'none', silentVoice: true })
} else {
this.pmSelectedMaterial = null
- uni.showToast({ title: '未找到匹配的包材', icon: 'none' })
+ uni.showToast({ title: '无记录', icon: 'none' })
}
} catch (error) {
- uni.showToast({ title: '包材搜索失败,请重试', icon: 'none' })
+ uni.showToast({ title: '包材搜索失败,请重试', icon: 'none', silentVoice: true })
} finally {
this.pmSearching = false
}
@@ -2447,12 +2854,12 @@ export default {
return
}
if (this.scanListType !== 'group') {
- uni.showToast({ title: '仅团购波次支持包材绑定', icon: 'none' })
+ uni.showToast({ title: '仅团购波次支持包材绑定', icon: 'none', silentVoice: true })
return
}
const waybill = this.pmBindWaybill || this.getWaveRepresentWaybill(this.currentOrderHeader)
if (!waybill) {
- uni.showToast({ title: '未找到波次运单号,无法绑定包材', icon: 'none' })
+ uni.showToast({ title: '未找到波次运单号,无法绑定包材', icon: 'none', silentVoice: true })
return
}
// 未点选但搜索结果唯一命中时自动采用;仍未选时兜底采用推荐包材
@@ -2465,7 +2872,7 @@ export default {
}
const materialId = material?.id ?? material?.package_material_id
if (materialId === undefined || materialId === null || materialId === '') {
- uni.showToast({ title: '请先扫描并选择包材', icon: 'none' })
+ uni.showToast({ title: '请先扫描并选择包材', icon: 'none', silentVoice: true })
return
}
this.pmBinding = true
@@ -2489,9 +2896,7 @@ export default {
})
return
}
- const snapshot =
- payload.package_material_name_snapshot || material?.material_name || material?.material_code || ''
- uni.showToast({ title: snapshot ? `绑定成功:${snapshot}` : '包材绑定成功', icon: 'none' })
+ uni.showToast({ title: '发货成功', icon: 'none' })
const autoRecheck = this.pmAutoRecheck
const continueWeigh = this.pmPendingWeigh
this.resetPackageMaterialDialog()
@@ -2533,7 +2938,7 @@ export default {
this.scheduleScanInputFocus(150)
}
} catch (error) {
- uni.showToast({ title: '包材绑定失败,请重试', icon: 'none' })
+ uni.showToast({ title: '包材绑定失败,请重试', icon: 'none', silentVoice: true })
} finally {
this.pmBinding = false
}
@@ -2605,12 +3010,12 @@ export default {
async confirmWeigh() {
const weight = (this.weighInputValue || '').trim()
if (weight === '') {
- uni.showToast({ title: '请输入称重重量', icon: 'none' })
+ uni.showToast({ title: '请输入称重重量', icon: 'none', silentVoice: true })
return
}
const numeric = Number(weight)
if (!Number.isInteger(numeric) || numeric <= 0) {
- uni.showToast({ title: '重量必须为正整数(g)', icon: 'none' })
+ uni.showToast({ title: '重量必须为正整数(g)', icon: 'none', silentVoice: true })
return
}
// 团购模式按运单号提交(order_id=0);其余按订单 ID 提交
@@ -2620,7 +3025,7 @@ export default {
const waybillCode =
this.pmAfterReviewWeighWaybill || this.getWaveRepresentWaybill(this.currentOrderHeader)
if (!waybillCode) {
- uni.showToast({ title: '未找到波次运单号,无法称重', icon: 'none' })
+ uni.showToast({ title: '未找到波次运单号,无法称重', icon: 'none', silentVoice: true })
return
}
params = {
@@ -2631,7 +3036,7 @@ export default {
} else {
const orderId = this.getScanOrderId(this.currentOrderHeader)
if (orderId === '') {
- uni.showToast({ title: '未找到订单ID,无法称重', icon: 'none' })
+ uni.showToast({ title: '未找到订单ID,无法称重', icon: 'none', silentVoice: true })
return
}
params = {
@@ -2660,7 +3065,7 @@ export default {
})
return
}
- uni.showToast({ title: `保存成功:${numeric} g`, icon: 'none' })
+ uni.showToast({ title: `保存成功:${numeric} g`, icon: 'none', silentVoice: true })
this.weighDialogVisible = false
// 复核前自动称重模式:保存成功后直接继续执行确认复核(不弹二次确认弹窗)
const shouldContinueReview = this.weighReviewMode
@@ -2679,7 +3084,7 @@ export default {
}
this.scheduleScanInputFocus(150)
} catch (error) {
- uni.showToast({ title: '保存失败,请重试', icon: 'none' })
+ uni.showToast({ title: '保存失败,请重试', icon: 'none', silentVoice: true })
}
},
// 点击商品明细行(单击):
@@ -2720,13 +3125,13 @@ export default {
// 已复核订单/波次(波次级锁定):禁止无条码复核
if (this.reviewLocked) {
diagDrop('无条码复核-blocked', { reason: 'review-locked' })
- uni.showToast({ title: '该订单已复核,无法无条码复核', icon: 'none' })
+ uni.showToast({ title: '该订单已复核,无法无条码复核', icon: 'none', silentVoice: true })
return
}
// 已扫完(数量>0 且已扫>=总数)的行:无条码复核无意义,直接不弹窗
if (this.isProductScanned(order)) {
diagDrop('无条码复核-blocked', { reason: 'already-scanned' })
- uni.showToast({ title: '该商品已全部复核', icon: 'none' })
+ uni.showToast({ title: '超出订单数', icon: 'none' })
return
}
this.openNoBarcodeReview(order)
@@ -2767,11 +3172,11 @@ export default {
const total = Number(target.quantity) || 0
const scanned = Number(target.scannedQty) || 0
if (total <= 0) {
- uni.showToast({ title: '该商品无数量,无法标记', icon: 'none' })
+ uni.showToast({ title: '该商品无数量,无法标记', icon: 'none', silentVoice: true })
return
}
if (scanned >= total) {
- uni.showToast({ title: '该商品已全部复核', icon: 'none' })
+ uni.showToast({ title: '超出订单数', icon: 'none' })
this.closeNoBarcodeReview()
return
}
@@ -2779,7 +3184,7 @@ export default {
target.scannedQty = total
// 同步已扫/总数统计
this.syncDetailStats(this.currentOrderHeader, this.displayOrders)
- uni.showToast({ title: `已将「${target.productName || ''}」标记为已复核`, icon: 'none' })
+ this.speakDataConsistent(target)
this.closeNoBarcodeReview()
// 商品明细全部扫完时:按“是否称重=称重”自动进入称重(复核前)
this.autoOpenWeighAfterScan()
@@ -3013,6 +3418,8 @@ export default {
this.interceptMode = false
this.interceptLocked = false
this.interceptTarget = null
+ this.spokenRecheckKeys = []
+ this.resetSharedBarcodeState()
const src = this.getScanOrderSource(item)
this.selectedPendingOrderKey = this.getScanOrderKey(item)
this.selectedOrderNo = this.getScanOrderNo(item)
@@ -3049,7 +3456,7 @@ export default {
orderNo,
orderId: this.getScanOrderId(item),
}
- uni.showToast({ title: `已进入拦截确认:${orderNo}`, icon: 'none' })
+ uni.showToast({ title: `已进入拦截确认:${orderNo}`, icon: 'none', silentVoice: true })
return
}
// 已拦截订单:进入拦截锁定态,确认拦截按钮禁用,不可再次拦截
@@ -3061,7 +3468,7 @@ export default {
orderNo,
orderId: this.getScanOrderId(item),
}
- uni.showToast({ title: `订单「${orderNo}」已拦截`, icon: 'none' })
+ uni.showToast({ title: '此单已拦截', icon: 'none' })
}
},
getWaveKey(wave) {
@@ -3083,6 +3490,8 @@ export default {
this.interceptMode = false
this.interceptLocked = false
this.interceptTarget = null
+ this.spokenRecheckKeys = []
+ this.resetSharedBarcodeState()
this.selectedWaveKey = this.getWaveKey(wave)
// 复核后称重待完成:切到其它波次时取消该状态(避免残留自动弹称重)
if (
@@ -3113,6 +3522,10 @@ export default {
if (this.getWaveReviewStatus(wave) === '已复核') {
this.markAllProductsScanned()
}
+ // 团购波次含拦截单:进入时播报「有拦截订单」
+ if (this.getWaveInterceptLabel(wave)) {
+ uni.showToast({ title: '有拦截订单', icon: 'none' })
+ }
},
// 将当前商品明细全部置为已扫(已复核/复核后重选波次展示用)
markAllProductsScanned() {
@@ -3642,9 +4055,7 @@ export default {
}
.table-row--selected {
- background-color: #d6e8ff;
- border-left-color: #1f63d3;
- box-shadow: inset 0 0 0 0.02rem rgba(31, 99, 211, 0.22);
+ background-color: #a6c8ff;
}
.table-cell {
@@ -3718,6 +4129,16 @@ export default {
min-width: 0;
}
+.cell-pack-value {
+ color: var(--wms-danger-strong);
+ background-color: #fdecea;
+}
+
+/* 已扫行(绿底白字)也统一显示:打包要求值保持红字 + 浅红底 */
+.detail-row--scanned .cell-pack-value {
+ color: var(--wms-danger-strong);
+}
+
.cell-index {
width: 0.98rem;
}
@@ -3937,6 +4358,155 @@ export default {
background-color: #eaf2ff;
}
+/* 库内有相同商品弹窗:匹配商品列表 */
+.shared-barcode-list {
+ max-height: 2.8rem;
+ border: 0.01rem solid #e6ebf5;
+ border-radius: 0.07rem;
+ box-sizing: border-box;
+}
+
+.shared-barcode-item {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.1rem;
+ padding: 0.12rem 0.15rem;
+ border-bottom: 0.01rem solid #f0f2f6;
+ cursor: pointer;
+}
+
+.shared-barcode-item:last-child {
+ border-bottom: none;
+}
+
+.shared-barcode-item--active {
+ background-color: #eaf2ff;
+}
+
+.shared-barcode-thumb {
+ flex-shrink: 0;
+ width: 0.72rem;
+ height: 0.72rem;
+ border-radius: 0.07rem;
+ overflow: hidden;
+ background-color: #f2f4f8;
+}
+
+.shared-barcode-image {
+ width: 100%;
+ height: 100%;
+}
+
+.shared-barcode-image-placeholder {
+ width: 100%;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 0.44rem;
+ color: #c0c4cc;
+ background-color: #f2f4f8;
+}
+
+.shared-barcode-main {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ flex: 1;
+}
+
+.shared-barcode-name {
+ font-size: 0.26rem;
+ font-weight: 600;
+ color: var(--wms-text);
+ line-height: 1.4;
+ word-break: break-all;
+}
+
+.shared-barcode-code {
+ font-size: 0.24rem;
+ color: #000000;
+ margin-top: 0.04rem;
+ line-height: 1.4;
+ word-break: break-all;
+}
+
+.shared-barcode-spec {
+ font-size: 0.2rem;
+ color: #000000;
+ margin-top: 0.04rem;
+ line-height: 1.4;
+ word-break: break-all;
+}
+
+.shared-barcode-qty {
+ font-size: 0.2rem;
+ color: var(--wms-warning);
+ margin-top: 0.02rem;
+ line-height: 1.4;
+ word-break: break-all;
+}
+
+/* 共享条码商品图片全屏预览 */
+.shared-img-preview-mask {
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: rgba(0, 0, 0, 0.92);
+ z-index: 9999;
+ overflow: hidden;
+}
+
+.shared-img-preview-stage {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+}
+
+.shared-img-preview-img {
+ width: 90%;
+ height: 90%;
+ transform-origin: center center;
+ will-change: transform;
+}
+
+.shared-img-preview-hint {
+ position: absolute;
+ bottom: 0.5rem;
+ left: 50%;
+ transform: translateX(-50%);
+ padding: 0.06rem 0.16rem;
+ font-size: 0.24rem;
+ color: rgba(255, 255, 255, 0.75);
+ background-color: rgba(0, 0, 0, 0.4);
+ border-radius: 0.3rem;
+ pointer-events: none;
+ white-space: nowrap;
+}
+
+.shared-img-preview-close {
+ position: absolute;
+ top: 0.3rem;
+ right: 0.3rem;
+ width: 0.6rem;
+ height: 0.6rem;
+ line-height: 0.6rem;
+ text-align: center;
+ font-size: 0.36rem;
+ color: #ffffff;
+ background-color: rgba(0, 0, 0, 0.5);
+ border-radius: 50%;
+ z-index: 2;
+}
+
.pm-result-main {
display: flex;
flex-direction: column;
@@ -4430,7 +5000,6 @@ export default {
display: flex;
flex-wrap: wrap;
align-items: center;
- gap: 0.15rem;
max-width: 100%;
margin-bottom: 0.1rem;
padding: 0.1rem 0.15rem;
@@ -4583,6 +5152,17 @@ export default {
background-color: #fff3e6;
}
+/* 工具栏控件间距:不用 flex gap(老 WebView 不支持 flex 容器的 gap,真机按钮会挤在一起),
+ 改用子项外边距;放在所有子控件样式之后,确保覆盖 .tool-btn 的 margin:0 */
+.review-toolbar > * {
+ margin-right: 0.15rem;
+ margin-bottom: 0.1rem;
+}
+
+.review-toolbar > *:last-child {
+ margin-right: 0;
+}
+
/* 团购模式推荐包材条(显示在商品明细上方) */
.recommend-pack-bar {
display: flex;
@@ -4619,18 +5199,40 @@ export default {
justify-content: space-between;
margin-bottom: 0.1rem;
padding: 0.05rem 0.15rem;
- border-left: 0.05rem solid var(--wms-primary);
border-radius: 0.07rem;
background-color: #f6f8fc;
}
+.detail-tab-left {
+ display: flex;
+ align-items: center;
+ flex: 1;
+ min-width: 0;
+}
+
+.detail-tab-left > * + * {
+ margin-left: 0.1rem;
+}
+
.detail-tab-text {
+ flex-shrink: 0;
font-size: 0.2rem;
font-weight: 600;
color: var(--wms-text);
}
+.detail-tab-tag {
+ flex-shrink: 0;
+ padding: 0.02rem 0.1rem;
+ font-size: 0.17rem;
+ color: var(--wms-text-secondary);
+ background-color: #eef2f8;
+ border-radius: 0.07rem;
+ white-space: nowrap;
+}
+
.detail-tab-summary {
+ flex-shrink: 0;
font-size: 0.18rem;
color: #555;
}
diff --git a/src/pages/returns/index.vue b/src/pages/returns/index.vue
index bfd2b0d..6fee84f 100644
--- a/src/pages/returns/index.vue
+++ b/src/pages/returns/index.vue
@@ -780,6 +780,33 @@ export default {
this.stopPreviewStream()
stopScanSelfHeal()
},
+ // 嵌入模式(布局壳内组件):App 端无 keep-alive,activated/deactivated 不触发,
+ // 需在 mounted/beforeUnmount 兜底注册/注销扫码捕获,避免退件页嵌入时无法扫码。
+ mounted() {
+ if (!this.embedded) {
+ return
+ }
+ this.pageActive = true
+ diagBegin('returns')
+ diagNote('lifecycle', { hook: 'mounted' })
+ this.registerScanCapture()
+ this.resumePreviewIfNeeded()
+ startScanSelfHeal()
+ // #ifdef APP-PLUS
+ this.requestScanFocus()
+ // #endif
+ },
+ beforeUnmount() {
+ if (!this.embedded) {
+ return
+ }
+ this.pageActive = false
+ diagNote('lifecycle', { hook: 'beforeUnmount' })
+ this.unregisterScanCapture()
+ this.clearScanTimers()
+ this.stopPreviewStream()
+ stopScanSelfHeal()
+ },
methods: {
// ==================== 通用 ====================