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

@@ -6,6 +6,11 @@
import { resolveShippingNumericChoice } from './shippingMenu';
import type { ShippingMenuAction } from '../types/shipping.types';
export interface ShippingTaskSwitchIntent {
mode: 'next' | 'prev' | 'task';
taskNo?: string;
}
export function parseShippingColumnMappingFromText(content: string): Record<string, string> | null {
const raw = String(content || '').trim();
if (!raw) return null;
@@ -88,4 +93,20 @@ export function isShippingDownloadExcelIntent(text: string): boolean {
].some((pattern) => pattern.test(normalized));
}
export function parseShippingTaskSwitchIntent(text: string): ShippingTaskSwitchIntent | null {
const normalized = String(text || '').trim();
if (!normalized) return null;
const taskMatch = normalized.match(/SN-\d{8}-[A-F0-9]{8}/i);
if (taskMatch?.[0] && /(切|切到|切换|goto|go to|switch)/i.test(normalized)) {
return { mode: 'task', taskNo: taskMatch[0].toUpperCase() };
}
if (/^(下一票|下一单|下一个|next)$/i.test(normalized) || /切到下一票/.test(normalized)) {
return { mode: 'next' };
}
if (/^(上一票|上一单|上一个|prev|previous)$/i.test(normalized) || /切到上一票/.test(normalized)) {
return { mode: 'prev' };
}
return null;
}
export type { ShippingMenuAction };