refactor(shipping-notice): 进度信号统一为 15 阶 stage 契约码并透传阻断原因

- 后端进度写入 step_key 全量切换为 15 阶契约 stage 码
- 投影层清除 CheckPoint stepN_* 遗留别名与子串/前缀启发式,阶段信号按契约码精确匹配
- 建单前 Case 摘要透传草稿首要阻断原因
- 前端标签/归一化/处理卡片同步契约码,阻断原因按 i18n 优先展示
- 修复正式下游回看时 activeCase 刻意为空导致队列定位与接收解析上下文静默跳过
- 同步更新投影/门禁/工作台/RPA 流程测试
This commit is contained in:
hugo committed 2026-09-17 15:54:53 +08:00
1 parent d1adbe5ec5
commit 18af972d20
34 files changed
+903 -111

No files matched your search

@@ -326,7 +326,9 @@ const lifecycleUiState = computed(() => {
};
}
// [STEP 3] 建单前:Run/Queue 项仍由后端下发生命周期入口。
const currentCaseNo = String(activeCase.value?.case_no || '').trim();
// 选法 2(正式下游回看)下 activeCase 刻意为 null,此时以切换管线的 requestedCaseNo
// 定位队列项,否则 entries 永远为空、阶段导航整体退化为 blocked。
const currentCaseNo = String(activeCase.value?.case_no || requestedCaseNo.value || '').trim();
const reviewEntry = (reviewQueue.value?.items || reviewRun.value?.items || []).find(
(item) => String(item.case_no || '').trim() === currentCaseNo,
);
@@ -399,6 +401,13 @@ const intakeParseContextAuthorized = computed(() => {
|| lifecycleEntryIsEnterable(entry)
);
});
/**
* 接收解析工作面的目标 Case:选法 2(正式下游回看)下 activeCase 刻意为 null,
* 必须以切换管线的 requestedCaseNo 兜底,否则上下文加载会被静默跳过(面板空白)。
*/
const intakeTargetCaseNo = computed(() => (
String(activeCase.value?.case_no || requestedCaseNo.value || '').trim()
));
const lifecycleStageItems = computed<ReviewLifecycleStageItem[]>(() => {
const blocker = lifecycleUiState.value.blocker;
const entries = lifecycleUiState.value.entries;
@@ -484,8 +493,8 @@ async function retryCurrentIntakeParse(): Promise<void> {
await Promise.all([
reloadLatestDraft(),
refreshShippingProcessing(),
activeCase.value?.case_no
? ensureIntakeParseContextLoaded(activeCase.value.case_no)
intakeTargetCaseNo.value
? ensureIntakeParseContextLoaded(intakeTargetCaseNo.value)
: Promise.resolve(false),
]);
} catch (error) {
@@ -576,8 +585,8 @@ async function selectLifecycleStage(code: ReviewLifecycleStageCode, options: { r
pendingReleaseAutoAdvanceCaseNo.value = null;
}
}
if (code === 'intake_parse' && intakeParseContextAuthorized.value && activeCase.value?.case_no) {
void ensureIntakeParseContextLoaded(activeCase.value.case_no);
if (code === 'intake_parse' && intakeParseContextAuthorized.value && intakeTargetCaseNo.value) {
void ensureIntakeParseContextLoaded(intakeTargetCaseNo.value);
}
const mode: ReviewWorkbenchMode = code === 'order_review' || code === 'intake_parse'
? 'standard'
@@ -4445,8 +4454,8 @@ watch(
// surface 反向成为前端阶段裁决。
if (code === null) return;
syncLifecycleWorkbenchMode(code);
if (code === 'intake_parse' && intakeAuthorized && activeCase.value?.case_no) {
void ensureIntakeParseContextLoaded(activeCase.value.case_no);
if (code === 'intake_parse' && intakeAuthorized && intakeTargetCaseNo.value) {
void ensureIntakeParseContextLoaded(intakeTargetCaseNo.value);
}
},
{ immediate: true },
@@ -4527,10 +4536,15 @@ function retryFormalTaskDetail() {
*/
const REVIEW_EDITOR_NEEDED_STAGES: ReviewLifecycleStageCode[] = ['intake_parse', 'order_review', 'fulfillment_prep'];
watch(
lifecycleCurrentStageCode,
// 用户查看面(含回看已完成阶段)驱动 Case 懒加载:选法 2 正式下游切 PDF 后 activeCase
// 为 null,回看接收解析/订单复核/通知准备时必须按需补拉目标 Case,否则这些工作面
// 只能渲染空白或残留上一份 PDF 的数据。
lifecycleActiveStageCode,
(stage) => {
if (!stage || !REVIEW_EDITOR_NEEDED_STAGES.includes(stage)) return;
const caseNo = String(displayCase.value?.case_no || '').trim();
// 禁止使用 displayCase 兜底:它可能停留在上一份 PDF 的快照上造成串味;
// 目标一律取当前工作面的 activeCase 或切换管线的 requestedCaseNo。
const caseNo = String(activeCase.value?.case_no || requestedCaseNo.value || '').trim();
if (!caseNo) return;
if (stage === 'fulfillment_prep') {
if (activeCase.value) return;
@@ -5119,8 +5133,8 @@ watch(
:load-failed="intakeParseLoadFailed"
:preview-url="previewUrl || null"
:preview-loading="previewLoading"
@retry-context="() => { if (activeCase?.case_no) void ensureIntakeParseContextLoaded(activeCase.case_no); }"
@load-preview="() => { if (activeCase?.case_no) void ensurePreviewLoaded(activeCase.case_no); }"
@retry-context="() => { if (intakeTargetCaseNo) void ensureIntakeParseContextLoaded(intakeTargetCaseNo); }"
@load-preview="() => { if (intakeTargetCaseNo) void ensurePreviewLoaded(intakeTargetCaseNo); }"
/>
<!-- 仅「固定为侧栏」时 PDF 占网格列;默认浮窗挂在根节点,不挤压订单区。 -->
<div