119 lines
2.7 KiB
TypeScript
119 lines
2.7 KiB
TypeScript
import request from '@/utils/request'
|
||
|
||
const v = '1.0'
|
||
|
||
/** 打包任务列表查询参数 */
|
||
export type PackingListParams = {
|
||
/** 仓库ID(按仓库维度查询,必填) */
|
||
warehouse_id?: number | string
|
||
pagination?: {
|
||
page?: number
|
||
pageSize?: number
|
||
}
|
||
where?: PackingListWhere
|
||
sort?: PackingListSort
|
||
}
|
||
|
||
/** 打包任务列表 where 条件 */
|
||
export type PackingListWhere = {
|
||
/** 任务状态:0=待处理 1=打包中 2=已完成 3=异常 */
|
||
status?: number | string
|
||
/** 打包模式:1=散单 2=团购 */
|
||
pack_mode?: number | string
|
||
/** 运单号(模糊匹配) */
|
||
waybill_code?: string
|
||
/** 波次号(模糊匹配) */
|
||
wave_no?: string
|
||
/** 订单ID(精确匹配) */
|
||
order_id?: number | string
|
||
/** 工作台ID(精确匹配) */
|
||
workbench_id?: number | string
|
||
/** 快捷搜索:运单号/波次号模糊匹配 */
|
||
quickWhere?: string
|
||
/** 开始打包时间范围-起始 */
|
||
start_time_start?: string
|
||
/** 开始打包时间范围-结束 */
|
||
start_time_end?: string
|
||
[key: string]: any
|
||
}
|
||
|
||
/** 打包任务列表排序 */
|
||
export type PackingListSort = {
|
||
sortField?: string
|
||
sortOrder?: 'ASC' | 'DESC' | 'asc' | 'desc'
|
||
}
|
||
|
||
/** 打包任务列表项 */
|
||
export type PackingTaskItem = {
|
||
id?: number
|
||
order_id?: number | string
|
||
warehouse_id?: number | string
|
||
workbench_id?: number | string
|
||
wave_id?: number | string
|
||
wave_no?: string
|
||
waybill_code?: string
|
||
pack_quantity?: number
|
||
pack_mode?: number | string
|
||
status?: number | string
|
||
start_time?: string
|
||
end_time?: string
|
||
create_time?: string
|
||
update_time?: string
|
||
[key: string]: any
|
||
}
|
||
|
||
/** 打包任务列表响应 */
|
||
export type PackingListResponse = {
|
||
list: PackingTaskItem[]
|
||
pagination: {
|
||
page?: number
|
||
pageSize?: number
|
||
total?: number
|
||
totalPages?: number
|
||
}
|
||
}
|
||
|
||
/**
|
||
* 打包任务列表查询(仓库侧)
|
||
* 按仓库维度查询 wms_pack_task 表,支持分页、筛选、排序
|
||
*/
|
||
export function packingList(data: PackingListParams = {}): Promise<{
|
||
code: number
|
||
message: string
|
||
data: PackingListResponse
|
||
}> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.packing.list',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data,
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|
||
|
||
/**
|
||
* 打包任务详情查询(仓库侧)
|
||
* 按打包任务ID + 仓库维度查询单条打包任务记录
|
||
*/
|
||
export function packingGet(id: number): Promise<{
|
||
code: number
|
||
message: string
|
||
data: PackingTaskItem
|
||
}> {
|
||
return request({
|
||
url: '/system',
|
||
method: 'post',
|
||
params: {
|
||
method: 'order.packing.get',
|
||
v,
|
||
timestamp: new Date().getTime()
|
||
},
|
||
data: { id },
|
||
isSystemApi: true
|
||
} as any)
|
||
}
|