修改订单复核页面
This commit is contained in:
parent
f174309d68
commit
797aacd748
@ -100,3 +100,25 @@ export function scanReviewOrder(
|
||||
options
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单复核-按拣货任务 ID 拉取复核扫描视图(order.recheckOrder.scanTask)
|
||||
* 根据拣货任务的 pick_mode 区分散单/团单模式,返回与 scanOrder 一致的数据结构:
|
||||
* - 散单(pick_mode 2/3/4):list_type='single',扁平订单列表(按 order_id 去重,未复核优先、wave_index 升序)
|
||||
* - 团购(pick_mode 1/5):list_type='group',任务下所有团购波次及订单分组列表
|
||||
*/
|
||||
export function scanReviewTask(
|
||||
params: {
|
||||
task_id: number
|
||||
},
|
||||
options?: RequestOptions
|
||||
) {
|
||||
return request<ApiBody>(
|
||||
'order.recheckOrder.scanTask',
|
||||
{
|
||||
...workerPayload,
|
||||
...params,
|
||||
},
|
||||
options
|
||||
)
|
||||
}
|
||||
|
||||
@ -185,8 +185,10 @@ export default {
|
||||
.layout-main {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
padding: 0 28rpx 24rpx;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.module-placeholder {
|
||||
|
||||
@ -5,35 +5,43 @@
|
||||
<view class="container container--compact-top">
|
||||
<view class="content-panel">
|
||||
<view class="panel-left">
|
||||
<!-- 选中订单时:复核扫描标签 + 数量步进器 -->
|
||||
<view v-if="hasSelection" class="scan-qty-bar">
|
||||
<view class="scan-qty-label">复核扫描</view>
|
||||
<view class="scan-qty-stepper">
|
||||
<text class="scan-qty-text">数量</text>
|
||||
<view class="scan-qty-btn" @click="handleScanQtyMinus">−</view>
|
||||
<input class="scan-qty-input" v-model="scanQty" type="number" />
|
||||
<view class="scan-qty-btn" @click="handleScanQtyPlus">+</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-bar">
|
||||
<input
|
||||
class="search-input"
|
||||
v-model="keyword"
|
||||
placeholder="输入运单号/车号,回车查询"
|
||||
:placeholder="searchPlaceholder"
|
||||
:focus="false"
|
||||
:adjust-position="false"
|
||||
confirm-type="search"
|
||||
@confirm="handleSearch"
|
||||
@confirm="handleConfirm"
|
||||
/>
|
||||
</view>
|
||||
<!-- 扫描复核结果(order.recheckOrder.scanOrder) -->
|
||||
<template v-if="scanActive">
|
||||
<!-- 散单:扁平订单列表 -->
|
||||
<!-- 散单:参考团单模式的扁平订单列表(复核状态 | 运单号 | 打印状态) -->
|
||||
<view v-if="scanListType === 'single' && scanOrderList.length > 0" class="table-wrap table-wrap--current-wave table-wrap--current-wave-sticky">
|
||||
<view class="table-header table-header--sticky">
|
||||
<text class="table-cell cell-pending-order">订单号</text>
|
||||
<text class="table-cell cell-weight">重量(g)</text>
|
||||
</view>
|
||||
<scroll-view class="left-reviewed-list left-reviewed-list--current-wave left-reviewed-list--current-wave-body" scroll-y>
|
||||
<view class="table-body">
|
||||
<view
|
||||
v-for="(item, index) in scanOrderList"
|
||||
:key="`scan-${index}`"
|
||||
:class="['table-row', index % 2 === 1 ? 'table-row--alt' : '', selectedPendingOrderKey === getScanOrderKey(item) ? 'table-row--selected' : '']"
|
||||
:class="['table-row', 'scan-row', index % 2 === 1 ? 'table-row--alt' : '', selectedPendingOrderKey === getScanOrderKey(item) ? 'table-row--selected' : '']"
|
||||
@click="handleScanOrderClick(item)"
|
||||
>
|
||||
<text class="table-cell cell-pending-order">{{ getScanOrderNo(item) }}</text>
|
||||
<text class="table-cell cell-weight">{{ formatWeight(item.items_weight) }}</text>
|
||||
<text :class="['table-cell', 'cell-review-status', getWaveReviewStatus(item) === '未复核' ? 'cell-review-status--unreviewed' : '']">{{ getWaveReviewStatus(item) }}</text>
|
||||
<text class="table-cell cell-wave-index">{{ formatWaveIndex(item) }}</text>
|
||||
<text class="table-cell cell-wave-no">{{ getScanOrderNo(item) }}</text>
|
||||
<text :class="['table-cell', 'cell-print-status', getWavePrintStatus(item) === '未打印' ? 'cell-print-status--unprinted' : '']">{{ getWavePrintStatus(item) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
@ -62,6 +70,14 @@
|
||||
|
||||
<!-- 初始空状态:引导查询 -->
|
||||
<view v-else class="empty-panel empty-panel--left">请输入关键词查询</view>
|
||||
|
||||
<!-- 左侧列表底部信息栏 -->
|
||||
<view v-if="scanActive && scanOrderList.length > 0" class="left-summary-bar">
|
||||
<text class="left-summary-text">波次总单数:<text class="left-summary-num">{{ waveTotalOrders }}</text></text>
|
||||
<text class="left-summary-sep">|</text>
|
||||
<text class="left-summary-text">剩余未复核:<text class="left-summary-num left-summary-num--orange">{{ waveUnreviewedCount }}</text></text>
|
||||
<button class="left-summary-refresh" @click="handleRefresh">刷新</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="panel-right">
|
||||
@ -130,27 +146,29 @@
|
||||
</view>
|
||||
</view>
|
||||
</picker>
|
||||
<text v-if="hasSelection" class="tool-info-text">拣货人:{{ pickerName || '-' }}</text>
|
||||
<text v-if="hasSelection" class="tool-info-text">货主:{{ storeRemark || '-' }}</text>
|
||||
<text v-if="hasSelection" class="tool-info-text tool-info-text--blue">拣货人:{{ pickerName || '-' }}</text>
|
||||
<text v-if="hasSelection" class="tool-info-text tool-info-text--blue">货主:{{ storeRemark || '-' }}</text>
|
||||
<text v-if="hasSelection && scanListType === 'single'" class="tool-info-text tool-info-text--gray">波次:{{ selectedWaveNo || '-' }}</text>
|
||||
<text v-if="hasSelection && scanListType === 'single'" class="tool-info-text tool-info-text--orange">蓝号:{{ selectedWaveIndex || '-' }}</text>
|
||||
</view>
|
||||
|
||||
<template v-if="hasSelection">
|
||||
<!-- 商品明细标签 -->
|
||||
<view class="detail-tab">
|
||||
<text class="detail-tab-text">商品明细</text>
|
||||
<text class="detail-tab-summary">{{ scannedCount }}/{{ totalCount }}件</text>
|
||||
<text class="detail-tab-summary">已扫<text class="detail-tab-summary--em">{{ scannedCount }}</text>/{{ totalCount }}件</text>
|
||||
</view>
|
||||
|
||||
<!-- 商品明细内容区 -->
|
||||
<view class="table-wrap table-wrap--detail table-wrap--detail-sticky">
|
||||
<view class="table-header table-header--sticky">
|
||||
<text class="table-cell cell-scanned">已扫</text>
|
||||
<text class="table-cell cell-total">总数</text>
|
||||
<text class="table-cell cell-name">商品名称</text>
|
||||
<text class="table-cell cell-image">图片</text>
|
||||
<text class="table-cell cell-barcode">条码</text>
|
||||
<text class="table-cell cell-spec">规格</text>
|
||||
<text class="table-cell cell-pack">打包要求</text>
|
||||
<view class="table-cell cell-scanned" :style="getColStyle('scanned')" ref="detail-header-scanned">已扫<view class="col-resizer" @mousedown.prevent.stop="startResize('scanned', $event)"></view></view>
|
||||
<view class="table-cell cell-total" :style="getColStyle('total')" ref="detail-header-total">总数<view class="col-resizer" @mousedown.prevent.stop="startResize('total', $event)"></view></view>
|
||||
<view class="table-cell cell-name" :style="getColStyle('name')" ref="detail-header-name">商品名称<view class="col-resizer" @mousedown.prevent.stop="startResize('name', $event)"></view></view>
|
||||
<view class="table-cell cell-image" :style="getColStyle('image')" ref="detail-header-image">图片<view class="col-resizer" @mousedown.prevent.stop="startResize('image', $event)"></view></view>
|
||||
<view class="table-cell cell-barcode" :style="getColStyle('barcode')" ref="detail-header-barcode">条码<view class="col-resizer" @mousedown.prevent.stop="startResize('barcode', $event)"></view></view>
|
||||
<view class="table-cell cell-spec" :style="getColStyle('spec')" ref="detail-header-spec">规格<view class="col-resizer" @mousedown.prevent.stop="startResize('spec', $event)"></view></view>
|
||||
<view class="table-cell cell-pack" :style="getColStyle('pack')" ref="detail-header-pack">打包要求<view class="col-resizer" @mousedown.prevent.stop="startResize('pack', $event)"></view></view>
|
||||
</view>
|
||||
|
||||
<scroll-view v-if="hasSelection && displayOrders.length > 0" class="table-scroll table-scroll--detail table-scroll--detail-body" scroll-y>
|
||||
@ -160,21 +178,26 @@
|
||||
:key="order.barcode || index"
|
||||
:class="['table-row', index % 2 === 1 ? 'table-row--alt' : '']"
|
||||
>
|
||||
<text class="table-cell cell-scanned">{{ order.scannedQty }}</text>
|
||||
<text class="table-cell cell-total">{{ order.quantity }}</text>
|
||||
<text class="table-cell cell-name">{{ order.productName }}</text>
|
||||
<view class="table-cell cell-image">
|
||||
<text class="table-cell cell-scanned" :style="getColStyle('scanned')">{{ order.scannedQty }}</text>
|
||||
<text class="table-cell cell-total" :style="getColStyle('total')">{{ order.quantity }}</text>
|
||||
<text class="table-cell cell-name" :style="getColStyle('name')">{{ order.productName }}</text>
|
||||
<view class="table-cell cell-image" :style="getColStyle('image')">
|
||||
<image v-if="order.image" class="item-image" :src="order.image" mode="aspectFit" />
|
||||
<text v-else class="cell-image-empty">-</text>
|
||||
</view>
|
||||
<text class="table-cell cell-barcode">{{ order.barcode }}</text>
|
||||
<text class="table-cell cell-spec">{{ order.spec }}</text>
|
||||
<text class="table-cell cell-pack">{{ order.packingRequirements }}</text>
|
||||
<text class="table-cell cell-barcode" :style="getColStyle('barcode')">{{ order.barcode }}</text>
|
||||
<text class="table-cell cell-spec" :style="getColStyle('spec')">{{ order.spec }}</text>
|
||||
<text class="table-cell cell-pack" :style="getColStyle('pack')">{{ order.packingRequirements }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-else class="empty-panel empty-panel--right-inline">暂无匹配数据</view>
|
||||
</view>
|
||||
|
||||
<!-- 合计栏 -->
|
||||
<view class="detail-total">
|
||||
<text class="detail-total-text">合计 <text class="detail-total-num">{{ totalQuantity }}</text></text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 未选中引导提示 -->
|
||||
@ -188,7 +211,7 @@
|
||||
|
||||
<script>
|
||||
import TopNav from '@/components/top-nav.vue'
|
||||
import { fetchOrderDetail, scanReviewOrder } from '@/api/order'
|
||||
import { scanReviewOrder, scanReviewTask } from '@/api/order'
|
||||
|
||||
export default {
|
||||
name: 'OrderReviewOnePage',
|
||||
@ -205,6 +228,15 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
keyword: '',
|
||||
// 当前生效的查询关键词(搜索成功后保存,供刷新按钮回退使用)
|
||||
activeKeyword: '',
|
||||
// 当前拣货任务 ID(搜索成功后保存,供刷新按钮按 task_id 调用 scanTask)
|
||||
currentTaskId: null,
|
||||
// 复核扫描数量(默认 1)
|
||||
scanQty: 1,
|
||||
// 明细表列宽拖拽:记录每列覆盖宽度(px)与拖拽状态
|
||||
detailColWidths: {},
|
||||
resizingCol: null,
|
||||
// 扫描复核结果(order.recheckOrder.scanOrder)
|
||||
scanActive: false,
|
||||
scanListType: '',
|
||||
@ -213,6 +245,8 @@ export default {
|
||||
selectedWaveKey: '',
|
||||
selectedOrderNo: '',
|
||||
selectedItemsWeight: null,
|
||||
selectedWaveNo: '',
|
||||
selectedWaveIndex: '',
|
||||
selectedPackageMaterial: null,
|
||||
displayOrders: [],
|
||||
selectedPendingOrderKey: '',
|
||||
@ -223,14 +257,17 @@ export default {
|
||||
printerOpened: false,
|
||||
selectedReviewProcess: '',
|
||||
reviewProcessOpened: false,
|
||||
selectedWeigh: '',
|
||||
selectedWeigh: '不称重',
|
||||
weighOpened: false,
|
||||
printerOptions: ['打印台1', '打印台2', '打印台3'],
|
||||
reviewProcessOptions: ['先打印后复核', '先复核后打印'],
|
||||
weighOptions: ['是', '否'],
|
||||
weighOptions: ['不称重', '称重'],
|
||||
// 顶部提示信息
|
||||
pickerName: '',
|
||||
storeRemark: '',
|
||||
// 左侧底部汇总
|
||||
waveTotalOrders: 0,
|
||||
waveUnreviewedCount: 0,
|
||||
// 商品明细统计
|
||||
scannedCount: 0,
|
||||
totalCount: 0,
|
||||
@ -240,6 +277,12 @@ export default {
|
||||
hasSelection() {
|
||||
return !!(this.selectedPendingOrderKey || this.selectedWaveKey)
|
||||
},
|
||||
searchPlaceholder() {
|
||||
return this.hasSelection ? '扫描商品条码(全部扫完后回车确认)' : '输入运单号/车号,回车查询'
|
||||
},
|
||||
totalQuantity() {
|
||||
return this.displayOrders.reduce((sum, order) => sum + (Number(order.quantity) || 0), 0)
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getRowValue(row, keys = []) {
|
||||
@ -292,6 +335,72 @@ export default {
|
||||
...snapshot,
|
||||
})
|
||||
},
|
||||
handleConfirm() {
|
||||
// 已选中列表项时,回车走商品条码匹配流程;否则走关键词查询
|
||||
if (this.hasSelection) {
|
||||
this.handleBarcodeMatch()
|
||||
} else {
|
||||
this.handleSearch()
|
||||
}
|
||||
},
|
||||
handleBarcodeMatch() {
|
||||
const barcode = this.keyword.trim()
|
||||
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',
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: '未找到该条码',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
},
|
||||
handleScanQtyPlus() {
|
||||
this.scanQty = (Number(this.scanQty) || 0) + 1
|
||||
},
|
||||
handleScanQtyMinus() {
|
||||
const value = Number(this.scanQty) || 0
|
||||
this.scanQty = value > 1 ? value - 1 : 1
|
||||
},
|
||||
getColStyle(key) {
|
||||
const w = this.detailColWidths[key]
|
||||
if (w) {
|
||||
return { width: `${w}px`, flex: 'none' }
|
||||
}
|
||||
return {}
|
||||
},
|
||||
startResize(key, event) {
|
||||
const el = this.$refs[`detail-header-${key}`]
|
||||
const dom = el && el.$el ? el.$el : el
|
||||
const startWidth = dom ? (dom.getBoundingClientRect ? dom.getBoundingClientRect().width : 0) : 0
|
||||
this.resizingCol = { key, startX: event.clientX, startWidth }
|
||||
if (typeof document !== 'undefined') {
|
||||
document.addEventListener('mousemove', this.onResizeMove)
|
||||
document.addEventListener('mouseup', this.onResizeEnd)
|
||||
}
|
||||
},
|
||||
onResizeMove(event) {
|
||||
if (!this.resizingCol) return
|
||||
const { key, startX, startWidth } = this.resizingCol
|
||||
const next = Math.max(60, Math.round(startWidth + (event.clientX - startX)))
|
||||
this.detailColWidths = { ...this.detailColWidths, [key]: next }
|
||||
},
|
||||
onResizeEnd() {
|
||||
this.resizingCol = null
|
||||
if (typeof document !== 'undefined') {
|
||||
document.removeEventListener('mousemove', this.onResizeMove)
|
||||
document.removeEventListener('mouseup', this.onResizeEnd)
|
||||
}
|
||||
},
|
||||
async handleSearch() {
|
||||
const query = this.keyword.trim()
|
||||
|
||||
@ -307,6 +416,8 @@ export default {
|
||||
const body = await scanReviewOrder({ keyword: query })
|
||||
const payload = body?.data || body?.result || body || {}
|
||||
this.applyScanResult(payload)
|
||||
this.activeKeyword = query
|
||||
this.keyword = ''
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '查询失败',
|
||||
@ -327,13 +438,29 @@ export default {
|
||||
this.scanListType = payload?.list_type || ''
|
||||
this.scanOrderList = list
|
||||
this.pickerName = this.getRowValue(payload, ['picker_name', 'pickerName']) || ''
|
||||
|
||||
// 汇总数据:优先取接口顶层字段;缺失时按列表逐项累加(团购模式为波次列表)
|
||||
const topTotal = this.getRowValue(payload, ['total_orders'])
|
||||
const topUnreviewed = this.getRowValue(payload, ['unreviewed_count'])
|
||||
if (topTotal !== '' || topUnreviewed !== '') {
|
||||
this.waveTotalOrders = topTotal
|
||||
this.waveUnreviewedCount = topUnreviewed
|
||||
} else {
|
||||
this.waveTotalOrders = list.reduce((sum, row) => sum + (Number(row?.total_orders) || 0), 0)
|
||||
this.waveUnreviewedCount = list.reduce((sum, row) => sum + (Number(row?.unreviewed_count) || 0), 0)
|
||||
}
|
||||
this.clearSelection()
|
||||
|
||||
// 记录拣货任务 ID,供刷新按钮按 task_id 调用 scanTask
|
||||
this.currentTaskId = this.extractTaskId(payload, list)
|
||||
},
|
||||
clearSelection() {
|
||||
this.selectedPendingOrderKey = ''
|
||||
this.selectedWaveKey = ''
|
||||
this.selectedOrderNo = ''
|
||||
this.selectedItemsWeight = null
|
||||
this.selectedWaveNo = ''
|
||||
this.selectedWaveIndex = ''
|
||||
this.selectedPackageMaterial = null
|
||||
this.displayOrders = []
|
||||
this.currentOrderHeader = null
|
||||
@ -341,6 +468,31 @@ export default {
|
||||
this.storeRemark = ''
|
||||
this.scannedCount = 0
|
||||
this.totalCount = 0
|
||||
this.currentTaskId = null
|
||||
},
|
||||
// 从响应顶层或列表行内提取拣货任务 ID
|
||||
extractTaskId(payload, list) {
|
||||
const topId = this.getRowValue(payload, ['task_id', 'taskId', 'pick_task_id', 'pickTaskId'])
|
||||
if (topId !== '') {
|
||||
return topId
|
||||
}
|
||||
const rows = Array.isArray(list) ? list : []
|
||||
for (const row of rows) {
|
||||
const rowId = this.getRowValue(row, ['task_id', 'taskId', 'pick_task_id', 'pickTaskId'])
|
||||
if (rowId !== '') {
|
||||
return rowId
|
||||
}
|
||||
// 团购模式:波次下订单可能携带任务 ID
|
||||
if (row && Array.isArray(row.orders)) {
|
||||
for (const order of row.orders) {
|
||||
const orderId = this.getRowValue(order, ['task_id', 'taskId', 'pick_task_id', 'pickTaskId'])
|
||||
if (orderId !== '') {
|
||||
return orderId
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null
|
||||
},
|
||||
syncDetailStats(source, list) {
|
||||
// 汇总商品件数:已扫 = scannedQty 之和,总数 = quantity 之和
|
||||
@ -354,9 +506,57 @@ export default {
|
||||
},
|
||||
handleClear() {
|
||||
this.scanOrderList = []
|
||||
this.activeKeyword = ''
|
||||
this.keyword = ''
|
||||
this.clearSelection()
|
||||
uni.showToast({ title: '已清空', icon: 'none' })
|
||||
},
|
||||
handleRefresh() {
|
||||
// 优先按拣货任务 ID 拉取复核扫描视图;无任务 ID 时回退到关键词查询
|
||||
const taskId = this.currentTaskId
|
||||
if (taskId !== null && taskId !== undefined && taskId !== '') {
|
||||
scanReviewTask({ task_id: Number(taskId) })
|
||||
.then((body) => {
|
||||
const payload = body?.data || body?.result || body || {}
|
||||
this.applyScanResult(payload)
|
||||
uni.showToast({
|
||||
title: '刷新成功',
|
||||
icon: 'none',
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
title: '刷新失败',
|
||||
icon: 'none',
|
||||
})
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const query = (this.activeKeyword || this.keyword).trim()
|
||||
if (!query) {
|
||||
uni.showToast({
|
||||
title: '请输入关键词',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
scanReviewOrder({ keyword: query })
|
||||
.then((body) => {
|
||||
const payload = body?.data || body?.result || body || {}
|
||||
this.applyScanResult(payload)
|
||||
uni.showToast({
|
||||
title: '刷新成功',
|
||||
icon: 'none',
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
uni.showToast({
|
||||
title: '刷新失败',
|
||||
icon: 'none',
|
||||
})
|
||||
})
|
||||
},
|
||||
handleBatchQuickReview() {
|
||||
uni.showToast({ title: '批量快捷复核', icon: 'none' })
|
||||
},
|
||||
@ -425,7 +625,15 @@ export default {
|
||||
},
|
||||
getScanOrderNo(item) {
|
||||
const src = this.getScanOrderSource(item)
|
||||
return this.getRowValue(src, ['order_no', 'orderNo', 'delivery_order_code', 'pending_order_no', 'pendingOrderNo', 'waybill_no', 'waybillNo'])
|
||||
return this.getRowValue(src, ['waybill_no'])
|
||||
},
|
||||
getWaveIndex(item) {
|
||||
const src = this.getScanOrderSource(item)
|
||||
return this.getRowValue(src, ['wave_index', 'waveIndex'])
|
||||
},
|
||||
formatWaveIndex(item) {
|
||||
const value = this.getWaveIndex(item)
|
||||
return value !== '' ? `[${value}]` : '-'
|
||||
},
|
||||
getScanOrderId(item) {
|
||||
const src = this.getScanOrderSource(item)
|
||||
@ -469,6 +677,14 @@ export default {
|
||||
if (reviewedCount !== '') {
|
||||
return Number(reviewedCount) > 0 ? '已复核' : '未复核'
|
||||
}
|
||||
// 散单订单:按 is_reviewed 布尔/标志位判断
|
||||
const reviewed = this.getRowValue(wave, ['is_reviewed', 'isReviewed'])
|
||||
if (reviewed === true || reviewed === 1 || reviewed === '1' || reviewed === '是' || reviewed === 'Y' || reviewed === 'yes') {
|
||||
return '已复核'
|
||||
}
|
||||
if (reviewed === false || reviewed === 0 || reviewed === '0' || reviewed === '否' || reviewed === 'N' || reviewed === 'no') {
|
||||
return '未复核'
|
||||
}
|
||||
return this.getRowValue(wave, ['review_status', 'reviewStatus', 'wave_status', 'waveStatus']) || '-'
|
||||
},
|
||||
handleScanOrderClick(item) {
|
||||
@ -476,51 +692,27 @@ export default {
|
||||
this.selectedPendingOrderKey = this.getScanOrderKey(item)
|
||||
this.selectedOrderNo = this.getScanOrderNo(item)
|
||||
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'])
|
||||
this.selectedPackageMaterial = pkg ? this.formatPackageMaterial(pkg) : null
|
||||
|
||||
// 优先使用接口自带的明细(单订单详情模式 / 团单订单)
|
||||
// 直接使用接口行内自带的商品明细(散单:stock / stocks,单订单详情:items / detail.items)
|
||||
const detailSource = this.getRowValue(item, ['detail'])
|
||||
const inlineItems = Array.isArray(item?.items)
|
||||
? item.items
|
||||
: detailSource && Array.isArray(detailSource.items)
|
||||
? detailSource.items
|
||||
: null
|
||||
: Array.isArray(item?.stock)
|
||||
? item.stock
|
||||
: Array.isArray(item?.stocks)
|
||||
? item.stocks
|
||||
: detailSource && Array.isArray(detailSource.items)
|
||||
? detailSource.items
|
||||
: null
|
||||
|
||||
if (inlineItems && inlineItems.length > 0) {
|
||||
this.currentOrderHeader = src
|
||||
this.currentWaybillInfo = null
|
||||
this.displayOrders = inlineItems.map((inlineItem) => this.normalizeOrderDetailItem(inlineItem))
|
||||
this.syncDetailStats(src, this.displayOrders)
|
||||
return
|
||||
}
|
||||
|
||||
const id = this.getScanOrderId(item)
|
||||
if (!id) {
|
||||
uni.showToast({
|
||||
title: '订单ID缺失',
|
||||
icon: 'none',
|
||||
})
|
||||
return
|
||||
}
|
||||
this.loadScanOrderDetail(id)
|
||||
},
|
||||
async loadScanOrderDetail(id) {
|
||||
try {
|
||||
const body = await fetchOrderDetail(id)
|
||||
const payload = body?.data || body?.result || body || {}
|
||||
const items = Array.isArray(payload?.items) ? payload.items : []
|
||||
|
||||
this.currentOrderHeader = payload?.order || payload?.orderHeader || null
|
||||
this.currentWaybillInfo = payload?.waybill || payload?.waybillInfo || null
|
||||
this.displayOrders = items.map((item) => this.normalizeOrderDetailItem(item))
|
||||
this.syncDetailStats(payload, this.displayOrders)
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '订单详情加载失败',
|
||||
icon: 'none',
|
||||
})
|
||||
}
|
||||
this.currentOrderHeader = src
|
||||
this.currentWaybillInfo = null
|
||||
this.displayOrders = (inlineItems || []).map((inlineItem) => this.normalizeOrderDetailItem(inlineItem))
|
||||
this.syncDetailStats(src, this.displayOrders)
|
||||
},
|
||||
getWaveKey(wave) {
|
||||
return String(this.getRowValue(wave, ['wave_id', 'waveId', 'wave_no', 'waveNo']) || '')
|
||||
@ -547,11 +739,19 @@ export default {
|
||||
this.currentOrderHeader = wave
|
||||
this.currentWaybillInfo = null
|
||||
|
||||
const stocks = Array.isArray(wave.stocks) ? wave.stocks : []
|
||||
// scanTask 团购模式波次视图使用 orders[],兼容 scanOrder 的 stocks[]
|
||||
const stocks = Array.isArray(wave.stocks)
|
||||
? wave.stocks
|
||||
: Array.isArray(wave.orders)
|
||||
? wave.orders
|
||||
: []
|
||||
this.displayOrders = stocks.map((stock) => this.normalizeOrderDetailItem(stock))
|
||||
this.syncDetailStats(wave, this.displayOrders)
|
||||
},
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.onResizeEnd()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -559,6 +759,7 @@ export default {
|
||||
.page {
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
@ -570,8 +771,10 @@ export default {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
overflow-y: auto;
|
||||
padding: 8rpx 32rpx 32rpx;
|
||||
padding: 8rpx 0 0;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.order-review-one {
|
||||
@ -579,9 +782,16 @@ export default {
|
||||
}
|
||||
|
||||
.container {
|
||||
background: #fff;
|
||||
background: #f8f8f8;
|
||||
border-radius: 16rpx;
|
||||
padding: 28rpx;
|
||||
margin: 0;
|
||||
padding: 10rpx;
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
flex: 1 1 auto;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.container--compact-top {
|
||||
@ -590,18 +800,29 @@ export default {
|
||||
|
||||
.content-panel {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
align-items: stretch;
|
||||
gap: 20rpx;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.panel-left {
|
||||
width: 700rpx;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-right: 1rpx solid #e6ebf5;
|
||||
padding-right: 20rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.panel-right {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
background-color: #f8f8f8;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.left-reviewed-list {
|
||||
@ -627,6 +848,65 @@ export default {
|
||||
margin-bottom: 24rpx;
|
||||
}
|
||||
|
||||
.scan-qty-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12rpx;
|
||||
margin-bottom: 16rpx;
|
||||
padding: 12rpx 16rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
|
||||
.scan-qty-text {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.scan-qty-label {
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #fff;
|
||||
background-color: #ff7d00;
|
||||
padding: 8rpx 24rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.scan-qty-stepper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
}
|
||||
|
||||
.scan-qty-btn {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1rpx solid #d9dde8;
|
||||
border-radius: 8rpx;
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
font-size: 32rpx;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.scan-qty-btn:active {
|
||||
background-color: #f0f2f5;
|
||||
}
|
||||
|
||||
.scan-qty-input {
|
||||
width: 110rpx;
|
||||
height: 56rpx;
|
||||
text-align: center;
|
||||
border: 1rpx solid #d9dde8;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
flex: 1;
|
||||
height: 72rpx;
|
||||
@ -655,7 +935,8 @@ export default {
|
||||
|
||||
.table-wrap--current-wave-sticky {
|
||||
margin-top: 14rpx;
|
||||
height: 60vh;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
@ -665,7 +946,8 @@ export default {
|
||||
}
|
||||
|
||||
.table-wrap--detail-sticky {
|
||||
height: 520rpx;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-x: auto;
|
||||
@ -684,7 +966,58 @@ export default {
|
||||
|
||||
.empty-panel--left {
|
||||
margin-top: 14rpx;
|
||||
height: 60vh;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
align-items: flex-start;
|
||||
padding-top: 40rpx;
|
||||
}
|
||||
|
||||
.left-summary-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24rpx;
|
||||
margin: 14rpx -20rpx -10rpx -10rpx;
|
||||
padding: 14rpx 20rpx;
|
||||
background-color: #f6f8fc;
|
||||
border: 1rpx solid #e6ebf5;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.left-summary-text {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.left-summary-sep {
|
||||
font-size: 26rpx;
|
||||
color: #d0d5e0;
|
||||
}
|
||||
|
||||
.left-summary-num {
|
||||
font-weight: 700;
|
||||
color: #2f7dff;
|
||||
}
|
||||
|
||||
.left-summary-num--orange {
|
||||
color: #ff7d00;
|
||||
}
|
||||
|
||||
.left-summary-refresh {
|
||||
margin: 0 0 0 auto;
|
||||
flex-shrink: 0;
|
||||
height: 48rpx;
|
||||
line-height: 48rpx;
|
||||
padding: 0 20rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
background-color: #2f7dff;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.left-summary-refresh::after {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.empty-panel--right-inline {
|
||||
@ -712,8 +1045,42 @@ export default {
|
||||
align-self: stretch;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-right: 1rpx solid #eef2f8;
|
||||
border-right: 1rpx solid #d0d5e0;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.col-resizer {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -6rpx;
|
||||
width: 14rpx;
|
||||
height: 100%;
|
||||
cursor: col-resize;
|
||||
z-index: 3;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.table-wrap--detail .table-header,
|
||||
.table-wrap--detail .table-body {
|
||||
border-color: #d0d5e0;
|
||||
}
|
||||
|
||||
.table-wrap--detail .table-row {
|
||||
border-top-color: #d0d5e0;
|
||||
}
|
||||
|
||||
/* 明细表左侧边线与右侧一致(1rpx #d0d5e0),数据行去掉占位边框保持对齐 */
|
||||
.table-wrap--detail .table-header {
|
||||
border-left: 1rpx solid #d0d5e0;
|
||||
}
|
||||
|
||||
.table-wrap--detail .table-row {
|
||||
border-left: none;
|
||||
}
|
||||
|
||||
.table-wrap--detail .table-body {
|
||||
border-left: 1rpx solid #d0d5e0;
|
||||
}
|
||||
|
||||
.table-wrap--detail .table-cell:last-child {
|
||||
@ -730,9 +1097,15 @@ export default {
|
||||
height: 64rpx;
|
||||
border: 1rpx solid #e6ebf5;
|
||||
border-bottom: none;
|
||||
border-left: 6rpx solid transparent;
|
||||
background-color: #f6f8fc;
|
||||
}
|
||||
|
||||
.table-header .table-cell {
|
||||
font-weight: 700;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.table-header--sticky {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
@ -775,28 +1148,35 @@ export default {
|
||||
}
|
||||
|
||||
.cell-barcode {
|
||||
width: 200rpx;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.cell-name {
|
||||
flex: 1;
|
||||
min-width: 180rpx;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.cell-scanned {
|
||||
width: 100rpx;
|
||||
width: 150rpx;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cell-total {
|
||||
width: 100rpx;
|
||||
width: 150rpx;
|
||||
justify-content: center;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.cell-spec {
|
||||
width: 240rpx;
|
||||
flex: 0.6;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.cell-image {
|
||||
width: 100rpx;
|
||||
width: 150rpx;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.item-image {
|
||||
@ -804,6 +1184,7 @@ export default {
|
||||
height: 72rpx;
|
||||
border-radius: 6rpx;
|
||||
background-color: #f2f4f8;
|
||||
margin: 8rpx 0;
|
||||
}
|
||||
|
||||
.cell-image-empty {
|
||||
@ -811,7 +1192,8 @@ export default {
|
||||
}
|
||||
|
||||
.cell-pack {
|
||||
width: 240rpx;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.cell-index {
|
||||
@ -831,6 +1213,29 @@ export default {
|
||||
width: 110rpx;
|
||||
}
|
||||
|
||||
.cell-wave-index {
|
||||
width: 90rpx;
|
||||
}
|
||||
|
||||
/* 散单行:复核状态、波次序号、运单号三列间隔完全贴合 */
|
||||
.scan-row .cell-review-status {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.scan-row .cell-wave-index {
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
.scan-row .cell-wave-no {
|
||||
padding-left: 0;
|
||||
min-width: 260rpx;
|
||||
white-space: normal;
|
||||
overflow: visible;
|
||||
text-overflow: clip;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.cell-review-status--unreviewed {
|
||||
color: #ff7d00;
|
||||
}
|
||||
@ -839,6 +1244,10 @@ export default {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding-left: 4rpx;
|
||||
white-space: normal;
|
||||
overflow: visible;
|
||||
text-overflow: clip;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.cell-print-status {
|
||||
@ -864,7 +1273,7 @@ export default {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
gap: 20rpx;
|
||||
max-width: 100%;
|
||||
margin-bottom: 12rpx;
|
||||
padding: 12rpx 16rpx;
|
||||
@ -979,6 +1388,25 @@ export default {
|
||||
.tool-info-text {
|
||||
font-size: 26rpx;
|
||||
color: #666;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 6rpx 14rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.tool-info-text--blue {
|
||||
color: #2f7dff;
|
||||
background-color: #eaf2ff;
|
||||
}
|
||||
|
||||
.tool-info-text--gray {
|
||||
color: #909399;
|
||||
background-color: #f0f2f5;
|
||||
}
|
||||
|
||||
.tool-info-text--orange {
|
||||
color: #ff7d00;
|
||||
background-color: #fff3e6;
|
||||
}
|
||||
|
||||
.detail-tab {
|
||||
@ -1003,6 +1431,33 @@ export default {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.detail-tab-summary--em {
|
||||
color: #2f7dff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.detail-total {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
margin-top: 24rpx;
|
||||
padding: 16rpx 24rpx;
|
||||
background-color: #f6f8fc;
|
||||
border: 1rpx solid #e6ebf5;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.detail-total-text {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.detail-total-num {
|
||||
font-weight: 700;
|
||||
color: #2f7dff;
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
|
||||
.detail-empty-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -1010,7 +1465,7 @@ export default {
|
||||
height: 260rpx;
|
||||
color: #999;
|
||||
font-size: 26rpx;
|
||||
background-color: #fafcff;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.empty {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user