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
@@ -722,18 +722,10 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
});
|
||||
|
||||
const { executeShippingDecision, executeShippingManualUpload } = createShippingDecisionHandlers({
|
||||
messages,
|
||||
conversationId,
|
||||
history,
|
||||
isShippingNoticeAgent,
|
||||
currentAgentId,
|
||||
getActiveShippingTaskId,
|
||||
getActiveShippingBatchNo: () => resolvedShippingBatchNo.value || shippingBatchNoFromQuery.value || '',
|
||||
loadHistory,
|
||||
refreshShippingActions,
|
||||
startChatTurn,
|
||||
msg,
|
||||
t,
|
||||
refreshShippingActions,
|
||||
msg,
|
||||
t,
|
||||
});
|
||||
|
||||
const {
|
||||
@@ -970,7 +962,6 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
const {
|
||||
handleShippingAutoUploadFile,
|
||||
handleShippingAutoUploadNoticeBatch,
|
||||
openShippingInventoryPicker,
|
||||
openShippingNoticePicker,
|
||||
selectShippingInventoryUploadTask,
|
||||
cancelShippingInventoryTaskSelection,
|
||||
@@ -1019,20 +1010,16 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
|
||||
const { handleShippingMenuAction, handleShippingActionClick } = createShippingMenuHandlers({
|
||||
isThinking,
|
||||
currentAgentId,
|
||||
getActiveShippingTaskId,
|
||||
getActiveShippingBatchNo: () => resolvedShippingBatchNo.value || shippingBatchNoFromQuery.value || '',
|
||||
messages,
|
||||
sendShippingMenuMessage,
|
||||
openShippingInventoryPicker,
|
||||
openShippingNoticePicker,
|
||||
openShippingCustomerDialog,
|
||||
executeShippingDecision,
|
||||
executeShippingManualUpload,
|
||||
refreshShippingActions,
|
||||
startChatTurn,
|
||||
msg,
|
||||
t,
|
||||
msg,
|
||||
t,
|
||||
});
|
||||
|
||||
const { tryHandleShippingSend, tryHandleShippingAttachmentAutoFlow } = createShippingSendHandlers({
|
||||
@@ -1058,7 +1045,6 @@ export function useChatShipping(options: UseChatShippingOptions) {
|
||||
loadHistory,
|
||||
sendShippingMenuMessage,
|
||||
startChatTurn,
|
||||
openShippingInventoryPicker,
|
||||
executeShippingDecision,
|
||||
executeShippingManualUpload,
|
||||
handleShippingMenuAction,
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* features/chat/composables/useProcurementContractChat.spec.ts
|
||||
* 用途:验证采购合同双文件选择后的即时可见状态。
|
||||
* 依赖:Vitest、Vue refs、useProcurementContractChat。
|
||||
* 逻辑:我方原合同选择后即展示本地文件名,FileAsset 上传仅补充可提交的资产编号。
|
||||
*/
|
||||
import { computed, ref } from 'vue';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { useProcurementContractChat } from './useProcurementContractChat';
|
||||
|
||||
const { uploadFileAsset } = vi.hoisted(() => ({ uploadFileAsset: vi.fn() }));
|
||||
|
||||
vi.mock('@/shared/api/file-assets.api', () => ({ uploadFileAsset }));
|
||||
|
||||
/** 构建只覆盖原合同选择流程的最小上下文。 */
|
||||
function createProcurementChat() {
|
||||
return useProcurementContractChat({
|
||||
currentAgent: ref({ agent_code: 'procurement_contract_review' }),
|
||||
currentAgentId: computed(() => 1),
|
||||
attachments: ref([]),
|
||||
messages: ref([]),
|
||||
isThinking: ref(false),
|
||||
isUploadingAttachments: ref(false),
|
||||
input: ref(''),
|
||||
clearAttachments: vi.fn(),
|
||||
saveLocalMessageToBackend: vi.fn(async () => undefined),
|
||||
loadHistory: vi.fn(async () => undefined),
|
||||
msg: { warning: vi.fn(), success: vi.fn(), info: vi.fn() },
|
||||
t: (key: string) => key,
|
||||
});
|
||||
}
|
||||
|
||||
describe('useProcurementContractChat original contract selection', () => {
|
||||
it('shows the selected original contract before its FileAsset upload finishes', async () => {
|
||||
let resolveUpload: ((value: { asset_no: string; original_filename: string }) => void) | undefined;
|
||||
uploadFileAsset.mockImplementation(() => new Promise((resolve) => { resolveUpload = resolve; }));
|
||||
const chat = createProcurementChat();
|
||||
const file = new File(['original'], '我方原合同.md', { type: 'text/markdown' });
|
||||
|
||||
const selecting = chat.handleOriginalContractSelected({ target: { files: [file], value: 'selected' } } as unknown as Event);
|
||||
|
||||
// 断言上传尚未完成时 UI 仍能立刻渲染已选择的我方原合同。
|
||||
expect(chat.originalContractName.value).toBe('我方原合同.md');
|
||||
expect(chat.originalContractAssetNo.value).toBeNull();
|
||||
|
||||
resolveUpload?.({ asset_no: 'FA-ORIGINAL-1', original_filename: '我方原合同.md' });
|
||||
await selecting;
|
||||
expect(chat.originalContractAssetNo.value).toBe('FA-ORIGINAL-1');
|
||||
});
|
||||
});
|
||||
@@ -131,12 +131,18 @@ export function useProcurementContractChat(options: ProcurementContractChatOptio
|
||||
const file = input.files?.[0];
|
||||
input.value = '';
|
||||
if (!file) return;
|
||||
// [STEP 1] 选择即展示,避免 FileAsset 网络上传期间输入栏看起来没有响应。
|
||||
originalContractAssetNo.value = null;
|
||||
originalContractName.value = file.name;
|
||||
options.isUploadingAttachments.value = true;
|
||||
try {
|
||||
const asset = await uploadFileAsset(file);
|
||||
// [STEP 2] 上传完成后才允许作为正式比对基准提交。
|
||||
originalContractAssetNo.value = asset.asset_no;
|
||||
originalContractName.value = asset.original_filename || file.name;
|
||||
} catch (e: unknown) {
|
||||
// 上传失败的临时卡片不可作为基准,必须移除,避免显示与提交状态不一致。
|
||||
clearOriginalContract();
|
||||
options.msg.warning(e instanceof Error ? e.message : options.t('chat.procurementContract.uploadFailed'));
|
||||
} finally {
|
||||
options.isUploadingAttachments.value = false;
|
||||
|
||||
Reference in new issue
Block a user