feat(订单复核): 拦截改为只读弹窗查看 + 散单包材/打印/称重链路增强

- 拦截:移除「确认拦截」按钮与拦截确认模式(interceptMode/interceptLocked/interceptTarget、doConfirmIntercept、confirmIntercept 接口),
  改为「拦截信息」弹窗只读查看(单订单/波次两形态,波次展示拦截单运单号列表);
  扩展拦截状态文案映射(requested/pending/intercepting=拦截中,intercepted/intercepted_at_warehouse/intercept_success=已拦截),
  新增 isOrderIntercepted 判断(intercept_status 非空且非 none);自动发货模式下选中被拦截订单/波次自动弹出拦截信息
- 散单包材:静默绑定推荐包材增强——运单号多字段兜底(waybill_no/waybillNo/waybillCode/delivery_order_code/express_no/expressNo),
  无包材 ID 仅有编码时按编码搜索包材 ID 再绑定;推荐包材读取兼容 suggested_package_material/suggestedPackageMaterial/suggestedPkg/suggested_pkg
- 打印:失败码映射可读文案(1001 不支持的打印类型 / 504 发送失败 / 500 服务异常),
  失败时 toast 语音播报 + showModal 展示具体原因,兼容网络超时/异常提取
- 称重:散单未打包(接口返回 400「订单未打包」)时弹窗指引「请先打包后再称重」并语音播报,保持当前选中态不切单
- 统计:波次总单数改按 order_count 累加;自动选中首行跳过已复核项,全部已复核时仅保留数据查看并语音提示「已复核」
- 补打:散单被拦截订单禁止面单补打(toast 提示)
- 样式:设置分段按钮用 margin 替代 flex gap(老 WebView 兼容),新增拦截信息弹窗样式,移除 tool-btn--intercept
This commit is contained in:
zm2000 2026-10-21 18:15:28 +08:00
parent 5de57baa2c
commit b85dcf41f1

View File

