diff --git a/src/api/order.pendingOrder/orderpendingOrder.ts b/src/api/order.pendingOrder/orderpendingOrder.ts index 3bbc7575..ffe79f97 100644 --- a/src/api/order.pendingOrder/orderpendingOrder.ts +++ b/src/api/order.pendingOrder/orderpendingOrder.ts @@ -111,6 +111,21 @@ export type PendingOrderImportOrdersFromExcelParams = { file_base64: string; }; +/** 批量拦截提交参数 */ +export type PendingOrderBatchInterceptParams = { + order_ids?: number[] + orderIds?: number[] + ids?: number[] + task_id?: string + taskId?: string +}; + +/** 批量拦截任务进度查询参数 */ +export type PendingOrderBatchInterceptProgressParams = { + task_id?: string + taskId?: string +}; + export type PendingOrderParseAddressParams = { address: string; }; @@ -480,6 +495,126 @@ export function orderPendingOrderParseAddress( } as any); } +/** order.pendingOrder.batchIntercept:批量提交订单拦截请求 */ +export function orderPendingOrderBatchIntercept(data: PendingOrderBatchInterceptParams): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.batchIntercept", + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** order.pendingOrder.batchInterceptTaskProgress:查询批量拦截任务进度 */ +export function orderPendingOrderBatchInterceptTaskProgress(data: PendingOrderBatchInterceptProgressParams): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.batchInterceptTaskProgress", + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** order.pendingOrder.batchUnintercept:批量解除拦截 */ +export function orderPendingOrderBatchUnintercept(data: PendingOrderBatchInterceptParams): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.batchUnintercept", + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** order.pendingOrder.batchUninterceptTaskProgress:查询批量解除拦截进度 */ +export function orderPendingOrderBatchUninterceptTaskProgress(data: PendingOrderBatchInterceptProgressParams): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.batchUninterceptTaskProgress", + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** order.pendingOrder.batchLock:批量锁定 */ +export function orderPendingOrderBatchLock(data: PendingOrderBatchInterceptParams): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.batchLock", + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** order.pendingOrder.batchLockTaskProgress:查询批量锁定进度 */ +export function orderPendingOrderBatchLockTaskProgress(data: PendingOrderBatchInterceptProgressParams): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.batchLockTaskProgress", + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** order.pendingOrder.batchUnlock:批量解锁 */ +export function orderPendingOrderBatchUnlock(data: PendingOrderBatchInterceptParams): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.batchUnlock", + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + +/** order.pendingOrder.batchUnlockTaskProgress:查询批量解锁进度 */ +export function orderPendingOrderBatchUnlockTaskProgress(data: PendingOrderBatchInterceptProgressParams): Promise { + return request({ + url: "/system", + method: "post", + params: { + method: "order.pendingOrder.batchUnlockTaskProgress", + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + export type OrderPendingOrderApi = { list: typeof orderPendingOrderList; detail: typeof orderPendingOrderDetail; @@ -498,6 +633,10 @@ export type OrderPendingOrderApi = { createOrder: typeof orderPendingOrderCreateOrder; importOrdersFromExcel: typeof orderPendingOrderImportOrdersFromExcel; parseAddress: typeof orderPendingOrderParseAddress; + batchIntercept: typeof orderPendingOrderBatchIntercept; + batchUnintercept: typeof orderPendingOrderBatchUnintercept; + batchLock: typeof orderPendingOrderBatchLock; + batchUnlock: typeof orderPendingOrderBatchUnlock; }; export const orderPendingOrder: OrderPendingOrderApi = { @@ -518,4 +657,8 @@ export const orderPendingOrder: OrderPendingOrderApi = { createOrder: orderPendingOrderCreateOrder, importOrdersFromExcel: orderPendingOrderImportOrdersFromExcel, parseAddress: orderPendingOrderParseAddress, + batchIntercept: orderPendingOrderBatchIntercept, + batchUnintercept: orderPendingOrderBatchUnintercept, + batchLock: orderPendingOrderBatchLock, + batchUnlock: orderPendingOrderBatchUnlock }; diff --git a/src/api/order.print/orderprint.ts b/src/api/order.print/orderprint.ts index e1bde05a..0d0c000b 100644 --- a/src/api/order.print/orderprint.ts +++ b/src/api/order.print/orderprint.ts @@ -93,3 +93,23 @@ export function unlockWavePlatformPrintDataByGroup(data: UnlockWavePlatformPrint isSystemApi: true } as any) } + +export type GetOrderPrintDataParams = { + order_ids: Array +} + +/** 按订单 ID 拉取平台打印中间态数据(order.print.getOrderPrintData) + * 返回结构与 getWavePlatformPrintData 一致,不限制打印锁定状态 */ +export function getOrderPrintData(data: GetOrderPrintDataParams) { + return request({ + url: '/system', + method: 'post', + params: { + method: 'order.print.getOrderPrintData', + v, + timestamp: new Date().getTime() + }, + data, + isSystemApi: true + } as any) +} diff --git a/src/api/order.recheckorder/recheckOrder.ts b/src/api/order.recheckorder/recheckOrder.ts index 9a8adc39..0f41a824 100644 --- a/src/api/order.recheckorder/recheckOrder.ts +++ b/src/api/order.recheckorder/recheckOrder.ts @@ -77,6 +77,25 @@ export function scanWaybill(data: RecheckScanOrderParams): Promise { return scanOrder(data) } +export type RecheckScanTaskParams = { + task_id: number +} + +/** order.recheckOrder.scanTask:按拣货任务 ID 拉取复核扫描视图 */ +export function scanTask(data: RecheckScanTaskParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'order.recheckOrder.scanTask', + v, + timestamp: Date.now() + }, + data, + isSystemApi: true + } as any) +} + /** 订单 ID;优先 order_id,兼容 id、orderId */ export type ConfirmRecheckParams = { order_id?: string | number @@ -122,7 +141,23 @@ export function confirmRecheck(data: ConfirmRecheckParams): Promise { } as any) } +/** order.recheckOrder.confirmIntercept:确认拦截,入参 order_id,匹配单个订单并标记拦截 */ +export function confirmIntercept(data: ConfirmRecheckParams): Promise { + return request({ + url: '/system', + method: 'post', + params: { + method: 'order.recheckOrder.confirmIntercept', + v, + timestamp: Date.now() + }, + data: pickConfirmRecheckBody(data), + isSystemApi: true + } as any) +} + export const orderRecheckOrder = { scanOrder, - confirmRecheck + confirmRecheck, + confirmIntercept } diff --git a/src/views/order/orderManagement/config/order-common-config.ts b/src/views/order/orderManagement/config/order-common-config.ts index 22306c1f..7fed7dbb 100644 --- a/src/views/order/orderManagement/config/order-common-config.ts +++ b/src/views/order/orderManagement/config/order-common-config.ts @@ -248,6 +248,11 @@ export const ORDER_TOOLBAR_BUTTONS: Record = { cloneOrder: { key: 'cloneOrder', label: '克隆订单', size: 'small', type: 'warning', plain: true, loadingKey: 'cloneOrderLoading', disabledKey: 'notSingleSelection', action: 'openCloneOrderDialog' }, syncOrderIds: { key: 'syncOrderIds', label: '同步订单', size: 'small', type: 'primary', plain: true, loadingKey: 'syncOrderIdsLoading', disabledKey: 'hasNoSelection', action: 'openSyncOrderIdsDialog' }, cancelOrder: { key: 'cancelOrder', label: '取消订单', size: 'small', type: 'danger', loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleCancelOrder' }, + batchIntercept: { key: 'batchIntercept', label: '批量拦截', size: 'small', type: 'danger', plain: true, loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleBatchIntercept' }, + batchUnintercept: { key: 'batchUnintercept', label: '解除拦截', size: 'small', type: 'warning', plain: true, loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnintercept' }, + batchLock: { key: 'batchLock', label: '批量锁定', size: 'small', type: 'warning', plain: true, loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleBatchLock' }, + batchUnlock: { key: 'batchUnlock', label: '批量解锁', size: 'small', type: 'primary', plain: true, loadingKey: 'actionLoading', disabledKey: 'hasNoSelection', action: 'handleBatchUnlock' }, + batchPrint: { key: 'batchPrint', label: '批量打印', size: 'small', type: 'primary', loadingKey: 'batchPrintLoading', disabledKey: 'hasNoSelection', action: 'handleBatchPrint' }, batchReview: { key: 'batchReview', label: '批量审核通过', size: 'small', type: 'success', loadingKey: 'reviewSubmitting', disabledKey: 'hasNoSelection', action: 'handleBatchReview' }, manualOutboundMigrate: { key: 'manualOutboundMigrate', @@ -302,6 +307,42 @@ export const PENDING_TOOLBAR_API_ACTIONS: ToolbarApiActionConfig[] = [ confirmType: 'error', successText: '取消订单成功', failText: '取消订单失败' + }, + { + action: 'handleBatchIntercept', + apiMethod: 'batchIntercept', + payloadKey: 'order_ids', + confirmText: '确定对选中的 {count} 条订单提交拦截请求吗?', + confirmType: 'error', + successText: '拦截请求已提交,异步处理中', + failText: '拦截请求提交失败' + }, + { + action: 'handleBatchUnintercept', + apiMethod: 'batchUnintercept', + payloadKey: 'order_ids', + confirmText: '确定对选中的 {count} 条订单提交解除拦截吗?', + confirmType: 'warning', + successText: '解除拦截请求已提交,异步处理中', + failText: '解除拦截请求提交失败' + }, + { + action: 'handleBatchLock', + apiMethod: 'batchLock', + payloadKey: 'order_ids', + confirmText: '确定对选中的 {count} 条订单提交锁定请求吗?', + confirmType: 'warning', + successText: '锁定请求已提交,异步处理中', + failText: '锁定请求提交失败' + }, + { + action: 'handleBatchUnlock', + apiMethod: 'batchUnlock', + payloadKey: 'order_ids', + confirmText: '确定对选中的 {count} 条订单提交解锁请求吗?', + confirmType: 'info', + successText: '解锁请求已提交,异步处理中', + failText: '解锁请求提交失败' } ] @@ -377,6 +418,29 @@ export function translateOrderField(field: string, value: any) { return value } +const INTERCEPT_STATUS_MAP: Record = { + none: '—', + requesting: '请求拦截中', + requested: '已请求拦截', + intercepting: '拦截中', + intercepted_in_transit: '在途拦截成功', + intercepted_at_warehouse: '仓库拦截成功', + returning: '退回中', + returned: '已退回', + delivered_by_mistake: '已误派送', + timeout: '超时', + cancelled: '已取消', + failed: '失败', + exception: '异常' +} + +export function translateInterceptStatus(value: any): string { + if (value === null || value === undefined || value === '' || value === 'none') { + return '—' + } + return INTERCEPT_STATUS_MAP[String(value)] || String(value) +} + function pad2(value: number) { return String(value).padStart(2, '0') } @@ -995,6 +1059,7 @@ export const pendingCloums = [ { prop: 'post_status', label: '快递', width: '100' }, { prop: 'pick_status', label: '拣货状态', width: '100' }, { prop: 'pack_status', label: '打包状态', width: '100' }, + { prop: 'intercept_status', label: '拦截状态', width: '100', tag: true }, { prop: 'waybill_codes', label: '快递单号', width: '160', formatter: waybillCodesFormatter }, { prop: 'items_count', label: '商品种类', width: '100' }, { prop: 'items_total', label: '商品总数', width: '100' }, @@ -1116,7 +1181,12 @@ export const pendingToolbarButtonKeys = [ 'createOrder', 'cloneOrder', 'syncOrderIds', - 'cancelOrder' + 'cancelOrder', + 'batchIntercept', + 'batchUnintercept', + 'batchLock', + 'batchUnlock', + 'batchPrint' ] /** 页面级按钮列表:pendingOrder 直接消费,避免页面内重复拼装 */ @@ -1268,6 +1338,7 @@ export const expectionColumns = [ { prop: 'post_status', label: '快递状态', width: '100' }, { prop: 'pick_status', label: '拣货状态', width: '100' }, { prop: 'pack_status', label: '打包状态', width: '100' }, + { prop: 'intercept_status', label: '拦截状态', width: '100', tag: true }, { prop: 'name', label: '收货人', width: '110' }, { prop: 'mobile', label: '手机号', width: '120' }, { prop: 'logistics_name', label: '快递', width: '120' }, diff --git a/src/views/order/orderManagement/exceptionOrder.vue b/src/views/order/orderManagement/exceptionOrder.vue index 7a35f9c4..203338a8 100644 --- a/src/views/order/orderManagement/exceptionOrder.vue +++ b/src/views/order/orderManagement/exceptionOrder.vue @@ -130,6 +130,13 @@ + + + + + +