feat(client): show customs receipt history
This commit is contained in:
@@ -14,6 +14,13 @@ export interface MerchantCustomsFile {
|
||||
uploadedAt: string
|
||||
}
|
||||
|
||||
export interface MerchantCustomsReceiptVersion {
|
||||
version: number
|
||||
file: MerchantCustomsFile
|
||||
operatorName: string | null
|
||||
createdAt: string
|
||||
}
|
||||
|
||||
export interface MerchantCustomsInbound {
|
||||
inboundId: string
|
||||
orderId: string
|
||||
@@ -36,6 +43,7 @@ export interface MerchantCustomsDocument {
|
||||
receiptStatus: 'PENDING' | 'CONFIRMED' | 'REJECTED' | null
|
||||
receiptRejectReason: string | null
|
||||
finalDocument: MerchantCustomsFile | null
|
||||
receiptHistory?: MerchantCustomsReceiptVersion[]
|
||||
}
|
||||
|
||||
export interface MerchantCustomsContainer {
|
||||
|
||||
@@ -246,6 +246,10 @@ function formatDateTime(value: string | null | undefined) {
|
||||
return Number.isNaN(date.getTime()) ? value : date.toLocaleString('zh-CN', { hour12: false })
|
||||
}
|
||||
|
||||
function receiptHistoryLabel(document: MerchantCustomsDocument) {
|
||||
return (document.receiptHistory || []).map((item) => `V${item.version}`).join('、') || '—'
|
||||
}
|
||||
|
||||
function formatSize(bytes: number) {
|
||||
if (bytes < 1024) return `${bytes} B`
|
||||
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`
|
||||
@@ -340,6 +344,7 @@ function clearanceResultStatusLabel(value: MerchantClearanceResult) {
|
||||
<div>
|
||||
<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>关联入仓码:{{ item.inboundCodes.join('、') || '—' }}</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user