@ -93,16 +93,17 @@
<view class="review-toolbar">
<button class="tool-btn tool-btn--blue" @click="openSettingsDialog">设置</button>
<button
:class="['tool-btn', interceptMode ? 'tool-btn--intercept' : 'tool-btn--confirm']"
:disabled="!hasSelection || interceptLocked || reviewLocked || (!interceptMode && !allProductsScanned)"
class="tool-btn tool-btn--confirm"
:disabled="!hasSelection || reviewLocked || !allProductsScanned"
@click="handleConfirmReview"
>{{ interceptMode ? '确认拦截' : '确认复核' }}</button>
>确认复核</button>
<button class="tool-btn" @click="handleClear">清空</button>
<button class="tool-btn tool-btn--blue-outline" @click="handleBatchQuickReview">批量快捷复核</button>
<button class="tool-btn tool-btn--blue-outline" @click="handleSingleReviewList">散单复核列表</button>
<button class="tool-btn tool-btn--orange" :disabled="!hasSelection" @click="handleRePrintLabel">面单补打</button>
<button v-if="scanListType === 'group'" class="tool-btn tool-btn--blue" :disabled="!hasSelection" @click="handleAddPackageMaterial">包材</button>
<button class="tool-btn tool-btn--blue" :disabled="!hasSelection" @click="handleWeigh">称重</button>
<button class="tool-btn tool-btn--blue" :disabled="!hasInterceptInfo" @click="handleShowInterceptInfo">拦截信息</button>
<view class="tool-select-wrap">
<view
:class="['tool-select', 'tool-select--printer', printerOpened ? 'tool-select--open' : '']"
@ -242,6 +243,46 @@
</view>
</view>
<!-- 拦截信息弹窗(点击左侧拦截/已拦截标签弹出;单订单/波次两形态,对齐 ReviewDetail) -->
<view v-if="interceptInfoVisible" class="weigh-mask" @click.self="closeInterceptInfo">
<view class="weigh-dialog">
<view class="weigh-dialog-header">
<text class="weigh-dialog-title">拦截信息</text>
<text class="weigh-dialog-close" @click="closeInterceptInfo">✕</text>
</view>
<view class="weigh-dialog-body">
<!-- 波次形态:波次号 + 拦截单运单号列表 -->
<template v-if="interceptInfo.isWave">
<view class="weigh-info-row">
<text class="weigh-info-label">波次号</text>
<text class="weigh-info-value">{{ interceptInfo.waveNo || '-' }}</text>
</view>
<view class="intercept-tip">该波次以下订单已被拦截,请勿复核发货</view>
<scroll-view class="intercept-info-scroll" scroll-y>
<view
v-for="(w, wi) in interceptInfo.list"
:key="`intercept-waybill-${wi}`"
class="intercept-waybill-row"
>
<text class="intercept-waybill-text">{{ w }}</text>
</view>
</scroll-view>
</template>
<!-- 单订单形态:运单号 + 提示 -->
<template v-else>
<view class="weigh-info-row">
<text class="weigh-info-label">运单号</text>
<text class="weigh-info-value">{{ interceptInfo.waybillNo || '-' }}</text>
</view>
<view class="intercept-tip">该订单已被拦截,请勿复核发货</view>
</template>
</view>
<view class="weigh-dialog-footer">
<button class="weigh-btn weigh-btn--close" @click="closeInterceptInfo">关闭</button>
</view>
</view>
</view>
<!-- 包材绑定弹窗(仅团购波次,order.bindExpressPackageMaterialByWaybill) -->
<view v-if="packageMaterialDialogVisible" class="weigh-mask weigh-mask--keyboard" @click.self="closePackageMaterialDialog">
<view class="weigh-dialog">
@ -565,7 +606,6 @@ import {
scanReviewOrder,
scanReviewTask,
fetchPrintList,
confirmIntercept,
confirmRecheck,
batchQuickRecheck,
batchQuickRecheckByWave,
@ -792,11 +832,14 @@ export default {
batchResultTab: 'success',
batchSuccessList: [],
batchFailedList: [],
// 拦截确认模式(点击左侧"拦截"后,确认按钮变为"确认拦截")
interceptMode: false,
// 已拦截锁定:选中行为已拦截订单时,确认拦截按钮置为禁用
interceptLocked: false,
interceptTarget: null,
// 拦截信息弹窗(点击拦截标签弹出):isWave=true 波次形态 / false 单订单形态
interceptInfoVisible: false,
interceptInfo: {
isWave: false,
waveNo: '',
waybillNo: '',
list: [],
},
// 顶部提示信息
pickerName: '',
storeRemark: '',
@ -883,6 +926,14 @@ export default {
? this.getWaveReviewStatus(this.currentOrderHeader) === '已复核'
: false
},
// 当前选中项是否含拦截信息(团购按波次内拦截单,散单按订单拦截状态)
hasInterceptInfo() {
if (!this.currentOrderHeader) return false
if (this.scanListType === 'group') {
return !!this.getWaveInterceptLabel(this.currentOrderHeader)
}
return this.isOrderIntercepted(this.currentOrderHeader)
},
noBarcodeReviewScanned() {
return this.noBarcodeReviewTarget ? Number(this.noBarcodeReviewTarget.scannedQty) || 0 : 0
},
@ -905,12 +956,12 @@ export default {
showBasketColumn() {
return this.scanListType === 'single' && Number(this.currentPickMode) === 3
},
// 商品明细标签行左侧:团购模式显示当前波次订单总数(total_orders / order_count)
// 商品明细标签行左侧:团购模式显示当前波次订单数(order_count)
currentOrderCount() {
if (this.scanListType !== 'group' || !this.currentOrderHeader) {
return ''
}
return this.getRowValue(this.currentOrderHeader, ['total_orders', 'order_count', 'orderCount'])
return this.getRowValue(this.currentOrderHeader, ['order_count', 'orderCount'])
},
// 商品明细标签行左侧:当前明细行的篮号(box_no 去重后合并,散单/团购均显示)
basketSummary() {
@ -2203,12 +2254,11 @@ export default {
this.warehouseId = scanWarehouseId
}
// 汇总数据:波次总单数优先取接口顶层字段,缺失时按列表累加(团购模式为波次列表)
const topTotal = this.getRowValue(payload, ['total_orders'])
this.waveTotalOrders =
topTotal !== ''
? topTotal
: list.reduce((sum, row) => sum + (Number(row?.total_orders) || 0), 0)
// 汇总数据:波次总单数 = 该次查询所有波次的订单数(order_count)累加
this.waveTotalOrders = list.reduce(
(sum, row) => sum + (Number(this.getRowValue(row, ['order_count', 'orderCount'])) || 0),
0
)
// 剩余未复核数:前端统计并排除拦截/已拦截订单
this.waveUnreviewedCount = this.countUnreviewedExcludingIntercepted(list)
this.clearSelection()
@ -2240,16 +2290,23 @@ export default {
}
return '未找到对应订单'
},
// 默认选中左侧复核列表第一行,展示其商品明细
// 默认选中左侧复核列表第一个未复核行;若扫描结果全部已复核完成,保留数据仅做查看,语音提示「已复核」
autoSelectFirstResult() {
const rows = Array.isArray(this.scanOrderList) ? this.scanOrderList : []
if (rows.length === 0) {
return
}
// 跳过已复核完成的行(该波次所有订单已复核完成时不进入复核流程)
const firstPending = rows.find((row) => this.getWaveReviewStatus(row) !== '已复核')
if (!firstPending) {
// 全部已复核:保留列表数据仅做查看,不选中任何行(保持无选中态,广播扫描继续走订单查询)
uni.showToast({ title: '已复核', icon: 'none' })
return
}
if (this.scanListType === 'group') {
this.handleWaveClick(rows[0])
this.handleWaveClick(firstPending)
} else {
this.handleScanOrderClick(rows[0])
this.handleScanOrderClick(firstPending)
}
},
// 将本地缓存的已复核订单/波次按原位置插回列表,保证保留已复核数据且位置不变
@ -2286,9 +2343,6 @@ export default {
return result
},
clearSelection() {
this.interceptMode = false
this.interceptLocked = false
this.interceptTarget = null
this.spokenRecheckKeys = []
this.resetSharedBarcodeState()
this.selectedPendingOrderKey = ''
@ -2360,27 +2414,6 @@ export default {
uni.showToast({ title: '该订单已复核,无需重复操作', icon: 'none', silentVoice: true })
return
}
// 已拦截订单:确认拦截按钮已禁用,此处兜底拦截重复操作
if (this.interceptLocked) {
uni.showToast({ title: '该订单已拦截,无需重复操作', icon: 'none', silentVoice: true })
return
}
// 拦截确认模式下,弹窗确认后执行拦截;否则执行确认复核
if (this.interceptMode) {
const orderNo = this.interceptTarget?.orderNo || this.selectedOrderNo || ''
uni.showModal({
title: '确认拦截',
content: `确认对订单「${orderNo}」执行拦截操作?`,
confirmText: '确定',
cancelText: '取消',
success: (res) => {
if (res.confirm) {
this.doConfirmIntercept()
}
},
})
return
}
// 商品未全部扫完:不可确认复核(按钮已禁用,此处兜底拦截)
if (!this.allProductsScanned) {
uni.showToast({ title: '请先扫完所有商品,再进行复核', icon: 'none', silentVoice: true })
@ -2484,18 +2517,52 @@ export default {
this.confirmRechecking = false
}
},
// 散单:静默绑定推荐包材(失败不阻塞复核)
// 散单:静默绑定推荐包材(失败不阻塞复核;对齐 WMS_PDA bindSuggestedPackageForSingle)
async bindSuggestedPackageForSingle() {
if (this.scanListType !== 'single') return null
const info = this.selectedPackageMaterialInfo
if (!info || typeof info !== 'object') return null
const waybill = this.getScanOrderNo(this.currentOrderHeader) || ''
if (!waybill) return null
const id = info.id ?? info.package_material_id
if (id === undefined || id === null || id === '') return null
const src = this.getScanOrderSource(this.currentOrderHeader)
const waybill = String(
this.getRowValue(src, [
'waybill_no',
'waybillNo',
'waybillCode',
'delivery_order_code',
'express_no',
'expressNo',
]) || ''
).trim()
if (!waybill) {
console.warn('[packageBinding] 散单缺少运单号,跳过包材绑定')
return null
}
const pkgCode = String(info.code || info.material_code || '').trim()
let finalPackageCode = String(info.id ?? info.package_material_id ?? '')
if (!finalPackageCode && pkgCode) {
// 无包材ID仅有编码:按编码搜索包材ID(setting.packageMaterial.search)
try {
const body = await searchPackageMaterial({ keyword: pkgCode })
const payload = body?.data || body?.result || body || {}
const raw = Array.isArray(payload) ? payload : payload.list || payload.data || []
const list = Array.isArray(raw) ? raw : []
const matched = list.find(
(item) => String(item?.material_code || item?.code || '') === pkgCode
)
if (matched) {
finalPackageCode = String(matched.id || matched.package_material_id || '')
}
} catch (e) {
console.warn('[packageBinding] 散单搜索推荐包材失败:', e)
}
}
if (!finalPackageCode) {
console.warn('[packageBinding] 散单推荐包材缺少ID,跳过绑定')
return null
}
return bindExpressPackageMaterialByWaybill({
waybill_code: waybill,
package_material_id: id,
package_material_id: finalPackageCode,
})
},
// 散单发货(对齐 WMS_PDA doShip):并发静默绑包材 + 确认复核;复核后按需称重/进下一单
@ -2673,61 +2740,6 @@ export default {
this.clearPostReviewWeighState()
}
},
// 执行确认拦截:调用 order.recheckOrder.confirmIntercept
async doConfirmIntercept() {
const orderNo = this.interceptTarget?.orderNo || this.selectedOrderNo || ''
const orderId = this.interceptTarget?.orderId ?? ''
if (orderId === '' || orderId === null || orderId === undefined) {
uni.showToast({ title: '订单ID为空,无法拦截', icon: 'none', silentVoice: true })
return
}
try {
const body = await confirmIntercept({ ids: [orderId] })
const payload = body?.data || body?.result || body || {}
const successList = Array.isArray(payload?.success) ? payload.success : []
const failedList = Array.isArray(payload?.failed) ? payload.failed : []
const successCount =
payload?.success_count != null ? Number(payload.success_count) : successList.length
const failedCount =
payload?.failed_count != null ? Number(payload.failed_count) : failedList.length
if (failedCount > 0) {
const reasons = failedList
.map((f) => {
const id = f?.order_id ?? f?.orderId ?? f?.id ?? ''
const reason = f?.reason ?? f?.msg ?? f?.message ?? ''
return `订单${id}${reason ? `:${reason}` : ''}`
})
.join('\n')
uni.showModal({
title: '拦截结果',
content: `成功 ${successCount} 单,失败 ${failedCount} 单${reasons ? `\n失败原因:\n${reasons}` : ''}`,
showCancel: false,
confirmText: '确定',
})
} else {
uni.showToast({ title: `拦截成功:${successCount} 单`, icon: 'none', silentVoice: true })
}
// 拦截完成,退出拦截确认模式
this.interceptMode = false
this.interceptLocked = false
this.interceptTarget = null
// 同步刷新左侧列表:本地即时将该行标记为已拦截,并从服务端刷新列表
if (successCount > 0) {
const successIds = successList
.map((s) => s?.order_id ?? s?.orderId ?? s?.id ?? '')
.filter((id) => id !== '')
const ids = successIds.length > 0 ? successIds : [orderId]
ids.forEach((id) => this.markRowIntercepted(id))
this.handleRefresh(false)
}
} catch (error) {
// 接口调用失败:保留拦截确认模式,便于重试
uni.showToast({ title: '拦截失败,请重试', icon: 'none', silentVoice: true })
}
},
handleClear() {
this.scanOrderList = []
this.activeKeyword = ''
@ -3004,6 +3016,11 @@ export default {
uni.showToast({ title: '请先在左侧选择订单', icon: 'none', silentVoice: true })
return
}
// 散单被拦截订单禁止补打(对齐 WMS_PDA isOrderIntercepted:interceptStatus 非空且 ≠ none,语音播报)
if (this.scanListType !== 'group' && this.isOrderIntercepted(this.currentOrderHeader)) {
uni.showToast({ title: '该订单已拦截,禁止打印', icon: 'none' })
return
}
// 未选择打印台时提示
if (!this.selectedPrinterId) {
uni.showToast({ title: '未选择打印台,无法补打', icon: 'none', silentVoice: true })
@ -3048,7 +3065,7 @@ export default {
response?.code !== 1001 &&
response?.code !== 504
if (!success) {
throw new Error(response?.message || response?.msg || '打印发送失败')
throw new Error(this.resolvePrintSendFailMessage(response))
}
uni.hideLoading()
uni.showToast({ title: '打印成功', icon: 'success' })
@ -3056,12 +3073,38 @@ export default {
this.handleRefresh(false)
} catch (error) {
uni.hideLoading()
// toast 触发全局语音播报「打印失败」(showModal 不经过 uni.showToast 包装器,无语音)
uni.showToast({ title: '打印失败', icon: 'none' })
uni.showModal({
title: '打印失败',
content: this.resolvePrintErrorText(error),
showCancel: false,
confirmText: '知道了',
})
} finally {
this.printSending = false
this.scheduleScanInputFocus(150)
}
},
// 根据打印接口失败码映射为可读文案(print.send 约定:1001 不支持的打印类型 / 504 发送失败 / 500 服务异常)
resolvePrintSendFailMessage(response) {
const code = response?.code
if (code === 1001 || code === '1001') return '不支持的打印类型'
if (code === 504 || code === '504') return '打印任务发送失败,请稍后重试'
if (code === 500 || code === '500') return '打印服务异常,请稍后重试'
const msg = response?.message || response?.msg
return msg ? String(msg) : '打印发送失败'
},
// 从打印错误对象提取可读原因(兼容 Error / 网络层 errMsg / 硬超时)
resolvePrintErrorText(error) {
if (!error) return '打印失败,请重试'
if (error?.timedOut) return '网络超时,请稍后重试'
const raw = String(error?.message || error?.msg || error?.errMsg || '').trim()
if (!raw || raw === 'Error') return '打印失败,请重试'
if (/timeout/i.test(raw)) return '网络超时,请稍后重试'
if (/request:fail/i.test(raw)) return '网络异常,请检查网络'
return raw
},
// 生成打印请求码(唯一)
buildPrintRequestCode() {
const timePart = Date.now().toString(36)
@ -3361,7 +3404,7 @@ export default {
) {
return
}
if (!this.hasSelection || this.reviewLocked || this.interceptLocked) {
if (!this.hasSelection || this.reviewLocked) {
return
}
if (!this.allProductsScanned) {
@ -3853,9 +3896,22 @@ export default {
if (!flagOk || !codeOk) {
const message =
body?.message || body?.msg || payload?.message || payload?.msg || '称重保存失败'
const rawMsg = String(message)
// 散单称重前置打包校验(single_weigh_require_pack):订单未打包时接口返回 400「订单未打包」,
// 给出明确指引并保持当前选中态(不切单),用户打包后可重新称重
if (rawMsg.includes('未打包')) {
uni.showModal({
title: '称重失败',
content: '订单未打包,请先打包后再称重',
showCancel: false,
confirmText: '确定',
})
getVoice().play('订单未打包,请先打包后再称重')
return
}
uni.showModal({
title: '称重失败',
content: String(message),
content: rawMsg,
showCancel: false,
confirmText: '确定',
})
@ -4065,6 +4121,19 @@ export default {
}
return item || {}
},
// 读取订单/波次的推荐包材(兼容 suggested_package_material / suggestedPackageMaterial / suggestedPkg / suggested_pkg,
// 散单订单兼容 detail 包裹;无则返回 '')
resolveSuggestedPackageMaterial(item) {
if (!item || typeof item !== 'object') return ''
const keys = ['suggested_package_material', 'suggestedPackageMaterial', 'suggestedPkg', 'suggested_pkg']
const value = this.getRowValue(item, keys)
if (value !== '') return value
const src = this.getScanOrderSource(item)
if (src && src !== item) {
return this.getRowValue(src, keys)
}
return ''
},
getScanOrderNo(item) {
const src = this.getScanOrderSource(item)
return this.getRowValue(src, ['waybill_no'])
@ -4134,14 +4203,110 @@ export default {
const src = this.getScanOrderSource(item)
return this.getRowValue(src, ['intercept_status', 'interceptStatus']) || ''
},
// 是否有拦截(intercept_status === 'requested')
isIntercepted(item) {
return this.getInterceptStatus(item) === 'requested'
// 拦截状态 → 展示文案(与 interceptionLog 状态映射一致)
interceptStatusText(status) {
const s = String(status || '').trim()
if (s === '' || s === 'none') return '未拦截'
if (s === 'requested' || s === 'pending' || s === 'intercepting') return '拦截中'
if (s === 'intercepted' || s === 'intercepted_at_warehouse') return '仓库已拦截'
if (s === 'intercept_success') return '拦截成功'
if (s === 'intercept_failed') return '拦截失败'
if (s === 'cancelled') return '已取消'
return s
},
// 是否已拦截(intercept_status === 'intercepted_at_warehouse')
// 读取拦截订单运单号(优先 firstWaybillNo,兜底 waybillNo / waybill_code)
interceptWaybillSource(item) {
const src = this.getScanOrderSource(item)
return String(
this.getRowValue(src, [
'first_waybill_no', 'firstWaybillNo',
'waybill_no', 'waybillNo', 'waybill_code', 'waybillCode',
]) || ''
).trim()
},
// 运单号展示(对齐 ReviewDetail.interceptWaybill):
// 基础值 firstWaybillNo || waybillNo;团购模式拼 运单号-总订单数-波次索引
interceptWaybill(item, fallbackTotal = '') {
const base = this.interceptWaybillSource(item)
if (!base) return '--'
if (this.scanListType === 'group') {
const totalOrders =
this.getRowValue(item, ['totalOrders', 'total_orders']) || fallbackTotal || ''
const waveIndex = this.getRowValue(item, ['waveIndex', 'wave_index']) || ''
const parts = [base]
if (totalOrders !== '') parts.push(String(totalOrders))
if (waveIndex !== '') parts.push(String(waveIndex))
return parts.join('-')
}
return base
},
// 波次拦截单列表:优先 wave.intercepted[],兜底从 wave.orders 过滤被拦截订单
resolveWaveInterceptList(wave) {
const intercepted = Array.isArray(wave?.intercepted) ? wave.intercepted : []
if (intercepted.length > 0) {
return intercepted
}
const orders = Array.isArray(wave?.orders) ? wave.orders : []
return orders.filter((o) => this.isOrderIntercepted(o))
},
// 点击散单拦截标签:单订单形态弹窗(运单号 + 提示)
openInterceptInfo(item) {
this.interceptInfo = {
isWave: false,
waveNo: '',
waybillNo: this.interceptWaybillSource(item) || '--',
list: [],
}
this.interceptInfoVisible = true
},
// 点击团购波次拦截标签:波次形态弹窗(波次号 + 拦截单运单号列表)
openWaveInterceptInfo(wave) {
const waveNo =
this.getRowValue(wave, ['wave_no', 'waveNo']) ||
this.getRowValue(wave, ['wave_id', 'waveId']) ||
'-'
const waveTotal =
this.getRowValue(wave, ['total_orders', 'totalOrders', 'order_count', 'orderCount']) || ''
const list = this.resolveWaveInterceptList(wave).map((o) => this.interceptWaybill(o, waveTotal))
this.interceptInfo = {
isWave: true,
waveNo,
waybillNo: '',
list,
}
this.interceptInfoVisible = true
},
closeInterceptInfo() {
this.interceptInfoVisible = false
},
// 点击「拦截信息」按钮:弹窗展示当前选中订单/波次的拦截信息
handleShowInterceptInfo() {
if (!this.hasInterceptInfo) return
if (this.scanListType === 'group') {
this.openWaveInterceptInfo(this.currentOrderHeader)
} else {
this.openInterceptInfo(this.currentOrderHeader)
}
},
// 拦截中(intercept_status ∈ requested/pending/intercepting):红色"拦截"标签
isIntercepted(item) {
const status = this.getInterceptStatus(item)
return status === 'requested' || status === 'pending' || status === 'intercepting'
},
// 已拦截(intercept_status ∈ intercepted/intercepted_at_warehouse/intercept_success):灰色"已拦截"标签
isInterceptedDone(item) {
const status = this.getInterceptStatus(item)
return status === 'intercepted_at_warehouse' || status === 'intercepted'
return (
status === 'intercepted' ||
status === 'intercepted_at_warehouse' ||
status === 'intercept_success'
)
},
// 是否被拦截(对齐 WMS_PDA:interceptStatus 非空且不为 'none' 即视为拦截,
// 覆盖 requested / intercepted_at_warehouse / intercepted 及后端可能的其它非 none 取值)
isOrderIntercepted(item) {
const status = String(this.getInterceptStatus(item) || '').trim()
return status !== '' && status !== 'none'
},
// 统计团购波次下订单的拦截情况(wave.orders[] 携带 intercept_status)
getWaveInterceptCount(wave) {
@ -4177,41 +4342,9 @@ export default {
// 兜底:scanOrder 返回的 waybill_no
return this.getScanOrderNo(wave)
},
// 拦截成功后:本地将左侧列表对应订单行状态更新为已拦截
markRowIntercepted(orderId) {
if (orderId === '' || orderId === null || orderId === undefined) {
return
}
const target = String(orderId)
const mark = (row) => {
const rowId = this.getScanOrderId(row)
if (rowId !== '' && String(rowId) === target) {
const src = this.getScanOrderSource(row)
if (src && typeof src === 'object') {
src.intercept_status = 'intercepted_at_warehouse'
}
return true
}
return false
}
for (const row of this.scanOrderList) {
if (mark(row)) {
return
}
// 团购模式:波次下订单也可能携带拦截状态
if (row && Array.isArray(row.orders)) {
for (const order of row.orders) {
if (mark(order)) {
return
}
}
}
}
},
// 是否处于拦截/已拦截状态(不计入剩余未复核)
// 是否处于拦截/已拦截状态(不计入剩余未复核),对齐 WMS_PDA:interceptStatus 非空且不为 none
isInterceptExcluded(item) {
const status = this.getInterceptStatus(item)
return status === 'requested' || status === 'intercepted_at_warehouse' || status === 'intercepted'
return this.isOrderIntercepted(item)
},
// 剩余未复核数统计:排除拦截/已拦截订单
countUnreviewedExcludingIntercepted(list) {
@ -4245,10 +4378,6 @@ export default {
this.waveUnreviewedCount = this.countUnreviewedExcludingIntercepted(list)
},
handleScanOrderClick(item) {
// 切换选中订单时退出拦截确认模式
this.interceptMode = false
this.interceptLocked = false
this.interceptTarget = null
this.spokenRecheckKeys = []
this.dprefixedAllScannedHandled = false
this.noRecheckAutoAdvanceHandled = false
@ -4266,7 +4395,7 @@ export default {
this.selectedItemsWeight = this.getRowValue(item, ['items_weight', 'itemsWeight'])
this.selectedWaveNo = this.getRowValue(item, ['wave_no', 'waveNo'])
this.selectedWaveIndex = this.getRowValue(item, ['wave_index', 'waveIndex'])
const pkg = this.getRowValue(item, ['suggested_package_material', 'suggestedPackageMaterial'])
const pkg = this.resolveSuggestedPackageMaterial(item)
this.selectedPackageMaterial = pkg ? this.formatPackageMaterial(pkg) : null
this.selectedPackageMaterialInfo = pkg && typeof pkg === 'object' ? pkg : null
@ -4289,30 +4418,11 @@ export default {
// 进入详情时播报免复核商品的打包要求(need_recheck=N 且含打包要求)
this.speakNoRecheckPackRequirements(this.displayOrders)
// 该行有拦截标识时:点击行即进入拦截确认模式(顶部确认按钮变为"确认拦截")
if (this.isIntercepted(item)) {
const orderNo = this.getScanOrderNo(item) || this.getRowValue(src, ['order_id', 'orderId'])
this.interceptMode = true
this.interceptLocked = false
this.interceptTarget = {
orderNo,
orderId: this.getScanOrderId(item),
}
uni.showToast({ title: `已进入拦截确认:${orderNo}`, icon: 'none', silentVoice: true })
return
}
// 已拦截订单:进入拦截锁定态,确认拦截按钮禁用,不可再次拦截
if (this.isInterceptedDone(item)) {
const orderNo = this.getScanOrderNo(item) || this.getRowValue(src, ['order_id', 'orderId'])
this.interceptMode = true
this.interceptLocked = true
this.interceptTarget = {
orderNo,
orderId: this.getScanOrderId(item),
}
uni.showToast({ title: '此单已拦截', icon: 'none' })
return
// 自动发货模式:选中订单含拦截信息时自动弹出拦截信息弹窗
if (this.settingShipMode === 'auto' && this.isOrderIntercepted(item)) {
this.openInterceptInfo(item)
}
// D前缀波次(单品单件):商品条码定位进入时自动标记全部已扫并触发复核发货
if (this.isDprefixedWave) {
if (this.dprefixedBarcodeVerified) {
@ -4340,10 +4450,7 @@ export default {
return String(value)
},
handleWaveClick(wave) {
// 团购模式:点击波次在右侧展示该波次的商品明细(stocks);切换时退出拦截确认模式
this.interceptMode = false
this.interceptLocked = false
this.interceptTarget = null
// 团购模式:点击波次在右侧展示该波次的商品明细(stocks)
this.spokenRecheckKeys = []
this.dprefixedAllScannedHandled = false
this.noRecheckAutoAdvanceHandled = false
@ -4359,7 +4466,7 @@ export default {
this.selectedPendingOrderKey = ''
this.selectedOrderNo = this.getRowValue(wave, ['wave_no', 'waveNo']) || ''
this.selectedItemsWeight = this.getRowValue(wave, ['items_weight', 'itemsWeight'])
const pkg = this.getRowValue(wave, ['suggested_package_material', 'suggestedPackageMaterial'])
const pkg = this.resolveSuggestedPackageMaterial(wave)
this.selectedPackageMaterial = pkg ? this.formatPackageMaterial(pkg) : null
this.selectedPackageMaterialInfo = pkg && typeof pkg === 'object' ? pkg : null
this.currentOrderHeader = wave
@ -4384,6 +4491,10 @@ export default {
if (this.getWaveInterceptLabel(wave)) {
uni.showToast({ title: '有拦截订单', icon: 'none' })
}
// 自动发货模式:波次内含拦截单时自动弹出拦截信息弹窗
if (this.settingShipMode === 'auto' && this.getWaveInterceptLabel(wave)) {
this.openWaveInterceptInfo(wave)
}
},
// 将当前商品明细全部置为已扫(已复核/复核后重选波次展示用)
markAllProductsScanned() {
@ -5145,6 +5256,33 @@ export default {
background-color: var(--wms-text-muted);
}
/* 拦截信息弹窗:提示文案与运单号列表 */
.intercept-tip {
margin-top: 0.08rem;
font-size: 0.18rem;
color: var(--wms-danger-strong);
}
.intercept-info-scroll {
max-height: 4.8rem;
margin-top: 0.12rem;
}
.intercept-waybill-row {
padding: 0.1rem 0;
border-bottom: 0.01rem solid #eef2f8;
}
.intercept-waybill-row:last-child {
border-bottom: none;
}
.intercept-waybill-text {
font-size: 0.2rem;
color: var(--wms-text);
word-break: break-all;
}
/* 称重/复核/批量弹窗共用遮罩
z-index 取 998:uni-app H5 内置 toast(uni-toast)z-index 为 999,
若遮罩 >999 会把弹窗内 uni.showToast 提示盖住看不到,故需低于 999 */
@ -5493,36 +5631,34 @@ export default {
display: flex;
align-items: center;
flex-wrap: wrap;
row-gap: 0.05rem;
border: 0.01rem solid var(--wms-border-alt);
border-radius: 0.07rem;
overflow: hidden;
}
.setting-seg-item {
margin-right: 0.08rem;
padding: 0.05rem 0.25rem;
font-size: 0.21rem;
color: var(--wms-text-secondary);
background-color: var(--wms-card-bg);
border: 0.01rem solid var(--wms-border-alt);
border-radius: 0.07rem;
cursor: pointer;
user-select: none;
border-left: 0.01rem solid var(--wms-border-alt);
white-space: nowrap;
}
.setting-seg-item:first-child {
border-left: none;
.setting-seg-item:last-child {
margin-right: 0;
}
.setting-seg-item--on {
background-color: var(--wms-primary);
border-color: var(--wms-primary);
color: var(--wms-white);
}
/* 复核流程:三个选项单行均分显示,间隔加大,不换行 */
/* 复核流程:三个选项单行均分显示,不换行(间隔走 margin,老 WebView 不支持 flex gap) */
.setting-seg--nowrap {
flex-wrap: nowrap;
gap: 0.1rem;
}
.setting-seg--nowrap .setting-seg-item {
@ -5532,7 +5668,6 @@ export default {
justify-content: center;
padding: 0.05rem 0.05rem;
text-align: center;
border-left: none;
}
.weigh-label-inline {
@ -5991,13 +6126,7 @@ export default {
color: var(--wms-white);
}
.tool-btn--intercept {
background-color: var(--wms-danger-strong);
border-color: var(--wms-danger-strong);
color: var(--wms-white);
}
/* 确认拦截按钮禁用态(已拦截订单):深灰字体 + 浅灰底,明确不可点击 */
/* 按钮禁用态:深灰字体 + 浅灰底,明确不可点击 */
.tool-btn[disabled] {
color: var(--wms-text-secondary);
background-color: #f2f2f2;