This commit is contained in:
2026-08-18 17:40:40 +08:00
parent 6ff77e92b2
commit c188482c24
18 changed files with 423 additions and 97 deletions
@@ -3,6 +3,7 @@ import { readFileSync } from 'node:fs'
import { resolve } from 'node:path'
const source = readFileSync(resolve(process.cwd(), 'src/modules/loading-lists/pages/PreloadPlanDetailView.vue'), 'utf8')
const detailSource = readFileSync(resolve(process.cwd(), 'src/modules/loading-lists/components/LoadingListDetailDrawer.vue'), 'utf8')
describe('PreloadPlanDetailView prototype contract', () => {
it('is a formal desktop detail page wired to the shared header return action', () => {
@@ -51,8 +52,18 @@ describe('PreloadPlanDetailView prototype contract', () => {
it('is the formal container-number entry and does not imply that preload directly opens PDA', () => {
expect(source).toContain("{ required: true, message: '请输入集装箱号'")
expect(source).toContain("detail.value?.summary.containerNo ? '修改集装箱号 / 航次' : '录入集装箱号'")
expect(source).toContain('预装清单不会直接开放 PDA')
expect(source).toContain('订舱关联与放舱、预装确认后')
expect(source).toContain('成功后由服务端按真实条件创建唯一 PDA 任务')
expect(source).toContain('当前页面不会伪造 PDA 成功')
})
it('uses a flat blocking note instead of repeated colored page alerts', () => {
expect(source).not.toContain('<el-alert\n v-if="detail"')
expect(detailSource).toContain('class="readiness-note"')
expect(detailSource).toContain('role="status"')
expect(detailSource).toContain("confirmationStatus !== 'CONFIRMED' && !preloadSummary.readiness.canConfirm")
expect(detailSource).not.toContain('type="success" :closable="false" show-icon title="整份预装计划已确认"')
expect(detailSource).toContain('<el-button type="primary" :loading="confirmSaving"')
expect(detailSource).not.toContain('<el-button type="success" :loading="confirmSaving"')
})
it('confirms the whole plan through readiness with stable idempotency and refreshes the detail', () => {
@@ -189,14 +189,6 @@ onMounted(() => void loadDetail())
<AdminPage>
<div class="preload-detail-page">
<OperationErrorToast :details="remarkError || editError || confirmError" />
<el-alert
v-if="detail"
type="info"
:closable="false"
show-icon
:title="detail.summary.containerNo ? '集装箱号已录入,继续完成订舱放舱与预装确认' : '下一步:录入集装箱号'"
description="预装清单不会直接开放 PDA;需完成集装箱号、订舱关联与放舱、预装确认后,才由服务端生成 PDA 任务。"
/>
<LoadingListDetailDrawer :mode="'preload'" :loading="loading" :detail="detail" :error="error" :can-edit="canEdit" :confirm-saving="confirmSaving" @back="goBack" @retry="loadDetail" @edit="openEdit" @edit-warehouse-remark="openWarehouseRemark" @confirm-preload="openConfirmPreload" />
</div>