优化
This commit is contained in:
@@ -314,6 +314,14 @@ describe('UnifiedOrdersView contract', () => {
|
||||
expect(source).toContain('firstLegDestinationTypeLabel(detail.order.order?.destinationType)')
|
||||
})
|
||||
|
||||
it('does not mount fee consumers until a real inboundId exists', () => {
|
||||
const feeSection = source.slice(source.indexOf("activeDetailTab === 'fees'"), source.indexOf("activeDetailTab === 'history'"))
|
||||
expect(source).toContain('const normalizedInboundId = computed(() => normalizedIdentifier(detail.value?.summary.inboundId))')
|
||||
expect(feeSection).toContain('v-if="!normalizedInboundId" description="订单尚未生成入库单,暂无入仓费用"')
|
||||
expect(feeSection.match(/:inbound-id="normalizedInboundId"/g)).toHaveLength(2)
|
||||
expect(feeSection).not.toContain('String(detail.summary.inboundId)')
|
||||
})
|
||||
|
||||
it('mounts downstream progress inside the existing order detail without opening unsafe writes', () => {
|
||||
expect(source).toContain('UnifiedOrderWorkflowPanel')
|
||||
expect(source).toContain("{ key: 'workflow', label: '后半程作业', icon: OrderFulfillmentIcon }")
|
||||
|
||||
@@ -151,6 +151,11 @@ const selectedStatus = ref<UnifiedOrderMainStatus | ''>('')
|
||||
const orderId = computed(() => typeof route.params.orderId === 'string' ? route.params.orderId : '')
|
||||
const detailTenantId = computed(() => typeof route.query.tenantId === 'string' ? route.query.tenantId : '')
|
||||
const detailRouteKey = computed(() => orderId.value ? `${detailTenantId.value}:${orderId.value}` : '')
|
||||
function normalizedIdentifier(value: unknown) {
|
||||
const identifier = String(value ?? '').trim()
|
||||
return identifier && identifier !== 'null' && identifier !== 'undefined' ? identifier : ''
|
||||
}
|
||||
const normalizedInboundId = computed(() => normalizedIdentifier(detail.value?.summary.inboundId))
|
||||
|
||||
const detailTabs = [
|
||||
{ key: 'basic', label: '基本信息', icon: OrderBasicInfoIcon },
|
||||
@@ -1009,6 +1014,8 @@ onBeforeUnmount(() => {
|
||||
|
||||
<template v-else-if="activeDetailTab === 'fees'">
|
||||
<div class="panel-title"><div><h2>费用信息</h2><p>头程自动初算与其他人工费用在同一页维护</p></div><WalletCards :size="19" /></div>
|
||||
<el-empty v-if="!normalizedInboundId" description="订单尚未生成入库单,暂无入仓费用" :image-size="64" />
|
||||
<template v-else>
|
||||
<dl class="fee-overview" aria-label="费用汇总">
|
||||
<div><dt>对客费用合计</dt><dd>{{ feeMoney(customerFeeTotal) }}</dd><small>已发布头程费用 + 已审核其他应收</small></div>
|
||||
<div><dt>已审核其他应付</dt><dd>{{ feeMoney(otherFeeSummary.approvedPayable) }}</dd><small>单列展示,不计入对客费用</small></div>
|
||||
@@ -1016,7 +1023,7 @@ onBeforeUnmount(() => {
|
||||
<h3 class="fee-section-title">头程自动初算</h3>
|
||||
<InboundFeePanel
|
||||
:customer-id="String(detail.summary.tenantId)"
|
||||
:inbound-id="String(detail.summary.inboundId)"
|
||||
:inbound-id="normalizedInboundId"
|
||||
compact
|
||||
@loaded="automaticFee = $event"
|
||||
@changed="loadDetail(true)"
|
||||
@@ -1024,10 +1031,11 @@ onBeforeUnmount(() => {
|
||||
<h3 class="fee-section-title fee-section-title--secondary">其他费用明细</h3>
|
||||
<InboundFeeDetailManager
|
||||
:account-id="String(detail.summary.tenantId)"
|
||||
:inbound-id="String(detail.summary.inboundId)"
|
||||
:inbound-id="normalizedInboundId"
|
||||
@summary="otherFeeSummary = $event"
|
||||
@changed="loadDetail(true)"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<template v-else-if="activeDetailTab === 'history'">
|
||||
|
||||
Reference in New Issue
Block a user