This commit is contained in:
2026-08-14 19:59:32 +08:00
parent f7594ebd39
commit 1540b80c89
29 changed files with 780 additions and 587 deletions
@@ -11,6 +11,11 @@ describe('OrderFulfillmentTreePanel contract', () => {
}
expect(source).toContain('历史双子单模型')
expect(source).toContain('新拆分不会再生成已装子单')
expect(source).toContain('inboundCode?: string | null')
expect(source).toContain("props.inboundCode || '暂缺'")
expect(source).not.toContain('tree.rootOrderNo')
expect(source).not.toContain('tree.rootOrderId')
expect(source).not.toContain('row.orderNo')
})
it('covers loading, error, empty and responsive states', () => {
@@ -7,7 +7,7 @@ import StatusBadge from '@/shared/components/StatusBadge.vue'
import { getPlatformOrderFulfillmentTree, type UnifiedOrderFulfillmentTree } from '../api/orderFulfillment'
import { unifiedOrderFulfillmentRoleLabel, unifiedOrderFulfillmentStatusLabel } from '../status'
const props = defineProps<{ tenantId: string; orderId: string; compact?: boolean }>()
const props = defineProps<{ tenantId: string; orderId: string; inboundCode?: string | null; compact?: boolean }>()
const tree = ref<UnifiedOrderFulfillmentTree | null>(null)
const loading = ref(false)
const error = ref<ApiErrorDetails | null>(null)
@@ -31,14 +31,14 @@ onMounted(() => { void load() })
<div v-else-if="loading" class="tree-loading" aria-live="polite">正在加载拆分履约…</div>
<template v-else-if="tree">
<div class="tree-summary">
<div><span>根单</span><strong>{{ tree.rootOrderNo || tree.rootOrderId }}</strong></div>
<div><span>入仓码</span><strong>{{ props.inboundCode || '暂缺' }}</strong></div>
<div><span>原始总量</span><strong>{{ tree.originalPackageCount ?? '—' }} 箱</strong></div>
<div><span>累计已装</span><strong>{{ tree.cumulativeLoadedPackageCount ?? '—' }} 箱</strong></div>
<div><span>当前余量</span><strong>{{ tree.currentRemainderPackageCount ?? '—' }} 箱</strong></div>
</div>
<el-alert v-if="tree.historicalTwoChildModel" type="info" :closable="false" show-icon title="该记录使用历史双子单模型,仅兼容展示;新拆分不会再生成已装子单。" />
<el-table :data="tree.fragments" row-key="orderId" border stripe empty-text="暂无拆分分片">
<el-table-column label="分片订单" min-width="180"><template #default="{ row }"><strong>{{ row.orderNo || row.orderId }}</strong><small v-if="row.splitSequence != null"> · 第 {{ row.splitSequence }} 次</small></template></el-table-column>
<el-table-column label="分片" min-width="180"><template #default="{ row }"><strong>{{ unifiedOrderFulfillmentRoleLabel(row.splitRole) }}</strong><small v-if="row.splitSequence != null"> · 第 {{ row.splitSequence }} 次</small></template></el-table-column>
<el-table-column label="类型" width="120"><template #default="{ row }">{{ unifiedOrderFulfillmentRoleLabel(row.splitRole) }}</template></el-table-column>
<el-table-column label="本单计划" width="100"><template #default="{ row }">{{ row.plannedPackageCount ?? '—' }} 箱</template></el-table-column>
<el-table-column label="已拣" width="90"><template #default="{ row }">{{ row.pickedPackageCount ?? '—' }}</template></el-table-column>