feat(shipping-notice,receipt-report): 新增收料报表功能并优化发货通知流程
清理废弃的shipping xfa ocr automark相关代码和job配置 新增收料报表管理的前端页面、路由和侧边栏入口 新增后端收料报表配置接口、数据库模型和RPA脚本 优化发货通知流程的重试策略,将shipping相关job默认不自动重试 移除废弃的库存源确认相关逻辑,更新流程门禁规则 重构订单模板的值适配器模块,新增坐标OCR值适配器 清理前端shipping菜单和action的废弃选项 更新相关文档和测试用例,调整.gitignore忽略规则
This commit is contained in:
1 parent
260465b72d
commit
1b6483a4ea
466 files changed
+32115
-33796
No files matched your search
+9
-48
@@ -11,20 +11,18 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import TaskTodoPanel from './TaskTodoPanel.vue';
|
||||
import type { ShippingTaskDetail } from '@/features/chat/types/shipping.api.types';
|
||||
|
||||
const postGateAction = vi.fn().mockResolvedValue({});
|
||||
const postGateAction = vi.fn().mockResolvedValue({ dispatch: 'sync' });
|
||||
const getProcessExecution = vi.fn();
|
||||
const refreshBadge = vi.fn().mockResolvedValue(undefined);
|
||||
|
||||
vi.mock('@/features/chat/api/shipping.api', () => ({
|
||||
confirmWorkspaceShippingCustomer: vi.fn(),
|
||||
confirmWorkspaceShippingInventorySource: vi.fn(),
|
||||
freezeWorkspaceShippingOrder: vi.fn(),
|
||||
listWorkspaceShippingCustomerOptions: vi.fn().mockResolvedValue([]),
|
||||
retryWorkspaceShippingUpload: vi.fn(),
|
||||
submitWorkspaceShippingDecision: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock('@/features/shipping-process-gates/api/process-gates.api', () => ({
|
||||
postWorkspaceProcessGateAction: (...args: unknown[]) => postGateAction(...args),
|
||||
getWorkspaceProcessExecution: (...args: unknown[]) => getProcessExecution(...args),
|
||||
}));
|
||||
|
||||
vi.mock('@/features/workspace/api/shipping-tasks.api', () => ({
|
||||
@@ -80,6 +78,7 @@ function detail(): ShippingTaskDetail {
|
||||
actions: {
|
||||
primary: {
|
||||
code: 'retry_inventory_matching', kind: 'recovery', enabled: true,
|
||||
label: '重新匹配', dispatch: 'mutation',
|
||||
requires_confirmation: false,
|
||||
},
|
||||
secondary: [],
|
||||
@@ -99,61 +98,23 @@ function detail(): ShippingTaskDetail {
|
||||
describe('TaskTodoPanel actionsExecutable', () => {
|
||||
beforeEach(() => {
|
||||
postGateAction.mockClear();
|
||||
postGateAction.mockResolvedValue({ dispatch: 'sync' });
|
||||
getProcessExecution.mockReset();
|
||||
refreshBadge.mockClear();
|
||||
});
|
||||
|
||||
it('invokes formal Gate Action when gateCanHandle=false but actionsExecutable=true', async () => {
|
||||
it('does not expose a hidden action-code executor when the Gate card is read-only', async () => {
|
||||
const wrapper = mount(TaskTodoPanel, {
|
||||
props: {
|
||||
detail: detail(),
|
||||
gateCanHandle: false,
|
||||
actionsExecutable: true,
|
||||
hidePrimaryActions: true,
|
||||
hidePrimaryActions: false,
|
||||
},
|
||||
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('retry_inventory_matching');
|
||||
await flushPromises();
|
||||
expect(postGateAction).toHaveBeenCalledWith(
|
||||
'SPE-1',
|
||||
'inventory_matching',
|
||||
expect.objectContaining({
|
||||
action_code: 'retry_inventory_matching',
|
||||
expected_gate_version: 3,
|
||||
idempotency_key: expect.any(String),
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
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('retry_inventory_matching');
|
||||
await flushPromises();
|
||||
expect(postGateAction).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('retry_inventory_matching');
|
||||
await flushPromises();
|
||||
expect((wrapper.vm as { invokeActionByCode?: unknown }).invokeActionByCode).toBeUndefined();
|
||||
expect(postGateAction).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user