fix(admin): create declaration batch after broker handoff
This commit is contained in:
@@ -50,7 +50,6 @@ const missingInbounds = computed(() => customs.value?.inbounds.filter((item) =>
|
|||||||
const missingCoverageCount = computed(() => Math.max(0, (customs.value?.taxRefundCount || 0) - (customs.value?.coveredTaxRefundCount || 0)))
|
const missingCoverageCount = computed(() => Math.max(0, (customs.value?.taxRefundCount || 0) - (customs.value?.coveredTaxRefundCount || 0)))
|
||||||
const allBuy = computed(() => customs.value?.hasActualCargo === true && customs.value.taxRefundCount === 0)
|
const allBuy = computed(() => customs.value?.hasActualCargo === true && customs.value.taxRefundCount === 0)
|
||||||
const brokerSubmitted = computed(() => Boolean(customs.value?.brokerSubmittedAt))
|
const brokerSubmitted = computed(() => Boolean(customs.value?.brokerSubmittedAt))
|
||||||
const latestDeclarationBatch = computed(() => declarationBatches.value[0] || null)
|
|
||||||
const openDeclarationBatch = computed(() => declarationBatches.value.find((item) => ['READY', 'SUBMITTED', 'ACKNOWLEDGED', 'RESULT_PENDING'].includes(item.status)) || null)
|
const openDeclarationBatch = computed(() => declarationBatches.value.find((item) => ['READY', 'SUBMITTED', 'ACKNOWLEDGED', 'RESULT_PENDING'].includes(item.status)) || null)
|
||||||
const statusText: Record<ContainerCustomsStatus, string> = {
|
const statusText: Record<ContainerCustomsStatus, string> = {
|
||||||
WAITING_CUSTOMER_DOCUMENTS: '待客户补齐退税资料', READY_TO_START: '可开始报关', DECLARING: '报关中', COMPLETED: '报关已完成',
|
WAITING_CUSTOMER_DOCUMENTS: '待客户补齐退税资料', READY_TO_START: '可开始报关', DECLARING: '报关中', COMPLETED: '报关已完成',
|
||||||
@@ -89,8 +88,8 @@ function declarationStatusLabel(value: DeclarationBatch['status']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function createFormalDeclaration() {
|
async function createFormalDeclaration() {
|
||||||
if (!customs.value || customs.value.status !== 'COMPLETED' || openDeclarationBatch.value) return
|
if (!customs.value || !['DECLARING', 'COMPLETED'].includes(customs.value.status) || !brokerSubmitted.value || openDeclarationBatch.value) return
|
||||||
try { await ElMessageBox.confirm('当前柜的资料、回执和真实报关完税文件已完成,确认创建正式申报批次?', '创建正式申报批次', { customClass: 'admin-density-confirm', type: 'warning', confirmButtonText: '确认创建' }) } catch { return }
|
try { await ElMessageBox.confirm('当前柜的资料、回执已确认并已发送报关行执行,确认创建正式申报批次?完税文件仍按报关行完成后回传。', '创建正式申报批次', { customClass: 'admin-density-confirm', type: 'warning', confirmButtonText: '确认创建' }) } catch { return }
|
||||||
actionLoading.value = true; actionError.value = null
|
actionLoading.value = true; actionError.value = null
|
||||||
try { await createDeclarationBatch(props.loadingPlanId, customs.value.version); await load(); ElMessage.success('正式申报批次已创建') }
|
try { await createDeclarationBatch(props.loadingPlanId, customs.value.version); await load(); ElMessage.success('正式申报批次已创建') }
|
||||||
catch (error) { actionError.value = getApiErrorDetails(error, '正式申报批次创建失败') }
|
catch (error) { actionError.value = getApiErrorDetails(error, '正式申报批次创建失败') }
|
||||||
@@ -274,8 +273,8 @@ onMounted(load)
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="customs.status === 'COMPLETED'" class="compact-table-wrap declaration-batches-wrap">
|
<div v-if="['DECLARING', 'COMPLETED'].includes(customs.status) && brokerSubmitted" class="compact-table-wrap declaration-batches-wrap">
|
||||||
<div class="declaration-batches-heading"><div><h3>正式申报与海关结果</h3><p>正式申报批次建立在退税资料、回执确认和真实完税文件完成之后,与船期和 PDA 节点独立。</p></div><el-button v-if="canManage && !openDeclarationBatch" size="small" type="primary" :loading="actionLoading" @click="createFormalDeclaration">创建正式申报批次</el-button></div>
|
<div class="declaration-batches-heading"><div><h3>正式申报与海关结果</h3><p>回执确认并发送报关行执行后建立正式申报批次;完税文件、船期和 PDA 节点保持独立。</p></div><el-button v-if="canManage && !openDeclarationBatch" size="small" type="primary" :loading="actionLoading" @click="createFormalDeclaration">创建正式申报批次</el-button></div>
|
||||||
<el-empty v-if="!declarationBatches.length" description="尚未创建正式申报批次" :image-size="48" />
|
<el-empty v-if="!declarationBatches.length" description="尚未创建正式申报批次" :image-size="48" />
|
||||||
<div v-else class="declaration-batch-list">
|
<div v-else class="declaration-batch-list">
|
||||||
<article v-for="batch in declarationBatches" :key="batch.id" class="declaration-batch-card">
|
<article v-for="batch in declarationBatches" :key="batch.id" class="declaration-batch-card">
|
||||||
|
|||||||
Reference in New Issue
Block a user