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

@@ -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);
});
});