64 lines
1.5 KiB
TypeScript
64 lines
1.5 KiB
TypeScript
import { request, type ApiBody, type RequestOptions } from './request'
|
||
|
||
const workerPayload = {
|
||
device: 'workerstation',
|
||
project: 'warehouse',
|
||
}
|
||
|
||
/**
|
||
* 订单相关接口集中在此文件,按页面/功能拆分方法。
|
||
* method 名请与后端约定一致后修改下列字符串。
|
||
*/
|
||
|
||
/** 复核台等:订单关键词搜索(method 占位,对接后端时改名) */
|
||
export function searchOrdersForReview(
|
||
params: { keyword?: string } = {},
|
||
options?: RequestOptions
|
||
) {
|
||
return request<ApiBody>(
|
||
'order.review.search',
|
||
{
|
||
...workerPayload,
|
||
...params,
|
||
},
|
||
options
|
||
)
|
||
}
|
||
|
||
/** 当前波次待处理订单列表(method 占位) */
|
||
export function fetchCurrentWavePendingOrders(options?: RequestOptions) {
|
||
return request<ApiBody>('order.review.currentWave', { ...workerPayload }, options)
|
||
}
|
||
|
||
type OrderListPagination = {
|
||
page?: number
|
||
pageSize?: number
|
||
currentPage?: number
|
||
page_size?: number
|
||
size?: number
|
||
}
|
||
|
||
type OrderListSort = {
|
||
sortField?: string
|
||
sortOrder?: 'asc' | 'desc' | 'ASC' | 'DESC'
|
||
}
|
||
|
||
type OrderListWhere = Record<string, unknown>
|
||
|
||
type OrderListParams = {
|
||
pagination?: OrderListPagination
|
||
where?: OrderListWhere
|
||
sort?: OrderListSort
|
||
}
|
||
|
||
/**
|
||
* 订单工作台总列表
|
||
* 查询当前登录用户仓库上下文下订单总列表,支持 pagination / where / sort
|
||
*/
|
||
export function fetchOrderList(params: OrderListParams = {}, options?: RequestOptions) {
|
||
return request<ApiBody>('order.list', {
|
||
...workerPayload,
|
||
...params,
|
||
}, options)
|
||
}
|