98 lines
2.9 KiB
TypeScript
98 lines
2.9 KiB
TypeScript
import { overseasHttp } from '@/shared/api/overseasHttp'
|
|||
|
|
import { unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
|
||
|
|
import type { OverseasPageResult } from './lastMileOrders'
|
||
|
|
|
||
|
|
export interface DispatchQuery {
|
||
|
|
page: number
|
||
|
|
size: number
|
||
|
|
dispatchNo?: string
|
||
|
|
vehiclePlate?: string
|
||
|
|
status?: string
|
||
|
|
fbaAppointmentNo?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface DispatchPalletCandidateDto {
|
||
|
|
planId: string
|
||
|
|
planPalletId: string
|
||
|
|
warehousePalletId?: string | null
|
||
|
|
orderId: string
|
||
|
|
overseasWarehouseId?: string | null
|
||
|
|
overseasWarehouseName?: string | null
|
||
|
|
orderNo?: string | null
|
||
|
|
orderRefs?: string | null
|
||
|
|
inboundCode?: string | null
|
||
|
|
palletNo?: string | null
|
||
|
|
destinationWarehouseId?: string | null
|
||
|
|
destinationWarehouseCode?: string | null
|
||
|
|
destinationWarehouseName?: string | null
|
||
|
|
fbaWarehouseCode?: string | null
|
||
|
|
packageCount?: number | null
|
||
|
|
volumeCbm?: number | null
|
||
|
|
sourceStage?: 'PLAN' | 'RECEIVED' | null
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface DispatchCandidateQuery {
|
||
|
|
orderNo?: string
|
||
|
|
fbaWarehouseCode?: string
|
||
|
|
sourceStage?: 'PLAN' | 'RECEIVED'
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface PreArrangeDispatchPayload {
|
||
|
|
planPalletIds: string[]
|
||
|
|
route?: string
|
||
|
|
fbaAppointmentNo?: string
|
||
|
|
fbaAppointmentStatus?: string
|
||
|
|
vehicleAppointmentStatus?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface DispatchSummaryDto {
|
||
|
|
id: string
|
||
|
|
dispatchNo: string
|
||
|
|
vehiclePlate?: string | null
|
||
|
|
driverName?: string | null
|
||
|
|
driverPhone?: string | null
|
||
|
|
carrierName?: string | null
|
||
|
|
orderNos?: string | null
|
||
|
|
route?: string | null
|
||
|
|
overseasWarehouseId?: string | null
|
||
|
|
overseasWarehouseName?: string | null
|
||
|
|
departAt?: string | null
|
||
|
|
fbaAppointmentNo?: string | null
|
||
|
|
fbaAppointmentStatus?: string | null
|
||
|
|
vehicleAppointmentStatus?: string | null
|
||
|
|
estimatedArrivalAt?: string | null
|
||
|
|
status?: string | null
|
||
|
|
itemCount?: number | null
|
||
|
|
palletCount?: number | null
|
||
|
|
packageCount?: number | null
|
||
|
|
pickedPackageCount?: number | null
|
||
|
|
shippedPackageCount?: number | null
|
||
|
|
remainingPackageCount?: number | null
|
||
|
|
partialCompletionReason?: string | null
|
||
|
|
createdAt?: string | null
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function listDispatches(query: DispatchQuery) {
|
||
|
|
const response = await overseasHttp.get<ApiEnvelope<OverseasPageResult<DispatchSummaryDto>>, ApiEnvelope<OverseasPageResult<DispatchSummaryDto>>>(
|
||
|
|
'/platform/v1/last-leg/dispatches',
|
||
|
|
{ params: query },
|
||
|
|
)
|
||
|
|
return unwrapApiResponse(response)
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function listDispatchCandidates(query: DispatchCandidateQuery) {
|
||
|
|
const response = await overseasHttp.get<ApiEnvelope<DispatchPalletCandidateDto[]>, ApiEnvelope<DispatchPalletCandidateDto[]>>(
|
||
|
|
'/platform/v1/last-leg/dispatches/candidates',
|
||
|
|
{ params: query },
|
||
|
|
)
|
||
|
|
return unwrapApiResponse(response)
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function preArrangeDispatch(payload: PreArrangeDispatchPayload) {
|
||
|
|
const response = await overseasHttp.post<ApiEnvelope<DispatchSummaryDto>, ApiEnvelope<DispatchSummaryDto>>(
|
||
|
|
'/platform/v1/last-leg/dispatches/pre-arrange',
|
||
|
|
payload,
|
||
|
|
)
|
||
|
|
return unwrapApiResponse(response)
|
||
|
|
}
|