WEB/src/api/order.outboundorder/orderoutboundOrder.ts
yin 4008a28796 feat(order): 新增待处理 B2B 订单批量取消,完善收货/盘点筛选与错误提示
- 新增 order.cancelB2b 接口与 CancelB2bForm 弹窗(convertToB2b 的反向操作),
  待处理订单工具栏接入:展示已选标签、去重后可提交数量与上限,支持逐个移除,
  提交后展示成功/跳过原因/未找到订单明细,并提示不支持取消的情形
- 待处理、归档等列表接口文档补充「默认排除 B2B 订单」,如需查询 B2B
  改用 order.pendingOrder2b.list / order.deliveryOrder2b.list
- 收货列表新增「隐藏无可用量」(filterDepleted)与「按入库单筛选」
  (entry_order_id 弹窗选择),移除已废弃的 getAvailableInboundQuantity 接口
- 收货库存明细面板改用 entry / inventory 接口,展示入库单号、库区、库位、
  数量、批次、生产/过期日期与库存类型;详情表单按来货方式动态隐藏物流单号
- 盘点明细新增「删除明细」(仅未开始作业的明细行可删),导出明细支持选择
  「按库位明细」或「明细汇总」模式(商品类任务生效)
- 新增 truncateLongMessage 截断工具,响应拦截与移库失败提示对超长 message
  只保留前 3 段并提示总数,完整信息仍输出到控制台
2026-11-16 18:05:41 +08:00

100 lines
2.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import request from '@/utils/request'
const v = '1.0'
export type { OrderWorkbenchListResponse, OrderListPagination } from '@/api/order.index/orderindex'
export type OrderWhere = Record<string, any>
export type OrderSort = {
sortField?: string
sortOrder?: 'asc' | 'desc' | 'ASC' | 'DESC'
field?: string
order?: 'asc' | 'desc' | 'ASC' | 'DESC'
}
export type OrderPagination = {
page?: number
pageSize?: number
}
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 已格式化为中文标签,查询条件须传英文枚举值。
* 默认排除 B2B 订单(is_b2b='Y',NULL 存量行视为非 B2B)——服务端固定条件,前端无法通过 where 覆盖;
* 需要查询 B2B 订单请使用 order.pendingOrder2b.list / order.deliveryOrder2b.list。
*/
where?: OrderWhere
sort?: OrderSort
}
export type OutboundOrderDetailParams = {
ids?: Array<number | string> | string | number
id?: number | string
order_id?: number | string
orderId?: number | string
tableType?: string
tablePosition?: string
type?: string
moduleName?: string
}
export type ManualOutboundParams = {
warehouseId?: number
warehouse_id?: number
warehouseIds?: number[]
queryTimeoutMs?: number
executionTimeoutMs?: number
}
export function orderOutboundOrderList(data: OutboundOrderListParams = {}): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'order.outboundOrder.list',
v,
timestamp: Date.now()
},
data,
isSystemApi: true
} as any)
}
export function orderOutboundOrderManualOutboundOrder(data: ManualOutboundParams = {}): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'order.outboundOrder.manualOutboundOrder',
v,
timestamp: Date.now()
},
data,
isSystemApi: true
} as any)
}
export function orderOutboundOrderDetail(data: OutboundOrderDetailParams): Promise<any> {
return request({
url: '/system',
method: 'post',
params: {
method: 'order.outboundOrder.detail',
v,
timestamp: Date.now()
},
data,
isSystemApi: true
} as any)
}
export const orderOutboundOrder = {
list: orderOutboundOrderList,
detail: orderOutboundOrderDetail,
manualOutboundOrder: orderOutboundOrderManualOutboundOrder
}