feat(shipping-notice): 支持发货通知解析延后至 Dify 画布,优化任务创建流程
This commit is contained in:
1 parent
d46d61bfa1
commit
70e8f700ff
38 files changed
+3215
-714
No files matched your search
@@ -29,13 +29,37 @@ export const SHIPPING_WORKFLOW_STEP_LABELS = [
|
||||
'chat.shippingNoticeUi.stepper.uploadFreight',
|
||||
] as const;
|
||||
|
||||
const CURRENT_STEP_INDEX_MAP: Record<string, number> = {
|
||||
step1_notice_submit: 0,
|
||||
step2_parse_confirm: 1,
|
||||
step3_inventory_prepare: 2,
|
||||
step2_inventory_prepare: 2,
|
||||
step4_align_confirm: 3,
|
||||
step5_match_inventory: 4,
|
||||
step3_inventory_match: 4,
|
||||
step4_shortage_review: 4,
|
||||
step6_generate_file: 5,
|
||||
step5_export_excel: 5,
|
||||
step7_upload_freight: 6,
|
||||
step6_upload_freight: 6,
|
||||
step7_finish: 6,
|
||||
};
|
||||
|
||||
function deriveCurrentIndex(task: ShippingTaskStepperSource | null | undefined): number {
|
||||
const currentStep = String(task?.current_step || '').trim();
|
||||
const processStatus = String(task?.process_status || '').trim();
|
||||
const reviewStatus = String(task?.review_status || '').trim();
|
||||
const pendingReason = String(task?.pending_human_reason || '').trim();
|
||||
const matchStatus = String(task?.match_status || '').trim();
|
||||
const hasExport = !!String(task?.export_file_name || '').trim();
|
||||
|
||||
if (currentStep) {
|
||||
const currentStepIndex = CURRENT_STEP_INDEX_MAP[currentStep];
|
||||
if (currentStepIndex !== undefined) {
|
||||
return currentStepIndex;
|
||||
}
|
||||
}
|
||||
|
||||
if (processStatus === 'uploaded' || processStatus === 'closed') return 6;
|
||||
if (processStatus === 'waiting_upload' || processStatus === 'upload_failed' || hasExport) return 5;
|
||||
if (processStatus === 'matched') return 4;
|
||||
|
||||
Reference in new issue
Block a user