- 新增 order.pendingOrder.importWaybill 接口与 ImportWaybillForm: 粘贴「发货单号 + 货主备注 + 运单号」批量写入,逐行校验与去重, 返回逐条结果明细,单条失败不影响其它记录 - 待处理订单工具栏新增「导入运单号」(无需勾选);手工录入运单号补充可选的 快递编码与物流接口名称,空值不下发 - 订单各列表统一「运单号」列与 waybill_codes 筛选字段,取值统一走 toWaybillCodes / waybillCodesFormatter,兼容 waybill_codes / express_numbers 等来源 - 波次打印与确认打印新增 resolveWaveOrderWaybillText: 按 expresses[].waybill_code → waybill_codes/express_numbers → waybill_code/ waybill_no/tracking_no 回退,明确不读取 express_code(快递公司编码), 模板同时写入 express_code 与 waybill_code;面板列名统一为「运单号」 - 新增运单号命名改动清单、同数据不同字段名对照表等文档,并更新单号字段命名快照
1631 lines
54 KiB
TypeScript
1631 lines
54 KiB
TypeScript
import request from "@/utils/request";
|
||
import type { OrderDetailB2bInfo, OrderDetailImage } from "@/api/order/order";
|
||
import {
|
||
orderModulePendingOrderDownloadCreateTemplate,
|
||
orderModulePendingOrderManualWaybill,
|
||
orderModulePendingOrderImportWaybill,
|
||
orderModulePendingOrderAllocateSubOrderNumber,
|
||
orderModulePendingOrderAllocateSubOrderNumberProgress,
|
||
} from "@/api/order/order";
|
||
|
||
const v = "1.0";
|
||
|
||
export type { OrderWorkbenchListResponse, OrderListPagination } from '@/api/order.index/orderindex'
|
||
import type { OrderWorkbenchListResponse as PendingOrderWorkbenchListResponse } from '@/api/order.index/orderindex'
|
||
export type {
|
||
PendingOrderDownloadCreateTemplateResponse,
|
||
PendingOrderManualWaybillParams,
|
||
PendingOrderManualWaybillResponse,
|
||
PendingOrderImportWaybillItem,
|
||
PendingOrderImportWaybillParams,
|
||
PendingOrderImportWaybillResult,
|
||
PendingOrderImportWaybillResponse,
|
||
PendingOrderAllocateSubOrderNumberParams,
|
||
PendingOrderAllocateSubOrderNumberData,
|
||
PendingOrderAllocateSubOrderNumberProgressParams,
|
||
PendingOrderAllocateSubOrderNumberProgressData,
|
||
} from '@/api/order/order'
|
||
|
||
export const orderPendingOrderDownloadCreateTemplate = orderModulePendingOrderDownloadCreateTemplate;
|
||
export const orderPendingOrderManualWaybill = orderModulePendingOrderManualWaybill;
|
||
export const orderPendingOrderImportWaybill = orderModulePendingOrderImportWaybill;
|
||
export const orderPendingOrderAllocateSubOrderNumber = orderModulePendingOrderAllocateSubOrderNumber;
|
||
export const orderPendingOrderAllocateSubOrderNumberProgress = orderModulePendingOrderAllocateSubOrderNumberProgress;
|
||
|
||
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 PendingOrderListParams = {
|
||
pagination?: OrderPagination;
|
||
/**
|
||
* 统一 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 已格式化为中文标签,查询条件须传英文枚举值。
|
||
* confirm_print_status 确认打印状态筛选(按订单表列过滤;枚举:none=未确认打印、fin=已确认打印):
|
||
* {"confirm_print_status":"fin"} 单值精确,也支持裸数组按 in 与 {operator,value} 标准结构(同 create_channel 示例)。
|
||
* claim_status 领料状态筛选(按订单表列过滤;枚举:none=未领料、padding=领料中、fin=已领料、error=异常):
|
||
* 例 {"claim_status":{"operator":"ne","value":"fin"}} 查未完成领料的订单。
|
||
* is_sn_order 是否含 SN(序列号)商品筛选(按 has_sn_item 归一化):{"is_sn_order":"Y"} 仅 SN 订单、"N" 仅非 SN 订单。
|
||
* sn_code / snCode / sn_codes / snCodes 按 SN 码反查订单(先查 wms_order_item_sn 回填,支持单值/分隔字符串/数组,完整码精确匹配)。
|
||
* 默认排除 B2B 订单(is_b2b='Y',NULL 存量行视为非 B2B)——服务端固定条件,前端无法通过 where 覆盖;
|
||
* 需要查询 B2B 订单请使用 order.pendingOrder2b.list / order.deliveryOrder2b.list。
|
||
*/
|
||
where?: OrderWhere;
|
||
sort?: OrderSort;
|
||
};
|
||
|
||
/**
|
||
* 待处理订单列表响应 data(与 order.pendingOrder.list module.json 对齐)。
|
||
* - list 每项含 store_remark(货主备注)、wave_index(波次内序号,无记录时为 0)。
|
||
* - list 每项 lock_status 统一输出为 Y/N:none(含空值)→ 'N',其余值(如 warehouse/store)→ 'Y'。
|
||
*/
|
||
export type PendingOrderListResponse = PendingOrderWorkbenchListResponse;
|
||
|
||
export type PendingOrderDetailParams = {
|
||
/** 订单ID:支持 ids 数组、逗号分隔字符串或单个 id/order_id,至少提供一项 */
|
||
ids?: Array<number | string> | string | number;
|
||
id?: number | string;
|
||
order_id?: number | string;
|
||
orderId?: number | string;
|
||
/** 已忽略:接口固定先查配送表(dispatch),查不到再兜底待处理表(current),传入不生效 */
|
||
tableType?: string;
|
||
tablePosition?: string;
|
||
type?: string;
|
||
moduleName?: string;
|
||
};
|
||
|
||
/**
|
||
* order.pendingOrder.detail 响应 data
|
||
* - B2B 订单(is_b2b='Y')额外返回副表作业明细 b2b、备货照片 images 与提货照片 pickup_images,
|
||
* 非 B2B 时 b2b 为 null、images / pickup_images 为空数组
|
||
*/
|
||
export type PendingOrderDetailPayload = {
|
||
/** 订单头对象(raw 行数据,来自配送表或兜底的待处理表) */
|
||
detail?: Record<string, any>;
|
||
order?: Record<string, any>;
|
||
orderItems?: Record<string, any>[];
|
||
items?: Record<string, any>[];
|
||
expresses?: Record<string, any>[];
|
||
/** 按库位平铺的储位分配明细 */
|
||
storage_items?: Record<string, any>[];
|
||
/** B2B 作业明细:仅 is_b2b=Y 的订单输出,非 B2B 为 null */
|
||
b2b?: OrderDetailB2bInfo | null;
|
||
/** B2B 备货留证照片(business_type=b2b_order);无图片为空数组 */
|
||
images?: OrderDetailImage[];
|
||
/** B2B 提货留证照片(business_type=b2b_pickup);无图片为空数组,与 images 分开输出 */
|
||
pickup_images?: OrderDetailImage[];
|
||
};
|
||
|
||
/** markPendingOutboundOrder / cancelOrder:文档要求订单 ID 正整数数组,不支持单 id 或逗号字符串 */
|
||
export type PendingOrderIdsParams = {
|
||
ids: number[];
|
||
};
|
||
|
||
export type PendingOrderReverseReviewParams = {
|
||
ids: number[];
|
||
};
|
||
|
||
export type PendingOrderAllocateExpressCodeParams = {
|
||
/** 订单 ID 数组,sys_platform_code / logistics_code 等字段由后端从数据库读取 */
|
||
ids: number[];
|
||
};
|
||
|
||
export type PendingOrderUpdateOrderPlatformParams = {
|
||
order_ids: number[];
|
||
code: string;
|
||
};
|
||
|
||
export type PendingOrderUpdateOrderExpressParams = {
|
||
order_ids: number[];
|
||
express_code: string;
|
||
};
|
||
|
||
export type PendingOrderUpdateAddressParams = {
|
||
ids: number[];
|
||
name?: string;
|
||
mobile?: string;
|
||
tel?: string;
|
||
zip_code?: string;
|
||
province?: string;
|
||
city?: string;
|
||
area?: string;
|
||
town?: string;
|
||
detail_address?: string;
|
||
/** 订单留言/备注,对应列表字段 remark */
|
||
remark?: string;
|
||
};
|
||
|
||
export type PendingOrderCloneOrderParams = {
|
||
order_id: number;
|
||
};
|
||
|
||
export type PendingOrderCreateOrderItem = {
|
||
item_id: number;
|
||
plan_qty: number;
|
||
item_name?: string;
|
||
order_line_no?: string;
|
||
actual_price?: number;
|
||
};
|
||
|
||
export type PendingOrderCreateOrderParams = {
|
||
store_id: number;
|
||
name: string;
|
||
mobile?: string;
|
||
tel?: string;
|
||
detail_address: string;
|
||
province: string;
|
||
city: string;
|
||
area: string;
|
||
town?: string;
|
||
zip_code?: string;
|
||
items: PendingOrderCreateOrderItem[];
|
||
delivery_order_code?: string;
|
||
logistics_code?: string;
|
||
logistics_name?: string;
|
||
sys_platform_code?: string;
|
||
shop_nick?: string;
|
||
remark?: string;
|
||
source_platform_code?: string;
|
||
source_order_codes?: string;
|
||
order_type?: string;
|
||
is_urgency?: string;
|
||
invoice_flag?: string;
|
||
};
|
||
|
||
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 = {
|
||
/** 单条地址解析(与 addresses 二选一) */
|
||
address?: string;
|
||
/** 批量地址解析(单次最多 50 条) */
|
||
addresses?: string[];
|
||
};
|
||
|
||
export type PendingOrderParseAddressData = {
|
||
province?: string
|
||
city?: string
|
||
area?: string
|
||
town?: string
|
||
detailAddress?: string
|
||
name?: string
|
||
mobile?: string
|
||
};
|
||
|
||
/** 批量解析结果项(按输入顺序返回) */
|
||
export type PendingOrderParseAddressItem = PendingOrderParseAddressData & {
|
||
address?: string
|
||
flag?: string
|
||
message?: string
|
||
};
|
||
|
||
export type PendingOrderParseAddressResponse = {
|
||
flag?: string;
|
||
code: number;
|
||
message: string;
|
||
timestamp?: number;
|
||
data?: PendingOrderParseAddressData & { list?: PendingOrderParseAddressItem[] };
|
||
/** 批量解析结果数组(实际响应中位于顶层,兼容 data.list) */
|
||
list?: PendingOrderParseAddressItem[];
|
||
} & PendingOrderParseAddressData;
|
||
|
||
export function extractPendingOrderParseAddressData(
|
||
res?: PendingOrderParseAddressResponse | null,
|
||
): PendingOrderParseAddressData {
|
||
const nested = res?.data;
|
||
if (
|
||
nested &&
|
||
(nested.province ||
|
||
nested.city ||
|
||
nested.area ||
|
||
nested.town ||
|
||
nested.detailAddress ||
|
||
nested.name ||
|
||
nested.mobile)
|
||
) {
|
||
return nested;
|
||
}
|
||
return {
|
||
province: res?.province,
|
||
city: res?.city,
|
||
area: res?.area,
|
||
town: res?.town,
|
||
detailAddress: res?.detailAddress,
|
||
name: res?.name,
|
||
mobile: res?.mobile,
|
||
};
|
||
}
|
||
|
||
/** 提取批量解析结果列表,未返回时为空数组(兼容顶层 list 与 data.list) */
|
||
export function extractPendingOrderParseAddressList(
|
||
res?: PendingOrderParseAddressResponse | null,
|
||
): PendingOrderParseAddressItem[] {
|
||
const nestedList = res?.data?.list;
|
||
if (Array.isArray(nestedList)) return nestedList;
|
||
const topList = res?.list;
|
||
return Array.isArray(topList) ? topList : [];
|
||
}
|
||
|
||
/** 与文档 Params 别名对齐;不再传 warehouse_id(由登录上下文决定仓库) */
|
||
export type PendingOrderAllocateStorageParams = {
|
||
allow_storage_location?: boolean;
|
||
allowStorageLocation?: boolean;
|
||
is_allow_storage?: boolean;
|
||
isAllowStorage?: boolean;
|
||
order_ids?: Array<number | string> | string | number;
|
||
orderIds?: Array<number | string> | string | number;
|
||
ids?: Array<number | string> | string | number;
|
||
order_id?: number | string;
|
||
orderId?: number | string;
|
||
id?: number | string;
|
||
};
|
||
|
||
/** allocateStorage 异步受理响应(与文档一致) */
|
||
export type PendingOrderAllocateStorageResponse = {
|
||
request_id: string;
|
||
warehouse_id: number;
|
||
message: string;
|
||
};
|
||
|
||
export type PendingOrderAllocateStorageProgressParams = {
|
||
request_id?: string;
|
||
requestId?: string;
|
||
};
|
||
|
||
export type PendingOrderAllocateStorageProgressResponse = {
|
||
request_id: string;
|
||
status: "submitted" | "running" | "success" | "failed" | "not_found";
|
||
result?: Record<string, unknown>;
|
||
error?: string;
|
||
warehouse_id?: number;
|
||
update_time?: string;
|
||
message?: string;
|
||
};
|
||
|
||
/** syncOrderIds:订单 ID 列表(必填,支持多种别名) */
|
||
export type PendingOrderSyncOrderIdsParams = {
|
||
/** 订单 ID 列表,支持数组、逗号分隔字符串或单个 ID */
|
||
order_ids?: Array<number | string> | string | number;
|
||
orderIds?: Array<number | string> | string | number;
|
||
ids?: Array<number | string> | string | number;
|
||
order_id?: number | string;
|
||
orderId?: number | string;
|
||
id?: number | string;
|
||
};
|
||
|
||
/** syncOrderIds 响应:异步模式,返回 request_id 供 syncOrderIdsProgress 轮询 */
|
||
export type PendingOrderSyncOrderIdsResponse = {
|
||
flag: string;
|
||
code: number;
|
||
message: string;
|
||
request_id: string;
|
||
warehouse_id: number;
|
||
data?: {
|
||
order_ids?: Array<number | string>;
|
||
[key: string]: unknown;
|
||
};
|
||
};
|
||
|
||
/** syncOrderIdsProgress 查询参数 */
|
||
export type PendingOrderSyncOrderIdsProgressParams = {
|
||
request_id?: string;
|
||
requestId?: string;
|
||
};
|
||
|
||
/** syncOrderIdsProgress 进度响应 */
|
||
export type PendingOrderSyncOrderIdsProgressResponse = {
|
||
flag: string;
|
||
code: number;
|
||
message: string;
|
||
request_id: string;
|
||
status: 'submitted' | 'running' | 'success' | 'failed' | 'not_found';
|
||
progress: number;
|
||
total_count?: number;
|
||
processed_count?: number;
|
||
warehouse_id?: number;
|
||
result?: {
|
||
success_count?: number;
|
||
failed_count?: number;
|
||
dispatch_results?: Record<string, unknown>;
|
||
[key: string]: unknown;
|
||
};
|
||
error?: string;
|
||
update_time?: number;
|
||
};
|
||
|
||
export function orderPendingOrderList(data: PendingOrderListParams = {}): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.list",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.pendingOrder2b.list:B2B 待处理订单列表
|
||
* - 查询条件与 order.pendingOrder.list 完全一致(current 分表 + 默认 outbound_status != padding 且 step in [1,2,3])
|
||
* - 额外强制 is_b2b='Y'(与请求 where 取 AND,传 is_b2b='N' 只会得到空列表)
|
||
* - 行内额外带出 wms_order_b2b 作业字段(无作业明细行时占位:数值 0 / is_picked_up=N / 时间为 null):
|
||
* total_box_count、pickup_plate_number、prep_remark、prep_duration_seconds、is_urgent(Y/N)、prep_at、
|
||
* is_picked_up(Y/N)、picked_up_at、created_at(作业明细创建时间,与订单 create_at 不同)、
|
||
* prep_status(none/padding/fin)、prep_operator_id、prep_operator_name、prep_start_at
|
||
* - 行内另带出 images(备货留证照片 business_type=b2b_order)、pickup_images(提货留证照片 b2b_pickup),
|
||
* 元素 { id: file_id, url, display_order };无图片为空数组
|
||
* - 取货储位不在列表返回:逐商品取货储位见 order.getB2bPackingSnapshot 的 items[].pick_locations
|
||
* - where 额外支持(仅 B2B 列表开放,普通列表不识别):total_box_count / pickup_plate_number / prep_remark /
|
||
* prep_duration_seconds / is_picked_up / picked_up_at / created_at / prep_at / is_urgent /
|
||
* prep_status / prep_operator_id / prep_start_at(支持简写与 {operator,value} 标准结构,prep_at 支持 between)
|
||
* - 排序固定「加急优先」(is_urgent='Y' 在前、无作业明细行排最后),sort 只决定加急/非加急各自内部次序
|
||
* (缺省 updated_at DESC, id DESC)
|
||
*/
|
||
export function orderPendingOrder2bList(data: PendingOrderListParams = {}): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder2b.list",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/** order.pendingOrder2b.list 列表行(在普通订单行基础上追加 B2B 作业字段与照片) */
|
||
export type PendingOrderB2bListRow = Record<string, any> & {
|
||
prep_status?: string;
|
||
prep_operator_id?: number | null;
|
||
prep_operator_name?: string | null;
|
||
prep_start_at?: string | null;
|
||
total_box_count?: number;
|
||
pickup_plate_number?: string | null;
|
||
prep_remark?: string | null;
|
||
prep_duration_seconds?: number;
|
||
prep_at?: string | null;
|
||
is_urgent?: string;
|
||
is_picked_up?: string;
|
||
picked_up_at?: string | null;
|
||
/** B2B 作业明细创建时间(与订单 create_at 不同) */
|
||
created_at?: string | null;
|
||
/** 备货留证照片(business_type=b2b_order) */
|
||
images?: OrderDetailImage[];
|
||
/** 提货留证照片(business_type=b2b_pickup) */
|
||
pickup_images?: OrderDetailImage[];
|
||
};
|
||
|
||
/**
|
||
* order.convertToB2b:待处理订单批量转 B2B 订单
|
||
* - 仅查当前仓库 current 分表(wms_order_delivery_{warehouseId}),仓库取自登录上下文,禁止前端传入
|
||
* - ids / order_ids / orderIds / id / order_id / orderId 均可,服务端转数组、仅保留正整数、去重,单次上限 200
|
||
* - 不符合准入条件的订单静默跳过(不报错),原因见 skipped_reasons
|
||
*/
|
||
export type PendingOrderConvertToB2bParams = {
|
||
/** 订单ID集合(单值或数组均可,服务端统一转数组) */
|
||
ids?: number[] | number;
|
||
order_ids?: number[] | number;
|
||
orderIds?: number[] | number;
|
||
id?: number;
|
||
order_id?: number;
|
||
orderId?: number;
|
||
};
|
||
|
||
/** order.convertToB2b 跳过原因项 */
|
||
export type PendingOrderConvertToB2bSkippedReason = {
|
||
order_id: number;
|
||
delivery_order_code?: string;
|
||
/** 订单待审核 / 已复核 / 已拣货 / 已锁定 / 已拦截 / 已是B2B订单(已打印不拦截转换) */
|
||
reason: string;
|
||
};
|
||
|
||
/** order.convertToB2b 响应 */
|
||
export type PendingOrderConvertToB2bResponse = {
|
||
converted_order_ids: number[];
|
||
converted_count: number;
|
||
skipped_order_ids: number[];
|
||
skipped_count: number;
|
||
skipped_reasons: PendingOrderConvertToB2bSkippedReason[];
|
||
/** 当前仓库 current 分表中查不到的订单 ID(已进配送/历史/外仓表,或不属于本仓) */
|
||
not_found_order_ids: number[];
|
||
};
|
||
|
||
export function orderPendingOrderConvertToB2b(
|
||
data: PendingOrderConvertToB2bParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.convertToB2b",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.cancelB2b:取消 B2B,把 B2B 订单流转回正常订单(order.convertToB2b 的反向操作)
|
||
* - 仅查当前仓库 current 分表(wms_order_delivery_{warehouseId}),仓库取自登录上下文,禁止前端传入
|
||
* - 准入:is_b2b=Y、step != 0(非待审核)、未锁定、未拦截;打印状态不限制(已打印同样可取消)
|
||
* - 事务内 is_b2b 置回 'N',并按 warehouse_id + order_id 物理删除 wms_order_b2b 作业明细(不保留历史)
|
||
* - 入参同 convertToB2b:ids / order_ids / orderIds / id / order_id / orderId 均可,单次上限 200;
|
||
* 不符合条件的订单只跳过、不报错,原因见 skipped_reasons
|
||
* - ⚠️ 文档归属模块为 order.index(folder order.index),此处与 convertToB2b 成对维护
|
||
*/
|
||
export type PendingOrderCancelB2bParams = PendingOrderConvertToB2bParams;
|
||
|
||
/** order.cancelB2b 跳过原因项 */
|
||
export type PendingOrderCancelB2bSkippedReason = {
|
||
order_id: number;
|
||
delivery_order_code?: string;
|
||
/** 订单待审核,不允许取消B2B / 订单不是B2B订单 / 订单已锁定,不允许取消B2B / 订单已拦截,不允许取消B2B */
|
||
reason: string;
|
||
};
|
||
|
||
/** order.cancelB2b 响应 */
|
||
export type PendingOrderCancelB2bResponse = {
|
||
/** 取消成功的订单 ID(已去重) */
|
||
canceled_order_ids: number[];
|
||
canceled_count: number;
|
||
/** 命中但不满足取消条件被跳过的订单 ID */
|
||
skipped_order_ids: number[];
|
||
skipped_count: number;
|
||
skipped_reasons: PendingOrderCancelB2bSkippedReason[];
|
||
/** 当前仓库 current 分表中查不到的订单 ID(已进配送/历史/外仓表,或不属于本仓) */
|
||
not_found_order_ids: number[];
|
||
};
|
||
|
||
export function orderPendingOrderCancelB2b(
|
||
data: PendingOrderCancelB2bParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.cancelB2b",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* B2B 作业入参(ids / order_ids / orderIds / id / order_id / orderId 均可,单值或数组)
|
||
* - 服务端取值优先级:ids > order_ids > orderIds > id > order_id > orderId
|
||
* - 加急类接口单次最多 200 个订单;备货/提货为**单订单作业**,传多个订单返回 400
|
||
* - warehouse_id 由服务端从登录上下文注入(ctx.user.store_id),前端禁止传入
|
||
*/
|
||
export type PendingOrderB2bOrderIdParams = {
|
||
ids?: number[] | number;
|
||
order_ids?: number[] | number;
|
||
orderIds?: number[] | number;
|
||
id?: number;
|
||
order_id?: number;
|
||
orderId?: number;
|
||
};
|
||
|
||
/**
|
||
* B2B 照片入参项:可直接传 file_id,或传 { file_id, display_order }
|
||
* (display_order 缺省按去重后下标补 0 起序号)
|
||
*/
|
||
export type PendingOrderB2bImageInput =
|
||
| number
|
||
| { file_id: number; display_order?: number };
|
||
|
||
/**
|
||
* B2B 照片项(接口响应内):order.pickupB2b / order.updateB2bOrderImages 返回 { file_id, url, display_order };
|
||
* 明细与列表的 images / pickup_images 返回 { id: file_id, url, display_order }(见 OrderDetailImage)
|
||
*/
|
||
export type PendingOrderB2bImageItem = {
|
||
/** file_id */
|
||
file_id: number | string;
|
||
url: string;
|
||
display_order?: number;
|
||
};
|
||
|
||
/**
|
||
* order.startB2bPrep:备货开始(仅 B2B 订单,单订单作业)
|
||
* - 操作人取当前登录工号写入 prep_operator_id / prep_operator_name,prep_status 置 padding,prep_start_at 记开始时间
|
||
* - 同工号重复调用幂等成功(保留首次开始时间,见 idempotent_order_ids);已被其他工号开始或已备货完成则返回失败
|
||
*/
|
||
export type PendingOrderStartB2bPrepResponse = {
|
||
/** 固定 padding */
|
||
prep_status: string;
|
||
/** 本次备货人工号 ID */
|
||
prep_operator_id: number;
|
||
/** 备货人姓名 */
|
||
prep_operator_name?: string;
|
||
/** 备货开始成功的订单 ID(含幂等命中) */
|
||
started_order_ids: number[];
|
||
started_count: number;
|
||
/** 同工号重复开始、未重置开始时间的订单 ID */
|
||
idempotent_order_ids: number[];
|
||
};
|
||
|
||
export function orderPendingOrderStartB2bPrep(
|
||
data: PendingOrderB2bOrderIdParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.startB2bPrep",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.cancelB2bPrep:取消备货(仅 B2B 订单,单订单作业)
|
||
* - prep_status 重置 none,并清空 prep_operator_id / prep_operator_name / prep_start_at / prep_at,prep_duration_seconds 置 0
|
||
* - 仅 prep_status=padding(备货中)可取消,且必须由记录在案的同一工号操作(备货人与当前工号不一致返回失败)
|
||
*/
|
||
export type PendingOrderCancelB2bPrepResponse = {
|
||
/** 固定 none */
|
||
prep_status: string;
|
||
canceled_order_ids: number[];
|
||
canceled_count: number;
|
||
};
|
||
|
||
export function orderPendingOrderCancelB2bPrep(
|
||
data: PendingOrderB2bOrderIdParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.cancelB2bPrep",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.finishB2bPrep:备货完成(仅 B2B 订单,单订单作业)
|
||
* - 必传 prep_remark(≤500 字符)与 total_box_count(≥0 整数)
|
||
* - 写入 prep_remark / total_box_count / prep_at(提交时刻)/ prep_duration_seconds,prep_status 置 fin
|
||
* - 仅 prep_status=padding 可提交,且必须由同一备货工号提交
|
||
* - ⚠️ 完成时**同步扣减库存**(口径同拣货完成:扣 wms_storage 锁定+可用、写 OUTBOUND/PICK_OUTBOUND 流水、wms_picking 置 fin)
|
||
* - 仓库开启 subject_config.b2b_packing_quantity_check 时,逐商品行校验分箱数量合计 = plan_qty,
|
||
* 并校验 total_box_count = 分箱箱号数;不符返回 400(data.item_mismatches),事务回滚
|
||
*/
|
||
export type PendingOrderFinishB2bPrepParams = PendingOrderB2bOrderIdParams & {
|
||
/** 备货备注,必填,最长 500 字符 */
|
||
prep_remark: string;
|
||
prepRemark?: string;
|
||
/** 总箱数,必填,大于等于 0 的整数 */
|
||
total_box_count: number;
|
||
totalBoxCount?: number;
|
||
};
|
||
|
||
/** order.finishB2bPrep 齐套校验失败明细项(data.item_mismatches) */
|
||
export type PendingOrderFinishB2bPrepMismatch = {
|
||
/** 订单商品明细ID */
|
||
order_item_id?: number;
|
||
item_id?: number | null;
|
||
item_code?: string | null;
|
||
item_name?: string | null;
|
||
/** 应拣数量 */
|
||
plan_qty?: number;
|
||
/** 已分箱数量合计 */
|
||
packed_quantity?: number;
|
||
};
|
||
|
||
/** order.finishB2bPrep 响应 */
|
||
export type PendingOrderFinishB2bPrepResponse = {
|
||
/** 固定 fin */
|
||
prep_status: string;
|
||
prep_remark: string;
|
||
total_box_count: number;
|
||
/** 备货完成时间(提交时刻) */
|
||
prep_at: string;
|
||
/** 备货用时(秒)= 提交时刻 - 备货开始时间 */
|
||
prep_duration_seconds: number;
|
||
finished_order_ids: number[];
|
||
finished_count: number;
|
||
/** 本次扣减的库存记录(wms_storage.id),无扣减时为空数组 */
|
||
stock_deducted_storage_ids: number[];
|
||
/** 本次扣减的库存总量合计,无扣减时为 0 */
|
||
stock_deducted_quantity: number;
|
||
};
|
||
|
||
export function orderPendingOrderFinishB2bPrep(
|
||
data: PendingOrderFinishB2bPrepParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.finishB2bPrep",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.pickupB2b:B2B 提货(仅 B2B 订单,单订单作业)
|
||
* - is_picked_up 置 Y、picked_up_at 记提交时刻;要求 is_b2b=Y、未取消、prep_status=fin
|
||
* - **提货即出库完成**:同一事务把订单所在分表的 outbound_status 置 fin、step 置 4、delivery_time 置提货时间,
|
||
* 随后由出库迁移调度搬到配送表(dispatch_lane=m4),可从 order.deliveryOrder2b.list 查询
|
||
* - 已提货重复调用幂等成功并返回首次提货时间(already_picked_up=true);已提货但主表未出库的历史单会补写(自愈)
|
||
* - 订单先在 current 分表查,未命中兜底 dispatch 分表
|
||
* - 可选 pickup_plate_number:提货时一并写入提货车牌(空串/null 清空;已提货时传不同值返回 400)
|
||
* - 可选 pickup_file_ids:提货照片(追加语义,写入 business_type=b2b_pickup,不覆盖已有照片)
|
||
*/
|
||
export type PendingOrderPickupB2bParams = PendingOrderB2bOrderIdParams & {
|
||
/** 提货车牌(可选;归一化后写入 wms_order_b2b.pickup_plate_number) */
|
||
pickup_plate_number?: string | null;
|
||
/** 车牌驼峰别名(与 pickup_plate_number 等价) */
|
||
pickupPlateNumber?: string | null;
|
||
/** 提货照片 file_id 列表(可选;兼容 pickupFileIds / file_ids / fileIds / pickup_images) */
|
||
pickup_file_ids?: PendingOrderB2bImageInput[];
|
||
/** 提货照片 file_id 列表驼峰别名 */
|
||
pickupFileIds?: PendingOrderB2bImageInput[];
|
||
/** 提货照片 file_id 数组简写 */
|
||
file_ids?: number[];
|
||
/** 提货照片 file_id 数组驼峰简写 */
|
||
fileIds?: number[];
|
||
/** 提货照片(与 pickup_file_ids 等价的兼容字段名) */
|
||
pickup_images?: PendingOrderB2bImageInput[];
|
||
};
|
||
|
||
export type PendingOrderPickupB2bResponse = {
|
||
/** 固定 Y */
|
||
is_picked_up: string;
|
||
/** 提货时间(幂等命中时为首次提货时间) */
|
||
picked_up_at: string;
|
||
/** 提货订单 ID(恒为单元素数组) */
|
||
picked_up_order_ids: number[];
|
||
/** 固定 1 */
|
||
picked_up_count: number;
|
||
/** true=已提货幂等命中(未改写提货时间与操作日志) */
|
||
already_picked_up: boolean;
|
||
/** 订单当前提货车牌:本次传入为新值,未传为库中已有值,均无时为 null */
|
||
pickup_plate_number?: string | null;
|
||
/** 订单当前提货照片(business_type=b2b_pickup),无照片为空数组 */
|
||
pickup_images: PendingOrderB2bImageItem[];
|
||
/** 订单当前提货照片数量 */
|
||
pickup_image_count: number;
|
||
/** 提货后订单主表出库状态,固定 fin */
|
||
outbound_status: string;
|
||
/** 提货后订单主表步骤,固定 4(已出库,等待迁移到配送表) */
|
||
step: number;
|
||
/** 本次调用是否写入了主表出库状态(已提货且主表已完成出库时为 false) */
|
||
outbound_marked: boolean;
|
||
};
|
||
|
||
export function orderPendingOrderPickupB2b(
|
||
data: PendingOrderPickupB2bParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pickupB2b",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.setB2bUrgent:批量设置 B2B 订单是否加急(单次最多 200 个)
|
||
* - 订单先查 current 分表,未命中兜底 dispatch 分表(覆盖配送域 B2B 订单)
|
||
* - 非 B2B 订单(is_b2b != 'Y')与已取消订单(status=cancel)逐条跳过,原因见 skipped_reasons
|
||
* - 设置后 order.pendingOrder2b.list / order.deliveryOrder2b.list 的「加急优先」排序立即生效
|
||
*/
|
||
export type PendingOrderSetB2bUrgentParams = PendingOrderB2bOrderIdParams & {
|
||
/**
|
||
* 是否加急,缺省 Y(调用即设为加急);支持 Y/N(大小写与首尾空格不敏感)、true/false、1/0、是/否;
|
||
* 传 N/false/0 表示取消加急;取值非法返回 400
|
||
*/
|
||
is_urgent?: string;
|
||
isUrgent?: string;
|
||
urgent?: string;
|
||
};
|
||
|
||
/** order.setB2bUrgent / cancelB2bUrgent 跳过原因项 */
|
||
export type PendingOrderSetB2bUrgentSkipReason = {
|
||
order_id: number;
|
||
delivery_order_code?: string;
|
||
/** 订单不是B2B订单 / 订单已取消,不允许设置加急 */
|
||
reason: string;
|
||
};
|
||
|
||
/** order.setB2bUrgent 响应 */
|
||
export type PendingOrderSetB2bUrgentResponse = {
|
||
/** 本次设置的加急标记(Y/N),与入参归一化结果一致 */
|
||
is_urgent: string;
|
||
updated_order_ids: number[];
|
||
updated_count: number;
|
||
skipped_order_ids: number[];
|
||
skipped_count: number;
|
||
skipped_reasons: PendingOrderSetB2bUrgentSkipReason[];
|
||
/** current 与 dispatch 分表都查不到的订单 ID(不属于本仓、已归档/外仓或 ID 不存在) */
|
||
not_found_order_ids: number[];
|
||
};
|
||
|
||
export function orderPendingOrderSetB2bUrgent(
|
||
data: PendingOrderSetB2bUrgentParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.setB2bUrgent",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.cancelB2bUrgent:取消 B2B 订单加急(等价 setB2bUrgent 传 is_urgent='N',本接口强制覆盖为 N)
|
||
* - 入参只有订单 ID(不需传 is_urgent),单次最多 200 个
|
||
*/
|
||
export type PendingOrderCancelB2bUrgentResponse = Omit<
|
||
PendingOrderSetB2bUrgentResponse,
|
||
"is_urgent"
|
||
> & {
|
||
/** 固定 N */
|
||
is_urgent: string;
|
||
};
|
||
|
||
export function orderPendingOrderCancelB2bUrgent(
|
||
data: PendingOrderB2bOrderIdParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.cancelB2bUrgent",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.setB2bPickupPlate:录入/修改 B2B 提货车牌(仅 B2B 订单,单订单作业,提货前可改)
|
||
* - 车牌归一化(去空格与 ·/•/-/-/_ 分隔符后转大写)后写入 wms_order_b2b.pickup_plate_number
|
||
* - pickup_plate_number 键必须传;传空字符串或 null 表示清空车牌
|
||
* - 仅 is_b2b=Y 且未取消的订单可录入;已提货(is_picked_up=Y)后车牌锁定不允许再修改
|
||
* - 作业明细行缺失时按默认值补建(detail_created=true)
|
||
*/
|
||
export type PendingOrderSetB2bPickupPlateParams = {
|
||
/** 订单ID:单订单作业,仅允许传 1 个(单值或单元素数组) */
|
||
ids: number[];
|
||
/** 提货车牌;空字符串或 null 表示清空 */
|
||
pickup_plate_number: string | null;
|
||
/** 车牌驼峰别名(与 pickup_plate_number 等价,后端兼容) */
|
||
pickupPlateNumber?: string | null;
|
||
};
|
||
|
||
export type PendingOrderSetB2bPickupPlateResponse = {
|
||
order_id: number;
|
||
delivery_order_code: string;
|
||
/** 本次落库的车牌(归一化后);清空时为 null */
|
||
pickup_plate_number: string | null;
|
||
/** 修改前的车牌;原本无车牌时为 null */
|
||
previous_pickup_plate_number: string | null;
|
||
/** 车牌是否发生变化(false 表示与原值一致,未重复写操作日志) */
|
||
changed: boolean;
|
||
/** 作业明细行是否本次补建(true=原无 wms_order_b2b 行) */
|
||
detail_created: boolean;
|
||
};
|
||
|
||
export function orderPendingOrderSetB2bPickupPlate(
|
||
data: PendingOrderSetB2bPickupPlateParams,
|
||
): Promise<PendingOrderSetB2bPickupPlateResponse> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.setB2bPickupPlate",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.updateB2bOrderImages:更新 B2B 订单备货留证照片(单订单,全量覆盖)
|
||
* - business_type 固定 b2b_order(与提货照片 b2b_pickup 分开存放)
|
||
* - images 全量覆盖语义,传 [] 清空;单订单最多 20 张;文件必须属于当前仓库且未删除
|
||
*/
|
||
export type PendingOrderUpdateB2bOrderImagesParams = {
|
||
/** 订单ID:单订单作业,仅允许传 1 个(单值或单元素数组) */
|
||
ids: number[];
|
||
/** 备货照片列表(全量覆盖;支持 file_id 或 { file_id, display_order }) */
|
||
images?: PendingOrderB2bImageInput[];
|
||
/** file_id 数组简写(与 images 等价,后端兼容;与 fileIds 二选一) */
|
||
file_ids?: number[];
|
||
/** file_id 数组驼峰简写(与 file_ids 等价) */
|
||
fileIds?: number[];
|
||
};
|
||
|
||
export type PendingOrderUpdateB2bOrderImagesResponse = {
|
||
order_id: number;
|
||
delivery_order_code: string;
|
||
image_count: number;
|
||
/** 更新后的备货照片列表(按 display_order、id 升序) */
|
||
images: PendingOrderB2bImageItem[];
|
||
added_file_ids: number[];
|
||
removed_file_ids: number[];
|
||
};
|
||
|
||
export function orderPendingOrderUpdateB2bOrderImages(
|
||
data: PendingOrderUpdateB2bOrderImagesParams,
|
||
): Promise<PendingOrderUpdateB2bOrderImagesResponse> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.updateB2bOrderImages",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.getB2bPackingSnapshot:查询单个 B2B 订单的商品明细与分箱快照
|
||
* - items 每项含 order_item_id / plan_qty / packed_quantity / boxes({ box_no, quantity })
|
||
* 以及 pick_locations(该商品从哪些储位取货多少:{ space_id, space_name, quantity })
|
||
* - pick_location_count:本单涉及的不同储位个数(wms_picking 排除 status=cancel,未分配储位为 0)
|
||
* - require_packing_quantity_match:当前仓库是否开启分箱齐套校验(subject_config.b2b_packing_quantity_check)
|
||
*/
|
||
export type PendingOrderB2bPackingBox = {
|
||
box_no: string;
|
||
quantity: number;
|
||
};
|
||
|
||
/** 逐商品取货储位(wms_picking 排除 status=cancel,同商品同储位合并数量) */
|
||
export type PendingOrderB2bPackingPickLocation = {
|
||
space_id: number | string;
|
||
space_name: string;
|
||
/** 该商品在此储位的取货数量 */
|
||
quantity: number;
|
||
};
|
||
|
||
export type PendingOrderB2bPackingSnapshotItem = {
|
||
order_item_id: number;
|
||
item_id?: number | null;
|
||
stock_id?: number | null;
|
||
item_code?: string | null;
|
||
item_name?: string | null;
|
||
item_snapshot?: Record<string, any> | null;
|
||
/** 应拣数量(订单明细 plan_qty) */
|
||
plan_qty: number;
|
||
/** 已分箱数量 */
|
||
packed_quantity: number;
|
||
boxes: PendingOrderB2bPackingBox[];
|
||
/** 该商品的取货储位(未分配储位时为空数组) */
|
||
pick_locations: PendingOrderB2bPackingPickLocation[];
|
||
};
|
||
|
||
export type PendingOrderB2bPackingSnapshot = {
|
||
order_id: number;
|
||
delivery_order_code: string;
|
||
status?: string;
|
||
/** 备货状态,无作业明细时为 none */
|
||
prep_status: string;
|
||
total_box_count: number;
|
||
/** 取货储位数量(本单涉及的不同储位个数),未分配储位时为 0 */
|
||
pick_location_count: number;
|
||
/** 当前仓库是否启用分箱数量齐套校验 */
|
||
require_packing_quantity_match: boolean;
|
||
items: PendingOrderB2bPackingSnapshotItem[];
|
||
};
|
||
|
||
export function orderPendingOrderGetB2bPackingSnapshot(
|
||
data: PendingOrderB2bOrderIdParams,
|
||
): Promise<PendingOrderB2bPackingSnapshot> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.getB2bPackingSnapshot",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/**
|
||
* order.updateB2bPackingItems:全量更新单个 B2B 订单的分箱商品明细
|
||
* - 每条记录关联订单商品明细 order_item_id,记录箱号 box_no 与该箱数量 quantity
|
||
* - 整单全量替换,items 传空数组可清空;同时按不同箱号数同步 wms_order_b2b.total_box_count
|
||
* - 仅当前仓库的 B2B 且备货中(prep_status=padding)的订单可更新
|
||
*/
|
||
export type PendingOrderB2bPackingItem = {
|
||
/** 订单商品明细ID */
|
||
order_item_id: number;
|
||
/** 箱号(最长 50 字符) */
|
||
box_no: string;
|
||
/** 该商品在该箱的正整数数量 */
|
||
quantity: number;
|
||
/** 商品明细ID 驼峰别名(与 order_item_id 等价,后端兼容) */
|
||
orderItemId?: number;
|
||
/** 箱号驼峰别名(与 box_no 等价) */
|
||
boxNo?: string;
|
||
};
|
||
|
||
export type PendingOrderUpdateB2bPackingItemsParams = {
|
||
/** 订单ID:仅允许传 1 个(单值或单元素数组) */
|
||
ids: number[];
|
||
/** 完整分箱明细(最多 10000 条;同一商品行与箱号不能重复) */
|
||
items: PendingOrderB2bPackingItem[];
|
||
};
|
||
|
||
export type PendingOrderUpdateB2bPackingItemsResponse = {
|
||
order_id: number;
|
||
/** 本次保存的分箱明细行数 */
|
||
item_count: number;
|
||
/** 不同箱号的数量 */
|
||
box_count: number;
|
||
};
|
||
|
||
export function orderPendingOrderUpdateB2bPackingItems(
|
||
data: PendingOrderUpdateB2bPackingItemsParams,
|
||
): Promise<PendingOrderUpdateB2bPackingItemsResponse> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.updateB2bPackingItems",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderReverseReviewOrder(
|
||
data: PendingOrderReverseReviewParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.reverseReviewOrder",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderDetail(data: PendingOrderDetailParams): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.detail",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderMarkPendingOutboundOrder(
|
||
data: PendingOrderIdsParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.markPendingOutboundOrder",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderCancelOrder(data: PendingOrderIdsParams): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.cancelOrder",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderAllocateExpressCode(
|
||
data: PendingOrderAllocateExpressCodeParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.allocateExpressCode",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
/** 查询分配快递号任务进度 */
|
||
export function orderPendingOrderAllocateExpressCodeTaskProgress(
|
||
data: { task_id: string },
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.allocateExpressCodeTaskProgress",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderAllocateStorage(
|
||
data: PendingOrderAllocateStorageParams,
|
||
): Promise<PendingOrderAllocateStorageResponse & { code?: number; message?: string; flag?: string; data?: unknown }> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.allocateStorage",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderCancelAllocateStorage(
|
||
data: PendingOrderAllocateStorageParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.cancelAllocateStorage",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderAllocateStorageProgress(
|
||
data: PendingOrderAllocateStorageProgressParams,
|
||
): Promise<PendingOrderAllocateStorageProgressResponse & { code?: number; message?: string; flag?: string; data?: unknown }> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.allocateStorageProgress",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderSyncOrderIds(
|
||
data: PendingOrderSyncOrderIdsParams,
|
||
): Promise<PendingOrderSyncOrderIdsResponse & { code?: number; message?: string; flag?: string; data?: PendingOrderSyncOrderIdsResponse['data'] }> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.syncOrderIds",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderSyncOrderIdsProgress(
|
||
data: PendingOrderSyncOrderIdsProgressParams,
|
||
): Promise<PendingOrderSyncOrderIdsProgressResponse & { code?: number; message?: string; flag?: string }> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.syncOrderIdsProgress",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderUpdateOrderPlatform(
|
||
data: PendingOrderUpdateOrderPlatformParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.updateOrderPlatform",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderUpdateOrderExpress(
|
||
data: PendingOrderUpdateOrderExpressParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.updateOrderExpress",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderUpdateAddress(
|
||
data: PendingOrderUpdateAddressParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.updateAddress",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderCloneOrder(data: PendingOrderCloneOrderParams): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.cloneOrder",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderCreateOrder(data: PendingOrderCreateOrderParams): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.createOrder",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderImportOrdersFromExcel(
|
||
data: PendingOrderImportOrdersFromExcelParams,
|
||
): Promise<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.importOrdersFromExcel",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export function orderPendingOrderParseAddress(
|
||
data: PendingOrderParseAddressParams,
|
||
): Promise<PendingOrderParseAddressResponse> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.parseAddress",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
// 地址解析可能调用外部服务,超时时间延长至 10 分钟
|
||
timeout: 600000,
|
||
} as any);
|
||
}
|
||
|
||
/** order.pendingOrder.parseAddressLocal 入参(可选;两者均不传时后端用内置示例地址数据) */
|
||
export type PendingOrderParseAddressLocalParams = {
|
||
/** 单条地址解析;也支持传字符串数组批量解析(与 addresses 二选一) */
|
||
address?: string | string[];
|
||
/** 批量地址解析(单次最多 50 条) */
|
||
addresses?: string[];
|
||
};
|
||
|
||
/** order.pendingOrder.parseAddressLocal 响应(结构同 parseAddress,额外含 data.source) */
|
||
export type PendingOrderParseAddressLocalResponse = PendingOrderParseAddressResponse & {
|
||
data?: PendingOrderParseAddressData & {
|
||
list?: PendingOrderParseAddressItem[];
|
||
/** 未传 address/addresses 时为 sample,表示结果来自内置示例地址数据 */
|
||
source?: string;
|
||
};
|
||
};
|
||
|
||
/**
|
||
* order.pendingOrder.parseAddressLocal:本地地址解析(不调 AI,内置省市区字典遍历识别)。
|
||
* 与 parseAddress 解析逻辑等价;区别是可完全无参调用(返回内置示例地址数据的识别结果)。
|
||
*/
|
||
export function orderPendingOrderParseAddressLocal(
|
||
data: PendingOrderParseAddressLocalParams = {},
|
||
): Promise<PendingOrderParseAddressLocalResponse> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.parseAddressLocal",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
// 批量解析(最多 50 条)耗时较长,超时时间延长至 10 分钟
|
||
timeout: 600000,
|
||
} as any);
|
||
}
|
||
|
||
/** order.pendingOrder.batchIntercept:批量提交订单拦截请求 */
|
||
export function orderPendingOrderBatchIntercept(data: PendingOrderBatchInterceptParams): Promise<any> {
|
||
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<any> {
|
||
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<any> {
|
||
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<any> {
|
||
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<any> {
|
||
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<any> {
|
||
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<any> {
|
||
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<any> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.batchUnlockTaskProgress",
|
||
v,
|
||
timestamp: Date.now()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export type PendingOrderUpdateRemarkParams = {
|
||
ids: number[]
|
||
remark: string
|
||
}
|
||
|
||
export type PendingOrderUpdateRemarkResponse = {
|
||
code?: number
|
||
message?: string
|
||
updated_count?: number
|
||
ids?: number[]
|
||
data?: {
|
||
updated_count?: number
|
||
ids?: number[]
|
||
}
|
||
}
|
||
|
||
/** order.pendingOrder.updateRemark:批量修改待处理订单备注 */
|
||
export function orderPendingOrderUpdateRemark(
|
||
data: PendingOrderUpdateRemarkParams,
|
||
): Promise<PendingOrderUpdateRemarkResponse> {
|
||
return request({
|
||
url: "/system",
|
||
method: "post",
|
||
params: {
|
||
method: "order.pendingOrder.updateRemark",
|
||
v,
|
||
timestamp: Date.now(),
|
||
},
|
||
data,
|
||
isSystemApi: true,
|
||
} as any);
|
||
}
|
||
|
||
export type OrderPendingOrderApi = {
|
||
list: typeof orderPendingOrderList;
|
||
convertToB2b: typeof orderPendingOrderConvertToB2b;
|
||
cancelB2b: typeof orderPendingOrderCancelB2b;
|
||
setB2bUrgent: typeof orderPendingOrderSetB2bUrgent;
|
||
cancelB2bUrgent: typeof orderPendingOrderCancelB2bUrgent;
|
||
setB2bPickupPlate: typeof orderPendingOrderSetB2bPickupPlate;
|
||
getB2bPackingSnapshot: typeof orderPendingOrderGetB2bPackingSnapshot;
|
||
updateB2bPackingItems: typeof orderPendingOrderUpdateB2bPackingItems;
|
||
updateB2bOrderImages: typeof orderPendingOrderUpdateB2bOrderImages;
|
||
startB2bPrep: typeof orderPendingOrderStartB2bPrep;
|
||
cancelB2bPrep: typeof orderPendingOrderCancelB2bPrep;
|
||
finishB2bPrep: typeof orderPendingOrderFinishB2bPrep;
|
||
pickupB2b: typeof orderPendingOrderPickupB2b;
|
||
detail: typeof orderPendingOrderDetail;
|
||
reverseReviewOrder: typeof orderPendingOrderReverseReviewOrder;
|
||
markPendingOutboundOrder: typeof orderPendingOrderMarkPendingOutboundOrder;
|
||
cancelOrder: typeof orderPendingOrderCancelOrder;
|
||
allocateExpressCode: typeof orderPendingOrderAllocateExpressCode;
|
||
allocateExpressCodeTaskProgress: typeof orderPendingOrderAllocateExpressCodeTaskProgress;
|
||
allocateStorage: typeof orderPendingOrderAllocateStorage;
|
||
allocateStorageProgress: typeof orderPendingOrderAllocateStorageProgress;
|
||
cancelAllocateStorage: typeof orderPendingOrderCancelAllocateStorage;
|
||
syncOrderIds: typeof orderPendingOrderSyncOrderIds;
|
||
syncOrderIdsProgress: typeof orderPendingOrderSyncOrderIdsProgress;
|
||
updateOrderPlatform: typeof orderPendingOrderUpdateOrderPlatform;
|
||
updateOrderExpress: typeof orderPendingOrderUpdateOrderExpress;
|
||
updateAddress: typeof orderPendingOrderUpdateAddress;
|
||
updateRemark: typeof orderPendingOrderUpdateRemark;
|
||
cloneOrder: typeof orderPendingOrderCloneOrder;
|
||
manualWaybill: typeof orderPendingOrderManualWaybill;
|
||
importWaybill: typeof orderPendingOrderImportWaybill;
|
||
createOrder: typeof orderPendingOrderCreateOrder;
|
||
importOrdersFromExcel: typeof orderPendingOrderImportOrdersFromExcel;
|
||
downloadCreateTemplate: typeof orderPendingOrderDownloadCreateTemplate;
|
||
parseAddress: typeof orderPendingOrderParseAddress;
|
||
parseAddressLocal: typeof orderPendingOrderParseAddressLocal;
|
||
batchIntercept: typeof orderPendingOrderBatchIntercept;
|
||
batchInterceptTaskProgress: typeof orderPendingOrderBatchInterceptTaskProgress;
|
||
batchUnintercept: typeof orderPendingOrderBatchUnintercept;
|
||
batchUninterceptTaskProgress: typeof orderPendingOrderBatchUninterceptTaskProgress;
|
||
batchLock: typeof orderPendingOrderBatchLock;
|
||
batchLockTaskProgress: typeof orderPendingOrderBatchLockTaskProgress;
|
||
batchUnlock: typeof orderPendingOrderBatchUnlock;
|
||
batchUnlockTaskProgress: typeof orderPendingOrderBatchUnlockTaskProgress;
|
||
allocateSubOrderNumber: typeof orderPendingOrderAllocateSubOrderNumber;
|
||
allocateSubOrderNumberProgress: typeof orderPendingOrderAllocateSubOrderNumberProgress;
|
||
};
|
||
|
||
export const orderPendingOrder: OrderPendingOrderApi = {
|
||
list: orderPendingOrderList,
|
||
convertToB2b: orderPendingOrderConvertToB2b,
|
||
cancelB2b: orderPendingOrderCancelB2b,
|
||
setB2bUrgent: orderPendingOrderSetB2bUrgent,
|
||
cancelB2bUrgent: orderPendingOrderCancelB2bUrgent,
|
||
setB2bPickupPlate: orderPendingOrderSetB2bPickupPlate,
|
||
getB2bPackingSnapshot: orderPendingOrderGetB2bPackingSnapshot,
|
||
updateB2bPackingItems: orderPendingOrderUpdateB2bPackingItems,
|
||
updateB2bOrderImages: orderPendingOrderUpdateB2bOrderImages,
|
||
startB2bPrep: orderPendingOrderStartB2bPrep,
|
||
cancelB2bPrep: orderPendingOrderCancelB2bPrep,
|
||
finishB2bPrep: orderPendingOrderFinishB2bPrep,
|
||
pickupB2b: orderPendingOrderPickupB2b,
|
||
detail: orderPendingOrderDetail,
|
||
reverseReviewOrder: orderPendingOrderReverseReviewOrder,
|
||
markPendingOutboundOrder: orderPendingOrderMarkPendingOutboundOrder,
|
||
cancelOrder: orderPendingOrderCancelOrder,
|
||
allocateExpressCode: orderPendingOrderAllocateExpressCode,
|
||
allocateExpressCodeTaskProgress: orderPendingOrderAllocateExpressCodeTaskProgress,
|
||
allocateStorage: orderPendingOrderAllocateStorage,
|
||
allocateStorageProgress: orderPendingOrderAllocateStorageProgress,
|
||
cancelAllocateStorage: orderPendingOrderCancelAllocateStorage,
|
||
syncOrderIds: orderPendingOrderSyncOrderIds,
|
||
syncOrderIdsProgress: orderPendingOrderSyncOrderIdsProgress,
|
||
updateOrderPlatform: orderPendingOrderUpdateOrderPlatform,
|
||
updateOrderExpress: orderPendingOrderUpdateOrderExpress,
|
||
updateAddress: orderPendingOrderUpdateAddress,
|
||
updateRemark: orderPendingOrderUpdateRemark,
|
||
cloneOrder: orderPendingOrderCloneOrder,
|
||
manualWaybill: orderPendingOrderManualWaybill,
|
||
importWaybill: orderPendingOrderImportWaybill,
|
||
createOrder: orderPendingOrderCreateOrder,
|
||
importOrdersFromExcel: orderPendingOrderImportOrdersFromExcel,
|
||
downloadCreateTemplate: orderPendingOrderDownloadCreateTemplate,
|
||
parseAddress: orderPendingOrderParseAddress,
|
||
parseAddressLocal: orderPendingOrderParseAddressLocal,
|
||
batchIntercept: orderPendingOrderBatchIntercept,
|
||
batchInterceptTaskProgress: orderPendingOrderBatchInterceptTaskProgress,
|
||
batchUnintercept: orderPendingOrderBatchUnintercept,
|
||
batchUninterceptTaskProgress: orderPendingOrderBatchUninterceptTaskProgress,
|
||
batchLock: orderPendingOrderBatchLock,
|
||
batchLockTaskProgress: orderPendingOrderBatchLockTaskProgress,
|
||
batchUnlock: orderPendingOrderBatchUnlock,
|
||
batchUnlockTaskProgress: orderPendingOrderBatchUnlockTaskProgress,
|
||
allocateSubOrderNumber: orderPendingOrderAllocateSubOrderNumber,
|
||
allocateSubOrderNumberProgress: orderPendingOrderAllocateSubOrderNumberProgress,
|
||
};
|
||
|
||
export const orderPendingOrder2b = {
|
||
list: orderPendingOrder2bList,
|
||
setB2bUrgent: orderPendingOrderSetB2bUrgent,
|
||
cancelB2bUrgent: orderPendingOrderCancelB2bUrgent,
|
||
setB2bPickupPlate: orderPendingOrderSetB2bPickupPlate,
|
||
getB2bPackingSnapshot: orderPendingOrderGetB2bPackingSnapshot,
|
||
updateB2bPackingItems: orderPendingOrderUpdateB2bPackingItems,
|
||
updateB2bOrderImages: orderPendingOrderUpdateB2bOrderImages,
|
||
startB2bPrep: orderPendingOrderStartB2bPrep,
|
||
cancelB2bPrep: orderPendingOrderCancelB2bPrep,
|
||
finishB2bPrep: orderPendingOrderFinishB2bPrep,
|
||
pickupB2b: orderPendingOrderPickupB2b,
|
||
};
|