完善退税报关回执交互

This commit is contained in:
2026-09-24 16:29:31 +08:00
parent 4e37dc3330
commit 945a3d3230
4 changed files with 30 additions and 33 deletions
@@ -31,6 +31,8 @@ export interface ContainerCustomsDocument {
inboundCodes: string[]
frozen: boolean
completion: ContainerCustomsFile | null
receiptStatus?: 'PENDING' | 'CONFIRMED' | 'REJECTED' | null
receiptRejectReason?: string | null
}
export interface ContainerCustomsView {
@@ -45,6 +47,7 @@ export interface ContainerCustomsView {
version: number
taxRefundCount: number
coveredTaxRefundCount: number
actualBoxCount: number
inbounds: ContainerCustomsInbound[]
documents: ContainerCustomsDocument[]
startedAt: string | null
@@ -105,13 +108,13 @@ export function completeAllBuyContainerCustoms(loadingPlanId: string, expectedVe
return action(loadingPlanId, 'complete-all-buy', expectedVersion)
}
export async function uploadContainerCustomsCompletion(documentId: string, fileValue: File, expectedVersion: number, finalConfirmation: boolean) {
export async function uploadContainerCustomsCompletion(documentId: string, fileValue: File, expectedVersion: number) {
const body = new FormData()
body.append('file', fileValue)
const response = await http.post<ApiEnvelope<ContainerCustomsDocument>, ApiEnvelope<ContainerCustomsDocument>>(
`${basePath}/documents/${encodeURIComponent(documentId)}/completion/upload`,
body,
{ params: { expectedVersion, finalConfirmation }, headers: { 'Content-Type': 'multipart/form-data', 'Idempotency-Key': operationId('container-customs-completion') } },
{ params: { expectedVersion }, headers: { 'Content-Type': 'multipart/form-data', 'Idempotency-Key': operationId('container-customs-completion') } },
)
const result = unwrapApiResponse(response)
return { ...result, documentId: String(result.documentId), tenantId: String(result.tenantId), source: file(result.source)!, completion: file(result.completion) }