feat(shipping-notice): 升级货代发货流程为五阶段,完善业务校验

将货代发货流程从四阶段扩展为五阶段,拆分上传相关逻辑至独立的货代上传阶段;
统一多语言文案修正客户状态语义,将"客户尚未识别"调整为符合业务的"客户尚未确认";
新增严格的上传成功验证谓词,需同时满足任务状态、全部预约单上传成功、存在有效成功上传尝试三个条件方可标记为完成;
新增坐标取值模型配置,支持Legacy冻结绝对坐标和锚点框架受限平移两种模式;
更新全链路相关文档、前端组件、后端服务与测试用例,确保业务逻辑对齐新业务规则。
This commit is contained in:
hugo committed 2026-08-21 09:20:47 +08:00
1 parent 1b6483a4ea
commit 935bf26fa6
86 files changed
+2743 -311

No files matched your search

@@ -47,6 +47,8 @@ import type {
OrderFieldValuePreview,
OrderProfileCanvasRegion,
OrderProfileDocumentMatchAnchor,
OrderProfileAnchorRule,
OrderCoordinateProfileDefinition,
OrderProfileFieldRegion,
OrderProfileRelativeRegion,
OrderProfileBoundSample,
@@ -384,6 +386,44 @@ const documentMatch = reactive({
minimumMargin: 0.15,
});
const documentMatchDirty = ref(false);
/** 坐标框架默认关闭;仅管理员显式启用后才写入 anchor_frame 声明。 */
const coordinateModel = reactive({
type: 'legacy' as 'legacy' | 'anchor_frame',
anchors: [] as OrderProfileAnchorRule[],
maxTranslateX: 0.03,
maxTranslateY: 0.06,
});
const coordinateModelDirty = ref(false);
const coordinateModelValid = computed(() => (
coordinateModel.type === 'legacy'
|| (coordinateModel.anchors.length > 0
&& coordinateModel.anchors.length <= 4
&& coordinateModel.anchors.every((anchor) => Boolean(anchor.text?.trim() && anchor.region))
&& Number.isFinite(coordinateModel.maxTranslateX)
&& Number.isFinite(coordinateModel.maxTranslateY)
&& coordinateModel.maxTranslateX >= 0 && coordinateModel.maxTranslateX <= 0.15
&& coordinateModel.maxTranslateY >= 0 && coordinateModel.maxTranslateY <= 0.2)
));
const enableAnchorFrameFromDocumentAnchor = () => {
const source = documentMatch.requiredAnchors[0];
if (!source?.label_region) return;
coordinateModel.type = 'anchor_frame';
coordinateModel.anchors = [{
anchor_id: `frame_${source.anchor_id}`.replace(/[^a-zA-Z0-9_]/g, '_').toLowerCase(),
text: source.label,
aliases: [],
match_mode: 'exact',
region: source.label_region,
position_locked: true,
minimum_evidence_level: 'coordinate',
}];
coordinateModelDirty.value = true;
};
const setCoordinateModelType = (type: 'legacy' | 'anchor_frame') => {
coordinateModel.type = type;
if (type === 'legacy') coordinateModel.anchors = [];
coordinateModelDirty.value = true;
};
/**
* 共同画布的字段选项只决定视觉定位;coordinate 末端值源仍必须由 Schema 显式授权
* pdf_coordinate。XFA 的正式取值来自 datasets,不能因未授权 PDF 文本而在画布中消失。
@@ -521,7 +561,7 @@ const draftSaveAdapter = computed<OrderProfileDraftSaveAdapter>(() => (
adapterKey: valueAdapterKey.value,
adapters: {
xfa_dataset: {
hasUnsavedChanges: history.value.length > 0 || documentMatchDirty.value || xfaDirty.value,
hasUnsavedChanges: history.value.length > 0 || documentMatchDirty.value || coordinateModelDirty.value || xfaDirty.value,
skipUnchangedManualSave: true,
canSave: !xfaValidateBlocked.value,
canValidate: !xfaDirty.value && !xfaValidateBlocked.value,
@@ -538,7 +578,7 @@ const draftSaveAdapter = computed<OrderProfileDraftSaveAdapter>(() => (
applySavedDraft: async (saved) => valueAdapterDesk.applySavedDraft(saved as ShippingOrderDocumentProfile),
},
coordinate_ocr: {
hasUnsavedChanges: history.value.length > 0 || documentMatchDirty.value,
hasUnsavedChanges: history.value.length > 0 || documentMatchDirty.value || coordinateModelDirty.value,
skipUnchangedManualSave: false,
canSave: issues.value.length === 0,
canValidate: issues.value.length === 0,
@@ -770,6 +810,7 @@ const issues = computed(() => {
if (regions.value.some(
(item) => item.kind === "order_field" && item.valueMode === "multi_line" && !item.stopAnchorText?.trim(),
)) result.push("多行订单字段必须填写结束标签。");
if (!coordinateModelValid.value) result.push(t('admin.shippingOrderProfiles.workbench.coordinateModelInvalid'));
if (regions.value.some((item) => !normalizedCanvasRegion(item.region))) {
result.push("存在无效的页面坐标框,请重新绘制该标注。");
}
@@ -1377,7 +1418,7 @@ const definition = () => {
})),
};
});
return {
const visualDefinition: OrderCoordinateProfileDefinition = {
document_match: {
document_type: "purchase_order" as const,
page_pattern: "one_or_more" as const,
@@ -1481,6 +1522,15 @@ const definition = () => {
};
}),
};
if (coordinateModel.type === 'anchor_frame') {
visualDefinition.coordinate_model = {
type: 'anchor_frame',
anchors: coordinateModel.anchors.map((anchor) => ({ ...anchor })),
max_translate_x: coordinateModel.maxTranslateX,
max_translate_y: coordinateModel.maxTranslateY,
};
}
return visualDefinition;
};
/**
* 保存当前草稿定义并附带当前标签租约。
@@ -2344,6 +2394,19 @@ const edit = async (profile: ShippingOrderDocumentProfile) => {
documentMatch.minimumScore = definition.document_match.minimum_score;
documentMatch.minimumMargin = definition.document_match.minimum_margin;
documentMatchDirty.value = false;
const configuredModel = definition.coordinate_model;
if (configuredModel?.type === 'anchor_frame') {
coordinateModel.type = 'anchor_frame';
coordinateModel.anchors = (configuredModel.anchors || []).map((anchor) => ({ ...anchor }));
coordinateModel.maxTranslateX = Number(configuredModel.max_translate_x ?? 0.03);
coordinateModel.maxTranslateY = Number(configuredModel.max_translate_y ?? 0.06);
} else {
coordinateModel.type = 'legacy';
coordinateModel.anchors = [];
coordinateModel.maxTranslateX = 0.03;
coordinateModel.maxTranslateY = 0.06;
}
coordinateModelDirty.value = false;
regions.value = restoreRegions(profile);
history.value = [];
future.value = [];
@@ -2781,6 +2844,37 @@ onBeforeUnmount(() => {
<p v-if="documentAnchorNotice" class="document-match-editor__warning">{{ documentAnchorNotice }}</p>
</section>
<section class="coordinate-model-editor">
<strong>{{ t('admin.shippingOrderProfiles.workbench.coordinateModelTitle') }}</strong>
<p>{{ t('admin.shippingOrderProfiles.workbench.coordinateModelHint') }}</p>
<label>
{{ t('admin.shippingOrderProfiles.workbench.coordinateModelType') }}
<select
:value="coordinateModel.type"
class="select-field"
:disabled="deskTableConfigReadonly"
@change="(event) => setCoordinateModelType((event.target as HTMLSelectElement).value as 'legacy' | 'anchor_frame')"
>
<option value="legacy">{{ t('admin.shippingOrderProfiles.workbench.coordinateModelLegacy') }}</option>
<option value="anchor_frame">{{ t('admin.shippingOrderProfiles.workbench.coordinateModelAnchorFrame') }}</option>
</select>
</label>
<template v-if="coordinateModel.type === 'anchor_frame'">
<button type="button" class="btn-secondary" :disabled="deskTableConfigReadonly || !documentMatch.requiredAnchors.length" @click="enableAnchorFrameFromDocumentAnchor">
{{ t('admin.shippingOrderProfiles.workbench.coordinateModelUseDocumentAnchor') }}
</button>
<label>
{{ t('admin.shippingOrderProfiles.workbench.coordinateModelMaxX') }}
<input v-model.number="coordinateModel.maxTranslateX" type="number" min="0" max="0.15" step="0.001" class="input-field" :disabled="deskTableConfigReadonly" @change="coordinateModelDirty = true" />
</label>
<label>
{{ t('admin.shippingOrderProfiles.workbench.coordinateModelMaxY') }}
<input v-model.number="coordinateModel.maxTranslateY" type="number" min="0" max="0.2" step="0.001" class="input-field" :disabled="deskTableConfigReadonly" @change="coordinateModelDirty = true" />
</label>
<p v-if="!coordinateModelValid" class="document-match-editor__warning">{{ t('admin.shippingOrderProfiles.workbench.coordinateModelInvalid') }}</p>
</template>
</section>
<section v-if="deskActivePageHasLines" class="table-region-editor">
<strong>{{ t('admin.shippingOrderProfiles.workbench.tableRegionSettings') }}</strong>
<label>{{ t('admin.shippingOrderProfiles.workbench.rowReconstructionMode') }}
@@ -60,6 +60,13 @@ export type XfaTotalAmountPolicy = 'must_equal_line_sum' | 'disabled';
export interface OrderProfileRelativeRegion { x0: number; y0: number; x1: number; y1: number; }
export interface OrderProfileDocumentMatchAnchor { anchor_id: string; label: string; value: string; value_position: 'right' | 'below'; page_no?: number | null; label_region?: OrderProfileRelativeRegion | null; value_region?: OrderProfileRelativeRegion | null; minimum_evidence_level: OrderProfileEvidenceLevel; }
export interface OrderProfileAnchorRule { anchor_id: string; text: string; aliases?: string[]; match_mode: 'exact' | 'contains'; region?: OrderProfileRelativeRegion | null; position_locked?: boolean; minimum_evidence_level: OrderProfileEvidenceLevel; }
export type OrderProfileCoordinateModelType = 'legacy' | 'anchor_frame';
export interface OrderProfileCoordinateModel {
type?: OrderProfileCoordinateModelType;
anchors?: OrderProfileAnchorRule[];
max_translate_x?: number;
max_translate_y?: number;
}
export interface OrderProfileFieldRegion { field_id: string; field_code: string; scope: 'header' | 'line'; region: OrderProfileRelativeRegion; extractor_key: OrderProfileExtractorKey; allowed_sources: OrderProfileAllowedSource[]; minimum_evidence_level: OrderProfileEvidenceLevel; target_fields?: Array<{ field_id: string; field_code: string; scope: 'header' | 'line' }>; }
export interface OrderProfileOrderFieldLayout { layout_id: string; field_id: string; field_code: string; scope: 'header'; page_scope: 'first_page' | 'all_pages' | 'exact_page'; page_no?: number | null; anchor?: OrderProfileAnchorRule | null; value_region?: OrderProfileAnchorRelativeRegion | null; absolute_value_region?: OrderProfileRelativeRegion | null; fallback_value_region?: OrderProfileRelativeRegion | null; value_mode: 'single_line' | 'multi_line' | 'right_of_anchor' | 'below_anchor'; stop_anchors: OrderProfileAnchorRule[]; normalizer_key?: string | null; required: boolean; minimum_evidence_level: OrderProfileEvidenceLevel; }
export interface OrderProfileDraftUnboundOrderFieldLayout { layout_id: string; label: string; page_scope: 'first_page' | 'all_pages' | 'exact_page'; page_no?: number | null; anchor?: OrderProfileAnchorRule | null; value_region?: OrderProfileAnchorRelativeRegion | null; absolute_value_region?: OrderProfileRelativeRegion | null; fallback_value_region?: OrderProfileRelativeRegion | null; value_mode: 'single_line' | 'multi_line' | 'right_of_anchor' | 'below_anchor'; stop_anchors: OrderProfileAnchorRule[]; minimum_evidence_level: OrderProfileEvidenceLevel; }
@@ -80,6 +87,8 @@ export interface OrderProfileVisualDefinition {
table_regions: OrderProfileTableRegion[];
order_field_layouts?: OrderProfileOrderFieldLayout[];
draft_unbound_order_field_layouts?: OrderProfileDraftUnboundOrderFieldLayout[];
/** 扁平坐标框架契约;legacy 不提交该配置,anchor_frame 由管理员显式启用。 */
coordinate_model?: OrderProfileCoordinateModel;
}
/** coordinate/OCR adapter 仅复用共同视觉定义,不增加独立生命周期字段。 */
@@ -238,7 +238,7 @@ export const getWorkspaceShippingProcessing = async (
.then((raw): WorkspaceShippingProcessingResponse => ({
conversation_id: String(raw?.conversation_id || normalized),
work_items: normalizeShippingProcessingWorkItems(raw?.work_items),
// 会话级 status_groups / 四阶段 / 产物均已由后端裁决;在 API 边界一次规范任务字段,
// 会话级 status_groups / 五阶段 / 产物均已由后端裁决;在 API 边界一次规范任务字段,
// 保证对话卡与批次中心消费同一份 DTO,后续组件不得再做 snake/camel 兼容分支。
conversation_processing: raw?.conversation_processing
? normalizeConversationProcessingProjection(raw.conversation_processing)
@@ -1,6 +1,6 @@
/**
* features/chat/components/ShippingWorkflowStepper.vue
* 用途:货代发货四阶段 Stepper 展示组件。
* 用途:货代发货五阶段 Stepper 展示组件。
* 依赖:shipping/shippingStepper、vue-i18n。
* 逻辑:Chat 与工作台传入 steps 数组;本组件只负责步骤高亮与标签渲染。
*/
@@ -33,7 +33,7 @@ const dotClass = (status: ShippingWorkflowStepItem['status']) => {
<template>
<div class="space-y-2">
<div class="text-[11px] font-semibold uppercase tracking-[0.18em] text-muted">{{ t('chat.shippingNoticeUi.stepperTitle') }}</div>
<div class="grid gap-2" :class="compact ? 'sm:grid-cols-4' : 'md:grid-cols-4'">
<div class="grid gap-2" :class="compact ? 'sm:grid-cols-5' : 'md:grid-cols-5'">
<div
v-for="(step, index) in steps"
:key="step.id"
@@ -167,7 +167,9 @@ const hasDiagnosticDetails = computed(() => Boolean(
<div class="min-h-0 flex-1 space-y-2 overflow-y-auto p-4">
<section
class="rounded-lg border px-3 py-2 text-xs"
:class="eligibility.can_build
:class="eligibility.can_build === null
? 'border-slate-200 bg-slate-50 text-slate-800 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100'
: eligibility.can_build
? 'border-emerald-200 bg-emerald-50 text-emerald-900 dark:border-emerald-900 dark:bg-emerald-950/30 dark:text-emerald-100'
: 'border-amber-200 bg-amber-50 text-amber-900 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-100'"
data-testid="review-eligibility-details-overall"
@@ -175,8 +177,10 @@ const hasDiagnosticDetails = computed(() => Boolean(
<div class="flex flex-wrap items-center justify-between gap-2">
<span class="font-semibold">{{ t('chat.shippingOrderReview.buildEligibility.overallResult') }}</span>
<span class="text-slate-600 dark:text-slate-300">{{ t('chat.shippingOrderReview.buildEligibility.manualBuildLabel') }}</span>
<span class="rounded-full px-2 py-0.5 font-medium" :class="eligibility.can_build ? 'bg-emerald-100 text-emerald-800 dark:bg-emerald-900/60 dark:text-emerald-100' : 'bg-amber-100 text-amber-900 dark:bg-amber-900/60 dark:text-amber-100'">
<span data-testid="review-eligibility-manual-status">{{ eligibility.can_build
<span class="rounded-full px-2 py-0.5 font-medium" :class="eligibility.can_build === null ? 'bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-100' : eligibility.can_build ? 'bg-emerald-100 text-emerald-800 dark:bg-emerald-900/60 dark:text-emerald-100' : 'bg-amber-100 text-amber-900 dark:bg-amber-900/60 dark:text-amber-100'">
<span data-testid="review-eligibility-manual-status">{{ eligibility.can_build === null
? t('chat.shippingOrderReview.buildEligibility.notValidated')
: eligibility.can_build
? t('chat.shippingOrderReview.buildEligibility.canBuildYes')
: t('chat.shippingOrderReview.buildEligibility.canBuildNo') }}</span>
</span>
@@ -153,6 +153,7 @@ const lowConfidenceFields = computed(() => props.eligibility?.issues?.flatMap((i
) || []);
const unexplainedBlocked = computed(() => Boolean(
props.eligibility
&& props.eligibility.status !== 'not_validated'
&& props.eligibility.can_build === false
&& !props.eligibility.issues?.length
&& !props.eligibility.failed_gates?.length
@@ -212,13 +213,17 @@ const gateChecklist = computed(() => {
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.buildEligibility.title') }}</h2>
<span
class="rounded-full px-2.5 py-1 text-xs font-medium"
:class="eligibility.can_build
:class="eligibility.can_build === null
? 'bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-200'
: eligibility.can_build
? 'bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-100'
: 'bg-amber-100 text-amber-900 dark:bg-amber-950 dark:text-amber-100'"
data-testid="review-build-eligibility-badge"
>
{{
eligibility.can_build
eligibility.status === 'not_validated'
? t('chat.shippingOrderReview.buildEligibility.notValidated')
: eligibility.can_build
? t('chat.shippingOrderReview.buildEligibility.canBuildYes')
: t('chat.shippingOrderReview.buildEligibility.canBuildNo')
}}
@@ -0,0 +1,63 @@
/**
* features/chat/components/shipping-review/ReviewCustomerResolutionPanel.spec.ts
* 用途:锁定唯一标准客户候选的工作台提示,避免将可自动确认状态误报为未识别。
* 依赖:vitest、@vue/test-utils、vue-i18n、ReviewCustomerResolutionPanel。
* 逻辑:unique_candidate 显示自动确认说明和明确按钮;其他未确认状态维持人工选择入口。
*/
import { describe, expect, it } from 'vitest';
import { mount } from '@vue/test-utils';
import { createI18n } from 'vue-i18n';
import ReviewCustomerResolutionPanel from './ReviewCustomerResolutionPanel.vue';
const i18n = createI18n({
legacy: false,
locale: 'zh-CN',
messages: {
'zh-CN': {
chat: {
shippingCustomer: { loadFailed: '加载失败', confirmFailed: '确认失败' },
shippingOrderReview: {
customerResolution: {
title: '客户确认', subtitle: '请选择标准客户', uniqueCandidateHint: '已找到唯一标准客户候选;保存校验时系统会自动确认,也可手动确认。',
confirmUniqueCandidate: '确认唯一候选', selectCustomer: '选择标准客户', retrying: '识别中…', retryCustomer: '重新识别客户',
retryDone: '已重新识别客户', retryFailed: '重新识别客户失败', confirmed: '客户已确认', confirmReason: '人工确认',
standardCustomer: '标准客户', customerCode: '客户编码', matchedInputs: '匹配输入', candidates: '候选客户', pdfReparseHint: '请重新识别 PDF',
inputLabels: { customerCode: '客户编码', customerName: '客户名称', address: '地址', email: '邮箱', domain: '域名', other: '其他' },
status: { unique_candidate: '唯一候选', unmatched: '未匹配', confirmed: '已确认' },
},
resume: { autoCreated: '已自动建单', waitingManualConfirm: '等待人工确认' },
},
},
},
},
});
function mountPanel(status: string) {
return mount(ReviewCustomerResolutionPanel, {
props: {
caseNo: 'CASE-CUSTOMER-1',
editable: true,
resolution: { resolved: false, status, raw_name: 'ACME' },
},
global: {
plugins: [i18n],
stubs: { ShippingCustomerConfirmDialog: true },
},
});
}
describe('ReviewCustomerResolutionPanel', () => {
it('唯一候选展示自动确认说明和明确确认入口', () => {
const wrapper = mountPanel('unique_candidate');
expect(wrapper.text()).toContain('保存校验时系统会自动确认');
expect(wrapper.get('[data-testid="review-select-customer"]').text()).toContain('确认唯一候选');
});
it('非唯一未确认状态维持人工选择客户入口', () => {
const wrapper = mountPanel('unmatched');
expect(wrapper.text()).not.toContain('保存校验时系统会自动确认');
expect(wrapper.get('[data-testid="review-select-customer"]').text()).toContain('选择标准客户');
});
});
@@ -41,6 +41,10 @@ const options = ref<ShippingCustomerOption[]>([]);
const loadingOptions = ref(false);
const resolved = computed(() => Boolean(props.resolution?.resolved));
const hasUniqueCandidate = computed(() => (
!resolved.value
&& String(props.resolution?.status || '').trim() === 'unique_candidate'
));
const statusLabel = computed(() => {
const status = String(props.resolution?.status || '').trim();
if (!status) {
@@ -198,7 +202,11 @@ async function onRetry() {
<header class="flex flex-wrap items-start justify-between gap-2">
<div>
<h2 class="text-sm font-semibold">{{ t('chat.shippingOrderReview.customerResolution.title') }}</h2>
<p class="mt-0.5 text-xs text-muted">{{ t('chat.shippingOrderReview.customerResolution.subtitle') }}</p>
<p class="mt-0.5 text-xs text-muted">
{{ hasUniqueCandidate
? t('chat.shippingOrderReview.customerResolution.uniqueCandidateHint')
: t('chat.shippingOrderReview.customerResolution.subtitle') }}
</p>
</div>
<span
class="rounded-full px-2.5 py-1 text-xs font-medium"
@@ -244,7 +252,9 @@ async function onRetry() {
:disabled="busy"
@click="openSelectDialog"
>
{{ t('chat.shippingOrderReview.customerResolution.selectCustomer') }}
{{ hasUniqueCandidate
? t('chat.shippingOrderReview.customerResolution.confirmUniqueCandidate')
: t('chat.shippingOrderReview.customerResolution.selectCustomer') }}
</button>
<button
type="button"
@@ -30,7 +30,7 @@ export type ReviewDocumentNavItem = {
lifecycle_stage?: ReviewLifecycleStageCode | null;
};
type ReviewLifecycleStageCode = 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete';
type ReviewLifecycleStageCode = 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'freight_upload' | 'upload_complete';
export type ReviewDocumentNavMode = 'hidden' | 'tabs' | 'sidebar' | 'sidebar_search' | 'narrow';
@@ -112,7 +112,7 @@ function caseStatusLabel(status: string): string {
/** 后端阶段码只做 i18n 投影;缺失时保留空白,禁止按 Case 状态补造阶段。 */
function lifecycleStageLabel(item: ReviewDocumentNavItem): string | null {
const code = String(item.lifecycle_stage || '').trim() as ReviewLifecycleStageCode;
if (!['intake_parse', 'order_review', 'fulfillment_prep', 'upload_complete'].includes(code)) return null;
if (!['intake_parse', 'order_review', 'fulfillment_prep', 'freight_upload', 'upload_complete'].includes(code)) return null;
const key = `chat.shippingOrderReview.lifecycle.stages.${code}`;
return te(key) ? t(key) : null;
}
@@ -17,6 +17,7 @@ const i18n = createI18n({
messages: {
'zh-CN': {
chat: {
shippingNoticeRetryParse: '重试解析',
shippingOrderReview: {
lifecycle: {
navigation: '订单生命周期阶段',
@@ -33,6 +34,7 @@ const i18n = createI18n({
const stages: ReviewLifecycleStageItem[] = [
{ code: 'order_review', label: '订单复核', state: 'completed' },
{ code: 'fulfillment_prep', label: '通知准备', state: 'current' },
{ code: 'freight_upload', label: '货代上传', state: 'blocked', reason: '请先完成通知准备' },
{ code: 'upload_complete', label: '通知完成', state: 'blocked', reason: '请先完成通知准备' },
];
@@ -45,6 +47,30 @@ function mountNavigation() {
}
describe('ReviewLifecycleStageNavigation', () => {
it('only exposes retry_parse on the current intake stage when the server authorizes it', async () => {
const wrapper = mount(ReviewLifecycleStageNavigation, {
props: {
stages: [
{ code: 'intake_parse', label: '接收解析', state: 'current' },
...stages,
],
activeCode: 'intake_parse',
availableActions: ['retry_parse'],
retrying: false,
},
global: { plugins: [i18n] },
});
// 关键断言:重试入口必须位于已发送文件的当前阶段卡,且完全由后端动作授权。
const retry = wrapper.get('[data-testid="review-lifecycle-stage-retry-parse"]');
expect(retry.text()).toContain('重试解析');
await retry.trigger('click');
expect(wrapper.emitted('retry-parse')).toEqual([[]]);
await wrapper.setProps({ availableActions: [] });
expect(wrapper.find('[data-testid="review-lifecycle-stage-retry-parse"]').exists()).toBe(false);
});
it('renders intake_parse as the first lifecycle stage', () => {
const wrapper = mount(ReviewLifecycleStageNavigation, {
props: {
@@ -63,9 +89,10 @@ describe('ReviewLifecycleStageNavigation', () => {
'review-lifecycle-stage-intake_parse',
'review-lifecycle-stage-order_review',
'review-lifecycle-stage-fulfillment_prep',
'review-lifecycle-stage-freight_upload',
'review-lifecycle-stage-upload_complete',
]);
expect(wrapper.find('[data-testid="review-lifecycle-stage-navigation"] > div').classes()).toContain('sm:grid-cols-4');
expect(wrapper.find('[data-testid="review-lifecycle-stage-navigation"] > div').classes()).toContain('sm:grid-cols-5');
});
it('allows opening a completed stage for inspection', async () => {
@@ -1,13 +1,13 @@
<!--
features/chat/components/shipping-review/ReviewLifecycleStageNavigation.vue
用途:订单生命周期工作台的四阶段导航,只呈现父级已裁决的阶段状态。
用途:订单生命周期工作台的五阶段导航,只呈现父级已裁决的阶段状态。
依赖:父级 ShippingOrderReviewView 提供阶段、状态和阻断原因;lucide-vue-next 图标。
逻辑:用户可打开当前或已完成阶段查看;后续阶段由父级传入 blocked 并禁用,本组件不写业务状态。
-->
<script setup lang="ts">
import { Check, LockKeyhole } from 'lucide-vue-next';
export type ReviewLifecycleStageCode = 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete';
export type ReviewLifecycleStageCode = 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'freight_upload' | 'upload_complete';
export type ReviewLifecycleStageState = 'current' | 'completed' | 'blocked';
export interface ReviewLifecycleStageItem {
@@ -21,13 +21,25 @@ const props = defineProps<{
stages: ReviewLifecycleStageItem[];
/** 后端尚未下发入口时为空;导航只能展示加载/未授权态,不能自行指定订单复核。 */
activeCode: ReviewLifecycleStageCode | null;
/** 仅消费当前对象后端下发的恢复动作,禁止按阶段或状态由前端猜测。 */
availableActions?: string[];
/** retry_parse 请求中的互斥状态,避免用户重复提交。 */
retrying?: boolean;
}>();
const emit = defineEmits<{
select: [code: ReviewLifecycleStageCode];
'open-detail': [code: ReviewLifecycleStageCode];
'retry-parse': [];
}>();
/** 接收解析的恢复只在后端明确授权且该阶段为当前阶段时展示。 */
function canRetryParse(stage: ReviewLifecycleStageItem): boolean {
return stage.code === 'intake_parse'
&& stage.state === 'current'
&& (props.availableActions || []).includes('retry_parse');
}
/**
* 阶段导航只允许进入当前或已完成阶段;blocked 仅说明前置条件,不替代后端 Gate 判定。
*/
@@ -43,7 +55,7 @@ function selectStage(stage: ReviewLifecycleStageItem) {
:aria-label="$t('chat.shippingOrderReview.lifecycle.navigation')"
data-testid="review-lifecycle-stage-navigation"
>
<div class="grid gap-2 sm:grid-cols-4">
<div class="grid gap-2 sm:grid-cols-5">
<div
v-for="stage in props.stages"
:key="stage.code"
@@ -81,6 +93,16 @@ function selectStage(stage: ReviewLifecycleStageItem) {
? $t('chat.shippingOrderReview.lifecycle.completed')
: (stage.reason || $t('chat.shippingOrderReview.lifecycle.blocked')) }}
</button>
<button
v-if="canRetryParse(stage)"
type="button"
class="mt-2 rounded border border-brand-300 px-2 py-1 text-xs font-medium text-brand-700 hover:bg-brand-50 disabled:cursor-not-allowed disabled:opacity-60 dark:border-brand-700 dark:text-brand-200 dark:hover:bg-brand-950/40"
data-testid="review-lifecycle-stage-retry-parse"
:disabled="props.retrying === true"
@click="emit('retry-parse')"
>
{{ $t('chat.shippingNoticeRetryParse') }}
</button>
</div>
</div>
</nav>
@@ -18,6 +18,10 @@ const i18n = createI18n({
title: '文档模板匹配', subtitle: '摘要', selected: '命中模板', noSelected: '未选定模板',
expandCandidates: '查看候选模板({count})', collapseCandidates: '收起候选模板',
routeType: '路由类型', executionMode: '执行模式',
coordinateModel: {
anchorFrame: '锚点坐标框架', status: '变换状态', translateX: '横向平移',
translateY: '纵向平移', reasonCodes: '原因码',
},
status: { matched: '已匹配', ambiguous: '多个候选' },
} } },
},
@@ -44,6 +48,34 @@ function mountPanel(needsReview = false) {
});
}
function mountAnchorFramePanel(visibility: 'admin' | 'admin_only' = 'admin') {
return mount(ReviewProfileMatchPanel, {
props: {
profileMatch: {
available: true,
visibility,
status: 'unique_match',
needs_review: false,
selected_profile: { profile_code: 'ODP-A', display_name: '客户订单模板', version: 1 },
candidates: [{
profile_code: 'ODP-A',
version: 1,
display_name: '客户订单模板',
score: 0.99,
coordinate_transform: {
status: 'applied',
translate_x: 0.001,
translate_y: 0.03,
reason_codes: [],
},
}],
fallback_reason_codes: [],
},
},
global: { plugins: [i18n] },
});
}
describe('ReviewProfileMatchPanel', () => {
it('默认收起无需关注的候选列表', () => {
const wrapper = mountPanel(false);
@@ -69,4 +101,23 @@ describe('ReviewProfileMatchPanel', () => {
expect(wrapper.get('[data-testid="review-profile-match-candidates"]').text()).toContain('客户订单模板');
expect(wrapper.get('[data-testid="review-profile-match-candidates"]').text()).not.toContain('ODP-A');
});
it('管理员技术详情展示锚点框架平移和稳定原因码,不展示原始正文或完整坐标', async () => {
const wrapper = mountAnchorFramePanel();
await wrapper.get('[data-testid="review-profile-match-candidates-toggle"]').trigger('click');
const details = wrapper.get('[data-testid="review-profile-match-details"]');
expect(details.text()).toContain('锚点坐标框架');
expect(details.text()).toContain('纵向平移');
expect(details.text()).toContain('0.03');
expect(details.text()).not.toContain('ORDER NO.');
expect(details.text()).not.toContain('x0');
});
it('非管理员不可见锚点框架技术详情', async () => {
const wrapper = mountAnchorFramePanel('admin_only');
expect(wrapper.find('[data-testid="review-profile-match-panel"]').exists()).toBe(true);
expect(wrapper.find('[data-testid="review-profile-match-coordinate-transform"]').exists()).toBe(false);
});
});
@@ -30,6 +30,19 @@ const candidateCount = computed(() => (props.profileMatch?.candidates || []).len
const defaultCandidatesExpanded = computed(() => false);
const candidatesOpenOverride = ref<boolean | null>(null);
const candidatesExpanded = computed(() => candidatesOpenOverride.value ?? defaultCandidatesExpanded.value);
const selectedCoordinateTransform = computed(() => {
if (!isAdminView.value) return null;
const selectedCode = String(props.profileMatch?.selected_profile?.profile_code || '');
const selectedVersion = props.profileMatch?.selected_profile?.version;
const candidate = (props.profileMatch?.candidates || []).find((item) => (
item.profile_code === selectedCode
&& (selectedVersion == null || item.version === selectedVersion)
));
return candidate?.coordinate_transform || null;
});
const coordinateTransformReasonCodes = computed(() => (
selectedCoordinateTransform.value?.reason_codes || []
));
watch(
() => `${props.profileMatch?.status || ''}:${props.profileMatch?.selected_profile?.profile_code || ''}:${candidateCount.value}`,
@@ -118,6 +131,17 @@ const selectedLabel = computed(() => {
<dt class="text-muted">{{ t('chat.shippingOrderReview.profileMatch.executionMode') }}</dt>
<dd class="font-mono">{{ profileMatch.execution_mode }}</dd>
</div>
<div v-if="selectedCoordinateTransform" data-testid="review-profile-match-coordinate-transform" class="mt-2 rounded-lg border border-sky-200 bg-sky-50 px-2.5 py-2 text-[11px] text-sky-950 dark:border-sky-900 dark:bg-sky-950/30 dark:text-sky-100">
<div class="font-medium">{{ t('chat.shippingOrderReview.profileMatch.coordinateModel.anchorFrame') }}</div>
<div class="mt-1 flex flex-wrap gap-x-3 gap-y-1">
<span>{{ t('chat.shippingOrderReview.profileMatch.coordinateModel.status') }}: {{ selectedCoordinateTransform.status }}</span>
<span v-if="selectedCoordinateTransform.translate_x != null">{{ t('chat.shippingOrderReview.profileMatch.coordinateModel.translateX') }}: {{ selectedCoordinateTransform.translate_x }}</span>
<span v-if="selectedCoordinateTransform.translate_y != null">{{ t('chat.shippingOrderReview.profileMatch.coordinateModel.translateY') }}: {{ selectedCoordinateTransform.translate_y }}</span>
</div>
<div v-if="coordinateTransformReasonCodes.length" class="mt-1">
{{ t('chat.shippingOrderReview.profileMatch.coordinateModel.reasonCodes') }}: {{ coordinateTransformReasonCodes.join(', ') }}
</div>
</div>
</dl>
<ul
class="mt-2 max-h-48 space-y-1.5 overflow-y-auto pr-1"
@@ -801,6 +801,7 @@ describe('ShippingConversationProcessingCard', () => {
lifecycleEntries: [
{ code: 'order_review', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
blocking_reason: null,
@@ -820,6 +821,7 @@ describe('ShippingConversationProcessingCard', () => {
expect(row.text()).toContain('通知准备');
expect(row.text()).toContain('订单复核 · 可进入');
expect(row.text()).toContain('通知准备 · 当前可处理');
expect(row.text()).toContain('货代上传 · 前置未完成');
expect(row.text()).toContain('通知完成 · 前置未完成');
});
@@ -50,8 +50,8 @@ const props = defineProps<{
hasMoreHistory?: boolean;
/** 批次中心按状态 → EML → 文件展示,不再嵌入任务级 15 节点进度。 */
workbenchMode?: boolean;
/** 批次四阶段筛选;保留状态/EML 分组,仅隐藏不属于当前阶段的任务。 */
lifecycleFilter?: 'all' | 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete';
/** 批次五阶段筛选;保留状态/EML 分组,仅隐藏不属于当前阶段的任务。 */
lifecycleFilter?: 'all' | 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'freight_upload' | 'upload_complete';
/** 批次中心本地搜索:只筛叶子文件,父 EML 卡仍保留。 */
fileSearchQuery?: string;
/** 后端已授权下载的正式 Excel 对应 OT。 */
@@ -94,12 +94,13 @@ type WorkbenchFileRow = {
po_number?: string | null;
projection?: ShippingProcessingProjection;
};
const LIFECYCLE_STAGE_CODES = ['intake_parse', 'order_review', 'fulfillment_prep', 'upload_complete'] as const;
const LIFECYCLE_STAGE_CODES = ['intake_parse', 'order_review', 'fulfillment_prep', 'freight_upload', 'upload_complete'] as const;
type LifecycleStageCode = typeof LIFECYCLE_STAGE_CODES[number];
const LIFECYCLE_STAGE_LABEL_KEYS: Record<string, string> = {
intake_parse: 'intakeParse',
order_review: 'orderReview',
fulfillment_prep: 'fulfillmentPrep',
freight_upload: 'freightUpload',
upload_complete: 'uploadComplete',
};
@@ -454,7 +455,7 @@ function workbenchFileReason(file: WorkbenchFileRow, task: ConversationProcessin
return taskReasonLabel(task);
}
/** 文件工作面显示四阶段业务语义;技术 stage 仍保留给进度诊断,不用于入口可达性。 */
/** 文件工作面显示五阶段业务语义;技术 stage 仍保留给进度诊断,不用于入口可达性。 */
function workbenchFileLifecycleStage(file: WorkbenchFileRow): string {
const code = String(file.projection?.uiState?.lifecycleStage || '').trim();
const key = LIFECYCLE_STAGE_LABEL_KEYS[code];
@@ -2,7 +2,7 @@
* features/chat/components/shipping/ShippingWorkflowTimeline.spec.ts
* 用途:验收批次进度中心只投影后端实时状态,不再保留文件详情抽屉。
* 依赖:Vitest、Vue Test Utils、Timeline、ShippingConversationProcessingCard、shipping API。
* 逻辑:四阶段、生命周期入口与单文件取消均由后端 Projection/availableActions 决定。
* 逻辑:五阶段、生命周期入口与单文件取消均由后端 Projection/availableActions 决定。
*/
import { flushPromises, mount } from '@vue/test-utils';
import { beforeEach, describe, expect, it, vi } from 'vitest';
@@ -116,23 +116,29 @@ describe('ShippingWorkflowTimeline', () => {
api.reparseBatch.mockClear();
});
it('renders backend-owned four-stage summaries and the authorized download toolbar', async () => {
it('prefers backend five-stage lifecycle nodes and shows the authorized download toolbar in freight upload', async () => {
const processing = processingProjection({
four_stage_nodes: [
lifecycle_nodes: [
{ code: 'intake_parse', status: 'passed', summary: { total: 1, completed: 1, needs_action: 0, processing: 0, failed: 0, blocking_reason: null } },
{ code: 'order_review', status: 'passed', summary: { total: 1, completed: 1, needs_action: 0, processing: 0, failed: 0, blocking_reason: null } },
{ code: 'fulfillment_prep', status: 'passed', summary: { total: 1, completed: 1, needs_action: 0, processing: 0, failed: 0, blocking_reason: null } },
{ code: 'upload_complete', status: 'running', summary: { total: 1, completed: 0, needs_action: 1, processing: 0, failed: 0, blocking_reason: { code: 'manual_upload_pending' } } },
{ code: 'freight_upload', status: 'running', summary: { total: 1, completed: 0, needs_action: 1, processing: 0, failed: 0, blocking_reason: { code: 'manual_upload_pending' } } },
{ code: 'upload_complete', status: 'pending', summary: { total: 1, completed: 0, needs_action: 0, processing: 0, failed: 0, blocking_reason: null } },
],
// 新字段存在时必须优先使用,不能显示兼容字段的旧/冲突结果。
four_stage_nodes: [{ code: 'upload_complete', status: 'passed', summary: { total: 9, completed: 9, needs_action: 0, processing: 0, failed: 0, blocking_reason: null } }],
output_artifacts: [{ order_task_no: 'OT-1', filename: 'notice.xlsx', type: 'xlsx', status: 'ready', action: { code: 'download_excel', enabled: true } }],
} as Partial<ConversationProcessingProjection>);
const wrapper = mountTimeline(processing, [fileProjection()]);
await flushPromises();
expect(wrapper.get('[data-testid="shipping-workflow-four-stage-progress"]').text()).toContain('接收解析');
const upload = wrapper.get('[data-testid="shipping-workflow-stage-filter-upload_complete"]');
// 四阶段卡仅保留阶段名和后端统计数量,状态由卡片样式表达。
expect(upload.text()).toBe('通知完成1');
const progress = wrapper.get('[data-testid="shipping-workflow-lifecycle-progress"]');
expect(progress.text()).toContain('接收解析');
expect(progress.text()).toContain('货代上传');
expect(progress.findAll('button')).toHaveLength(5);
const upload = wrapper.get('[data-testid="shipping-workflow-stage-filter-freight_upload"]');
// 五阶段卡仅保留阶段名和后端统计数量,状态由卡片样式表达。
expect(upload.text()).toBe('货代上传1');
await upload.trigger('click');
expect(wrapper.find('[data-testid="shipping-workflow-download-toolbar"]').exists()).toBe(true);
});
@@ -463,7 +469,7 @@ describe('ShippingWorkflowTimeline', () => {
}));
});
it('shows only title and total on four-stage cards', async () => {
it('falls back to the compatibility lifecycle field and shows only title and total', async () => {
const processing = processingProjection({
four_stage_nodes: [{
code: 'order_review', status: 'blocked',
@@ -1,6 +1,6 @@
/**
* features/chat/components/shipping/ShippingWorkflowTimeline.vue
* 用途:聊天页右侧「批次进度中心」——后端批次投影、四阶段进度和文件行操作。
* 用途:聊天页右侧「批次进度中心」——后端批次投影、五阶段进度和文件行操作。
* 依赖:vue-i18n、useMessage、useShippingNoticeWorkflow、ShippingConversationProcessingCard、
* ReasonDialog、ProcessGateRecoveryCard。
* 逻辑:顶层以 OT / ShippingProcessing 为主路径;标题栏仅保留批次名称、加载与截断提示,
@@ -115,25 +115,28 @@ const processing = computed(() => ctl.value.processing?.value ?? null);
/** 展示投影:统一 ShippingProcessing / conversation_processing。 */
const displayProcessing = computed(() => processing.value);
const batchArtifacts = computed(() => displayProcessing.value?.output_artifacts || []);
const batchFourStageNodes = computed(() => displayProcessing.value?.four_stage_nodes || []);
const lifecycleFilter = ref<'all' | 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete'>('all');
const batchLifecycleNodes = computed(() => (
displayProcessing.value?.lifecycle_nodes || displayProcessing.value?.four_stage_nodes || []
));
const lifecycleFilter = ref<'all' | 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'freight_upload' | 'upload_complete'>('all');
const fileSearchQuery = ref('');
const selectedDownloadTaskNos = ref<string[]>([]);
/** 四阶段后端编码为 snake_case,语言资源键沿用 camelCase;映射仅做展示翻译,不参与状态裁决。 */
const BATCH_FOUR_STAGE_I18N_KEYS: Record<string, string> = {
/** 五阶段后端编码为 snake_case,语言资源键沿用 camelCase;映射仅做展示翻译,不参与状态裁决。 */
const BATCH_LIFECYCLE_I18N_KEYS: Record<string, string> = {
intake_parse: 'intakeParse',
order_review: 'orderReview',
fulfillment_prep: 'fulfillmentPrep',
freight_upload: 'freightUpload',
upload_complete: 'uploadComplete',
};
function batchFourStageLabelKey(code: string): string {
return BATCH_FOUR_STAGE_I18N_KEYS[code] || code;
function batchLifecycleLabelKey(code: string): string {
return BATCH_LIFECYCLE_I18N_KEYS[code] || code;
}
function selectLifecycleFilter(code: 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete') {
function selectLifecycleFilter(code: 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'freight_upload' | 'upload_complete') {
lifecycleFilter.value = lifecycleFilter.value === code ? 'all' : code;
}
/** 阶段卡仅展示后端统计总数;状态、阻塞和推进语义由颜色与边框表达。 */
function stageTotalText(node: NonNullable<typeof batchFourStageNodes.value>[number]): string {
function stageTotalText(node: NonNullable<typeof batchLifecycleNodes.value>[number]): string {
return String(Number(node.summary?.total || 0));
}
/** 下载资格仅来自后端 output_artifacts 的授权动作;筛选仅影响展示,不缩减授权集合。 */
@@ -1024,15 +1027,15 @@ watch(
/>
</div>
</div>
<section v-if="batchFourStageNodes.length" class="mb-4 border-b border-default pb-4" data-testid="shipping-workflow-four-stage-progress">
<div class="grid grid-cols-4 gap-2">
<button v-for="node in batchFourStageNodes" :key="node.code" type="button" class="rounded-lg border px-2 py-2 text-left text-xs transition-colors" :class="[node.status === 'passed' ? 'border-emerald-200 bg-emerald-50 text-emerald-800' : node.status === 'blocked' ? 'border-amber-300 bg-amber-50 text-amber-800' : node.status === 'running' ? 'border-brand-300 bg-brand-50 text-brand-800' : 'border-default bg-surface-muted text-secondary', lifecycleFilter === node.code ? 'ring-2 ring-brand-400 ring-offset-1' : 'hover:brightness-95']" :data-testid="`shipping-workflow-stage-filter-${node.code}`" @click="selectLifecycleFilter(node.code)">
<span class="block font-semibold">{{ t(`chat.shippingNoticeUi.stage.${batchFourStageLabelKey(node.code)}`) }}</span>
<section v-if="batchLifecycleNodes.length" class="mb-4 border-b border-default pb-4" data-testid="shipping-workflow-lifecycle-progress">
<div class="grid grid-cols-2 gap-2 sm:grid-cols-5">
<button v-for="node in batchLifecycleNodes" :key="node.code" type="button" class="rounded-lg border px-2 py-2 text-left text-xs transition-colors" :class="[node.status === 'passed' ? 'border-emerald-200 bg-emerald-50 text-emerald-800' : node.status === 'blocked' ? 'border-amber-300 bg-amber-50 text-amber-800' : node.status === 'running' ? 'border-brand-300 bg-brand-50 text-brand-800' : 'border-default bg-surface-muted text-secondary', lifecycleFilter === node.code ? 'ring-2 ring-brand-400 ring-offset-1' : 'hover:brightness-95']" :data-testid="`shipping-workflow-stage-filter-${node.code}`" @click="selectLifecycleFilter(node.code)">
<span class="block font-semibold">{{ t(`chat.shippingNoticeUi.stage.${batchLifecycleLabelKey(node.code)}`) }}</span>
<span class="mt-0.5 block text-[11px] opacity-80">{{ stageTotalText(node) }}</span>
</button>
</div>
<div v-if="lifecycleFilter !== 'all'" class="mt-2 flex items-center justify-between gap-2 text-xs text-secondary">
<span>{{ t('chat.shippingProcessing.batchWorkbench.filteringByStage', { stage: t(`chat.shippingNoticeUi.stage.${batchFourStageLabelKey(lifecycleFilter)}`) }) }}</span>
<span>{{ t('chat.shippingProcessing.batchWorkbench.filteringByStage', { stage: t(`chat.shippingNoticeUi.stage.${batchLifecycleLabelKey(lifecycleFilter)}`) }) }}</span>
<button type="button" class="text-brand-700 hover:underline" data-testid="shipping-workflow-clear-stage-filter" @click="lifecycleFilter = 'all'">{{ t('chat.shippingProcessing.batchWorkbench.clearStageFilter') }}</button>
</div>
<p v-if="Number(displayProcessing?.unclassified_summary?.count || 0) > 0" class="mt-2 text-xs text-amber-700" data-testid="shipping-workflow-unclassified-summary">
@@ -1048,7 +1051,7 @@ watch(
<span class="sr-only">{{ t('chat.shippingProcessing.batchWorkbench.search.label') }}</span>
<input v-model="fileSearchQuery" type="search" class="w-full rounded-md border border-default bg-surface px-2.5 py-1.5 text-xs" :placeholder="t('chat.shippingProcessing.batchWorkbench.search.placeholder')" data-testid="shipping-workflow-file-search">
</label>
<div v-if="lifecycleFilter === 'upload_complete' && downloadableTaskNos.length" class="flex flex-wrap items-center gap-2" data-testid="shipping-workflow-download-toolbar">
<div v-if="lifecycleFilter === 'freight_upload' && downloadableTaskNos.length" class="flex flex-wrap items-center gap-2" data-testid="shipping-workflow-download-toolbar">
<label class="inline-flex items-center gap-1 text-xs text-secondary"><input type="checkbox" :checked="allDownloadableSelected" data-testid="shipping-workflow-download-select-all" @change="toggleAllDownloadSelections"><span>{{ t('chat.shippingProcessing.batchWorkbench.artifacts.selectAll') }}</span></label>
<span class="text-xs text-secondary">{{ t('chat.shippingProcessing.batchWorkbench.artifacts.selected', { count: selectedDownloadTaskNos.length }) }}</span>
<button type="button" class="rounded-md border border-brand-300 px-2.5 py-1 text-xs font-medium text-brand-700 disabled:opacity-50" :disabled="!selectedDownloadTaskNos.length" data-testid="shipping-workflow-download-selected" @click="downloadSelectedBatchArtifacts">{{ t('chat.shippingProcessing.batchWorkbench.artifacts.downloadSelected') }}</button>
@@ -65,12 +65,12 @@ describe('shipping order review workbench viewport layout contract', () => {
expect(share1440).toBeGreaterThanOrEqual(0.62);
});
it('keeps four lifecycle columns while reserving 16rem only for the desktop sidebar', () => {
it('keeps five lifecycle columns while reserving 16rem only for the desktop sidebar', () => {
const lifecycleNavigation = readFileSync(lifecycleNavigationPath, 'utf8');
const reviewWorkbench = readFileSync(reviewWorkbenchPath, 'utf8');
// 关键断言:接收解析为第四阶段;必须断言真实导航组件,不能只验证 spec 内常量。
expect(lifecycleNavigation).toContain('class="grid gap-2 sm:grid-cols-4"');
// 关键断言:导航真实渲染五个业务阶段,不能只验证 spec 内常量。
expect(lifecycleNavigation).toContain('class="grid gap-2 sm:grid-cols-5"');
// sidebar/sidebar_search 是唯一允许预留 16rem 的模式;tabs/hidden/narrow 均落入 contents。
expect(reviewWorkbench).toMatch(/reviewDocumentNavigationMode\.value === 'sidebar'\s*\|\|\s*reviewDocumentNavigationMode\.value === 'sidebar_search'/);
expect(reviewWorkbench).toMatch(/:class="reviewDocumentNavigationUsesSidebar\s*\? 'grid gap-2 lg:grid-cols-\[16rem_minmax\(0,1fr\)\] lg:items-start lg:gap-3'\s*:\s*'contents'"/);
@@ -669,6 +669,51 @@ describe('useShippingOrderReview build eligibility writes', () => {
expect(review.activeCase.value?.case_no).toBe('CASE-B');
});
it('keeps the latest Run and Case when an older load response arrives last', async () => {
// 关键断言:重识别跳转新版本后,旧 Run 的迟到响应不得覆盖新版工作面。
let resolveOldRun: ((value: Record<string, unknown>) => void) | null = null;
api.getRun.mockImplementation((runNo: string) => (runNo === 'RUN-OLD'
? new Promise<Record<string, unknown>>((resolve) => { resolveOldRun = resolve; })
: Promise.resolve({
run_no: runNo,
summary: {},
items: [{ case_no: 'CASE-NEW', document_id: 2, status: 'draft', issue_count: 0 }],
})));
api.getQueue.mockImplementation((runNo: string) => Promise.resolve({
summary: { total: 1, needs_action: 1, processing: 0, completed: 0 },
items: [{
case_no: runNo === 'RUN-OLD' ? 'CASE-OLD' : 'CASE-NEW',
document_id: runNo === 'RUN-OLD' ? 1 : 2,
source_run_no: runNo,
status: 'draft', issue_count: 0, available_actions: [],
}],
}));
api.getCase.mockImplementation((caseNo: string) => Promise.resolve(buildCase({
case_no: caseNo,
run_no: caseNo === 'CASE-OLD' ? 'RUN-OLD' : 'RUN-NEW',
document: {
id: caseNo === 'CASE-OLD' ? 1 : 2,
file_name: caseNo === 'CASE-OLD' ? 'old.pdf' : 'new.pdf',
},
})));
api.getEvidence.mockResolvedValue({ items: [] });
const review = useShippingOrderReview();
const olderLoad = review.load('RUN-OLD', 'CASE-OLD');
await Promise.resolve();
await review.load('RUN-NEW', 'CASE-NEW');
resolveOldRun?.({
run_no: 'RUN-OLD',
summary: {},
items: [{ case_no: 'CASE-OLD', document_id: 1, status: 'superseded', issue_count: 0 }],
});
await olderLoad;
expect(review.reviewRun.value?.run_no).toBe('RUN-NEW');
expect(review.activeCase.value?.case_no).toBe('CASE-NEW');
});
it('blocks confirm when build eligibility cannot build', async () => {
const review = useShippingOrderReview();
@@ -654,21 +654,34 @@ export function useShippingOrderReview(options: { onWorkflowRefresh?: () => void
/**
* ???? WorkItem ???????????????????
*/
const refreshWorkItemContext = async (conversationId?: string, itemNo?: string) => {
const refreshWorkItemContext = async (
conversationId?: string,
itemNo?: string,
options?: { expectedLoadGeneration?: number },
) => {
const isExpectedLoad = () => (
options?.expectedLoadGeneration == null
|| options.expectedLoadGeneration === caseLoadGeneration
);
const conversation = String(conversationId || contextConversationId || '').trim();
if (conversation) contextConversationId = conversation;
if (itemNo) contextItemNo = itemNo;
if (!isExpectedLoad()) return;
versionsLoading.value = true;
try {
reviewProgressContext.value = await resolveWorkItem(conversation, {
const context = await resolveWorkItem(conversation, {
itemNo: contextItemNo || undefined,
caseNo: activeCase.value?.case_no,
});
if (!isExpectedLoad()) return;
reviewProgressContext.value = context;
versions.value = [];
} catch {
if (!isExpectedLoad()) return;
reviewProgressContext.value = null;
versions.value = [];
} finally {
if (!isExpectedLoad()) return;
versionsLoading.value = false;
refreshStatusMessage();
}
@@ -848,8 +861,9 @@ export function useShippingOrderReview(options: { onWorkflowRefresh?: () => void
preferredCaseNo?: string,
options?: { conversationId?: string; itemNo?: string; restoreProgress?: boolean },
) => {
++caseLoadGeneration;
const generation = ++caseLoadGeneration;
++intakeParseRequestGeneration;
requestedCaseNo.value = String(preferredCaseNo || '').trim() || null;
loading.value = true;
loadFailed.value = false;
draftConflict.value = null;
@@ -874,18 +888,25 @@ export function useShippingOrderReview(options: { onWorkflowRefresh?: () => void
getWorkspaceShippingOrderReviewRun(runNo),
getWorkspaceShippingOrderReviewQueue(runNo),
]);
if (generation !== caseLoadGeneration) return;
reviewRun.value = run;
reviewQueue.value = queue;
// [STREAM] Run 替代不等于其内全部 PDF 替代;当前文件只由队列 Stream 裁决。
const caseNo = preferredCaseNo || queue.items[0]?.case_no || run.items[0]?.case_no;
const caseSnapshot = caseNo ? await getWorkspaceShippingOrderReviewCase(caseNo) : null;
if (generation !== caseLoadGeneration) return;
applyCaseSnapshot(caseSnapshot);
evidence.value = caseNo ? (await getWorkspaceShippingOrderReviewEvidence(caseNo)).items : [];
const caseEvidence = caseNo ? await getWorkspaceShippingOrderReviewEvidence(caseNo) : null;
if (generation !== caseLoadGeneration) return;
evidence.value = caseEvidence?.items || [];
// [STEP] ??????? PDF??????????????????????
clearPreview();
await refreshWorkItemContext(contextConversationId, contextItemNo);
await refreshWorkItemContext(contextConversationId, contextItemNo, {
expectedLoadGeneration: generation,
});
// refreshWorkItemContext ????? ref???????? ref????? load ???????????
} catch {
if (generation !== caseLoadGeneration) return;
loadFailed.value = true;
reviewRun.value = null;
activeCase.value = null;
@@ -894,6 +915,7 @@ export function useShippingOrderReview(options: { onWorkflowRefresh?: () => void
versions.value = [];
statusMessage.value = null;
} finally {
if (generation !== caseLoadGeneration) return;
loading.value = false;
}
};
@@ -1235,7 +1235,9 @@ describe('conversationProcessingProjection — normalize & semantic & stabilize'
}],
waiting_human: [], processing: [], completed: [], cancelled: [], archived: [],
},
four_stage_nodes: [{ code: 'intake_parse', label_key: 'shipping.stage.intake', status: 'blocked' }],
lifecycle_nodes: [{ code: 'intake_parse', label_key: 'shipping.stage.intake', status: 'blocked' }],
// 兼容字段故意给出不同值,验证适配层优先消费 lifecycle_nodes。
four_stage_nodes: [{ code: 'upload_complete', label_key: 'shipping.stage.complete', status: 'passed' }],
output_artifacts: [{ order_task_no: 'OT-API-1', filename: 'shipping.xlsx', type: 'excel', status: 'ready', action: { code: 'download_excel', enabled: true } }],
} as unknown as ConversationProcessingProjection;
@@ -1247,9 +1249,10 @@ describe('conversationProcessingProjection — normalize & semantic & stabilize'
expect(eml.uiState?.primary_action?.i18nKey).toBe('shipping.retry');
expect(eml.aggregateChildren?.[0]?.uiState?.primary_action?.code).toBe('retry');
expect(eml.aggregateChildren?.[0]?.sourceSummary.filename).toBe('a.pdf');
// 批次统计、四阶段与产物均是后端事实,适配时不得从附件重算或丢失。
// 批次统计、五阶段与产物均是后端事实,适配时不得从附件重算或丢失。
expect(normalized.summary.total_files).toBe(7);
expect(normalized.four_stage_nodes).toEqual([{ code: 'intake_parse', label_key: 'shipping.stage.intake', status: 'blocked' }]);
expect(normalized.lifecycle_nodes).toEqual([{ code: 'intake_parse', label_key: 'shipping.stage.intake', status: 'blocked' }]);
expect(normalized.four_stage_nodes).toEqual([{ code: 'upload_complete', label_key: 'shipping.stage.complete', status: 'passed' }]);
expect(normalized.output_artifacts?.[0]?.action.enabled).toBe(true);
});
@@ -946,7 +946,7 @@ export function resolveConversationProcessingFromUnified(
stabilizer?: { hasSeenOrderTaskBefore?(conversationId?: string | null): boolean; markSeen?(conversationId?: string | null): void; reset?(conversationId?: string | null): void; conversationId?: string | null },
): ConversationProcessingProjection | null {
const items = Array.isArray(workItems) ? workItems : [];
// [AUTHORITY] conversation_processing.status_groups 与 four_stage_nodes / ui_state
// [AUTHORITY] conversation_processing.status_groups 与 lifecycle_nodes / ui_state
// 同属后端一次裁决。即使顶层 work_items 非空,也不得前端二次聚合或用旧快照覆盖。
if (embedded && typeof embedded === 'object' && embedded.status_groups) {
return normalizeConversationProcessingProjection(embedded);
@@ -1035,11 +1035,11 @@ export function normalizeConversationProcessingProjection(
: null)
),
targetLifecycleStage: (
['intake_parse', 'order_review', 'fulfillment_prep', 'upload_complete'].includes(
['intake_parse', 'order_review', 'fulfillment_prep', 'freight_upload', 'upload_complete'].includes(
String(rawAction.targetLifecycleStage),
)
? rawAction.targetLifecycleStage
: (['intake_parse', 'order_review', 'fulfillment_prep', 'upload_complete'].includes(
: (['intake_parse', 'order_review', 'fulfillment_prep', 'freight_upload', 'upload_complete'].includes(
String(rawAction.target_lifecycle_stage),
)
? rawAction.target_lifecycle_stage
@@ -1192,7 +1192,8 @@ export function normalizeConversationProcessingProjection(
completed,
history,
status_groups: normalizedGroups || projection.status_groups,
four_stage_nodes: projection.four_stage_nodes || [],
lifecycle_nodes: projection.lifecycle_nodes || projection.four_stage_nodes || [],
four_stage_nodes: projection.four_stage_nodes || projection.lifecycle_nodes || [],
unclassified_summary: projection.unclassified_summary || { count: 0 },
ui_state: projection.ui_state || undefined,
output_artifacts: projection.output_artifacts || [],
@@ -1,6 +1,6 @@
/**
* features/chat/shipping/shippingStepper.spec.ts
* 用途:验证发货通知四阶段 Stepper 只消费后端 UI State 投影。
* 用途:验证发货通知五阶段 Stepper 只消费后端 UI State 投影。
* 依赖:shippingStepper 纯函数、vitest。
* 逻辑:后端 UI State 缺失时,前端仍需把关键人工介入态渲染为 blocked。
*/
@@ -12,19 +12,20 @@ import {
} from './shippingStepper';
describe('shippingStepper', () => {
it('renders exactly four stages from backend ui_state', () => {
it('renders exactly five stages from backend ui_state', () => {
const steps = resolveShippingWorkflowSteps({
ui_state: {
steps: [
{ id: 'shipping-stage-1', code: 'intake_parse', label: '接收解析', status: 'completed' },
{ id: 'shipping-stage-2', code: 'order_review', label: '订单复核', status: 'completed' },
{ id: 'shipping-stage-3', code: 'fulfillment_prep', label: '通知准备', status: 'blocked' },
{ id: 'shipping-stage-4', code: 'upload_complete', label: '通知完成', status: 'pending' },
{ id: 'shipping-stage-4', code: 'freight_upload', label: '货代上传', status: 'pending' },
{ id: 'shipping-stage-5', code: 'upload_complete', label: '通知完成', status: 'pending' },
],
},
});
expect(steps).toHaveLength(4);
expect(steps).toHaveLength(5);
expect(steps[2]?.status).toBe('blocked');
});
@@ -33,17 +34,18 @@ describe('shippingStepper', () => {
expect(normalizeShippingWorkflowSteps(null)).toEqual([]);
});
it('maps technical processing stages into the four business stages', () => {
it('maps technical processing stages into the five business stages', () => {
const base = normalizeShippingWorkflowSteps([
{ code: 'intake_parse', status: 'pending' },
{ code: 'order_review', status: 'pending' },
{ code: 'fulfillment_prep', status: 'pending' },
{ code: 'freight_upload', status: 'pending' },
{ code: 'upload_complete', status: 'pending' },
]);
const steps = applyShippingProcessingStageToSteps(base, {
stage: 'inventory_matching',
status: 'running',
});
expect(steps.map((step) => step.status)).toEqual(['completed', 'completed', 'current', 'pending']);
expect(steps.map((step) => step.status)).toEqual(['completed', 'completed', 'current', 'pending', 'pending']);
});
});
@@ -1,8 +1,8 @@
/**
* features/chat/shipping/shippingStepper.ts
* 用途:基于后端 ui_state 投影渲染四阶段业务 Stepper。
* 用途:基于后端 ui_state 投影渲染五阶段业务 Stepper。
* 依赖:ShippingProcessingProjection(可选叠加)、shippingProcessingFulfillment;ShippingWorkflowStepper.vue 消费输出。
* 逻辑:只消费后端 ui_state.steps 四阶段投影;缺失投影时 fail-closed。
* 逻辑:只消费后端 ui_state.steps 五阶段投影;缺失投影时 fail-closed。
*/
import {
FULFILLMENT_PROGRESS_NODES,
@@ -32,6 +32,7 @@ export const SHIPPING_WORKFLOW_STEP_LABELS = [
'chat.shippingNoticeUi.stage.intakeParse',
'chat.shippingNoticeUi.stage.orderReview',
'chat.shippingNoticeUi.stage.fulfillmentPrep',
'chat.shippingNoticeUi.stage.freightUpload',
'chat.shippingNoticeUi.stage.uploadComplete',
] as const;
@@ -90,7 +91,7 @@ const PROCESSING_STAGE_INDEX_MAP: Record<string, number> = {
inventory_matching: 2,
excel_generating: 2,
freight_uploading: 3,
completed: 3,
completed: 4,
};
/**
@@ -163,7 +163,7 @@ export interface ShippingProcessingPrimaryAction {
}
/** 订单生命周期工作台的后端目标阶段。 */
export type LifecycleWorkbenchStage = 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete';
export type LifecycleWorkbenchStage = 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'freight_upload' | 'upload_complete';
/** 文件级生命周期入口;状态、目标均由后端裁决。 */
export interface ShippingProcessingLifecycleEntry {
@@ -678,9 +678,23 @@ export interface ConversationProcessingProjection {
cancelled: ConversationProcessingUserTask[];
archived: ConversationProcessingUserTask[];
};
/** 会话批次主进度;后端已将技术阶段折叠为四个业务节点。 */
/** 会话批次主进度;后端已将技术阶段折叠为五个业务节点。 */
lifecycle_nodes?: Array<{
code: LifecycleWorkbenchStage;
label_key: string;
status: 'passed' | 'running' | 'blocked' | 'pending';
summary?: {
total: number;
completed: number;
needs_action: number;
processing: number;
failed: number;
blocking_reason?: ShippingProcessingBlockingReason | null;
};
}>;
/** @deprecated 兼容旧客户端;当前值同 lifecycle_nodes,已包含五阶段。 */
four_stage_nodes?: Array<{
code: 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete';
code: LifecycleWorkbenchStage;
label_key: string;
status: 'passed' | 'running' | 'blocked' | 'pending';
/** 批次阶段摘要由后端按完整叶子工作项裁决,禁止页面从筛选结果反算。 */
@@ -693,7 +707,7 @@ export interface ConversationProcessingProjection {
blocking_reason?: ShippingProcessingBlockingReason | null;
};
}>;
/** 后端无法归类到四阶段的业务文件数量;页面只提示,不擅自归类。 */
/** 后端无法归类到五阶段的业务文件数量;页面只提示,不擅自归类。 */
unclassified_summary?: { count: number };
/** 批次级用户态:状态、问题与可操作动作必须来自同一次后端裁决。 */
ui_state?: ConversationProcessingUiState;
@@ -711,8 +725,8 @@ export interface ConversationProcessingProjection {
export interface ConversationProcessingUiState {
status: ShippingUserProcessingStatus;
stage: string;
/** 后端从技术节点裁决的四阶段业务编码,批次中心与工作台共同消费。 */
lifecycleStage?: 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete';
/** 后端从技术节点裁决的五阶段业务编码,批次中心与工作台共同消费。 */
lifecycleStage?: LifecycleWorkbenchStage;
lifecycleEntries?: ShippingProcessingLifecycleEntry[];
blocking_reason: ShippingProcessingBlockingReason | null;
primary_action: ShippingProcessingPrimaryAction | null;
@@ -1445,7 +1459,7 @@ export interface ShippingTaskUiState {
primary?: ShippingUnifiedAction | null;
secondary?: ShippingUnifiedAction[];
};
/** 四阶段工作台只读事实;由后端 ui_state 投影,不参与状态或权限裁决。 */
/** 五阶段工作台只读事实;由后端 ui_state 投影,不参与状态或权限裁决。 */
stage_context?: {
preparation?: {
status?: 'processing' | 'blocked' | 'ready' | string;
@@ -1483,6 +1497,14 @@ export interface ShippingTaskUiState {
} | null;
upload?: {
outcome?: 'not_started' | 'running' | 'awaiting_manual' | 'succeeded' | 'failed' | 'unknown' | string;
/** 仅 upload_complete 工作面读取的、后端验证过的成功上传事实。 */
succeeded_attempt?: {
id?: number | null;
status?: string | null;
mode?: string | null;
freight_ref_no?: string | null;
finished_at?: string | null;
} | null;
latest_attempt?: {
id?: number | null;
status?: string | null;
@@ -2255,6 +2277,8 @@ export interface ShippingOrderReviewCaseSummary {
draft_version?: number | null;
issue_count: number;
available_actions: string[];
/** 仅 parse_failed 时由后端下发,供当前阶段卡调用原 Intake retry API。 */
intake_no?: string | null;
source_run_no?: string | null;
}
@@ -2435,7 +2459,8 @@ export interface ShippingOrderReviewBuildEligibilityIssue {
}
export interface ShippingOrderReviewBuildEligibility {
can_build: boolean;
/** 未执行校验时为 null;只有 validated/needs_review 才返回布尔结论。 */
can_build: boolean | null;
can_auto_create?: boolean;
status: string;
gates?: Record<string, boolean>;
@@ -2632,6 +2657,8 @@ export interface ShippingOrderReviewCase {
build_eligibility?: ShippingOrderReviewBuildEligibility;
} | null;
available_actions: string[];
/** 仅 parse_failed 时由后端下发,供当前阶段卡调用原 Intake retry API。 */
intake_no?: string | null;
/** 正式任务 Schema 放行可写字段 field_id;confirmed + edit_formal_task 时由后端投影。 */
formal_editable_field_ids?: string[];
/** 关联 Notice 的 order_data_version;formal patch 乐观锁。 */
@@ -2936,6 +2963,14 @@ export interface ShippingOrderReviewProfileMatchCandidate {
hard_match?: boolean | null;
reason_codes?: string[];
missing_required_anchor_ids?: string[];
/** 管理员技术详情:共同 matcher 已确认的受限平移,不含正文或完整坐标。 */
coordinate_transform?: {
status: 'applied' | 'unavailable' | 'rejected' | string;
translate_x?: number | null;
translate_y?: number | null;
anchor_ids?: string[];
reason_codes?: string[];
} | null;
}
/** 建单前文档模板匹配只读投影。 */
@@ -21,6 +21,7 @@ import {
retryWorkspaceShippingOrderStpAutoCreate,
retryWorkspaceShippingTask,
retryWorkspaceShippingTaskLine,
retryShippingNoticeIntake,
} from '@/features/chat/api/shipping.api';
const { downloadWorkspaceShippingLineInventoryFileMock } = vi.hoisted(() => ({
@@ -111,6 +112,7 @@ const shippingProcessingProjection = ref<Record<string, any> | null>(null);
/** 正式任务投影的请求中状态;用于覆盖 Case 先到、Projection 后到的过渡窗口。 */
const shippingProcessingLoading = ref(false);
const intakeParseContext = ref<Record<string, any> | null>(null);
const requestedCaseNo = ref<string | null>(null);
/** 每个用例必须从独立的 Case 图快照开始,避免嵌套 schema/draft 被浅拷贝污染。 */
function createActiveCaseFixture() {
@@ -177,6 +179,7 @@ vi.mock('@/features/chat/api/shipping.api', async (importOriginal) => {
job_id: 901,
case: null,
}),
retryShippingNoticeIntake: vi.fn().mockResolvedValue({ intake_no: 'SNI-RETRY-1', parse_status: 'queued' }),
getWorkspaceShippingTask: vi.fn().mockResolvedValue({
task_no: 'SN-MOCK',
status: 'created',
@@ -229,7 +232,7 @@ function createReviewComposableMock() {
loadFailed: ref(false),
caseSwitchLoading: ref(false),
caseSwitchFailed: ref(false),
requestedCaseNo: ref(null),
requestedCaseNo,
saving: ref(false),
validationInProgress: ref(false),
saveFailed: ref(false),
@@ -587,6 +590,7 @@ async function mountView(query: Record<string, string> = {}) {
intake_parse: '接收解析',
order_review: '订单复核',
fulfillment_prep: '通知准备',
freight_upload: '货代上传',
upload_complete: '通知完成',
},
prepare: {
@@ -665,6 +669,7 @@ async function mountView(query: Record<string, string> = {}) {
/** 将共享 Case fixture 恢复为可编辑草稿,避免跨用例污染确认恢复态。 */
function resetActiveCaseFixture() {
activeCase.value = createActiveCaseFixture();
requestedCaseNo.value = null;
shippingProcessingProjection.value = null;
shippingProcessingLoading.value = false;
intakeParseContext.value = null;
@@ -679,6 +684,20 @@ describe('ShippingOrderReviewView layout phase 1', () => {
reviewProgressContext.value = null;
});
it('keeps the requested replacement Case when the loaded Run updates the URL', async () => {
// 关键断言:新版 Run 先到而旧 URL Case 仍在时,不能拼出 RUN-NEW + CASE-OLD。
const wrapper = await mountView({ case_no: 'CASE-OLD' });
requestedCaseNo.value = 'CASE-NEW';
reviewRun.value = {
...reviewRun.value,
run_no: 'RUN-NEW',
};
await flushPromises();
expect((wrapper.vm as any).$route.query.run_no).toBe('RUN-NEW');
expect((wrapper.vm as any).$route.query.case_no).toBe('CASE-NEW');
});
it('uses the current-task card as the only Gate action entry for every formal-OT Gate', async () => {
activeCase.value = {
...activeCase.value,
@@ -1031,7 +1050,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
const shell = wrapper.get('[data-testid="review-workbench-ot-shell"]');
const navigation = wrapper.get('[data-testid="review-document-navigation"]');
// 2–4 文件不浪费一列宽度,但必须在四阶段前完成文件选择。
// 2–4 文件不浪费一列宽度,但必须在五阶段前完成文件选择。
expect(navigation.attributes('data-nav-mode')).toBe('tabs');
expect(shell.classes()).toContain('contents');
expect(wrapper.html().indexOf('review-document-navigation'))
@@ -1082,6 +1101,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
lifecycleEntries: [
{ code: 'order_review', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
},
@@ -1115,7 +1135,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
const wrapper = await mountView({ lifecycle_stage: 'order_review' });
await flushPromises();
for (const code of ['order_review', 'fulfillment_prep', 'upload_complete']) {
for (const code of ['order_review', 'fulfillment_prep', 'freight_upload', 'upload_complete']) {
const stage = wrapper.get(`[data-testid="review-lifecycle-stage-${code}"]`);
expect(stage.findAll('button')[1].attributes('disabled')).toBeDefined();
}
@@ -1136,6 +1156,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
{ code: 'intake_parse', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'order_review', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
}],
@@ -1151,6 +1172,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
{ code: 'intake_parse', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'order_review', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
}],
@@ -1178,6 +1200,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
{ code: 'intake_parse', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'order_review', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
}],
@@ -1193,6 +1216,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
{ code: 'intake_parse', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'order_review', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
}],
@@ -1236,6 +1260,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
{ code: 'intake_parse', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'order_review', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
}],
@@ -1322,6 +1347,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
{ code: 'intake_parse', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'order_review', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
},
@@ -1506,6 +1532,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
lifecycleEntries: [
{ code: 'order_review', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
blocking_reason: null,
@@ -1587,7 +1614,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
expect(wrapper.get('[data-testid="review-lifecycle-fulfillment-prep"]').text()).toContain('3');
expect(wrapper.find('[data-testid="review-fulfillment-prep-workspace"]').exists()).toBe(true);
expect(messageMocks.warning).not.toHaveBeenCalledWith('处理结果尚未生成');
// 通知准备工作区必须属于四阶段导航的下方主区,不能仍停留在导航之前的状态摘要区。
// 通知准备工作区必须属于五阶段导航的下方主区,不能仍停留在导航之前的状态摘要区。
expect(wrapper.html().indexOf('review-lifecycle-workbench-header'))
.toBeLessThan(wrapper.html().indexOf('review-fulfillment-prep-workspace'));
});
@@ -1760,6 +1787,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
lifecycle_entries: [
{ code: 'order_review', state: 'available', target_surface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'current', target_surface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', target_surface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', target_surface: 'order_lifecycle_workbench' },
],
},
@@ -1802,7 +1830,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
expect(wrapper.get('[data-testid="review-footer-actions"]').text()).toContain('保存订单并校验');
});
it('keeps backend-authorized manual upload registration out of the upload main area', async () => {
it('keeps notification completion read-only even when an obsolete manual-upload action arrives', async () => {
const originalQueue = reviewQueue.value;
try {
activeCase.value = {
@@ -1817,6 +1845,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
{ code: 'intake_parse', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'order_review', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'current', targetSurface: 'order_lifecycle_workbench' },
],
}],
@@ -1836,7 +1865,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
actions: {
primary: {
code: 'mark_manual_uploaded', kind: 'forward', enabled: true,
target_surface: 'upload_complete',
target_surface: 'freight_upload',
target_anchor: 'manual_upload',
requires_confirmation: false,
},
@@ -1847,8 +1876,9 @@ describe('ShippingOrderReviewView layout phase 1', () => {
} as any);
const withAuthorization = await mountView({ lifecycle_stage: 'upload_complete' });
await flushPromises();
// Gate 写操作只在右侧“当前任务”显示;主区只保留上传事实与审计摘要。
// 完成面必须屏蔽迟到的 Gate 写操作;主区只保留验证成功事实与审计摘要。
expect(withAuthorization.find('[data-testid="review-lifecycle-upload-manual"]').exists()).toBe(false);
expect(withAuthorization.find('[data-testid="review-current-task-primary-action"]').exists()).toBe(false);
// 正式动作直接提交当前 Gate,不允许无界面 TaskTodoPanel 作为隐藏执行器。
expect((withAuthorization.vm as { formalTodoPanelRef?: unknown }).formalTodoPanelRef).toBeUndefined();
} finally {
@@ -1856,7 +1886,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
}
});
it('opens the page-level evidence dialog when the authorized current-task action is manual upload', async () => {
it('opens the page-level evidence dialog from freight upload when the current-task action is manual upload', async () => {
activeCase.value = {
...activeCase.value,
status: 'confirmed', confirmed_task_no: 'SN-UPLOAD-DIALOG', confirmed_task_id: 19, has_formal_ot: true,
@@ -1869,7 +1899,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
primary: {
code: 'mark_manual_uploaded', kind: 'forward', enabled: true,
dispatch: 'dialog', ui_handler: 'manual_upload_evidence',
target_surface: 'upload_complete', target_anchor: 'manual_upload',
target_surface: 'freight_upload', target_anchor: 'manual_upload',
requires_confirmation: false,
},
secondary: [],
@@ -1878,7 +1908,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
},
} as any);
const wrapper = await mountView({ lifecycle_stage: 'upload_complete' });
const wrapper = await mountView({ lifecycle_stage: 'freight_upload' });
await flushPromises();
await wrapper.get('[data-testid="review-current-task-primary-action"]').trigger('click');
await flushPromises();
@@ -1886,7 +1916,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
expect(wrapper.find('[data-testid="manual-upload-evidence-dialog"]').exists()).toBe(true);
});
it('renders the authorized Excel download in every upload-complete order line instead of the task rail', async () => {
it('renders the authorized Excel download in every freight-upload order line instead of the task rail', async () => {
activeCase.value = {
...activeCase.value,
status: 'confirmed', confirmed_task_no: 'SN-DOWNLOAD-DISPATCH', confirmed_task_id: 20, has_formal_ot: true,
@@ -1926,26 +1956,26 @@ describe('ShippingOrderReviewView layout phase 1', () => {
secondary: [{
code: 'download_excel', label: '下载 Excel', kind: 'view', enabled: true,
dispatch: 'view', ui_handler: 'excel_download',
target_surface: 'upload_complete', target_anchor: 'excel_artifact',
target_surface: 'freight_upload', target_anchor: 'excel_artifact',
requires_confirmation: false,
}],
},
lifecycle_stage: 'upload_complete',
lifecycle_entries: [{ code: 'upload_complete', state: 'current' }],
lifecycle_stage: 'freight_upload',
lifecycle_entries: [{ code: 'freight_upload', state: 'current' }],
process_gate: { execution_no: 'EXEC-DOWNLOAD-DISPATCH' }, summary: {}, steps: [],
},
} as any);
const wrapper = await mountView({ lifecycle_stage: 'upload_complete' });
const wrapper = await mountView({ lifecycle_stage: 'freight_upload' });
await flushPromises();
const rows = wrapper.findAll('[data-testid="review-upload-complete-line"]');
const rows = wrapper.findAll('[data-testid="review-freight-upload-line"]');
expect(rows).toHaveLength(2);
expect(rows[0].text()).toContain('PN-ONE');
expect(rows[1].text()).toContain('PN-TWO');
expect(wrapper.find('[data-testid="review-current-task-recovery-download_excel"]').exists()).toBe(false);
await wrapper.get('[data-testid="review-upload-complete-download-LINE-1"]').trigger('click');
await wrapper.get('[data-testid="review-freight-upload-download-LINE-1"]').trigger('click');
await flushPromises();
// 下载是 Artifact 只读操作;订单行不按 PO 聚合,且不得伪装成 Gate mutation。
@@ -1969,6 +1999,7 @@ describe('ShippingOrderReviewView layout phase 1', () => {
{ code: 'intake_parse', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'order_review', state: 'available', targetSurface: 'order_lifecycle_workbench' },
{ code: 'fulfillment_prep', state: 'current', targetSurface: 'order_lifecycle_workbench' },
{ code: 'freight_upload', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
{ code: 'upload_complete', state: 'unavailable', targetSurface: 'order_lifecycle_workbench' },
],
}],
@@ -2103,6 +2134,104 @@ describe('ShippingOrderReviewView layout phase 1', () => {
expect(wrapper.find('[data-testid="review-lifecycle-upload-download"]').exists()).toBe(false);
});
it('retries the server-authorized failed Intake from the current lifecycle card and refreshes projections', async () => {
const originalQueue = reviewQueue.value;
try {
activeCase.value = {
...activeCase.value,
available_actions: ['retry_parse'],
intake_no: 'SNI-RETRY-1',
};
reviewQueue.value = {
...reviewQueue.value,
items: [{
...reviewQueue.value.items[0],
lifecycle_stage: 'intake_parse',
lifecycle_entries: [],
intake_parse_authorized: true,
available_actions: ['retry_parse'],
intake_no: 'SNI-RETRY-1',
}],
};
const wrapper = await mountView({ lifecycle_stage: 'intake_parse' });
// 关键断言:已发送 EML 的恢复从当前阶段卡执行,并且使用服务端下发的原 SNI。
await wrapper.get('[data-testid="review-lifecycle-stage-retry-parse"]').trigger('click');
await flushPromises();
expect(retryShippingNoticeIntake).toHaveBeenCalledWith('SNI-RETRY-1');
expect(reloadLatestDraftMock).toHaveBeenCalled();
expect(refreshShippingProcessingMock).toHaveBeenCalled();
} finally {
reviewQueue.value = originalQueue;
}
});
it('does not show intake retry while parsing or after cancellation', async () => {
const originalQueue = reviewQueue.value;
try {
reviewQueue.value = {
...reviewQueue.value,
items: [{
...reviewQueue.value.items[0], lifecycle_stage: 'intake_parse', lifecycle_entries: [], intake_parse_authorized: true,
}],
};
for (const status of ['parsing', 'cancelled']) {
activeCase.value = { ...activeCase.value, status, available_actions: [], intake_no: null };
const wrapper = await mountView({ lifecycle_stage: 'intake_parse' });
// 关键断言:运行中等待超时回收,取消态不可复活,均无 retry_parse 入口。
expect(wrapper.find('[data-testid="review-lifecycle-stage-retry-parse"]').exists()).toBe(false);
}
} finally {
reviewQueue.value = originalQueue;
}
});
it('renders completion evidence only from the verified succeeded attempt', async () => {
activeCase.value = {
...activeCase.value,
status: 'confirmed', confirmed_task_no: 'SN-VERIFIED-EVIDENCE', confirmed_task_id: 22, has_formal_ot: true,
};
const taskApi = await import('@/features/chat/api/shipping.api');
vi.mocked(taskApi.getWorkspaceShippingTask).mockResolvedValue({
task_no: 'SN-VERIFIED-EVIDENCE', status: 'completed', upload_status: 'uploaded', lines: [], events: [],
ui_state: {
lifecycle_stage: 'upload_complete',
lifecycle_entries: [
{ code: 'intake_parse', state: 'available' },
{ code: 'order_review', state: 'available' },
{ code: 'fulfillment_prep', state: 'available' },
{ code: 'freight_upload', state: 'available' },
{ code: 'upload_complete', state: 'current' },
],
actions: {
primary: {
code: 'mark_manual_uploaded', kind: 'forward', enabled: true,
dispatch: 'dialog', ui_handler: 'manual_upload_evidence',
},
secondary: [],
},
stage_context: {
upload: {
latest_attempt: { status: 'failed', mode: 'rpa', freight_ref_no: 'LATEST-FAILED' },
succeeded_attempt: { status: 'succeeded', mode: 'manual', freight_ref_no: 'VERIFIED-REF' },
},
},
summary: {}, steps: [],
},
} as any);
const wrapper = await mountView({ lifecycle_stage: 'upload_complete' });
await flushPromises();
const evidence = wrapper.get('[data-testid="review-lifecycle-upload-complete"]');
expect(evidence.text()).toContain('VERIFIED-REF');
expect(evidence.text()).toContain('succeeded');
expect(evidence.text()).not.toContain('LATEST-FAILED');
expect(evidence.text()).not.toContain('failed');
expect(wrapper.find('[data-testid="review-current-task-primary-action"]').exists()).toBe(false);
expect(wrapper.find('[data-testid="review-current-processing-retry"]').exists()).toBe(false);
});
it('renders empty optional schema fields as editable line columns', async () => {
const wrapper = await mountView();
const inputs = wrapper.findAll('[data-testid="review-line-field-input"]');
@@ -1,6 +1,6 @@
<!--
features/chat/views/ShippingOrderReviewView.vue
用途:建单前/正式任务「订单生命周期工作台」(主编辑区 + 四阶段导航 + 工作台侧栏 + workbenchMode)。
用途:建单前/正式任务「订单生命周期工作台」(主编辑区 + 五阶段导航 + 工作台侧栏 + workbenchMode)。
依赖:路由参数、useShippingOrderReview、ReviewWorkbenchHeader/Footer、ReviewDocumentNavigation、
ReviewProcessDetailDrawer、ReviewUnsavedSwitchDialog、
ReviewWorkbenchModeToggle、ReviewDocumentEvidenceDrawer、ReviewVersionHistoryDrawer、
@@ -31,6 +31,7 @@ import {
retryWorkspaceShippingOrderStpAutoCreate,
retryWorkspaceShippingTask,
retryWorkspaceShippingTaskLine,
retryShippingNoticeIntake,
decideWorkspaceShippingOrderReviewLineFulfillment,
viewWorkspaceShippingOrderReviewHighlightDiagnostic,
} from '../api/shipping.api';
@@ -217,6 +218,7 @@ const LIFECYCLE_STAGE_CODES: ReviewLifecycleStageCode[] = [
'intake_parse',
'order_review',
'fulfillment_prep',
'freight_upload',
'upload_complete',
];
@@ -322,7 +324,40 @@ const isLifecycleIntakeParse = computed(() => (
lifecycleActiveStageCode.value === 'intake_parse' && intakeParseContextAuthorized.value
));
const isLifecycleFulfillmentPrep = computed(() => lifecycleActiveStageCode.value === 'fulfillment_prep');
const isLifecycleFreightUpload = computed(() => lifecycleActiveStageCode.value === 'freight_upload');
const isLifecycleUploadComplete = computed(() => lifecycleActiveStageCode.value === 'upload_complete');
/** 当前阶段重试只取 Case 的服务端授权,不从输入框附件卡或本地状态推断。 */
const intakeParseRetryAvailable = computed(() => (
isLifecycleIntakeParse.value
&& (activeCase.value?.available_actions || []).includes('retry_parse')
&& Boolean(String(activeCase.value?.intake_no || '').trim())
));
const intakeParseRetrying = ref(false);
/**
* 对已发送文件重投原 Intake 的解析任务。
* 成功后同步 Case、统一处理投影并重新读取 Intake 上下文;后端状态会转为 queued,
* 原有 polling 会继续推进,运行中不再展示 retry_parse。
*/
async function retryCurrentIntakeParse(): Promise<void> {
const intakeNo = String(activeCase.value?.intake_no || '').trim();
if (!intakeParseRetryAvailable.value || !intakeNo || intakeParseRetrying.value) return;
intakeParseRetrying.value = true;
try {
await retryShippingNoticeIntake(intakeNo);
await Promise.all([
reloadLatestDraft(),
refreshShippingProcessing(),
activeCase.value?.case_no
? ensureIntakeParseContextLoaded(activeCase.value.case_no)
: Promise.resolve(false),
]);
} catch (error) {
msg.warning(error instanceof Error ? error.message : t('chat.shippingNoticeRetryParse'));
} finally {
intakeParseRetrying.value = false;
}
}
/**
* 只切换前端工作面并同步可分享深链;禁止在导航点击中修改任何订单生命周期字段。
@@ -508,10 +543,10 @@ const formalTaskActions = computed(() => {
});
/**
* 通知完成明细的只读 Excel 动作。
* 货代上传工作面的 Excel 下载动作。
*
* Artifact 下载由后端 ui_state.actions 授权;它属于订单行结果表的行内操作,
* 不与右侧当前任务的 Gate 动作混排。每个行入口下载同一正式任务已校验的 Excel。
* Artifact 下载由后端 ui_state.actions 授权;它属于货代上传工作面,
* 不与只读成功证据或右侧当前任务 Gate 动作混排。
*/
const uploadCompletionExcelDownloadAction = computed(() => formalTaskActions.value.find((action) => (
action.enabled
@@ -573,6 +608,22 @@ const currentTaskRecoveryActions = computed(() => {
})).filter((action) => action.code)
});
/**
* 已验证的通知完成面只展示成功证据,不能因迟到或历史 Gate 动作再次提供写入口。
* 核心逻辑:货代上传工作面仍原样消费后端授权动作;完成面只把动作降为只读,
* 不修改服务端授权,也不根据客户端状态推导新的操作。
* @returns 当前工作面允许交给 ReviewCurrentProcessingCard 展示的动作。
*/
const visibleCurrentTaskPrimaryAction = computed(() => (
isLifecycleUploadComplete.value ? null : currentTaskPrimaryAction.value
));
const visibleCurrentTaskRecoveryActions = computed(() => (
isLifecycleUploadComplete.value ? [] : currentTaskRecoveryActions.value
));
const visibleCurrentTaskRetryable = computed(() => (
isLifecycleUploadComplete.value ? false : currentTaskRetryable.value
));
/** 管理员诊断:后端 technical_progress / automation.technical 仅 admin 投影。 */
const showAdminTaskMissingDiagnosis = computed(() => (
Boolean(displayCase.value?.task_missing)
@@ -1898,7 +1949,7 @@ const showWorkbenchGrid = computed(
const headerSchemaFields = computed(() => (displayCase.value?.schema.fields || []).filter((field) => field.scope === 'header'));
const lineSchemaFields = computed(() => (displayCase.value?.schema.fields || []).filter((field) => field.scope === 'line'));
/** 通知完成仅展示订单行的核心识别字段,字段值始终按当前行的 line_key 读取。 */
/** 货代上传仅展示订单行的核心识别字段,字段值始终按当前行的 line_key 读取。 */
const uploadCompletionLineFields = computed(() => {
const codes = ['line_no', 'part_number', 'quantity'];
return codes.map((code) => lineSchemaFields.value.find((field) => field.field_code === code))
@@ -2106,7 +2157,7 @@ async function retryFormalPreparationLine(lineKey: string) {
}
/**
* 人工上传登记是后端 Gate 的受控写动作;仅进入「通知完成」工作面不构成授权。
* 人工上传登记是后端 Gate 的受控写动作;仅进入「货代上传」工作面不构成授权。
* 任务详情与批次中心共用 ui_state.actions,避免页面按上传状态或生命周期自行放行。
*/
const manualUploadRegistrationAuthorized = computed(() => {
@@ -3308,6 +3359,7 @@ watch(
if (resolvedRunNo && resolvedRunNo !== runNo.value) {
const resolvedCaseNo = String(
pendingCrossRunCaseNo.value
|| requestedCaseNo.value
|| route.query.case_no
|| route.query.case
|| activeCase.value?.case_no
@@ -3464,8 +3516,11 @@ watch(
<ReviewLifecycleStageNavigation
:stages="lifecycleStageItems"
:active-code="lifecycleActiveStageCode"
:available-actions="activeCase?.available_actions || []"
:retrying="intakeParseRetrying"
@select="(code) => { void selectLifecycleStage(code); }"
@open-detail="() => { processDetailOpen = true; }"
@retry-parse="() => void retryCurrentIntakeParse()"
/>
</div>
</div>
@@ -3543,11 +3598,11 @@ watch(
:automation="displayCase?.automation"
:show-retry="showObjectRetryOnRail"
:user-status="currentTaskUserStatus"
:retryable="currentTaskRetryable"
:retryable="visibleCurrentTaskRetryable"
:blocking-reason="currentTaskBlockingReason"
:gate-status="currentTaskGateStatus"
:primary-action="currentTaskPrimaryAction"
:recovery-actions="currentTaskRecoveryActions"
:primary-action="visibleCurrentTaskPrimaryAction"
:recovery-actions="visibleCurrentTaskRecoveryActions"
:retrying="taskRetryButtonDisabled || progressRetrying || caseSwitchLoading"
:loading="caseContentSkeleton || formalTaskProjectionPending"
@retry="() => void (hasFormalOt ? retryFormalOtAutoProgress() : retryStpAutoCreate())"
@@ -3642,14 +3697,14 @@ watch(
</section>
<section
v-if="hasCreatedShippingTask && formalTaskDetail && isLifecycleUploadComplete"
v-if="hasCreatedShippingTask && formalTaskDetail && isLifecycleFreightUpload"
class="rounded-xl border border-default bg-surface p-3"
data-testid="review-lifecycle-upload-complete"
data-testid="review-lifecycle-freight-upload"
>
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
<h2 class="text-sm font-semibold text-primary">{{ t('chat.shippingOrderReview.lifecycle.upload.title') }}</h2>
<p class="mt-1 text-xs text-secondary">{{ t('chat.shippingOrderReview.lifecycle.upload.subtitle') }}</p>
<h2 class="text-sm font-semibold text-primary">{{ t('chat.shippingOrderReview.lifecycle.freightUpload.title') }}</h2>
<p class="mt-1 text-xs text-secondary">{{ t('chat.shippingOrderReview.lifecycle.freightUpload.subtitle') }}</p>
</div>
<span class="rounded-full bg-surface-muted px-2 py-1 text-xs text-secondary">{{ formalTaskDetail.upload_status || '-' }}</span>
</div>
@@ -3658,7 +3713,7 @@ watch(
<p v-if="formalTaskDetail.ui_state?.stage_context?.upload?.latest_attempt" class="mt-1">{{ t('chat.shippingOrderReview.lifecycle.upload.attempt', { status: formalTaskDetail.ui_state.stage_context.upload.latest_attempt.status || '-', mode: formalTaskDetail.ui_state.stage_context.upload.latest_attempt.mode || '-' }) }}</p>
<p v-if="formalTaskDetail.ui_state?.stage_context?.upload?.latest_attempt?.error_code" class="mt-1 text-rose-700 dark:text-rose-300">{{ formalTaskDetail.ui_state.stage_context.upload.latest_attempt.error_code }}</p>
</div>
<div v-if="displayDraftLines.length" class="mt-3 overflow-x-auto" data-testid="review-upload-complete-lines">
<div v-if="displayDraftLines.length" class="mt-3 overflow-x-auto" data-testid="review-freight-upload-lines">
<table class="min-w-full text-left text-xs">
<thead class="border-b border-default bg-surface-muted/50 text-secondary">
<tr>
@@ -3673,7 +3728,7 @@ watch(
v-for="line in displayDraftLines"
:key="String(line.line_key)"
class="border-b border-default last:border-0"
data-testid="review-upload-complete-line"
data-testid="review-freight-upload-line"
>
<td class="px-3 py-2 font-medium text-primary">{{ processDetailPoNumber || '—' }}</td>
<td v-for="field in uploadCompletionLineFields" :key="field.field_id" class="px-3 py-2">{{ lineFieldDisplayValue(line, field) || '—' }}</td>
@@ -3683,7 +3738,7 @@ watch(
v-if="uploadCompletionExcelDownloadAction"
type="button"
class="rounded border border-brand-200 px-2 py-1 font-medium text-brand-700 hover:bg-brand-50 disabled:opacity-50 dark:border-brand-800 dark:text-brand-200 dark:hover:bg-brand-950/40"
:data-testid="`review-upload-complete-download-${line.line_key}`"
:data-testid="`review-freight-upload-download-${line.line_key}`"
:disabled="saving"
@click="void executeFormalTaskAction(uploadCompletionExcelDownloadAction, {})"
>
@@ -3696,6 +3751,19 @@ watch(
</div>
</section>
<section
v-if="hasCreatedShippingTask && formalTaskDetail && isLifecycleUploadComplete"
class="rounded-xl border border-emerald-200 bg-emerald-50/40 p-3 dark:border-emerald-900 dark:bg-emerald-950/20"
data-testid="review-lifecycle-upload-complete"
>
<h2 class="text-sm font-semibold text-primary">{{ t('chat.shippingOrderReview.lifecycle.uploadComplete.title') }}</h2>
<p class="mt-1 text-xs text-secondary">{{ t('chat.shippingOrderReview.lifecycle.uploadComplete.subtitle') }}</p>
<div class="mt-3 rounded-lg border border-emerald-200 bg-surface/70 p-3 text-xs text-secondary dark:border-emerald-900">
<p>{{ t('chat.shippingOrderReview.lifecycle.upload.receipt', { value: formalTaskDetail.ui_state?.stage_context?.upload?.succeeded_attempt?.freight_ref_no || '-' }) }}</p>
<p v-if="formalTaskDetail.ui_state?.stage_context?.upload?.succeeded_attempt" class="mt-1">{{ t('chat.shippingOrderReview.lifecycle.upload.attempt', { status: formalTaskDetail.ui_state.stage_context.upload.succeeded_attempt.status || '-', mode: formalTaskDetail.ui_state.stage_context.upload.succeeded_attempt.mode || '-' }) }}</p>
</div>
</section>
<ReviewIntakeParsePanel
v-if="isLifecycleIntakeParse"
:context="intakeParseContext"
@@ -4138,11 +4206,11 @@ watch(
:has-formal-ot="shippingProcessingProjection?.hasFormalOt ?? hasFormalOt"
:shipping-notice-no="shippingProcessingProjection?.shippingNoticeNo ?? confirmedNoticeTaskNo"
:user-status="currentTaskUserStatus"
:retryable="currentTaskRetryable"
:retryable="visibleCurrentTaskRetryable"
:blocking-reason="currentTaskBlockingReason"
:gate-status="currentTaskGateStatus"
:primary-action="currentTaskPrimaryAction"
:recovery-actions="currentTaskRecoveryActions"
:primary-action="visibleCurrentTaskPrimaryAction"
:recovery-actions="visibleCurrentTaskRecoveryActions"
:retrying="taskRetryButtonDisabled || progressRetrying || caseSwitchLoading"
:loading="caseContentSkeleton || formalTaskProjectionPending"
@retry="() => void (hasFormalOt ? retryFormalOtAutoProgress() : retryStpAutoCreate())"
@@ -162,10 +162,11 @@ function toItem(
actionCode: code,
labelKey,
targetLifecycleStage: (
targetLifecycleStage === 'intake_parse'
|| targetLifecycleStage === 'order_review'
|| targetLifecycleStage === 'fulfillment_prep'
|| targetLifecycleStage === 'upload_complete'
targetLifecycleStage === 'intake_parse'
|| targetLifecycleStage === 'order_review'
|| targetLifecycleStage === 'fulfillment_prep'
|| targetLifecycleStage === 'freight_upload'
|| targetLifecycleStage === 'upload_complete'
) ? targetLifecycleStage : null,
};
}
@@ -1,6 +1,6 @@
<!--
features/shipping-progress/components/WorkbenchProgressGrouped.vue
用途:任务台四阶段进度——接收解析 / 订单复核 / 通知准备 / 通知完成;可选动作栏。
用途:任务台五阶段进度——接收解析 / 订单复核 / 通知准备 / 货代上传 / 通知完成;可选动作栏。
依赖:vue-i18n、ShippingProcessingProjection、UnifiedProgressTrack、UnifiedActionBar。
逻辑:由 ShippingTaskWorkbench 挂载;任务台履约动作归 TaskTodoPanel,默认关闭本组件动作栏(UI-05)。
-->
@@ -14,8 +14,8 @@ import type { ActionPresentationItem } from '../types';
import UnifiedActionBar from './UnifiedActionBar.vue';
import UnifiedProgressTrack from './UnifiedProgressTrack.vue';
type FourStageNode = {
code: 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete';
type LifecycleNode = {
code: 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'freight_upload' | 'upload_complete';
status: 'passed' | 'running' | 'blocked' | 'pending';
};
@@ -23,10 +23,12 @@ const props = withDefaults(defineProps<{
projection: ShippingProcessingProjection;
/** 是否渲染投影动作栏;任务台内嵌时应为 false,避免与 TaskTodoPanel 双入口。 */
showActions?: boolean;
/** 是否允许展开技术 15 节点;批次中心只展示业务四阶段。 */
/** 是否允许展开技术 15 节点;批次中心只展示业务五阶段。 */
showTechnicalDetail?: boolean;
/** 后端已折叠的四阶段节点;缺失时 fail-closed,不从 15 阶重算。 */
fourStageNodes?: FourStageNode[] | null;
/** 后端已折叠的五阶段节点;缺失时 fail-closed,不从 15 阶重算。 */
lifecycleNodes?: LifecycleNode[] | null;
/** @deprecated 一次发布兼容旧调用方;值与 lifecycleNodes 相同,后者存在时优先。 */
fourStageNodes?: LifecycleNode[] | null;
}>(), {
showActions: true,
showTechnicalDetail: true,
@@ -41,15 +43,20 @@ const showDetailTrack = ref(false);
const projectionRef = computed(() => props.projection);
const actionPresentation = useProcessingActionPresentation(projectionRef, { surface: 'workbench' });
const DOMAIN_LABELS: Record<FourStageNode['code'], string> = {
const DOMAIN_LABELS: Record<LifecycleNode['code'], string> = {
intake_parse: '接收解析',
order_review: '订单复核',
fulfillment_prep: '通知准备',
freight_upload: '货代上传',
upload_complete: '通知完成',
};
// 四阶段是后端从正式 Gate/work_items 裁决后的业务投影;这里不再由 15 阶技术节点聚合。
const domainSummaries = computed(() => Array.isArray(props.fourStageNodes) ? props.fourStageNodes : []);
// 五阶段是后端从正式 Gate/work_items 裁决后的业务投影;这里不再由 15 阶技术节点聚合。
const domainSummaries = computed(() => (
Array.isArray(props.lifecycleNodes)
? props.lifecycleNodes
: (Array.isArray(props.fourStageNodes) ? props.fourStageNodes : [])
));
/**
* 判断某域是否为当前/已过/未到。
@@ -57,7 +64,7 @@ const domainSummaries = computed(() => Array.isArray(props.fourStageNodes) ? pro
/**
* 域标签样式。
*/
function domainClass(state: FourStageNode['status']): string {
function domainClass(state: LifecycleNode['status']): string {
if (state === 'passed') return 'border-emerald-200 bg-emerald-50 text-emerald-800';
if (state === 'blocked') return 'border-amber-300 bg-amber-50 text-amber-900';
if (state === 'running') return 'border-brand-300 bg-brand-50 text-brand-800';
@@ -82,7 +89,7 @@ const currentStageLabel = computed(() => {
当前阶段:{{ currentStageLabel }}
</div>
<div class="grid gap-2 sm:grid-cols-4" data-testid="workbench-four-stage-track">
<div class="grid gap-2 sm:grid-cols-5" data-testid="workbench-lifecycle-track">
<div
v-for="domain in domainSummaries"
:key="domain.code"
@@ -180,32 +180,34 @@ describe('shipping progress presenters', () => {
const wrapper = mount(WorkbenchProgressGrouped, {
props: {
projection,
fourStageNodes: [
lifecycleNodes: [
{ code: 'intake_parse', status: 'passed' },
{ code: 'order_review', status: 'blocked' },
{ code: 'fulfillment_prep', status: 'pending' },
{ code: 'freight_upload', status: 'pending' },
{ code: 'upload_complete', status: 'pending' },
],
},
global: { plugins: [i18n] },
});
expect(wrapper.find('[data-testid="workbench-progress-grouped"]').exists()).toBe(true);
expect(wrapper.findAll('[data-domain]').length).toBe(4);
expect(wrapper.findAll('[data-domain]').length).toBe(5);
});
it('uses backend four-stage nodes instead of the current technical stage', () => {
it('uses backend five-stage nodes instead of the current technical stage', () => {
const blockedProjection = {
...projection,
// stage 仍是早期解析节点;四阶段态必须以服务端折叠节点为准。
// stage 仍是早期解析节点;五阶段态必须以服务端折叠节点为准。
stage: 'document_parsing',
};
const wrapper = mount(WorkbenchProgressGrouped, {
props: {
projection: blockedProjection,
fourStageNodes: [
lifecycleNodes: [
{ code: 'intake_parse', status: 'passed' },
{ code: 'order_review', status: 'passed' },
{ code: 'fulfillment_prep', status: 'blocked' },
{ code: 'freight_upload', status: 'pending' },
{ code: 'upload_complete', status: 'pending' },
],
},
@@ -214,4 +216,26 @@ describe('shipping progress presenters', () => {
expect(wrapper.get('[data-domain="fulfillment_prep"]').attributes('data-state')).toBe('blocked');
expect(wrapper.get('[data-domain="intake_parse"]').attributes('data-state')).toBe('passed');
});
it('prefers lifecycle nodes and falls back to the one-release compatibility field', () => {
const preferred = mount(WorkbenchProgressGrouped, {
props: {
projection,
lifecycleNodes: [{ code: 'freight_upload', status: 'running' }],
fourStageNodes: [{ code: 'upload_complete', status: 'passed' }],
},
global: { plugins: [i18n] },
});
expect(preferred.find('[data-domain="freight_upload"]').exists()).toBe(true);
expect(preferred.find('[data-domain="upload_complete"]').exists()).toBe(false);
const fallback = mount(WorkbenchProgressGrouped, {
props: {
projection,
fourStageNodes: [{ code: 'freight_upload', status: 'running' }],
},
global: { plugins: [i18n] },
});
expect(fallback.find('[data-domain="freight_upload"]').exists()).toBe(true);
});
});
@@ -3,7 +3,7 @@
* 用途:发货「任务中心」壳——Pending|Processing|Done + 识别 Run 续办表;列表入口 + STP 重试。
* 依赖:shipping-tasks.api(my-todos)、shipping.api(详情/STP retry)、ShippingRunProgressTable、
* useShippingTodoBadge、useMessage、shippingProcessingLabels。
* 逻辑:选中项展示入口卡 + 四阶段筛选 + 统一进度紧凑摘要;主按钮深链「订单生命周期工作台」;
* 逻辑:选中项展示入口卡 + 五阶段筛选 + 统一进度紧凑摘要;主按钮深链「订单生命周期工作台」;
* review_case 在 failed/manual_fallback 时提供「重试自动推进」(与底栏同一 API/幂等键);
* 不内嵌 ShippingTaskWorkbench;生命周期筛选、禁用与深链只消费后端
* ui_state.lifecycle_entries,Intake parse_status 仅用于解析任务轮询。
@@ -78,11 +78,12 @@ const { refreshShippingTodoBadge } = useShippingTodoBadge();
const surface = ref<'todos' | 'runs'>('todos');
const bucket = ref<'pending' | 'processing' | 'done'>('pending');
const filterTodoCategory = ref<'all' | 'review' | 'exception' | 'manual_upload' | 'intake_parse'>('all');
type LifecycleStageCode = 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'upload_complete';
type LifecycleStageCode = 'intake_parse' | 'order_review' | 'fulfillment_prep' | 'freight_upload' | 'upload_complete';
const LIFECYCLE_STAGES: LifecycleStageCode[] = [
'intake_parse',
'order_review',
'fulfillment_prep',
'freight_upload',
'upload_complete',
];
const lifecycleStageFilter = ref<'all' | LifecycleStageCode>('all');
@@ -1,6 +1,6 @@
/**
* features/workspace/shipping-task-center/ShippingTaskWorkbench.vue
* 用途:发货任务处理主区——当前待办栏、四阶段进度、最后活动/终止原因、STP 事实、订单概览、时间线。
* 用途:发货任务处理主区——当前待办栏、五阶段进度、最后活动/终止原因、STP 事实、订单概览、时间线。
* 依赖:TaskTodoPanel、StpProgressFactsPanel、TaskProgressTimeline、ShippingTaskParsedResultCard、
* useShippingProcessingWorkItem、ShippingWorkflowStepper、listWorkspaceShippingTaskAuditTimeline。
* 逻辑:由 ShippingTaskCenterPage 选中任务后挂载;OT 身份取 detail.order_task_no(禁止 WorkflowItem);
+9
View File
@@ -3680,6 +3680,15 @@
"noIssues": "No blocking configuration issue.",
"currentConfiguration": "Current configuration",
"tableRegionSettings": "Line table settings",
"coordinateModelTitle": "Coordinate value model",
"coordinateModelHint": "Legacy frozen absolute coordinates are used by default. Enable this only for bounded translation with stable static anchors.",
"coordinateModelType": "Coordinate model",
"coordinateModelLegacy": "Legacy (frozen absolute coordinates)",
"coordinateModelAnchorFrame": "Anchor frame (bounded translation)",
"coordinateModelUseDocumentAnchor": "Use the first document anchor",
"coordinateModelMaxX": "Maximum horizontal translation (page width)",
"coordinateModelMaxY": "Maximum vertical translation (page height)",
"coordinateModelInvalid": "An anchor frame requires at least one stable anchor with coordinates and valid translation limits.",
"rowReconstructionMode": "Line reconstruction mode",
"rowReconstructionModes": {
"fixedSubrows": "Fixed subrows (default)",
+16 -3
View File
@@ -558,7 +558,7 @@
"resolveFailed": "Failed to resolve conflict. Refresh and try again."
},
"shippingNoticeUi": {
"stage": {"intakeParse": "Intake and parsing", "orderReview": "Order review", "fulfillmentPrep": "Notification preparation", "uploadComplete": "Notification completion"},
"stage": {"intakeParse": "Intake and parsing", "orderReview": "Order review", "fulfillmentPrep": "Notification preparation", "freightUpload": "Freight upload", "uploadComplete": "Notification completion"},
"rpaModeBrowser": "Real RPA",
"rpaModeMock": "Mock RPA",
"rpaModeUnknown": "RPA mode unknown",
@@ -1478,14 +1478,17 @@
"blocked": "Prerequisite incomplete",
"prerequisite": "Complete the current stage first",
"identity": {"po": "PO: {value}", "case": "Case: {value}", "version": "Order version: V{value}"},
"descriptions": {"intake_parse": "Review the email body and current attachment, then resolve intake parsing issues.", "order_review": "Verify fields and evidence, resolve conflicts, and freeze the order.", "fulfillment_prep": "Complete inventory matching and generate the notice Excel.", "upload_complete": "Download, upload or register the notice, and retain the receipt."},
"descriptions": {"intake_parse": "Review the email body and current attachment, then resolve intake parsing issues.", "order_review": "Verify fields and evidence, resolve conflicts, and freeze the order.", "fulfillment_prep": "Complete inventory matching and generate the notice Excel.", "freight_upload": "Download the notice, run RPA or register a manual upload, and reconcile unknown results.", "upload_complete": "Shown only after complete upload-success evidence is verified."},
"intakeParse": {"title": "Intake and parsing", "email": "Email body", "emailPreviewTitle": "Safe email body preview", "noEmail": "No email context", "attachment": "Current attachment", "fileName": "File name", "fileType": "File type", "preview": "Attachment preview", "previewLoading": "Loading attachment preview…", "loadPreview": "Load attachment preview", "previewUnsupported": "The current attachment is not a PDF and cannot be previewed here.", "loading": "Loading intake parsing context…", "loadFailed": "Failed to load intake parsing context.", "retry": "Retry"},
"prepare": {"title": "Notice preparation", "subtitle": "Handle inventory candidates, matching issues, and notice generation here.", "frozenOrder": "Frozen order", "inventorySource": "Inventory source", "excel": "Shipping Excel", "downloadInventory": "Download inventory file", "retryInventory": "Re-fetch inventory", "releaseShortage": "Release shortage", "releaseShortageHint": "Release allows shipping Excel generation. State the reason for this shortage release.", "releaseReasonPlaceholder": "Enter release reason (required)", "releaseConfirm": "Confirm release", "requiredQty": "Required quantity", "matchWorkspace": "Inventory matching", "lineCount": "{count} inventory results", "lineStatus": "Match status", "matched": "Matched", "shortage": "Inventory shortage", "matchStatus": {"not_found": "Inventory not found", "preparing": "Preparing inventory", "mapping_failed": "Inventory mapping failed", "unavailable": "Inventory unavailable", "source_conflict": "Inventory source conflict", "invalid_key": "Invalid match key", "result_missing": "Awaiting match result", "unknown": "Unknown status"}, "pending": "Inventory matching or the shipping file is not ready yet. Use the current processing card to continue.", "loadFailed": "Failed to load notice preparation details; current data could not be confirmed.", "detailUnavailable": "Notice preparation details have not returned yet, so frozen order and inventory matching data cannot be shown.", "retry": "Reload"},
"upload": {"title": "Notice completion", "subtitle": "Download the notice Excel, upload or register manual upload, and retain the receipt.", "manualUpload": "Register manual upload", "receipt": "Freight receipt: {value}", "attempt": "Latest upload attempt: {mode} · {status}"},
"freightUpload": {"title": "Freight upload", "subtitle": "Download the notice Excel, run RPA or register manual upload; reconcile an unknown result before retrying."},
"uploadComplete": {"title": "Notification completion", "subtitle": "Upload-success evidence is verified. This view is read only."},
"upload": {"title": "Freight upload", "subtitle": "Download the notice Excel, upload or register manual upload, and retain the receipt.", "manualUpload": "Register manual upload", "receipt": "Freight receipt: {value}", "attempt": "Latest upload attempt: {mode} · {status}"},
"stages": {
"intake_parse": "Intake and parsing",
"order_review": "Order review",
"fulfillment_prep": "Notification preparation",
"freight_upload": "Freight upload",
"upload_complete": "Notification completion"
}
},
@@ -1964,6 +1967,8 @@
"retrying": "Identifying…",
"retryDone": "Customer re-identified",
"retryFailed": "Failed to re-identify customer",
"uniqueCandidateHint": "One standard customer candidate was found. Saving and validating will confirm it automatically, or you can confirm it manually.",
"confirmUniqueCandidate": "Confirm unique candidate",
"confirmed": "Customer confirmed",
"confirmReason": "Manual customer confirmation in the order lifecycle workbench",
"pdfReparseHint": "For PDF layout issues, use “Reparse this PDF” at the top—not these buttons.",
@@ -2354,6 +2359,13 @@
"profile_ambiguous": "Multiple profile candidates with insufficient margin",
"profile_not_matched": "No usable profile matched",
"profile_drift": "Layout drifted from the profile"
},
"coordinateModel": {
"anchorFrame": "Anchor-frame coordinates",
"status": "Transform status",
"translateX": "Horizontal translation",
"translateY": "Vertical translation",
"reasonCodes": "Reason codes"
}
},
"buildEligibility": {
@@ -2361,6 +2373,7 @@
"subtitle": "Checks whether the order information and inventory sources are ready for order creation.",
"canBuildYes": "Can build",
"canBuildNo": "Cannot build yet",
"notValidated": "Not validated",
"manualBuildLabel": "Manual build",
"autoBuildLabel": "Automatic build",
"autoBuildYes": "Eligible for automatic creation",
+1 -1
View File
@@ -320,7 +320,7 @@
"freeze_not_ready": "Order is not ready to build or freeze",
"profile_not_auto_freeze_approved": "Document profile is not approved for auto build",
"profile_manual_confirmation_required": "Document profile requires manual confirmation",
"customer_unresolved": "Customer is unresolved",
"customer_unresolved": "Customer has not been confirmed",
"customer_ambiguous": "Customer resolution is ambiguous",
"field_conflict": "Field conflicts need manual resolution",
"duplicate_unresolved": "Duplicate order is unresolved",
+9
View File
@@ -3549,6 +3549,15 @@
"noIssues": "ไม่มีปัญหาการตั้งค่าที่ขัดขวาง",
"currentConfiguration": "การตั้งค่าปัจจุบัน",
"tableRegionSettings": "การตั้งค่าตารางรายละเอียด",
"coordinateModelTitle": "โมเดลค่าพิกัด",
"coordinateModelHint": "ค่าเริ่มต้นใช้พิกัดสัมบูรณ์ที่แช่แข็ง เปิดใช้งานเฉพาะเมื่อมีการเลื่อนที่จำกัดและจุดยึดคงที่เท่านั้น",
"coordinateModelType": "โมเดลพิกัด",
"coordinateModelLegacy": "Legacy (พิกัดสัมบูรณ์ที่แช่แข็ง)",
"coordinateModelAnchorFrame": "กรอบจุดยึด (การเลื่อนที่จำกัด)",
"coordinateModelUseDocumentAnchor": "ใช้จุดยึดเอกสารแรก",
"coordinateModelMaxX": "การเลื่อนแนวนอนสูงสุด (ความกว้างหน้า)",
"coordinateModelMaxY": "การเลื่อนแนวตั้งสูงสุด (ความสูงหน้า)",
"coordinateModelInvalid": "กรอบจุดยึดต้องมีจุดยึดคงที่พร้อมพิกัดอย่างน้อยหนึ่งจุดและขีดจำกัดการเลื่อนที่ถูกต้อง",
"rowReconstructionMode": "โหมดสร้างแถวรายละเอียดใหม่",
"rowReconstructionModes": {
"fixedSubrows": "แถวย่อยคงที่ (ค่าเริ่มต้น)",
+16 -3
View File
@@ -558,7 +558,7 @@
"resolveFailed": "แก้ความขัดแย้งไม่สำเร็จ กรุณารีเฟรชแล้วลองใหม่"
},
"shippingNoticeUi": {
"stage": {"intakeParse": "รับและแยกวิเคราะห์", "orderReview": "ตรวจสอบคำสั่งซื้อ", "fulfillmentPrep": "เตรียมการแจ้งการจัดส่ง", "uploadComplete": "การแจ้งการจัดส่งเสร็จสิ้น"},
"stage": {"intakeParse": "รับและแยกวิเคราะห์", "orderReview": "ตรวจสอบคำสั่งซื้อ", "fulfillmentPrep": "เตรียมการแจ้งการจัดส่ง", "freightUpload": "อัปโหลดให้ผู้ให้บริการขนส่ง", "uploadComplete": "การแจ้งการจัดส่งเสร็จสิ้น"},
"rpaModeBrowser": "RPA จริง",
"rpaModeMock": "Mock RPA",
"rpaModeUnknown": "ไม่ทราบโหมด RPA",
@@ -1478,14 +1478,17 @@
"blocked": "เงื่อนไขก่อนหน้ายังไม่เสร็จ",
"prerequisite": "กรุณาทำขั้นตอนปัจจุบันให้เสร็จก่อน",
"identity": {"po": "PO: {value}", "case": "Case: {value}", "version": "เวอร์ชันคำสั่งซื้อ: V{value}"},
"descriptions": {"intake_parse": "ตรวจสอบเนื้อหาอีเมลและไฟล์แนบปัจจุบัน แล้วจัดการปัญหาการแยกวิเคราะห์ขาเข้า", "order_review": "ตรวจสอบข้อมูลและหลักฐาน แก้ข้อขัดแย้ง และตรึงคำสั่งซื้อ", "fulfillment_prep": "จับคู่สต็อกและสร้าง Excel แจ้งงาน", "upload_complete": "ดาวน์โหลด อัปโหลด หรือลงทะเบียนแจ้งงาน พร้อมเก็บใบตอบรับ"},
"descriptions": {"intake_parse": "ตรวจสอบเนื้อหาอีเมลและไฟล์แนบปัจจุบัน แล้วจัดการปัญหาการแยกวิเคราะห์ขาเข้า", "order_review": "ตรวจสอบข้อมูลและหลักฐาน แก้ข้อขัดแย้ง และตรึงคำสั่งซื้อ", "fulfillment_prep": "จับคู่สต็อกและสร้าง Excel แจ้งงาน", "freight_upload": "ดาวน์โหลดไฟล์แจ้งงาน รัน RPA หรือลงทะเบียนการอัปโหลดด้วยตนเอง และตรวจสอบผลลัพธ์ที่ไม่ทราบ", "upload_complete": "แสดงเมื่อยืนยันหลักฐานความสำเร็จของการอัปโหลดครบถ้วนแล้วเท่านั้น"},
"intakeParse": {"title": "รับและแยกวิเคราะห์", "email": "เนื้อหาอีเมล", "emailPreviewTitle": "ตัวอย่างเนื้อหาอีเมลแบบปลอดภัย", "noEmail": "ไม่มีบริบทอีเมล", "attachment": "ไฟล์แนบปัจจุบัน", "fileName": "ชื่อไฟล์", "fileType": "ประเภทไฟล์", "preview": "ตัวอย่างไฟล์แนบ", "previewLoading": "กำลังโหลดตัวอย่างไฟล์แนบ…", "loadPreview": "โหลดตัวอย่างไฟล์แนบ", "previewUnsupported": "ไฟล์แนบปัจจุบันไม่ใช่ PDF และไม่สามารถแสดงตัวอย่างที่นี่ได้", "loading": "กำลังโหลดบริบทการแยกวิเคราะห์ขาเข้า…", "loadFailed": "โหลดบริบทการแยกวิเคราะห์ขาเข้าไม่สำเร็จ", "retry": "ลองอีกครั้ง"},
"prepare": {"title": "เตรียมการแจ้ง", "subtitle": "จัดการตัวเลือกสต็อก ปัญหาการจับคู่ และการสร้างไฟล์แจ้งงานที่นี่", "frozenOrder": "คำสั่งซื้อที่ตรึงแล้ว", "inventorySource": "แหล่งสต็อก", "excel": "Excel การจัดส่ง", "downloadInventory": "ดาวน์โหลดไฟล์สินค้าคงคลัง", "retryInventory": "ดึงข้อมูลสต็อกอีกครั้ง", "releaseShortage": "อนุมัติส่วนขาดสต็อก", "releaseShortageHint": "การอนุมัติทำให้สร้าง Excel การจัดส่งได้ โปรดระบุเหตุผลสำหรับส่วนขาดนี้", "releaseReasonPlaceholder": "กรอกเหตุผลการอนุมัติ (จำเป็น)", "releaseConfirm": "ยืนยันการอนุมัติ", "requiredQty": "จำนวนที่ต้องการ", "matchWorkspace": "การจับคู่สต็อก", "lineCount": "ผลลัพธ์สต็อก {count} รายการ", "lineStatus": "สถานะการจับคู่", "matched": "จับคู่แล้ว", "shortage": "สต็อกไม่เพียงพอ", "matchStatus": {"not_found": "ไม่พบสต็อก", "preparing": "กำลังเตรียมสต็อก", "mapping_failed": "จับคู่ฟิลด์สต็อกไม่สำเร็จ", "unavailable": "สต็อกไม่พร้อมใช้", "source_conflict": "แหล่งสต็อกขัดแย้ง", "invalid_key": "คีย์จับคู่ไม่ถูกต้อง", "result_missing": "กำลังรอผลการจับคู่", "unknown": "ไม่ทราบสถานะ"}, "pending": "การจับคู่สต็อกหรือไฟล์แจ้งการจัดส่งยังไม่พร้อม โปรดดำเนินการจากบัตรงานปัจจุบัน", "loadFailed": "โหลดรายละเอียดการเตรียมการแจ้งไม่สำเร็จ จึงยังยืนยันข้อมูลปัจจุบันไม่ได้", "detailUnavailable": "ยังไม่ได้รับรายละเอียดการเตรียมการแจ้ง จึงยังแสดงคำสั่งซื้อที่ตรึงและข้อมูลการจับคู่สต็อกไม่ได้", "retry": "โหลดอีกครั้ง"},
"upload": {"title": "แจ้งเสร็จสิ้น", "subtitle": "ดาวน์โหลด Excel แจ้งงาน อัปโหลดหรือลงทะเบียนการอัปโหลดด้วยตนเอง และเก็บใบตอบรับ", "manualUpload": "ลงทะเบียนอัปโหลดด้วยตนเอง", "receipt": "ใบตอบรับจากผู้ขนส่ง: {value}", "attempt": "ความพยายามอัปโหลดล่าสุด: {mode} · {status}"},
"freightUpload": {"title": "อัปโหลดให้ผู้ให้บริการขนส่ง", "subtitle": "ดาวน์โหลด Excel แจ้งงาน รัน RPA หรือลงทะเบียนการอัปโหลดด้วยตนเอง; หากผลลัพธ์ไม่ทราบให้ตรวจสอบก่อนลองใหม่"},
"uploadComplete": {"title": "แจ้งเสร็จสิ้น", "subtitle": "ยืนยันหลักฐานความสำเร็จของการอัปโหลดแล้ว หน้านี้อ่านได้อย่างเดียว"},
"upload": {"title": "อัปโหลดให้ผู้ให้บริการขนส่ง", "subtitle": "ดาวน์โหลด Excel แจ้งงาน อัปโหลดหรือลงทะเบียนการอัปโหลดด้วยตนเอง และเก็บใบตอบรับ", "manualUpload": "ลงทะเบียนอัปโหลดด้วยตนเอง", "receipt": "ใบตอบรับจากผู้ขนส่ง: {value}", "attempt": "ความพยายามอัปโหลดล่าสุด: {mode} · {status}"},
"stages": {
"intake_parse": "รับและแยกวิเคราะห์",
"order_review": "ทบทวนคำสั่งซื้อ",
"fulfillment_prep": "เตรียมการแจ้ง",
"freight_upload": "อัปโหลดให้ผู้ให้บริการขนส่ง",
"upload_complete": "แจ้งเสร็จสิ้น"
}
},
@@ -1964,6 +1967,8 @@
"retrying": "กำลังระบุ…",
"retryDone": "ระบุลูกค้าใหม่แล้ว",
"retryFailed": "ระบุลูกค้าใหม่ไม่สำเร็จ",
"uniqueCandidateHint": "พบผู้สมัครลูกค้ามาตรฐานเพียงรายเดียว การบันทึกและตรวจสอบจะยืนยันโดยอัตโนมัติ หรือยืนยันด้วยตนเองได้",
"confirmUniqueCandidate": "ยืนยันผู้สมัครรายเดียว",
"confirmed": "ยืนยันลูกค้าแล้ว",
"confirmReason": "ยืนยันลูกค้าด้วยตนเองจากโต๊ะทำงานวงจรชีวิตคำสั่งซื้อ",
"pdfReparseHint": "หากเลย์เอาต์ PDF ผิด ใช้ “ระบุ PDF นี้อีกครั้ง” ด้านบน ไม่ใช่ปุ่มในส่วนนี้",
@@ -2354,6 +2359,13 @@
"profile_ambiguous": "มีหลายเทมเพลตและคะแนนต่างกันไม่พอ",
"profile_not_matched": "ไม่พบเทมเพลตที่ใช้ได้",
"profile_drift": "เลย์เอาต์เพี้ยนจากเทมเพลต"
},
"coordinateModel": {
"anchorFrame": "พิกัดกรอบจุดยึด",
"status": "สถานะการแปลง",
"translateX": "การเลื่อนแนวนอน",
"translateY": "การเลื่อนแนวตั้ง",
"reasonCodes": "รหัสเหตุผล"
}
},
"buildEligibility": {
@@ -2361,6 +2373,7 @@
"subtitle": "ตรวจสอบว่าข้อมูลคำสั่งซื้อและแหล่งสต็อกพร้อมสำหรับสร้างคำสั่งซื้อหรือไม่",
"canBuildYes": "สร้างได้",
"canBuildNo": "ยังสร้างไม่ได้",
"notValidated": "ยังไม่ได้ตรวจสอบ",
"manualBuildLabel": "สร้างด้วยตนเอง",
"autoBuildLabel": "สร้างอัตโนมัติ",
"autoBuildYes": "มีสิทธิ์สร้างอัตโนมัติ",
+1 -1
View File
@@ -254,7 +254,7 @@
"freeze_not_ready": "คำสั่งซื้อยังไม่พร้อมสร้างหรือ freeze",
"profile_not_auto_freeze_approved": "โปรไฟล์เอกสารยังไม่ได้รับอนุมัติ auto build",
"profile_manual_confirmation_required": "โปรไฟล์เอกสารต้องยืนยันด้วยตนเอง",
"customer_unresolved": "ยังระบุลูกค้าไม่ได้",
"customer_unresolved": "ยังไม่ได้ยืนยันลูกค้า",
"customer_ambiguous": "การระบุลูกค้ามีความคลุมเครือ",
"field_conflict": "ฟิลด์ขัดแย้ง ต้องตัดสินด้วยตนเอง",
"duplicate_unresolved": "คำสั่งซื้อซ้ำยังไม่ได้รับการแก้ไข",
+9
View File
@@ -3791,6 +3791,15 @@
"noIssues": "没有阻断配置问题。",
"currentConfiguration": "当前配置",
"tableRegionSettings": "明细表区设置",
"coordinateModelTitle": "坐标取值模型",
"coordinateModelHint": "默认使用冻结绝对坐标;仅在版式存在受限平移且有稳定静态锚点时启用。",
"coordinateModelType": "坐标模型",
"coordinateModelLegacy": "Legacy(冻结绝对坐标)",
"coordinateModelAnchorFrame": "锚点坐标框架(受限平移)",
"coordinateModelUseDocumentAnchor": "使用首个匹配锚点建立框架",
"coordinateModelMaxX": "最大横向平移(相对页宽)",
"coordinateModelMaxY": "最大纵向平移(相对页高)",
"coordinateModelInvalid": "锚点坐标框架必须至少有一个带坐标的稳定锚点,且平移上限在允许范围内。",
"rowReconstructionMode": "明细行重建方式",
"rowReconstructionModes": {
"fixedSubrows": "固定子行(默认)",
+16 -3
View File
@@ -592,7 +592,7 @@
"resolveFailed": "解决冲突失败,请刷新后重试"
},
"shippingNoticeUi": {
"stage": {"intakeParse": "接收解析", "orderReview": "订单复核", "fulfillmentPrep": "通知准备", "uploadComplete": "通知完成"},
"stage": {"intakeParse": "接收解析", "orderReview": "订单复核", "fulfillmentPrep": "通知准备", "freightUpload": "货代上传", "uploadComplete": "通知完成"},
"rpaModeBrowser": "真实 RPA",
"rpaModeMock": "Mock RPA",
"rpaModeUnknown": "RPA 模式未知",
@@ -1585,14 +1585,17 @@
"blocked": "前置未完成",
"prerequisite": "请先完成当前阶段",
"identity": {"po": "PO:{value}", "case": "Case:{value}", "version": "订单版本:V{value}"},
"descriptions": {"intake_parse": "核对邮件正文和当前附件,处置接收解析异常。", "order_review": "核实字段和证据,处理冲突并冻结订单。", "fulfillment_prep": "完成库存匹配并生成通知 Excel。", "upload_complete": "下载通知文件、上传或登记回执,完成闭环。"},
"descriptions": {"intake_parse": "核对邮件正文和当前附件,处置接收解析异常。", "order_review": "核实字段和证据,处理冲突并冻结订单。", "fulfillment_prep": "完成库存匹配并生成通知 Excel。", "freight_upload": "下载通知文件、执行 RPA 或登记人工上传,并核对未知结果。", "upload_complete": "仅在上传成功证据完整时展示通知完成。"},
"intakeParse": {"title": "接收解析", "email": "邮件正文", "emailPreviewTitle": "邮件正文安全预览", "noEmail": "无邮件上下文", "attachment": "当前附件", "fileName": "文件名", "fileType": "文件类型", "preview": "附件预览", "previewLoading": "正在加载附件预览…", "loadPreview": "加载附件预览", "previewUnsupported": "当前附件不是 PDF,不能在此预览。", "loading": "正在加载接收解析上下文…", "loadFailed": "接收解析上下文加载失败。", "retry": "重试"},
"prepare": {"title": "通知准备", "subtitle": "库存候选、匹配异常和通知文件生成均在此阶段处理。", "frozenOrder": "冻结订单", "inventorySource": "库存源", "excel": "通知 Excel", "downloadInventory": "下载库存文件", "retryInventory": "重新获取库存", "releaseShortage": "库存缺口放行", "releaseShortageHint": "放行后可生成发货 Excel;请填写本次缺口放行原因。", "releaseReasonPlaceholder": "请输入放行原因(必填)", "releaseConfirm": "确认放行", "requiredQty": "需求数量", "matchWorkspace": "库存匹配", "lineCount": "{count} 行库存结果", "lineStatus": "匹配状态", "matched": "已匹配", "shortage": "库存不足", "matchStatus": {"not_found": "未匹配到库存", "preparing": "库存准备中", "mapping_failed": "库存映射失败", "unavailable": "库存不可用", "source_conflict": "库存源冲突", "invalid_key": "匹配键无效", "result_missing": "等待匹配结果", "unknown": "状态未知"}, "pending": "库存匹配或通知文件尚未生成。请查看右侧当前处理,按当前门禁继续。", "loadFailed": "通知准备任务详情加载失败,当前数据未能确认。", "detailUnavailable": "通知准备任务详情尚未返回,暂时无法展示冻结订单和库存匹配数据。", "retry": "重新加载"},
"upload": {"title": "通知完成", "subtitle": "下载已生成的通知 Excel,上传货代或登记人工上传,并保留回执。", "manualUpload": "登记人工上传", "receipt": "货代回执:{value}", "attempt": "最近上传尝试:{mode} · {status}"},
"freightUpload": {"title": "货代上传", "subtitle": "下载已生成的通知 Excel,执行 RPA 或登记人工上传;结果未知时先核对后再处理。"},
"uploadComplete": {"title": "通知完成", "subtitle": "上传成功证据已核验,以下内容仅供查看。"},
"upload": {"title": "货代上传", "subtitle": "下载已生成的通知 Excel,上传货代或登记人工上传,并保留回执。", "manualUpload": "登记人工上传", "receipt": "货代回执:{value}", "attempt": "最近上传尝试:{mode} · {status}"},
"stages": {
"intake_parse": "接收解析",
"order_review": "订单复核",
"fulfillment_prep": "通知准备",
"freight_upload": "货代上传",
"upload_complete": "通知完成"
}
},
@@ -2071,6 +2074,8 @@
"retrying": "识别中…",
"retryDone": "已重新识别客户",
"retryFailed": "重新识别客户失败",
"uniqueCandidateHint": "已找到唯一标准客户候选;保存校验时系统会自动确认,也可手动确认。",
"confirmUniqueCandidate": "确认唯一候选",
"confirmed": "客户已确认",
"confirmReason": "订单生命周期工作台人工确认标准客户",
"pdfReparseHint": "若 PDF 版面错误,请使用顶部「重新识别此 PDF」,不要用本区按钮。",
@@ -2473,6 +2478,13 @@
"profile_ambiguous": "多个模板候选分差不足",
"profile_not_matched": "未匹配到可用模板",
"profile_drift": "版面相对模板发生漂移"
},
"coordinateModel": {
"anchorFrame": "锚点坐标框架",
"status": "变换状态",
"translateX": "横向平移",
"translateY": "纵向平移",
"reasonCodes": "原因码"
}
},
"buildEligibility": {
@@ -2480,6 +2492,7 @@
"subtitle": "检查订单信息和库存来源是否满足创建条件。",
"canBuildYes": "可建单",
"canBuildNo": "暂不可建单",
"notValidated": "尚未校验",
"manualBuildLabel": "人工建单",
"autoBuildLabel": "自动建单",
"autoBuildYes": "可自动建单",
+1 -1
View File
@@ -320,7 +320,7 @@
"freeze_not_ready": "订单尚未满足建单/冻结条件",
"profile_not_auto_freeze_approved": "文档模板未通过自动建单审批",
"profile_manual_confirmation_required": "文档模板需要人工确认",
"customer_unresolved": "客户尚未识别",
"customer_unresolved": "客户尚未确认",
"customer_ambiguous": "客户识别存在歧义",
"field_conflict": "字段存在冲突,需人工裁决",
"duplicate_unresolved": "重复订单尚未处理",
+9
View File
@@ -3554,6 +3554,15 @@
"noIssues": "沒有阻斷設定問題。",
"currentConfiguration": "目前設定",
"tableRegionSettings": "明細表區設定",
"coordinateModelTitle": "座標取值模型",
"coordinateModelHint": "預設使用凍結絕對座標;僅在版式存在受限平移且有穩定靜態錨點時啟用。",
"coordinateModelType": "座標模型",
"coordinateModelLegacy": "Legacy(凍結絕對座標)",
"coordinateModelAnchorFrame": "錨點座標框架(受限平移)",
"coordinateModelUseDocumentAnchor": "使用首個匹配錨點建立框架",
"coordinateModelMaxX": "最大橫向平移(相對頁寬)",
"coordinateModelMaxY": "最大縱向平移(相對頁高)",
"coordinateModelInvalid": "錨點座標框架必須至少有一個帶座標的穩定錨點,且平移上限在允許範圍內。",
"rowReconstructionMode": "明細行重建方式",
"rowReconstructionModes": {
"fixedSubrows": "固定子行(預設)",
+16 -3
View File
@@ -558,7 +558,7 @@
"resolveFailed": "解決衝突失敗,請重新整理後再試"
},
"shippingNoticeUi": {
"stage": {"intakeParse": "接收解析", "orderReview": "訂單複核", "fulfillmentPrep": "通知準備", "uploadComplete": "通知完成"},
"stage": {"intakeParse": "接收解析", "orderReview": "訂單複核", "fulfillmentPrep": "通知準備", "freightUpload": "貨代上傳", "uploadComplete": "通知完成"},
"rpaModeBrowser": "真實 RPA",
"rpaModeMock": "Mock RPA",
"rpaModeUnknown": "RPA 模式未知",
@@ -1478,14 +1478,17 @@
"blocked": "前置未完成",
"prerequisite": "請先完成目前階段",
"identity": {"po": "PO:{value}", "case": "Case:{value}", "version": "訂單版本:V{value}"},
"descriptions": {"intake_parse": "核對郵件正文和目前附件,處理接收解析異常。", "order_review": "核實欄位與證據、處理衝突並凍結訂單。", "fulfillment_prep": "完成庫存匹配並產生通知 Excel。", "upload_complete": "下載、上傳或登記通知,並保留回執。"},
"descriptions": {"intake_parse": "核對郵件正文和目前附件,處理接收解析異常。", "order_review": "核實欄位與證據、處理衝突並凍結訂單。", "fulfillment_prep": "完成庫存匹配並產生通知 Excel。", "freight_upload": "下載通知檔案、執行 RPA 或登記人工上傳,並核對未知結果。", "upload_complete": "僅在上傳成功證據完整時顯示通知完成。"},
"intakeParse": {"title": "接收解析", "email": "郵件正文", "emailPreviewTitle": "郵件正文安全預覽", "noEmail": "無郵件上下文", "attachment": "目前附件", "fileName": "檔案名稱", "fileType": "檔案類型", "preview": "附件預覽", "previewLoading": "正在載入附件預覽…", "loadPreview": "載入附件預覽", "previewUnsupported": "目前附件不是 PDF,無法在此預覽。", "loading": "正在載入接收解析上下文…", "loadFailed": "接收解析上下文載入失敗。", "retry": "重試"},
"prepare": {"title": "通知準備", "subtitle": "在此處處理庫存候選、匹配異常與通知檔產生。", "frozenOrder": "凍結訂單", "inventorySource": "庫存來源", "excel": "發貨 Excel", "downloadInventory": "下載庫存檔案", "retryInventory": "重新取得庫存", "releaseShortage": "放行庫存缺口", "releaseShortageHint": "放行後可產生發貨 Excel;請填寫本次缺口放行原因。", "releaseReasonPlaceholder": "請輸入放行原因(必填)", "releaseConfirm": "確認放行", "requiredQty": "需求數量", "matchWorkspace": "庫存匹配", "lineCount": "{count} 行庫存結果", "lineStatus": "匹配狀態", "matched": "已匹配", "shortage": "庫存不足", "matchStatus": {"not_found": "未匹配到庫存", "preparing": "庫存準備中", "mapping_failed": "庫存對應失敗", "unavailable": "庫存不可用", "source_conflict": "庫存來源衝突", "invalid_key": "匹配鍵無效", "result_missing": "等待匹配結果", "unknown": "狀態未知"}, "pending": "庫存匹配或通知檔案尚未產生。請查看右側目前處理,依目前門禁繼續。", "loadFailed": "通知準備任務詳情載入失敗,目前資料無法確認。", "detailUnavailable": "通知準備任務詳情尚未返回,暫時無法展示凍結訂單和庫存匹配資料。", "retry": "重新載入"},
"upload": {"title": "通知完成", "subtitle": "下載通知 Excel、上傳或登記人工上傳,並保留回執。", "manualUpload": "登記人工上傳", "receipt": "貨代回執:{value}", "attempt": "最近上傳嘗試:{mode} · {status}"},
"freightUpload": {"title": "貨代上傳", "subtitle": "下載通知 Excel、執行 RPA 或登記人工上傳;結果未知時請先核對。"},
"uploadComplete": {"title": "通知完成", "subtitle": "上傳成功證據已核驗,以下內容僅供查看。"},
"upload": {"title": "貨代上傳", "subtitle": "下載通知 Excel、上傳或登記人工上傳,並保留回執。", "manualUpload": "登記人工上傳", "receipt": "貨代回執:{value}", "attempt": "最近上傳嘗試:{mode} · {status}"},
"stages": {
"intake_parse": "接收解析",
"order_review": "訂單覆核",
"fulfillment_prep": "通知準備",
"freight_upload": "貨代上傳",
"upload_complete": "通知完成"
}
},
@@ -1964,6 +1967,8 @@
"retrying": "識別中…",
"retryDone": "已重新識別客戶",
"retryFailed": "重新識別客戶失敗",
"uniqueCandidateHint": "已找到唯一標準客戶候選;儲存校驗時系統會自動確認,也可手動確認。",
"confirmUniqueCandidate": "確認唯一候選",
"confirmed": "客戶已確認",
"confirmReason": "訂單生命週期工作台人工確認標準客戶",
"pdfReparseHint": "若 PDF 版面錯誤,請使用頂部「重新識別此 PDF」,不要用本區按鈕。",
@@ -2354,6 +2359,13 @@
"profile_ambiguous": "多個範本候選分差不足",
"profile_not_matched": "未匹配到可用範本",
"profile_drift": "版面相對範本發生漂移"
},
"coordinateModel": {
"anchorFrame": "錨點座標框架",
"status": "變換狀態",
"translateX": "橫向平移",
"translateY": "縱向平移",
"reasonCodes": "原因碼"
}
},
"buildEligibility": {
@@ -2361,6 +2373,7 @@
"subtitle": "檢查訂單資訊和庫存來源是否符合建立條件。",
"canBuildYes": "可建單",
"canBuildNo": "暫不可建單",
"notValidated": "尚未校驗",
"manualBuildLabel": "人工建單",
"autoBuildLabel": "自動建單",
"autoBuildYes": "可自動建單",
+1 -1
View File
@@ -320,7 +320,7 @@
"freeze_not_ready": "訂單尚未滿足建單/凍結條件",
"profile_not_auto_freeze_approved": "文件模板未通過自動建單審批",
"profile_manual_confirmation_required": "文件模板需要人工確認",
"customer_unresolved": "客戶尚未識別",
"customer_unresolved": "客戶尚未確認",
"customer_ambiguous": "客戶識別存在歧義",
"field_conflict": "欄位存在衝突,需人工裁決",
"duplicate_unresolved": "重複訂單尚未處理",