This commit is contained in:
2026-09-09 11:55:10 +08:00
parent 87fc08b06e
commit 7b75f40e28
4 changed files with 56 additions and 16 deletions
@@ -56,7 +56,7 @@ function saveRequest(row?: OverseasContainerFeeSource): OverseasContainerFeeSave
async function load() {
if (!canView.value) return
loading.value = true; error.value = null
try { [rows.value, customers.value, suppliers.value] = await Promise.all([listOverseasContainerFees(props.containerBookingId), listOverseasContainerCustomers(props.containerBookingId), props.readonly ? Promise.resolve([]) : listContainerFeeSupplierOptions(null)]) }
try { [rows.value, customers.value, suppliers.value] = await Promise.all([listOverseasContainerFees(props.containerBookingId), listOverseasContainerCustomers(props.containerBookingId), canEdit.value && access.can('platform:supplier:list') ? listContainerFeeSupplierOptions(null) : Promise.resolve([])]) }
catch (cause) { error.value = getApiErrorDetails(cause, '尾程计费加载失败') }
finally { loading.value = false }
}
@@ -108,7 +108,7 @@ onMounted(load)
<template>
<div class="last-leg-fees">
<header class="last-leg-fees__header"><div><h2>{{ title }}</h2><p>按真实货柜展示港口、堆存、修箱、吊机和码头拖车费用,金额按币种分别列示。</p></div><el-button v-if="canEdit" type="primary" :disabled="!containerNo || customers.length === 0" @click="openCreate">新增费用</el-button></header>
<el-alert v-if="readonly" type="info" :closable="false" title="当前路由仅查看海外段费用,写操作请从清关提柜详情进入。" />
<el-alert v-if="canView && !canEdit && !canReview" type="info" :closable="false" title="当前账号仅有海外段费用查看权限。" />
<el-alert v-if="!containerNo" type="warning" :closable="false" title="当前货柜尚未补录真实集装箱号,暂不能新增尾程费用。" />
<el-alert v-if="!canView" type="warning" :closable="false" title="当前账号无权查看尾程计费。" />
<LoadErrorState v-else-if="error" title="尾程计费加载失败" :message="error.message" :loading="loading" @retry="load"><template #details><ApiErrorMeta :details="error" /></template></LoadErrorState>