From 2fb2b089ebf8a0507558cac4ea4181abbbbf019a Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Thu, 7 May 2026 18:20:41 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=95=A3=E5=8D=95?= =?UTF-8?q?=E6=B3=A2=E6=AC=A1=E7=AD=96=E7=95=A5=E9=A1=B5=E9=9D=A2=E5=B9=B6?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=AE=A2=E5=8D=95=E6=8B=A3=E8=B4=A7=E6=B5=81?= =?UTF-8?q?=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/request/apis.js | 22 ++ pages.json | 7 + pages/home/edit-quick-actions.vue | 5 +- pages/index/index.vue | 5 +- pages/work/order/detail.vue | 361 +++++++++++++++------ pages/work/order/picking.vue | 281 ++++++++++------ pages/work/order/scatter-wave-strategy.vue | 219 +++++++++++++ 7 files changed, 710 insertions(+), 190 deletions(-) create mode 100644 pages/work/order/scatter-wave-strategy.vue diff --git a/core/request/apis.js b/core/request/apis.js index e07d370..91b215d 100644 --- a/core/request/apis.js +++ b/core/request/apis.js @@ -217,6 +217,28 @@ export default { auth: true, method: "POST", isSystemApi: true + }, + items: { + path: "pick.items", + auth: true, + method: "POST", + isSystemApi: true + }, + complete: { + path: "pick.complete", + auth: true, + method: "POST", + isSystemApi: true + } + }, + order: { + wave: { + waveStrategyList: { + path: "order.wave.waveStrategyList", + auth: true, + method: "POST", + isSystemApi: true + } } }, print: { diff --git a/pages.json b/pages.json index 6a3517f..2fc234a 100644 --- a/pages.json +++ b/pages.json @@ -155,6 +155,13 @@ { "titleNView": false } + }, + { + "path" : "pages/work/order/scatter-wave-strategy", + "style" : + { + "titleNView": false + } } ], diff --git a/pages/home/edit-quick-actions.vue b/pages/home/edit-quick-actions.vue index 19c4a26..cd38048 100644 --- a/pages/home/edit-quick-actions.vue +++ b/pages/home/edit-quick-actions.vue @@ -314,6 +314,7 @@ const menuName = String(item?.name || '').trim(); const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询')); const isOrderPicking = menuName === '订单拣货' || (menuName.includes('订单') && menuName.includes('拣货')); + const isScatterWaveStrategy = menuName === '散单波次策略' || (menuName.includes('散单') && menuName.includes('波次')); const rawPath = item?.component || item?.path || ''; const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : ''; const isRelocation = menuName === '移库作业' || normalizedPath === '/pages/work/storage/relocation'; @@ -327,7 +328,9 @@ } const targetPath = isGoodsQuery ? '/pages/work/product/query' - : (isOrderPicking ? '/pages/work/order/picking' : normalizedPath); + : (isOrderPicking + ? '/pages/work/order/picking' + : (isScatterWaveStrategy ? '/pages/work/order/scatter-wave-strategy' : normalizedPath)); if (!targetPath) { uni.showToast({ diff --git a/pages/index/index.vue b/pages/index/index.vue index c7ff6c2..49e9583 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1148,6 +1148,7 @@ const menuName = String(item?.name || '').trim(); const isGoodsQuery = menuName === '商品查询' || (menuName.includes('商品') && menuName.includes('查询')); const isOrderPicking = menuName === '订单拣货' || (menuName.includes('订单') && menuName.includes('拣货')); + const isScatterWaveStrategy = menuName === '散单波次策略' || (menuName.includes('散单') && menuName.includes('波次')); const rawPath = item?.component || item?.path || ''; const normalizedPath = rawPath ? (rawPath.startsWith('/') ? rawPath : `/${rawPath}`) : ''; const isRelocation = menuName === '移库作业' || normalizedPath === '/pages/work/storage/relocation'; @@ -1161,7 +1162,9 @@ } const targetPath = isGoodsQuery ? '/pages/work/product/query' - : (isOrderPicking ? '/pages/work/order/picking' : normalizedPath); + : (isOrderPicking + ? '/pages/work/order/picking' + : (isScatterWaveStrategy ? '/pages/work/order/scatter-wave-strategy' : normalizedPath)); if (!targetPath) { uni.showToast({ diff --git a/pages/work/order/detail.vue b/pages/work/order/detail.vue index 6bfd21b..aa090f5 100644 --- a/pages/work/order/detail.vue +++ b/pages/work/order/detail.vue @@ -4,14 +4,8 @@ - - {{ orderInfo.orderNo || '--' }} - {{ pickModeText }} - - 客户:{{ orderInfo.customerName || '--' }} 波次:{{ orderInfo.waveNo || '--' }} - 状态:{{ statusText }} - 拣货进度:{{ orderInfo.pickedQty || 0 }}/{{ orderInfo.needQty || 0 }} + 订单总数:{{ orderInfo.needQty || 0 }} @@ -22,21 +16,30 @@ - + 暂无拣货明细 + {{ line.skuName }} 无条码核对 库位报错 已拣 - {{ line.space }} - SKU:{{ line.skuCode }} - 条码:{{ line.barcode || '--' }} - 篮号:{{ getBasketNoText(line) }} - 应拣:{{ line.needQty }} - 已拣:{{ line.pickedQty }} + + + + 商品名称:{{ line.skuName || '--' }} + 库位:{{ line.space || '--' }} + 商品条码:{{ line.barcode || '--' }} + 数量:{{ line.needQty }} + + + + + 上一个 + {{ currentDetailIndex + 1 }}/{{ detailList.length }} + 下一个 @@ -50,6 +53,7 @@ 完成拣货 已完成 @@ -90,9 +94,12 @@ data() { return { title: '拣货详情', - pickMode: 'F', + loading: false, + completing: false, orderInfo: { id: '', + orderId: 0, + orderItemId: 0, orderNo: '', customerName: '', waveNo: '', @@ -101,6 +108,7 @@ pickedQty: 0 }, detailList: [], + currentDetailIndex: 0, locationErrorPopupVisible: false, currentActionLineIndex: -1, locationErrorRemark: '', @@ -109,9 +117,6 @@ } }, computed: { - pickModeText() { - return this.pickMode === 'E' ? 'E拣货(边拣边分)' : 'F拣货(先拣后分)'; - }, statusText() { const map = { pending: '待拣货', @@ -125,6 +130,16 @@ return null; } return this.detailList[this.currentActionLineIndex] || null; + }, + currentDetailList() { + const line = this.detailList[this.currentDetailIndex]; + return line ? [line] : []; + }, + hasPrevDetail() { + return this.currentDetailIndex > 0; + }, + hasNextDetail() { + return this.currentDetailIndex < this.detailList.length - 1; } }, onLoad(options) { @@ -133,15 +148,10 @@ }); this.safeDispatchBroadcast('start'); - if (options && options.mode) { - const mode = String(options.mode || '').toUpperCase(); - if (mode === 'F' || mode === 'E') { - this.pickMode = mode; - } - } - this.orderInfo = { id: options?.id || '', + orderId: Number(options?.orderId || 0), + orderItemId: Number(options?.orderItemId || 0), orderNo: options?.orderNo || '--', customerName: options?.customerName || '--', waveNo: options?.waveNo || '--', @@ -149,8 +159,7 @@ needQty: Number(options?.needQty || 0), pickedQty: Number(options?.pickedQty || 0) }; - - this.detailList = this.buildMockDetails(this.orderInfo); + this.loadOrderDetail(); }, onShow() { this.safeDispatchBroadcast('setCallbacks', { @@ -165,6 +174,157 @@ this.safeDispatchBroadcast('stop'); }, methods: { + getApiErrorMessage(error, fallback = '请求失败') { + const message = error?.message || error?.msg || error?.errMsg || error?.data?.message; + return String(message || fallback); + }, + buildItemsQueryParams() { + return { + order_id: Number(this.orderInfo.orderId || 0), + order_item_id: Number(this.orderInfo.orderItemId || 0), + full_display: true + }; + }, + buildCompletePickingParams() { + return { + order_id: Number(this.orderInfo.orderId || 0), + order_item_id: Number(this.orderInfo.orderItemId || 0), + details: this.detailList.map(line => ({ + id: line.lineId, + picked_qty: Number(line.pickedQty || 0), + need_qty: Number(line.needQty || 0) + })) + }; + }, + extractDetailPayload(response) { + const candidates = [ + response?.data?.data, + response?.data, + response?.result, + response + ]; + for (let i = 0; i < candidates.length; i += 1) { + const current = candidates[i]; + if (current && typeof current === 'object' && !Array.isArray(current)) { + return current; + } + } + return {}; + }, + extractDetailList(payload, response) { + const candidates = [ + Array.isArray(payload) ? payload : null, + payload?.list, + payload?.details, + payload?.rows, + payload?.items, + payload?.data?.list, + payload?.data?.details, + payload?.summary?.list, + payload?.summary?.details, + response?.data?.list, + response?.data?.rows, + response?.data?.items, + response?.data?.data?.list, + response?.data?.data?.rows, + response?.data?.data?.items, + response?.list, + response?.rows, + response?.items + ]; + for (let i = 0; i < candidates.length; i += 1) { + if (Array.isArray(candidates[i])) { + return candidates[i]; + } + } + return []; + }, + extractItemsResponse(response) { + const payload = this.extractDetailPayload(response); + const list = this.extractDetailList(payload, response); + return { + payload, + list + }; + }, + syncOrderInfoFromPayload(payload) { + if (!payload || typeof payload !== 'object') { + return; + } + this.orderInfo.orderNo = payload.order_no || payload.orderNo || this.orderInfo.orderNo; + this.orderInfo.customerName = payload.customer_name || payload.customerName || this.orderInfo.customerName; + this.orderInfo.waveNo = payload.wave_no || payload.waveNo || this.orderInfo.waveNo; + const nextStatus = payload.picking_status || payload.status; + if (nextStatus) { + this.orderInfo.status = this.normalizeStatus(nextStatus); + } + }, + async loadOrderDetail() { + const params = this.buildItemsQueryParams(); + if (!params.order_id || !params.order_item_id) { + uni.showToast({ + title: '缺少订单参数', + icon: 'none' + }); + return; + } + this.loading = true; + try { + const response = await this.$http('pick.items', params); + const parsed = this.extractItemsResponse(response); + this.syncOrderInfoFromPayload(parsed.payload); + const list = parsed.list; + this.detailList = list.map((item, index) => this.normalizeDetailItem(item, index)); + this.currentDetailIndex = 0; + this.recalculateOrderProgress(); + } catch (error) { + this.detailList = []; + this.currentDetailIndex = 0; + this.recalculateOrderProgress(); + uni.showToast({ + title: this.getApiErrorMessage(error, '明细加载失败'), + icon: 'none' + }); + } finally { + this.loading = false; + } + }, + normalizeStatus(value) { + const text = String(value || '').toLowerCase(); + if (!text) { + return 'pending'; + } + if (['fin', 'finished', 'done', 'completed', 'complete', 'success'].includes(text)) { + return 'done'; + } + if (['picking', 'pick', 'doing', 'processing', 'progress', 'part'].includes(text)) { + return 'picking'; + } + return 'pending'; + }, + normalizeDetailItem(item, index) { + const source = item && typeof item === 'object' ? item : {}; + const needQty = Number(source.need_qty || source.needQty || source.plan_qty || source.planQty || source.qty || source.total_qty || 0); + const pickedQty = Number(source.picked_qty || source.pickedQty || source.done_qty || source.doneQty || source.finish_qty || source.finishQty || source.scanned_qty || source.scannedQty || 0); + const basketNo = source.basket_no || source.basketNo || source.basket_code || source.bucket_no || ''; + const space = source.space_name || source.spaceName || source.space || source.location || source.location_code || source.bin_code || source.slot || '--'; + const skuCode = source.sku_code || source.skuCode || source.sku || source.product_code || source.goods_code || '--'; + const skuName = source.sku_name || source.skuName || source.name || source.product_name || source.goods_name || '--'; + const imageUrl = source.image || source.image_url || source.product_image || source.goods_image || source.pic || source.cover || ''; + return { + lineId: source.line_id || source.lineId || source.detail_id || source.detailId || source.id || source.order_item_id || `${this.orderInfo.orderNo || 'detail'}-${index + 1}`, + skuName, + skuCode, + imageUrl, + barcode: source.barcode || source.code || source.ean || '', + basketNo, + space, + needQty, + pickedQty, + noBarcodeVerified: Boolean(source.no_barcode_verified || source.noBarcodeVerified), + locationErrorReported: Boolean(source.location_error_reported || source.locationErrorReported) + }; + }, getBasketNoText(line) { if (!line || typeof line !== 'object') { return '--'; @@ -408,6 +568,7 @@ pickedQty: Number(targetLine.needQty || 0) }; this.$set(this.detailList, index, updatedLine); + this.currentDetailIndex = index; this.recalculateOrderProgress(); this.emitOrderUpdate(); @@ -462,66 +623,54 @@ if (this.orderInfo.status !== 'picking') { return; } - this.orderInfo.status = 'done'; - this.detailList = this.detailList.map(line => ({ - ...line, - pickedQty: Number(line.needQty || 0) - })); - this.recalculateOrderProgress(); - this.emitOrderUpdate(); - uni.showToast({ - title: '拣货完成', - icon: 'success' - }); - setTimeout(() => { - uni.navigateBack({ - delta: 1 - }); - }, 300); + this.submitCompletePicking(); }, - buildMockDetails(orderInfo) { - const total = Number(orderInfo.needQty || 0); - const picked = Number(orderInfo.pickedQty || 0); - const firstNeed = Math.max(Math.floor(total * 0.4), 1); - const secondNeed = Math.max(Math.floor(total * 0.35), 1); - const thirdNeed = Math.max(total - firstNeed - secondNeed, 1); - const firstPicked = Math.min(firstNeed, picked); - const secondPicked = Math.min(secondNeed, Math.max(picked - firstPicked, 0)); - const thirdPicked = Math.min(thirdNeed, Math.max(picked - firstPicked - secondPicked, 0)); - - return [ - { - lineId: `${orderInfo.orderNo}-1`, - skuName: '陶瓷马克杯 350ml', - skuCode: 'SKU-CP-350', - barcode: '6901001000011', - basketNo: 'A01', - space: 'A-01-03', - needQty: firstNeed, - pickedQty: firstPicked - }, - { - lineId: `${orderInfo.orderNo}-2`, - skuName: '密封保鲜盒 2L', - skuCode: 'SKU-FB-2000', - barcode: '6901001000028', - basketNo: 'B02', - space: 'B-02-08', - needQty: secondNeed, - pickedQty: secondPicked - }, - { - lineId: `${orderInfo.orderNo}-3`, - skuName: '厨房清洁布 5片装', - skuCode: 'SKU-KC-005', - barcode: '6901001000035', - basketNo: 'C03', - space: 'C-03-12', - needQty: thirdNeed, - pickedQty: thirdPicked - } - ]; - } + showPrevDetail() { + if (!this.hasPrevDetail) { + return; + } + this.currentDetailIndex -= 1; + }, + showNextDetail() { + if (!this.hasNextDetail) { + return; + } + this.currentDetailIndex += 1; + }, + async submitCompletePicking() { + if (this.completing) { + return; + } + this.completing = true; + try { + const params = this.buildCompletePickingParams(); + await this.$http('pick.complete', params); + this.orderInfo.status = 'done'; + this.detailList = this.detailList.map(line => ({ + ...line, + pickedQty: Number(line.needQty || 0) + })); + this.recalculateOrderProgress(); + this.emitOrderUpdate(); + uni.showToast({ + title: '拣货完成', + icon: 'success' + }); + setTimeout(() => { + uni.navigateBack({ + delta: 1 + }); + }, 300); + } catch (error) { + uni.showToast({ + title: this.getApiErrorMessage(error, '完成拣货失败'), + icon: 'none' + }); + } finally { + this.completing = false; + } + }, + } } @@ -552,14 +701,6 @@ color: #303133; } - .mode-tag { - font-size: 22rpx; - color: #2979ff; - background: #edf4ff; - padding: 6rpx 12rpx; - border-radius: 16rpx; - } - .summary-row, .detail-row { display: flex; @@ -612,6 +753,16 @@ padding: 0 24rpx 160rpx; } + .detail-empty { + background: #fff; + border-radius: 14rpx; + padding: 30rpx 20rpx; + text-align: center; + font-size: 24rpx; + color: #909399; + margin-bottom: 12rpx; + } + .detail-item { background: #fff; border-radius: 14rpx; @@ -619,6 +770,16 @@ margin-bottom: 12rpx; } + .detail-main { + display: flex; + align-items: flex-start; + } + + .detail-main-info { + flex: 1; + margin-left: 14rpx; + } + .detail-head { display: flex; justify-content: space-between; @@ -672,6 +833,18 @@ border-radius: 12rpx; } + .switch-row { + display: flex; + align-items: center; + justify-content: space-between; + padding: 8rpx 0 14rpx; + } + + .switch-index { + font-size: 24rpx; + color: #606266; + } + .action-bar { position: fixed; left: 0; diff --git a/pages/work/order/picking.vue b/pages/work/order/picking.vue index 0f2ae2c..21a90ab 100644 --- a/pages/work/order/picking.vue +++ b/pages/work/order/picking.vue @@ -25,25 +25,6 @@ - - 拣货模式 - - - F拣货(先拣后分) - - - E拣货(边拣边分) - - - + + 波次号:{{ headerSummary.waveNo || '--' }} + 总商品数量:{{ headerSummary.quantityTotal }} + + 待复核:{{ headerSummary.pendingReviewCount }} + 已复核:{{ headerSummary.reviewedCount }} + + @@ -64,17 +53,13 @@ - - {{ item.orderNo }} - {{ getStatusText(item.status) }} - - 客户:{{ item.customerName || '--' }} - 波次:{{ item.waveNo || '--' }} - SKU数:{{ item.skuCount }} - 应拣数量:{{ item.needQty }} - 已拣数量:{{ item.pickedQty }} + 货主:{{ item.ownerName || '--' }}{{ getPickingStatusText(item.pickingStatus) }} + 库位:{{ item.spaceName || '--' }} + 库位状态:{{ getSpaceStatusText(item.spaceStatus) }} + 商品数量:{{ item.quantity }} + 复核状态:{{ getReviewStatusText(item.reviewed, item.inspectionStatus) }} - {{ item.createTime }} + 进入拣货 @@ -94,8 +79,13 @@ return { title: '订单拣货', keyword: '', - pickMode: 'F', fullDisplay: true, + headerSummary: { + waveNo: '--', + pendingReviewCount: 0, + reviewedCount: 0, + quantityTotal: 0 + }, loading: false, status: 'all', pageSize: 10, @@ -131,12 +121,6 @@ if (options && options.status) { this.status = options.status; } - if (options && options.mode) { - const mode = String(options.mode || '').toUpperCase(); - if (mode === 'F' || mode === 'E') { - this.pickMode = mode; - } - } if (options && options.waybill_code) { this.keyword = String(options.waybill_code || '').trim(); this.handleSearch({ @@ -221,16 +205,48 @@ icon: 'none' }); }, - switchPickMode(mode) { - if (mode !== 'F' && mode !== 'E') { - return; - } - this.pickMode = mode; - }, getApiErrorMessage(error, fallback = '请求失败') { const message = error?.message || error?.msg || error?.errMsg || error?.data?.message; return String(message || fallback); }, + resetHeaderSummary() { + this.headerSummary = { + waveNo: '--', + pendingReviewCount: 0, + reviewedCount: 0, + quantityTotal: 0 + }; + }, + extractHeaderSummary(response) { + const dataSource = (response?.data?.data && typeof response.data.data === 'object' && !Array.isArray(response.data.data)) + ? response.data.data + : ((response?.data && typeof response.data === 'object' && !Array.isArray(response.data)) + ? response.data + : ((response?.result && typeof response.result === 'object' && !Array.isArray(response.result)) + ? response.result + : ((response && typeof response === 'object' && !Array.isArray(response)) ? response : null))); + + if (!dataSource) { + this.resetHeaderSummary(); + return; + } + + const summary = dataSource.summary && typeof dataSource.summary === 'object' && !Array.isArray(dataSource.summary) + ? dataSource.summary + : {}; + + const toNumber = value => { + const num = Number(value); + return Number.isNaN(num) ? 0 : num; + }; + + this.headerSummary = { + waveNo: dataSource.wave_no || dataSource.waveNo || summary.wave_no || summary.waveNo || '--', + pendingReviewCount: toNumber(summary.pending_review_count ?? summary.pendingReviewCount ?? dataSource.pending_review_count ?? dataSource.pendingReviewCount), + reviewedCount: toNumber(summary.reviewed_count ?? summary.reviewedCount ?? dataSource.reviewed_count ?? dataSource.reviewedCount), + quantityTotal: toNumber(summary.quantity_total ?? summary.quantityTotal ?? dataSource.quantity_total ?? dataSource.quantityTotal) + }; + }, normalizeStatus(value) { const text = String(value || '').toLowerCase(); if (!text) { @@ -269,17 +285,34 @@ }, normalizeOrderItem(item, index) { const source = item && typeof item === 'object' ? item : {}; - const inspectionStatus = source.inspection_status || source.pick_status || source.status; + const summary = source.summary && typeof source.summary === 'object' ? source.summary : {}; + const locationSpace = source.location_space && typeof source.location_space === 'object' ? source.location_space : {}; + const storeWarehouse = source.store_warehouse && typeof source.store_warehouse === 'object' ? source.store_warehouse : {}; + const detailList = Array.isArray(source.details) + ? source.details + : (Array.isArray(summary.details) ? summary.details : []); + const pickingStatus = source.picking_status || source.pick_status || source.status || summary.picking_status; + const inspectionStatus = source.inspection_status || summary.inspection_status; return { id: source.id || source.order_id || source.pick_id || source.waybill_code || `pick_${index}`, + orderId: Number(source.order_id || source.orderId || 0), + orderItemId: Number(source.order_item_id || source.orderItemId || 0), orderNo: source.order_no || source.order_code || source.waybill_code || source.waybillCode || '--', customerName: source.customer_name || source.consignee || source.receiver_name || '--', - waveNo: source.wave_no || source.wave_code || source.batch_no || '--', - skuCount: Number(source.sku_count || source.item_count || source.goods_count || source.detail_count || 0), - needQty: Number(source.need_qty || source.pick_qty || source.total_qty || source.total_quantity || 0), - pickedQty: Number(source.picked_qty || source.done_qty || source.finish_qty || source.finished_qty || source.finished_qty || 0), - status: this.normalizeStatus(inspectionStatus), - createTime: source.created_at || source.create_time || source.createdAt || '--' + waveNo: source.wave_no || summary.wave_no || source.wave_code || source.batch_no || '--', + ownerName: storeWarehouse.store_remask || storeWarehouse.store_name || source.owner_name || source.ownerName || '--', + quantity: Number(source.quantity || summary.quantity || source.need_qty || summary.need_qty || 0), + spaceName: source.space_name || locationSpace.space_code || locationSpace.custom_name || summary.space_name || '--', + spaceStatus: locationSpace.space_status || source.space_status || '', + pickingStatus: pickingStatus || 'pending', + inspectionStatus: inspectionStatus || '', + reviewed: Boolean(source.reviewed), + skuCount: Number(summary.sku_count || source.sku_count || summary.item_count || source.item_count || source.goods_count || source.detail_count || 0), + needQty: Number(summary.need_qty || source.need_qty || summary.pick_qty || source.pick_qty || summary.total_qty || source.total_qty || source.total_quantity || 0), + pickedQty: Number(summary.picked_qty || source.picked_qty || summary.done_qty || source.done_qty || source.finish_qty || source.finished_qty || 0), + status: this.normalizeStatus(pickingStatus), + createTime: source.created_at || source.create_time || source.createdAt || '--', + detailList }; }, applyFilteredList(resetPage = true) { @@ -296,6 +329,7 @@ const waybillCode = String(this.keyword || '').trim(); if (!waybillCode) { this.fullList = []; + this.resetHeaderSummary(); this.applyFilteredList(true); if (!silentTip) { uni.showToast({ @@ -312,12 +346,14 @@ waybill_code: waybillCode, full_display: Boolean(this.fullDisplay) }); + this.extractHeaderSummary(response); const orderList = this.extractOrderList(response) .map((item, index) => this.normalizeOrderItem(item, index)); this.fullList = orderList; this.applyFilteredList(resetPage); } catch (error) { this.fullList = []; + this.resetHeaderSummary(); this.applyFilteredList(true); uni.showToast({ title: this.getApiErrorMessage(error, '查询失败'), @@ -353,16 +389,52 @@ }; return map[status] || '未知状态'; }, + getPickingStatusText(status) { + return this.getStatusText(this.normalizeStatus(status)); + }, + getReviewStatusText(reviewed, inspectionStatus) { + if (reviewed === true) { + return '已复核'; + } + const text = String(inspectionStatus || '').toLowerCase(); + if (!text || ['pending', 'padding', 'wait', 'waiting', 'todo'].includes(text)) { + return '待复核'; + } + if (['reviewed', 'done', 'completed', 'finish', 'finished', 'success'].includes(text)) { + return '已复核'; + } + return text; + }, + getSpaceStatusText(status) { + const text = String(status || '').toUpperCase(); + const map = { + AVAILABLE: '可用', + DISABLED: '禁用', + LOCKED: '锁定' + }; + return map[text] || (status || '--'); + }, goPicking(item) { + const orderId = Number(item?.orderId || 0); + const orderItemId = Number(item?.orderItemId || 0); + if (!orderId || !orderItemId) { + uni.showToast({ + title: '缺少订单参数', + icon: 'none' + }); + return; + } const params = [ `id=${encodeURIComponent(String(item.id || ''))}`, + `orderId=${encodeURIComponent(String(orderId))}`, + `orderItemId=${encodeURIComponent(String(orderItemId))}`, `orderNo=${encodeURIComponent(String(item.orderNo || ''))}`, `customerName=${encodeURIComponent(String(item.customerName || ''))}`, `waveNo=${encodeURIComponent(String(item.waveNo || ''))}`, + `spaceName=${encodeURIComponent(String(item.spaceName || ''))}`, `status=${encodeURIComponent(String(item.status || 'pending'))}`, `needQty=${encodeURIComponent(String(item.needQty || 0))}`, - `pickedQty=${encodeURIComponent(String(item.pickedQty || 0))}`, - `mode=${encodeURIComponent(String(this.pickMode || 'F'))}` + `pickedQty=${encodeURIComponent(String(item.pickedQty || 0))}` ]; this.$tools.routerTo(`/pages/work/order/detail?${params.join('&')}`); }, @@ -404,9 +476,7 @@ this.$set(this.fullList, index, merged); this.applyFilteredList(false); }, - getPickModeText() { - return this.pickMode === 'E' ? 'E拣货(边拣边分)' : 'F拣货(先拣后分)'; - } + } } @@ -437,46 +507,6 @@ padding: 16rpx 24rpx; } - .mode-panel { - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 24rpx 16rpx; - } - - .mode-title { - font-size: 24rpx; - color: #606266; - padding-right: 16rpx; - } - - .mode-switch-group { - flex: 1; - display: flex; - align-items: center; - background: #f6f7fb; - border-radius: 12rpx; - padding: 6rpx; - box-sizing: border-box; - } - - .mode-switch-btn { - flex: 1; - height: 56rpx; - display: flex; - align-items: center; - justify-content: center; - font-size: 23rpx; - color: #606266; - border-radius: 10rpx; - } - - .mode-switch-btn--active { - background: #fff; - color: #2979ff; - font-weight: 600; - } - .search-input-wrap { display: flex; align-items: center; @@ -543,6 +573,61 @@ background: #edf4ff; } + .summary-panel { + margin: 0 24rpx 16rpx; + padding: 16rpx 20rpx; + background: #f8fbff; + border: 1rpx solid #e4efff; + border-radius: 12rpx; + } + + .summary-row { + display: flex; + align-items: center; + font-size: 24rpx; + line-height: 38rpx; + } + + .summary-label { + width: 180rpx; + font-size: 24rpx; + line-height: 38rpx; + color: #909399; + } + + .summary-value { + flex: 1; + font-size: 24rpx; + line-height: 38rpx; + color: #303133; + font-weight: 500; + } + + .summary-inline-row { + display: flex; + align-items: center; + justify-content: space-between; + } + + .summary-inline-item { + flex: 1; + display: flex; + align-items: center; + } + + .summary-inline-item + .summary-inline-item { + margin-left: 16rpx; + } + + .summary-inline-item .summary-label { + width: 132rpx; + } + + .summary-inline-item .summary-value { + flex: 0; + min-width: 40rpx; + } + .list-content { height: 100rpx; flex: 1; @@ -564,6 +649,14 @@ margin-bottom: 12rpx; } + .item-header--status-only { + justify-content: flex-end; + } + + .item-row--with-status .order-status { + margin-left: 12rpx; + } + .order-no { font-size: 30rpx; font-weight: 600; diff --git a/pages/work/order/scatter-wave-strategy.vue b/pages/work/order/scatter-wave-strategy.vue new file mode 100644 index 0000000..665e4f2 --- /dev/null +++ b/pages/work/order/scatter-wave-strategy.vue @@ -0,0 +1,219 @@ + + + + +