feat(shipping-notice): 收敛复核状态隔离、STP 重试幂等与 XFA 合成预览标注
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
84a881b554
commit
74270adc22
149 files changed
+20111
-3871
No files matched your search
@@ -1,9 +1,10 @@
|
||||
/**
|
||||
* features/workspace/shipping-task-center/ShippingTaskCenterPage.vue
|
||||
* 用途:发货「任务中心」壳——Pending|Processing|Done + 识别 Run 续办表;仅列表入口。
|
||||
* 依赖:shipping-tasks.api(my-todos)、shipping.api 详情(直链摘要)、ShippingRunProgressTable、useShippingTodoBadge、
|
||||
* shippingProcessingLabels。
|
||||
* 逻辑:选中项展示入口卡 + 统一进度紧凑摘要(UI-03);唯一主按钮深链「订单处理工作台」或对话;
|
||||
* 用途:发货「任务中心」壳——Pending|Processing|Done + 识别 Run 续办表;列表入口 + STP 重试。
|
||||
* 依赖:shipping-tasks.api(my-todos)、shipping.api(详情/STP retry)、ShippingRunProgressTable、
|
||||
* useShippingTodoBadge、useMessage、shippingProcessingLabels。
|
||||
* 逻辑:选中项展示入口卡 + 统一进度紧凑摘要(UI-03);主按钮深链「订单处理工作台」;
|
||||
* review_case 在 failed/manual_fallback 时提供「重试自动推进」(与底栏同一 API/幂等键);
|
||||
* 不内嵌 ShippingTaskWorkbench;轮询依据 shipping_processing_status /
|
||||
* process_status / Intake parse_status。
|
||||
*/
|
||||
@@ -15,6 +16,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import {
|
||||
getWorkspaceShippingTask,
|
||||
listShippingChatAgents,
|
||||
retryWorkspaceShippingOrderStpAutoCreate,
|
||||
SHIPPING_NOTICE_AGENT_CODE,
|
||||
type ShippingTaskDetail,
|
||||
type ShippingTaskSummary,
|
||||
@@ -25,6 +27,8 @@ import {
|
||||
type ShippingMyTodosCount,
|
||||
} from '@/features/workspace/api/shipping-tasks.api';
|
||||
import { useShippingTodoBadge } from '../composables/useShippingTodoBadge';
|
||||
import { useMessage } from '@/shared/composables/useMessage';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import {
|
||||
IN_PROGRESS_PROCESSING_STATUSES,
|
||||
TERMINAL_PROCESSING_STATUSES,
|
||||
@@ -42,6 +46,7 @@ import {
|
||||
import ShippingRunProgressTable from './ShippingRunProgressTable.vue';
|
||||
|
||||
const { t, te } = useI18n();
|
||||
const msg = useMessage();
|
||||
/** 进行中 Workflow/Task 前台轮询间隔。 */
|
||||
const FOREGROUND_POLL_MS = 2000;
|
||||
/** 页面隐藏时后台轮询间隔。 */
|
||||
@@ -354,7 +359,7 @@ async function refreshAll(_options?: { silent?: boolean }) {
|
||||
|
||||
/**
|
||||
* 打开订单处理工作台(Chat 主区 order-review;单 OT 全生命周期)。
|
||||
* 任务中心仅作列表入口,禁止在本页履约写操作。
|
||||
* 任务中心仅作列表入口,禁止在本页履约写操作(STP 重试除外)。
|
||||
*/
|
||||
function openOrderProcessing(item: ShippingTaskSummary | ShippingTaskDetail) {
|
||||
const runNo = String(item.review_run_no || '').trim();
|
||||
@@ -382,6 +387,41 @@ function canOpenOrderProcessing(item: ShippingTaskSummary | ShippingTaskDetail |
|
||||
return Boolean(runNo && agentId);
|
||||
}
|
||||
|
||||
const stpRetrying = ref(false);
|
||||
|
||||
/**
|
||||
* 任务中心是否展示「重试自动推进」(与工作台底栏同一 available_actions / 幂等键)。
|
||||
*/
|
||||
function canRetryStpAutoCreate(item: ShippingTaskSummary | ShippingTaskDetail | null): boolean {
|
||||
if (!item || item.can_handle === false) return false;
|
||||
const caseNo = String(item.review_case_no || '').trim();
|
||||
if (!caseNo) return false;
|
||||
const summaryActions = item.ui_state?.summary?.allowed_actions || [];
|
||||
const buttons = (item.ui_state?.action_buttons || []).map((action) => String(action));
|
||||
return summaryActions.includes('retry_stp_auto_create') || buttons.includes('retry_stp_auto_create');
|
||||
}
|
||||
|
||||
/**
|
||||
* 显式重试 STP 自动建单入队;与 ReviewWorkbenchFooter 共用 POST retry API。
|
||||
*/
|
||||
async function retryStpAutoCreate(item: ShippingTaskSummary | ShippingTaskDetail) {
|
||||
const caseNo = String(item.review_case_no || '').trim();
|
||||
if (!caseNo || stpRetrying.value) return;
|
||||
stpRetrying.value = true;
|
||||
try {
|
||||
await retryWorkspaceShippingOrderStpAutoCreate(caseNo);
|
||||
msg.success(t('chat.shippingOrderReview.autoProgress.retryStpSuccess'));
|
||||
await loadTodos();
|
||||
} catch (error) {
|
||||
const message = error instanceof BusinessError
|
||||
? (error.message || t('chat.shippingOrderReview.autoProgress.retryStp'))
|
||||
: t('chat.shippingOrderReview.autoProgress.retryStp');
|
||||
msg.error(message);
|
||||
} finally {
|
||||
stpRetrying.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 打开对话「本次处理中」卡,聚焦未建 OT 的 Intake 材料。
|
||||
*/
|
||||
@@ -731,16 +771,29 @@ onBeforeUnmount(() => {
|
||||
{{ selectedItem.source_file_name }}
|
||||
<span v-if="selectedItem.review_run_no"> · {{ selectedItem.review_run_no }}</span>
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1.5 rounded-xl bg-brand-600 px-4 py-2 text-sm font-medium text-white hover:bg-brand-700 disabled:opacity-50"
|
||||
:disabled="!canOpenOrderProcessing(selectedItem)"
|
||||
data-testid="my-todos-open-order-processing"
|
||||
@click="openOrderProcessing(selectedItem)"
|
||||
>
|
||||
<ExternalLink class="h-3.5 w-3.5" />
|
||||
{{ $t('workspace.shippingNotice.myTodos.openReview') }}
|
||||
</button>
|
||||
<div class="flex flex-wrap gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1.5 rounded-xl bg-brand-600 px-4 py-2 text-sm font-medium text-white hover:bg-brand-700 disabled:opacity-50"
|
||||
:disabled="!canOpenOrderProcessing(selectedItem)"
|
||||
data-testid="my-todos-open-order-processing"
|
||||
@click="openOrderProcessing(selectedItem)"
|
||||
>
|
||||
<ExternalLink class="h-3.5 w-3.5" />
|
||||
{{ $t('workspace.shippingNotice.myTodos.openReview') }}
|
||||
</button>
|
||||
<button
|
||||
v-if="canRetryStpAutoCreate(selectedItem)"
|
||||
type="button"
|
||||
class="inline-flex items-center gap-1.5 rounded-xl border border-amber-400 bg-amber-50 px-4 py-2 text-sm font-medium text-amber-950 hover:bg-amber-100 disabled:opacity-50 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-100"
|
||||
:disabled="stpRetrying"
|
||||
data-testid="my-todos-retry-stp-auto-create"
|
||||
@click="() => { if (selectedItem) void retryStpAutoCreate(selectedItem); }"
|
||||
>
|
||||
<RefreshCw class="h-3.5 w-3.5" />
|
||||
{{ $t('chat.shippingOrderReview.autoProgress.retryStp') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="isIntakeSelection && selectedItem"
|
||||
|
||||
+137
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
* features/workspace/shipping-task-center/TaskTodoPanel.actionsExecutable.spec.ts
|
||||
* 用途:验收 A2——Gate 只读时 Footer 委托 invokeActionByCode 仍可写。
|
||||
* 依赖:Vitest、Vue Test Utils、TaskTodoPanel、shipping.api mock。
|
||||
* 逻辑:gateCanHandle=false + actionsExecutable=true 时匹配库存 API 被调用;
|
||||
* actionsExecutable=false 时直接返回;hidePrimaryActions 时不渲染 action_buttons。
|
||||
*/
|
||||
import { flushPromises, mount } from '@vue/test-utils';
|
||||
import { createI18n } from 'vue-i18n';
|
||||
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import TaskTodoPanel from './TaskTodoPanel.vue';
|
||||
import type { ShippingTaskDetail } from '@/features/chat/types/shipping.api.types';
|
||||
|
||||
const matchInventory = vi.fn().mockResolvedValue({});
|
||||
const refreshBadge = vi.fn().mockResolvedValue(undefined);
|
||||
|
||||
vi.mock('@/features/chat/api/shipping.api', () => ({
|
||||
confirmWorkspaceShippingCustomer: vi.fn(),
|
||||
confirmWorkspaceShippingInventorySource: vi.fn(),
|
||||
freezeWorkspaceShippingOrder: vi.fn(),
|
||||
generateWorkspaceShippingExcel: vi.fn(),
|
||||
listWorkspaceShippingCustomerOptions: vi.fn().mockResolvedValue([]),
|
||||
matchWorkspaceShippingInventory: (...args: unknown[]) => matchInventory(...args),
|
||||
retryWorkspaceShippingUpload: vi.fn(),
|
||||
submitWorkspaceShippingDecision: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/features/workspace/api/shipping-tasks.api', () => ({
|
||||
downloadWorkspaceShippingExcelFile: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/features/workspace/composables/useShippingTodoBadge', () => ({
|
||||
refreshShippingTodoBadge: (...args: unknown[]) => refreshBadge(...args),
|
||||
}));
|
||||
|
||||
vi.mock('@/features/shipping-process-gates/components/ProcessGateRecoveryCard.vue', () => ({
|
||||
default: {
|
||||
name: 'ProcessGateRecoveryCard',
|
||||
props: ['summary', 'canHandle'],
|
||||
template: '<div data-testid="gate-stub" :data-can-handle="canHandle" />',
|
||||
},
|
||||
}));
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: 'zh-CN',
|
||||
messages: {
|
||||
'zh-CN': {
|
||||
errors: {
|
||||
codes: {
|
||||
SHIPPING_PROCESSING_TASK_OWNERSHIP_MISMATCH: '归属不匹配',
|
||||
},
|
||||
},
|
||||
workspace: {
|
||||
shippingNotice: {
|
||||
todo: {
|
||||
currentTodo: '待办',
|
||||
adminViewOnly: '只读',
|
||||
waitingManualUploadNote: '上传',
|
||||
},
|
||||
actions: {
|
||||
failed: '失败',
|
||||
freezeOrder: '冻结',
|
||||
freezeConfirm: '确认',
|
||||
},
|
||||
loading: '加载中',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
function detail(): ShippingTaskDetail {
|
||||
return {
|
||||
task_no: 'SN-1',
|
||||
ui_state: {
|
||||
summary: { title: 't', message: 'm' },
|
||||
action_buttons: [],
|
||||
checkpoint_kind: 'inventory',
|
||||
process_gate: null,
|
||||
},
|
||||
} as unknown as ShippingTaskDetail;
|
||||
}
|
||||
|
||||
describe('TaskTodoPanel actionsExecutable', () => {
|
||||
beforeEach(() => {
|
||||
matchInventory.mockClear();
|
||||
refreshBadge.mockClear();
|
||||
});
|
||||
|
||||
it('invokes match API when gateCanHandle=false but actionsExecutable=true', async () => {
|
||||
const wrapper = mount(TaskTodoPanel, {
|
||||
props: {
|
||||
detail: detail(),
|
||||
gateCanHandle: false,
|
||||
actionsExecutable: true,
|
||||
hidePrimaryActions: true,
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
expect(wrapper.get('[data-testid="gate-stub"]').attributes('data-can-handle')).toBe('false');
|
||||
await (wrapper.vm as { invokeActionByCode: (id: string) => Promise<void> }).invokeActionByCode('match_inventory');
|
||||
await flushPromises();
|
||||
expect(matchInventory).toHaveBeenCalledWith('SN-1', undefined);
|
||||
});
|
||||
|
||||
it('blocks fulfillment invoke when expectedNoticeTaskNo mismatches', async () => {
|
||||
const wrapper = mount(TaskTodoPanel, {
|
||||
props: {
|
||||
detail: detail(),
|
||||
gateCanHandle: false,
|
||||
actionsExecutable: true,
|
||||
hidePrimaryActions: true,
|
||||
expectedNoticeTaskNo: 'SN-OTHER',
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await (wrapper.vm as { invokeActionByCode: (id: string) => Promise<void> }).invokeActionByCode('match_inventory');
|
||||
await flushPromises();
|
||||
expect(matchInventory).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('no-ops invokeActionByCode when actionsExecutable=false', async () => {
|
||||
const wrapper = mount(TaskTodoPanel, {
|
||||
props: {
|
||||
detail: detail(),
|
||||
gateCanHandle: false,
|
||||
actionsExecutable: false,
|
||||
hidePrimaryActions: true,
|
||||
},
|
||||
global: { plugins: [i18n] },
|
||||
});
|
||||
await (wrapper.vm as { invokeActionByCode: (id: string) => Promise<void> }).invokeActionByCode('match_inventory');
|
||||
await flushPromises();
|
||||
expect(matchInventory).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
@@ -2,8 +2,8 @@
|
||||
* features/workspace/shipping-task-center/TaskTodoPanel.vue
|
||||
* 用途:渲染统一 Gate 恢复卡片与 STP 履约待办说明(表单/弹窗入口)。
|
||||
* 依赖:ProcessGateRecoveryCard、shipping.api、shipping-tasks.api、ManualUploadEvidenceDialog。
|
||||
* 逻辑:优先展示 ui_state.process_gate 阻断信息;hidePrimaryActions=true 时不渲染平级主按钮
|
||||
* (由订单处理工作台统一 ActionBar 输出,UI-01 / BE-05);对话框与登记表单仍由此面板承接。
|
||||
* 逻辑:gateCanHandle 控制 Gate 卡写按钮;actionsExecutable 控制 invokeActionByCode / 对话框写;
|
||||
* hidePrimaryActions=true 时不渲染 action_buttons(订单处理工作台写入口仅 Footer)。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
@@ -17,6 +17,7 @@ import type {
|
||||
ShippingInventorySourceCandidate,
|
||||
ShippingTaskDetail,
|
||||
} from '@/features/chat/types/shipping.api.types';
|
||||
import { BusinessError } from '@/shared/api/client';
|
||||
import {
|
||||
confirmWorkspaceShippingCustomer,
|
||||
confirmWorkspaceShippingInventorySource,
|
||||
@@ -26,6 +27,7 @@ import {
|
||||
matchWorkspaceShippingInventory,
|
||||
retryWorkspaceShippingUpload,
|
||||
submitWorkspaceShippingDecision,
|
||||
type ShippingFulfillmentOwnershipContext,
|
||||
} from '@/features/chat/api/shipping.api';
|
||||
import { downloadWorkspaceShippingExcelFile } from '@/features/workspace/api/shipping-tasks.api';
|
||||
import { refreshShippingTodoBadge } from '@/features/workspace/composables/useShippingTodoBadge';
|
||||
@@ -37,11 +39,31 @@ import { gateSummaryIndicatesManualUpload } from '@/features/chat/shipping/shipp
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
detail: ShippingTaskDetail;
|
||||
canHandle: boolean;
|
||||
/** 为 true 时隐藏主按钮区与 Gate 卡内主操作(统一进度 ActionBar 已输出)。 */
|
||||
/** 兼容旧调用:未显式传 gate/actions 时两者跟随 canHandle。 */
|
||||
canHandle?: boolean;
|
||||
/** Gate 卡是否允许写(订单处理工作台恒为 false)。 */
|
||||
gateCanHandle?: boolean;
|
||||
/** Footer/Resolver 委托的 invokeActionByCode 是否可执行写。 */
|
||||
actionsExecutable?: boolean;
|
||||
/** 为 true 时隐藏全部 action_buttons(订单处理工作台写入口仅 Footer)。 */
|
||||
hidePrimaryActions?: boolean;
|
||||
/** 工作台权威正式 Notice 号;与 detail.task_no 不一致时禁止履约写。 */
|
||||
expectedNoticeTaskNo?: string | null;
|
||||
/** 工作台权威 OT 号,随履约 API 校验归属。 */
|
||||
expectedOrderTaskNo?: string | null;
|
||||
/** 当前 Review Case 号。 */
|
||||
expectedReviewCaseNo?: string | null;
|
||||
/** 当前 Extraction Run 号。 */
|
||||
expectedRunNo?: string | null;
|
||||
}>(), {
|
||||
canHandle: undefined,
|
||||
gateCanHandle: undefined,
|
||||
actionsExecutable: undefined,
|
||||
hidePrimaryActions: false,
|
||||
expectedNoticeTaskNo: null,
|
||||
expectedOrderTaskNo: null,
|
||||
expectedReviewCaseNo: null,
|
||||
expectedRunNo: null,
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -173,12 +195,13 @@ const UNIFIED_OWNED_ACTION_IDS = new Set([
|
||||
]);
|
||||
|
||||
const visibleActions = computed(() => {
|
||||
// [STEP] 订单处理工作台:写操作仅 Footer;不渲染 Notice action_buttons(D1)。
|
||||
if (props.hidePrimaryActions) return [];
|
||||
// [STEP] Gate 阻断时后端已清零 action_buttons;前端再兜底隐藏,避免双真相。
|
||||
if (hasBlockingGate.value) return [];
|
||||
return actionButtons.value.filter((action) => {
|
||||
const id = String(action.id || '');
|
||||
// [UI-01 / BE-05] 统一 ActionBar 已表达的动作不再重复渲染;未映射的履约动作仍由本面板承接。
|
||||
if (props.hidePrimaryActions && UNIFIED_OWNED_ACTION_IDS.has(id)) {
|
||||
if (UNIFIED_OWNED_ACTION_IDS.has(id)) {
|
||||
return false;
|
||||
}
|
||||
if (!allowedIds.value.has(id) || !isActionAllowedForCheckpoint(id, checkpointKind.value)) {
|
||||
@@ -190,8 +213,14 @@ const visibleActions = computed(() => {
|
||||
return true;
|
||||
});
|
||||
});
|
||||
/** Gate 卡在统一进度存在时仍可执行业务恢复(客户确认等),但避免与 ActionBar 重复的 next_action。 */
|
||||
const gateCanHandle = computed(() => props.canHandle);
|
||||
/** Gate 卡写权限;订单处理工作台传入 false 保持只读。 */
|
||||
const resolvedGateCanHandle = computed(() => (
|
||||
props.gateCanHandle !== undefined ? Boolean(props.gateCanHandle) : Boolean(props.canHandle)
|
||||
));
|
||||
/** Footer 委托写权限。 */
|
||||
const resolvedActionsExecutable = computed(() => (
|
||||
props.actionsExecutable !== undefined ? Boolean(props.actionsExecutable) : Boolean(props.canHandle)
|
||||
));
|
||||
/**
|
||||
* 动作成功后刷新详情并更新导航徽标。
|
||||
*/
|
||||
@@ -338,13 +367,44 @@ async function onFreezeConfirm() {
|
||||
pendingFreezeVersion.value = null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 组装履约 API 归属上下文(仅非空字段)。
|
||||
*/
|
||||
function ownershipContext(): ShippingFulfillmentOwnershipContext | undefined {
|
||||
const ctx: ShippingFulfillmentOwnershipContext = {};
|
||||
const ot = String(props.expectedOrderTaskNo || '').trim();
|
||||
const caseNo = String(props.expectedReviewCaseNo || '').trim();
|
||||
const run = String(props.expectedRunNo || '').trim();
|
||||
if (ot) ctx.expectedOrderTaskNo = ot;
|
||||
if (caseNo) ctx.expectedReviewCaseNo = caseNo;
|
||||
if (run) ctx.expectedRunNo = run;
|
||||
return (ctx.expectedOrderTaskNo || ctx.expectedReviewCaseNo || ctx.expectedRunNo) ? ctx : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* 履约写前校验正式任务号与工作台权威上下文一致。
|
||||
*
|
||||
* @returns 通过为 true;失败已提示并触发 refreshed
|
||||
*/
|
||||
async function assertFulfillmentOwnership(): Promise<boolean> {
|
||||
const expectedNotice = String(props.expectedNoticeTaskNo || '').trim();
|
||||
const actualNotice = String(props.detail.task_no || '').trim();
|
||||
if (expectedNotice && actualNotice && expectedNotice !== actualNotice) {
|
||||
msg.warning(t('errors.codes.SHIPPING_PROCESSING_TASK_OWNERSHIP_MISMATCH'));
|
||||
emit('refreshed');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行后端允许的动作;人工上传/客户/库存源/冻结走对话框,其余走对应工作台 API。
|
||||
*/
|
||||
async function runAction(action: ShippingChatAction) {
|
||||
if (!props.canHandle || busyId.value) return;
|
||||
if (!resolvedActionsExecutable.value || busyId.value) return;
|
||||
const id = String(action.id || '');
|
||||
if (id === 'mark_manual_uploaded') {
|
||||
if (!(await assertFulfillmentOwnership())) return;
|
||||
manualUploadOpen.value = true;
|
||||
return;
|
||||
}
|
||||
@@ -357,38 +417,47 @@ async function runAction(action: ShippingChatAction) {
|
||||
return;
|
||||
}
|
||||
if (id === 'confirm_inventory_source') {
|
||||
if (!(await assertFulfillmentOwnership())) return;
|
||||
await runConfirmInventorySource(action);
|
||||
return;
|
||||
}
|
||||
if (id === 'freeze_order') {
|
||||
if (!(await assertFulfillmentOwnership())) return;
|
||||
openFreezeDialog();
|
||||
return;
|
||||
}
|
||||
busyId.value = id;
|
||||
try {
|
||||
if (!(await assertFulfillmentOwnership())) return;
|
||||
const ownership = ownershipContext();
|
||||
if (id === 'download_excel' || id === 'export') {
|
||||
await downloadWorkspaceShippingExcelFile(props.detail.task_no);
|
||||
await afterSuccess();
|
||||
return;
|
||||
}
|
||||
if (id === 'generate_excel') {
|
||||
await generateWorkspaceShippingExcel(props.detail.task_no);
|
||||
await generateWorkspaceShippingExcel(props.detail.task_no, ownership);
|
||||
await afterSuccess();
|
||||
return;
|
||||
}
|
||||
if (id === 'match_inventory' || id === 'rematch') {
|
||||
await matchWorkspaceShippingInventory(props.detail.task_no);
|
||||
await matchWorkspaceShippingInventory(props.detail.task_no, ownership);
|
||||
await afterSuccess();
|
||||
return;
|
||||
}
|
||||
if (id === 'retry_upload') {
|
||||
await retryWorkspaceShippingUpload(props.detail.task_no);
|
||||
await retryWorkspaceShippingUpload(props.detail.task_no, ownership);
|
||||
await afterSuccess();
|
||||
return;
|
||||
}
|
||||
await submitWorkspaceShippingDecision(props.detail.task_no, id);
|
||||
await afterSuccess();
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof BusinessError && e.code === 'SHIPPING_PROCESSING_TASK_OWNERSHIP_MISMATCH') {
|
||||
msg.warning(t('errors.codes.SHIPPING_PROCESSING_TASK_OWNERSHIP_MISMATCH'));
|
||||
emit('refreshed');
|
||||
return;
|
||||
}
|
||||
msg.warning(e instanceof Error ? e.message : t('workspace.shippingNotice.actions.failed'));
|
||||
} finally {
|
||||
busyId.value = null;
|
||||
@@ -421,7 +490,7 @@ defineExpose({
|
||||
<div class="space-y-3">
|
||||
<ProcessGateRecoveryCard
|
||||
:summary="processGateSummary"
|
||||
:can-handle="gateCanHandle"
|
||||
:can-handle="resolvedGateCanHandle"
|
||||
:navigation-context="{
|
||||
agentId: detail.owner_agent_id != null ? String(detail.owner_agent_id) : undefined,
|
||||
conversationId: detail.conversation_id || undefined,
|
||||
@@ -446,7 +515,7 @@ defineExpose({
|
||||
<p v-if="summary.pause_reason" class="mt-1 text-xs text-amber-700">
|
||||
{{ summary.pause_reason }}
|
||||
</p>
|
||||
<div v-if="!canHandle" class="mt-3 text-xs text-muted">
|
||||
<div v-if="!resolvedActionsExecutable" class="mt-3 text-xs text-muted">
|
||||
{{ $t('workspace.shippingNotice.todo.adminViewOnly') }}
|
||||
</div>
|
||||
<div v-else-if="visibleActions.length" class="mt-3 flex flex-wrap gap-2">
|
||||
@@ -477,7 +546,7 @@ defineExpose({
|
||||
v-model:open="manualUploadOpen"
|
||||
:task-no="detail.task_no"
|
||||
:artifact-id="currentExportArtifactId"
|
||||
:disabled="!canHandle"
|
||||
:disabled="!resolvedActionsExecutable"
|
||||
@success="afterSuccess"
|
||||
/>
|
||||
<ShippingCustomerConfirmDialog
|
||||
|
||||
Reference in new issue
Block a user