This commit is contained in:
2026-09-09 10:18:12 +08:00
parent e643e43828
commit 1249263b94
12 changed files with 164 additions and 28 deletions
@@ -55,16 +55,27 @@ describe('ContainerDetailView customs integration', () => {
expect(source).not.toContain("v-if=\"activeTab === 'overview'\" class=\"detail-section surface-panel\"")
})
it('exposes empty return directly in overseas detail only when permission and server action both allow it', () => {
expect(source).toContain("access.can('platform:firstleg:terminal-drayage:empty-return:confirm')")
expect(source).toContain("hasAction('RECORD_EMPTY_RETURN')")
expect(source).toContain("terminalDrayage?.allowedActions.includes('RECORD_EMPTY_RETURN')")
expect(source).toContain('v-if="canRecordEmptyReturn" type="primary"')
expect(source).toContain('>确认还柜/还空</el-button>')
expect(source).toContain('expectedVersion: current.version')
expect(source).toContain('actualAt: emptyReturnAt.value')
expect(source).toContain('await load()')
})
it('separates domestic first-leg fees and connects the overseas fee lifecycle lazily', () => {
expect(source).toContain('label="头程计费" name="first-leg-fees"')
expect(source).toContain('label="尾程计费" name="last-leg-fees"')
expect(source).toContain('<el-tab-pane label="头程计费" name="first-leg-fees" />')
expect(source).toContain('<el-tab-pane label="尾程计费" name="last-leg-fees" />')
expect(source).toContain('label="国内段费用(头程)" name="first-leg-fees"')
expect(source).toContain('label="目的港及海外段费用(尾程)" name="last-leg-fees"')
expect(source).toContain('v-if="firstLegFeesOpened"')
expect(source).toContain('v-show="activeTab === \'first-leg-fees\'"')
expect(source).toContain('title="头程计费" :plan-id="overview.loadingPlanId" :container-booking-id="detail.id"')
expect(source).toContain('title="国内段费用(头程)" :plan-id="overview.loadingPlanId" :container-booking-id="detail.id"')
expect(source).toContain(':readonly="isOverseas"')
expect(source).toContain('v-if="lastLegFeesOpened"')
expect(source).toContain('<ContainerLastLegFeesPanel :container-booking-id="detail.id" :container-no="detail.containerNo" />')
expect(source).toContain('title="目的港及海外段费用(尾程)"')
expect(source).toContain(':readonly="isDomestic"')
expect(source).toContain("if (isDomestic.value && activeTab.value === 'loading-list') await loadLoadingDetail(resource, aggregate)")
expect(source).toContain("const needsLoadingDetail = tabName === 'first-leg-fees' || (isDomestic.value && tabName === 'loading-list')")
expect(lastLegFeesSource.indexOf('label="操作"')).toBeLessThan(lastLegFeesSource.indexOf('label="客户"'))
@@ -83,6 +94,15 @@ describe('ContainerDetailView customs integration', () => {
expect(source).toContain("const needsLoadingDetail = tabName === 'first-leg-fees' || (isDomestic.value && tabName === 'loading-list')")
})
it('uses domestic and overseas route-specific primary status and summary labels', () => {
expect(source).toContain("const primaryStatusText = computed(() => isDomestic.value ? statusText(detail.value?.planStatus) : overseasStageText.value)")
expect(source).toContain("UNLOADED: '待还柜'")
expect(source).toContain("EMPTY_RETURNED: '已还柜'")
expect(source).toContain("{{ isDomestic ? '装柜清单号' : '当前海外阶段' }}")
expect(source).toContain("{{ isDomestic ? '装柜仓库' : '目的仓 / 接柜仓' }}")
expect(source).toContain('emptyReturnWarningText')
})
it('mounts the new container customs panel only after loading completes', () => {
expect(source).toContain("detail.planStatus === 'COMPLETED' && overview?.loadingPlanId && canListCustoms")
expect(source).toContain('<ContainerCustomsPanel')