117 lines
3.4 KiB
TypeScript
117 lines
3.4 KiB
TypeScript
import request from '@/utils/request'
|
||
|
||
const v = '1.0'
|
||
|
||
/** 接口文档:summary / wave_list / ext;wave_list 单项结构由后端定义 */
|
||
export type WavePrintDataPayload = {
|
||
summary?: Record<string, unknown>
|
||
wave_list?: Record<string, unknown>[]
|
||
ext?: Record<string, unknown>
|
||
}
|
||
|
||
export type GetWavePlatformPrintDataParams = {
|
||
warehouse_id: number
|
||
wave_ids: Array<number | string>
|
||
}
|
||
|
||
export type UnlockWavePlatformPrintGroupItem = {
|
||
wave_id: number | string
|
||
platform?: string
|
||
sys_logistics_code?: string
|
||
order_ids?: Array<number | string>
|
||
}
|
||
|
||
export type UnlockWavePlatformPrintDataByGroupParams = {
|
||
warehouse_id: number
|
||
wave_ids: Array<number | string>
|
||
group_type?: 'platform' | 'platform_express' | 'order'
|
||
unlock_scope?: 'group' | 'wave'
|
||
groups: UnlockWavePlatformPrintGroupItem[]
|
||
}
|
||
|
||
/** 接口文档:summary / wave_ids / waveGroups(主)/ locked_wave_groups(锁定)/ platform_groups、order_list(兼容)/ ext */
|
||
export type WavePlatformPrintDataPayload = {
|
||
summary?: Record<string, unknown>
|
||
wave_ids?: Array<number | string>
|
||
/** 主返回:波次 → 平台 → 订单 */
|
||
waveGroups?: unknown[]
|
||
/** 锁定波次:结构与 waveGroups 一致 */
|
||
locked_wave_groups?: unknown[]
|
||
locked_orders?: Record<string, unknown>[]
|
||
locked_count?: number
|
||
platform_groups?: unknown[]
|
||
order_list?: Record<string, unknown>[]
|
||
ext?: Record<string, unknown>
|
||
}
|
||
|
||
/** 按波次 IDs 获取平台打印中间态数据(order.print.getWavePlatformPrintData) */
|
||
export function getWavePlatformPrintData(data: GetWavePlatformPrintDataParams) {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.print.getWavePlatformPrintData',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
/** 按分组解锁波次平台打印锁(order.print.unlockWavePlatformPrintDataByGroup) */
|
||
export function unlockWavePlatformPrintDataByGroup(data: UnlockWavePlatformPrintDataByGroupParams) {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.print.unlockWavePlatformPrintDataByGroup',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
export type GetOrderPrintDataParams = {
|
||
order_ids: Array<number | string>
|
||
}
|
||
|
||
/** 按订单 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)
|
||
}
|
||
|
||
export type GetPrintDataByWaybillCodesParams = {
|
||
/** 运单号数组(字符串数组,内部自动去重与归一化,必须为非空数组) */
|
||
waybill_codes: string[]
|
||
}
|
||
|
||
/** 按运单号数组拉取平台打印中间态数据(order.print.getPrintDataByWaybillCodes)
|
||
* 返回结构与 getOrderPrintData 一致 */
|
||
export function getPrintDataByWaybillCodes(data: GetPrintDataByWaybillCodesParams) {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.print.getPrintDataByWaybillCodes',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|