feat(customs): show receipt action history in client

This commit is contained in:
2026-09-28 13:21:59 +08:00
parent 8acfbb1074
commit 8fd406331a
2 changed files with 16 additions and 0 deletions
+12
View File
@@ -21,6 +21,17 @@ export interface MerchantCustomsReceiptVersion {
createdAt: string
}
export type MerchantCustomsConfirmationAction = 'CONFIRM' | 'REJECT'
export interface MerchantCustomsConfirmationHistory {
id: string
receiptVersion: number
action: MerchantCustomsConfirmationAction
reason: string | null
operatorName: string
createdAt: string
}
export interface MerchantCustomsInbound {
inboundId: string
orderId: string
@@ -44,6 +55,7 @@ export interface MerchantCustomsDocument {
receiptRejectReason: string | null
finalDocument: MerchantCustomsFile | null
receiptHistory?: MerchantCustomsReceiptVersion[]
confirmationHistory: MerchantCustomsConfirmationHistory[]
}
export interface MerchantCustomsContainer {
@@ -249,6 +249,9 @@ function formatDateTime(value: string | null | undefined) {
function receiptHistoryLabel(document: MerchantCustomsDocument) {
return (document.receiptHistory || []).map((item) => `V${item.version}`).join('、') || '—'
}
function confirmationActionLabel(action: MerchantCustomsDocument['confirmationHistory'][number]['action']) {
return action === 'CONFIRM' ? '确认' : '打回'
}
function formatSize(bytes: number) {
if (bytes < 1024) return `${bytes} B`
@@ -345,6 +348,7 @@ function clearanceResultStatusLabel(value: MerchantClearanceResult) {
<strong>{{ item.source.fileName }}</strong>
<span>版本 V{{ item.source.version }} · {{ formatSize(item.source.sizeBytes) }} · {{ formatDateTime(item.source.uploadedAt) }}</span>
<small v-if="item.receiptHistory?.length">报关行回执历史:{{ receiptHistoryLabel(item) }}</small>
<small v-for="history in item.confirmationHistory" :key="history.id">{{ confirmationActionLabel(history.action) }} · {{ formatDateTime(history.createdAt) }} · {{ history.operatorName || '—' }}<span v-if="history.reason"> · {{ history.reason }}</span></small>
<small>关联入仓码:{{ item.inboundCodes.join('、') || '—' }}</small>
</div>
</div>