feat(customs): show receipt action history in client
This commit is contained in:
@@ -21,6 +21,17 @@ export interface MerchantCustomsReceiptVersion {
|
|||||||
createdAt: string
|
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 {
|
export interface MerchantCustomsInbound {
|
||||||
inboundId: string
|
inboundId: string
|
||||||
orderId: string
|
orderId: string
|
||||||
@@ -44,6 +55,7 @@ export interface MerchantCustomsDocument {
|
|||||||
receiptRejectReason: string | null
|
receiptRejectReason: string | null
|
||||||
finalDocument: MerchantCustomsFile | null
|
finalDocument: MerchantCustomsFile | null
|
||||||
receiptHistory?: MerchantCustomsReceiptVersion[]
|
receiptHistory?: MerchantCustomsReceiptVersion[]
|
||||||
|
confirmationHistory: MerchantCustomsConfirmationHistory[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MerchantCustomsContainer {
|
export interface MerchantCustomsContainer {
|
||||||
|
|||||||
@@ -249,6 +249,9 @@ function formatDateTime(value: string | null | undefined) {
|
|||||||
function receiptHistoryLabel(document: MerchantCustomsDocument) {
|
function receiptHistoryLabel(document: MerchantCustomsDocument) {
|
||||||
return (document.receiptHistory || []).map((item) => `V${item.version}`).join('、') || '—'
|
return (document.receiptHistory || []).map((item) => `V${item.version}`).join('、') || '—'
|
||||||
}
|
}
|
||||||
|
function confirmationActionLabel(action: MerchantCustomsDocument['confirmationHistory'][number]['action']) {
|
||||||
|
return action === 'CONFIRM' ? '确认' : '打回'
|
||||||
|
}
|
||||||
|
|
||||||
function formatSize(bytes: number) {
|
function formatSize(bytes: number) {
|
||||||
if (bytes < 1024) return `${bytes} B`
|
if (bytes < 1024) return `${bytes} B`
|
||||||
@@ -345,6 +348,7 @@ function clearanceResultStatusLabel(value: MerchantClearanceResult) {
|
|||||||
<strong>{{ item.source.fileName }}</strong>
|
<strong>{{ item.source.fileName }}</strong>
|
||||||
<span>版本 V{{ item.source.version }} · {{ formatSize(item.source.sizeBytes) }} · {{ formatDateTime(item.source.uploadedAt) }}</span>
|
<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-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>
|
<small>关联入仓码:{{ item.inboundCodes.join('、') || '—' }}</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user