feat(shipping-notice): 新增发货批次和任务管理功能,支持批次创建与任务处理

This commit is contained in:
hugo committed 2026-06-17 20:45:19 +08:00
1 parent 457f0f4e5e
commit 634dee4b81
81 files changed
+9088 -3625

No files matched your search

@@ -22,6 +22,7 @@ export interface ChatPageConversationContext {
onConversationLoadFailed: () => Promise<void>;
isShippingNoticeAgent: ComputedRef<boolean>;
shippingTaskIdFromQuery: ComputedRef<string>;
shippingBatchNoFromQuery?: ComputedRef<string>;
clearHistory: () => void;
clearAttachments: () => void;
input: Ref<string>;
@@ -51,7 +52,11 @@ export function createChatPageConversationApi(ctx: ChatPageConversationContext)
} catch (e) {
console.error('Failed to load conversation', e);
await ctx.onConversationLoadFailed();
if (ctx.isShippingNoticeAgent.value && ctx.shippingTaskIdFromQuery.value && !ctx.isThinking.value) {
if (
ctx.isShippingNoticeAgent.value
&& (ctx.shippingTaskIdFromQuery.value || ctx.shippingBatchNoFromQuery?.value)
&& !ctx.isThinking.value
) {
return;
}
ctx.deps.msg.warning(ctx.deps.t('chat.historyLoadFailed'));
@@ -1,4 +1,4 @@
/**
/**
* 对话页:子组件 inject 用的 handlers 对象打包(请假表单、出货映射、消息气泡)。
*/
import type { LeaveMessageHandlers } from '../components/messages/LeaveMessageBlock.vue';
@@ -31,8 +31,14 @@ type ShippingHandlerSource = Pick<
| 'normalizeShippingHeaderForDisplay'
| 'hasShippingInventorySampleRows'
| 'getShippingInventorySampleRowText'
| 'getShippingParseReviewPayload'
| 'getShippingMatchResultPayload'
| 'reuploadShippingInventoryFromMappingForm'
| 'applyShippingInventoryMappingForm'
| 'updateShippingParseReviewHeader'
| 'updateShippingParseReviewLine'
| 'addShippingParseReviewLine'
| 'removeShippingParseReviewLine'
>;
/** 请假消息块 handlers(LeaveMessageBlock) */
@@ -62,8 +68,16 @@ export function createShippingMappingHandlers(shipping: ShippingHandlerSource):
normalizeHeader: shipping.normalizeShippingHeaderForDisplay,
hasSampleRows: shipping.hasShippingInventorySampleRows,
getSampleRowText: shipping.getShippingInventorySampleRowText,
getParseReviewPayload: shipping.getShippingParseReviewPayload,
getMatchResultPayload: shipping.getShippingMatchResultPayload,
reupload: shipping.reuploadShippingInventoryFromMappingForm,
apply: shipping.applyShippingInventoryMappingForm,
updateParseReviewHeader: shipping.updateShippingParseReviewHeader,
updateParseReviewLine: shipping.updateShippingParseReviewLine,
updateHeader: shipping.updateShippingParseReviewHeader,
updateLine: shipping.updateShippingParseReviewLine,
addLine: shipping.addShippingParseReviewLine,
removeLine: shipping.removeShippingParseReviewLine,
};
}
@@ -1,10 +1,11 @@
/**
/**
* 对话页:Markdown 渲染、消息可见性判断、PLM/请假链接点击。
*/
import { computed } from 'vue';
import { marked } from 'marked';
import type { ChatMessageBubbleHandlers } from '../components/messages/ChatMessageBubble.vue';
import type { ChatMessage, SourceFileLink } from '../types/chat.types';
import type { ShippingMatchResultPayload } from '../types/shipping.types';
import type { Ref } from 'vue';
marked.setOptions({ gfm: true, breaks: true });
@@ -24,6 +25,7 @@ export interface ChatPageMarkdownContext {
getSourceMeta: ChatMessageBubbleHandlers['getSourceMeta'];
getSourceBrief: ChatMessageBubbleHandlers['getSourceBrief'];
getShippingInventoryMappingPayload: ChatMessageBubbleHandlers['getShippingInventoryMappingPayload'];
getShippingMatchResultPayload: (msg: ChatMessage) => ShippingMatchResultPayload | null;
canOpenQueryPreview: ChatMessageBubbleHandlers['canOpenQueryPreview'];
getQueryPreviewSummary: ChatMessageBubbleHandlers['getQueryPreviewSummary'];
openQueryPreviewDialog: ChatMessageBubbleHandlers['openQueryPreviewDialog'];
@@ -87,6 +89,7 @@ export function createChatPageMarkdownApi(ctx: ChatPageMarkdownContext) {
renderMarkdown,
onMarkdownClick: handleChatMarkdownClick,
getShippingInventoryMappingPayload: ctx.getShippingInventoryMappingPayload,
getShippingMatchResultPayload: ctx.getShippingMatchResultPayload,
canOpenQueryPreview: ctx.canOpenQueryPreview,
getQueryPreviewSummary: ctx.getQueryPreviewSummary,
openQueryPreviewDialog: ctx.openQueryPreviewDialog,