From 3e9095c73e7e45503fa7547318188b4d3286e440 Mon Sep 17 00:00:00 2001 From: yin <3313488199@qq.com> Date: Tue, 15 Sep 2026 18:31:55 +0800 Subject: [PATCH] 1 --- .../order.archiveorder/orderarchiveorder.ts | 7 + .../orderdeliveryexpectionorder.ts | 7 + .../order.deliveryorder/orderdeliveryOrder.ts | 15 +- .../order.entrustorder/orderentrustorder.ts | 7 + .../orderexpectionorder.ts | 7 + src/api/order.index/orderindex.ts | 8 +- .../order.outboundorder/orderoutboundOrder.ts | 7 + .../order.pendingorder/orderpendingOrder.ts | 4 + src/api/order.revieworder/orderreviewOrder.ts | 7 + src/api/returnunpack/index.ts | 80 +++- src/api/storage.inventory/inventory.ts | 66 +++ src/api/storage.stockout/stockout.ts | 23 - .../data/packingflow/packingflow-config.ts | 11 +- src/views/express/returnUnpack/index.vue | 17 +- .../returnUnpack/returnUnpack-config.ts | 7 + .../components/TransferByWaybillsDialog.vue | 432 ++++++++++++++++++ .../express/waybill/config/template-config.ts | 10 + src/views/express/waybill/index.vue | 33 +- .../order/orderManagement/archiveOrder.vue | 6 + .../component/OrderItemsDetailPanel.vue | 169 +++++-- .../component/PendingOrderDetailPanel.vue | 19 +- .../order/orderManagement/component/log.vue | 137 ++++-- .../config/order-common-config.ts | 31 +- .../orderManagement/deliveryException.vue | 6 + .../order/orderManagement/deliveryOrder.vue | 6 + .../orderManagement/entrustWarehouse.vue | 6 + .../order/orderManagement/exceptionOrder.vue | 6 + .../order/orderManagement/outboundOrder.vue | 6 + .../order/orderManagement/pendingOrder.vue | 6 + .../order/orderManagement/reviewOrder.vue | 6 + .../utils/order-index-helpers.ts | 2 +- .../waveOrder/GroupWaveBatchListPanel.vue | 3 +- .../waveOrder/SandanWaveBatchListPanel.vue | 3 +- .../order/waveOrder/WavePickTaskListPanel.vue | 228 ++++++--- .../component/WaveBatchDetailPanel.vue | 23 +- src/views/stock/external_stock/index.vue | 224 ++++++--- src/views/stock/stock/component/erpStock.vue | 195 ++++++-- src/views/stock/stock/component/log.vue | 111 ++++- .../entry/component/DirectInboundLogs.vue | 42 +- .../entry/component/EntryBindingRelations.vue | 306 ++++++++----- .../storage/entry/component/entrydetail.vue | 32 +- src/views/storage/entry/component/log.vue | 60 ++- src/views/storage/entry/index.vue | 4 +- src/views/storage/entry_owner/index.vue | 4 +- .../inventory/component/panelstockdetail.vue | 360 ++++++++++++++- src/views/storage/productflow/store/index.vue | 126 +++-- .../storage/receiving/component/Logs.vue | 66 ++- .../storage/receiving/component/Product.vue | 8 +- src/views/storage/receiving_owner/index.vue | 4 +- src/views/storage/report/report-config.ts | 27 ++ src/views/storage/report/store.vue | 86 +++- src/views/storage/stockout/index.vue | 114 ----- src/views/storage/stockout/stockout-config.ts | 17 - .../video/newcamara/config/camara-config.ts | 16 +- .../config/camaraserver-config.ts | 16 +- src/views/warehouses/index.vue | 271 ++++++++--- 56 files changed, 2755 insertions(+), 745 deletions(-) create mode 100644 src/views/express/waybill/components/TransferByWaybillsDialog.vue diff --git a/src/api/order.archiveorder/orderarchiveorder.ts b/src/api/order.archiveorder/orderarchiveorder.ts index d3033f92..c13277cb 100644 --- a/src/api/order.archiveorder/orderarchiveorder.ts +++ b/src/api/order.archiveorder/orderarchiveorder.ts @@ -18,6 +18,13 @@ export type OrderPagination = { export type ArchiveOrderListParams = { pagination?: OrderPagination + /** + * 统一 where 条件对象;禁止传入 warehouse_id / warehouseId(后端按登录仓库上下文注入)。 + * create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 + */ where?: OrderWhere sort?: OrderSort } diff --git a/src/api/order.deliveryexpectionorder/orderdeliveryexpectionorder.ts b/src/api/order.deliveryexpectionorder/orderdeliveryexpectionorder.ts index 93ea3202..670fc7b7 100644 --- a/src/api/order.deliveryexpectionorder/orderdeliveryexpectionorder.ts +++ b/src/api/order.deliveryexpectionorder/orderdeliveryexpectionorder.ts @@ -18,6 +18,13 @@ export type OrderPagination = { export type DeliveryExpectionOrderListParams = { pagination?: OrderPagination + /** + * 统一 where 条件对象;禁止传入 warehouse_id / warehouseId(后端按登录仓库上下文注入)。 + * create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 + */ where?: OrderWhere sort?: OrderSort } diff --git a/src/api/order.deliveryorder/orderdeliveryOrder.ts b/src/api/order.deliveryorder/orderdeliveryOrder.ts index 19fa9b52..e0469f2b 100644 --- a/src/api/order.deliveryorder/orderdeliveryOrder.ts +++ b/src/api/order.deliveryorder/orderdeliveryOrder.ts @@ -18,6 +18,13 @@ export type OrderPagination = { export type DeliveryOrderListParams = { pagination?: OrderPagination + /** + * 统一 where 条件对象;禁止传入 warehouse_id / warehouseId(后端按登录仓库上下文注入)。 + * create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 + */ where?: OrderWhere sort?: OrderSort } @@ -237,6 +244,10 @@ export function orderDeliveryOrderDetail(data: DeliveryOrderDetailParams): Promi } as any) } +/** + * order.deliveryOrder.quickSearch:按关键词跨表联合搜索(运单号/发货单号/外部订单号/平台交易单号) + * 工单页「发起售后单-关联订单-选择订单」使用;联合查询较慢,超时时间延长至 20 秒(axios 默认 10 秒) + */ export function orderDeliveryOrderQuickSearch(keyword: string): Promise { return request({ url: '/system', @@ -247,7 +258,9 @@ export function orderDeliveryOrderQuickSearch(keyword: string): Promise { timestamp: Date.now() }, data: { keyword }, - isSystemApi: true + isSystemApi: true, + // 联合搜索耗时较长,单独放宽超时时间至 20 秒 + timeout: 60000 } as any) } diff --git a/src/api/order.entrustorder/orderentrustorder.ts b/src/api/order.entrustorder/orderentrustorder.ts index 9b033400..3d00c1a1 100644 --- a/src/api/order.entrustorder/orderentrustorder.ts +++ b/src/api/order.entrustorder/orderentrustorder.ts @@ -18,6 +18,13 @@ export type OrderPagination = { export type EntrustOrderListParams = { pagination?: OrderPagination + /** + * 统一 where 条件对象;禁止传入 warehouse_id / warehouseId(后端按登录仓库上下文注入)。 + * create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 + */ where?: OrderWhere sort?: OrderSort } diff --git a/src/api/order.expectionorder/orderexpectionorder.ts b/src/api/order.expectionorder/orderexpectionorder.ts index fcee9124..47c57d07 100644 --- a/src/api/order.expectionorder/orderexpectionorder.ts +++ b/src/api/order.expectionorder/orderexpectionorder.ts @@ -18,6 +18,13 @@ export type OrderPagination = { export type ExpectionOrderListParams = { pagination?: OrderPagination + /** + * 统一 where 条件对象;禁止传入 warehouse_id / warehouseId(后端按登录仓库上下文注入)。 + * create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 + */ where?: OrderWhere sort?: OrderSort } diff --git a/src/api/order.index/orderindex.ts b/src/api/order.index/orderindex.ts index 86d249fd..a7969c12 100644 --- a/src/api/order.index/orderindex.ts +++ b/src/api/order.index/orderindex.ts @@ -16,7 +16,13 @@ export type OrderListParams = { * - 虚拟字段:buyer_message_has(覆盖 buyer_message/seller_message/remark 三个字段,任一有值即为有留言,value=true/false)、 * express_numbers / waybill_codes(运单号筛选)、 * wave_index(波次内序号筛选,联查 wms_order_wave_index,支持 eq/in/gt/lt/ge/le/between/notbetween, - * between 要求 value 为长度 2 的数组,如 {"wave_index":{"operator":"between","value":[1,50]}})。 + * between 要求 value 为长度 2 的数组,如 {"wave_index":{"operator":"between","value":[1,50]}})、 + * wave_scope(波次范围筛选,直接按订单表 wave_scope 列过滤;取值 0=未分配、1=大团购、2=散单、3=小团购、4=单品单件。 + * 支持 {"wave_scope":0} 单值、{"wave_scope":[1,3]} 裸数组、{"wave_scope":{"operator":"in","value":[1,3]}} 标准结构)。 + * - create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 */ where?: Record sort?: { diff --git a/src/api/order.outboundorder/orderoutboundOrder.ts b/src/api/order.outboundorder/orderoutboundOrder.ts index 810d3b3d..3733e284 100644 --- a/src/api/order.outboundorder/orderoutboundOrder.ts +++ b/src/api/order.outboundorder/orderoutboundOrder.ts @@ -18,6 +18,13 @@ export type OrderPagination = { export type OutboundOrderListParams = { pagination?: OrderPagination + /** + * 统一 where 条件对象;禁止传入 warehouse_id / warehouseId(后端按登录仓库上下文注入)。 + * create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 + */ where?: OrderWhere sort?: OrderSort } diff --git a/src/api/order.pendingorder/orderpendingOrder.ts b/src/api/order.pendingorder/orderpendingOrder.ts index fab6d3e7..365f0aaa 100644 --- a/src/api/order.pendingorder/orderpendingOrder.ts +++ b/src/api/order.pendingorder/orderpendingOrder.ts @@ -43,6 +43,10 @@ export type PendingOrderListParams = { * 统一 where 条件对象;禁止传入 warehouse_id / warehouseId。where 无字段白名单,可直接传订单表列名。 * lock_status 锁定状态筛选(筛选值用数据库原始枚举 none/warehouse/store,不是响应中的 Y/N;ne 表示不等于;条件值为空自动忽略): * 未锁定 {"lock_status":"none"};已锁定(所有非 none){"lock_status":{"operator":"ne","value":"none"}} + * create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 */ where?: OrderWhere; sort?: OrderSort; diff --git a/src/api/order.revieworder/orderreviewOrder.ts b/src/api/order.revieworder/orderreviewOrder.ts index 370ce3f1..20d61eae 100644 --- a/src/api/order.revieworder/orderreviewOrder.ts +++ b/src/api/order.revieworder/orderreviewOrder.ts @@ -18,6 +18,13 @@ export type OrderPagination = { export type ReviewOrderListParams = { pagination?: OrderPagination + /** + * 统一 where 条件对象;禁止传入 warehouse_id / warehouseId(后端按登录仓库上下文注入)。 + * create_channel 订单来源渠道筛选(按订单表 create_channel 列过滤;枚举:MANUAL=手工单、API=接口、QM=奇门、STOCKOUT=出库转单): + * {"create_channel":"MANUAL"} 单值精确;{"create_channel":["QM","API"]} 裸数组按 in 多选; + * {"create_channel":{"operator":"in","value":["QM","API"]}} 标准结构多选;{"create_channel":{"operator":"ne","value":"MANUAL"}} 排除指定渠道。 + * 注意:列表响应中的 create_channel 已格式化为中文标签,查询条件须传英文枚举值。 + */ where?: OrderWhere sort?: OrderSort } diff --git a/src/api/returnunpack/index.ts b/src/api/returnunpack/index.ts index 533c1544..413ab452 100644 --- a/src/api/returnunpack/index.ts +++ b/src/api/returnunpack/index.ts @@ -730,6 +730,83 @@ export function returnUnpackExportTaskProgress(data: ReturnUnpackExportTaskProgr } as any) } +// ============ returnUnpack.transferByWaybills ============ + +/** returnUnpack.transferByWaybills 请求参数 */ +export type ReturnUnpackTransferByWaybillsParams = { + /** 运单表主键ID列表(wms_order_express.id,也兼容单个数值;服务端 Number() 归一化 + 过滤非正整数 + 去重,去重后单次上限 200) */ + ids: number[] | number +} + +/** returnUnpack.transferByWaybills 成功项 */ +export type ReturnUnpackTransferSuccessItem = { + /** 运单表主键ID(wms_order_express.id) */ + waybill_id: number + /** 运单号 */ + waybill_code: string + /** 拆包单ID */ + unpack_id: number + /** 拆包单号 */ + unpack_no: string + /** true=命中已有有效拆包单,直接复用未重复创建 */ + reused: boolean + /** 明细行数 */ + detail_count: number + /** 明细数量合计 */ + total_quantity: number +} + +/** returnUnpack.transferByWaybills 失败项 */ +export type ReturnUnpackTransferFailedItem = { + /** 运单表主键ID(wms_order_express.id) */ + waybill_id?: number | null + /** 运单号(运单命中时才有值,否则为 null) */ + waybill_code?: string | null + /** 失败原因,如「运单不存在」「运单为子单(business_key>1),跳过」「运单号为空,无法转入退件登记」「运单关联订单无明细可复制」 */ + reason: string +} + +/** returnUnpack.transferByWaybills 响应(逐单处理,单条失败不阻断主流程,HTTP 整体仍成功) */ +export type ReturnUnpackTransferByWaybillsResponse = { + code?: number + message?: string + /** 去重后待处理运单总数 */ + total: number + /** 成功转入数量 */ + success_count: number + /** 失败数量 */ + failed_count: number + /** 成功项数组 */ + success: ReturnUnpackTransferSuccessItem[] + /** 失败项数组 */ + failed: ReturnUnpackTransferFailedItem[] +} + +/** + * returnUnpack.transferByWaybills:运单批量转入退件登记(一次调用把多个运单批量转入退回拆包登记) + * - `ids` 为运单表主键ID(wms_order_express.id),支持单个数值或数组;服务端 Number() 归一化 + 过滤非正整数 + 去重,去重后单次上限 200 + * - 仓库隔离:warehouse_id 由服务端从 ctx.user.store_id 注入,禁止前端传入;服务端按 id IN (ids) + 仓库一次批量反查 wms_order_express,未命中(不存在/非本仓库)记失败「运单不存在」 + * - 逐单处理,单条失败不阻断主流程:失败项进入 failed[](HTTP 整体仍成功) + * - 子单(business_key>1)跳过(一个运单只允许一条有效拆包单);运单号为空时记失败「运单号为空,无法转入退件登记」;命中运单统一置 wms_order_express.is_back='Y' + * - 幂等:同仓库 + 同运单号已存在 status != 'cancelled' 的拆包单时直接复用(reused=true));复用单明细为空时按订单明细补写,已有明细不重复写入 + * - 明细来源:运单关联订单的原本明细 1:1 复制(订单 items 优先,为空回退明细分表);命中退回收到登记时回填主表 return_received_id(失败仅告警不阻断) + */ +export function returnUnpackTransferByWaybills( + data: ReturnUnpackTransferByWaybillsParams +): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'returnUnpack.transferByWaybills', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + // ============ 模块导出 ============ export const returnUnpackModule = { @@ -745,5 +822,6 @@ export const returnUnpackModule = { delete: returnUnpackDelete, forceRecord: returnUnpackForceRecord, export: returnUnpackExport, - exportTaskProgress: returnUnpackExportTaskProgress + exportTaskProgress: returnUnpackExportTaskProgress, + transferByWaybills: returnUnpackTransferByWaybills } diff --git a/src/api/storage.inventory/inventory.ts b/src/api/storage.inventory/inventory.ts index 2812c9da..b09ef182 100644 --- a/src/api/storage.inventory/inventory.ts +++ b/src/api/storage.inventory/inventory.ts @@ -127,6 +127,72 @@ export function getInventoryListBySpaceId(data: InventoryListBySpaceIdParams): P } as any) } +/** storage.inventory.updateExpiry 请求参数 */ +export type InventoryUpdateExpiryParams = { + /** 库存记录ID(wms_storage.id,必填,正整数) */ + storage_id: number + /** 生产日期,支持 YYYY-MM-DD / YYYY/MM/DD / YYYY-MM-DD HH:mm:ss / ISO 字符串;传 null 或空串表示清空。与 expiry_date 至少传一个,未传则保持库内原值 */ + production_date?: string | null + /** 到期日期,格式要求同 production_date;传 null 或空串表示清空。与 production_date 至少传一个,未传则保持库内原值 */ + expiry_date?: string | null +} + +/** storage.inventory.updateExpiry 响应 data(维护结果) */ +export type InventoryUpdateExpiryResult = { + /** 库存记录ID(wms_storage.id) */ + storage_id?: number + /** 仓库ID(取自当前登录用户 ctx.user.store_id) */ + warehouse_id?: number + /** 货主ID */ + store_id?: number + /** 库位ID */ + space_id?: number + /** 商品SKU ID(wms_stock_warehouse.id) */ + stock_id?: number + /** 批次号 */ + batch_no?: string + /** 维护后的生产日期(YYYY-MM-DD),未维护时为 null */ + production_date?: string | null + /** 维护后的到期日期(YYYY-MM-DD),未维护时为 null */ + expiry_date?: string | null + /** 维护前的生产日期(YYYY-MM-DD),原为空时为 null */ + before_production_date?: string | null + /** 维护前的到期日期(YYYY-MM-DD),原为空时为 null */ + before_expiry_date?: string | null + /** 是否发生了实际变更(false 表示传入值与库内现值一致,未写库) */ + changed?: boolean + [key: string]: unknown +} + +/** storage.inventory.updateExpiry 响应(request 拦截器返回完整响应体) */ +export type InventoryUpdateExpiryResponse = { + code?: number + message?: string + data?: InventoryUpdateExpiryResult | null +} + +/** + * 按库存记录维度维护生产日期与到期日期 + * - `storage_id` 必填(wms_storage.id);`production_date` / `expiry_date` 至少传一个,未传的字段保持库内原值,传 null 或空串表示清空 + * - 日期支持 YYYY-MM-DD / YYYY/MM/DD / YYYY-MM-DD HH:mm:ss / ISO 字符串,后端统一按 YYYY-MM-DD 落库 + * - 合并后的生产日期不得晚于到期日期(未传字段取库内现值参与比较),校验失败返回 400 + * - 仅允许维护当前登录仓库(ctx.user.store_id)下的库存记录,跨仓库的 storage_id 按「不存在」处理(404);库存记录被锁定返回 409 + * - 更新前后完全一致时返回 changed=false,不写库、不记操作日志 + */ +export function updateInventoryExpiry(data: InventoryUpdateExpiryParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'storage.inventory.updateExpiry', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} + export function quickPutaway(data: { receiving_id: number; id?: number }): Promise { const body: Record = { ...data } if (body.receiving_id === undefined && body.id != null) { diff --git a/src/api/storage.stockout/stockout.ts b/src/api/storage.stockout/stockout.ts index b700a5f9..87a5af05 100644 --- a/src/api/storage.stockout/stockout.ts +++ b/src/api/storage.stockout/stockout.ts @@ -188,21 +188,12 @@ export const stockoutConfirm = (data: StockoutConfirmParams) => { export type StockoutUpdateExpressParams = { /** 出库单ID(必填) */ id: number -<<<<<<< HEAD - /** 快递公司编码(非运单号,如 SF/STO/ZT);传入后自动解析 express_name,传空值置 NULL */ - express_code?: string - /** 运单号(单个);storage.stockout.confirm 前必须已填写该字段 */ - waybill_code?: string - /** 运单号列表(JSON 数组或 null,支持多包裹场景);非数组返回 400 */ - waybill_codes?: string[] | null -======= /** 快递公司编码(**非运单号**,如 SF/STO/ZT):传入后后端自动解析 express_name,传空值则 express_code/express_name 置 NULL */ express_code?: string /** 运单号列表(JSON 数组或 null,支持一单多运单);回传与确认校验以此为准,传空数组或 null 表示清空;非数组返回 400 */ waybill_codes?: string[] | null /** 【已弃用】单数运单号:仅作 waybill_codes 首个的镜像,勿单独使用 */ waybill_code?: string ->>>>>>> f4db2401638744bb2c1a5d132f23f0f470b76598 } /** storage.stockout.updateExpress 响应 */ @@ -211,19 +202,6 @@ export type StockoutUpdateExpressResponse = { stockout_order_code: string /** 更新后的快递公司编码 */ express_code?: string -<<<<<<< HEAD - /** 由 express_code 解析出的快递公司名称 */ - express_name?: string - /** 更新后的运单号 */ - waybill_code?: string - /** 更新后的运单号列表 */ - waybill_codes?: string[] -} - -/** - * 更新出库单的快递公司与运单号(express_code / waybill_code / waybill_codes),用于在确认前填写运单信息。 - * 未传入的字段不更新,三个字段都未传时返回「没有需要更新的字段」;已废弃字段 express_codes 不在本接口读写范围内。 -======= /** 由 express_code 解析出的快递公司名称(未匹配到为空串) */ express_name?: string /** 更新后的运单号列表(以此为准) */ @@ -236,7 +214,6 @@ export type StockoutUpdateExpressResponse = { * 更新出库单的快递公司与运单号(确认前填写运单信息) * - `express_code` 是**快递公司编码**,不是运单号 * - 运单号统一走 `waybill_codes`(复数数组);`waybill_code` 已弃用,`express_codes` 已废弃(不在本接口读写范围内) ->>>>>>> f4db2401638744bb2c1a5d132f23f0f470b76598 */ export const stockoutUpdateExpress = (data: StockoutUpdateExpressParams) => { return request({ diff --git a/src/views/data/packingflow/packingflow-config.ts b/src/views/data/packingflow/packingflow-config.ts index f55f65cf..3dde0a26 100644 --- a/src/views/data/packingflow/packingflow-config.ts +++ b/src/views/data/packingflow/packingflow-config.ts @@ -139,7 +139,7 @@ export const videoEnableConfig: Record getWaybill(row), formatter: (row: any) => getWaybill(row) || '—' }, { prop: 'wave_no', label: '波次号', minWidth: 140, copyAction: 'copy' as const }, @@ -154,6 +154,10 @@ export const packingColumns = [ { prop: 'sku_count', label: 'SKU数', width: 80 }, { prop: 'pack_mode', label: '打包模式', width: 100 }, { prop: 'status', label: '任务状态', width: 100 }, + { prop: 'express_info', label: '快递信息', minWidth: 140, formatter: (row: any) => getExpressInfo(row) }, + { prop: 'has_video', label: '包含录像', width: 90 }, + { prop: 'video_enable', label: '录像可用', width: 90 }, + { prop: 'videos', label: '录像', width: 110 }, // { prop: 'device_ids', label: '设备ID', width: 120, formatter: (row: any) => (row.device_ids || []).join(',') || '—' }, { prop: 'remark', label: '备注', minWidth: 120 }, { prop: 'start_time', label: '开始时间', width: 170, sortable: true, formatter: (row: any) => row.start_time ? dayjs(row.start_time).format('YYYY-MM-DD HH:mm:ss') : '—' }, @@ -174,10 +178,7 @@ export const packingColumns = [ }}, { prop: 'create_time', label: '创建时间', width: 170, sortable: true, formatter: (row: any) => row.create_time ? dayjs(row.create_time).format('YYYY-MM-DD HH:mm:ss') : '—' }, { prop: 'update_time', label: '更新时间', width: 170, sortable: true, formatter: (row: any) => row.update_time ? dayjs(row.update_time).format('YYYY-MM-DD HH:mm:ss') : '—' }, - { prop: 'express_info', label: '快递信息', minWidth: 140, formatter: (row: any) => getExpressInfo(row) }, - { prop: 'has_video', label: '包含录像', width: 90 }, - { prop: 'video_enable', label: '录像可用', width: 90 }, - { prop: 'videos', label: '录像', width: 110 }, + { prop: 'operation', label: '操作', width: 180, fixed: 'right' } ] diff --git a/src/views/express/returnUnpack/index.vue b/src/views/express/returnUnpack/index.vue index 825b6a76..ad8dad74 100644 --- a/src/views/express/returnUnpack/index.vue +++ b/src/views/express/returnUnpack/index.vue @@ -296,6 +296,8 @@ :update-time="exportTaskProgress.updateTime" /> + + @@ -492,9 +494,18 @@ const buttonLoadingMap = computed>(() => ({ loading: loading.value, exportLoading: exportLoading.value, })) -const buttonDisabledMap = ref>({}) -const buttonLabelMap = ref>({}) -const toolbarLayoutKey = ref('') +/** 勾选态驱动的按钮禁用(hasNoSelection:未勾选时禁用批量类操作) */ +const buttonDisabledMap = computed>(() => ({ + hasNoSelection: selectionRows.value.length === 0, +})) +const buttonLabelMap = computed>(() => ({})) +const toolbarLayoutKey = computed(() => + JSON.stringify({ + loading: buttonLoadingMap.value, + disabled: buttonDisabledMap.value, + labels: buttonLabelMap.value, + }) +) function resolveButtonLoading(loadingKey?: string) { if (!loadingKey) return false diff --git a/src/views/express/returnUnpack/returnUnpack-config.ts b/src/views/express/returnUnpack/returnUnpack-config.ts index 508f798a..e6365d7f 100644 --- a/src/views/express/returnUnpack/returnUnpack-config.ts +++ b/src/views/express/returnUnpack/returnUnpack-config.ts @@ -65,6 +65,13 @@ export const returnUnpackColumns = [ // { prop: 'id', label: 'ID', width: '80', sortable: 'custom' }, { prop: 'unpack_no', label: '拆包单号', minWidth: '170', showOverflowTooltip: true, copyAction: 'copy' as const }, { prop: 'waybill_code', label: '退回运单号', minWidth: '180', showOverflowTooltip: true, copyAction: 'copy' as const }, + { + prop: 'order_express_id', + label: '原运单ID', + width: '110', + /** 为空 = 开单时未命中原单退回,不参与「运单批量转入」 */ + formatter: (row: any) => (row?.order_express_id == null || row?.order_express_id === '' ? '-' : row.order_express_id), + }, { prop: 'status', label: '拆包状态', width: '100' }, { prop: 'detail_status', label: '明细状态', width: '110' }, { prop: 'total_items', label: '物品种类', width: '90' }, diff --git a/src/views/express/waybill/components/TransferByWaybillsDialog.vue b/src/views/express/waybill/components/TransferByWaybillsDialog.vue new file mode 100644 index 00000000..ba7a1be7 --- /dev/null +++ b/src/views/express/waybill/components/TransferByWaybillsDialog.vue @@ -0,0 +1,432 @@ + + + + + diff --git a/src/views/express/waybill/config/template-config.ts b/src/views/express/waybill/config/template-config.ts index cc300e0c..3d5c2eef 100644 --- a/src/views/express/waybill/config/template-config.ts +++ b/src/views/express/waybill/config/template-config.ts @@ -827,6 +827,16 @@ export const TOOLBAR_BUTTONS: Record = { { label: '导出全部', action: 'handleExportAll', divided: true } ] }, + transferByWaybills: { + key: 'transferByWaybills', + label: '转入退件登记', + category: 'function', + size: 'small', + type: 'primary', + plain: true, + disabledKey: 'noSelection', + action: 'openTransferByWaybillsDialog' + }, columnConfig: { key: 'columnConfig', label: '字段设置', diff --git a/src/views/express/waybill/index.vue b/src/views/express/waybill/index.vue index 5a671242..847207e7 100644 --- a/src/views/express/waybill/index.vue +++ b/src/views/express/waybill/index.vue @@ -229,12 +229,12 @@ - + - --> void> = { openColumnConfigPanel: () => { upperTableRef.value?.openColumnConfig?.() }, toggleDetailVisible: () => { detailVisible.value = !detailVisible.value }, handleExportSelected: () => { void handleExportSelected() }, - handleExportAll: () => { void handleExportAll() } + handleExportAll: () => { void handleExportAll() }, + openTransferByWaybillsDialog: () => { openTransferByWaybillsDialog() } } function handleToolbarButtonClick(action: string) { @@ -685,6 +687,25 @@ const handleSelectionChange = (rows: Record[]) => { selectedRows.value = rows } +// ============================================================ +// 运单批量转入退件登记(returnUnpack.transferByWaybills) +// ============================================================ +const transferByWaybillsVisible = ref(false) + +/** 运单批量转入:使用当前勾选的运单行(入参 ids 取运单表主键 id) */ +function openTransferByWaybillsDialog() { + if (!selectedRows.value.length) { + ElMessage.warning('请先勾选需要转入退件登记的运单') + return + } + transferByWaybillsVisible.value = true +} + +/** 转入后刷新列表(部分失败时也刷新,明细由弹窗结果区展示) */ +function handleTransferByWaybillsSuccess() { + void loadData() +} + // ============================================================ // 明细面板 // ============================================================ diff --git a/src/views/order/orderManagement/archiveOrder.vue b/src/views/order/orderManagement/archiveOrder.vue index f7725e62..0a35dd20 100644 --- a/src/views/order/orderManagement/archiveOrder.vue +++ b/src/views/order/orderManagement/archiveOrder.vue @@ -429,5 +429,11 @@ function handleToolbarButtonClick(action: ToolbarButtonConfig['action']) { diff --git a/src/views/order/orderManagement/component/OrderItemsDetailPanel.vue b/src/views/order/orderManagement/component/OrderItemsDetailPanel.vue index cfc82691..98fc120f 100644 --- a/src/views/order/orderManagement/component/OrderItemsDetailPanel.vue +++ b/src/views/order/orderManagement/component/OrderItemsDetailPanel.vue @@ -2,43 +2,72 @@
请从上方列表中选择一项查看商品明细