Files
client-web/src/modules/order-management/api/inboundPlans.ts
T

76 lines
2.3 KiB
TypeScript

import { overseasApiRequest } from '@/api/overseasHttp'
export interface PageResult<T> { records: T[]; page: number; size: number; total: number; pages: number }
export interface InboundPlanQuery {
page: number
size: number
planNo?: string
inboundCode?: string
status?: string
destinationWarehouseCode?: string
appointmentStatus?: string
dispatchStatus?: string
createdFrom?: string
createdTo?: string
}
export interface InboundPlanSummary {
planNo: string
inboundCode: string
orderType: string | null
overseasWarehouseCode?: string | null
overseasWarehouseName?: string | null
fbaWarehouseCode: string | null
packageCount: number
pickedPackageCount: number
volumeCbm: number | null
palletCount: number
status: string
appointmentNo: string | null
appointmentStatus: string | null
appointmentAt: string | null
expectedLoadingAt: string | null
dispatchStatus: string | null
createdAt: string
version: number
}
export interface InboundPlanLine {
inboundCode: string
fbaWarehouseCode: string | null
destinationWarehouseCode: string | null
destinationWarehouseName: string | null
volumeCbm: number
requiredPackageCount: number
plannedPalletCount: number
}
export interface InboundPlanPallet {
palletNo: string
destinationWarehouseCode: string | null
destinationWarehouseName: string | null
capacityCbm: number
allocatedVolumeCbm: number
}
export interface InboundPlanDetail {
planNo: string
containerNo: string | null
overseasWarehouseCode?: string | null
overseasWarehouseName?: string | null
status: string
lineCount: number
palletCount: number
totalVolumeCbm: number
expectedPackageCount: number
pickedPackageCount: number
lines: InboundPlanLine[]
pallets: InboundPlanPallet[]
version: number
}
export async function listInboundPlans(params: InboundPlanQuery) {
const result = await overseasApiRequest<PageResult<InboundPlanSummary>>({ method: 'GET', url: '/merchant/v1/last-leg/inbound-plans', params })
return { ...result, page: Number(result.page), size: Number(result.size), total: Number(result.total), pages: Number(result.pages) }
}
export function getInboundPlan(planNo: string) {
return overseasApiRequest<InboundPlanDetail>({ method: 'GET', url: `/merchant/v1/last-leg/inbound-plans/${encodeURIComponent(planNo)}` })
}