优化
This commit is contained in:
@@ -320,19 +320,6 @@ 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 confirmationActionLabel(action: MerchantCustomsDocument['confirmationHistory'][number]['action']) {
|
||||
return action === 'CONFIRM' ? '确认' : '打回'
|
||||
}
|
||||
|
||||
function formatSize(bytes: number) {
|
||||
if (bytes < 1024) return `${bytes} B`
|
||||
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`
|
||||
return `${(bytes / 1024 / 1024).toFixed(1)} MB`
|
||||
}
|
||||
|
||||
function clearanceResultLabel(value: MerchantClearanceResult) {
|
||||
return ({ INSPECTION: '查验', SUPPLEMENT_REQUIRED: '补充资料', RELEASED: '放行', DETAINED: '扣留', OTHER: '其他' } as Record<string, string>)[value.resultType] || value.resultType
|
||||
}
|
||||
@@ -418,7 +405,7 @@ function clearanceResultStatusLabel(value: MerchantClearanceResult) {
|
||||
|
||||
<section class="customs-section">
|
||||
<div class="customs-section-title">
|
||||
<h3>资料版本历史</h3>
|
||||
<h3>资料文件</h3>
|
||||
<div v-if="pendingReceipts.length && detail.status === 'DECLARING'" class="customs-receipt-actions">
|
||||
<el-button type="success" :disabled="mutating" @click="confirmReceipt">确认全部回执</el-button>
|
||||
<el-button type="danger" plain :disabled="mutating" @click="rejectReceipt">打回全部回执</el-button>
|
||||
@@ -431,10 +418,6 @@ function clearanceResultStatusLabel(value: MerchantClearanceResult) {
|
||||
<FileText :size="20" />
|
||||
<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 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>
|
||||
<div class="customs-document-actions">
|
||||
|
||||
@@ -751,7 +751,8 @@ test('supports the frozen customs document workflow and customer-safe downloads'
|
||||
assert.match(customsDialogSource, /v-if="detail.status === 'COMPLETED'"[^>]*><strong>报关已完成/)
|
||||
assert.match(customsDialogSource, /真实报关完税文件已齐全/)
|
||||
assert.match(customsDialogSource, /item\.finalDocument/)
|
||||
assert.match(customsDialogSource, /资料版本历史/)
|
||||
assert.match(customsDialogSource, /资料文件/)
|
||||
assert.doesNotMatch(customsDialogSource, /资料版本历史|报关行回执历史|item\.confirmationHistory|版本 V/)
|
||||
assert.match(customsDialogSource, /尚未上传退税报关资料/)
|
||||
assert.match(customsDialogSource, /退税报关资料加载失败/)
|
||||
assert.doesNotMatch(customsDialogSource, /accept=/)
|
||||
|
||||
Reference in New Issue
Block a user