From 173771f60c7e8e15b9c3855fd3d4645a9d07ccac Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Tue, 9 Jun 2026 18:20:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E5=A4=8D?= =?UTF-8?q?=E6=A0=B8=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages.json | 2 +- pages/home/edit-quick-actions.vue | 4 +- pages/index/index.vue | 4 +- ...r-review-shipping.vue => order-review.vue} | 132 ++++++++++++++++-- 4 files changed, 127 insertions(+), 15 deletions(-) rename pages/work/order/{scatter-review-shipping.vue => order-review.vue} (88%) diff --git a/pages.json b/pages.json index 2f7eb3f..980b0fa 100644 --- a/pages.json +++ b/pages.json @@ -192,7 +192,7 @@ } }, { - "path" : "pages/work/order/scatter-review-shipping", + "path" : "pages/work/order/order-review", "style" : { "titleNView": false diff --git a/pages/home/edit-quick-actions.vue b/pages/home/edit-quick-actions.vue index be5e114..d15f5f9 100644 --- a/pages/home/edit-quick-actions.vue +++ b/pages/home/edit-quick-actions.vue @@ -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) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 3f35ca5..29cef6f 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -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))))); diff --git a/pages/work/order/scatter-review-shipping.vue b/pages/work/order/order-review.vue similarity index 88% rename from pages/work/order/scatter-review-shipping.vue rename to pages/work/order/order-review.vue index ec3193f..d1879b3 100644 --- a/pages/work/order/scatter-review-shipping.vue +++ b/pages/work/order/order-review.vue @@ -71,13 +71,11 @@ + 复核状态:{{ getStatusText(item.status) }} 波次号:{{ item.waveNo || '--' }} - 拣货员:{{ item.pickerName || '--' }} - 车号:{{ item.cartNo || '--' }} - 未复核 {{ item.unreviewedCount }} - {{ getStatusText(item.status) }} + 打印状态:{{ getPrintStatusText(item) }} @@ -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) {