feat(admin): edit domestic order declarations
This commit is contained in:
@@ -93,6 +93,7 @@ export interface UnifiedOrderResource {
|
||||
customerName: string | null
|
||||
channelCode: string | null
|
||||
channelName: string | null
|
||||
channelChanged?: boolean
|
||||
receivingWarehouseId: number | string | null
|
||||
receivingWarehouseName: string | null
|
||||
destinationWarehouseId: number | string | null
|
||||
@@ -102,6 +103,7 @@ export interface UnifiedOrderResource {
|
||||
inboundCode: string | null
|
||||
expectedShipDate: string | null
|
||||
totalPackageCount: number | null
|
||||
expectedVolumeCbm?: number | null
|
||||
locationCodes: string | null
|
||||
actualGrossWeightKg: number | null
|
||||
actualVolumeCbm: number | null
|
||||
@@ -170,6 +172,7 @@ export interface UnifiedOrderTimelineEvent {
|
||||
|
||||
export interface UnifiedOrderDetailOrderSnapshot {
|
||||
id: number | string | null
|
||||
version: number | null
|
||||
tenantId: number | string | null
|
||||
orderNo: string | null
|
||||
customerId: number | string | null
|
||||
@@ -329,6 +332,58 @@ function id(value: number | string | null | undefined) {
|
||||
return value === null || value === undefined || value === '' ? null : String(value)
|
||||
}
|
||||
|
||||
export interface UnifiedOrderDeclarationCargo {
|
||||
itemNo: number
|
||||
cargoName: string
|
||||
cargoNameEn?: string | null
|
||||
skuNo?: string | null
|
||||
model?: string | null
|
||||
packageCount: number
|
||||
totalQuantity: number
|
||||
lengthCm: number
|
||||
widthCm: number
|
||||
heightCm: number
|
||||
grossWeightKg: number
|
||||
volumeCbm: number
|
||||
netWeightKg?: number | null
|
||||
hsCode?: string | null
|
||||
customsHsCode?: string | null
|
||||
unitsPerPackage?: number | null
|
||||
unitDeclaredValue?: number | null
|
||||
declaredValue?: number | null
|
||||
currency?: string | null
|
||||
material?: string | null
|
||||
usage?: string | null
|
||||
brand?: string | null
|
||||
cargoRemark?: string | null
|
||||
}
|
||||
|
||||
export interface UpdateUnifiedOrderDeclarationRequest {
|
||||
expectedVersion: number
|
||||
customerRemark?: string | null
|
||||
expectedArrivalAt?: string | null
|
||||
channelCode: string
|
||||
channelName: string
|
||||
cargoes: UnifiedOrderDeclarationCargo[]
|
||||
}
|
||||
|
||||
export interface UnifiedOrderDeclarationChange {
|
||||
itemNo: number | null
|
||||
field: string
|
||||
beforeValue: string | null
|
||||
afterValue: string | null
|
||||
}
|
||||
|
||||
export interface UpdateUnifiedOrderDeclarationResult {
|
||||
orderNo: string | null
|
||||
inboundCode: string | null
|
||||
previousVersion: number
|
||||
version: number
|
||||
channelChangedBefore: boolean
|
||||
channelChanged: boolean
|
||||
changes: UnifiedOrderDeclarationChange[]
|
||||
}
|
||||
|
||||
function optionalText(value: string | null | undefined) {
|
||||
const normalized = value?.trim()
|
||||
return normalized || null
|
||||
@@ -357,6 +412,8 @@ function normalizeRow(raw: UnifiedOrderResource): UnifiedOrderResource {
|
||||
childCount: integer(raw.relation.childCount, 0),
|
||||
} : null,
|
||||
totalPackageCount: nullableInteger(raw.totalPackageCount),
|
||||
expectedVolumeCbm: numberValue(raw.expectedVolumeCbm),
|
||||
channelChanged: Boolean(raw.channelChanged),
|
||||
actualGrossWeightKg: numberValue(raw.actualGrossWeightKg),
|
||||
actualVolumeCbm: numberValue(raw.actualVolumeCbm),
|
||||
totalPalletCount: nullableInteger(raw.totalPalletCount),
|
||||
@@ -413,7 +470,26 @@ export async function getPlatformUnifiedOrder(tenantId: string, orderId: string)
|
||||
{ params: { tenantId } },
|
||||
)
|
||||
const result = unwrapApiResponse(response)
|
||||
return { ...result, summary: normalizeRow(result.summary) }
|
||||
return {
|
||||
...result,
|
||||
summary: normalizeRow(result.summary),
|
||||
order: {
|
||||
...result.order,
|
||||
order: result.order.order ? { ...result.order.order, version: nullableInteger(result.order.order.version) } : null,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export function updatePlatformUnifiedOrderDeclaration(
|
||||
tenantId: string,
|
||||
orderId: string,
|
||||
request: UpdateUnifiedOrderDeclarationRequest,
|
||||
) {
|
||||
return http.put<ApiEnvelope<UpdateUnifiedOrderDeclarationResult>, ApiEnvelope<UpdateUnifiedOrderDeclarationResult>>(
|
||||
`${unifiedOrdersApiPath}/${orderId}/declaration`,
|
||||
request,
|
||||
{ params: { tenantId } },
|
||||
).then(unwrapApiResponse)
|
||||
}
|
||||
|
||||
export function downloadPlatformProductImage(tenantId: string, fileId: string) {
|
||||
|
||||
Reference in New Issue
Block a user