修改订单复核页面
This commit is contained in:
parent
66ee3043f5
commit
173771f60c
@ -192,7 +192,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/work/order/scatter-review-shipping",
|
||||
"path" : "pages/work/order/order-review",
|
||||
"style" :
|
||||
{
|
||||
"titleNView": false
|
||||
|
||||
@ -315,7 +315,7 @@
|
||||
const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询'));
|
||||
const isOrderPicking = menuName === '订单拣货' || (menuName.includes('订单') && menuName.includes('拣货'));
|
||||
const isScatterWaveStrategy = menuName === '散单波次策略' || (menuName.includes('散单') && menuName.includes('波次'));
|
||||
const isScatterReviewShipping = menuName === '散单复核发货' || (menuName.includes('散单') && menuName.includes('复核') && menuName.includes('发货'));
|
||||
const isScatterReviewShipping = menuName === '散单复核发货' || menuName === '订单复核' || (menuName.includes('散单') && menuName.includes('复核') && menuName.includes('发货'));
|
||||
const isGrouponPickingDetail = menuName === '团购拣货详情' || (menuName.includes('团购') && menuName.includes('拣货') && menuName.includes('详情'));
|
||||
const rawPath = item?.component || item?.path || '';
|
||||
const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : '';
|
||||
@ -335,7 +335,7 @@
|
||||
: (isScatterWaveStrategy
|
||||
? '/pages/work/order/scatter-wave-strategy'
|
||||
: (isScatterReviewShipping
|
||||
? '/pages/work/order/scatter-review-shipping'
|
||||
? '/pages/work/order/order-review'
|
||||
: (isGrouponPickingDetail ? '/pages/work/order/groupon-picking-detail' : normalizedPath))));
|
||||
|
||||
if (!targetPath) {
|
||||
|
||||
@ -1150,7 +1150,7 @@
|
||||
const isOrderPicking = menuName === '订单拣货' || (menuName.includes('订单') && menuName.includes('拣货'));
|
||||
const isScatterWaveStrategy = menuName === '散单波次策略' || (menuName.includes('散单') && menuName.includes('波次'));
|
||||
const isScatterPickingDetail = menuName === '散单拣货详情' || (menuName.includes('散单') && menuName.includes('拣货') && menuName.includes('详情'));
|
||||
const isScatterReviewShipping = menuName === '散单复核发货' || (menuName.includes('散单') && menuName.includes('复核') && menuName.includes('发货'));
|
||||
const isScatterReviewShipping = menuName === '散单复核发货' || menuName === '订单复核' || (menuName.includes('散单') && menuName.includes('复核') && menuName.includes('发货'));
|
||||
const isGrouponPickingDetail = menuName === '团购拣货详情' || (menuName.includes('团购') && menuName.includes('拣货') && menuName.includes('详情'));
|
||||
const rawPath = item?.component || item?.path || '';
|
||||
const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : '';
|
||||
@ -1170,7 +1170,7 @@
|
||||
: (isScatterWaveStrategy
|
||||
? '/pages/work/order/scatter-wave-strategy'
|
||||
: (isScatterReviewShipping
|
||||
? '/pages/work/order/scatter-review-shipping'
|
||||
? '/pages/work/order/order-review'
|
||||
: (isScatterPickingDetail
|
||||
? '/pages/work/order/scatter-picking-detail'
|
||||
: (isGrouponPickingDetail ? '/pages/work/order/groupon-picking-detail' : normalizedPath)))));
|
||||
|
||||
@ -71,13 +71,11 @@
|
||||
<view v-for="item in displayOrderList" :key="item.id" class="record-item" @click="goPickGoodsDetail(item)">
|
||||
<view class="record-main">
|
||||
<view class="record-left">
|
||||
<view class="record-line"><text class="record-label">复核状态:</text><text class="record-value" :class="{ 'record-value--fin': getStatusText(item.status) === '已完成' }">{{ getStatusText(item.status) }}</text></view>
|
||||
<view class="record-line"><text class="record-label">波次号:</text><text class="record-value">{{ item.waveNo || '--' }}</text></view>
|
||||
<view class="record-line"><text class="record-label">拣货员:</text><text class="record-value">{{ item.pickerName || '--' }}</text></view>
|
||||
<view class="record-line"><text class="record-label">车号:</text><text class="record-value">{{ item.cartNo || '--' }}</text></view>
|
||||
</view>
|
||||
<view class="record-right">
|
||||
<text class="record-count">未复核 {{ item.unreviewedCount }}</text>
|
||||
<text class="record-status">{{ getStatusText(item.status) }}</text>
|
||||
<view class="record-line record-line--print"><text class="record-label">打印状态:</text><text class="record-value" :class="{ 'record-value--bound': item.hasBoundPrintStation }">{{ getPrintStatusText(item) }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="record-footer" @click.stop>
|
||||
@ -190,7 +188,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: '散单复核发货',
|
||||
title: '订单复核',
|
||||
grabCount: 0,
|
||||
keyword: '',
|
||||
showUnboundPrintStationOnly: false,
|
||||
@ -656,6 +654,39 @@
|
||||
return {};
|
||||
},
|
||||
normalizeScanOrderResult(payload) {
|
||||
const listType = String(payload?.list_type || payload?.listType || '').trim();
|
||||
const matchType = String(payload?.match_type || payload?.matchType || '').trim();
|
||||
|
||||
// 扁平化订单列表模式(散单:运单号/波次号命中)
|
||||
if (listType === 'single') {
|
||||
const list = Array.isArray(payload?.list) ? payload.list : [];
|
||||
return {
|
||||
listType: 'single',
|
||||
matchType,
|
||||
list: list.map(item => this.normalizeScanOrderItem(item)),
|
||||
total: Number(payload?.total ?? payload?.count ?? list.length)
|
||||
};
|
||||
}
|
||||
|
||||
// 嵌套波次结构模式(团单:车号命中)
|
||||
if (listType === 'group') {
|
||||
const waves = Array.isArray(payload?.waves || payload?.list) ? (payload?.waves || payload?.list) : [];
|
||||
return {
|
||||
listType: 'group',
|
||||
matchType,
|
||||
waves: waves.map(wave => ({
|
||||
waveNo: String(wave?.wave_no || wave?.waveNo || '').trim(),
|
||||
waveId: wave?.wave_id ?? wave?.waveId ?? wave?.id ?? '',
|
||||
cartNo: String(wave?.cart_code || wave?.cartCode || wave?.cart_no || wave?.cartNo || '').trim(),
|
||||
pickerName: String(wave?.picker_name || wave?.pickerName || '').trim(),
|
||||
status: String(wave?.status || 'pending'),
|
||||
list: Array.isArray(wave?.list || wave?.items) ? (wave?.list || wave?.items).map(item => this.normalizeScanOrderItem(item)) : []
|
||||
})),
|
||||
total: Number(payload?.total ?? payload?.count ?? waves.length)
|
||||
};
|
||||
}
|
||||
|
||||
// 单订单详情模式(运单号命中但无波次信息)
|
||||
const order = payload?.order && typeof payload.order === 'object' ? payload.order : {};
|
||||
const items = Array.isArray(payload?.items) ? payload.items : [];
|
||||
const firstItem = items[0] && typeof items[0] === 'object' ? items[0] : {};
|
||||
@ -683,12 +714,12 @@
|
||||
|| order?.waybill_code
|
||||
|| ''
|
||||
).trim();
|
||||
const matchType = String(payload?.match_type || '').trim();
|
||||
const cartMatchView = payload?.cart_match_view && typeof payload.cart_match_view === 'object'
|
||||
? payload.cart_match_view
|
||||
: null;
|
||||
|
||||
return {
|
||||
listType: 'detail',
|
||||
matchType,
|
||||
cartMatchView,
|
||||
orderId,
|
||||
@ -700,7 +731,81 @@
|
||||
logs: Array.isArray(payload?.logs) ? payload.logs : []
|
||||
};
|
||||
},
|
||||
normalizeScanOrderItem(item) {
|
||||
if (!item || typeof item !== 'object') return {};
|
||||
return {
|
||||
id: item?.id ?? item?.order_id ?? item?.orderId ?? '',
|
||||
orderId: item?.order_id ?? item?.orderId ?? item?.id ?? '',
|
||||
waybillNo: String(item?.waybill_no || item?.waybillCode || item?.waybill_code || '').trim(),
|
||||
waveNo: String(item?.wave_no || item?.waveNo || '').trim(),
|
||||
pickerName: String(item?.picker_name || item?.pickerName || '').trim(),
|
||||
cartNo: String(item?.cart_code || item?.cartCode || item?.cart_no || item?.cartNo || '').trim(),
|
||||
status: String(item?.status || 'pending'),
|
||||
recheckStatus: String(item?.recheck_status || item?.recheckStatus || '').trim().toLowerCase(),
|
||||
detail: item?.detail && typeof item.detail === 'object' ? item.detail : null,
|
||||
items: Array.isArray(item?.items) ? item.items : [],
|
||||
expresses: Array.isArray(item?.expresses) ? item.expresses : [],
|
||||
logs: Array.isArray(item?.logs) ? item.logs : []
|
||||
};
|
||||
},
|
||||
handleScanOrderSuccess(result) {
|
||||
if (!result) {
|
||||
uni.showToast({
|
||||
title: '未查询到订单',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const listType = result?.listType || '';
|
||||
|
||||
// 散单模式(list_type=single):刷新当前页面列表
|
||||
if (listType === 'single') {
|
||||
const flatList = Array.isArray(result?.list) ? result.list : [];
|
||||
this.orderList = flatList.map((item, index) => ({
|
||||
id: String(item?.id || item?.orderId || `scan-${Date.now()}-${index}`),
|
||||
waveNo: item?.waveNo || '--',
|
||||
pickerName: item?.pickerName || '--',
|
||||
cartNo: item?.cartNo || '--',
|
||||
unreviewedCount: item?.recheckStatus === 'fin' ? 0 : 1,
|
||||
status: item?.status || 'pending',
|
||||
waybillCode: item?.waybillNo || '',
|
||||
recheckStatus: item?.recheckStatus || ''
|
||||
}));
|
||||
this.paginationTotal = result?.total ?? flatList.length;
|
||||
this.goodsInfoList = [];
|
||||
uni.showToast({
|
||||
title: `共匹配 ${flatList.length} 条订单`,
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 团单模式(list_type=group):按波次嵌套展示
|
||||
if (listType === 'group') {
|
||||
const waves = Array.isArray(result?.waves) ? result.waves : [];
|
||||
this.orderList = waves.map((wave, wi) => {
|
||||
const subList = Array.isArray(wave?.list) ? wave.list : [];
|
||||
return {
|
||||
id: String(wave?.waveId || wave?.waveNo || `wave-${Date.now()}-${wi}`),
|
||||
waveNo: wave?.waveNo || '--',
|
||||
pickerName: wave?.pickerName || '--',
|
||||
cartNo: wave?.cartNo || '--',
|
||||
unreviewedCount: subList.filter(s => String(s?.recheckStatus || '') !== 'fin').length,
|
||||
status: wave?.status || 'pending',
|
||||
children: subList
|
||||
};
|
||||
});
|
||||
this.paginationTotal = this.orderList.length;
|
||||
this.goodsInfoList = [];
|
||||
uni.showToast({
|
||||
title: `共匹配 ${this.orderList.length} 个波次`,
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 单订单详情模式(运单号命中,无波次信息)
|
||||
const order = result?.order || {};
|
||||
const orderId = Number(result?.orderId || 0);
|
||||
if (!orderId) {
|
||||
@ -848,11 +953,18 @@
|
||||
},
|
||||
getStatusText(status) {
|
||||
const map = {
|
||||
pending: '待拣货',
|
||||
picking: '拣货中',
|
||||
done: '已完成'
|
||||
pending: '待复核',
|
||||
picking: '复核中',
|
||||
done: '已复核',
|
||||
fin: '已完成',
|
||||
};
|
||||
return map[status] || '待拣货';
|
||||
return map[status] || '待复核';
|
||||
},
|
||||
getPrintStatusText(item) {
|
||||
if (item?.hasBoundPrintStation) {
|
||||
return '已绑定';
|
||||
}
|
||||
return '未绑定';
|
||||
},
|
||||
goPickGoodsDetail(item) {
|
||||
if (!item) {
|
||||
Loading…
x
Reference in New Issue
Block a user