72 lines
2.1 KiB
TypeScript
72 lines
2.1 KiB
TypeScript
import { overseasHttp } from '@/shared/api/overseasHttp'
|
|||
|
|
import { unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
|
||
|
|
import type { OverseasPageResult } from './lastMileOrders'
|
||
|
|
|
||
|
|
export interface RelabelOrderQuery {
|
||
|
|
customerId: string
|
||
|
|
page: number
|
||
|
|
size: number
|
||
|
|
skuCode?: string
|
||
|
|
status?: string
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface RelabelSummaryDto {
|
||
|
|
id: string
|
||
|
|
relabelNo: string
|
||
|
|
lastlegOrderId?: string | null
|
||
|
|
lastlegOrderNo?: string | null
|
||
|
|
customerOrderNo?: string | null
|
||
|
|
overseasWarehouseId?: string | null
|
||
|
|
labelDeadline?: string | null
|
||
|
|
contactName?: string | null
|
||
|
|
contactPhone?: string | null
|
||
|
|
status?: string | null
|
||
|
|
itemCount?: number | null
|
||
|
|
totalPackageCount?: number | null
|
||
|
|
notifiedPackageCount?: number | null
|
||
|
|
skuCodes?: string | null
|
||
|
|
createdAt?: string | null
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface RelabelItemDto {
|
||
|
|
id: string
|
||
|
|
skuCode?: string | null
|
||
|
|
productNameZh?: string | null
|
||
|
|
totalPackageCount?: number | null
|
||
|
|
notifiedPackageCount?: number | null
|
||
|
|
newSkuCode?: string | null
|
||
|
|
labelRequirement?: string | null
|
||
|
|
relabelFileName?: string | null
|
||
|
|
relabelFileUrl?: string | null
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface RelabelHistoryDto {
|
||
|
|
fromStatus?: string | null
|
||
|
|
toStatus?: string | null
|
||
|
|
operatorId?: string | null
|
||
|
|
remark?: string | null
|
||
|
|
createdAt?: string | null
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface RelabelDetailDto {
|
||
|
|
application: RelabelSummaryDto
|
||
|
|
remark?: string | null
|
||
|
|
items: RelabelItemDto[]
|
||
|
|
history: RelabelHistoryDto[]
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function listRelabelOrders(query: RelabelOrderQuery) {
|
||
|
|
const { customerId, ...params } = query
|
||
|
|
const response = await overseasHttp.get<ApiEnvelope<OverseasPageResult<RelabelSummaryDto>>, ApiEnvelope<OverseasPageResult<RelabelSummaryDto>>>(
|
||
|
|
'/platform/v1/last-leg/relabel-applications', { params: { customerId, ...params } },
|
||
|
|
)
|
||
|
|
return unwrapApiResponse(response)
|
||
|
|
}
|
||
|
|
|
||
|
|
export async function getRelabelOrder(relabelNo: string, customerId: string) {
|
||
|
|
const response = await overseasHttp.get<ApiEnvelope<RelabelDetailDto>, ApiEnvelope<RelabelDetailDto>>(
|
||
|
|
`/platform/v1/last-leg/relabel-applications/${encodeURIComponent(relabelNo)}`, { params: { customerId } },
|
||
|
|
)
|
||
|
|
return unwrapApiResponse(response)
|
||
|
|
}
|