This commit is contained in:
2026-09-17 13:36:31 +08:00
parent 5d00618c53
commit 9c9cb91593
18 changed files with 317 additions and 32 deletions
@@ -33,6 +33,10 @@ export interface DeliveryOrderRow {
destinationWarehouseId?: string | null
destinationWarehouseCode?: string | null
destinationWarehouseName?: string | null
destinationType?: 'FBA' | 'PRIVATE' | null
deliveryAddress?: string | null
contactName?: string | null
contactPhone?: string | null
overseasWarehouseId?: string | null
overseasWarehouseName?: string | null
status: string
@@ -39,13 +39,18 @@ export interface DispatchPalletCandidateDto {
sourceStage?: 'PLAN' | 'RECEIVED' | 'RELABEL' | null
cartonMarks?: string | null
relabelCartonMarks?: string | null
destinationType?: 'FBA' | 'PRIVATE' | null
deliveryAddress?: string | null
postalCode?: string | null
contactName?: string | null
contactPhone?: string | null
}
export interface DispatchCandidateQuery {
planIds?: string
orderNo?: string
fbaWarehouseCode?: string
sourceStage?: 'PLAN' | 'RECEIVED'
sourceStage?: 'PLAN' | 'RECEIVED' | 'RELABEL'
draftToken?: string
}
export interface DispatchDraftContainerDto { id: string; capacity: number; palletIds: string[] }
@@ -71,6 +71,8 @@ export interface LastMileOrderSummaryDto {
version?: number | null
palletCount?: number | null
packageCount?: number | null
receivedPackageCount?: number | null
packageDifference?: number | null
volumeCbm?: number | null
productQuantity?: number | null
volumeWeightKg?: number | null
@@ -20,6 +20,8 @@ export interface OutboundDetail { outbound: OutboundRow; pallets?: OutboundPalle
export interface OutboundQuery { page: number; size: number; documentNo?: string; lxCode?: string; warehouseId?: string; status?: string; outboundType?: string }
export interface ReturnOutboundCandidate { returnNo?: string | null; overseasWarehouseId?: string | null; cartonMark?: string | null; fbaCartonMark?: string | null; destinationWarehouseCode?: string | null; destinationWarehouseName?: string | null; totalQuantity?: number | null; status?: string | null }
export interface OneClickOutboundCandidate { inventoryPositionId: string; orderNo?: string | null; customerId?: string | null; customerName?: string | null; overseasWarehouseId?: string | null; overseasWarehouseName?: string | null; palletNo?: string | null; inboundCode?: string | null; skuCode?: string | null; productName?: string | null; availablePackages: number }
export interface WarehouseTransferOutboundCandidate { customerId: string; customerName?: string | null; transferNo: string; overseasWarehouseId: string; transferStatus: string; needRelabel: boolean; relabelNo?: string | null; packageCount: number; grossWeightKg?: number | null; volumeCbm?: number | null }
export interface WarehouseTransferDestinationPayload { transfers: Array<{ customerId: string; transferNo: string }>; destinationType: 'FBA' | 'PRIVATE'; destinationWarehouseId?: string; destinationWarehouseCode?: string; destinationWarehouseName?: string; privateDestinationAddress?: string; privateDestinationPostalCode?: string; privateDestinationContactName?: string; privateDestinationContactPhone?: string; idempotencyKey: string }
export async function listOutbounds(query: OutboundQuery) {
const response = await overseasHttp.get<ApiEnvelope<OverseasPagePayload<OutboundRow>>, ApiEnvelope<OverseasPagePayload<OutboundRow>>>('/platform/v1/last-leg/outbound-orders', { params: query })
return normalizeOverseasPage(unwrapApiResponse(response))
@@ -44,6 +46,14 @@ export async function createReturnOutbound(customerId: string, payload: { recipi
const response = await overseasHttp.post<ApiEnvelope<OutboundRow>, ApiEnvelope<OutboundRow>>('/platform/v1/last-leg/outbound-orders/return', payload, { params: { customerId } })
return unwrapApiResponse(response)
}
export async function listWarehouseTransferOutboundCandidates(query: { customerId?: string; warehouseId?: string } = {}) {
const response = await overseasHttp.get<ApiEnvelope<WarehouseTransferOutboundCandidate[]>, ApiEnvelope<WarehouseTransferOutboundCandidate[]>>('/platform/v1/last-leg/outbound-orders/warehouse-transfer/candidates', { params: query })
return unwrapApiResponse(response).map(item => ({ ...item, packageCount: Number(item.packageCount || 0) }))
}
export async function bindWarehouseTransferDestination(payload: WarehouseTransferDestinationPayload) {
const response = await overseasHttp.post<ApiEnvelope<unknown[]>, ApiEnvelope<unknown[]>>('/platform/v1/last-leg/warehouse-transfers/bind-destination', payload)
return unwrapApiResponse(response)
}
export async function cancelOutbound(outboundNo: string, reason: string) {
const response = await overseasHttp.post<ApiEnvelope<null>, ApiEnvelope<null>>(`/platform/v1/last-leg/outbound-orders/${encodeURIComponent(outboundNo)}/cancel`, { reason })
return unwrapApiResponse(response)
@@ -167,6 +167,14 @@ export async function returnRelabelForRework(relabelNo: string, expectedVersion:
return unwrapApiResponse(response)
}
export async function confirmRelabelCompletion(relabelNo: string, remark?: string) {
const response = await overseasHttp.post<ApiEnvelope<unknown>, ApiEnvelope<unknown>>(
`/platform/v1/last-leg/relabel-applications/${encodeURIComponent(relabelNo)}/confirm-completion`,
{ idempotencyKey: crypto.randomUUID(), remark },
)
return unwrapApiResponse(response)
}
export async function uploadRelabelPdf(relabelNo: string, file: File, scope: 'TOTAL' | 'ITEM', itemId?: string) {
const body = new FormData()
body.append('file', file)