feat(chat): 更新发货任务处理逻辑和界面文本

- 移除不必要的状态引用
- 更新上传处理提示文本,使用国际化支持
- 扩展发货任务摘要接口,增加错误信息和短缺信息
- 更新多语言支持的文本,改善用户体验
- 增加批次工作区的汇总信息和操作提示
This commit is contained in:
hugo committed 2026-06-29 14:43:27 +08:00
1 parent 0b083cfdbd
commit 1fc9976ca3
60 files changed
+3876 -639

No files matched your search

@@ -8,6 +8,7 @@ import { getAuthHeaders } from '@/shared/utils/auth';
import type {
ShippingBatchSummary,
ShippingChatActionsResponse,
ShippingConversationWorkspace,
ShippingDecisionResponse,
ShippingInventoryUploadResponse,
ShippingNoticeHeader,
@@ -50,6 +51,12 @@ export const getWorkspaceShippingBatch = (batchNo: string) =>
`/api/workspace/shipping-batches/${encodeURIComponent(batchNo)}`,
);
/** 获取一个 Agent 会话下的多批次执行工作台快照。 */
export const getWorkspaceShippingConversationBatches = (conversationId: string) =>
getJson<ShippingConversationWorkspace>(
`/api/workspace/shipping-conversations/${encodeURIComponent(conversationId)}/batch-workspace`,
);
/** 获取指定批次当前焦点任务。 */
export const getWorkspaceShippingBatchFocusTask = (batchNo: string) =>
getJson<ShippingTaskSummary>(
@@ -476,6 +483,27 @@ export async function markWorkspaceShippingManualUploaded(taskNo: string) {
return body;
}
/**
* 重试将发货 Excel 上传至货代系统。
* @param taskNo - 发货任务编号
* @returns RPA 上传触发或等待结果
*/
export async function retryWorkspaceShippingUpload(taskNo: string) {
const res = await fetch(
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/retry-upload`,
{
method: 'POST',
headers: { ...getAuthHeaders(), 'Content-Type': 'application/json' },
body: JSON.stringify({}),
},
);
const body = (await res.json().catch(() => ({}))) as ShippingDecisionResponse & { error?: string };
if (!res.ok || body.status === 'failed') {
throw new Error(body.error || body.message || res.statusText);
}
return body;
}
/**
* 生成发货 Excel。
* @param taskNo - 发货任务编号
@@ -504,6 +532,9 @@ export type {
ShippingBatchSummary,
ShippingChatAction,
ShippingChatActionsResponse,
ShippingConversationBatch,
ShippingConversationWorkspace,
ShippingConversationWorkspaceSummary,
ShippingCurrentStepProgress,
ShippingDecisionResponse,
ShippingInventoryUploadResponse,