feat(shipping-notice): 完成货代发货通知全门禁恢复MVP收口

完成全门禁恢复MVP版本交付:调整自动上传与重试配置,重构正式执行链路;修复多处代码bug,新增测试与审计工具;更新全流程文档与契约规范。
This commit is contained in:
hugo committed 2026-08-11 14:04:39 +08:00
1 parent 8e0bbf7a81
commit c94d173f92
181 files changed
+12947 -1724

No files matched your search

@@ -23,9 +23,7 @@ import {
confirmWorkspaceShippingCustomer,
confirmWorkspaceShippingInventorySource,
freezeWorkspaceShippingOrder,
generateWorkspaceShippingExcel,
listWorkspaceShippingCustomerOptions,
matchWorkspaceShippingInventory,
retryWorkspaceShippingUpload,
submitWorkspaceShippingDecision,
type ShippingFulfillmentOwnershipContext,
@@ -35,6 +33,7 @@ import { refreshShippingTodoBadge } from '@/features/workspace/composables/useSh
import InventorySourceSelectDialog from './InventorySourceSelectDialog.vue';
import ManualUploadEvidenceDialog from './ManualUploadEvidenceDialog.vue';
import ProcessGateRecoveryCard from '@/features/shipping-process-gates/components/ProcessGateRecoveryCard.vue';
import { postWorkspaceProcessGateAction } from '@/features/shipping-process-gates/api/process-gates.api';
import type { ShippingProcessGateUserSummary } from '@/features/chat/types/shipping.api.types';
import { gateSummaryIndicatesManualUpload } from '@/features/chat/shipping/shippingProcessingFulfillment';
@@ -48,6 +47,8 @@ const props = withDefaults(defineProps<{
actionsExecutable?: boolean;
/** 为 true 时隐藏全部 action_buttons(订单处理工作台写入口仅 Footer)。 */
hidePrimaryActions?: boolean;
/** 订单处理工作台将 Gate 卡提升到右侧展示时隐藏此处重复卡。 */
hideGateCard?: boolean;
/** 工作台权威正式 Notice 号;与 detail.task_no 不一致时禁止履约写。 */
expectedNoticeTaskNo?: string | null;
/** 工作台权威 OT 号,随履约 API 校验归属。 */
@@ -61,6 +62,7 @@ const props = withDefaults(defineProps<{
gateCanHandle: undefined,
actionsExecutable: undefined,
hidePrimaryActions: false,
hideGateCard: false,
expectedNoticeTaskNo: null,
expectedOrderTaskNo: null,
expectedReviewCaseNo: null,
@@ -223,6 +225,7 @@ const visibleActions = computed(() => {
if (hasBlockingGate.value) return [];
return actionButtons.value.filter((action) => {
const id = String(action.id || '');
if (id === 'regenerate_manual_upload_todo') return false;
if (UNIFIED_OWNED_ACTION_IDS.has(id)) {
return false;
}
@@ -419,6 +422,24 @@ async function assertFulfillmentOwnership(): Promise<boolean> {
return true;
}
/** 将兼容按钮收口为服务端正式 Gate Action;缺少 Projection 身份时只刷新。 */
async function requestProjectedGateAction(actionCode: string): Promise<boolean> {
const executionNo = String(processGateSummary.value?.execution_no || '').trim();
const gate = processGateSummary.value?.current_blocking_gate;
const gateCode = String(gate?.gate_code || '').trim();
const version = Number(gate?.evaluation_version);
if (!executionNo || !gateCode || !Number.isInteger(version)) {
emit('refreshed');
return false;
}
await postWorkspaceProcessGateAction(executionNo, gateCode, {
action_code: actionCode,
expected_gate_version: version,
idempotency_key: `task-todo:${executionNo}:${gateCode}:${version}:${actionCode}:${crypto.randomUUID()}`,
});
return true;
}
/**
* 执行后端允许的动作;人工上传/客户/库存源/冻结走对话框,其余走对应工作台 API。
*/
@@ -458,12 +479,12 @@ async function runAction(action: ShippingChatAction) {
return;
}
if (id === 'generate_excel') {
await generateWorkspaceShippingExcel(props.detail.task_no, ownership);
await requestProjectedGateAction('regenerate_excel_artifact');
await afterSuccess();
return;
}
if (id === 'match_inventory' || id === 'rematch') {
await matchWorkspaceShippingInventory(props.detail.task_no, ownership);
await requestProjectedGateAction('retry_inventory_matching');
await afterSuccess();
return;
}
@@ -511,6 +532,7 @@ defineExpose({
<template>
<div class="space-y-3">
<ProcessGateRecoveryCard
v-if="!hideGateCard"
:summary="processGateSummary"
:can-handle="resolvedGateCanHandle"
:navigation-context="{
@@ -520,6 +542,7 @@ defineExpose({
@refreshed="afterSuccess"
@refresh-needed="afterSuccess"
@confirm-customer="() => void openCustomerDialog()"
@manual-upload="() => void invokeActionByCode('mark_manual_uploaded')"
/>
<section
v-if="!hasBlockingGate && !isSystemAutoWait"