feat(shipping): 实现订单批处理聊天聚合展示与优化后端逻辑

This commit is contained in:
hugo committed 2026-08-13 17:40:43 +08:00
1 parent 11cef575b4
commit 523b791c92
38 files changed
+2868 -414

No files matched your search

@@ -125,9 +125,9 @@ describe('ShippingConversationProcessingCard', () => {
await flushPromises();
expect(wrapper.find('[data-testid="shipping-conversation-processing-card"]').exists()).toBe(true);
expect(wrapper.find('[data-testid="shipping-processing-group-needs_action"]').exists()).toBe(true);
expect(wrapper.find('[data-testid="shipping-processing-group-failed"]').exists()).toBe(true);
expect(wrapper.find('[data-testid="shipping-processing-group-processing"]').exists()).toBe(true);
expect(wrapper.text()).toContain('需要你处理 · 1 个任务');
expect(wrapper.text()).toContain('异常 / 失败 · 1 个任务');
expect(wrapper.text()).toContain('系统处理中 · 1 个任务');
expect(wrapper.text()).toContain('刚刚创建');
@@ -441,20 +441,36 @@ describe('ShippingConversationProcessingCard', () => {
expect(wrapper.findAll('[data-testid="shipping-conversation-processing-card"]')).toHaveLength(1);
});
it('renders pending order_intake work items above task groups', async () => {
it('renders an EML order_intake in the unified failed group rather than the removed intake side path', async () => {
const wrapper = mount(ShippingConversationProcessingCard, {
props: {
projection: null,
projection: {
summary: { total_tasks: 1, total_files: 1, processing: 0, needs_action: 1, completed: 0, history: 0 },
needs_action: [{
user_task_no: 'SNI-1',
group: 'needs_action',
userGroup: 'failed',
status_label: 'failed',
title: 'mail.eml',
file_count: 1,
run_no: null,
can_append: false,
}],
processing: [],
completed: [],
history: [],
},
workItems: [{
workItemType: 'order_intake',
workItemNo: 'SNI-1',
sourceType: 'direct_pdf',
sourceType: 'eml',
rootOrderTaskNo: null,
shippingNoticeNo: null,
conversationId: 'conv-1',
submissionNo: 'SOS-1',
intakeNo: 'SNI-1',
status: 'failed',
userGroup: 'failed',
stage: 'document_parsing',
progressVersion: 1,
lastActivityAt: '2026-08-04T12:00:00Z',
@@ -484,16 +500,10 @@ describe('ShippingConversationProcessingCard', () => {
global: { plugins: [i18n] },
});
await flushPromises();
expect(wrapper.find('[data-testid="shipping-processing-group-order-intake"]').exists()).toBe(true);
expect(wrapper.find('[data-testid="shipping-processing-intake-SNI-1"]').exists()).toBe(true);
expect(wrapper.text()).toContain('po.pdf');
expect(wrapper.find('[data-testid="shipping-processing-intake-recovery"]').exists()).toBe(true);
expect(wrapper.text()).toContain('SHIPPING_NOTICE.INTAKE_PARSE_FAILED');
await wrapper.find('[data-testid="shipping-processing-intake-action-retry_parse"]').trigger('click');
expect(wrapper.emitted('intakeAction')?.[0]?.[0]).toMatchObject({
action: 'retry_parse',
item: { workItemNo: 'SNI-1' },
});
expect(wrapper.find('[data-testid="shipping-processing-group-failed"]').exists()).toBe(true);
expect(wrapper.find('[data-testid="shipping-processing-task-SNI-1"]').exists()).toBe(true);
expect(wrapper.find('[data-testid="shipping-processing-group-order-intake"]').exists()).toBe(false);
expect(wrapper.text()).toContain('重试解析');
});
it('keeps a human Gate action visible before and after selecting its task', async () => {