diff --git a/src/modules/container-loading/components/ContainerCustomsPanel.vue b/src/modules/container-loading/components/ContainerCustomsPanel.vue index ed95c2d7..30cb8a4c 100644 --- a/src/modules/container-loading/components/ContainerCustomsPanel.vue +++ b/src/modules/container-loading/components/ContainerCustomsPanel.vue @@ -26,6 +26,7 @@ import { type ContainerCustomsDocument, type ContainerCustomsStatus, type ContainerCustomsView, + type ClearanceResultType, type DeclarationBatch, } from '../api/platformContainerCustoms' @@ -46,6 +47,17 @@ const actionError = ref(null) const downloadingKey = ref('') const receiptFiles = reactive>({}) const finalFiles = reactive>({}) +const clearanceDialogVisible = ref(false) +const clearanceBatch = ref(null) +const clearanceResultType = ref('INSPECTION') +const clearanceRemark = ref('') +const clearanceResultOptions: Array<{ value: ClearanceResultType; label: string }> = [ + { value: 'INSPECTION', label: '查验' }, + { value: 'SUPPLEMENT_REQUIRED', label: '补资料' }, + { value: 'DETAINED', label: '扣货' }, + { value: 'RELEASED', label: '放行' }, + { value: 'OTHER', label: '其他' }, +] const missingInbounds = computed(() => customs.value?.inbounds.filter((item) => item.taxMode === 'TAX_REFUND' && !item.covered) || []) const missingCoverageCount = computed(() => Math.max(0, (customs.value?.taxRefundCount || 0) - (customs.value?.coveredTaxRefundCount || 0))) @@ -122,16 +134,27 @@ async function submitFormalDeclaration(batch: DeclarationBatch) { } finally { actionLoading.value = false } } -async function recordFormalResult(batch: DeclarationBatch) { +function openFormalResultDialog(batch: DeclarationBatch) { + clearanceBatch.value = batch + clearanceResultType.value = 'INSPECTION' + clearanceRemark.value = '' + clearanceDialogVisible.value = true +} + +async function recordFormalResult() { + const batch = clearanceBatch.value + if (!batch) return + if (clearanceResultType.value === 'OTHER' && !clearanceRemark.value.trim()) { + ElMessage.warning('选择“其他”时请填写备注') + return + } + actionLoading.value = true; actionError.value = null try { - const answer = await ElMessageBox.prompt('可填写查验处理说明,没有说明可直接确认', '录入海关查验结果', { customClass: 'admin-density-confirm', inputPlaceholder: '处理说明(可选)', confirmButtonText: '确认录入' }) - actionLoading.value = true; actionError.value = null - await recordClearanceResult(batch, 'INSPECTION', answer.value) - await load(); ElMessage.success('海关结果已录入') - } catch (error) { - if (error === 'cancel' || error === 'close') return - actionError.value = getApiErrorDetails(error, '海关结果录入失败') - } finally { actionLoading.value = false } + await recordClearanceResult(batch, clearanceResultType.value, clearanceRemark.value.trim() || undefined) + clearanceDialogVisible.value = false + await load(); ElMessage.success('海关异常节点已标记') + } catch (error) { actionError.value = getApiErrorDetails(error, '海关异常节点标记失败') } + finally { actionLoading.value = false } } async function resolveFormalResult(batch: DeclarationBatch, result: DeclarationBatch['results'][number]) { @@ -305,7 +328,7 @@ onMounted(load)
{{ batch.batchNo }}报关单号:{{ batch.customsEntryNo || '—' }} · 版本 {{ batch.version }}
{{ declarationStatusLabel(batch.status) }} -
提交正式申报录入查验结果
+
提交正式申报标记海关异常/结果
{{ result.resultType === 'INSPECTION' ? '查验' : result.resultType === 'SUPPLEMENT_REQUIRED' ? '补充资料' : result.resultType === 'RELEASED' ? '放行' : result.resultType }}{{ result.resultStatus === 'RESOLVED' ? '已处理' : result.resultStatus === 'OPEN' ? '待处理' : '已取消' }}{{ result.resolution || '—' }}处理
@@ -314,9 +337,22 @@ onMounted(load)
国内离仓状态:{{ departureState === 'DEPARTED' ? '已自动离仓' : departureState === 'UNKNOWN' ? '离仓状态尚未读取' : '报关已完成,待其他离仓条件' }}
+ + + + + + + + + + + + +