feat(shipping-notice): 新增库存确认来源接口及相关逻辑

This commit is contained in:
hugo committed 2026-07-13 21:53:45 +08:00
1 parent a31735b689
commit 0a9bd6415d
69 files changed
+8442 -775

No files matched your search

@@ -66,7 +66,7 @@ export interface ShippingSendHandlerContext {
isShippingShortageQueryIntent: (text: string) => boolean;
queryShippingShortageDetails: (taskNo?: string, displayText?: string) => Promise<boolean>;
msg: { warning: (text: string) => void; info: (text: string) => void };
t: (key: string) => string;
t: (key: string, ...args: unknown[]) => string;
}
/**
@@ -114,13 +114,13 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
const label = String(hit?.display_name || sourceCode).trim();
await ctx.handleShippingMenuAction({
id: 'confirm_inventory_source',
message: `确认库存查询来源:${label}`,
message: ctx.t('chat.shippingNoticeUi.inventorySource.confirmDisplay', { label }),
label,
source_code: sourceCode,
});
return true;
} catch (e: unknown) {
const errorMessage = e instanceof Error ? e.message : '确认库存源失败';
const errorMessage = e instanceof Error ? e.message : ctx.t('chat.shippingNoticeUi.inventorySource.confirmFailed');
ctx.msg.warning(errorMessage);
return true;
}