feat(shipping-notice): 新增临时库存管理功能,支持创建会话、获取分析结果及字段映射建议

This commit is contained in:
hugo committed 2026-07-18 11:41:02 +08:00
1 parent 46eb63f5bb
commit e9bdd81f1a
320 files changed
+28361 -10487

No files matched your search

@@ -47,6 +47,8 @@ const WecomAuditsPage = () => import("@/features/admin/modules/wecom/pages/Wecom
const ReportsPage = () =>
import("@/features/admin/modules/reports/ReportsPage.vue");
const ShippingInventoryPage = () =>
import("@/features/admin/modules/shipping-inventory/ShippingInventoryPage.vue");
export const adminRoutes: RouteRecordRaw[] = [
{
@@ -146,10 +148,10 @@ export const adminRoutes: RouteRecordRaw[] = [
},
{
path: "shipping-customers",
name: "AdminShippingCustomers",
redirect: "/workspace/shipping-notice/customers",
meta: { requiresAdmin: true, title: "货代客户主数据" },
path: "shipping-notice",
name: "AdminShippingInventory",
component: ShippingInventoryPage,
meta: { requiresAdmin: true, adminModule: "shipping_inventory", title: "货代配置" },
},
{
@@ -54,7 +54,7 @@ export const workspaceRoutes: RouteRecordRaw[] = [
{
path: 'shipping-notice/customers',
name: 'workspace-shipping-customers',
component: () => import('@/features/admin/modules/shipping-customers/ShippingCustomersPage.vue'),
component: () => import('@/features/shipping-notice/customers/ShippingCustomersPage.vue'),
meta: { title: '货代客户主数据', requiresAdmin: true },
},
{
+1
View File
@@ -63,6 +63,7 @@ export const config = {
requests: true, // 审批权限
reports: true, // 数据报表
schedules: true, // 定时任务
shipping_inventory: true, // 货代配置
}
}
};
@@ -8,8 +8,6 @@ export const SHIPPING_ACTION_IDS = [
'reject',
'reparse',
'replace_notice_file',
'confirm_inventory_mapping',
'correct_inventory_mapping',
'reparse_inventory',
'rematch',
'retry_rpa',
@@ -21,8 +19,6 @@ export const SHIPPING_ACTION_IDS = [
'download_excel',
'generate_excel',
'mark_manual_uploaded',
'paste_inventory_json',
'edit_inventory_mapping',
'match_inventory',
'refresh',
] as const;
@@ -39,8 +35,6 @@ export const SHIPPING_INTERNAL_STATUS_TOKENS = [
'upload_rpa_pending',
'rpa_exhausted',
'inv_unavail',
'align_review',
'map_infer',
'parse_review',
'shortage_review',
'low_confidence',
+188 -99
View File
@@ -1,11 +1,11 @@
/**
* features/admin/api/admin.api.ts
* 用途:管理后台用户、部门、Agent、货代客户、权限、报表等 HTTP API。
* 用途:管理后台用户、部门、Agent、权限、报表等 HTTP API。
* 依赖:requestJson、getAuthHeaders、各管理域类型。
* 逻辑:JSON 接口统一走 requestJson;模板与对账二进制下载沿用认证 fetch 并抛 BusinessError。
* 逻辑:JSON 接口统一走 requestJson;业务域专属 API 位于各自 feature 目录。
*/
import { getAuthHeaders } from '@/shared/utils/auth';
import { BusinessError, requestJson, resolveLocalizedErrorMessage } from '@/shared/api/client';
import { requestJson } from '@/shared/api/client';
import type { AdminUserRow } from '../types/admin.types';
import type { AdminDashboardBadges, AdminDashboardSummary } from '../types/dashboard.types';
import type { PaginatedResult } from '@/shared/types/pagination.types';
@@ -17,38 +17,17 @@ import type {
UsageReport,
UsageRangeKey,
} from '../types/report.types';
import type {
ShippingCustomerIdentifier,
ShippingCustomerImportBatch,
ShippingCustomerPage,
ShippingCustomerRow,
ShippingCustomerShadowItem,
ShippingCustomerShadowReport,
ShippingIdentifierFormState,
} from '../types/shipping-customer.types';
const auth = () => ({ headers: getAuthHeaders() });
const jsonAuth = () => ({ headers: { 'Content-Type': 'application/json', ...getAuthHeaders() } });
/** 下载管理端二进制文件,并将标准错误 envelope 保留为 BusinessError。 */
const downloadAdminFile = async (url: string, fallbackName: string): Promise<void> => {
const response = await fetch(url, { headers: getAuthHeaders() });
if (!response.ok) {
const payload = await response.json().catch(() => null);
const code = payload?.error?.code || 'SYSTEM.HTTP_ERROR';
throw new BusinessError({
message: resolveLocalizedErrorMessage(code, payload?.error?.message || `HTTP ${response.status}`),
code,
details: payload?.error?.details || {},
requestId: payload?.request_id,
status: response.status,
});
}
/** 下载管理员可访问的库存快照,并保留服务端指定的原始文件名。 */
export const downloadShippingInventorySnapshot = async (snapshotId: number, fallbackName: string): Promise<void> => {
const response = await fetch(`/api/admin/shipping-notice/snapshots/${snapshotId}/download`, { headers: getAuthHeaders() });
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const blob = await response.blob();
const disposition = response.headers.get('Content-Disposition') || '';
const encodedName = disposition.match(/filename\*=UTF-8''([^;]+)/i)?.[1];
const plainName = disposition.match(/filename="?([^";]+)"?/i)?.[1];
const filename = encodedName ? decodeURIComponent(encodedName) : plainName || fallbackName;
const filename = disposition.match(/filename="?([^";]+)"?/i)?.[1] || fallbackName;
const objectUrl = URL.createObjectURL(blob);
const anchor = document.createElement('a');
anchor.href = objectUrl;
@@ -57,90 +36,200 @@ const downloadAdminFile = async (url: string, fallbackName: string): Promise<voi
URL.revokeObjectURL(objectUrl);
};
// Shipping customers
export interface ListShippingCustomersParams {
q?: string;
status?: string;
page?: number;
pageSize?: number;
}
/** 货代库存配置统一接口;敏感凭据仅能写入,服务端不会回显。 */
export const getShippingInventoryConfig = async () => Promise.all([
requestJson<unknown[]>('/api/admin/shipping-notice/rpa-profiles', auth()),
requestJson<unknown[]>('/api/admin/shipping-notice/sources', auth()),
requestJson<unknown[]>('/api/admin/shipping-notice/routing-rules', auth()),
requestJson<unknown[]>('/api/admin/shipping-notice/external-mappings', auth()),
requestJson<unknown[]>('/api/admin/shipping-notice/snapshots', auth()),
requestJson<unknown[]>('/api/admin/shipping-notice/export-records', auth()),
requestJson<unknown[]>('/api/admin/shipping-notice/parsing-profiles', auth()),
requestJson<unknown[]>('/api/admin/shipping-notice/excel-templates', auth()),
]);
/** 分页查询货代标准客户。 */
export const listShippingCustomers = (params: ListShippingCustomersParams = {}) => {
const qs = new URLSearchParams();
if (params.q?.trim()) qs.set('q', params.q.trim());
if (params.status) qs.set('status', params.status);
qs.set('page', String(params.page || 1));
qs.set('page_size', String(params.pageSize || 20));
return requestJson<ShippingCustomerPage>(`/api/admin/shipping-customers?${qs.toString()}`, auth());
export type ShippingInventoryField = {
id: number;
display_name: string;
description: string;
value_type: 'text' | 'integer' | 'decimal' | 'date';
usage_type: 'match_identity' | 'inventory_quantity' | 'warehouse_identity' | 'general';
status: 'active' | 'retired';
sort_order: number;
};
export const getShippingCustomer = (id: number) =>
requestJson<ShippingCustomerRow>(`/api/admin/shipping-customers/${id}`, auth());
/** 管理可供不同库存文件解析方案复用的统一库存业务字段。 */
export const getShippingInventoryFields = () => requestJson<ShippingInventoryField[]>(
'/api/admin/shipping-notice/inventory-fields?include_retired=true', auth(),
);
export const createShippingInventoryField = (payload: Omit<ShippingInventoryField, 'id' | 'status'>) => requestJson<ShippingInventoryField>(
'/api/admin/shipping-notice/inventory-fields', { method: 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
export const updateShippingInventoryField = (id: number, payload: Omit<ShippingInventoryField, 'id' | 'status'>) => requestJson<ShippingInventoryField>(
`/api/admin/shipping-notice/inventory-fields/${id}`, { method: 'PUT', body: JSON.stringify(payload), ...jsonAuth() },
);
export const retireShippingInventoryField = (id: number) => requestJson<ShippingInventoryField>(
`/api/admin/shipping-notice/inventory-fields/${id}/retire`, { method: 'POST', ...jsonAuth() },
);
export const deleteShippingInventoryField = (id: number) => requestJson<void>(
`/api/admin/shipping-notice/inventory-fields/${id}`, { method: 'DELETE', ...auth() },
);
export const createShippingCustomer = (payload: Record<string, unknown>) =>
requestJson<ShippingCustomerRow>('/api/admin/shipping-customers', {
method: 'POST', ...jsonAuth(), body: JSON.stringify(payload),
});
/** 上传或更新版本化发货 Excel 模板;文件仅在创建草稿时提交。 */
export const createShippingExcelTemplate = (payload: FormData) => requestJson<unknown>(
'/api/admin/shipping-notice/excel-templates', { method: 'POST', body: payload, ...auth() },
);
export const updateShippingExcelTemplate = (id: number, payload: Record<string, unknown>) => requestJson<unknown>(
`/api/admin/shipping-notice/excel-templates/${id}`, { method: 'PUT', body: JSON.stringify(payload), ...jsonAuth() },
);
export const getShippingExcelTemplateLayout = (id: number) => requestJson<{ template_id: number; sheets: Record<string, Array<{ index: number; label: string }>> }>(
`/api/admin/shipping-notice/excel-templates/${id}/layout`, auth(),
);
export const createShippingExcelTemplateVersion = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/excel-templates/${id}/new-version`, { method: 'POST', ...jsonAuth() },
);
export const publishShippingExcelTemplate = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/excel-templates/${id}/publish`, { method: 'POST', ...jsonAuth() },
);
export const retireShippingExcelTemplate = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/excel-templates/${id}/retire`, { method: 'POST', ...jsonAuth() },
);
export const deleteShippingExcelTemplate = (id: number) => requestJson<void>(
`/api/admin/shipping-notice/excel-templates/${id}`, { method: 'DELETE', ...auth() },
);
export const updateShippingCustomer = (id: number, payload: Record<string, unknown>) =>
requestJson<ShippingCustomerRow>(`/api/admin/shipping-customers/${id}`, {
method: 'PUT', ...jsonAuth(), body: JSON.stringify(payload),
});
/** 读取库存路由可选的 published 订单字段和受控系统事实。 */
export const getShippingInventoryRoutingFields = () => requestJson<{
order_fields: Array<{ field_id: string; field_code: string; display_name: string; description?: string; scope: 'header' | 'line' }>;
system_facts: string[];
order_schema_published: boolean;
}>('/api/admin/shipping-notice/routing-fields', auth());
export const deactivateShippingCustomer = (id: number) =>
requestJson<ShippingCustomerRow>(`/api/admin/shipping-customers/${id}/deactivate`, {
method: 'POST', ...auth(),
});
export const createShippingCustomerIdentifier = (customerId: number, payload: ShippingIdentifierFormState) =>
requestJson<ShippingCustomerIdentifier>(`/api/admin/shipping-customers/${customerId}/identifiers`, {
method: 'POST', ...jsonAuth(), body: JSON.stringify(payload),
});
export const updateShippingCustomerIdentifier = (identifierId: number, payload: Record<string, unknown>) =>
requestJson<ShippingCustomerIdentifier>(`/api/admin/shipping-customer-identifiers/${identifierId}`, {
method: 'PUT', ...jsonAuth(), body: JSON.stringify(payload),
});
export const uploadShippingCustomerImport = (file: File, sourceSystem: string) => {
const body = new FormData();
body.append('file', file);
body.append('source_system', sourceSystem);
return requestJson<ShippingCustomerImportBatch>('/api/admin/shipping-customer-imports', {
method: 'POST', headers: getAuthHeaders(), body,
});
export type ShippingInventoryConfigurationCatalog = {
order_fields: Array<{ field_id: string; field_code: string; display_name: string; description?: string; scope: 'header' | 'line' }>;
order_schema_published: boolean;
routing_system_facts: string[];
inventory_fields: ShippingInventoryField[];
template_system_facts: string[];
template_source_kinds: Array<'order_field' | 'inventory_field' | 'system_fact' | 'constant'>;
template_row_modes: Array<'header' | 'line'>;
template_formatters: string[];
};
export const decideShippingCustomerImportRow = (
rowId: number,
payload: { action: string; target_customer_id?: number; note?: string },
) => requestJson(`/api/admin/shipping-customer-import-rows/${rowId}/decision`, {
method: 'PUT', ...jsonAuth(), body: JSON.stringify(payload),
});
/** 读取 Profile 与模板结构化编辑器使用的后端权威白名单。 */
export const getShippingInventoryConfigurationCatalog = () =>
requestJson<ShippingInventoryConfigurationCatalog>(
'/api/admin/shipping-notice/configuration-catalog', auth(),
);
export const publishShippingCustomerImport = (batchId: number) =>
requestJson<ShippingCustomerImportBatch>(`/api/admin/shipping-customer-imports/${batchId}/publish`, {
method: 'POST', ...auth(),
/** 保存和发布可复用库存解析 Profile。 */
export const saveShippingInventoryParsingProfile = (payload: Record<string, unknown>, id?: number) => requestJson<unknown>(
`/api/admin/shipping-notice/parsing-profiles${id ? `/${id}` : ''}`,
{ method: id ? 'PUT' : 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
export const publishShippingInventoryParsingProfile = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/parsing-profiles/${id}/publish`, { method: 'POST', ...jsonAuth() },
);
export const retireShippingInventoryParsingProfile = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/parsing-profiles/${id}/retire`, { method: 'POST', ...jsonAuth() },
);
export const deleteShippingInventoryParsingProfile = (id: number) => requestJson<void>(
`/api/admin/shipping-notice/parsing-profiles/${id}`, { method: 'DELETE', ...auth() },
);
/** 上传库存样本,由后端分析工作表、表头、栏位样例和字段建议。 */
export const createShippingInventoryStructureAnalysis = (file: File) => {
const form = new FormData();
form.set('file', file);
return requestJson<unknown>('/api/admin/shipping-notice/inventory-structure-analyses', {
method: 'POST', body: form, ...auth(),
});
};
/** 用已分析的真实栏位创建库存文件解析方案草稿。 */
export const createShippingInventoryParsingDraftFromAnalysis = (id: number, payload: Record<string, unknown>) => requestJson<unknown>(
`/api/admin/shipping-notice/inventory-structure-analyses/${id}/create-profile-draft`,
{ method: 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
/** 确认复用后端推荐的已发布解析方案;库存站点绑定仍由后续测试流程确认。 */
export const adoptShippingInventoryParsingProfile = (analysisId: number, profileId: number) => requestJson<unknown>(
`/api/admin/shipping-notice/inventory-structure-analyses/${analysisId}/adopt-profile`,
{ method: 'POST', body: JSON.stringify({ profile_id: profileId }), ...jsonAuth() },
);
/** 列出已确认、可由管理员沉淀为库存文件解析方案草稿的对话临时库存会话。 */
export const listShippingTemporaryInventorySessions = () => requestJson<unknown>(
'/api/admin/shipping-notice/temporary-inventory-sessions', auth(),
);
/** 使用临时会话锁定的结构和映射创建草稿;前端提交的字段映射不会被接受。 */
export const createShippingParsingDraftFromTemporarySession = (sessionNo: string, payload: Record<string, unknown>) => requestJson<unknown>(
`/api/admin/shipping-notice/temporary-inventory-sessions/${encodeURIComponent(sessionNo)}/create-profile-draft`,
{ method: 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
export const downloadShippingCustomerImportTemplate = () =>
downloadAdminFile('/api/admin/shipping-customers/import-template', 'shipping_customer_import_template.xlsx');
/** 保存 RPA Profile;password 未传或为空时由服务端保留旧密文。 */
export const saveShippingRpaProfile = (payload: Record<string, unknown>, id?: number) => requestJson<unknown>(
`/api/admin/shipping-notice/rpa-profiles${id ? `/${id}` : ''}`,
{ method: id ? 'PUT' : 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
export const deleteShippingRpaProfile = (id: number) => requestJson<void>(
`/api/admin/shipping-notice/rpa-profiles/${id}`, { method: 'DELETE', ...auth() },
);
export const downloadShippingCustomerReconciliation = (batchId: number, batchNo: string) =>
downloadAdminFile(
`/api/admin/shipping-customer-imports/${batchId}/reconciliation`,
`${batchNo}_reconciliation.csv`,
);
/** 保存 Inventory Source,服务端校验其 Driver 与 Profile 一致。 */
export const saveShippingInventorySource = (payload: Record<string, unknown>, id?: number) => requestJson<unknown>(
`/api/admin/shipping-notice/sources${id ? `/${id}` : ''}`,
{ method: id ? 'PUT' : 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
export const deleteShippingInventorySource = (id: number) => requestJson<void>(
`/api/admin/shipping-notice/sources/${id}`, { method: 'DELETE', ...auth() },
);
/** 仅在站点完成测试和必需绑定后启用正式库存运行。 */
export const activateShippingInventorySource = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/sources/${id}/activate`, { method: 'POST', ...jsonAuth() },
);
/** 停用库存站点但保留其既有配置和审计记录。 */
export const deactivateShippingInventorySource = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/sources/${id}/deactivate`, { method: 'POST', ...jsonAuth() },
);
/** 对停用库存站点发起异步 RPA 测试导出,测试文件不会进入生产库存池。 */
export const startShippingInventoryConfigurationTest = (id: number) => requestJson<any>(
`/api/admin/shipping-notice/sources/${id}/test-export`, { method: 'POST', ...jsonAuth() },
);
/** 查询库存站点测试导出与结构识别的后端真实状态。 */
export const getShippingInventoryConfigurationTest = (id: number, runNo: string) => requestJson<any>(
`/api/admin/shipping-notice/sources/${id}/test-export/${encodeURIComponent(runNo)}`, auth(),
);
/** 管理员确认测试结果使用的已发布解析方案,才更新停用库存站点绑定。 */
export const confirmShippingInventoryConfigurationTestProfile = (id: number, runNo: string, profileId: number) => requestJson<any>(
`/api/admin/shipping-notice/sources/${id}/test-export/${encodeURIComponent(runNo)}/confirm-profile`,
{ method: 'POST', body: JSON.stringify({ profile_id: profileId }), ...jsonAuth() },
);
export const getShippingCustomerShadowReport = (limit = 100) =>
requestJson<ShippingCustomerShadowReport>(`/api/admin/shipping-customer-shadow-report?limit=${limit}`, auth());
/** 保存路由规则草稿;规则发布需调用独立接口以生成审计快照。 */
export const saveShippingInventoryRule = (payload: Record<string, unknown>, id?: number) => requestJson<unknown>(
`/api/admin/shipping-notice/routing-rules${id ? `/${id}` : ''}`,
{ method: id ? 'PUT' : 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
export const labelShippingCustomerShadowResolution = (resolutionId: number, customerId: number) =>
requestJson<ShippingCustomerShadowItem>(
`/api/admin/shipping-customer-shadow-resolutions/${resolutionId}/label`,
{ method: 'PUT', ...jsonAuth(), body: JSON.stringify({ customer_id: customerId }) },
);
/** 发布草稿规则,服务端会保存不可变定义快照。 */
export const publishShippingInventoryRule = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/routing-rules/${id}/publish`,
{ method: 'POST', ...jsonAuth() },
);
export const retireShippingInventoryRule = (id: number) => requestJson<unknown>(
`/api/admin/shipping-notice/routing-rules/${id}/retire`, { method: 'POST', ...jsonAuth() },
);
export const deleteShippingInventoryRule = (id: number) => requestJson<void>(
`/api/admin/shipping-notice/routing-rules/${id}`, { method: 'DELETE', ...auth() },
);
/** 保存精确或 Source 默认外部系统映射。 */
export const saveShippingInventoryExternalMapping = (payload: Record<string, unknown>, id?: number) => requestJson<unknown>(
`/api/admin/shipping-notice/external-mappings${id ? `/${id}` : ''}`,
{ method: id ? 'PUT' : 'POST', body: JSON.stringify(payload), ...jsonAuth() },
);
export const deleteShippingInventoryExternalMapping = (id: number) => requestJson<void>(
`/api/admin/shipping-notice/external-mappings/${id}`, { method: 'DELETE', ...auth() },
);
// Users
export const listAdminUsers = () => requestJson<AdminUserRow[]>('/api/admin/users', auth());
@@ -0,0 +1,124 @@
/**
* features/admin/api/shipping-order-schema.api.ts
* 用途:订单 Schema 管理 JSON API。
* 依赖:shared/api/client、shared/utils/auth、订单 Schema DTO。
* 逻辑:页面通过本模块加载状态、维护字段与草稿、发布不可变版本。
*/
import { requestJson } from '@/shared/api/client';
import { getAuthHeaders } from '@/shared/utils/auth';
import type {
ShippingOrderField,
ShippingOrderFieldConfig,
ShippingOrderSchemaAuditEventPage,
ShippingOrderExtractionAudit,
ShippingOrderSchemaState,
ShippingOrderSchemaVersion,
ShippingOrderSchemaVersionDiff,
ShippingOrderSchemaVersionPage,
ShippingOrderSchemaVersionUsage,
} from '../types/shipping-order-schema.types';
const auth = () => ({ headers: getAuthHeaders() });
const jsonAuth = () => ({ headers: { 'Content-Type': 'application/json', ...getAuthHeaders() } });
/** 读取唯一订单 Schema、字段目录和版本。 */
export const getShippingOrderSchemaState = () =>
requestJson<ShippingOrderSchemaState>('/api/admin/shipping-order-schema', auth());
/** 初始化全局唯一订单 Schema。 */
export const initializeShippingOrderSchema = (payload: { display_name: string; description?: string }) =>
requestJson<ShippingOrderSchemaState>('/api/admin/shipping-order-schema', {
method: 'POST', body: JSON.stringify(payload), ...jsonAuth(),
});
/** 创建稳定订单字段身份。 */
export const createShippingOrderField = (payload: Pick<ShippingOrderField, 'field_code' | 'scope' | 'value_type'>) =>
requestJson<ShippingOrderField>('/api/admin/shipping-order-schema/fields', {
method: 'POST', body: JSON.stringify(payload), ...jsonAuth(),
});
/** 更新字段系统标识;服务端仍锁定已发布字段的位置和数据格式。 */
export const updateShippingOrderField = (
fieldId: string,
payload: Pick<ShippingOrderField, 'field_code' | 'scope' | 'value_type'>,
) => requestJson<ShippingOrderField>(`/api/admin/shipping-order-schema/fields/${fieldId}`, {
method: 'PUT', body: JSON.stringify(payload), ...jsonAuth(),
});
/** 退役不再被草稿或下游运行配置引用的字段。 */
export const retireShippingOrderField = (fieldId: string) =>
requestJson<ShippingOrderField>(`/api/admin/shipping-order-schema/fields/${fieldId}/retire`, {
method: 'POST', ...jsonAuth(),
});
/** 删除未使用字段;服务端按历史引用自动决定物理删除或归档。 */
export const deleteShippingOrderField = (fieldId: string) =>
requestJson<{ field_id: string; action: 'deleted' | 'archived' }>(`/api/admin/shipping-order-schema/fields/${fieldId}`, {
method: 'DELETE', ...auth(),
});
/** 创建下一 Schema 草稿,可复制指定版本。 */
export const createShippingOrderSchemaDraft = (payload: { copy_from_version_id?: number; change_note?: string }) =>
requestJson<ShippingOrderSchemaVersion>('/api/admin/shipping-order-schema/versions', {
method: 'POST', body: JSON.stringify(payload), ...jsonAuth(),
});
/** 分页读取版本历史概要,完整定义由详情接口按需加载。 */
export const listShippingOrderSchemaVersions = (page = 1, pageSize = 20, versionNumber?: number) =>
requestJson<ShippingOrderSchemaVersionPage>(
`/api/admin/shipping-order-schema/versions?page=${page}&page_size=${pageSize}${versionNumber ? `&version_number=${versionNumber}` : ''}`,
auth(),
);
/** 读取一个版本的完整不可变快照。 */
export const getShippingOrderSchemaVersion = (versionId: number) =>
requestJson<ShippingOrderSchemaVersion>(`/api/admin/shipping-order-schema/versions/${versionId}`, auth());
/** 比较两个已保存版本,字段级变更由服务端按稳定 field_id 计算。 */
export const getShippingOrderSchemaVersionDiff = (versionId: number, againstVersionId: number) =>
requestJson<ShippingOrderSchemaVersionDiff>(
`/api/admin/shipping-order-schema/versions/${versionId}/diff?against_version_id=${againstVersionId}`,
auth(),
);
/** 分页读取只追加的配置审计事件,历史抽屉不读取事件完整快照。 */
export const listShippingOrderSchemaAuditEvents = (page = 1, pageSize = 20) =>
requestJson<ShippingOrderSchemaAuditEventPage>(
`/api/admin/shipping-order-schema/audit-events?page=${page}&page_size=${pageSize}`,
auth(),
);
/** 分页读取实际使用指定 Schema 版本的订单解析记录与状态汇总。 */
export const getShippingOrderSchemaVersionUsage = (versionId: number, page = 1, pageSize = 20) =>
requestJson<ShippingOrderSchemaVersionUsage>(
`/api/admin/shipping-order-schema/versions/${versionId}/usage?page=${page}&page_size=${pageSize}`,
auth(),
);
/** 读取单次动态订单解析冻结输入、LLM 输出、裁决和证据的只读审计详情。 */
export const getShippingOrderExtractionAudit = (extractionId: number) =>
requestJson<ShippingOrderExtractionAudit>(
`/api/admin/shipping-order-schema/order-extractions/${extractionId}`,
auth(),
);
/** 整体保存草稿字段配置及每个字段的版本纳入状态。 */
export const saveShippingOrderSchemaDraft = (
versionId: number,
payload: { fields: ShippingOrderFieldConfig[]; change_note?: string; expected_lock_version: number },
) => requestJson<ShippingOrderSchemaVersion>(`/api/admin/shipping-order-schema/versions/${versionId}`, {
method: 'PUT', body: JSON.stringify(payload), ...jsonAuth(),
});
/** 删除错误草稿;发布版本由服务端拒绝删除。 */
export const deleteShippingOrderSchemaDraft = (versionId: number) =>
requestJson<void>(`/api/admin/shipping-order-schema/versions/${versionId}`, {
method: 'DELETE', ...auth(),
});
/** 发布草稿并自动退役上一当前版本。 */
export const publishShippingOrderSchemaDraft = (versionId: number, expectedLockVersion: number) =>
requestJson<ShippingOrderSchemaVersion>(
`/api/admin/shipping-order-schema/versions/${versionId}/publish`,
{ method: 'POST', body: JSON.stringify({ expected_lock_version: expectedLockVersion }), ...jsonAuth() },
);
@@ -10,7 +10,7 @@ import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import {
LayoutDashboard, UserPlus, UserCog, Building, Bot, FileText,
Settings2, Megaphone, MessageCircleQuestion, Link2, Users, ShieldCheck, BarChart2, AppWindow
Settings2, Megaphone, MessageCircleQuestion, Link2, Users, ShieldCheck, BarChart2, AppWindow, Warehouse
} from 'lucide-vue-next';
import type { Component } from 'vue';
import { config } from '@/config';
@@ -36,6 +36,7 @@ const iconMap: Record<AdminModuleId, Component> = {
wecom: Link2,
permissions: Users,
platform_apps: AppWindow,
shipping_inventory: Warehouse,
requests: ShieldCheck,
reports: BarChart2,
};
@@ -15,7 +15,7 @@ export interface AdminModuleMeta {
/** 已独立拆分的模块(全部 admin 模块均已拆分) */
export const STANDALONE_ADMIN_MODULES = new Set<AdminModuleId>([
'dashboard', 'agents', 'users', 'departments', 'approvals', 'announcements', 'questions', 'requests', 'permissions', 'schedules', 'knowledge_base', 'wecom', 'platform_apps', 'reports',
'dashboard', 'agents', 'users', 'departments', 'approvals', 'announcements', 'questions', 'requests', 'permissions', 'schedules', 'knowledge_base', 'wecom', 'platform_apps', 'shipping_inventory', 'reports',
]);
export const ADMIN_MODULE_METAS: AdminModuleMeta[] = [
@@ -31,6 +31,7 @@ export const ADMIN_MODULE_METAS: AdminModuleMeta[] = [
{ id: 'wecom', routeName: 'AdminWecom', path: 'wecom', labelKey: 'admin.nav.wecom', configKey: 'wecom' },
{ id: 'permissions', routeName: 'AdminPermissions', path: 'permissions', labelKey: 'admin.nav.permissions', configKey: 'permissions' },
{ id: 'platform_apps', routeName: 'AdminPlatformApps', path: 'platform-apps', labelKey: 'admin.nav.platformApps', configKey: 'platform_apps' },
{ id: 'shipping_inventory', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.nav.shippingInventory', configKey: 'shipping_inventory' },
{ id: 'requests', routeName: 'AdminRequests', path: 'requests', labelKey: 'admin.nav.requests', configKey: 'requests' },
];
@@ -46,7 +47,6 @@ export const ADMIN_REPORT_TABLES: AdminReportTableId[] = [
export const LEGACY_MODULE_QUERY_TO_PATH: Record<string, string> = {};
export const adminModulePath = (moduleId: AdminModuleId | string): string => {
if (moduleId === 'shipping_customers') return '/workspace/shipping-notice/customers';
if (moduleId === 'reports') return '/admin/reports';
const meta = ADMIN_MODULE_METAS.find((m) => m.id === moduleId);
if (meta) return `/admin/${meta.path}`;
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,828 @@
<!--
features/admin/modules/shipping-order-schema/ShippingOrderSchemaPage.vue
用途:维护唯一订单 Schema 的字段目录、草稿配置和发布版本。
依赖:shipping-order-schema.api、BusinessError、useMessage、Vue I18n。
逻辑:管理员维护全局字段系统标识和版本级显示规则;纳入状态仅决定字段是否进入发布契约。
-->
<script setup lang="ts">
import { computed, onMounted, reactive, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
import { BusinessError } from '@/shared/api/client';
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
import { useMessage } from '@/shared/composables/useMessage';
import {
createShippingOrderField,
createShippingOrderSchemaDraft,
deleteShippingOrderField,
deleteShippingOrderSchemaDraft,
getShippingOrderSchemaVersion,
getShippingOrderSchemaVersionDiff,
getShippingOrderSchemaVersionUsage,
getShippingOrderExtractionAudit,
getShippingOrderSchemaState,
initializeShippingOrderSchema,
listShippingOrderSchemaVersions,
listShippingOrderSchemaAuditEvents,
publishShippingOrderSchemaDraft,
saveShippingOrderSchemaDraft,
updateShippingOrderField,
} from '@/features/admin/api/shipping-order-schema.api';
import SchemaVersionHistoryDrawer from '@/features/admin/modules/shipping-order-schema/components/SchemaVersionHistoryDrawer.vue';
import SchemaVersionDiffDrawer from '@/features/admin/modules/shipping-order-schema/components/SchemaVersionDiffDrawer.vue';
import SchemaVersionUsageDrawer from '@/features/admin/modules/shipping-order-schema/components/SchemaVersionUsageDrawer.vue';
import SchemaExtractionAuditDrawer from '@/features/admin/modules/shipping-order-schema/components/SchemaExtractionAuditDrawer.vue';
import type {
ShippingOrderField,
ShippingOrderFieldConfig,
ShippingOrderSchemaAuditEvent,
ShippingOrderSchemaState,
ShippingOrderSchemaVersion,
ShippingOrderSchemaVersionDiff,
ShippingOrderSchemaVersionUsage,
ShippingOrderExtractionAudit,
} from '@/features/admin/types/shipping-order-schema.types';
type DraftFieldEditor = ShippingOrderFieldConfig & { enabled: boolean };
type FieldScope = 'header' | 'line';
const { t } = useI18n();
const message = useMessage();
const route = useRoute();
const router = useRouter();
defineProps<{ embedded?: boolean }>();
const state = ref<ShippingOrderSchemaState | null>(null);
const loading = ref(false);
const saving = ref(false);
const fieldForm = reactive({ field_code: '', scope: 'line' as 'header' | 'line', value_type: 'string' as const });
const schemaForm = reactive({ display_name: '发货订单字段', description: '' });
const draftFields = ref<DraftFieldEditor[]>([]);
const changeNote = ref('');
const selectedDraftFieldId = ref<string | null>(null);
const editingFieldCode = ref('');
const pendingRemoval = ref<{ field: ShippingOrderField; index: number } | null>(null);
const fieldSearch = ref('');
const showNewFieldForm = ref(false);
const expandedGroups = reactive<Record<FieldScope, boolean>>({ header: false, line: false });
const groupExpansionInitialized = ref(false);
const historyOpen = ref(false);
const historyLoading = ref(false);
const historyDetailLoading = ref(false);
const historyPage = ref(0);
const historyTotal = ref(0);
const historyVersions = ref<ShippingOrderSchemaVersion[]>([]);
const selectedHistoryVersion = ref<ShippingOrderSchemaVersion | null>(null);
const historyAuditLoading = ref(false);
const historyAuditPage = ref(0);
const historyAuditTotal = ref(0);
const historyAuditEvents = ref<ShippingOrderSchemaAuditEvent[]>([]);
const diffOpen = ref(false);
const diffLoading = ref(false);
const selectedVersionDiff = ref<ShippingOrderSchemaVersionDiff | null>(null);
const usageOpen = ref(false);
const usageLoading = ref(false);
const usagePage = ref(0);
const selectedVersionUsage = ref<ShippingOrderSchemaVersionUsage | null>(null);
const extractionAuditOpen = ref(false);
const extractionAuditLoading = ref(false);
const selectedExtractionAudit = ref<ShippingOrderExtractionAudit | null>(null);
const draft = computed(() => state.value?.versions.find((item) => item.status === 'draft') || null);
const published = computed(() => state.value?.versions.find((item) => item.status === 'published') || null);
const selectedDraftField = computed(() => draftFields.value.find((item) => item.field_id === selectedDraftFieldId.value) || null);
const selectedField = computed(() => state.value?.fields.find((item) => item.id === selectedDraftFieldId.value) || null);
const selectedFieldIndex = computed(() => state.value?.fields.findIndex((item) => item.id === selectedDraftFieldId.value) ?? -1);
const selectedPublishedField = computed(() => (
published.value?.definition?.fields.find((item) => item.field_id === selectedDraftFieldId.value) || null
));
const selectedRuleConfig = computed(() => draft.value ? selectedDraftField.value : selectedPublishedField.value);
const isReadOnly = computed(() => !draft.value);
const comparisonTarget = computed(() => draft.value || published.value || null);
/** 左侧字段字典按显示名称和字段编号搜索,并保持订单信息/货品明细分组。 */
const groupedFields = computed(() => {
const query = fieldSearch.value.trim().toLocaleLowerCase();
const fields = (state.value?.fields || []).filter((field) => {
if (!query) return true;
const label = displayNameForField(field, 0).toLocaleLowerCase();
return label.includes(query) || field.field_code.toLocaleLowerCase().includes(query);
});
return [
{ scope: 'header' as const, fields: fields.filter((field) => field.scope === 'header') },
{ scope: 'line' as const, fields: fields.filter((field) => field.scope === 'line') },
].filter((group) => group.fields.length);
});
/** 搜索期间自动展开命中分组;清空搜索后自然恢复用户原来的展开状态。 */
const groupIsExpanded = (scope: FieldScope): boolean => Boolean(fieldSearch.value.trim()) || expandedGroups[scope];
/** 独立切换字段分组;搜索期间保持结果展开,避免隐藏匹配项。 */
const toggleGroup = (scope: FieldScope): void => {
if (fieldSearch.value.trim()) return;
expandedGroups[scope] = !expandedGroups[scope];
};
/** 折叠标题提示当前选中字段位于该组,避免用户误以为选择已经丢失。 */
const groupHasSelectedField = (scope: FieldScope): boolean => selectedField.value?.scope === scope;
watch(selectedField, (field) => {
editingFieldCode.value = field?.field_code || '';
if (field) expandedGroups[field.scope] = true;
}, { immediate: true });
/** 展示 API 层已本地化的错误,并为未知错误提供页面级兜底。 */
const showError = (error: unknown): void => {
message.error(error instanceof BusinessError || error instanceof Error
? error.message
: t('admin.shippingOrderSchema.operationFailed'));
};
/** 展示写操作错误;草稿锁冲突时立即加载服务端最新版本,避免继续编辑陈旧状态。 */
const handleWriteError = async (error: unknown): Promise<void> => {
showError(error);
if (error instanceof BusinessError && error.code === 'SHIPPING.ORDER_SCHEMA_VERSION_CONFLICT') {
await load();
}
};
/** 读取下一页版本概要;抽屉首次打开时重置,后续按需追加历史记录。 */
const loadHistory = async (reset = false): Promise<void> => {
if (historyLoading.value) return;
historyLoading.value = true;
try {
const page = reset ? 1 : historyPage.value + 1;
const result = await listShippingOrderSchemaVersions(page);
historyVersions.value = reset ? result.items : [...historyVersions.value, ...result.items];
historyPage.value = result.page;
historyTotal.value = result.total;
} catch (error) {
showError(error);
} finally {
historyLoading.value = false;
}
};
/** 读取追加式配置审计摘要;历史页面不拉取或展示完整前后快照。 */
const loadHistoryAudit = async (reset = false): Promise<void> => {
if (historyAuditLoading.value) return;
historyAuditLoading.value = true;
try {
const page = reset ? 1 : historyAuditPage.value + 1;
const result = await listShippingOrderSchemaAuditEvents(page);
historyAuditEvents.value = reset ? result.items : [...historyAuditEvents.value, ...result.items];
historyAuditPage.value = result.page;
historyAuditTotal.value = result.total;
} catch (error) {
showError(error);
} finally {
historyAuditLoading.value = false;
}
};
/** 按版本 ID 读取完整只读快照,并同步 URL 以支持刷新后重新定位。 */
const selectHistoryVersion = async (versionId: number): Promise<void> => {
historyDetailLoading.value = true;
try {
const detail = await getShippingOrderSchemaVersion(versionId);
selectedHistoryVersion.value = detail;
await router.replace({ query: { ...route.query, version: String(detail.version) } });
} catch (error) {
showError(error);
} finally {
historyDetailLoading.value = false;
}
};
/** 打开版本历史并优先恢复 URL 指定的业务版本号,否则选择最新版本。 */
const openHistory = async (): Promise<void> => {
historyOpen.value = true;
selectedHistoryVersion.value = null;
await Promise.all([loadHistory(true), loadHistoryAudit(true)]);
const requestedVersion = Number(route.query.version);
let target = historyVersions.value.find((item) => item.version === requestedVersion);
if (!target && Number.isInteger(requestedVersion) && requestedVersion > 0) {
const result = await listShippingOrderSchemaVersions(1, 1, requestedVersion);
target = result.items[0];
if (target) historyVersions.value = [...historyVersions.value, target]
.sort((left, right) => right.version - left.version);
}
target ||= historyVersions.value[0];
if (target) await selectHistoryVersion(target.id);
};
/** 以所选历史版本为基线比较当前草稿或当前发布版本,差异统一由服务端计算。 */
const compareHistoryVersion = async (versionId: number): Promise<void> => {
if (!comparisonTarget.value) return;
diffOpen.value = true;
diffLoading.value = true;
selectedVersionDiff.value = null;
try {
selectedVersionDiff.value = await getShippingOrderSchemaVersionDiff(versionId, comparisonTarget.value.id);
} catch (error) {
diffOpen.value = false;
showError(error);
} finally {
diffLoading.value = false;
}
};
/** 按历史版本读取实际解析使用记录;列表保持轻量,详情按管理员点击后再读取。 */
const openVersionUsage = async (versionId: number, reset = true): Promise<void> => {
usageOpen.value = true;
usageLoading.value = true;
try {
const page = reset ? 1 : usagePage.value + 1;
const result = await getShippingOrderSchemaVersionUsage(versionId, page);
selectedVersionUsage.value = reset || !selectedVersionUsage.value
? result
: { ...result, items: [...selectedVersionUsage.value.items, ...result.items] };
usagePage.value = result.page;
} catch (error) {
usageOpen.value = false;
showError(error);
} finally {
usageLoading.value = false;
}
};
/** 读取一条解析的冻结审计链;不允许从详情改写、重放或回滚结果。 */
const openExtractionAudit = async (extractionId: number): Promise<void> => {
extractionAuditOpen.value = true;
extractionAuditLoading.value = true;
selectedExtractionAudit.value = null;
try {
selectedExtractionAudit.value = await getShippingOrderExtractionAudit(extractionId);
} catch (error) {
extractionAuditOpen.value = false;
showError(error);
} finally {
extractionAuditLoading.value = false;
}
};
/** 从不可变历史版本创建独立新草稿,已有草稿时由服务端明确拒绝而不覆盖。 */
const copyHistoryVersion = async (versionId: number): Promise<void> => {
saving.value = true;
try {
await createShippingOrderSchemaDraft({ copy_from_version_id: versionId });
message.success(t('admin.shippingOrderSchema.draftCreated'));
await load();
await closeHistory(false);
} catch (error) {
showError(error);
} finally {
saving.value = false;
}
};
/** 关闭只读历史,保持当前工作区编辑状态不变并移除 URL 版本定位。 */
const closeHistory = async (visible: boolean): Promise<void> => {
historyOpen.value = visible;
if (!visible) {
selectedHistoryVersion.value = null;
selectedVersionDiff.value = null;
diffOpen.value = false;
usageOpen.value = false;
extractionAuditOpen.value = false;
const query = { ...route.query };
delete query.version;
await router.replace({ query });
}
};
/** 按字段类型生成后端兼容矩阵允许的默认规则。 */
const defaultRule = (field: ShippingOrderField): Pick<ShippingOrderFieldConfig, 'normalizer_key' | 'comparator_key'> => ({
normalizer_key: state.value?.catalog.type_normalizers[field.value_type]?.[0] || 'trim',
comparator_key: state.value?.catalog.type_comparators[field.value_type]?.[0] || 'normalized_text',
});
/** 将草稿字段配置同步到本地编辑状态,并保留未纳入版本的 active 字段供管理员选择。 */
const syncDraftFields = (): void => {
const existing = draft.value?.definition?.fields || [];
const byId = new Map(existing.map((item) => [item.field_id, item]));
draftFields.value = (state.value?.fields || [])
.filter((field) => field.status === 'active')
.map((field) => ({
...(byId.get(field.id) || {
field_id: field.id,
display_name: published.value?.definition?.fields.find((item) => item.field_id === field.id)?.display_name || field.field_code,
required: false,
aliases: [],
...defaultRule(field),
validator_keys: [],
enum_options: [],
evidence_policy: {
required: true,
source_precedence: ['attachment_table', 'attachment_text', 'email_body_table', 'email_body_text', 'dify_llm'],
conflict_policy: 'block',
allow_single_source: true,
},
relation_role: null,
extraction_instruction: '',
}),
enabled: byId.has(field.id) ? byId.get(field.id)?.enabled !== false : false,
}));
changeNote.value = draft.value?.change_note || '';
if (!draftFields.value.some((item) => item.field_id === selectedDraftFieldId.value)) {
selectedDraftFieldId.value = draftFields.value[0]?.field_id || null;
}
if (!groupExpansionInitialized.value) {
expandedGroups.header = false;
expandedGroups.line = false;
const initialScope = state.value?.fields.find((item) => item.id === selectedDraftFieldId.value)?.scope;
if (initialScope) expandedGroups[initialScope] = true;
groupExpansionInitialized.value = true;
}
};
/** 加载订单 Schema 状态;每次写操作后重新读取服务端真相。 */
const load = async (): Promise<void> => {
loading.value = true;
try {
state.value = await getShippingOrderSchemaState();
syncDraftFields();
} catch (error) {
showError(error);
} finally {
loading.value = false;
}
};
/** 初始化唯一订单 Schema。 */
const initialize = async (): Promise<void> => {
saving.value = true;
try {
await initializeShippingOrderSchema(schemaForm);
message.success(t('admin.shippingOrderSchema.initialized'));
await load();
} catch (error) {
showError(error);
} finally {
saving.value = false;
}
};
/** 创建业务字段;管理员填写的字段名称就是下游配置和数据库使用的稳定标识。 */
const saveField = async (): Promise<void> => {
saving.value = true;
try {
const fieldCode = fieldForm.field_code.trim().toLowerCase();
const payload = {
field_code: fieldCode,
scope: fieldForm.scope,
value_type: fieldForm.value_type,
};
const savedField = await createShippingOrderField(payload);
if (!draft.value) {
await createShippingOrderSchemaDraft({ copy_from_version_id: published.value?.id });
await load();
}
selectedDraftFieldId.value = savedField.id;
const savedConfig = draftFields.value.find((item) => item.field_id === savedField.id);
if (savedConfig) {
savedConfig.display_name = fieldCode;
savedConfig.enabled = true;
await saveDraft();
}
await load();
selectedDraftFieldId.value = savedField.id;
Object.assign(fieldForm, { field_code: '', scope: 'line', value_type: 'string' });
showNewFieldForm.value = false;
message.success(t('admin.shippingOrderSchema.fieldCreated'));
} catch (error) {
showError(error);
} finally {
saving.value = false;
}
};
/** 修改字段系统标识;稳定 field_id 保持不变,历史发布版本继续使用其快照中的旧标识。 */
const saveFieldCode = async (): Promise<void> => {
const field = selectedField.value;
if (!field) return;
const fieldCode = editingFieldCode.value.trim().toLowerCase();
if (fieldCode === field.field_code) return;
saving.value = true;
try {
const savedField = await updateShippingOrderField(field.id, {
field_code: fieldCode,
scope: field.scope,
value_type: field.value_type,
});
Object.assign(field, savedField);
editingFieldCode.value = savedField.field_code;
await load();
message.success(t('admin.shippingOrderSchema.fieldUpdated'));
} catch (error) {
editingFieldCode.value = field.field_code;
showError(error);
} finally {
saving.value = false;
}
};
/** 创建下一版本草稿,默认复制当前发布版本。 */
const createDraft = async (): Promise<void> => {
saving.value = true;
try {
await createShippingOrderSchemaDraft({ copy_from_version_id: published.value?.id });
message.success(t('admin.shippingOrderSchema.draftCreated'));
await load();
} catch (error) {
showError(error);
} finally {
saving.value = false;
}
};
/** 保存草稿的全部字段规则和纳入状态;未纳入字段保留配置但不会进入发布契约。 */
const saveDraft = async (): Promise<void> => {
if (!draft.value) return;
saving.value = true;
try {
const fields = draftFields.value.map((item) => ({ ...item }));
await saveShippingOrderSchemaDraft(draft.value.id, {
fields,
change_note: changeNote.value,
expected_lock_version: draft.value.lock_version,
});
message.success(t('admin.shippingOrderSchema.draftSaved'));
await load();
} catch (error) {
await handleWriteError(error);
} finally {
saving.value = false;
}
};
/** 发布当前草稿;发布后不可原地修改。 */
const publishDraft = async (): Promise<void> => {
if (!draft.value) return;
saving.value = true;
try {
await publishShippingOrderSchemaDraft(draft.value.id, draft.value.lock_version);
message.success(t('admin.shippingOrderSchema.published'));
await load();
} catch (error) {
await handleWriteError(error);
} finally {
saving.value = false;
}
};
/** 删除配置错误的草稿,释放下一版本创建门禁。 */
const deleteDraft = async (): Promise<void> => {
if (!draft.value) return;
saving.value = true;
try {
await deleteShippingOrderSchemaDraft(draft.value.id);
message.success(t('admin.shippingOrderSchema.draftDeleted'));
await load();
} catch (error) {
showError(error);
} finally {
saving.value = false;
}
};
/** 打开平台统一确认弹窗;确认后才安全移除字段。 */
const requestRemoveField = (field: ShippingOrderField, index: number): void => {
pendingRemoval.value = { field, index };
};
/** 删除字段;服务端在同一事务中移出草稿并按历史引用选择物理删除或归档。 */
const confirmRemoveField = async (): Promise<void> => {
const removal = pendingRemoval.value;
if (!removal) return;
const { field } = removal;
saving.value = true;
try {
const result = await deleteShippingOrderField(field.id);
if (selectedDraftFieldId.value === field.id) selectedDraftFieldId.value = null;
await load();
message.success(t(`admin.shippingOrderSchema.field${result.action === 'deleted' ? 'Deleted' : 'Archived'}`));
} catch (error) {
await load();
showError(error);
} finally {
saving.value = false;
pendingRemoval.value = null;
}
};
/** 将逗号分隔输入规范化为去重字符串列表。 */
const splitValues = (value: string): string[] => [...new Set(value.split(',').map((item) => item.trim()).filter(Boolean))];
/** 切换多选目录项,保持字段配置列表去重。 */
const toggleValue = (values: string[], value: string): string[] =>
values.includes(value) ? values.filter((item) => item !== value) : [...values, value];
/** 根据稳定字段 ID 查找字段身份,供草稿编辑器展示 code/scope/type。 */
const fieldFor = (config: ShippingOrderFieldConfig) => state.value?.fields.find((item) => item.id === config.field_id);
/** 业务显示名称优先,字段编号作为次级技术信息单独展示。 */
const displayNameForField = (field: ShippingOrderField, index: number): string =>
draftFields.value.find((item) => item.field_id === field.id)?.display_name
|| published.value?.definition?.fields.find((item) => item.field_id === field.id)?.display_name
|| field.field_code
|| t('admin.shippingOrderSchema.pendingNameField', { number: index + 1 });
/** 用版本状态说明字段是否会参与本次订单识别,避免只显示无意义的位置。 */
const fieldVersionStatus = (field: ShippingOrderField): string => {
if (field.status !== 'active') return t('admin.shippingOrderSchema.fieldRemovedStatus');
if (draft.value) {
return draftFields.value.find((item) => item.field_id === field.id)?.enabled
? t('admin.shippingOrderSchema.inDraft')
: t('admin.shippingOrderSchema.notInDraft');
}
return published.value?.definition?.fields.some((item) => item.field_id === field.id)
? t('admin.shippingOrderSchema.inPublished')
: t('admin.shippingOrderSchema.notInPublished');
};
/** 当前版本是否纳入字段,用于列表状态点而不是重复展示长状态标签。 */
const fieldIncluded = (field: ShippingOrderField): boolean => draft.value
? Boolean(draftFields.value.find((item) => item.field_id === field.id)?.enabled)
: Boolean(published.value?.definition?.fields.some((item) => item.field_id === field.id));
/** 返回当前字段类型可用的规范化、校验或比较规则,避免提交后端必然拒绝的组合。 */
const compatibleRules = (
config: ShippingOrderFieldConfig,
kind: 'type_normalizers' | 'type_validators' | 'type_comparators',
): string[] => {
const valueType = fieldFor(config)?.value_type;
const available = valueType && state.value ? state.value.catalog[kind][valueType] : [];
if (!isReadOnly.value) return available;
const currentValues = kind === 'type_validators'
? config.validator_keys
: [kind === 'type_normalizers' ? config.normalizer_key : config.comparator_key];
return [...new Set([...currentValues, ...available])];
};
/** 将后端白名单枚举转换为管理人员可理解的业务名称,界面绝不直接输出内部键。 */
const ruleLabel = (value: string): string => t(`admin.shippingOrderSchema.ruleLabel.${value}`);
const sourceLabel = (value: string): string => t(`admin.shippingOrderSchema.sourceLabel.${value}`);
onMounted(async () => {
await load();
if (route.query.version) await openHistory();
});
</script>
<template>
<section :class="embedded ? 'order-schema-workspace' : 'mx-auto max-w-7xl space-y-6 p-6'">
<header v-if="!embedded">
<p class="text-xs font-bold uppercase tracking-widest text-brand-600">{{ t('admin.shippingOrderSchema.eyebrow') }}</p>
<h1 class="mt-2 text-2xl font-bold text-primary">{{ t('admin.shippingOrderSchema.title') }}</h1>
<p class="mt-2 text-sm text-muted">{{ t('admin.shippingOrderSchema.subtitle') }}</p>
</header>
<div v-if="loading" class="rounded-xl border border-default p-8 text-center text-muted">{{ t('common.loading') }}</div>
<form v-else-if="!state?.schema" class="schema-setup" @submit.prevent="initialize">
<div class="schema-setup-copy">
<p class="schema-setup-kicker">{{ t('admin.shippingOrderSchema.setupKicker') }}</p>
<h2>{{ t('admin.shippingOrderSchema.setupTitle') }}</h2>
<p>{{ t('admin.shippingOrderSchema.setupHint') }}</p>
<ol>
<li>{{ t('admin.shippingOrderSchema.setupStepCatalog') }}</li>
<li>{{ t('admin.shippingOrderSchema.setupStepRules') }}</li>
<li>{{ t('admin.shippingOrderSchema.setupStepPublish') }}</li>
</ol>
</div>
<div class="schema-setup-form">
<p>{{ t('admin.shippingOrderSchema.setupActionHint') }}</p>
<button :disabled="saving" class="primary-button">{{ t('admin.shippingOrderSchema.initialize') }}</button>
</div>
</form>
<template v-else>
<div class="schema-toolbar">
<div><strong>{{ t('admin.shippingOrderSchema.ruleWorkspace') }}</strong><span>{{ published ? t('admin.shippingOrderSchema.publishedVersion', { version: published.version }) : t('admin.shippingOrderSchema.notPublished') }}</span></div>
<div class="toolbar-actions">
<button type="button" class="secondary-button" :disabled="saving" @click="openHistory">{{ t('admin.shippingOrderSchema.historyOpen') }}</button>
<button v-if="!draft" :disabled="saving || !state.fields.length" class="secondary-button" @click="createDraft">{{ t('admin.shippingOrderSchema.createDraft') }}</button>
<template v-else><button :disabled="saving" class="secondary-button" @click="saveDraft">{{ t('admin.shippingOrderSchema.saveDraft') }}</button><button :disabled="saving || !draftFields.some((item) => item.enabled)" class="primary-button" @click="publishDraft">{{ t('admin.shippingOrderSchema.publish') }}</button></template>
</div>
</div>
<div class="schema-workbench">
<aside class="field-panel">
<div class="panel-heading">
<div><h2>{{ t('admin.shippingOrderSchema.businessFields') }}</h2><p>{{ t('admin.shippingOrderSchema.businessFieldsHint') }}</p></div>
<button type="button" class="add-field-trigger" @click="showNewFieldForm = !showNewFieldForm">
{{ showNewFieldForm ? t('admin.shippingOrderSchema.cancelAddField') : t('admin.shippingOrderSchema.addField') }}
</button>
</div>
<form v-if="showNewFieldForm" class="new-field-form" @submit.prevent="saveField">
<label><span>{{ t('admin.shippingOrderSchema.businessFieldName') }}</span><input v-model="fieldForm.field_code" required :placeholder="t('admin.shippingOrderSchema.businessFieldNamePlaceholder')"><small>{{ t('admin.shippingOrderSchema.businessFieldNameHint') }}</small></label>
<div class="form-grid"><label><span>{{ t('admin.shippingOrderSchema.businessFieldPlacement') }}</span><select v-model="fieldForm.scope"><option value="header">{{ t('admin.shippingOrderSchema.placementHeader') }}</option><option value="line">{{ t('admin.shippingOrderSchema.placementLine') }}</option></select></label><label><span>{{ t('admin.shippingOrderSchema.businessFieldFormat') }}</span><select v-model="fieldForm.value_type"><option v-for="item in state.catalog.field_types" :key="item" :value="item">{{ t(`admin.shippingOrderSchema.fieldType.${item}`) }}</option></select></label></div>
<div class="form-actions"><button :disabled="saving" class="primary-button">{{ t('admin.shippingOrderSchema.addField') }}</button></div>
</form>
<div class="field-search">
<input v-model="fieldSearch" type="search" :placeholder="t('admin.shippingOrderSchema.searchFields')">
<span>{{ t('admin.shippingOrderSchema.fieldCount', { count: state.fields.length }) }}</span>
</div>
<div class="field-list">
<section v-for="group in groupedFields" :key="group.scope" class="field-group">
<button
type="button"
class="field-group-toggle"
:aria-expanded="groupIsExpanded(group.scope)"
@click="toggleGroup(group.scope)"
>
<span class="field-group-title"><i :class="{ expanded: groupIsExpanded(group.scope) }">›</i>{{ t(`admin.shippingOrderSchema.placement.${group.scope}`) }}</span>
<span class="field-group-summary"><b v-if="!groupIsExpanded(group.scope) && groupHasSelectedField(group.scope)">{{ t('admin.shippingOrderSchema.selectedInGroup') }}</b><em>{{ group.fields.length }}</em></span>
</button>
<div v-if="groupIsExpanded(group.scope)" class="field-group-items">
<div v-for="(field, index) in group.fields" :key="field.id" class="field-item" :class="{ selected: selectedDraftFieldId === field.id, retired: field.status !== 'active' }">
<button type="button" class="field-select" :disabled="field.status !== 'active'" @click="selectedDraftFieldId = field.id">
<span class="field-identity"><strong>{{ displayNameForField(field, index) }}</strong><code :title="field.field_code">{{ field.field_code }}</code></span>
<span class="field-state" :class="{ included: fieldIncluded(field) }" :title="fieldVersionStatus(field)"></span>
</button>
</div>
</div>
</section>
<div v-if="!groupedFields.length" class="field-list-empty">{{ t('admin.shippingOrderSchema.noMatchingFields') }}</div>
</div>
</aside>
<main class="rule-panel">
<template v-if="selectedRuleConfig">
<header class="rule-heading">
<div class="rule-heading-copy">
<p>{{ isReadOnly ? t('admin.shippingOrderSchema.publishedRuleViewer') : t('admin.shippingOrderSchema.ruleEditor') }}</p>
<div class="field-title-line"><h2>{{ selectedRuleConfig.display_name || fieldFor(selectedRuleConfig)?.field_code }}</h2><code>{{ fieldFor(selectedRuleConfig)?.field_code }}</code></div>
<small>{{ isReadOnly ? t('admin.shippingOrderSchema.publishedReadOnlyHint') : t('admin.shippingOrderSchema.fieldEditingHint') }}</small>
</div>
<div class="rule-heading-actions">
<label v-if="!isReadOnly && selectedDraftField" class="toggle-field"><input v-model="selectedDraftField.enabled" type="checkbox"><span>{{ t('admin.shippingOrderSchema.includeField') }}</span></label>
<span v-else class="read-only-badge">{{ t('admin.shippingOrderSchema.readOnly') }}</span>
<button v-if="selectedField?.status === 'active'" type="button" class="field-action-remove" :disabled="saving" @click="requestRemoveField(selectedField, selectedFieldIndex)">{{ t('admin.shippingOrderSchema.removeField') }}</button>
</div>
</header>
<div class="rule-body">
<div class="rule-basics">
<label><span>{{ t('admin.shippingOrderSchema.displayName') }}</span><input v-model="selectedRuleConfig.display_name" :disabled="isReadOnly"></label>
<label><span>{{ t('admin.shippingOrderSchema.fieldName') }}</span><input v-model="editingFieldCode" :disabled="isReadOnly" @change="saveFieldCode"></label>
<label class="span-two"><span>{{ t('admin.shippingOrderSchema.aliases') }}</span><input :value="selectedRuleConfig.aliases.join(', ')" :disabled="isReadOnly || !selectedDraftField?.enabled" @input="!isReadOnly && (selectedRuleConfig.aliases = splitValues(($event.target as HTMLInputElement).value))"></label>
<label class="span-two"><span>{{ t('admin.shippingOrderSchema.extractionInstruction') }}</span><textarea v-model="selectedRuleConfig.extraction_instruction" :disabled="isReadOnly || !selectedDraftField?.enabled" :placeholder="t('admin.shippingOrderSchema.extractionInstructionPlaceholder')"></textarea></label>
</div>
<div class="rule-switches"><label><input v-model="selectedRuleConfig.required" :disabled="isReadOnly || !selectedDraftField?.enabled" type="checkbox"><span><strong>{{ t('admin.shippingOrderSchema.required') }}</strong></span></label><label><input v-model="selectedRuleConfig.evidence_policy.required" :disabled="isReadOnly || !selectedDraftField?.enabled" type="checkbox"><span><strong>{{ t('admin.shippingOrderSchema.evidenceRequired') }}</strong></span></label><label><input v-model="selectedRuleConfig.evidence_policy.allow_single_source" :disabled="isReadOnly || !selectedDraftField?.enabled" type="checkbox"><span><strong>{{ t('admin.shippingOrderSchema.allowSingleSource') }}</strong></span></label></div>
<details class="advanced-rules"><summary>{{ t('admin.shippingOrderSchema.advancedRules') }}</summary><div class="advanced-content"><div class="rule-grid"><label><span>{{ t('admin.shippingOrderSchema.normalizer') }}</span><select v-model="selectedRuleConfig.normalizer_key" :disabled="isReadOnly || !selectedDraftField?.enabled"><option v-for="item in compatibleRules(selectedRuleConfig, 'type_normalizers')" :key="item" :value="item">{{ ruleLabel(item) }}</option></select></label><label><span>{{ t('admin.shippingOrderSchema.comparator') }}</span><select v-model="selectedRuleConfig.comparator_key" :disabled="isReadOnly || !selectedDraftField?.enabled"><option v-for="item in compatibleRules(selectedRuleConfig, 'type_comparators')" :key="item" :value="item">{{ ruleLabel(item) }}</option></select></label><label><span>{{ t('admin.shippingOrderSchema.relationRole') }}</span><select v-model="selectedRuleConfig.relation_role" :disabled="isReadOnly || !selectedDraftField?.enabled"><option :value="null">{{ t('admin.shippingOrderSchema.notSet') }}</option><option v-for="item in state.catalog.relation_roles" :key="item" :value="item">{{ ruleLabel(item) }}</option></select></label><label><span>{{ t('admin.shippingOrderSchema.conflictPolicy') }}</span><select v-model="selectedRuleConfig.evidence_policy.conflict_policy" :disabled="isReadOnly || !selectedDraftField?.enabled"><option v-for="item in state.catalog.conflict_policies" :key="item" :value="item">{{ ruleLabel(item) }}</option></select></label></div><fieldset><legend>{{ t('admin.shippingOrderSchema.validators') }}</legend><div class="check-row"><label v-for="item in compatibleRules(selectedRuleConfig, 'type_validators')" :key="item"><input :checked="selectedRuleConfig.validator_keys.includes(item)" :disabled="isReadOnly || !selectedDraftField?.enabled" type="checkbox" @change="!isReadOnly && (selectedRuleConfig.validator_keys = toggleValue(selectedRuleConfig.validator_keys, item))">{{ ruleLabel(item) }}</label></div></fieldset><fieldset><legend>{{ t('admin.shippingOrderSchema.sourcePrecedence') }}</legend><div class="check-row"><label v-for="item in state.catalog.source_types" :key="item"><input :checked="selectedRuleConfig.evidence_policy.source_precedence.includes(item)" :disabled="isReadOnly || !selectedDraftField?.enabled" type="checkbox" @change="!isReadOnly && (selectedRuleConfig.evidence_policy.source_precedence = toggleValue(selectedRuleConfig.evidence_policy.source_precedence, item))">{{ sourceLabel(item) }}</label></div></fieldset></div></details>
</div>
<footer v-if="!isReadOnly" class="rule-footer"><label><span>{{ t('admin.shippingOrderSchema.changeNote') }}</span><input v-model="changeNote" :placeholder="t('admin.shippingOrderSchema.changeNotePlaceholder')"></label><button :disabled="saving" class="text-danger" @click="deleteDraft">{{ t('admin.shippingOrderSchema.deleteDraft') }}</button></footer>
</template>
<div v-else class="rule-empty">{{ t('admin.shippingOrderSchema.selectField') }}</div>
</main>
</div>
</template>
<DeleteConfirmDialog
:model-value="Boolean(pendingRemoval)"
:title="t('admin.shippingOrderSchema.removeField')"
:message="pendingRemoval ? t('admin.shippingOrderSchema.confirmRemoveField', { name: displayNameForField(pendingRemoval.field, pendingRemoval.index) }) : ''"
:confirm-text="t('admin.shippingOrderSchema.removeField')"
:confirm-loading="saving"
@update:model-value="(visible) => { if (!visible) pendingRemoval = null; }"
@cancel="pendingRemoval = null"
@confirm="confirmRemoveField"
/>
<SchemaVersionHistoryDrawer
:model-value="historyOpen"
:versions="historyVersions"
:selected-version="selectedHistoryVersion"
:loading="historyLoading"
:detail-loading="historyDetailLoading"
:total="historyTotal"
:audit-events="historyAuditEvents"
:audit-total="historyAuditTotal"
:audit-loading="historyAuditLoading"
:comparison-target="comparisonTarget"
:copying="saving"
@update:model-value="closeHistory"
@select="selectHistoryVersion"
@load-more="loadHistory(false)"
@load-more-audit="loadHistoryAudit(false)"
@compare="compareHistoryVersion"
@usage="openVersionUsage"
@copy="copyHistoryVersion"
/>
<SchemaVersionDiffDrawer v-model="diffOpen" :diff="selectedVersionDiff" :loading="diffLoading" />
<SchemaVersionUsageDrawer
v-model="usageOpen"
:usage="selectedVersionUsage"
:loading="usageLoading"
@select="openExtractionAudit"
@load-more="selectedVersionUsage && openVersionUsage(selectedVersionUsage.version.id, false)"
/>
<SchemaExtractionAuditDrawer v-model="extractionAuditOpen" :audit="selectedExtractionAudit" :loading="extractionAuditLoading" />
</section>
</template>
<style scoped>
.order-schema-workspace { min-width: 0; color: #334155; font-size: 14px; }
.primary-button, .secondary-button, .text-button { border: 0; border-radius: 6px; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.primary-button { background: #0ea5e9; color: #fff; }
.secondary-button { border: 1px solid #d7e0ea; background: #fff; color: #475569; }
.text-button { background: transparent; color: #64748b; }
.primary-button:disabled, .secondary-button:disabled { cursor: not-allowed; opacity: .55; }
.schema-setup { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr); gap: 24px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; padding: 24px; }
.schema-setup-copy { max-width: 600px; }
.schema-setup-kicker { margin: 0 0 6px; color: #0284c7; font-size: 12px; font-weight: 600; }
.schema-setup h2 { margin: 0; color: #1e293b; font-size: 18px; font-weight: 600; }
.schema-setup-copy > p:not(.schema-setup-kicker), .schema-setup-form p { margin: 8px 0 16px; color: #64748b; font-size: 13px; line-height: 1.6; }
.schema-setup ol { display: grid; gap: 8px; margin: 0; padding: 0; counter-reset: setup; list-style: none; }
.schema-setup li { display: flex; align-items: center; gap: 9px; color: #475569; font-size: 13px; }
.schema-setup li::before { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: #e0f2fe; color: #0284c7; content: counter(setup); counter-increment: setup; font-size: 11px; font-weight: 600; }
.schema-setup-form { display: grid; align-content: center; border-left: 1px solid #e2e8f0; padding-left: 24px; }
.schema-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.schema-toolbar > div:first-child { display: flex; align-items: baseline; gap: 10px; }
.schema-toolbar strong { color: #1e293b; font-size: 15px; font-weight: 600; }
.schema-toolbar span { color: #94a3b8; font-size: 12px; }
.toolbar-actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.schema-workbench { display: grid; height: min(700px, calc(100vh - 280px)); min-height: 540px; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; border: 1px solid #dfe7ef; border-radius: 10px; background: #fff; box-shadow: 0 1px 2px rgb(15 23 42 / 3%); }
.field-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; border-right: 1px solid #e5ebf1; background: #fbfcfe; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 10px; }
.panel-heading h2, .rule-heading h2 { margin: 0; color: #1e293b; font-size: 15px; font-weight: 600; }
.panel-heading p { margin: 5px 0 0; color: #94a3b8; font-size: 12px; line-height: 1.5; }
.add-field-trigger { flex: 0 0 auto; border: 0; background: transparent; padding: 2px 0; color: #0284c7; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.new-field-form { display: grid; gap: 10px; margin: 0 12px 10px; border: 1px solid #dbe6ef; border-radius: 7px; background: #fff; padding: 12px; }
.new-field-form label, .rule-body label, .rule-footer label { display: grid; gap: 5px; color: #64748b; font-size: 12px; }
.new-field-form label small { color: #94a3b8; font-size: 11px; line-height: 1.4; }
.rule-body label small { color: #94a3b8; font-size: 11px; line-height: 1.4; }
.new-field-form input, .new-field-form select, .rule-body input:not([type="checkbox"]):not([type="radio"]), .rule-body select, .rule-body textarea, .rule-footer input { min-width: 0; border: 1px solid #d9e2ec; border-radius: 6px; background: #fff; padding: 8px 9px; color: #334155; font: inherit; font-size: 13px; outline: none; }
.new-field-form input:focus, .new-field-form select:focus, .rule-body input:not([type="checkbox"]):not([type="radio"]):focus, .rule-body select:focus, .rule-body textarea:focus, .rule-footer input:focus { border-color: #38bdf8; box-shadow: 0 0 0 2px rgb(56 189 248 / 12%); }
.form-grid, .rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.field-search { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e5ebf1; padding: 8px 12px 12px; }
.field-search input { min-width: 0; flex: 1; border: 1px solid #d9e2ec; border-radius: 6px; background: #fff; padding: 7px 9px; color: #334155; font: inherit; font-size: 12px; outline: none; }
.field-search input:focus { border-color: #38bdf8; box-shadow: 0 0 0 2px rgb(56 189 248 / 12%); }
.field-search span { flex: 0 0 auto; color: #94a3b8; font-size: 11px; }
.field-list { min-height: 0; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 0 8px 12px; }
.field-group { margin-top: 4px; }
.field-group-toggle { position: sticky; z-index: 2; top: 0; display: flex; width: 100%; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid #edf1f5; background: rgb(251 252 254 / 96%); padding: 9px 8px 7px; color: #64748b; font: inherit; font-size: 11px; font-weight: 700; text-align: left; cursor: pointer; backdrop-filter: blur(5px); }
.field-group-toggle:hover { color: #334155; }
.field-group-toggle:focus-visible { border-radius: 5px; outline: 2px solid #7dd3fc; outline-offset: -2px; }
.field-group-title, .field-group-summary { display: flex; align-items: center; gap: 6px; }
.field-group-title i { display: inline-block; color: #94a3b8; font-size: 17px; font-style: normal; font-weight: 400; line-height: 1; transform: rotate(0deg); transition: transform .15s ease; }
.field-group-title i.expanded { transform: rotate(90deg); }
.field-group-summary b { color: #0284c7; font-size: 10px; font-weight: 600; }
.field-group-summary em { min-width: 20px; border-radius: 999px; background: #e2e8f0; padding: 1px 6px; text-align: center; font-style: normal; font-weight: 500; }
.field-group-items { padding-top: 2px; }
.field-item { display: flex; align-items: center; margin-top: 2px; border-radius: 7px; color: #475569; }
.field-item:hover { background: #f1f6fa; }
.field-item.selected { background: #e8f5fc; color: #0369a1; box-shadow: inset 3px 0 #0ea5e9; }
.field-item.retired { opacity: .55; }
.field-select { display: flex; min-width: 0; flex: 1; align-items: center; justify-content: space-between; gap: 10px; border: 0; background: transparent; padding: 8px 10px 8px 12px; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.field-select:disabled { cursor: default; }
.field-identity { display: grid; min-width: 0; gap: 2px; }
.field-identity strong { overflow: hidden; color: #334155; font-size: 12.5px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.field-identity code { overflow: hidden; color: #94a3b8; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.field-item.selected .field-identity strong, .field-item.selected .field-identity code { color: #0369a1; }
.field-state { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #cbd5e1; box-shadow: 0 0 0 3px #f1f5f9; }
.field-state.included { background: #0ea5e9; box-shadow: 0 0 0 3px #dff3fd; }
.field-list-empty { padding: 44px 12px; color: #94a3b8; text-align: center; font-size: 12px; }
.rule-panel { display: flex; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; background: #fff; }
.rule-heading { display: flex; min-height: 92px; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e5ebf1; padding: 16px 24px; }
.rule-heading-copy { min-width: 0; }
.rule-heading-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 14px; }
.rule-heading p { margin: 0 0 4px; color: #94a3b8; font-size: 12px; }
.rule-heading small { display: block; margin-top: 4px; color: #94a3b8; font-size: 11px; }
.field-title-line { display: flex; min-width: 0; align-items: baseline; gap: 10px; }
.field-title-line h2 { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.field-title-line code { color: #64748b; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; }
.read-only-badge { border: 1px solid #cbd5e1; border-radius: 999px; background: #f8fafc; padding: 4px 9px; color: #64748b; font-size: 11px; font-weight: 600; }
.field-action-remove { border: 0; background: transparent; padding: 5px 2px; color: #ef4444; font: inherit; font-size: 12px; cursor: pointer; }
.field-action-remove:hover:not(:disabled) { color: #b91c1c; text-decoration: underline; }
.field-action-remove:disabled { cursor: not-allowed; opacity: .5; }
.toggle-field { display: flex !important; align-items: center; gap: 7px; color: #475569 !important; white-space: nowrap; }
.toggle-field input[type="checkbox"], .toggle-field input[type="radio"], .check-row input[type="checkbox"], .check-row input[type="radio"] { box-sizing: border-box; width: 16px; height: 16px; flex: 0 0 16px; margin: 0; padding: 0; border-color: #cbd5e1; color: #0ea5e9; accent-color: #0ea5e9; cursor: pointer; }
.toggle-field input[type="checkbox"], .check-row input[type="checkbox"] { border-radius: 4px; }
.toggle-field input[type="radio"], .check-row input[type="radio"] { border-radius: 50%; }
.toggle-field input[type="checkbox"]:checked, .toggle-field input[type="checkbox"]:indeterminate, .toggle-field input[type="radio"]:checked, .check-row input[type="checkbox"]:checked, .check-row input[type="checkbox"]:indeterminate, .check-row input[type="radio"]:checked { border-color: #0ea5e9; background-color: #0ea5e9; }
.toggle-field input[type="checkbox"]:focus, .toggle-field input[type="radio"]:focus, .check-row input[type="checkbox"]:focus, .check-row input[type="radio"]:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgb(14 165 233 / 16%); outline: none; }
.toggle-field input[type="checkbox"]:disabled, .toggle-field input[type="radio"]:disabled, .check-row input[type="checkbox"]:disabled, .check-row input[type="radio"]:disabled { cursor: not-allowed; opacity: .55; }
.rule-body { display: grid; min-height: 0; flex: 1 1 auto; align-content: start; gap: 18px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 22px 24px 30px; scrollbar-gutter: stable; }
.rule-basics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; border: 1px solid #edf1f5; border-radius: 9px; background: #fcfdff; padding: 18px; }
.rule-basics .span-two { grid-column: 1 / -1; }
.rule-body textarea { min-height: 78px; resize: vertical; }
.rule-switches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rule-switches label { display: flex; min-height: 48px; align-items: center; gap: 9px; border: 1px solid #e5ebf1; border-radius: 8px; background: #fff; padding: 10px 12px; color: #475569; cursor: pointer; }
.rule-switches label:hover { border-color: #bae6fd; background: #f8fcff; }
.rule-switches strong { font-size: 12px; font-weight: 600; }
.rule-switches input { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; accent-color: #0ea5e9; }
.check-row { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.check-row label { display: flex; align-items: center; gap: 5px; color: #475569; }
.advanced-rules { border: 1px solid #e5ebf1; border-radius: 8px; background: #fff; }
.advanced-rules summary { padding: 12px 14px; color: #64748b; font-size: 12px; font-weight: 600; cursor: pointer; }
.advanced-content { display: grid; gap: 18px; padding-top: 16px; }
.advanced-content { border-top: 1px solid #edf1f5; padding: 16px; }
.advanced-content fieldset { display: grid; gap: 9px; border: 0; margin: 0; padding: 0; }
.advanced-content legend { color: #64748b; font-size: 12px; }
.rule-footer { display: flex; flex: 0 0 auto; align-items: flex-end; justify-content: space-between; gap: 16px; border-top: 1px solid #e5ebf1; background: #fbfcfe; padding: 12px 24px; }
.rule-footer label { flex: 1; }
.text-danger { border: 0; background: transparent; color: #ef4444; font: inherit; font-size: 12px; cursor: pointer; }
.rule-empty { display: grid; min-height: 360px; place-items: center; color: #94a3b8; font-size: 13px; }
@media (max-width: 900px) { .schema-workbench { height: auto; overflow: visible; grid-template-columns: 1fr; } .field-panel { max-height: 360px; border-right: 0; border-bottom: 1px solid #e2e8f0; } .rule-panel { overflow: visible; } .rule-body { max-height: none; overflow: visible; } .schema-setup { grid-template-columns: 1fr; } .schema-setup-form { border-top: 1px solid #e2e8f0; border-left: 0; padding: 18px 0 0; } .rule-switches { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .schema-toolbar, .rule-heading, .rule-footer { align-items: flex-start; flex-direction: column; } .rule-heading-actions { width: 100%; justify-content: space-between; } .schema-workbench { min-height: auto; } .form-grid, .rule-grid, .rule-basics { grid-template-columns: 1fr; } .rule-basics .span-two { grid-column: auto; } .schema-setup, .rule-body { padding: 18px; } }
</style>
@@ -0,0 +1,50 @@
<!--
features/admin/modules/shipping-order-schema/components/SchemaAuditTimeline.vue
用途:展示订单 Schema 配置的追加式审计时间线。
依赖:ShippingOrderSchemaAuditEvent DTO、Vue I18n。
逻辑:父组件分页读取最小审计摘要,本组件不展示完整前后配置快照或提供修改操作。
-->
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import type { ShippingOrderSchemaAuditEvent } from '@/features/admin/types/shipping-order-schema.types';
defineProps<{ events: ShippingOrderSchemaAuditEvent[]; total: number; loading: boolean }>();
const emit = defineEmits<{ loadMore: [] }>();
const { t } = useI18n();
/** 使用本地时间展示事件发生时刻,缺失时间维持审计可读性。 */
const formatDate = (value?: string | null): string => value
? new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(new Date(value))
: t('admin.shippingOrderSchema.historyUnknownTime');
/** 将事件类型映射为面向业务人员的动作,未知类型保留其原值。 */
const eventLabel = (eventType: string): string => {
const key = `admin.shippingOrderSchema.auditEvent.${eventType}`;
const translated = t(key);
return translated === key ? eventType : translated;
};
/** 只有字段集合确有变化时才显示计数摘要,避免目录事件出现无意义的全零提示。 */
const hasFieldChanges = (event: ShippingOrderSchemaAuditEvent): boolean => [
event.change_summary.added_field_ids,
event.change_summary.removed_field_ids,
event.change_summary.changed_field_ids,
].some((fieldIds) => Array.isArray(fieldIds) && fieldIds.length > 0);
</script>
<template>
<section class="audit-timeline" :aria-label="t('admin.shippingOrderSchema.auditTitle')">
<div class="audit-heading"><span>{{ t('admin.shippingOrderSchema.auditTitle') }}</span><small>{{ total }}</small></div>
<p v-if="!events.length && !loading" class="audit-empty">{{ t('admin.shippingOrderSchema.auditEmpty') }}</p>
<article v-for="event in events" :key="event.id" class="audit-event">
<strong>{{ eventLabel(event.event_type) }}</strong><span v-if="event.version">V{{ event.version.version }}</span>
<p>{{ formatDate(event.created_at) }} · {{ event.actor?.display_name || t('admin.shippingOrderSchema.historyUnknownActor') }}</p>
<small v-if="hasFieldChanges(event)">{{ t('admin.shippingOrderSchema.auditFieldSummary', { added: (event.change_summary.added_field_ids as string[] | undefined)?.length || 0, removed: (event.change_summary.removed_field_ids as string[] | undefined)?.length || 0, changed: (event.change_summary.changed_field_ids as string[] | undefined)?.length || 0 }) }}</small>
</article>
<button v-if="events.length < total" type="button" :disabled="loading" @click="emit('loadMore')">{{ loading ? t('common.loading') : t('admin.shippingOrderSchema.auditLoadMore') }}</button>
</section>
</template>
<style scoped>
.audit-timeline { margin-top: 22px; border-top: 1px solid #e5ebf1; padding-top: 18px; }.audit-heading { display: flex; align-items: center; gap: 8px; color: #64748b; font-size: 12px; font-weight: 700; }.audit-heading small { border-radius: 999px; background: #e0f2fe; padding: 2px 7px; color: #0369a1; }.audit-event { position: relative; margin: 10px 0 0 6px; border-left: 2px solid #bae6fd; padding: 0 0 10px 13px; }.audit-event::before { position: absolute; top: 3px; left: -5px; width: 8px; height: 8px; border-radius: 50%; background: #0ea5e9; content: ''; }.audit-event strong { color: #334155; font-size: 12px; }.audit-event > span { margin-left: 6px; color: #0369a1; font-size: 11px; }.audit-event p, .audit-event small { display: block; margin: 4px 0 0; color: #94a3b8; font-size: 11px; }.audit-timeline > button { width: 100%; border: 1px dashed #cbd5e1; border-radius: 7px; background: transparent; padding: 8px; color: #0284c7; font: inherit; font-size: 12px; cursor: pointer; }.audit-empty { color: #94a3b8; font-size: 12px; }
</style>
@@ -0,0 +1,45 @@
<!--
features/admin/modules/shipping-order-schema/components/SchemaExtractionAuditDrawer.vue
用途:以只读方式展示一条订单解析的冻结输入、LLM 输出、裁决和字段证据。
依赖:ShippingOrderExtractionAudit DTO、Vue I18n。
逻辑:复杂运行数据由服务端完整组装;组件使用 JSON 预格式化展示,禁止在审计视图编辑或重放解析。
-->
<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import type { ShippingOrderExtractionAudit } from '@/features/admin/types/shipping-order-schema.types';
const props = defineProps<{ modelValue: boolean; audit: ShippingOrderExtractionAudit | null; loading: boolean }>();
const emit = defineEmits<{ 'update:modelValue': [visible: boolean] }>();
const { t } = useI18n();
/** 保持审计载荷原样可读,并安全处理缺失或非对象值。 */
const json = (value: unknown): string => JSON.stringify(value ?? null, null, 2);
const documents = computed(() => Array.isArray(props.audit?.input_snapshot.documents) ? props.audit?.input_snapshot.documents : []);
</script>
<template>
<Teleport to="body">
<div v-if="modelValue" class="audit-detail-layer" role="presentation" @click.self="emit('update:modelValue', false)">
<aside class="audit-detail-drawer" role="dialog" aria-modal="true" :aria-label="t('admin.shippingOrderSchema.runtimeAuditTitle')">
<header><div><p>{{ t('admin.shippingOrderSchema.runtimeAuditEyebrow') }}</p><h2>{{ t('admin.shippingOrderSchema.runtimeAuditTitle') }}</h2></div><button type="button" :aria-label="t('common.close')" @click="emit('update:modelValue', false)">×</button></header>
<main v-if="loading" class="audit-detail-empty">{{ t('common.loading') }}</main>
<main v-else-if="audit">
<dl class="audit-meta"><div><dt>{{ t('admin.shippingOrderSchema.runtimeAuditExtraction') }}</dt><dd>#{{ audit.extraction.id }}</dd></div><div><dt>{{ t('admin.shippingOrderSchema.runtimeAuditVersion') }}</dt><dd>V{{ audit.schema_version.version }}</dd></div><div><dt>{{ t('admin.shippingOrderSchema.runtimeAuditStatus') }}</dt><dd>{{ t(`admin.shippingOrderSchema.extractionStatus.${audit.extraction.status}`) }}</dd></div><div><dt>{{ t('admin.shippingOrderSchema.runtimeAuditHash') }}</dt><dd><code>{{ audit.extraction.input_snapshot_hash }}</code></dd></div></dl>
<section><h3>{{ t('admin.shippingOrderSchema.runtimeAuditInput') }}</h3><p v-if="audit.input_snapshot.snapshot_available === false" class="snapshot-unavailable">{{ t('admin.shippingOrderSchema.runtimeAuditInputUnavailable') }}</p><article v-for="document in documents" :key="String(document.id)" class="audit-document"><strong>{{ String(document.filename || document.id) }}</strong><pre>{{ String(document.extracted_text || '') }}</pre></article></section>
<section><h3>{{ t('admin.shippingOrderSchema.runtimeAuditLlm') }}</h3><pre>{{ json(audit.raw_llm_output) }}</pre></section>
<section><h3>{{ t('admin.shippingOrderSchema.runtimeAuditNormalized') }}</h3><pre>{{ json(audit.normalized_result) }}</pre></section>
<section><h3>{{ t('admin.shippingOrderSchema.runtimeAuditValidation') }}</h3><pre>{{ json(audit.validation_result) }}</pre></section>
<section><h3>{{ t('admin.shippingOrderSchema.runtimeAuditDecisions') }} ({{ audit.decisions.length }})</h3><pre>{{ json(audit.decisions) }}</pre></section>
<section><h3>{{ t('admin.shippingOrderSchema.runtimeAuditEvidence') }} ({{ audit.observations.length }})</h3><pre>{{ json(audit.observations) }}</pre></section>
<section><h3>{{ t('admin.shippingOrderSchema.runtimeAuditValues') }} ({{ audit.field_values.length }})</h3><pre>{{ json(audit.field_values) }}</pre></section>
</main>
<main v-else class="audit-detail-empty">{{ t('admin.shippingOrderSchema.runtimeAuditEmpty') }}</main>
</aside>
</div>
</Teleport>
</template>
<style scoped>
.audit-detail-layer { position: fixed; z-index: 90; inset: 0; display: flex; justify-content: flex-end; background: rgb(15 23 42 / 40%); backdrop-filter: blur(2px); }.audit-detail-drawer { display: flex; width: min(900px, 97vw); height: 100%; flex-direction: column; overflow: hidden; background: #f8fafc; box-shadow: -18px 0 48px rgb(15 23 42 / 22%); }.audit-detail-drawer > header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e8f0; background: #fff; padding: 22px 26px; }.audit-detail-drawer header p { margin: 0 0 4px; color: #0284c7; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }.audit-detail-drawer h2 { margin: 0; color: #1e293b; font-size: 20px; }.audit-detail-drawer > header button { width: 32px; height: 32px; border: 1px solid #dbe5ee; border-radius: 50%; background: #fff; color: #475569; font-size: 22px; line-height: 1; cursor: pointer; }.audit-detail-drawer main { overflow-y: auto; padding: 24px 26px; }.audit-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 20px; }.audit-meta div { border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; padding: 10px; }.audit-meta dt { color: #94a3b8; font-size: 10px; }.audit-meta dd { margin: 5px 0 0; color: #334155; font-size: 12px; overflow-wrap: anywhere; }.audit-detail-drawer section { margin-top: 18px; }.audit-detail-drawer h3 { margin: 0 0 8px; color: #64748b; font-size: 12px; }.audit-detail-drawer pre { overflow: auto; max-height: 340px; margin: 0; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; padding: 12px; color: #334155; font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }.audit-document { margin-top: 8px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; padding: 12px; }.audit-document strong { color: #334155; font-size: 12px; }.audit-document pre { max-height: 220px; margin-top: 8px; border: 0; background: #f8fafc; }.snapshot-unavailable { margin: 0; border: 1px solid #fde68a; border-radius: 7px; background: #fffbeb; padding: 9px; color: #a16207; font-size: 12px; }.audit-detail-empty { display: grid; min-height: 240px; place-items: center; color: #94a3b8; font-size: 13px; }@media (max-width: 640px) { .audit-detail-drawer main { padding: 18px; }.audit-meta { grid-template-columns: 1fr; } }
</style>
@@ -0,0 +1,67 @@
<!--
features/admin/modules/shipping-order-schema/components/SchemaVersionDiffDrawer.vue
用途:只读展示两个订单 Schema 版本的服务端语义化字段差异。
依赖:ShippingOrderSchemaVersionDiff DTO、Vue I18n。
逻辑:父组件负责加载差异;本组件只根据后端 field_id 差异结构渲染,绝不自行推断字段是否重命名。
-->
<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import type {
ShippingOrderSchemaFieldChange,
ShippingOrderSchemaFieldDiff,
ShippingOrderSchemaVersionDiff,
} from '@/features/admin/types/shipping-order-schema.types';
const props = defineProps<{ modelValue: boolean; diff: ShippingOrderSchemaVersionDiff | null; loading: boolean }>();
const emit = defineEmits<{ 'update:modelValue': [visible: boolean] }>();
const { t } = useI18n();
/** 隐藏未变化字段,审计人员只聚焦实际配置差异。 */
const changedFields = computed(() => props.diff?.fields.filter((item) => item.change_type !== 'unchanged') || []);
/** 为差异条目提供当前或历史快照中最具识别性的字段名称。 */
const fieldLabel = (field: ShippingOrderSchemaFieldDiff): string =>
field.after?.display_name || field.before?.display_name || field.after?.field_code || field.before?.field_code || field.field_id;
/** 将后端属性键映射为可本地化的审计标签,未知键仍保留原键以防信息丢失。 */
const changeLabel = (change: ShippingOrderSchemaFieldChange): string => {
const key = `admin.shippingOrderSchema.diffField.${change.key}`;
const translated = t(key);
return translated === key ? change.key : translated;
};
/** 标量和集合变更使用同一紧凑文本格式,避免渲染原始 JSON。 */
const valueText = (value: unknown): string => {
if (value === null || value === undefined || value === '') return t('admin.shippingOrderSchema.diffEmpty');
if (Array.isArray(value)) return value.join(', ') || t('admin.shippingOrderSchema.diffEmpty');
return String(value);
};
</script>
<template>
<Teleport to="body">
<div v-if="modelValue" class="diff-layer" role="presentation" @click.self="emit('update:modelValue', false)">
<aside class="diff-drawer" role="dialog" aria-modal="true" :aria-label="t('admin.shippingOrderSchema.diffTitle')">
<header><div><p>{{ t('admin.shippingOrderSchema.diffEyebrow') }}</p><h2>{{ t('admin.shippingOrderSchema.diffTitle') }}</h2></div><button type="button" :aria-label="t('common.close')" @click="emit('update:modelValue', false)">×</button></header>
<main v-if="loading" class="empty">{{ t('common.loading') }}</main>
<main v-else-if="diff">
<p class="comparison">V{{ diff.base_version.version }} {{ t('admin.shippingOrderSchema.diffComparedWith') }} V{{ diff.compare_version.version }}</p>
<div class="summary"><span v-for="key in ['added', 'removed', 'modified']" :key="key">{{ t(`admin.shippingOrderSchema.diffStatus.${key}`) }} <b>{{ diff.summary[key as 'added' | 'removed' | 'modified'] }}</b></span></div>
<article v-for="field in changedFields" :key="field.field_id" class="diff-field" :class="field.change_type">
<header><div><strong>{{ fieldLabel(field) }}</strong><code>{{ field.after?.field_code || field.before?.field_code }}</code></div><span>{{ t(`admin.shippingOrderSchema.diffStatus.${field.change_type}`) }}</span></header>
<template v-if="field.change_type === 'added'"><p>{{ t('admin.shippingOrderSchema.diffAddedField') }}</p></template>
<template v-else-if="field.change_type === 'removed'"><p>{{ t('admin.shippingOrderSchema.diffRemovedField') }}</p></template>
<dl v-else><div v-for="change in field.changes" :key="change.key"><dt>{{ changeLabel(change) }}</dt><dd><del>{{ valueText(change.before) }}</del><ins>{{ valueText(change.after) }}</ins><small v-if="change.order_changed">{{ t('admin.shippingOrderSchema.diffOrderChanged') }}</small></dd></div></dl>
</article>
<p v-if="!changedFields.length" class="empty">{{ t('admin.shippingOrderSchema.diffNoChanges') }}</p>
</main>
<main v-else class="empty">{{ t('admin.shippingOrderSchema.diffNoChanges') }}</main>
</aside>
</div>
</Teleport>
</template>
<style scoped>
.diff-layer { position: fixed; z-index: 80; inset: 0; display: flex; justify-content: flex-end; background: rgb(15 23 42 / 35%); backdrop-filter: blur(2px); }.diff-drawer { display: flex; width: min(760px, 96vw); height: 100%; flex-direction: column; overflow: hidden; background: #f8fafc; box-shadow: -18px 0 48px rgb(15 23 42 / 18%); }.diff-drawer > header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e8f0; background: #fff; padding: 22px 26px; }.diff-drawer header p { margin: 0 0 4px; color: #0284c7; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }.diff-drawer h2 { margin: 0; color: #1e293b; font-size: 20px; }.diff-drawer > header button { width: 32px; height: 32px; border: 1px solid #dbe5ee; border-radius: 50%; background: #fff; color: #475569; font-size: 22px; line-height: 1; cursor: pointer; }.diff-drawer main { overflow-y: auto; padding: 24px 26px; }.comparison { margin: 0 0 10px; color: #64748b; font-size: 13px; }.summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }.summary span, .diff-field > header > span { border-radius: 999px; background: #e0f2fe; padding: 3px 7px; color: #0369a1; font-size: 11px; }.summary b { margin-left: 3px; }.diff-field { margin-top: 10px; border: 1px solid #e2e8f0; border-left-width: 3px; border-radius: 8px; background: #fff; padding: 13px; }.diff-field.added { border-left-color: #22c55e; }.diff-field.removed { border-left-color: #ef4444; }.diff-field.modified { border-left-color: #0ea5e9; }.diff-field > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }.diff-field strong { display: block; color: #1e293b; font-size: 13px; }.diff-field code { color: #64748b; font-size: 11px; }.diff-field > p { margin: 10px 0 0; color: #64748b; font-size: 12px; }.diff-field dl { display: grid; gap: 8px; margin: 12px 0 0; }.diff-field dl div { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 8px; }.diff-field dt { color: #64748b; font-size: 11px; }.diff-field dd { display: grid; gap: 4px; margin: 0; color: #475569; font-size: 12px; overflow-wrap: anywhere; }.diff-field del { color: #b91c1c; text-decoration: line-through; }.diff-field ins { color: #15803d; text-decoration: none; }.diff-field small { color: #a16207; font-size: 10px; }.empty { display: grid; min-height: 240px; place-items: center; color: #94a3b8; font-size: 13px; }@media (max-width: 640px) { .diff-drawer main { padding: 18px; }.diff-field dl div { grid-template-columns: 1fr; gap: 3px; } }
</style>
@@ -0,0 +1,153 @@
<!--
features/admin/modules/shipping-order-schema/components/SchemaVersionHistoryDrawer.vue
用途:以时间线和完整只读快照浏览订单 Schema 的草稿、发布及退役版本。
依赖:ShippingOrderSchemaVersion DTO、Vue I18n。
逻辑:父页面加载版本概要和按需详情;本组件仅展示并发出选择/关闭事件,不修改任何版本配置。
-->
<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import SchemaAuditTimeline from '@/features/admin/modules/shipping-order-schema/components/SchemaAuditTimeline.vue';
import type { ShippingOrderSchemaVersion } from '@/features/admin/types/shipping-order-schema.types';
import type { ShippingOrderSchemaAuditEvent } from '@/features/admin/types/shipping-order-schema.types';
const props = defineProps<{
modelValue: boolean;
versions: ShippingOrderSchemaVersion[];
selectedVersion: ShippingOrderSchemaVersion | null;
loading: boolean;
detailLoading: boolean;
total: number;
auditEvents: ShippingOrderSchemaAuditEvent[];
auditTotal: number;
auditLoading: boolean;
comparisonTarget: ShippingOrderSchemaVersion | null;
copying: boolean;
}>();
const emit = defineEmits<{
'update:modelValue': [visible: boolean];
select: [versionId: number];
loadMore: [];
loadMoreAudit: [];
compare: [versionId: number];
usage: [versionId: number];
copy: [versionId: number];
}>();
const { t } = useI18n();
/** 将时间转为用户本地格式;缺失发布时间时回退创建时间。 */
const formatDate = (value?: string | null): string => {
if (!value) return t('admin.shippingOrderSchema.historyUnknownTime');
return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(new Date(value));
};
/** 根据版本状态提供一致的时间线标签。 */
const statusLabel = (status: ShippingOrderSchemaVersion['status']): string =>
t(`admin.shippingOrderSchema.historyStatus.${status}`);
/** 历史详情只展示快照中的完整字段,不回读当前字段目录。 */
const fields = computed(() => props.selectedVersion?.definition?.fields || []);
/** 关闭抽屉时由父页面同步清除 URL 中的版本查询参数。 */
const close = (): void => emit('update:modelValue', false);
</script>
<template>
<Teleport to="body">
<div v-if="modelValue" class="history-layer" role="presentation" @click.self="close">
<aside class="history-drawer" role="dialog" aria-modal="true" :aria-label="t('admin.shippingOrderSchema.historyTitle')">
<header class="history-header">
<div><p>{{ t('admin.shippingOrderSchema.historyEyebrow') }}</p><h2>{{ t('admin.shippingOrderSchema.historyTitle') }}</h2></div>
<button type="button" class="history-close" :aria-label="t('common.close')" @click="close">×</button>
</header>
<div class="history-content">
<nav class="history-timeline" :aria-label="t('admin.shippingOrderSchema.historyTitle')">
<button
v-for="item in versions"
:key="item.id"
type="button"
class="history-item"
:class="{ selected: selectedVersion?.id === item.id }"
@click="emit('select', item.id)"
>
<span class="history-version">V{{ item.version }}</span>
<span class="history-status" :class="item.status">{{ statusLabel(item.status) }}</span>
<strong>{{ item.change_note || t('admin.shippingOrderSchema.historyNoNote') }}</strong>
<small>{{ formatDate(item.published_at || item.created_at) }}</small>
<small>{{ item.published_by?.display_name || item.created_by?.display_name || t('admin.shippingOrderSchema.historyUnknownActor') }}</small>
</button>
<button v-if="versions.length < total" type="button" class="history-more" :disabled="loading" @click="emit('loadMore')">
{{ loading ? t('common.loading') : t('admin.shippingOrderSchema.historyLoadMore') }}
</button>
</nav>
<section class="history-detail">
<div v-if="detailLoading" class="history-empty">{{ t('common.loading') }}</div>
<template v-else-if="selectedVersion">
<header class="detail-heading">
<div><p>{{ t('admin.shippingOrderSchema.historyViewing') }}</p><h3>V{{ selectedVersion.version }}</h3></div>
<span class="detail-readonly">{{ t('admin.shippingOrderSchema.readOnly') }}</span>
</header>
<dl class="detail-meta">
<div><dt>{{ t('admin.shippingOrderSchema.historyPublishedAt') }}</dt><dd>{{ formatDate(selectedVersion.published_at || selectedVersion.created_at) }}</dd></div>
<div><dt>{{ t('admin.shippingOrderSchema.historyPublisher') }}</dt><dd>{{ selectedVersion.published_by?.display_name || selectedVersion.created_by?.display_name || t('admin.shippingOrderSchema.historyUnknownActor') }}</dd></div>
<div><dt>{{ t('admin.shippingOrderSchema.historyChecksum') }}</dt><dd><code>{{ selectedVersion.checksum || '-' }}</code></dd></div>
<div><dt>{{ t('admin.shippingOrderSchema.changeNote') }}</dt><dd>{{ selectedVersion.change_note || t('admin.shippingOrderSchema.historyNoNote') }}</dd></div>
</dl>
<button v-if="comparisonTarget" type="button" class="compare-button" @click="emit('compare', selectedVersion.id)">
{{ t('admin.shippingOrderSchema.diffWithCurrent', { version: comparisonTarget.version }) }}
</button>
<div class="history-actions">
<button type="button" class="compare-button" @click="emit('usage', selectedVersion.id)">{{ t('admin.shippingOrderSchema.usageOpen') }}</button>
<button v-if="selectedVersion.status !== 'draft'" type="button" class="compare-button" :disabled="copying" @click="emit('copy', selectedVersion.id)">{{ t('admin.shippingOrderSchema.copyToDraft') }}</button>
</div>
<div class="snapshot-heading"><span>{{ t('admin.shippingOrderSchema.historySnapshotFields') }}</span><b>{{ fields.length }}</b></div>
<article v-for="field in fields" :key="field.field_id" class="snapshot-field" :class="{ excluded: field.enabled === false }">
<div class="snapshot-field-title"><strong>{{ field.display_name }}</strong><code>{{ field.field_code }}</code><span v-if="field.enabled === false">{{ t('admin.shippingOrderSchema.historyExcluded') }}</span></div>
<p>{{ field.scope === 'header' ? t('admin.shippingOrderSchema.placementHeader') : t('admin.shippingOrderSchema.placementLine') }} · {{ t(`admin.shippingOrderSchema.fieldType.${field.value_type}`) }}</p>
<dl><div><dt>{{ t('admin.shippingOrderSchema.aliases') }}</dt><dd>{{ field.aliases.join(', ') || '-' }}</dd></div><div><dt>{{ t('admin.shippingOrderSchema.extractionInstruction') }}</dt><dd>{{ field.extraction_instruction || '-' }}</dd></div></dl>
</article>
<SchemaAuditTimeline
:events="auditEvents"
:total="auditTotal"
:loading="auditLoading"
@load-more="emit('loadMoreAudit')"
/>
</template>
<div v-else class="history-empty">{{ t('admin.shippingOrderSchema.historySelectVersion') }}</div>
</section>
</div>
</aside>
</div>
</Teleport>
</template>
<style scoped>
.history-layer { position: fixed; z-index: 70; inset: 0; display: flex; justify-content: flex-end; background: rgb(15 23 42 / 30%); backdrop-filter: blur(2px); }
.history-drawer { display: flex; width: min(1060px, 96vw); height: 100%; flex-direction: column; background: #f8fafc; box-shadow: -18px 0 48px rgb(15 23 42 / 18%); }
.history-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e8f0; background: #fff; padding: 22px 26px; }
.history-header p, .detail-heading p { margin: 0 0 4px; color: #0284c7; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.history-header h2, .detail-heading h3 { margin: 0; color: #1e293b; font-size: 20px; }
.history-close { width: 32px; height: 32px; border: 1px solid #dbe5ee; border-radius: 50%; background: #fff; color: #475569; font-size: 22px; line-height: 1; cursor: pointer; }
.history-content { display: grid; min-height: 0; flex: 1; grid-template-columns: 290px minmax(0, 1fr); }
.history-timeline { overflow-y: auto; border-right: 1px solid #e2e8f0; background: #f1f5f9; padding: 14px 10px; }
.history-item { display: grid; width: 100%; gap: 5px; margin-bottom: 6px; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 12px; color: #475569; font: inherit; text-align: left; cursor: pointer; }
.history-item:hover { background: #fff; }
.history-item.selected { border-color: #bae6fd; background: #fff; box-shadow: inset 3px 0 #0ea5e9; }
.history-version { color: #0f172a; font-size: 16px; font-weight: 700; }
.history-status { width: fit-content; border-radius: 999px; padding: 2px 6px; font-size: 10px; font-weight: 700; }
.history-status.published { background: #dcfce7; color: #15803d; }.history-status.retired { background: #e2e8f0; color: #475569; }.history-status.draft { background: #fef3c7; color: #a16207; }
.history-item strong { overflow: hidden; color: #334155; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }.history-item small { color: #94a3b8; font-size: 11px; }
.history-more { width: 100%; border: 1px dashed #cbd5e1; border-radius: 7px; background: transparent; padding: 8px; color: #0284c7; font: inherit; font-size: 12px; cursor: pointer; }
.history-detail { overflow-y: auto; background: #fff; padding: 26px; }.history-empty { display: grid; min-height: 300px; place-items: center; color: #94a3b8; font-size: 13px; }
.detail-heading { display: flex; align-items: flex-start; justify-content: space-between; }.detail-readonly { border: 1px solid #cbd5e1; border-radius: 999px; background: #f8fafc; padding: 4px 9px; color: #64748b; font-size: 11px; font-weight: 700; }
.detail-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0; }.detail-meta div { border: 1px solid #e5ebf1; border-radius: 8px; background: #fbfdff; padding: 10px; }.detail-meta dt, .snapshot-field dt { color: #94a3b8; font-size: 10px; }.detail-meta dd, .snapshot-field dd { margin: 5px 0 0; color: #334155; font-size: 12px; overflow-wrap: anywhere; }.detail-meta code { color: #0369a1; font-size: 10px; }
.snapshot-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #64748b; font-size: 12px; font-weight: 700; }.snapshot-heading b { border-radius: 999px; background: #e0f2fe; padding: 2px 7px; color: #0369a1; }
.compare-button { margin: -8px 0 16px; border: 1px solid #7dd3fc; border-radius: 6px; background: #f0f9ff; padding: 7px 10px; color: #0369a1; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.history-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; }.history-actions .compare-button { margin: 0; }.compare-button:disabled { cursor: not-allowed; opacity: .55; }
.snapshot-field { margin-top: 8px; border: 1px solid #e5ebf1; border-radius: 8px; padding: 13px; }.snapshot-field.excluded { border-style: dashed; opacity: .68; }.snapshot-field-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }.snapshot-field-title strong { color: #1e293b; font-size: 13px; }.snapshot-field-title code { color: #64748b; font-size: 11px; }.snapshot-field-title span { border-radius: 999px; background: #fef3c7; padding: 2px 6px; color: #a16207; font-size: 10px; }.snapshot-field p { margin: 6px 0 10px; color: #94a3b8; font-size: 11px; }.snapshot-field dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
@media (max-width: 760px) { .history-drawer { width: 100vw; }.history-content { grid-template-columns: 1fr; }.history-timeline { max-height: 38vh; border-right: 0; border-bottom: 1px solid #e2e8f0; }.detail-meta, .snapshot-field dl { grid-template-columns: 1fr; }.history-detail { padding: 18px; } }
</style>
@@ -0,0 +1,46 @@
<!--
features/admin/modules/shipping-order-schema/components/SchemaVersionUsageDrawer.vue
用途:展示一个订单 Schema 版本实际参与解析的使用统计和分页运行记录。
依赖:ShippingOrderSchemaVersionUsage DTO、Vue I18n。
逻辑:父页面负责请求数据和打开单次审计,本组件只展示摘要并发出选择/翻页事件。
-->
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import type { ShippingOrderSchemaVersionUsage } from '@/features/admin/types/shipping-order-schema.types';
defineProps<{ modelValue: boolean; usage: ShippingOrderSchemaVersionUsage | null; loading: boolean }>();
const emit = defineEmits<{ 'update:modelValue': [visible: boolean]; select: [extractionId: number]; loadMore: [] }>();
const { t } = useI18n();
/** 将可选 UTC 时间统一展示为本地阅读格式。 */
const formatDate = (value?: string | null): string => value
? new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(new Date(value))
: t('admin.shippingOrderSchema.historyUnknownTime');
</script>
<template>
<Teleport to="body">
<div v-if="modelValue" class="usage-layer" role="presentation" @click.self="emit('update:modelValue', false)">
<aside class="usage-drawer" role="dialog" aria-modal="true" :aria-label="t('admin.shippingOrderSchema.usageTitle')">
<header><div><p>{{ t('admin.shippingOrderSchema.usageEyebrow') }}</p><h2>{{ t('admin.shippingOrderSchema.usageTitle') }}</h2></div><button type="button" :aria-label="t('common.close')" @click="emit('update:modelValue', false)">×</button></header>
<main v-if="loading" class="usage-empty">{{ t('common.loading') }}</main>
<main v-else-if="usage">
<p class="usage-version">V{{ usage.version.version }}</p>
<dl class="usage-summary"><div><dt>{{ t('admin.shippingOrderSchema.usageTotal') }}</dt><dd>{{ usage.summary.total }}</dd></div><div><dt>{{ t('admin.shippingOrderSchema.usageFirst') }}</dt><dd>{{ formatDate(usage.summary.first_used_at) }}</dd></div><div><dt>{{ t('admin.shippingOrderSchema.usageLast') }}</dt><dd>{{ formatDate(usage.summary.last_used_at) }}</dd></div></dl>
<div class="usage-statuses"><span v-for="(count, status) in usage.summary.status_counts" :key="status">{{ t(`admin.shippingOrderSchema.extractionStatus.${status}`) }} <b>{{ count }}</b></span></div>
<h3>{{ t('admin.shippingOrderSchema.usageRecords') }}</h3>
<p v-if="!usage.items.length" class="usage-empty">{{ t('admin.shippingOrderSchema.usageEmpty') }}</p>
<button v-for="item in usage.items" :key="item.id" type="button" class="usage-record" @click="emit('select', item.id)">
<strong>#{{ item.id }}</strong><span>{{ t(`admin.shippingOrderSchema.extractionStatus.${item.status}`) }}</span><small>{{ formatDate(item.created_at) }} · {{ item.input_snapshot_hash.slice(0, 12) }}</small>
</button>
<button v-if="usage.items.length < usage.total" type="button" class="usage-more" :disabled="loading" @click="emit('loadMore')">{{ t('admin.shippingOrderSchema.usageLoadMore') }}</button>
</main>
<main v-else class="usage-empty">{{ t('admin.shippingOrderSchema.usageEmpty') }}</main>
</aside>
</div>
</Teleport>
</template>
<style scoped>
.usage-layer { position: fixed; z-index: 80; inset: 0; display: flex; justify-content: flex-end; background: rgb(15 23 42 / 35%); backdrop-filter: blur(2px); }.usage-drawer { display: flex; width: min(680px, 96vw); height: 100%; flex-direction: column; overflow: hidden; background: #f8fafc; box-shadow: -18px 0 48px rgb(15 23 42 / 18%); }.usage-drawer > header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e8f0; background: #fff; padding: 22px 26px; }.usage-drawer header p { margin: 0 0 4px; color: #0284c7; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }.usage-drawer h2 { margin: 0; color: #1e293b; font-size: 20px; }.usage-drawer > header button { width: 32px; height: 32px; border: 1px solid #dbe5ee; border-radius: 50%; background: #fff; color: #475569; font-size: 22px; line-height: 1; cursor: pointer; }.usage-drawer main { overflow-y: auto; padding: 24px 26px; }.usage-version { margin: 0 0 12px; color: #0369a1; font-weight: 700; }.usage-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }.usage-summary div { border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; padding: 10px; }.usage-summary dt { color: #94a3b8; font-size: 10px; }.usage-summary dd { margin: 5px 0 0; color: #334155; font-size: 12px; overflow-wrap: anywhere; }.usage-statuses { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0; }.usage-statuses span { border-radius: 999px; background: #e0f2fe; padding: 3px 7px; color: #0369a1; font-size: 11px; }.usage-drawer h3 { margin: 22px 0 10px; color: #64748b; font-size: 12px; }.usage-record { display: grid; width: 100%; grid-template-columns: 70px 1fr; gap: 5px 10px; margin-top: 7px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; padding: 11px; color: #475569; font: inherit; text-align: left; cursor: pointer; }.usage-record:hover { border-color: #7dd3fc; background: #f0f9ff; }.usage-record strong { color: #1e293b; font-size: 12px; }.usage-record span { color: #0369a1; font-size: 12px; }.usage-record small { grid-column: 1 / -1; color: #94a3b8; font-size: 10px; }.usage-empty { display: grid; min-height: 220px; place-items: center; color: #94a3b8; font-size: 13px; }.usage-more { width: 100%; margin-top: 10px; border: 1px dashed #cbd5e1; border-radius: 7px; background: transparent; padding: 8px; color: #0284c7; font: inherit; font-size: 12px; cursor: pointer; }@media (max-width: 640px) { .usage-drawer main { padding: 18px; }.usage-summary { grid-template-columns: 1fr; } }
</style>
@@ -17,6 +17,7 @@ export type AdminModuleId =
| 'permissions'
| 'requests'
| 'platform_apps'
| 'shipping_inventory'
| 'reports';
export type AdminReportTableId =
@@ -0,0 +1,173 @@
/**
* features/admin/types/shipping-order-schema.types.ts
* 用途:订单 Schema 管理 API 的字段、版本和能力目录类型。
* 依赖:无。
* 逻辑:shipping-order-schema API 与管理页面共享这些稳定 DTO。
*/
export interface ShippingOrderField {
id: string;
field_code: string;
scope: 'header' | 'line';
value_type: 'string' | 'decimal' | 'integer' | 'date' | 'boolean' | 'enum';
status: 'active' | 'retired';
published_once: boolean;
}
export interface ShippingOrderFieldConfig {
field_id: string;
enabled?: boolean;
field_code?: string;
scope?: ShippingOrderField['scope'];
value_type?: ShippingOrderField['value_type'];
display_name: string;
description?: string | null;
required: boolean;
aliases: string[];
normalizer_key: string;
validator_keys: string[];
enum_options: string[];
evidence_policy: {
required: boolean;
source_precedence: string[];
conflict_policy: string;
allow_single_source: boolean;
};
relation_role?: string | null;
comparator_key: string;
extraction_instruction?: string | null;
sequence?: number;
}
export interface ShippingOrderSchemaVersion {
id: number;
version: number;
status: 'draft' | 'published' | 'retired';
checksum?: string | null;
lock_version: number;
change_note?: string | null;
source_version_id?: number | null;
published_at?: string | null;
retired_at?: string | null;
created_at?: string | null;
updated_at?: string | null;
created_by?: SchemaVersionActor | null;
published_by?: SchemaVersionActor | null;
field_count: number;
definition?: { fields: ShippingOrderFieldConfig[] };
}
export interface SchemaVersionActor {
id: number;
display_name: string;
}
export interface ShippingOrderSchemaVersionPage {
items: ShippingOrderSchemaVersion[];
page: number;
page_size: number;
total: number;
}
export interface ShippingOrderSchemaFieldChange {
key: string;
kind: 'value' | 'set';
before: unknown;
after: unknown;
added?: string[];
removed?: string[];
order_changed?: boolean;
}
export interface ShippingOrderSchemaFieldDiff {
field_id: string;
change_type: 'added' | 'removed' | 'modified' | 'unchanged';
before: ShippingOrderFieldConfig | null;
after: ShippingOrderFieldConfig | null;
changes: ShippingOrderSchemaFieldChange[];
}
export interface ShippingOrderSchemaVersionDiff {
base_version: ShippingOrderSchemaVersion;
compare_version: ShippingOrderSchemaVersion;
summary: Record<'added' | 'removed' | 'modified' | 'unchanged', number>;
fields: ShippingOrderSchemaFieldDiff[];
}
export interface ShippingOrderSchemaAuditEvent {
id: number;
event_type: string;
version: Pick<ShippingOrderSchemaVersion, 'id' | 'version'> | null;
actor: SchemaVersionActor | null;
change_summary: Record<string, unknown>;
request_id?: string | null;
created_at?: string | null;
}
export interface ShippingOrderSchemaAuditEventPage {
items: ShippingOrderSchemaAuditEvent[];
page: number;
page_size: number;
total: number;
}
export interface ShippingOrderExtractionSummary {
id: number;
task_id?: number | null;
intake_id?: number | null;
status: string;
input_snapshot_hash: string;
created_at?: string | null;
updated_at?: string | null;
}
export interface ShippingOrderSchemaVersionUsage {
version: ShippingOrderSchemaVersion;
summary: {
total: number;
status_counts: Record<string, number>;
first_used_at?: string | null;
last_used_at?: string | null;
};
items: ShippingOrderExtractionSummary[];
page: number;
page_size: number;
total: number;
}
export interface ShippingOrderExtractionAudit {
extraction: ShippingOrderExtractionSummary;
schema_version: ShippingOrderSchemaVersion;
input_snapshot: Record<string, unknown>;
raw_llm_output: unknown;
normalized_result: unknown;
validation_result: unknown;
lines: Array<{ id: number; position: number; line_key?: string | null }>;
observations: Array<Record<string, unknown>>;
decisions: Array<Record<string, unknown>>;
field_values: Array<Record<string, unknown>>;
}
export interface ShippingOrderSchemaState {
schema: null | {
id: number;
schema_code: string;
display_name: string;
description?: string | null;
status: string;
};
fields: ShippingOrderField[];
versions: ShippingOrderSchemaVersion[];
catalog: {
field_types: string[];
field_scopes: string[];
normalizers: string[];
validators: string[];
comparators: string[];
relation_roles: string[];
source_types: string[];
conflict_policies: string[];
type_normalizers: Record<ShippingOrderField['value_type'], string[]>;
type_validators: Record<ShippingOrderField['value_type'], string[]>;
type_comparators: Record<ShippingOrderField['value_type'], string[]>;
};
}
+12 -31
View File
@@ -1,17 +1,17 @@
/**
* features/chat/api/shipping.api.ts
* 用途:封装发货通知相关 HTTP API,包括任务/批次查询、库存上传、映射确认、人工决策与 Excel 导出。
* 用途:封装发货通知相关 HTTP API,包括任务/批次查询、人工决策与 Excel 导出。
* 依赖:统一 requestJson / BusinessError、shipping.api.types 类型定义。
* 逻辑:上游由 useChatShipping 与 shipping/* handler 调用本文件;本文件统一请求工作台后端 `/api/workspace/*` 路由并抛出标准错误。
*/
import { BusinessError, requestJson } from '@/shared/api/client';
import { getAuthHeaders } from '@/shared/utils/auth';
import { reportShippingDebugEvent } from '../shipping/shippingDebugReporter';
import type {
ShippingBatchSummary,
ShippingBatchUiState,
ShippingConversationWorkspace,
ShippingDecisionResponse,
ShippingInventoryUploadResponse,
ShippingNoticeHeader,
ShippingNoticeLine,
ShippingNoticeUploadResponse,
@@ -125,20 +125,16 @@ export const getWorkspaceShippingTaskUiState = (taskNo: string) =>
export const workspaceShippingExportUrl = (taskNo: string) =>
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/export`;
/**
* 上传库存 Excel,并由后端完成解析与 schema preview 生成。
* @param taskNo - 发货任务编号
* @param file - 用户选择的库存文件
* @returns 库存上传与解析结果
*/
export async function uploadWorkspaceShippingInventory(taskNo: string, file: File) {
const form = new FormData();
form.append('file', file);
const body = await requestJson<ShippingInventoryUploadResponse & ShippingApiStatusPayload>(
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/upload-inventory`,
{ method: 'POST', body: form },
);
return assertShippingOk(body);
/** 下载一个批次或显式任务集合的当前 ready 发货 Excel ZIP。 */
export async function downloadWorkspaceShippingExportArchive(payload: { batch_no?: string; task_nos?: string[] }) {
const response = await fetch('/api/workspace/shipping-exports/archive', {
method: 'POST', headers: { 'Content-Type': 'application/json', ...getAuthHeaders() }, body: JSON.stringify(payload),
});
if (!response.ok) throw new Error('Shipping export archive download failed');
const disposition = response.headers.get('Content-Disposition') || '';
const encoded = disposition.match(/filename\*=UTF-8''([^;]+)/i)?.[1];
const plain = disposition.match(/filename="?([^";]+)"?/i)?.[1];
return { blob: await response.blob(), filename: encoded ? decodeURIComponent(encoded) : (plain || 'shipping_exports.zip') };
}
/**
@@ -169,20 +165,6 @@ export const confirmWorkspaceShippingCustomer = (taskNo: string, customerId: num
jsonPost({ customer_id: customerId }),
);
/**
* 提交库存字段映射。
* @param taskNo - 发货任务编号
* @param columnMappingJson - 前端表单确认后的 map_json
* @returns 映射应用与库存解析结果
*/
export async function applyWorkspaceShippingInventoryMapping(taskNo: string, columnMappingJson: Record<string, unknown>) {
const body = await requestJson<ShippingInventoryUploadResponse & ShippingApiStatusPayload>(
`/api/workspace/shipping-tasks/${encodeURIComponent(taskNo)}/apply-inventory-mapping`,
jsonPost({ map_json: columnMappingJson }),
);
return assertShippingOk(body);
}
/**
* 创建单个发货任务。
* @param params - 建单参数,可包含 source_type、conversation_id、raw_content
@@ -681,7 +663,6 @@ export type {
ShippingConversationWorkspaceSummary,
ShippingCurrentStepProgress,
ShippingDecisionResponse,
ShippingInventoryUploadResponse,
ShippingMatchLineResult,
ShippingNoticeHeader,
ShippingNoticeLine,
@@ -437,7 +437,7 @@ watch(
:ref="bindShippingPickerRef"
type="file"
class="hidden"
accept=".xlsx,.csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv"
accept=".xls,.xlsx,.csv,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,text/csv"
@change="emit('shipping-inventory-selected', $event)"
/>
@@ -9,7 +9,7 @@ import ChatThinkingBubble from './ChatThinkingBubble.vue';
import ChatMessageBubble, { type ChatMessageBubbleHandlers } from './messages/ChatMessageBubble.vue';
import ToolRunProgressCard from './ToolRunProgressCard.vue';
import type { LeaveMessageHandlers } from './messages/LeaveMessageBlock.vue';
import type { ShippingMappingHandlers } from './messages/ShippingInventoryMappingMessage.vue';
import type { ShippingMessageHandlers } from './messages/shippingMessageHandlers';
import type { TrainingHandlers } from './messages/TrainingExamQuestionMessage.vue';
import type { ChatMessage } from '../types/chat.types';
import type { ToolRunProgress } from '../api/toolRunProgress.api';
@@ -34,7 +34,7 @@ const {
isShippingNoticeAgent: boolean;
handlers: ChatMessageBubbleHandlers;
leaveHandlers: LeaveMessageHandlers;
shippingHandlers: ShippingMappingHandlers;
shippingHandlers: ShippingMessageHandlers;
trainingHandlers: TrainingHandlers;
shouldRenderMessage: (msg: ChatMessage) => boolean;
shouldShowToolRunProgressAfterMessage: (msg: ChatMessage, index: number) => boolean;
@@ -233,7 +233,7 @@ watch(() => page.currentAgentId, () => {
:is-shipping-notice-agent="page.isShippingNoticeAgent"
:handlers="page.messageBubbleHandlers"
:leave-handlers="page.leaveMessageHandlers"
:shipping-handlers="page.shippingMappingHandlers"
:shipping-handlers="page.shippingMessageHandlers"
:training-handlers="page.trainingHandlers"
:should-render-message="page.shouldRenderMessage"
:should-show-tool-run-progress-after-message="page.shouldShowToolRunProgressAfterMessage"
@@ -337,12 +337,6 @@ const resolveTaskDiagnosis = (task: ShippingTaskSummary | ShippingTaskDetail) =>
advice: t('chat.shippingNoticeUi.diagnosisInventoryRpaAdvice'),
};
}
if (reason === 'align_review' || reviewStatus === 'align_review') {
return {
title: t('chat.shippingNoticeUi.diagnosisAlignReviewTitle'),
advice: t('chat.shippingNoticeUi.diagnosisAlignReviewAdvice'),
};
}
if (reason === 'low_confidence' || reviewStatus === 'parse_review') {
return {
title: t('chat.shippingNoticeUi.diagnosisParseReviewTitle'),
@@ -370,7 +364,7 @@ const resolveTaskDiagnosis = (task: ShippingTaskSummary | ShippingTaskDetail) =>
: 'chat.shippingNoticeUi.diagnosisInventorySourceAdvice'),
};
}
if (reason === 'map_infer' || processStatus === 'waiting_inventory') {
if (processStatus === 'waiting_inventory') {
return {
title: t('chat.shippingNoticeUi.diagnosisInventoryWaitingTitle'),
advice: t('chat.shippingNoticeUi.diagnosisInventoryWaitingAdvice'),
@@ -392,9 +386,6 @@ const resolveSuggestedAction = (task: ShippingTaskSummary | ShippingTaskDetail)
if (hasShortageLines(task) || reason === 'shortage' || reviewStatus === 'shortage_review') {
return t('chat.shippingNoticeUi.suggestShortageActions');
}
if (reason === 'align_review' || reviewStatus === 'align_review') {
return t('chat.shippingNoticeUi.suggestConfirmMapping');
}
if (reason === 'low_confidence' || reviewStatus === 'parse_review') {
return t('chat.shippingNoticeUi.suggestReviewParse');
}
@@ -148,6 +148,11 @@ function displayCell(value: unknown): string {
return text || '—';
}
/** 将客户匹配状态转换为面向业务用户的文案。 */
function customerMatchStatus(status: string): string {
return t(`chat.shippingCustomerMatch.status.${status}`);
}
/** 对当前首个重复目标应用决策;强制新建时要求填写原因。 */
function resolveDuplicate(candidateNo: string, action: ShippingDuplicateAction): void {
const candidate = candidates.value.find((item) => item.candidateNo === candidateNo);
@@ -225,6 +230,36 @@ function submitForceCreate(candidateNo: string): void {
</span>
</div>
</div>
<div
v-if="candidate.customerMatches?.length"
class="mt-2 overflow-x-auto rounded-lg border border-default bg-surface"
>
<div class="border-b border-default bg-surface-soft px-2 py-1.5 font-semibold text-primary">
{{ t('chat.shippingCustomerMatch.title') }}
</div>
<table class="min-w-full text-[11px]">
<thead class="text-left text-muted">
<tr>
<th class="px-2 py-1">{{ t('chat.shippingCustomerMatch.role') }}</th>
<th class="px-2 py-1">{{ t('chat.shippingCustomerMatch.rawName') }}</th>
<th class="px-2 py-1">{{ t('chat.shippingCustomerMatch.standardName') }}</th>
<th class="px-2 py-1">{{ t('chat.shippingCustomerMatch.shortCode') }}</th>
<th class="px-2 py-1">{{ t('chat.shippingCustomerMatch.site') }}</th>
<th class="px-2 py-1">{{ t('chat.shippingCustomerMatch.statusLabel') }}</th>
</tr>
</thead>
<tbody>
<tr v-for="match in candidate.customerMatches" :key="match.role" class="border-t border-default/60">
<td class="px-2 py-1 font-medium">{{ t(`chat.shippingCustomerMatch.roles.${match.role}`) }}</td>
<td class="px-2 py-1">{{ displayCell(match.raw_name) }}</td>
<td class="px-2 py-1">{{ displayCell(match.standard_name) }}</td>
<td class="px-2 py-1 font-mono">{{ displayCell(match.short_code) }}</td>
<td class="px-2 py-1">{{ displayCell(match.candidates?.find((item) => item.site_id === match.site_id)?.site_name) }}</td>
<td class="px-2 py-1">{{ customerMatchStatus(match.status) }}</td>
</tr>
</tbody>
</table>
</div>
<div
v-if="editingCandidateNo !== candidate.candidateNo && readonlyLines(candidate).length"
class="mt-2 overflow-x-auto rounded-lg border border-default bg-surface"
@@ -25,15 +25,15 @@ import { useAuthStore } from '@/features/auth/stores/auth.store';
import LeaveMessageBlock, { type LeaveMessageHandlers } from './LeaveMessageBlock.vue';
import ChatMessageAttachmentList from './ChatMessageAttachmentList.vue';
import MaintenanceDeviceResultCard from './MaintenanceDeviceResultCard.vue';
import ShippingInventoryMappingMessage, { type ShippingMappingHandlers } from './ShippingInventoryMappingMessage.vue';
import ShippingMatchResultCard from './ShippingMatchResultCard.vue';
import ShippingParseReviewMessage, { type ShippingParseReviewHandlers } from './ShippingParseReviewMessage.vue';
import type { ShippingMessageHandlers } from './shippingMessageHandlers';
import TrainingExamQuestionMessage, { type TrainingHandlers } from './TrainingExamQuestionMessage.vue';
import TrainingVideoMessage from './TrainingVideoMessage.vue';
import TrainingSummaryMessage from './TrainingSummaryMessage.vue';
import TrainingResultCard from './TrainingResultCard.vue';
import type { ChatMessage, InlineDownloadFile, SourceFileLink } from '../../types/chat.types';
import type { ShippingInventoryMappingFormPayload, ShippingMatchResultPayload } from '../../types/shipping.types';
import type { ShippingMatchResultPayload } from '../../types/shipping.types';
import type { MaintenanceDevice } from '@/features/maintenance/types/ledger.types';
import type { MaintenanceRecord } from '@/features/maintenance/types/record.types';
@@ -44,7 +44,6 @@ export interface ChatMessageBubbleHandlers {
openAssetImage: (assetId: string, assetName?: string) => void;
getInlineDownloadFiles: (text: string) => { cleanedText: string; files: InlineDownloadFile[] };
downloadInlineFile: (file: InlineDownloadFile) => void;
getShippingInventoryMappingPayload: (msg: ChatMessage) => ShippingInventoryMappingFormPayload | null;
getShippingMatchResultPayload: (msg: ChatMessage) => ShippingMatchResultPayload | null;
canOpenQueryPreview: (msg: ChatMessage) => boolean;
getQueryPreviewSummary: (msg: ChatMessage) => string;
@@ -83,7 +82,7 @@ const {
isLatestAssistantMessage: boolean;
handlers: ChatMessageBubbleHandlers;
leaveHandlers: LeaveMessageHandlers;
shippingHandlers: ShippingMappingHandlers;
shippingHandlers: ShippingMessageHandlers;
trainingHandlers: TrainingHandlers;
}>();
@@ -752,13 +751,8 @@ function handleInlineDownload(file: InlineDownloadFile): void {
:index="index"
:handlers="leaveHandlers"
/>
<ShippingInventoryMappingMessage
v-else-if="message.type === 'shipping-inventory-mapping' && handlers.getShippingInventoryMappingPayload(message)"
:message="message"
:handlers="shippingHandlers"
/>
<ShippingParseReviewMessage
v-else-if="message.type === 'shipping-parse-review' && shippingHandlers.getParseReviewPayload(message)"
v-if="message.type === 'shipping-parse-review' && shippingHandlers.getParseReviewPayload(message)"
:message="message"
:handlers="shippingParseReviewHandlers"
/>
@@ -1,122 +0,0 @@
/**
* features/chat/components/messages/ShippingInventoryMappingMessage.vue
* 用途:发货 Agent 库存 Excel 列映射表单消息 UI。
* 依赖:chat.types、shipping.api.types、shipping.types。
* 逻辑:ChatView 渲染 mapping 类型消息时挂载;通过 ShippingMappingHandlers 与 useChatShipping 交互。
*/
<script setup lang="ts">
import type { ChatMessage } from '../../types/chat.types';
import type { ShippingNoticeHeader, ShippingNoticeLine } from '../../types/shipping.api.types';
import type { ShippingInventoryMappingFormPayload, ShippingMatchResultPayload, ShippingParseReviewPayload } from '../../types/shipping.types';
export interface ShippingMappingHandlers {
getPayload: (msg: ChatMessage) => ShippingInventoryMappingFormPayload | null;
normalizeHeader: (header: string) => string;
hasSampleRows: (msg: ChatMessage) => boolean;
getSampleRowText: (msg: ChatMessage) => string;
reupload: (msg: ChatMessage) => void;
apply: (msg: ChatMessage) => void;
getParseReviewPayload: (msg: ChatMessage) => ShippingParseReviewPayload | null;
getMatchResultPayload: (msg: ChatMessage) => ShippingMatchResultPayload | null;
updateParseReviewHeader: (msg: ChatMessage, fields: Partial<ShippingNoticeHeader>) => Promise<boolean>;
updateParseReviewLine: (msg: ChatMessage, lineIndex: number, patch: Partial<ShippingNoticeLine>) => Promise<boolean>;
updateHeader: (msg: ChatMessage, fields: Partial<ShippingNoticeHeader>) => Promise<boolean>;
updateLine: (msg: ChatMessage, lineIndex: number, patch: Partial<ShippingNoticeLine>) => Promise<boolean>;
addLine: (msg: ChatMessage, line: Partial<ShippingNoticeLine>) => Promise<boolean>;
removeLine: (msg: ChatMessage, lineIndex: number) => Promise<boolean>;
}
const { message, handlers } = defineProps<{
message: ChatMessage;
handlers: ShippingMappingHandlers;
}>();
</script>
<template>
<div v-if="handlers.getPayload(message)" class="space-y-4">
<div class="whitespace-pre-wrap text-sm font-medium text-secondary">{{ message.content }}</div>
<div class="space-y-4 rounded-2xl border border-default bg-surface-soft/90 p-4">
<div class="space-y-2">
<div class="text-xs font-bold uppercase tracking-wider text-muted">{{ $t('chat.shippingNoticeMapping.inventoryHeaders') }}</div>
<div class="text-xs text-muted">
{{ $t('chat.shippingNoticeMapping.headerRow', { row: handlers.getPayload(message)!.schema_preview.header_row_index || 1 }) }}
</div>
<div class="flex flex-wrap gap-2">
<span
v-for="h in (handlers.getPayload(message)!.schema_preview.headers || [])"
:key="`inv-h-${h}`"
class="rounded-full border border-default bg-surface px-3 py-1 text-xs text-secondary"
>{{ handlers.normalizeHeader(h) || $t('chat.shippingNoticeMapping.empty') }}</span>
</div>
<div
v-if="handlers.hasSampleRows(message)"
class="whitespace-pre-wrap text-xs text-muted"
>
{{ $t('chat.shippingNoticeMapping.sample') }}:{{ handlers.getSampleRowText(message) }}
</div>
</div>
<div class="space-y-2">
<div class="text-xs font-bold uppercase tracking-wider text-muted">{{ $t('chat.shippingNoticeMapping.orderDetails') }}</div>
<div class="text-xs text-muted">
{{ $t('chat.shippingNoticeMapping.orderRowCount', { count: handlers.getPayload(message)!.order.line_count }) }};{{ $t('chat.shippingNoticeMapping.orderPartNumberPreview', { count: handlers.getPayload(message)!.order.part_numbers.length, partNumbers: handlers.getPayload(message)!.order.part_numbers.join(',') || $t('chat.shippingNoticeMapping.unrecognized') }) }}
</div>
</div>
<div class="grid gap-4 md:grid-cols-2">
<label class="space-y-1.5">
<span class="text-xs font-semibold text-muted">{{ $t('chat.shippingNoticeMapping.partNumberColumnRequired') }}</span>
<select
v-model="handlers.getPayload(message)!.form.part_number"
class="w-full rounded-xl border border-default px-3 py-2 text-sm text-secondary outline-none transition focus:border-blue-400"
:disabled="handlers.getPayload(message)!.applying"
>
<option value="" disabled>{{ $t('chat.shippingNoticeMapping.selectHeader') }}</option>
<option v-for="h in (handlers.getPayload(message)!.schema_preview.headers || [])" :key="`part-number-${h}`" :value="h">{{ handlers.normalizeHeader(h) }}</option>
</select>
</label>
<label class="space-y-1.5">
<span class="text-xs font-semibold text-muted">{{ $t('chat.shippingNoticeMapping.availableQtyColumnRequired') }}</span>
<select
v-model="handlers.getPayload(message)!.form.available_qty"
class="w-full rounded-xl border border-default px-3 py-2 text-sm text-secondary outline-none transition focus:border-blue-400"
:disabled="handlers.getPayload(message)!.applying"
>
<option value="" disabled>{{ $t('chat.shippingNoticeMapping.selectHeader') }}</option>
<option v-for="h in (handlers.getPayload(message)!.schema_preview.headers || [])" :key="`qty-${h}`" :value="h">{{ handlers.normalizeHeader(h) }}</option>
</select>
</label>
<label class="space-y-1.5 md:col-span-2">
<span class="text-xs font-semibold text-muted">{{ $t('chat.shippingNoticeMapping.reservationIdColumnRequired') }}</span>
<select
v-model="handlers.getPayload(message)!.form.reservation_id"
class="w-full rounded-xl border border-default px-3 py-2 text-sm text-secondary outline-none transition focus:border-blue-400"
:disabled="handlers.getPayload(message)!.applying"
>
<option value="" disabled>{{ $t('chat.shippingNoticeMapping.selectHeader') }}</option>
<option v-for="h in (handlers.getPayload(message)!.schema_preview.headers || [])" :key="`rid-${h}`" :value="h">{{ handlers.normalizeHeader(h) }}</option>
</select>
</label>
</div>
<div class="flex justify-end gap-3">
<button
type="button"
class="rounded-xl border border-default px-4 py-2 text-sm font-medium text-secondary transition hover:bg-surface-soft disabled:cursor-not-allowed disabled:opacity-60"
:disabled="handlers.getPayload(message)!.applying"
@click="handlers.reupload(message)"
>
{{ $t('chat.shippingNoticeMapping.reupload') }}
</button>
<button
type="button"
class="rounded-xl bg-emerald-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-emerald-700 disabled:cursor-not-allowed disabled:opacity-60"
:disabled="handlers.getPayload(message)!.applying"
@click="handlers.apply(message)"
>
{{ handlers.getPayload(message)!.applying ? $t('chat.shippingNoticeMapping.applying') : $t('chat.shippingNoticeMapping.applyAndParse') }}
</button>
</div>
</div>
</div>
</template>
@@ -0,0 +1,18 @@
/**
* features/chat/components/messages/shippingMessageHandlers.ts
* 用途:定义发货通知订单复核与库存匹配消息共用的页面处理器契约。
* 依赖:chat.types、shipping.api.types、shipping.types。
* 逻辑:页面组合处理器后传给消息列表;不包含已下线的任务级库存列映射能力。
*/
import type { ChatMessage } from '../../types/chat.types';
import type { ShippingNoticeHeader, ShippingNoticeLine } from '../../types/shipping.api.types';
import type { ShippingMatchResultPayload, ShippingParseReviewPayload } from '../../types/shipping.types';
export interface ShippingMessageHandlers {
getParseReviewPayload: (msg: ChatMessage) => ShippingParseReviewPayload | null;
getMatchResultPayload: (msg: ChatMessage) => ShippingMatchResultPayload | null;
updateHeader: (msg: ChatMessage, fields: Partial<ShippingNoticeHeader>) => Promise<boolean>;
updateLine: (msg: ChatMessage, lineIndex: number, patch: Partial<ShippingNoticeLine>) => Promise<boolean>;
addLine: (msg: ChatMessage, line: Partial<ShippingNoticeLine>) => Promise<boolean>;
removeLine: (msg: ChatMessage, lineIndex: number) => Promise<boolean>;
}
@@ -532,7 +532,7 @@ export function useChat() {
| { type: 'image' | 'document' | 'audio' | 'video' | 'custom'; transfer_method: 'local_file'; upload_file_id: string }
| { type: 'image' | 'document' | 'audio' | 'video' | 'custom'; transfer_method: 'remote_url'; url: string }
>,
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; shipping_temporary_inventory_asset_no?: string; shipping_temporary_inventory_session_no?: string; display_query?: string },
hooks?: SendMessageLifecycleHooks,
): Promise<ChatMessageSendResult> => {
const displayQuery = String(
@@ -601,6 +601,8 @@ export function useChat() {
task_id: context?.task_id || undefined,
batch_no: context?.batch_no || undefined,
shipping_intake_nos: context?.shipping_intake_nos?.length ? context.shipping_intake_nos : undefined,
shipping_temporary_inventory_asset_no: context?.shipping_temporary_inventory_asset_no || undefined,
shipping_temporary_inventory_session_no: context?.shipping_temporary_inventory_session_no || undefined,
display_query: context && Object.prototype.hasOwnProperty.call(context, 'display_query')
? context.display_query
: undefined,
@@ -38,7 +38,7 @@ import {
createChatPageMarkdownApi,
createChatPageSendApi,
createLeaveMessageHandlers,
createShippingMappingHandlers,
createShippingMessageHandlers,
createShippingPickerRefHolder,
createTrainingHandlers,
useChatPageDialogs,
@@ -287,7 +287,6 @@ export function useChatPage() {
history,
loadHistory,
input,
chatScrollContainer,
attachments: attachmentApi.attachments,
selectedKb: agent.selectedKb,
isUploadingAttachments: attachmentApi.isUploadingAttachments,
@@ -395,7 +394,6 @@ export function useChatPage() {
getSourceTitle,
getSourceMeta,
getSourceBrief,
getShippingInventoryMappingPayload: shipping.getShippingInventoryMappingPayload,
getShippingMatchResultPayload: shipping.getShippingMatchResultPayload,
canOpenQueryPreview: queryPreview.canOpen,
getQueryPreviewSummary: queryPreview.getSummary,
@@ -456,7 +454,7 @@ export function useChatPage() {
shipping.shippingBindSend(() => sendApi.handleSend());
const leaveMessageHandlers = createLeaveMessageHandlers(leave);
const shippingMappingHandlers = createShippingMappingHandlers(shipping);
const shippingMessageHandlers = createShippingMessageHandlers(shipping);
const trainingHandlers = createTrainingHandlers(training);
const shippingPickerRefHolder = markRaw(createShippingPickerRefHolder(shipping.shippingInventoryPickerRef));
const shippingNoticePickerRefHolder = markRaw(createShippingPickerRefHolder(shipping.shippingNoticePickerRef));
@@ -588,7 +586,7 @@ export function useChatPage() {
training,
...leave,
leaveMessageHandlers,
shippingMappingHandlers,
shippingMessageHandlers,
trainingHandlers,
shippingPickerRefHolder,
shippingNoticePickerRefHolder,
@@ -24,24 +24,19 @@ import {
createShippingActionsRefresher,
createShippingConversationHelpers,
createShippingDecisionHandlers,
createShippingMappingFormHandlers,
createShippingMenuHandlers,
createShippingParseReviewHandlers,
createShippingSendHandlers,
createShippingUploadHandlers,
onNoticeBatchConversationChanging,
findLatestShippingTaskId,
getShippingInventoryMappingPayload,
getShippingMatchResultPayload,
getShippingParseReviewPayload,
getShippingInventorySampleRowText,
hasShippingInventorySampleRows,
normalizeShippingHeaderForDisplay,
sanitizeShippingConversationText,
shippingActionButtonClass,
} from '../shipping';
import { reportShippingDebugEvent } from '../shipping/shippingDebugReporter';
import { classifyShippingUploadFile } from '../shipping/shippingUploadPrompt';
import { isShippingSpreadsheetFile } from '../shipping/shippingUploadPrompt';
import { extractExt } from '../constants/shipping';
import {
getWorkspaceShippingConversationBatches,
@@ -83,7 +78,6 @@ export interface UseChatShippingOptions {
history: Ref<ChatSessionItem[]>;
loadHistory: () => Promise<void>;
input: Ref<string>;
chatScrollContainer: Ref<HTMLElement | null>;
attachments: Ref<PendingAttachment[]>;
selectedKb: Ref<string>;
isUploadingAttachments: Ref<boolean>;
@@ -97,7 +91,7 @@ export interface UseChatShippingOptions {
agentId: number,
kb: string,
files: ChatUploadFileSpec[],
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; shipping_temporary_inventory_asset_no?: string; shipping_temporary_inventory_session_no?: string; display_query?: string },
hooks?: SendMessageLifecycleHooks,
) => Promise<ChatMessageSendResult>;
startChatTurn: (options: import('../types/chat-turn.types').StartChatTurnOptions) => Promise<boolean>;
@@ -235,7 +229,7 @@ export const resolveLatestShippingMessageRecoveryPayload = (
/**
* 组装发货通知聊天所需的状态、动作处理器与发送拦截逻辑。
*
* 核心逻辑:统一管理当前任务/批次上下文,组合上传、映射、决策、动作刷新等子模块,并对 ChatView 暴露稳定 API。
* 核心逻辑:统一管理当前任务/批次上下文,组合上传、解析复核、匹配结果、决策与动作刷新等子模块,并对 ChatView 暴露稳定 API。
* @param options - 聊天页依赖与响应式状态集合
* @returns 发货通知聊天场景所需的状态、事件处理器和工具函数
*/
@@ -253,7 +247,6 @@ export function useChatShipping(options: UseChatShippingOptions) {
history,
loadHistory,
input,
chatScrollContainer,
attachments,
selectedKb,
isUploadingAttachments,
@@ -316,7 +309,6 @@ export function useChatShipping(options: UseChatShippingOptions) {
const retryingShippingPendingTasks = ref(false);
const activeShippingTaskDetail = ref<ShippingTaskDetail | null>(null);
const shippingFocusReason = ref('');
const shippingInventorySchemaPreviewCache = ref<Record<string, unknown>>({});
const autoResumedShippingTasks = ref<Record<string, boolean>>({});
const lastConversationSyncKey = ref('');
let shippingStatusPollTimer: ReturnType<typeof setInterval> | null = null;
@@ -628,7 +620,6 @@ export function useChatShipping(options: UseChatShippingOptions) {
shippingWorkspaceOpen.value = false;
retryingShippingPendingTasks.value = false;
activeShippingTaskDetail.value = null;
shippingInventorySchemaPreviewCache.value = {};
lastConversationSyncKey.value = '';
};
@@ -753,25 +744,6 @@ export function useChatShipping(options: UseChatShippingOptions) {
getActiveBatchTaskId,
});
const {
openShippingInventoryMappingFormForTask,
applyShippingInventoryMappingForm,
reuploadShippingInventoryFromMappingForm,
} = createShippingMappingFormHandlers({
messages,
chatScrollContainer,
shippingInventorySchemaPreviewCache,
shippingInventoryPickerRef,
pendingShippingUploadTaskId,
resolvedShippingTaskId,
newLocalMessageId,
saveLocalMessageToBackend,
startChatTurn,
currentAgentId,
refreshShippingActions,
msg,
});
/**
* Dify SSE 完成后立即净化最后一条回复,并同步后端动作按钮。
*
@@ -860,11 +832,9 @@ export function useChatShipping(options: UseChatShippingOptions) {
history,
isShippingNoticeAgent,
currentAgentId,
shippingInventorySchemaPreviewCache,
getActiveShippingTaskId,
getActiveShippingBatchNo: () => resolvedShippingBatchNo.value || shippingBatchNoFromQuery.value || '',
loadHistory,
openShippingInventoryMappingFormForTask,
refreshShippingActions,
startChatTurn,
msg,
@@ -1074,13 +1044,22 @@ export function useChatShipping(options: UseChatShippingOptions) {
shippingBatchTasks,
shippingInventorySelectionActive,
shippingInventorySelectionTaskId,
shippingInventorySchemaPreviewCache,
getActiveShippingTaskId,
startChatTurn,
refreshShippingActions,
getParsedIntakeNos: shippingIntakes.getParsedIntakeNos,
getSelectedCandidateNos: shippingIntakes.getSelectedCandidateNos,
clearConsumedNoticeAttachments: shippingIntakes.clearConsumedAttachments,
sendTemporaryInventoryMessage: async (assetNo, fileName) => sendMessage(
`我已上传库存文件:${fileName},请先检查文件结构并说明下一步。`,
currentAgentId.value,
selectedKb.value,
[],
{
shipping_temporary_inventory_asset_no: assetNo,
display_query: `上传库存文件:${fileName}`,
},
),
msg,
t,
});
@@ -1092,7 +1071,6 @@ export function useChatShipping(options: UseChatShippingOptions) {
getActiveShippingBatchNo: () => resolvedShippingBatchNo.value || shippingBatchNoFromQuery.value || '',
messages,
sendShippingMenuMessage,
openShippingInventoryMappingFormForTask,
openShippingInventoryPicker,
openShippingNoticePicker,
openShippingCustomerDialog,
@@ -1272,21 +1250,20 @@ export function useChatShipping(options: UseChatShippingOptions) {
const inputEl = event.target as HTMLInputElement | null;
const files = inputEl?.files ? Array.from(inputEl.files) : [];
if (!files.length) return false;
const noticeFiles = files.filter((file) => classifyShippingUploadFile(file, extractExt) === 'notice');
const otherFiles = files.filter((file) => classifyShippingUploadFile(file, extractExt) !== 'notice');
const noticeFiles = files.filter((file) => !isShippingSpreadsheetFile(file, extractExt));
const spreadsheetFiles = files.filter((file) => isShippingSpreadsheetFile(file, extractExt));
if (noticeFiles.length) {
void shippingIntakes.enqueueNoticeFiles(noticeFiles);
}
// 同一次选择中的库存/其他文件直接落入本地附件,避免清空 input 后通用 handler 丢失 FileList
for (const file of otherFiles) {
const kind = classifyShippingUploadFile(file, extractExt);
// 表格附件先留在本地等待用户声明;不能因扩展名直接送订单或库存解析。
for (const file of spreadsheetFiles) {
attachments.value = [
...attachments.value,
{
id: `${Date.now()}_${Math.random().toString(36).slice(2, 8)}`,
kind: 'local',
file,
type: kind === 'inventory' ? 'document' : 'document',
type: 'document',
uploadStatus: 'waiting',
uploadProgress: 0,
},
@@ -1455,14 +1432,8 @@ export function useChatShipping(options: UseChatShippingOptions) {
queryShippingShortageDetails,
resetShippingConversationState,
resumeShippingTaskFromQuery,
normalizeShippingHeaderForDisplay,
getShippingInventoryMappingPayload,
getShippingMatchResultPayload,
getShippingParseReviewPayload,
hasShippingInventorySampleRows,
getShippingInventorySampleRowText,
applyShippingInventoryMappingForm,
reuploadShippingInventoryFromMappingForm,
updateShippingParseReviewHeader,
updateShippingParseReviewLine,
addShippingParseReviewLine,
@@ -14,7 +14,6 @@ export const SHIPPING_MENU_ACTION_SPECS: Record<
{ id: string; label: string; message: string; variant: 'primary' | 'secondary' | 'danger' }
> = {
upload: { id: 'upload_inventory_file', label: '选择库存文件', message: '我要上传库存 Excel', variant: 'primary' },
paste: { id: 'paste_inventory_json', label: '粘贴库存', message: '我粘贴库存小表', variant: 'secondary' },
retry_rpa: { id: 'retry_rpa', label: '重新获取库存', message: '重新获取库存', variant: 'secondary' },
confirm: { id: 'confirm', label: '确认', message: '确认', variant: 'primary' },
reparse: { id: 'reparse', label: '重新解析', message: '重新解析', variant: 'secondary' },
@@ -23,8 +22,6 @@ export const SHIPPING_MENU_ACTION_SPECS: Record<
export const SHIPPING_DECISION_ACTIONS = new Set([
'confirm',
'confirm_inventory_mapping',
'correct_inventory_mapping',
'reparse_inventory',
'retry_rpa',
'reject',
@@ -99,7 +99,6 @@ const createUploadContext = (
shippingBatchTasks: ref([]),
shippingInventorySelectionActive: ref(false),
shippingInventorySelectionTaskId: ref(''),
shippingInventorySchemaPreviewCache: ref({}),
getActiveShippingTaskId: () => '',
startChatTurn,
refreshShippingActions: vi.fn(async () => undefined),
@@ -1,8 +1,8 @@
/**
* 对话页:子组件 inject 用的 handlers 对象打包(请假表单、出货映射、消息气泡)。
* 对话页:子组件 inject 用的 handlers 对象打包(请假表单、发货消息、消息气泡)。
*/
import type { LeaveMessageHandlers } from '../components/messages/LeaveMessageBlock.vue';
import type { ShippingMappingHandlers } from '../components/messages/ShippingInventoryMappingMessage.vue';
import type { ShippingMessageHandlers } from '../components/messages/shippingMessageHandlers';
import type { TrainingHandlers } from '../components/messages/TrainingExamQuestionMessage.vue';
import type { useChatLeave } from '../composables/useChatLeave';
import type { useChatShipping } from '../composables/useChatShipping';
@@ -29,14 +29,8 @@ type LeaveHandlerSource = Pick<
type ShippingHandlerSource = Pick<
ReturnType<typeof useChatShipping>,
| 'getShippingInventoryMappingPayload'
| 'normalizeShippingHeaderForDisplay'
| 'hasShippingInventorySampleRows'
| 'getShippingInventorySampleRowText'
| 'getShippingParseReviewPayload'
| 'getShippingMatchResultPayload'
| 'reuploadShippingInventoryFromMappingForm'
| 'applyShippingInventoryMappingForm'
| 'updateShippingParseReviewHeader'
| 'updateShippingParseReviewLine'
| 'addShippingParseReviewLine'
@@ -65,19 +59,11 @@ export function createLeaveMessageHandlers(leave: LeaveHandlerSource): LeaveMess
};
}
/** 出货库存映射块 handlers(ShippingInventoryMappingMessage) */
export function createShippingMappingHandlers(shipping: ShippingHandlerSource): ShippingMappingHandlers {
/** 发货通知订单复核与匹配消息 handlers。 */
export function createShippingMessageHandlers(shipping: ShippingHandlerSource): ShippingMessageHandlers {
return {
getPayload: shipping.getShippingInventoryMappingPayload,
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,
@@ -39,7 +39,6 @@ function createContext(
getSourceTitle: () => '',
getSourceMeta: () => '',
getSourceBrief: () => '',
getShippingInventoryMappingPayload: () => null,
getShippingMatchResultPayload: () => null,
canOpenQueryPreview: () => false,
getQueryPreviewSummary: () => '',
@@ -79,7 +79,6 @@ export interface ChatPageMarkdownContext {
getSourceTitle: ChatMessageBubbleHandlers['getSourceTitle'];
getSourceMeta: ChatMessageBubbleHandlers['getSourceMeta'];
getSourceBrief: ChatMessageBubbleHandlers['getSourceBrief'];
getShippingInventoryMappingPayload: ChatMessageBubbleHandlers['getShippingInventoryMappingPayload'];
getShippingMatchResultPayload: (msg: ChatMessage) => ShippingMatchResultPayload | null;
canOpenQueryPreview: ChatMessageBubbleHandlers['canOpenQueryPreview'];
getQueryPreviewSummary: ChatMessageBubbleHandlers['getQueryPreviewSummary'];
@@ -368,7 +367,6 @@ export function createChatPageMarkdownApi(ctx: ChatPageMarkdownContext) {
if (msgItem?.type === 'leave-form'
|| msgItem?.type === 'leave-confirmation'
|| msgItem?.type === 'leave-result'
|| msgItem?.type === 'shipping-inventory-mapping'
|| msgItem?.type === 'shipping-parse-review'
|| msgItem?.type === 'shipping-match-result') {
return true;
@@ -459,7 +457,6 @@ export function createChatPageMarkdownApi(ctx: ChatPageMarkdownContext) {
openAssetImage: ctx.openAssetImage,
getInlineDownloadFiles: safeExtractInlineDownloadFiles,
downloadInlineFile,
getShippingInventoryMappingPayload: ctx.getShippingInventoryMappingPayload,
getShippingMatchResultPayload: ctx.getShippingMatchResultPayload,
canOpenQueryPreview: ctx.canOpenQueryPreview,
getQueryPreviewSummary: ctx.getQueryPreviewSummary,
@@ -54,7 +54,7 @@ export interface ChatPageSendContext {
agentId: number,
kb: string,
files: ChatUploadFileSpec[],
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; shipping_temporary_inventory_asset_no?: string; shipping_temporary_inventory_session_no?: string; display_query?: string },
hooks?: SendMessageLifecycleHooks,
) => Promise<ChatMessageSendResult>;
refreshHistoryAfterSend: () => Promise<void>;
@@ -75,7 +75,7 @@ export interface ChatPageSendContext {
msg: { warning: (text: string) => void; info: (text: string) => void };
t: (key: string) => string;
copiedIndex: Ref<number | null>;
getChatContext?: () => { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string };
getChatContext?: () => { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; shipping_temporary_inventory_asset_no?: string; shipping_temporary_inventory_session_no?: string; display_query?: string };
onAssistantMessageFinished?: (message: ChatMessage, runMessages: ChatMessage[]) => void | Promise<void>;
}
@@ -7,7 +7,6 @@
export * from './shippingText';
export * from './shippingMenu';
export * from './shippingIntents';
export * from './shippingMapping';
export * from './shippingTaskId';
export * from './shippingDownload';
export * from './shippingDecisionFormat';
@@ -18,7 +17,6 @@ export * from './shippingStepper';
export * from './shippingLocalMessages';
export * from './shippingConversation';
export * from './useChatShippingRefresh';
export * from './useChatShippingMappingForm';
export * from './useChatShippingParseReview';
export * from './useChatShippingDecision';
export * from './useChatShippingMenuHandler';
@@ -1,34 +1,24 @@
/**
* features/chat/shipping/shippingDecisionFormat.spec.ts
* 用途:验证库存映射人工修正摘要使用 v2 系统字段名。
* 用途:验证库存重新上传决策只输出业务引导,不再暴露任务级字段映射。
* 依赖:vitest、shippingDecisionFormat。
* 逻辑:锁死建议映射展示中的 part_number,防止旧 sku 契约回流。
* 逻辑:断言重新上传提示和任务编号完整,同时排除旧技术字段。
*/
import { describe, expect, it } from 'vitest';
import { formatShippingDecisionAssistantMessage } from './shippingDecisionFormat';
describe('formatShippingDecisionAssistantMessage', () => {
it('renders part_number for inventory mapping suggestions', () => {
it('guides inventory reupload without legacy mapping terms', () => {
const text = formatShippingDecisionAssistantMessage(
'correct_inventory_mapping',
{
message: '请修正映射',
data: {
schema_preview: {
headers: ['Supplier Sku', 'COM ID', 'Qty Available'],
suggested_mapping: {
part_number: 'Supplier Sku',
reservation_id: 'COM ID',
available_qty: 'Qty Available',
},
},
},
},
'SN-MAP-001',
'reparse_inventory',
{ message: '当前库存已解除关联。' },
'SN-REUPLOAD-001',
'操作已完成',
);
expect(text).toContain('- part_number → Supplier Sku');
expect(text).not.toContain('- sku →');
expect(text).toContain('选择库存文件');
expect(text).toContain('SN-REUPLOAD-001');
expect(text).not.toContain('schema_preview');
expect(text).not.toContain('map_json');
});
});
@@ -2,7 +2,7 @@
* features/chat/shipping/shippingDecisionFormat.ts
* 用途:决策 API 响应格式化为助手 Markdown 消息。
* 依赖:无;useChatShippingDecision 在 submit_decision 成功后调用。
* 逻辑:按 decision 类型追加映射提示、下一步指引与任务编号尾注。
* 逻辑:按 decision 类型追加业务提示与任务编号尾注。
*/
/**
* 将 submit_decision 结果格式化为本地 assistant 消息 Markdown。
@@ -14,34 +14,8 @@ export function formatShippingDecisionAssistantMessage(
fallbackDoneMessage: string,
): string {
const lines: string[] = [result.message || fallbackDoneMessage];
if (decision === 'correct_inventory_mapping') {
const preview = (result.data?.schema_preview || {}) as Record<string, unknown>;
const headers = Array.isArray(preview.headers) ? (preview.headers as unknown[]).filter(Boolean) : [];
const suggested = (preview.suggested_mapping || {}) as Record<string, string>;
if (preview.header_row_index) {
lines.push('', `表头在第 ${preview.header_row_index} 行:${headers.join(' | ')}`);
} else if (headers.length) {
lines.push('', `当前表头:${headers.join(' | ')}`);
}
const mappingLines = [
suggested.part_number ? `- part_number → ${suggested.part_number}` : null,
suggested.reservation_id ? `- reservation_id → ${suggested.reservation_id}` : null,
suggested.available_qty ? `- available_qty → ${suggested.available_qty}` : null,
].filter((line): line is string => Boolean(line));
if (mappingLines.length) {
lines.push('', '建议列映射:', ...mappingLines);
}
lines.push(
'',
'如需调整,请说明要改的列(例如:available_qty 改用 Qty Available)。',
'也可点击「选择库存文件」重新上传。',
);
} else if (decision === 'confirm_inventory_mapping') {
if (String(result.checkpoint || '').trim() === 'map_ok') {
lines.push('', '下一步:匹配库存与发货需求。');
}
} else if (decision === 'reparse_inventory') {
lines.push('', '请重新上传或粘贴库存 Excel。');
if (decision === 'reparse_inventory') {
lines.push('', '请点击「选择库存文件」重新上传。');
}
lines.push('', `任务编号:${taskId}`);
return lines.join('\n');
@@ -1,29 +0,0 @@
/**
* features/chat/shipping/shippingIntents.spec.ts
* 用途:验证发货聊天自然语言库存映射遵循 v2 字段契约。
* 依赖:vitest、shippingIntents。
* 逻辑:覆盖完整三字段映射与缺 Reservation 拒绝分支。
*/
import { describe, expect, it } from 'vitest';
import { parseShippingColumnMappingFromText } from './shippingIntents';
describe('parseShippingColumnMappingFromText', () => {
it('normalizes SKU wording to the v2 part_number key', () => {
expect(parseShippingColumnMappingFromText([
'SKU -> Supplier Sku',
'Reservation ID -> COM ID',
'Available Qty -> Qty Available',
].join('\n'))).toEqual({
part_number: 'Supplier Sku',
reservation_id: 'COM ID',
available_qty: 'Qty Available',
});
});
it('rejects mappings that omit Reservation ID', () => {
expect(parseShippingColumnMappingFromText([
'part_number -> Supplier Sku',
'available_qty -> Qty Available',
].join('\n'))).toBeNull();
});
});
@@ -2,7 +2,7 @@
* features/chat/shipping/shippingIntents.ts
* 用途:发货聊天用户输入意图识别,供 handleSend 前置拦截。
* 依赖:shippingMenu.resolveShippingNumericChoice、types/shipping.types。
* 逻辑:useChatShippingSendHandler 调用;覆盖手工上传、库存上传、Excel 生成/下载、列映射与切票。
* 逻辑:useChatShippingSendHandler 调用;覆盖手工上传、库存上传、Excel 生成/下载与切票。
*/
import { resolveShippingNumericChoice } from './shippingMenu';
import type { ShippingMenuAction } from '../types/shipping.types';
@@ -15,43 +15,6 @@ export interface ShippingTaskSwitchIntent {
/**
* 从自然语言文本解析库存列映射(part_number / reservation_id / available_qty → Excel 列名)。
*/
export function parseShippingColumnMappingFromText(content: string): Record<string, string> | null {
const raw = String(content || '').trim();
if (!raw) return null;
if (!/[→>=-]/.test(raw)) return null;
const lines = raw.split(/\r?\n/).map((s) => s.trim()).filter(Boolean);
const mapping: Record<string, string> = {};
const normalizeRight = (s: string) => String(s || '')
.replace(/[::]/g, '')
.replace(/列$/g, '')
.replace(/字段$/g, '')
.replace(/^\[|\]$/g, '')
.trim();
const toKey = (left: string) => {
const s = left.toLowerCase();
if (s.includes('reservation') || left.includes('预留') || left.includes('预定')) return 'reservation_id';
if (s.includes('qty') || s.includes('available') || left.includes('可用') || left.includes('数量')) return 'available_qty';
if (s.includes('part_number') || s.includes('part number') || s.includes('sku') || left.includes('料号') || left.includes('物料')) {
return 'part_number';
}
return '';
};
for (const line of lines) {
const m = line.match(/^\s*(.+?)\s*(?:→|->|=>|=|:|:)\s*(.+?)\s*$/);
if (!m) continue;
const left = m[1];
const right = m[2];
if (!left || !right) continue;
const key = toKey(left.trim());
if (!key) continue;
const col = normalizeRight(right);
if (!col) continue;
mapping[key] = col;
}
if (!mapping.part_number || !mapping.reservation_id || !mapping.available_qty) return null;
return mapping;
}
export function isShippingManualUploadIntent(text: string): boolean {
const normalized = text.trim();
if (!normalized) return false;
@@ -1,62 +0,0 @@
/**
* features/chat/shipping/shippingMapping.ts
* 用途:库存列映射消息 payload 读取与字段对齐 Markdown 生成。
* 依赖:shippingText.normalizeShippingHeaderForDisplay、chat.types、shipping.types。
* 逻辑:ShippingInventoryMappingMessage 与 useChatShippingMappingForm 读取 mapping 消息数据。
*/
import { normalizeShippingHeaderForDisplay } from './shippingText';
import type { ChatMessage } from '../types/chat.types';
import type { ShippingInventoryMappingFormPayload } from '../types/shipping.types';
/**
* 从 shipping-inventory-mapping 类型消息中提取 taskId、schema_preview 与 form。
*/
export function getShippingInventoryMappingPayload(chatMsg: ChatMessage): ShippingInventoryMappingFormPayload | null {
if (!chatMsg || chatMsg.type !== 'shipping-inventory-mapping') return null;
const payload = chatMsg.payload;
if (!payload || typeof payload !== 'object') return null;
const taskId = String((payload as ShippingInventoryMappingFormPayload).taskId || '').trim();
const schemaPreview = (payload as ShippingInventoryMappingFormPayload).schema_preview;
const form = (payload as ShippingInventoryMappingFormPayload).form;
if (!taskId || !schemaPreview || !form) return null;
return payload as ShippingInventoryMappingFormPayload;
}
export function hasShippingInventorySampleRows(chatMsg: ChatMessage): boolean {
const rows = getShippingInventoryMappingPayload(chatMsg)?.schema_preview?.sample_rows;
return Array.isArray(rows) && rows.length > 0;
}
export function getShippingInventorySampleRowText(chatMsg: ChatMessage): string {
const row = getShippingInventoryMappingPayload(chatMsg)?.schema_preview?.sample_rows?.[0];
return Array.isArray(row) ? row.map((cell) => String(cell)).join(' | ') : '';
}
/**
* 将 field_alignment API 响应转为 Markdown 表格文本,供发送给 Agent 确认。
*/
export function buildShippingFieldAlignmentText(payload: { data?: { field_alignment?: Record<string, unknown> } }): string {
const alignment = payload?.data?.field_alignment;
if (!alignment || typeof alignment !== 'object') return '';
const invCols = (alignment as { inventory_columns?: { mapping?: Record<string, { source_column?: string }> } }).inventory_columns || {};
const mapping = invCols.mapping || {};
const rows: Array<[string, string]> = [
['part_number', normalizeShippingHeaderForDisplay(mapping?.part_number?.source_column) || '(未识别)'],
['reservation_id', normalizeShippingHeaderForDisplay(mapping?.reservation_id?.source_column) || '(未识别)'],
['available_qty', normalizeShippingHeaderForDisplay(mapping?.available_qty?.source_column) || '(未识别)'],
];
const lines: string[] = [];
const matchRule = String((alignment as { match_rule?: string }).match_rule || '').trim();
if (matchRule) lines.push(`匹配规则:${matchRule}`);
lines.push('', '字段对齐表:', '', '|系统字段|库存列|', '|---|---|');
for (const [k, v] of rows) {
lines.push(`|${k}|${v}|`);
}
const warnings = Array.isArray((alignment as { warnings?: unknown[] }).warnings)
? (alignment as { warnings: unknown[] }).warnings.filter(Boolean)
: [];
if (warnings.length) {
lines.push('', '提示:', ...warnings.map((w) => `- ${String(w)}`));
}
return lines.join('\n').trim();
}
@@ -30,7 +30,6 @@ export function classifyShippingMenuLine(desc: string): ShippingMenuAction | nul
if (!normalized) return null;
if (/已确认/.test(normalized)) return null;
if (/(?:选择|上传).*(?:库存|excel|xlsx|xls|csv)/i.test(normalized)) return 'upload';
if (/粘贴|文本|小量|直接发/i.test(desc)) return 'paste';
if (/(?:重试|重新)\s*RPA|重试.*(?:导出|获取|拉取)|RPA.*(?:导出|获取|拉取).*重试/i.test(desc)) return 'retry_rpa';
if (/重新解析|重解析|reparse/i.test(desc)) return 'reparse';
if (/驳回|取消|reject/i.test(desc)) return 'reject';
@@ -78,11 +77,9 @@ export function normalizeApiShippingButtons(
/**
* 从用户文本与助手上下文识别 submit_decision 所需的 action id。
*/
export function resolveShippingDecisionFromText(text: string, assistantContext: string): string | null {
export function resolveShippingDecisionFromText(text: string, _assistantContext: string): string | null {
const normalized = text.trim();
const direct: Record<string, string> = {
更正映射: 'correct_inventory_mapping',
更正列映射: 'correct_inventory_mapping',
重新上传库存: 'reparse_inventory',
重新上传: 'reparse_inventory',
驳回: 'reject',
@@ -92,9 +89,6 @@ export function resolveShippingDecisionFromText(text: string, assistantContext:
};
if (direct[normalized]) return direct[normalized];
if (normalized === '确认') {
if (assistantContext.includes('字段对齐') || assistantContext.includes('field_alignment') || assistantContext.includes('库存字段对齐')) {
return 'confirm_inventory_mapping';
}
return 'confirm';
}
return null;
@@ -111,11 +111,9 @@ function deriveCurrentIndex(task: ShippingTaskStepperSource | null | undefined):
if (processStatus === 'waiting_upload' || processStatus === 'upload_failed' || hasExport) return 5;
if (processStatus === 'matched') return 4;
if (reviewStatus === 'shortage_review' || pendingReason === 'shortage_review' || pendingReason === 'shortage') return 4;
if (reviewStatus === 'align_review' || pendingReason === 'align_review') return 3;
if (processStatus === 'inventory_ready' || matchStatus) return 4;
if (
processStatus === 'waiting_inventory'
|| pendingReason === 'map_infer'
|| pendingReason === 'rpa_pending'
|| pendingReason === 'inv_unavail'
|| pendingReason === 'rpa_exhausted'
@@ -167,7 +165,6 @@ export function buildShippingWorkflowSteps(
|| pendingReason === 'inventory_source_unresolved'
))
|| (index === 2 && (pendingReason === 'inv_unavail' || pendingReason === 'rpa_exhausted'))
|| (index === 3 && (reviewStatus === 'align_review' || pendingReason === 'align_review'))
|| (index === 4 && (reviewStatus === 'shortage_review' || pendingReason === 'shortage_review' || pendingReason === 'shortage'))
|| (index === 6 && processStatus === 'upload_failed')
) {
@@ -249,18 +249,6 @@ export function stripShippingActionListByButtons(
export function sanitizeShippingConversationText(text: string, enabled: boolean): string {
if (!enabled) return text;
let result = sanitizeShippingRuntimeStatusText(String(text || ''))
.replace(
/已回到列映射步骤。?请根据\s*schema_preview\s*提供新的\s*map_json\s*[,,]\s*再调用\s*(?:应用库存字段映射|apply_inventory_mapping)[^。.\n]*[。.]?/gi,
'已回到库存字段确认步骤。请检查系统识别的库存列名,确认无误后继续;如有问题请修改映射。',
)
.replace(
/请根据\s*schema_preview\s*提供新的\s*map_json\s*[,,]\s*再调用\s*(?:应用库存字段映射|apply_inventory_mapping)[^。.\n]*[。.]?/gi,
'请检查系统识别的库存列名,确认无误后继续;如有问题请修改映射。',
)
.replace(
/根据\s*data\.schema_preview\.headers\s*与\s*sample_rows\s*推断\s*JSON[^。.\n]*再调用\s*(?:应用库存字段映射|apply_inventory_mapping)[^。.\n]*[。.]?/gi,
'请根据库存表头和样例行确认字段对应关系。',
)
.replace(/通过\s*(?:Hxops|HXOPS|hxops)\s*聊天区上传/gi, '在当前对话中上传')
.replace(/在\s*(?:Hxops|HXOPS|hxops)\s*聊天区上传/gi, '在当前对话中上传')
.replace(/(?:Hxops|HXOPS|hxops)\s*聊天区/gi, '当前对话')
@@ -278,12 +266,6 @@ export function sanitizeShippingConversationText(text: string, enabled: boolean)
.replace(/\bgenerate_excel\b/gi, '生成发货 Excel')
.replace(/\bgenerate_shipment_excel\b/gi, '生成发货 Excel')
.replace(/\bupload_to_freight\b/gi, '上传货代系统')
.replace(/\bapply_inventory_mapping\b/gi, '应用库存字段映射')
.replace(/\bget_inventory_schema_preview\b/gi, '读取库存表头预览')
.replace(/\bschema_preview(?:\.headers)?\b/gi, '库存表头预览')
.replace(/\bdata\.库存表头预览\b/gi, '库存表头预览')
.replace(/\bmap_json\b/gi, '字段映射')
.replace(/\bsample_rows\b/gi, '样例行')
.replace(/\bretry_rpa\b/gi, '重新获取库存')
.replace(/\bretry_upload\b/gi, '重试上传货代')
.replace(/\bstructured\b/gi, '结构化内容')
@@ -309,11 +291,3 @@ export function sanitizeShippingConversationText(text: string, enabled: boolean)
export function stripShippingActionsDirectiveComment(rawText: string): string {
return String(rawText || '').replace(/<!--\s*HXOPS_SHIPPING_ACTIONS\s*:\s*[\s\S]*?\s*-->/gi, '').trim();
}
/**
* 库存表头列名展示规范化(空格转 NBSP,避免 Markdown 表格换行)。
*/
export function normalizeShippingHeaderForDisplay(raw: unknown): string {
const text = String(raw ?? '').replace(/\s+/g, ' ').trim();
return text.replace(/ /g, '\u00A0');
}
@@ -133,17 +133,6 @@ export function buildShippingTurnRefs(taskNo: string, batchNo?: string): Record<
return refs;
}
export function buildShippingUploadInventoryTurn(taskNo: string, file: File) {
const task = String(taskNo || '').trim().toUpperCase();
return {
actionType: 'shipping.upload_inventory',
displayText: `上传库存文件:${file.name}`,
payload: { task_no: task },
files: [file],
refs: buildShippingTurnRefs(task),
};
}
export function buildShippingReplaceNoticeTurn(taskNo: string, file: File) {
const task = String(taskNo || '').trim().toUpperCase();
return {
@@ -155,16 +144,6 @@ export function buildShippingReplaceNoticeTurn(taskNo: string, file: File) {
};
}
export function buildShippingApplyMappingTurn(taskNo: string, mapping: Record<string, string>) {
const task = String(taskNo || '').trim().toUpperCase();
return {
actionType: 'shipping.apply_inventory_mapping',
displayText: `应用库存列映射(任务 ${task})`,
payload: { task_no: task, map_json: mapping },
refs: buildShippingTurnRefs(task),
};
}
export function buildShippingSwitchFocusTurn(batchNo: string, taskNo: string, displayText: string) {
const batch = String(batchNo || '').trim();
const task = String(taskNo || '').trim().toUpperCase();
@@ -1,6 +1,6 @@
/**
* features/chat/shipping/shippingUploadPrompt.ts
* 用途:库存/通知上传后发给 Dify 的提示语构建与附件类型分类。
* 用途:通知上传后提示语构建、文件格式识别与临时库存声明判断。
* 依赖:无;useChatShippingUploadHandler 在上传成功后调用。
* 逻辑:按 checkpoint 生成不同 follow-up 提示;通知建批后触发 Dify LLM 解析续办。
*/
@@ -9,40 +9,6 @@ import i18n from '@/i18n';
/**
* 根据上传 API 响应 checkpoint 生成发给 Agent 的 follow-up 提示语。
*/
export function buildShippingInventoryUploadPrompt(
result: Record<string, unknown> | null | undefined,
fileName?: string,
): string {
const checkpoint = String(result?.checkpoint || '').trim();
const hasAlignment = Boolean(result?.data && typeof result.data === 'object'
&& (result.data as { field_alignment?: unknown }).field_alignment
&& typeof (result.data as { field_alignment?: unknown }).field_alignment === 'object');
const suggestOk = Boolean((result?.data as { suggest_ok?: boolean } | undefined)?.suggest_ok);
const batchNo = String(
(result?.batch_no as string | undefined)
|| ((result?.data as { batch_no?: string } | undefined)?.batch_no)
|| ((result?.data as { batch?: { batch_no?: string } } | undefined)?.batch?.batch_no)
|| '',
).trim();
const prefix = batchNo
? (fileName
? String(i18n.global.t('chat.shippingNoticePrompt.inventory.prefixBatchWithFile', { fileName, batchNo }))
: String(i18n.global.t('chat.shippingNoticePrompt.inventory.prefixBatch', { batchNo })))
: (fileName
? String(i18n.global.t('chat.shippingNoticePrompt.inventory.prefixWithFile', { fileName }))
: String(i18n.global.t('chat.shippingNoticePrompt.inventory.prefix')));
if (checkpoint === 'map_infer') {
if (suggestOk) {
return String(i18n.global.t('chat.shippingNoticePrompt.inventory.mapInferSuggested', { prefix }));
}
return String(i18n.global.t('chat.shippingNoticePrompt.inventory.mapInferPending', { prefix }));
}
if (checkpoint === 'align_review' || hasAlignment) {
return String(i18n.global.t('chat.shippingNoticePrompt.inventory.alignReview', { prefix }));
}
return String(i18n.global.t('chat.shippingNoticePrompt.inventory.default', { prefix }));
}
/**
* 根据通知建批 API 响应生成发给 Dify 的 follow-up 提示语(触发画布 LLM 抽取 + parse_notice)。
*/
@@ -94,13 +60,30 @@ export function buildShippingNoticeUploadPrompt(
}
/**
* 按扩展名判断附件是库存 Excel 还是发货通知文件。
* 判断文件是否为后端当前可受控分析的表格格式。
* 格式只是技术能力,不能据此推断文件一定是库存或订单。
*/
export function classifyShippingUploadFile(
export function isShippingSpreadsheetFile(
file: File,
extractExt: (name: string) => string,
): 'inventory' | 'notice' {
): boolean {
const ext = extractExt(file.name || '').toLowerCase();
if (['xlsx', 'xls', 'csv'].includes(ext)) return 'inventory';
return 'notice';
return ['xlsx', 'xls', 'csv'].includes(ext);
}
/**
* 判断用户是否明确声明当前附件是库存文件。
* 仅用于临时库存分支门禁;不能从文件名、表格后缀或模型猜测推导。
*/
export function isTemporaryInventoryDeclaration(text: string): boolean {
const value = String(text || '').trim();
if (!value) return false;
return [
/这是.*库存(?:文件|表|excel|csv)?/i,
/(?:请|帮我|麻烦).*(?:分析|解析|识别).*(?:库存|stock)/i,
/(?:上传|附件|这个|该).*(?:库存文件|库存表|库存excel|库存csv)/i,
/(?:库存文件|库存表|库存excel|库存csv).*(?:分析|解析|识别|使用)/i,
/(?:this|the).*(?:is|are).*(?:inventory|stock)/i,
/(?:analyse|analyze|parse).*(?:inventory|stock)/i,
].some((pattern) => pattern.test(value));
}
@@ -2,7 +2,7 @@
* features/chat/shipping/useChatShippingDecision.spec.ts
* 用途:验证发货通知决策处理器经 Chat Turn 发起,silent 模式不追加用户气泡。
* 依赖:vitest、vue refs、useChatShippingDecision。
* 逻辑:mock startChatTurn,覆盖 silent/普通决策、显式 taskId 与 inventory_mapping 分支。
* 逻辑:mock startChatTurn,覆盖 silent/普通决策与显式 taskId 分支。
*/
import { computed, ref } from 'vue';
import { describe, expect, it, vi, beforeEach } from 'vitest';
@@ -26,11 +26,9 @@ const createContext = (
history: ref([{ conversation_id: 'conv-001' }]),
isShippingNoticeAgent: computed(() => true),
currentAgentId: computed(() => 42),
shippingInventorySchemaPreviewCache: ref({}),
getActiveShippingTaskId: () => 'SN-FOCUS-001',
getActiveShippingBatchNo: () => 'BATCH-001',
loadHistory: vi.fn(async () => undefined),
openShippingInventoryMappingFormForTask: vi.fn(async () => true),
refreshShippingActions: vi.fn(async () => undefined),
startChatTurn: defaultStartChatTurn,
msg: {
@@ -115,21 +113,6 @@ describe('useChatShippingDecision', () => {
expect(ctx.msg.warning).not.toHaveBeenCalled();
});
it('submits confirm_inventory_mapping via submit_decision Chat Turn', async () => {
const ctx = createContext();
const { executeShippingDecision } = createShippingDecisionHandlers(ctx);
const ok = await executeShippingDecision('confirm_inventory_mapping', '确认');
expect(ok).toBe(true);
expect(ctx.startChatTurn).toHaveBeenCalledWith(
expect.objectContaining({
actionType: 'shipping.submit_decision',
payload: { task_no: 'SN-FOCUS-001', decision: 'confirm_inventory_mapping' },
}),
);
});
it('returns false when startChatTurn reports failure', async () => {
const ctx = createContext({
startChatTurn: vi.fn(async () => false),
@@ -16,11 +16,9 @@ export interface ShippingDecisionContext {
history: Ref<ChatSessionItem[]>;
isShippingNoticeAgent: ComputedRef<boolean>;
currentAgentId: ComputedRef<number>;
shippingInventorySchemaPreviewCache: Ref<Record<string, unknown>>;
getActiveShippingTaskId: () => string;
getActiveShippingBatchNo: () => string;
loadHistory: () => Promise<void>;
openShippingInventoryMappingFormForTask: (taskId: string) => Promise<boolean>;
refreshShippingActions: () => Promise<void>;
startChatTurn: (options: StartChatTurnOptions) => Promise<boolean>;
msg: { warning: (text: string) => void; success: (text: string) => void };
@@ -54,23 +52,9 @@ export function createShippingDecisionHandlers(ctx: ShippingDecisionContext) {
}
};
const afterDecisionTurn = async (decision: string, taskId: string, assistantMsg?: ChatMessage) => {
if (decision === 'correct_inventory_mapping' && assistantMsg?.payload && typeof assistantMsg.payload === 'object') {
const toolResult = (assistantMsg.payload as { tool_result?: { data?: { schema_preview?: unknown } } }).tool_result;
const preview = toolResult?.data?.schema_preview;
const key = String(taskId || '').trim().toUpperCase();
if (key && preview && typeof preview === 'object') {
ctx.shippingInventorySchemaPreviewCache.value = {
...ctx.shippingInventorySchemaPreviewCache.value,
[key]: preview,
};
}
}
const afterDecisionTurn = async () => {
await syncHistoryIfNeeded();
void ctx.refreshShippingActions();
if (decision === 'correct_inventory_mapping') {
await ctx.openShippingInventoryMappingFormForTask(taskId);
}
};
/**
@@ -105,7 +89,8 @@ export function createShippingDecisionHandlers(ctx: ShippingDecisionContext) {
silent: options?.silent,
hooks: {
onAssistantMessageFinished: async (assistantMsg) => {
await afterDecisionTurn(decision, taskId, assistantMsg);
void assistantMsg;
await afterDecisionTurn();
},
},
});
@@ -1,98 +0,0 @@
/**
* features/chat/shipping/useChatShippingMappingForm.spec.ts
* 用途:验证库存人工列映射严格使用 v2 料号与 Reservation 契约。
* 依赖:vitest、Vue refs、shipping.api、useChatShippingMappingForm。
* 逻辑:覆盖表单预填、完整映射提交和缺 Reservation 本地阻断。
*/
import { computed, ref } from 'vue';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { createShippingMappingFormHandlers, type ShippingMappingFormContext } from './useChatShippingMappingForm';
import type { ChatMessage } from '../types/chat.types';
const { getWorkspaceShippingTask } = vi.hoisted(() => ({
getWorkspaceShippingTask: vi.fn(),
}));
vi.mock('@/features/chat/api/shipping.api', () => ({
getWorkspaceShippingTask,
}));
const createContext = (
overrides: Partial<ShippingMappingFormContext> = {},
): ShippingMappingFormContext => ({
messages: ref<ChatMessage[]>([]),
chatScrollContainer: ref(null),
shippingInventorySchemaPreviewCache: ref({
'SN-MAP-001': {
headers: ['Supplier Sku', 'COM ID', 'Qty Available'],
suggested_mapping: {
part_number: 'Supplier Sku',
reservation_id: 'COM ID',
available_qty: 'Qty Available',
},
},
}),
shippingInventoryPickerRef: ref(null),
pendingShippingUploadTaskId: ref(''),
resolvedShippingTaskId: ref(''),
newLocalMessageId: () => 'local-mapping-1',
saveLocalMessageToBackend: vi.fn(async () => undefined),
startChatTurn: vi.fn(async () => true),
currentAgentId: computed(() => 42),
refreshShippingActions: vi.fn(async () => undefined),
msg: { warning: vi.fn() },
...overrides,
});
describe('useChatShippingMappingForm', () => {
beforeEach(() => {
getWorkspaceShippingTask.mockReset();
getWorkspaceShippingTask.mockResolvedValue({
lines: [{ part_number: 'D4-A08AR12000002', reservation_id: '3000092917', qty: 10 }],
});
});
it('prefills and submits the v2 inventory mapping fields', async () => {
const ctx = createContext();
const handlers = createShippingMappingFormHandlers(ctx);
expect(await handlers.openShippingInventoryMappingFormForTask('sn-map-001')).toBe(true);
const message = ctx.messages.value[0];
expect(message.payload).toMatchObject({
order: { line_count: 1, part_numbers: ['D4-A08AR12000002'] },
form: {
part_number: 'Supplier Sku',
reservation_id: 'COM ID',
available_qty: 'Qty Available',
},
});
await handlers.applyShippingInventoryMappingForm(message);
expect(ctx.startChatTurn).toHaveBeenCalledWith(expect.objectContaining({
actionType: 'shipping.apply_inventory_mapping',
payload: {
task_no: 'SN-MAP-001',
map_json: {
part_number: 'Supplier Sku',
reservation_id: 'COM ID',
available_qty: 'Qty Available',
},
},
}));
});
it('blocks submission when the Reservation ID mapping is missing', async () => {
const ctx = createContext();
const handlers = createShippingMappingFormHandlers(ctx);
await handlers.openShippingInventoryMappingFormForTask('SN-MAP-001');
const message = ctx.messages.value[0];
const payload = message.payload as { form: { reservation_id: string } };
payload.form.reservation_id = '';
await handlers.applyShippingInventoryMappingForm(message);
expect(ctx.startChatTurn).not.toHaveBeenCalled();
expect(ctx.msg.warning).toHaveBeenCalledWith('请先选择内部料号列、Reservation ID 列与可用数量列');
});
});
@@ -1,174 +0,0 @@
/**
* features/chat/shipping/useChatShippingMappingForm.ts
* 用途:管理库存列映射表单的打开、提交和重新上传交互。
* 依赖:shipping.api、shippingMapping、chat.types、Vue nextTick。
* 逻辑:由 useChatShipping 调用本文件;本文件负责把 schema preview 渲染成聊天卡片,并把表单提交回后端映射接口。
*/
import { nextTick } from 'vue';
import { getWorkspaceShippingTask } from '@/features/chat/api/shipping.api';
import { buildShippingApplyMappingTurn } from './shippingTurnActions';
import { getShippingInventoryMappingPayload } from './shippingMapping';
import type { StartChatTurnOptions } from '../types/chat-turn.types';
import type { ChatMessage } from '../types/chat.types';
import type { ShippingInventoryMappingFormPayload } from '../types/shipping.types';
import type { Ref } from 'vue';
export interface ShippingMappingFormContext {
messages: Ref<ChatMessage[]>;
chatScrollContainer: Ref<HTMLElement | null>;
shippingInventorySchemaPreviewCache: Ref<Record<string, unknown>>;
shippingInventoryPickerRef: Ref<HTMLInputElement | null>;
pendingShippingUploadTaskId: Ref<string>;
resolvedShippingTaskId: Ref<string>;
newLocalMessageId: (prefix: string) => string;
saveLocalMessageToBackend: (msg: ChatMessage, userQuery?: string) => Promise<void>;
startChatTurn: (options: StartChatTurnOptions) => Promise<boolean>;
currentAgentId: import('vue').ComputedRef<number>;
refreshShippingActions: () => Promise<void>;
msg: { warning: (text: string) => void };
}
/**
* 创建库存列映射表单处理器。
*
* 核心逻辑:按任务号打开或复用映射卡片,提交 map_json 到后端,并在成功后刷新动作按钮。
* @param ctx - 库存映射表单上下文
* @returns 打开、应用和重传库存映射表单的处理函数
*/
export function createShippingMappingFormHandlers(ctx: ShippingMappingFormContext) {
const scrollToLastShippingInventoryMapping = async (): Promise<boolean> => {
const container = ctx.chatScrollContainer.value;
if (!container) return false;
let idx = -1;
for (let i = ctx.messages.value.length - 1; i >= 0; i -= 1) {
if ((ctx.messages.value[i] as ChatMessage)?.type === 'shipping-inventory-mapping') {
idx = i;
break;
}
}
if (idx < 0) return false;
await nextTick();
await nextTick();
const el = container.querySelector(`[data-msg-index="${idx}"]`) as HTMLElement | null;
if (!el) return false;
el.scrollIntoView({ behavior: 'smooth', block: 'start' });
return true;
};
const openShippingInventoryMappingFormForTask = async (taskId: string): Promise<boolean> => {
const id = String(taskId || '').trim().toUpperCase();
if (!id) return false;
const existingIdx = (() => {
for (let i = ctx.messages.value.length - 1; i >= 0; i -= 1) {
const chatMsg = ctx.messages.value[i] as ChatMessage;
if (chatMsg?.type !== 'shipping-inventory-mapping') continue;
const payload = getShippingInventoryMappingPayload(chatMsg);
if (payload?.taskId?.trim().toUpperCase() === id) return i;
}
return -1;
})();
if (existingIdx >= 0) {
return scrollToLastShippingInventoryMapping();
}
const schemaPreview = ctx.shippingInventorySchemaPreviewCache.value[id];
if (!schemaPreview || typeof schemaPreview !== 'object') {
ctx.msg.warning('未找到表头预览,请重新上传库存文件后再点击“修改映射”');
return false;
}
const detail = await getWorkspaceShippingTask(id).catch(() => null);
const rawLines = Array.isArray((detail as { lines?: unknown[] } | null)?.lines)
? (detail as { lines: unknown[] }).lines
: [];
const partNumbers = [...new Set(
rawLines
.map((line) => String((line as Record<string, unknown>)?.part_number || '').trim())
.filter(Boolean),
)].slice(0, 40);
const suggested = (schemaPreview as { suggested_mapping?: Record<string, string> }).suggested_mapping || {};
const mappingMsg: ChatMessage = {
role: 'assistant',
type: 'shipping-inventory-mapping',
content: [
'请用下拉框选择库存列映射(必须从表头中选择)。',
`任务编号:${id}`,
].filter(Boolean).join('\n'),
payload: {
taskId: id,
schema_preview: schemaPreview,
order: { line_count: rawLines.length, part_numbers: partNumbers },
form: {
part_number: String(suggested?.part_number || '').trim(),
available_qty: String(suggested?.available_qty || '').trim(),
reservation_id: String(suggested?.reservation_id || '').trim(),
},
applying: false,
} as ShippingInventoryMappingFormPayload,
local_id: ctx.newLocalMessageId('shipping-assistant'),
local_only: true,
};
ctx.messages.value.push(mappingMsg);
await ctx.saveLocalMessageToBackend(mappingMsg);
await scrollToLastShippingInventoryMapping();
return true;
};
const applyShippingInventoryMappingForm = async (msgObj: ChatMessage) => {
const payload = getShippingInventoryMappingPayload(msgObj);
if (!payload) return;
if (payload.applying) return;
const taskId = String(payload.taskId || '').trim();
if (!taskId) {
ctx.msg.warning('未找到任务编号');
return;
}
const mapping: Record<string, string> = {
part_number: String(payload.form?.part_number || '').trim(),
available_qty: String(payload.form?.available_qty || '').trim(),
reservation_id: String(payload.form?.reservation_id || '').trim(),
};
if (!mapping.part_number || !mapping.reservation_id || !mapping.available_qty) {
ctx.msg.warning('请先选择内部料号列、Reservation ID 列与可用数量列');
return;
}
payload.applying = true;
try {
const turn = buildShippingApplyMappingTurn(taskId, mapping);
const ok = await ctx.startChatTurn({
agentId: ctx.currentAgentId.value,
inputType: 'form_submit',
displayText: turn.displayText,
actionType: turn.actionType,
payload: turn.payload,
refs: turn.refs,
hooks: {
onAssistantMessageFinished: async () => {
ctx.resolvedShippingTaskId.value = taskId;
void ctx.refreshShippingActions();
},
},
});
if (!ok) ctx.msg.warning('应用映射失败');
} catch (e: unknown) {
const errorMessage = e instanceof Error ? e.message : '应用映射失败';
ctx.msg.warning(errorMessage);
} finally {
payload.applying = false;
await ctx.saveLocalMessageToBackend(msgObj);
}
};
const reuploadShippingInventoryFromMappingForm = (msgObj: ChatMessage) => {
const payload = getShippingInventoryMappingPayload(msgObj);
if (!payload) return;
const taskId = String(payload.taskId || '').trim();
if (!taskId) return;
ctx.pendingShippingUploadTaskId.value = taskId;
ctx.shippingInventoryPickerRef.value?.click();
};
return {
openShippingInventoryMappingFormForTask,
applyShippingInventoryMappingForm,
reuploadShippingInventoryFromMappingForm,
};
}
@@ -38,7 +38,6 @@ const createContext = (
getActiveShippingBatchNo: () => 'BATCH-001',
messages: ref([]),
sendShippingMenuMessage: vi.fn(async () => undefined),
openShippingInventoryMappingFormForTask: vi.fn(async () => true),
openShippingInventoryPicker: vi.fn((_taskId?: string) => true),
openShippingNoticePicker: vi.fn((_taskId?: string) => true),
executeShippingDecision: vi.fn(async () => true),
@@ -20,7 +20,6 @@ export interface ShippingMenuHandlerContext {
getActiveShippingBatchNo: () => string;
messages: Ref<ChatMessage[]>;
sendShippingMenuMessage: (message: string) => Promise<void>;
openShippingInventoryMappingFormForTask: (taskId: string) => Promise<boolean>;
openShippingInventoryPicker: (taskId?: string) => boolean;
openShippingNoticePicker: (taskId?: string) => boolean;
openShippingCustomerDialog: (taskId: string) => Promise<void>;
@@ -208,15 +207,6 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
ctx.msg.info(ctx.t('chat.shippingNoticeUi.inventorySource.retryResolveDone'));
return;
}
if (action.id === 'edit_inventory_mapping') {
const taskId = resolveTaskId();
if (!taskId) {
ctx.msg.warning(ctx.t('chat.shippingNoticeMissingTaskId'));
return;
}
await ctx.openShippingInventoryMappingFormForTask(taskId);
return;
}
if (action.id === 'upload_inventory_file') {
ctx.openShippingInventoryPicker(resolveTaskId());
return;
@@ -225,10 +215,6 @@ export function createShippingMenuHandlers(ctx: ShippingMenuHandlerContext) {
ctx.openShippingNoticePicker(resolveTaskId());
return;
}
if (action.id === 'paste_inventory_json') {
ctx.msg.info(ctx.t('chat.shippingNoticePasteHint'));
return;
}
if (action.id === 'reparse_inventory') {
if (chatMsg?.shipping_actions_used) return;
const taskId = resolveTaskId();
@@ -82,6 +82,40 @@ describe('useChatShippingSendHandler', () => {
expect(ctx.msg.info).toHaveBeenCalledWith('chat.shippingNoticeBatchSubmitting');
});
it('keeps a spreadsheet pending until the user explicitly declares it as inventory', async () => {
const attachment = {
id: 'spreadsheet', kind: 'local' as const,
file: new File(['sheet'], 'unknown.xlsx', { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' }),
type: 'document' as const, uploadStatus: 'waiting' as const, uploadProgress: 0,
};
const ctx = createContext({ attachments: ref([attachment]) });
const { tryHandleShippingAttachmentAutoFlow } = createShippingSendHandlers(ctx);
const consumed = await tryHandleShippingAttachmentAutoFlow(undefined, '', '');
expect(consumed).toBe(true);
expect(ctx.handleShippingAutoUploadFile).not.toHaveBeenCalled();
expect(ctx.handleShippingAutoUploadNoticeBatch).not.toHaveBeenCalled();
expect(ctx.msg.info).toHaveBeenCalledWith('chat.shippingNoticeSpreadsheetIntentRequired');
expect(ctx.attachments.value).toHaveLength(1);
});
it('routes a declared xls spreadsheet to the isolated temporary inventory path', async () => {
const attachment = {
id: 'legacy-spreadsheet', kind: 'local' as const,
file: new File(['sheet'], 'inventory.xls', { type: 'application/vnd.ms-excel' }),
type: 'document' as const, uploadStatus: 'waiting' as const, uploadProgress: 0,
};
const ctx = createContext({ attachments: ref([attachment]), shippingAutoFlowRequested: ref(false) });
const { tryHandleShippingAttachmentAutoFlow } = createShippingSendHandlers(ctx);
const consumed = await tryHandleShippingAttachmentAutoFlow('这是库存文件,请分析', '这是库存文件,请分析', '这是库存文件,请分析');
expect(consumed).toBe(true);
expect(ctx.handleShippingAutoUploadFile).toHaveBeenCalledWith(attachment.file);
expect(ctx.handleShippingAutoUploadNoticeBatch).not.toHaveBeenCalled();
});
it('sends parsed intakes to the existing Chatflow without requiring upload-time candidates', async () => {
const completionOrder: string[] = [];
const attachment = {
@@ -1,7 +1,7 @@
/**
* features/chat/shipping/useChatShippingSendHandler.ts
* 用途:在聊天发送前拦截发货通知专属意图,如订单抽取、切票、决策文本、列映射和附件自动流程。
* 依赖:shipping.api、shippingIntents、shippingMenu、shippingMapping、shippingDownload、chat.types。
* 用途:在聊天发送前拦截发货通知专属意图,如订单抽取、切票、决策文本和附件自动流程。
* 依赖:shipping.api、shippingIntents、shippingMenu、shippingDownload、chat.types。
* 逻辑:已预处理 Intake 通过普通聊天接口进入现有 Dify Chatflow;其他业务动作经 Chat Turn / handleShippingMenuAction。
*/
import {
@@ -9,7 +9,7 @@ import {
getWorkspaceShippingTask,
} from '@/features/chat/api/shipping.api';
import { SHIPPING_DECISION_ACTIONS, SHIPPING_MENU_ACTION_SPECS } from '../constants/shipping';
import { buildShippingApplyMappingTurn, buildShippingSwitchFocusTurn } from './shippingTurnActions';
import { buildShippingSwitchFocusTurn } from './shippingTurnActions';
import { downloadWorkspaceShippingExcelFile } from './shippingDownload';
import {
isShippingDownloadExcelIntent,
@@ -17,10 +17,9 @@ import {
isShippingInventoryUploadIntent,
isShippingManualUploadIntent,
parseShippingTaskSwitchIntent,
parseShippingColumnMappingFromText,
} from './shippingIntents';
import { resolveShippingDecisionFromText, resolveShippingNumericChoice } from './shippingMenu';
import { classifyShippingUploadFile } from './shippingUploadPrompt';
import { isShippingSpreadsheetFile, isTemporaryInventoryDeclaration } from './shippingUploadPrompt';
import { extractExt } from '../constants/shipping';
import { createChatMessageAttachmentSnapshots } from '../utils/attachmentCard.utils';
import type { SendMessageLifecycleHooks } from '../composables/useChat';
@@ -52,7 +51,7 @@ export interface ShippingSendHandlerContext {
agentId: number,
kb: string,
files: ChatUploadFileSpec[],
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; display_query?: string },
context?: { task_id?: string; batch_no?: string; shipping_intake_nos?: string[]; shipping_temporary_inventory_asset_no?: string; shipping_temporary_inventory_session_no?: string; display_query?: string },
hooks?: SendMessageLifecycleHooks,
) => Promise<ChatMessageSendResult>;
buildFileSpecsForSend: () => Promise<ChatUploadFileSpec[]>;
@@ -270,7 +269,6 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
return true;
}
}
if (!(ctx.shippingAutoFlowRequested.value || !trimmed)) return false;
if (!ctx.isShippingNoticeAgent.value || ctx.attachments.value.length === 0) return false;
if (ctx.isThinking.value || ctx.isUploadingAttachments.value) return false;
if (ctx.isShippingNoticeBatchSubmitting?.()) {
@@ -285,8 +283,15 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
ctx.msg.warning('当前仅支持本地附件触发自动流程');
return true;
}
const kind = classifyShippingUploadFile(first.file, extractExt);
if (kind === 'inventory') {
if (isShippingSpreadsheetFile(first.file, extractExt)) {
if (!isTemporaryInventoryDeclaration(trimmed)) {
// 仅附件或自动建议时必须先澄清;有其他明确文本则交回普通对话,不把表格擅自归类。
if (!trimmed || requestedAutoFlow) {
ctx.msg.info(ctx.t('chat.shippingNoticeSpreadsheetIntentRequired'));
return true;
}
return false;
}
ctx.attachments.value = [];
if (typeof textOrEvent !== 'string') ctx.input.value = '';
if (localFiles.length > 1) {
@@ -300,6 +305,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
}
return true;
}
if (!(ctx.shippingAutoFlowRequested.value || !trimmed)) return false;
if (!trimmed || requestedAutoFlow) {
if (typeof textOrEvent !== 'string') ctx.input.value = '';
ctx.attachments.value = [];
@@ -355,9 +361,6 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
if (typeof textOrEvent !== 'string') ctx.input.value = '';
if (menuChoice === 'upload') {
if (ctx.openShippingInventoryPicker()) return true;
} else if (menuChoice === 'paste') {
ctx.msg.info(ctx.t('chat.shippingNoticePasteHint'));
return true;
} else if (SHIPPING_DECISION_ACTIONS.has(menuChoice)) {
const spec = SHIPPING_MENU_ACTION_SPECS[menuChoice];
await ctx.executeShippingDecision(menuChoice, spec?.label || spec?.message || menuChoice);
@@ -372,34 +375,6 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
if (typeof textOrEvent !== 'string') ctx.input.value = '';
if (await ctx.executeShippingDecision(shippingDecision, content.trim())) return true;
}
if (assistantCtx.includes('schema_preview') || assistantCtx.includes('列映射') || assistantCtx.includes('字段对齐')) {
const mapping = parseShippingColumnMappingFromText(content);
if (mapping) {
const taskId = ctx.getActiveShippingTaskId();
if (!taskId) {
ctx.msg.warning('未找到任务编号,请先上传库存文件');
return true;
}
ctx.resolvedShippingTaskId.value = taskId;
if (typeof textOrEvent !== 'string') ctx.input.value = '';
ctx.attachments.value = [];
const turn = buildShippingApplyMappingTurn(taskId, mapping);
await ctx.startChatTurn({
agentId: ctx.currentAgentId.value,
inputType: 'form_submit',
displayText: `${content.trim()}\n任务编号:${taskId}`,
actionType: turn.actionType,
payload: turn.payload,
refs: turn.refs,
hooks: {
onAssistantMessageFinished: async () => {
void ctx.refreshShippingActions();
},
},
});
return true;
}
}
if (isShippingManualUploadIntent(content)) {
const taskId = ctx.getActiveShippingTaskId();
if (!taskId) {
@@ -415,6 +390,7 @@ export function createShippingSendHandlers(ctx: ShippingSendHandlerContext) {
if (isShippingInventoryUploadIntent(content, assistantCtx)) {
if (typeof textOrEvent !== 'string') ctx.input.value = '';
if (ctx.openShippingInventoryPicker()) return true;
return true;
}
if (isShippingGenerateExcelIntent(content)) {
const taskId = ctx.getActiveShippingTaskId();
@@ -14,8 +14,8 @@ import {
type ShippingUploadHandlerContext,
} from './useChatShippingUploadHandler';
const { createWorkspaceShippingTask } = vi.hoisted(() => ({
createWorkspaceShippingTask: vi.fn(),
const { uploadFileAsset } = vi.hoisted(() => ({
uploadFileAsset: vi.fn(),
}));
const { computeNoticeFilesContentFingerprint } = vi.hoisted(() => ({
@@ -25,8 +25,8 @@ const { computeNoticeFilesContentFingerprint } = vi.hoisted(() => ({
}),
}));
vi.mock('@/features/chat/api/shipping.api', () => ({
createWorkspaceShippingTask,
vi.mock('@/shared/api/file-assets.api', () => ({
uploadFileAsset,
}));
vi.mock('./shippingNoticeBatchIdempotency', () => ({
@@ -52,18 +52,18 @@ const createContext = (
shippingBatchTasks: ref([]),
shippingInventorySelectionActive: ref(false),
shippingInventorySelectionTaskId: ref(''),
shippingInventorySchemaPreviewCache: ref({}),
getActiveShippingTaskId: () => 'SN-ACTIVE-001',
startChatTurn: vi.fn(async () => true),
refreshShippingActions: vi.fn(async () => undefined),
msg: { warning: vi.fn() },
t: (key: string) => key,
sendTemporaryInventoryMessage: vi.fn(async () => undefined),
...overrides,
});
describe('useChatShippingUploadHandler', () => {
beforeEach(() => {
createWorkspaceShippingTask.mockReset();
uploadFileAsset.mockReset();
computeNoticeFilesContentFingerprint.mockReset();
computeNoticeFilesContentFingerprint.mockImplementation(async (files: File[]) => {
const content = await files[0]?.text();
@@ -72,6 +72,34 @@ describe('useChatShippingUploadHandler', () => {
resetShippingNoticeBatchSubmitStateForTests();
});
it('stores an explicitly declared conversation inventory Excel as a temporary asset without creating a shipping task', async () => {
uploadFileAsset.mockResolvedValue({ asset_no: 'FAS-TEMP-001' });
const sendTemporaryInventoryMessage = vi.fn(async () => undefined);
const ctx = createContext({ sendTemporaryInventoryMessage });
const { handleShippingAutoUploadFile } = createShippingUploadHandlers(ctx);
const file = new File(['inventory'], 'inventory.xlsx', {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
});
await handleShippingAutoUploadFile(file);
expect(uploadFileAsset).toHaveBeenCalledWith(file);
expect(sendTemporaryInventoryMessage).toHaveBeenCalledWith('FAS-TEMP-001', 'inventory.xlsx');
});
it('accepts a legacy xls inventory file for the isolated temporary upload path', async () => {
uploadFileAsset.mockResolvedValue({ asset_no: 'FAS-TEMP-XLS' });
const sendTemporaryInventoryMessage = vi.fn(async () => undefined);
const ctx = createContext({ sendTemporaryInventoryMessage });
const { handleShippingAutoUploadFile } = createShippingUploadHandlers(ctx);
const file = new File(['legacy inventory'], 'inventory.xls', { type: 'application/vnd.ms-excel' });
await handleShippingAutoUploadFile(file);
expect(uploadFileAsset).toHaveBeenCalledWith(file);
expect(sendTemporaryInventoryMessage).toHaveBeenCalledWith('FAS-TEMP-XLS', 'inventory.xls');
});
it('opens inventory picker for explicit taskId instead of current active task', () => {
const inventoryClick = vi.fn();
const ctx = createContext({
@@ -86,6 +114,22 @@ describe('useChatShippingUploadHandler', () => {
expect(inventoryClick).toHaveBeenCalledTimes(1);
});
it('uploads a task-selected inventory file through the formal task Chat Turn, not the temporary path', async () => {
const ctx = createContext({ pendingShippingUploadTaskId: ref('SN-TASK-001') });
const { handleShippingInventorySelected } = createShippingUploadHandlers(ctx);
const file = new File(['inventory'], 'task-inventory.xls', { type: 'application/vnd.ms-excel' });
const event = { target: { files: [file], value: 'chosen' } } as unknown as Event;
await handleShippingInventorySelected(event);
expect(ctx.startChatTurn).toHaveBeenCalledWith(expect.objectContaining({
actionType: 'shipping.upload_inventory',
payload: { task_no: 'SN-TASK-001' },
files: [file],
}));
expect(ctx.sendTemporaryInventoryMessage).not.toHaveBeenCalled();
});
it('replaces notice on locked pending task via Chat Turn', async () => {
const ctx = createContext({
pendingShippingNoticeTaskId: ref('SN-TARGET-200'),
@@ -1,18 +1,15 @@
/**
* features/chat/shipping/useChatShippingUploadHandler.ts
* 用途:处理发货通知与库存文件上传、批量建单和附件建议提示。
* 依赖:shipping.api、shippingUploadPrompt、shipping 常量、chat.types。
* 逻辑:发货通知建批/库存上传/单票覆盖均经 startChatTurn + multipart SSE;待重试幂等键绑定 conversation_id。
* 依赖:shipping.api、file-assets.api、shippingUploadPrompt、shipping 常量、chat.types。
* 逻辑:发货通知建批和单票覆盖经 Chat Turn;对话上传库存文件先成为私有临时资产,再进入 Dify 受控分析分支。
*/
import { computed } from 'vue';
import {
createWorkspaceShippingTask,
type ShippingTaskSummary,
} from '@/features/chat/api/shipping.api';
import type { ShippingTaskSummary } from '@/features/chat/api/shipping.api';
import { uploadFileAsset } from '@/shared/api/file-assets.api';
import { extractExt } from '../constants/shipping';
import { buildShippingCreateBatchTurn, buildShippingCreateBatchFromIntakesTurn, buildShippingReplaceNoticeTurn, buildShippingUploadInventoryTurn } from './shippingTurnActions';
import { buildShippingCreateBatchTurn, buildShippingCreateBatchFromIntakesTurn, buildShippingReplaceNoticeTurn, buildShippingTurnRefs } from './shippingTurnActions';
import { computeNoticeFilesContentFingerprint, computeNoticeIntakeNosFingerprint } from './shippingNoticeBatchIdempotency';
import { classifyShippingUploadFile } from './shippingUploadPrompt';
import type { StartChatTurnOptions } from '../types/chat-turn.types';
import type { ChatMessage } from '../types/chat.types';
import type { PendingAttachment } from '../types/shipping.types';
@@ -113,7 +110,6 @@ export interface ShippingUploadHandlerContext {
shippingBatchTasks: Ref<ShippingTaskSummary[]>;
shippingInventorySelectionActive: Ref<boolean>;
shippingInventorySelectionTaskId: Ref<string>;
shippingInventorySchemaPreviewCache: Ref<Record<string, unknown>>;
getActiveShippingTaskId: () => string;
startChatTurn: (options: StartChatTurnOptions) => Promise<boolean>;
refreshShippingActions: () => Promise<void>;
@@ -122,12 +118,13 @@ export interface ShippingUploadHandlerContext {
getParsedIntakeNos?: () => string[];
getSelectedCandidateNos?: () => string[];
clearConsumedNoticeAttachments?: () => void;
sendTemporaryInventoryMessage: (assetNo: string, fileName: string) => Promise<unknown>;
}
/**
* 创建发货通知上传处理器。
*
* 核心逻辑:识别附件属于发货通知还是库存文件,分别触发建单/建批或库存上传,并维护 task/batch 本地上下文。
* 核心逻辑:通知附件触发建单/建批;临时库存文件只能由发送层在用户明确声明后调用,避免根据后缀误判业务类型。
* @param ctx - 上传处理上下文
* @returns 自动上传、文件选择器和建议提示相关处理函数
*/
@@ -138,28 +135,17 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
};
const runInventoryUploadChatTurn = async (taskId: string, file: File) => {
const turn = buildShippingUploadInventoryTurn(taskId, file);
const normalizedTaskId = String(taskId || '').trim().toUpperCase();
const ok = await ctx.startChatTurn({
agentId: ctx.currentAgentId.value,
inputType: 'upload_followup',
displayText: turn.displayText,
actionType: turn.actionType,
payload: turn.payload,
files: turn.files,
refs: turn.refs,
displayText: `上传库存文件:${file.name}`,
actionType: 'shipping.upload_inventory',
payload: { task_no: normalizedTaskId },
files: [file],
refs: buildShippingTurnRefs(normalizedTaskId),
hooks: {
onAssistantMessageFinished: async (assistantMsg) => {
const payload = assistantMsg.payload && typeof assistantMsg.payload === 'object'
? assistantMsg.payload as { schema_preview?: unknown; task_no?: string }
: {};
const key = String(payload.task_no || taskId || '').trim().toUpperCase();
const preview = payload.schema_preview;
if (key && preview && typeof preview === 'object') {
ctx.shippingInventorySchemaPreviewCache.value = {
...ctx.shippingInventorySchemaPreviewCache.value,
[key]: preview,
};
}
syncBatchContextFromTurnMessage(assistantMsg);
void ctx.refreshShippingActions();
},
@@ -271,25 +257,6 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
}
};
const syncBatchContextFromNoticeResponse = (result: Record<string, unknown> | null | undefined) => {
const batchNo = String(
(result?.batch_no as string | undefined)
|| ((result?.data as { batch?: { batch_no?: string } } | undefined)?.batch?.batch_no)
|| '',
).trim();
const focusTaskNo = String(
((result?.data as { focus_task?: { task_no?: string } } | undefined)?.focus_task?.task_no)
|| (result?.task_id as string | undefined)
|| '',
).trim();
const batchSummary = ((result?.data as { batch?: unknown } | undefined)?.batch) || null;
if (batchNo) ctx.resolvedShippingBatchNo.value = batchNo;
if (focusTaskNo) ctx.resolvedShippingTaskId.value = focusTaskNo;
if (batchSummary && typeof batchSummary === 'object') {
ctx.shippingBatchSummary.value = batchSummary;
}
};
const runReplaceNoticeChatTurn = async (taskId: string, file: File) => {
const turn = buildShippingReplaceNoticeTurn(taskId, file);
const ok = await ctx.startChatTurn({
@@ -377,32 +344,9 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
};
const handleShippingAutoUploadFile = async (file: File) => {
const kind = classifyShippingUploadFile(file, extractExt);
if (kind === 'inventory') {
let taskId = ctx.getActiveShippingTaskId();
if (!taskId) {
const created = await createWorkspaceShippingTask({
source_type: 'manual',
conversation_id: String(ctx.conversationId.value || '').trim() || undefined,
});
syncBatchContextFromNoticeResponse(created as unknown as Record<string, unknown>);
taskId = String(created.task_id || '').trim();
if (!taskId) {
ctx.msg.warning('自动创建发货任务失败');
return;
}
}
await uploadInventoryForTask(taskId, file);
return;
}
const pendingNoticeTaskId = String(ctx.pendingShippingNoticeTaskId.value || '').trim().toUpperCase();
ctx.pendingShippingNoticeTaskId.value = '';
const targetTaskId = pendingNoticeTaskId || String(ctx.getActiveShippingTaskId() || '').trim().toUpperCase();
if (targetTaskId) {
await handleReplaceNoticeForCurrentTask(targetTaskId, file);
return;
}
await runNoticeBatchChatTurn([file]);
// 调用方已验证用户明确声明库存;此处只创建隔离的临时资产,绝不建单或写正式库存。
const asset = await uploadFileAsset(file);
await ctx.sendTemporaryInventoryMessage(asset.asset_no, file.name);
};
const handleShippingAutoUploadNoticeBatch = async (files: File[]) => {
@@ -476,8 +420,9 @@ export function createShippingUploadHandlers(ctx: ShippingUploadHandlerContext)
| Extract<PendingAttachment, { kind: 'local' }>
| undefined;
if (!first) return '';
const kind = classifyShippingUploadFile(first.file, extractExt);
if (kind === 'inventory') return ctx.t('chat.shippingNoticePrompt.notice.autoInventoryAction');
if (['xlsx', 'xls', 'csv'].includes(extractExt(first.file.name || '').toLowerCase())) {
return ctx.t('chat.shippingNoticePrompt.notice.autoSpreadsheetAction');
}
return ctx.t('chat.shippingNoticePrompt.notice.autoNoticeAction');
});
@@ -6,11 +6,21 @@
*/
import { describe, expect, it } from 'vitest';
import {
isOrderExtractionEligibleIntake,
resolveShippingOrderExtractionStatus,
shouldRestoreShippingNoticeIntake,
shouldPollShippingNoticeIntake,
} from './useShippingNoticeIntakes';
describe('shipping notice order extraction state', () => {
it('does not resubmit consumed intakes for a new order extraction turn', () => {
expect(isOrderExtractionEligibleIntake({
intakeNo: 'SNI-CONSUMED',
parseStatus: 'consumed',
parseSummary: undefined,
})).toBe(false);
});
it('keeps polling after preprocessing is parsed while order extraction is active', () => {
expect(shouldPollShippingNoticeIntake({
parseStatus: 'parsed',
@@ -32,4 +42,14 @@ describe('shipping notice order extraction state', () => {
expect(resolveShippingOrderExtractionStatus('extracting', 'completed')).toBe('completed');
expect(resolveShippingOrderExtractionStatus(undefined, 'not_started')).toBe('not_started');
});
it('restores only in-progress and retryable parsing attachments into the input area', () => {
expect(shouldRestoreShippingNoticeIntake('queued')).toBe(true);
expect(shouldRestoreShippingNoticeIntake('parsing')).toBe(true);
expect(shouldRestoreShippingNoticeIntake('parse_failed')).toBe(true);
// Parsed files are already persisted in the user message bubble.
expect(shouldRestoreShippingNoticeIntake('parsed')).toBe(false);
expect(shouldRestoreShippingNoticeIntake('consumed')).toBe(false);
});
});
@@ -3,7 +3,7 @@
* 用途:发货通知选择即上传、创建 intake 与批量状态轮询编排。
* 依赖:file-assets.api、shipping.api、shipping.types、shippingNoticeAttachmentIntegrity。
* 逻辑:useChatShipping / useChatAttachments 在货代 Agent 下委托本 composable 管理预解析附件;
* 完整性判定委托 shippingNoticeAttachmentIntegrity(与后端契约对齐)。
* 完整性判定委托 shippingNoticeAttachmentIntegrity(与后端契约对齐);会话刷新仅恢复未提交的处理中或解析失败附件。
*/
import { computed, onBeforeUnmount, ref, type Ref } from 'vue';
import { uploadFileAsset } from '@/shared/api/file-assets.api';
@@ -34,6 +34,18 @@ const TERMINAL_PARSE = new Set(['parsed', 'failed', 'parse_failed', 'consumed',
const ACTIVE_PARSE = new Set(['waiting', 'queued', 'parsing', 'created']);
const ACTIVE_ORDER_EXTRACTION = new Set(['extracting']);
/**
* 判断服务端 Intake 是否应恢复到输入栏。
* AI 触发时机:无;页面刷新或重新打开会话时调用。
* 已解析文件已作为用户消息附件固化在对话气泡中,不能再次显示在输入栏;仅恢复仍在处理中的文件和可手动重试的解析失败文件。
* @param parseStatus - 服务端返回的预解析状态
* @returns 是否恢复为待发送附件卡片
*/
export function shouldRestoreShippingNoticeIntake(parseStatus: string | null | undefined): boolean {
const status = String(parseStatus || '').trim().toLowerCase();
return ACTIVE_PARSE.has(status) || status === 'parse_failed';
}
/** 判断 Intake 是否仍需轮询上传预处理或订单抽取状态。 */
export function shouldPollShippingNoticeIntake(
item: Pick<ShippingNoticePendingAttachment, 'parseStatus' | 'orderExtractionStatus'>,
@@ -42,6 +54,15 @@ export function shouldPollShippingNoticeIntake(
|| ACTIVE_ORDER_EXTRACTION.has(String(item.orderExtractionStatus || '').trim().toLowerCase());
}
/** 判断附件是否仍可作为新一轮完整订单抽取的输入。 */
export function isOrderExtractionEligibleIntake(
item: Pick<ShippingNoticePendingAttachment, 'intakeNo' | 'parseStatus' | 'parseSummary'>,
): boolean {
return item.parseStatus === 'parsed'
&& Boolean(item.intakeNo)
&& !isShippingNoticeAttachmentParseIncomplete(item.parseSummary);
}
/** 保留刚点击发送的本地 extracting,直到服务端进入真实抽取状态或返回终态。 */
export function resolveShippingOrderExtractionStatus(localStatus?: string, remoteStatus?: string | null): string | undefined {
const local = String(localStatus || '').trim().toLowerCase();
@@ -135,6 +156,7 @@ function mapServerCandidate(remote: ShippingNoticeCandidateResponse): ShippingNo
fieldAdjudication: remote.field_adjudication && typeof remote.field_adjudication === 'object'
? remote.field_adjudication
: null,
customerMatches: Array.isArray(remote.customer_matches) ? remote.customer_matches : [],
businessSummary: remote.business_summary || {},
duplicate,
duplicateResolution: remote.duplicate_resolution
@@ -376,12 +398,7 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
const getParsedIntakeNos = () =>
noticeAttachments.value
.filter(
(item) =>
item.parseStatus === 'parsed'
&& item.intakeNo
&& !isShippingNoticeAttachmentParseIncomplete(item.parseSummary),
)
.filter(isOrderExtractionEligibleIntake)
.map((item) => String(item.intakeNo));
/** 点击发送后立即展示订单识别阶段,并启动 Intake 状态轮询。 */
@@ -420,8 +437,7 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
const restoreForConversation = async (conversationId?: string | null) => {
const { items } = await listActiveShippingNoticeIntakes(conversationId);
const restored: ShippingNoticePendingAttachment[] = items
.filter((item) => !TERMINAL_PARSE.has(String(item.parse_status || '').toLowerCase()) || item.parse_status === 'parsed')
.filter((item) => item.parse_status !== 'consumed')
.filter((item) => shouldRestoreShippingNoticeIntake(item.parse_status))
.map((item) => ({
id: `restored_${item.intake_no}`,
kind: 'shipping_notice' as const,
@@ -68,7 +68,7 @@ export interface ChatMessage {
content: string;
/** 用户提交时固化的附件展示快照;助手消息不使用此字段。 */
attachments?: ChatMessageAttachment[];
type?: 'text' | 'leave-form' | 'leave-confirmation' | 'leave-result' | 'shipping-inventory-mapping' | 'shipping-parse-review' | 'shipping-match-result' | 'maintenance-device-result';
type?: 'text' | 'leave-form' | 'leave-confirmation' | 'leave-result' | 'shipping-parse-review' | 'shipping-match-result' | 'maintenance-device-result';
retriever_resources?: RetrieverResource[];
attribution_parts?: string[];
chat_log_id?: number;
@@ -21,7 +21,6 @@ export type InventorySourceMethod =
export interface ShippingInventorySourceCandidate {
source_code: string;
display_name?: string | null;
site_id?: string | null;
warehouse_id?: string | null;
connector_type?: string | null;
match_score?: number | null;
@@ -100,7 +99,6 @@ export interface ShippingTaskSummary {
warehouse_hint?: string | null;
inventory_source_code?: string | null;
inventory_connector_type?: string | null;
inventory_site_id?: string | null;
inventory_warehouse_id?: string | null;
inventory_source_status?: InventorySourceStatus | null;
inventory_source_method?: InventorySourceMethod | null;
@@ -241,6 +239,32 @@ export interface ShippingFieldAdjudication {
conflicts?: Array<Record<string, unknown>>;
}
export interface ShippingOrderCustomerMatchCandidate {
customer_id: number;
standard_name: string;
short_code: string;
site_id?: number | null;
site_name?: string | null;
site_code?: string | null;
matched_by?: string[];
}
export interface ShippingOrderCustomerMatch {
id: number;
extraction_id: number;
role: 'bill_to' | 'ship_to';
raw_name?: string | null;
status: 'unmatched' | 'unique_candidate' | 'ambiguous' | 'confirmed' | string;
customer_id?: number | null;
site_id?: number | null;
source_system?: string | null;
external_code?: string | null;
standard_name?: string | null;
short_code?: string | null;
candidates?: ShippingOrderCustomerMatchCandidate[];
resolution_method?: string | null;
}
export interface ShippingFieldConflict {
id: number;
task_id: number;
@@ -507,6 +531,7 @@ export interface ShippingNoticeCandidateResponse {
field_confidence?: Record<string, number | null | undefined>;
evidence?: ShippingFieldEvidenceItem[];
field_adjudication?: ShippingFieldAdjudication | null;
customer_matches?: ShippingOrderCustomerMatch[];
business_summary?: Record<string, unknown> | null;
duplicate?: ShippingDuplicateResult | null;
duplicate_resolution?: {
@@ -5,11 +5,11 @@
* 逻辑:附件 composable、shipping/* composable 与 Chat 消息组件统一引用本文件类型。
*/
import type { ShippingFieldAdjudication } from './shipping.api.types';
import type { ShippingFieldAdjudication, ShippingOrderCustomerMatch } from './shipping.api.types';
export type ShippingActionVariant = 'primary' | 'secondary' | 'danger';
export type ShippingMenuAction = 'upload' | 'paste' | 'retry_rpa' | 'confirm' | 'reparse' | 'reject';
export type ShippingMenuAction = 'upload' | 'retry_rpa' | 'confirm' | 'reparse' | 'reject';
export type ChatUploadFileType = 'image' | 'document' | 'audio' | 'video' | 'custom';
@@ -79,6 +79,7 @@ export interface ShippingNoticeCandidate {
fieldConfidence?: Record<string, number | null | undefined>;
evidence?: Array<Record<string, unknown>>;
fieldAdjudication?: ShippingFieldAdjudication | null;
customerMatches?: ShippingOrderCustomerMatch[];
businessSummary: Record<string, unknown>;
duplicate?: ShippingDuplicateResult;
duplicateResolution?: ShippingDuplicateResolution;
@@ -180,23 +181,6 @@ export type ChatUploadFileSpec =
| { type: ChatUploadFileType; transfer_method: 'local_file'; upload_file_id: string }
| { type: ChatUploadFileType; transfer_method: 'remote_url'; url: string };
/** 库存 Excel 表头预览(后端 schema_preview 字段) */
export interface ShippingSchemaPreview {
header_row_index?: number;
headers?: string[];
sample_rows?: unknown[][];
suggested_mapping?: Record<string, string>;
}
/** 库存列映射表单消息 payload(type=shipping-inventory-mapping) */
export interface ShippingInventoryMappingFormPayload {
taskId: string;
schema_preview: ShippingSchemaPreview;
order: { line_count: number; part_numbers: string[] };
form: { part_number: string; available_qty: string; reservation_id: string };
applying?: boolean;
}
export interface ShippingParseReviewPayload {
taskId: string;
checkpoint: string;
@@ -70,7 +70,9 @@ describe('attachment card utils', () => {
});
it('preserves shipping parsing, failure and duplicate attention states', () => {
expect(getAttachmentCardStatus(shippingAttachment({ parseStatus: 'parsing' })).state).toBe('processing');
expect(getAttachmentCardStatus(shippingAttachment({ parseStatus: 'parsing' }))).toEqual({
state: 'processing', labelKey: 'chat.attachment.parsing',
});
expect(getAttachmentCardStatus(shippingAttachment({ parseStatus: 'failed' }))).toEqual({
state: 'failed', labelKey: 'chat.attachment.parseFailed',
});
@@ -83,7 +85,9 @@ describe('attachment card utils', () => {
allowedActions: [],
},
})).state).toBe('attention');
expect(getAttachmentCardStatus(shippingAttachment()).state).toBe('ready');
expect(getAttachmentCardStatus(shippingAttachment())).toEqual({
state: 'ready', labelKey: 'chat.attachment.parseSucceeded',
});
});
it('shows the order extraction lifecycle separately from attachment parsing', () => {
@@ -67,7 +67,7 @@ export function getAttachmentCardStatus(attachment: PendingAttachment): Attachme
if (attachment.uploadStatus === 'uploading') return { state: 'uploading', labelKey: 'chat.attachment.uploading' };
if (attachment.uploadStatus === 'failed') return { state: 'failed', labelKey: 'chat.attachment.uploadFailed' };
if (attachment.parseStatus === 'queued' || attachment.parseStatus === 'parsing') {
return { state: 'processing', labelKey: 'chat.attachment.processing' };
return { state: 'processing', labelKey: 'chat.attachment.parsing' };
}
if (attachment.parseStatus === 'failed') return { state: 'failed', labelKey: 'chat.attachment.parseFailed' };
const extractionStatus = String(attachment.orderExtractionStatus || '').trim().toLowerCase();
@@ -92,7 +92,7 @@ export function getAttachmentCardStatus(attachment: PendingAttachment): Attachme
}
}
if (attachment.parseStatus === 'parsed' || attachment.parseStatus === 'consumed') {
return { state: 'ready', labelKey: 'chat.attachment.ready' };
return { state: 'ready', labelKey: 'chat.attachment.parseSucceeded' };
}
return { state: 'pending', labelKey: 'chat.attachment.pending' };
}
@@ -129,9 +129,7 @@ function getSnapshotAttachmentName(attachment: PendingAttachment): string {
return basename.replace(/[\u0000-\u001f\u007f]/g, '').trim().slice(0, 255) || 'attachment';
}
/**
* 鐢熸垚鍙寔涔呭寲鐨勯檮浠跺揩鐓?ID锛屼紭鍏堝鐢ㄥ緟鍙戦€侀檮浠剁殑鏈湴鏍囪瘑锛岄伩鍏嶅紩鍏?File 鎴栧唴閮ㄨ祫浜ф寚閽堛€?
*/
/** 生成可持久化的附件快照 ID,避免引入 File 或内部资产指针。 */
function getSnapshotAttachmentId(attachment: PendingAttachment, index: number): string {
const candidate = String(attachment.id || '')
.replace(/[\u0000-\u001f\u007f]/g, '')
@@ -0,0 +1,180 @@
/**
* features/shipping-notice/api/customer-master.api.ts
* 用途:货代客户主数据的管理 API,归属货代发货业务域。
* 依赖:requestJson、认证请求头、客户主数据类型。
* 逻辑:页面位于货代发货工作台,但所有写操作仍调用管理员受保护的后端契约。
*/
import { getAuthHeaders } from '@/shared/utils/auth';
import { BusinessError, requestJson, resolveLocalizedErrorMessage } from '@/shared/api/client';
import type {
ShippingCustomerIdentifier,
ShippingCustomerImportBatch,
ShippingCustomerLifecycleImpact,
ShippingCustomerLifecycleTimeline,
DeleteShippingCustomerRequest,
DeleteShippingCustomerResult,
MergeShippingCustomerRequest,
MergeShippingCustomerResult,
ShippingCustomerMergeImpact,
ShippingCustomerPage,
ShippingCustomerRow,
ShippingCustomerShadowItem,
ShippingCustomerShadowReport,
ShippingIdentifierFormState,
} from '../types/customer-master.types';
const auth = () => ({ headers: getAuthHeaders() });
const jsonAuth = () => ({ headers: { 'Content-Type': 'application/json', ...getAuthHeaders() } });
export interface ListShippingCustomersParams {
q?: string;
status?: string;
page?: number;
pageSize?: number;
}
/** 分页查询货代标准客户。 */
export const listShippingCustomers = (params: ListShippingCustomersParams = {}) => {
const qs = new URLSearchParams();
if (params.q?.trim()) qs.set('q', params.q.trim());
if (params.status) qs.set('status', params.status);
qs.set('page', String(params.page || 1));
qs.set('page_size', String(params.pageSize || 20));
return requestJson<ShippingCustomerPage>(`/api/admin/shipping-customers?${qs.toString()}`, auth());
};
export const getShippingCustomer = (id: number) =>
requestJson<ShippingCustomerRow>(`/api/admin/shipping-customers/${id}`, auth());
/** 查询客户永久删除前的完整引用影响;前端不得以业务单数自行推断。 */
export const getShippingCustomerLifecycleImpact = (id: number) =>
requestJson<ShippingCustomerLifecycleImpact>(`/api/admin/shipping-customers/${id}/lifecycle-impact`, auth());
/** 查询客户创建、变更、证据及归并的不可变治理时间线。 */
export const getShippingCustomerLifecycleTimeline = (id: number) =>
requestJson<ShippingCustomerLifecycleTimeline>(`/api/admin/shipping-customers/${id}/lifecycle-timeline`, auth());
/** 受控删除误建客户;服务端在提交时重新检查全部生命周期阻断引用。 */
export const deleteShippingCustomer = (id: number, payload: DeleteShippingCustomerRequest) =>
requestJson<DeleteShippingCustomerResult>(`/api/admin/shipping-customers/${id}`, {
method: 'DELETE', ...jsonAuth(), body: JSON.stringify(payload),
});
/** 预览客户归并时保留的历史引用和可迁移的未来识别配置。 */
export const getShippingCustomerMergeImpact = (sourceId: number, targetId: number) =>
requestJson<ShippingCustomerMergeImpact>(
`/api/admin/shipping-customers/${sourceId}/merge-impact?target_customer_id=${targetId}`,
auth(),
);
/** 归并重复客户;后端锁定双方并保留历史业务与业务号快照。 */
export const mergeShippingCustomer = (sourceId: number, payload: MergeShippingCustomerRequest) =>
requestJson<MergeShippingCustomerResult>(`/api/admin/shipping-customers/${sourceId}/merge`, {
method: 'POST', ...jsonAuth(), body: JSON.stringify(payload),
});
export const createShippingCustomer = (payload: Record<string, unknown>) =>
requestJson<ShippingCustomerRow>('/api/admin/shipping-customers', {
method: 'POST', ...jsonAuth(), body: JSON.stringify(payload),
});
export const updateShippingCustomer = (id: number, payload: Record<string, unknown>) =>
requestJson<ShippingCustomerRow>(`/api/admin/shipping-customers/${id}`, {
method: 'PUT', ...jsonAuth(), body: JSON.stringify(payload),
});
export const deactivateShippingCustomer = (id: number, reason: string) =>
requestJson<ShippingCustomerRow>(`/api/admin/shipping-customers/${id}/deactivate`, {
method: 'POST', ...jsonAuth(), body: JSON.stringify({ reason }),
});
export const createShippingCustomerIdentifier = (customerId: number, payload: ShippingIdentifierFormState) =>
requestJson<ShippingCustomerIdentifier>(`/api/admin/shipping-customers/${customerId}/identifiers`, {
method: 'POST', ...jsonAuth(), body: JSON.stringify(payload),
});
export const updateShippingCustomerIdentifier = (identifierId: number, payload: Record<string, unknown>) =>
requestJson<ShippingCustomerIdentifier>(`/api/admin/shipping-customer-identifiers/${identifierId}`, {
method: 'PUT', ...jsonAuth(), body: JSON.stringify(payload),
});
export const createShippingCustomerExternalRef = (
customerId: number,
payload: { source_system: string; customer_code: string },
) => requestJson(`/api/admin/shipping-customers/${customerId}/external-refs`, {
method: 'POST', ...jsonAuth(), body: JSON.stringify(payload),
});
export const createShippingCustomerSite = (
customerId: number,
payload: { site_name: string; site_code: string; address?: string; city?: string; country?: string; remark?: string },
) => requestJson(`/api/admin/shipping-customers/${customerId}/sites`, {
method: 'POST', ...jsonAuth(), body: JSON.stringify(payload),
});
export const uploadShippingCustomerImport = (file: File, sourceSystem: string) => {
const body = new FormData();
body.append('file', file);
body.append('source_system', sourceSystem);
return requestJson<ShippingCustomerImportBatch>('/api/admin/shipping-customer-imports', {
method: 'POST', headers: getAuthHeaders(), body,
});
};
export const decideShippingCustomerImportRow = (
rowId: number,
payload: { action: string; target_customer_id?: number; note?: string },
) => requestJson(`/api/admin/shipping-customer-import-rows/${rowId}/decision`, {
method: 'PUT', ...jsonAuth(), body: JSON.stringify(payload),
});
export const publishShippingCustomerImport = (batchId: number) =>
requestJson<ShippingCustomerImportBatch>(`/api/admin/shipping-customer-imports/${batchId}/publish`, {
method: 'POST', ...auth(),
});
/** 下载需要管理员权限的二进制文件,并保持统一 BusinessError 契约。 */
const downloadCustomerMasterFile = async (url: string, fallbackName: string): Promise<void> => {
const response = await fetch(url, { headers: getAuthHeaders() });
if (!response.ok) {
const payload = await response.json().catch(() => null);
const code = payload?.error?.code || 'SYSTEM.HTTP_ERROR';
throw new BusinessError({
message: resolveLocalizedErrorMessage(code, payload?.error?.message || `HTTP ${response.status}`),
code,
details: payload?.error?.details || {},
requestId: payload?.request_id,
status: response.status,
});
}
const blob = await response.blob();
const disposition = response.headers.get('Content-Disposition') || '';
const encodedName = disposition.match(/filename\*=UTF-8''([^;]+)/i)?.[1];
const plainName = disposition.match(/filename="?([^";]+)"?/i)?.[1];
const filename = encodedName ? decodeURIComponent(encodedName) : plainName || fallbackName;
const objectUrl = URL.createObjectURL(blob);
const anchor = document.createElement('a');
anchor.href = objectUrl;
anchor.download = filename;
anchor.click();
URL.revokeObjectURL(objectUrl);
};
export const downloadShippingCustomerImportTemplate = () =>
downloadCustomerMasterFile('/api/admin/shipping-customers/import-template', 'shipping_customer_import_template.xlsx');
export const downloadShippingCustomerReconciliation = (batchId: number, batchNo: string) =>
downloadCustomerMasterFile(
`/api/admin/shipping-customer-imports/${batchId}/reconciliation`,
`${batchNo}_reconciliation.csv`,
);
export const getShippingCustomerShadowReport = (limit = 100) =>
requestJson<ShippingCustomerShadowReport>(`/api/admin/shipping-customer-shadow-report?limit=${limit}`, auth());
export const labelShippingCustomerShadowResolution = (resolutionId: number, customerId: number) =>
requestJson<ShippingCustomerShadowItem>(
`/api/admin/shipping-customer-shadow-resolutions/${resolutionId}/label`,
{ method: 'PUT', ...jsonAuth(), body: JSON.stringify({ customer_id: customerId }) },
);
@@ -1,5 +1,5 @@
<!--
features/admin/modules/shipping-customers/ShippingCustomersPage.vue
features/shipping-notice/customers/ShippingCustomersPage.vue
用途:货代客户主数据管理入口,提供列表、识别证据和期初导入工作台。
依赖:useShippingCustomersAdmin、PaginationBar、三个域内组件。
逻辑:路由加载后查询客户;页面只组合展示与事件,业务状态由 composable 管理。
@@ -7,12 +7,15 @@
<script setup lang="ts">
import { onMounted, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { Edit, FileSpreadsheet, Fingerprint, Plus, Search, UserX } from 'lucide-vue-next';
import { Edit, FileSpreadsheet, Fingerprint, GitMerge, History, Plus, Search, Trash2, UserX } from 'lucide-vue-next';
import CustomerDeleteDialog from './components/CustomerDeleteDialog.vue';
import CustomerMergeDialog from './components/CustomerMergeDialog.vue';
import PaginationBar from '@/shared/components/PaginationBar.vue';
import CustomerFormModal from './components/CustomerFormModal.vue';
import CustomerIdentifiersPanel from './components/CustomerIdentifiersPanel.vue';
import CustomerImportDialog from './components/CustomerImportDialog.vue';
import CustomerShadowQualityPanel from './components/CustomerShadowQualityPanel.vue';
import CustomerLifecyclePanel from './components/CustomerLifecyclePanel.vue';
import { useShippingCustomersAdmin } from './composables/useShippingCustomersAdmin';
const { t } = useI18n();
@@ -42,6 +45,7 @@ onMounted(() => { void Promise.all([admin.loadCustomers(), admin.loadShadowRepor
<option value="">{{ t('admin.shippingCustomers.status.all') }}</option>
<option value="active">{{ t('admin.shippingCustomers.status.active') }}</option>
<option value="inactive">{{ t('admin.shippingCustomers.status.inactive') }}</option>
<option value="merged">{{ t('admin.shippingCustomers.status.merged') }}</option>
</select>
<button type="button" class="btn-ghost" @click="admin.searchCustomers">{{ t('admin.shippingCustomers.search') }}</button>
</div>
@@ -67,8 +71,11 @@ onMounted(() => { void Promise.all([admin.loadCustomers(), admin.loadShadowRepor
<td class="px-5 py-4 text-sm">{{ customer.case_count }}</td>
<td class="px-5 py-4"><div class="flex justify-end gap-1">
<button type="button" class="p-2 text-indigo-600 hover:bg-indigo-50 rounded-lg" :title="t('admin.shippingCustomers.identifiers.title')" @click="admin.openIdentifiers(customer)"><Fingerprint class="w-4 h-4" /></button>
<button type="button" class="p-2 text-slate-600 hover:bg-slate-100 rounded-lg" :title="t('admin.shippingCustomers.lifecycle.open')" @click="admin.openLifecycleTimeline(customer)"><History class="w-4 h-4" /></button>
<button type="button" class="p-2 text-indigo-600 hover:bg-indigo-50 rounded-lg" :title="t('admin.edit')" @click="admin.openEditCustomer(customer)"><Edit class="w-4 h-4" /></button>
<button v-if="customer.status === 'active'" type="button" class="p-2 text-red-600 hover:bg-red-50 rounded-lg" :title="t('admin.shippingCustomers.deactivate')" @click="admin.deactivateCustomer(customer)"><UserX class="w-4 h-4" /></button>
<button v-if="customer.status !== 'merged'" type="button" class="p-2 text-amber-700 hover:bg-amber-50 rounded-lg" :title="t('admin.shippingCustomers.mergeDialog.open')" @click="admin.openMergeCustomer(customer)"><GitMerge class="w-4 h-4" /></button>
<button type="button" class="p-2 text-red-700 hover:bg-red-50 rounded-lg" :title="t('admin.shippingCustomers.deleteDialog.open')" @click="admin.openDeleteCustomer(customer)"><Trash2 class="w-4 h-4" /></button>
</div></td>
</tr>
</tbody>
@@ -80,7 +87,10 @@ onMounted(() => { void Promise.all([admin.loadCustomers(), admin.loadShadowRepor
<CustomerShadowQualityPanel :report="admin.shadowReport.value" :customers="admin.importTargetCustomers.value.length ? admin.importTargetCustomers.value : admin.customers.value" :loading="admin.isShadowLoading.value" @refresh="admin.loadShadowReport" @label="admin.labelShadowResolution" />
<CustomerFormModal :visible="admin.showCustomerModal.value" :form="admin.customerForm.value" :is-saving="admin.isSaving.value" @close="admin.closeCustomerModal" @save="admin.saveCustomer" />
<CustomerIdentifiersPanel :visible="admin.showIdentifiersPanel.value" :customer="admin.selectedCustomer.value" :is-saving="admin.isSaving.value" @close="admin.showIdentifiersPanel.value = false" @add="admin.addIdentifier" @update="admin.updateIdentifier" />
<CustomerIdentifiersPanel :visible="admin.showIdentifiersPanel.value" :customer="admin.selectedCustomer.value" :is-saving="admin.isSaving.value" @close="admin.showIdentifiersPanel.value = false" @add="admin.addIdentifier" @update="admin.updateIdentifier" @add-external-ref="admin.addExternalRef" @add-site="admin.addSite" />
<CustomerImportDialog :visible="admin.showImportDialog.value" :batch="admin.importBatch.value" :customers="admin.importTargetCustomers.value" :is-importing="admin.isImporting.value" @close="admin.showImportDialog.value = false" @upload="admin.uploadImport" @decide="admin.decideImportRow" @publish="admin.publishImport" @template="admin.downloadTemplate" @reconciliation="admin.downloadReconciliation" />
<CustomerDeleteDialog :visible="admin.showDeleteDialog.value" :customer="admin.deleteCustomer.value" :impact="admin.deleteImpact.value" :is-saving="admin.isSaving.value" @close="admin.closeDeleteCustomer" @confirm="admin.confirmDeleteCustomer" />
<CustomerLifecyclePanel :visible="admin.showLifecyclePanel.value" :customer="admin.lifecycleCustomer.value" :timeline="admin.lifecycleTimeline.value" @close="admin.closeLifecycleTimeline" />
<CustomerMergeDialog :visible="admin.showMergeDialog.value" :source="admin.mergeCustomer.value" :impact="admin.mergeImpact.value" :customers="admin.importTargetCustomers.value" :is-saving="admin.isSaving.value" @close="admin.closeMergeCustomer" @preview="admin.previewMergeCustomer" @confirm="admin.confirmMergeCustomer" />
</section>
</template>
@@ -0,0 +1,81 @@
<!--
features/shipping-notice/customers/components/CustomerDeleteDialog.vue
用途:展示客户永久删除预检,并收集简码二次确认和删除原因。
依赖:customer-master.types、vue-i18n。
逻辑:有任何服务端生命周期阻断项时不暴露确认按钮;提交仍由父级调用后端原子校验。
-->
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import type { ShippingCustomerLifecycleImpact, ShippingCustomerRow } from '@/features/shipping-notice/types/customer-master.types';
const props = defineProps<{
visible: boolean;
customer: ShippingCustomerRow | null;
impact: ShippingCustomerLifecycleImpact | null;
isSaving: boolean;
}>();
const emit = defineEmits<{ close: []; confirm: [confirmationShortCode: string, reason: string] }>();
const { t } = useI18n();
const confirmationShortCode = ref('');
const reason = ref('');
const blockerEntries = computed(() => Object.entries(props.impact?.blockers || {}).filter(([, count]) => count > 0));
watch(() => props.visible, (visible) => {
if (visible) {
confirmationShortCode.value = '';
reason.value = '';
}
});
/** 仅在预检无阻断且二次确认信息完整时允许发起删除请求。 */
const canSubmit = computed(() => Boolean(
props.impact?.can_delete
&& confirmationShortCode.value.trim()
&& reason.value.trim()
&& !props.isSaving,
));
</script>
<template>
<div v-if="visible" class="admin-modal-overlay animate-fade-in items-center">
<div class="admin-modal-panel max-w-xl max-h-[92vh] scale-100">
<div class="px-6 py-5 border-b border-subtle">
<h3 class="section-title text-red-700">{{ t('admin.shippingCustomers.deleteDialog.title') }}</h3>
<p class="section-desc mt-1">{{ t('admin.shippingCustomers.deleteDialog.subtitle') }}</p>
</div>
<div class="px-6 py-5 space-y-4 overflow-y-auto">
<div v-if="!impact" class="text-sm text-muted">{{ t('admin.shippingCustomers.deleteDialog.loading') }}</div>
<template v-else>
<div class="rounded-lg border border-default bg-surface-secondary p-4 text-sm">
<div class="font-medium text-primary">{{ impact.customer.standard_name }} <span class="font-mono">({{ impact.customer.short_code }})</span></div>
<div class="mt-1 text-muted">{{ t('admin.shippingCustomers.deleteDialog.identifiers', { count: impact.cascade.identifiers }) }}</div>
</div>
<div v-if="!impact.can_delete" class="rounded-lg border border-red-200 bg-red-50 p-4">
<div class="font-medium text-red-700">{{ t('admin.shippingCustomers.deleteDialog.blocked') }}</div>
<ul class="mt-2 space-y-1 text-sm text-red-700">
<li v-for="[key, count] in blockerEntries" :key="key">{{ t(`admin.shippingCustomers.deleteDialog.blockers.${key}`) }}: {{ count }}</li>
</ul>
<p class="mt-3 text-sm text-red-700">{{ t('admin.shippingCustomers.deleteDialog.blockedHint') }}</p>
</div>
<template v-else>
<p class="text-sm text-red-700">{{ t('admin.shippingCustomers.deleteDialog.warning') }}</p>
<label class="block space-y-1.5">
<span class="label-field">{{ t('admin.shippingCustomers.deleteDialog.confirmationShortCode', { shortCode: impact.customer.short_code }) }}</span>
<input v-model="confirmationShortCode" class="input-field text-sm uppercase" maxlength="6" />
</label>
<label class="block space-y-1.5">
<span class="label-field">{{ t('admin.shippingCustomers.deleteDialog.reason') }}</span>
<textarea v-model="reason" rows="3" class="input-field text-sm resize-y" />
</label>
</template>
</template>
</div>
<div class="admin-modal-footer">
<button type="button" class="btn-ghost" @click="emit('close')">{{ t('admin.cancel') }}</button>
<button v-if="impact?.can_delete" type="button" class="btn-danger" :disabled="!canSubmit" @click="emit('confirm', confirmationShortCode, reason)">{{ isSaving ? t('admin.shippingCustomers.saving') : t('admin.shippingCustomers.deleteDialog.confirm') }}</button>
</div>
</div>
</div>
</template>
@@ -1,12 +1,12 @@
<!--
features/admin/modules/shipping-customers/components/CustomerFormModal.vue
features/shipping-notice/customers/components/CustomerFormModal.vue
用途:创建或编辑货代标准客户。
依赖:shipping-customer.types、admin 通用表单样式、vue-i18n。
依赖:customer-master.types、admin 通用表单样式、vue-i18n。
逻辑:父页面传入可变表单;提交事件交由 useShippingCustomersAdmin 保存。
-->
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import type { ShippingCustomerFormState } from '@/features/admin/types/shipping-customer.types';
import type { ShippingCustomerFormState } from '@/features/shipping-notice/types/customer-master.types';
defineProps<{ visible: boolean; form: ShippingCustomerFormState; isSaving: boolean }>();
const emit = defineEmits<{ close: []; save: [] }>();
@@ -42,6 +42,10 @@ const { t } = useI18n();
<span class="label-field">{{ t('admin.shippingCustomers.fields.remark') }}</span>
<textarea v-model="form.remark" rows="3" class="input-field text-sm resize-y" />
</label>
<label v-if="form.id" class="block space-y-1.5">
<span class="label-field">{{ t('admin.shippingCustomers.fields.changeReason') }}</span>
<textarea v-model="form.reason" rows="2" class="input-field text-sm resize-y" :placeholder="t('admin.shippingCustomers.fields.changeReasonHint')" />
</label>
</div>
<div class="admin-modal-footer">
<button type="button" class="btn-ghost" @click="emit('close')">{{ t('admin.cancel') }}</button>
@@ -1,7 +1,7 @@
<!--
features/admin/modules/shipping-customers/components/CustomerIdentifiersPanel.vue
features/shipping-notice/customers/components/CustomerIdentifiersPanel.vue
用途:展示、新增、审核和停用客户识别证据。
依赖:shipping-customer.types、vue-i18n。
依赖:customer-master.types、vue-i18n。
逻辑:所有修改通过事件上送 composable;本组件不直接访问 API。
-->
<script setup lang="ts">
@@ -10,21 +10,27 @@ import { useI18n } from 'vue-i18n';
import type {
ShippingCustomerRow,
ShippingIdentifierFormState,
} from '@/features/admin/types/shipping-customer.types';
import { createEmptyShippingIdentifierForm } from '@/features/admin/types/shipping-customer.types';
} from '@/features/shipping-notice/types/customer-master.types';
import { createEmptyShippingIdentifierForm } from '@/features/shipping-notice/types/customer-master.types';
const props = defineProps<{ visible: boolean; customer: ShippingCustomerRow | null; isSaving: boolean }>();
const emit = defineEmits<{
close: [];
add: [form: ShippingIdentifierFormState];
update: [id: number, payload: Record<string, unknown>];
addExternalRef: [payload: { source_system: string; customer_code: string }];
addSite: [payload: { site_name: string; site_code: string; address?: string; city?: string; country?: string; remark?: string }];
}>();
const { t } = useI18n();
const form = ref(createEmptyShippingIdentifierForm());
const externalRefForm = ref({ source_system: '', customer_code: '' });
const siteForm = ref({ site_name: '', site_code: '', address: '', city: '', country: '', remark: '' });
/** 切换客户或关闭面板时清空未提交证据。 */
watch(() => [props.visible, props.customer?.id], () => {
form.value = createEmptyShippingIdentifierForm();
externalRefForm.value = { source_system: '', customer_code: '' };
siteForm.value = { site_name: '', site_code: '', address: '', city: '', country: '', remark: '' };
});
/** 提交证据后重置表单,实际保存由父级处理。 */
@@ -32,6 +38,18 @@ const submit = (): void => {
emit('add', { ...form.value });
form.value = createEmptyShippingIdentifierForm();
};
/** 提交来源系统客户编码;客户简称仍由客户基本信息统一维护。 */
const submitExternalRef = (): void => {
emit('addExternalRef', { ...externalRefForm.value });
externalRefForm.value = { source_system: '', customer_code: '' };
};
/** 提交送货站点;站点用于 Ship-to 匹配,不创建新的账款客户。 */
const submitSite = (): void => {
emit('addSite', { ...siteForm.value });
siteForm.value = { site_name: '', site_code: '', address: '', city: '', country: '', remark: '' };
};
</script>
<template>
@@ -45,6 +63,31 @@ const submit = (): void => {
<button type="button" class="btn-ghost" @click="emit('close')">{{ t('admin.close') }}</button>
</div>
<div class="px-6 py-5 overflow-y-auto space-y-6">
<section class="rounded-xl border border-default p-4 space-y-4">
<div><h4 class="font-semibold text-primary">{{ t('admin.shippingCustomers.externalRefs.title') }}</h4><p class="text-xs text-muted mt-1">{{ t('admin.shippingCustomers.externalRefs.hint') }}</p></div>
<div v-if="customer.external_refs?.length" class="flex flex-wrap gap-2"><span v-for="item in customer.external_refs" :key="item.id" class="badge">{{ item.source_system }} · {{ item.customer_code }}</span></div>
<p v-else class="text-sm text-muted">{{ t('admin.shippingCustomers.externalRefs.empty') }}</p>
<div class="grid grid-cols-1 md:grid-cols-[1fr_1fr_auto] gap-3">
<input v-model="externalRefForm.source_system" class="input-field text-sm" :placeholder="t('admin.shippingCustomers.externalRefs.sourceSystem')" />
<input v-model="externalRefForm.customer_code" class="input-field text-sm" :placeholder="t('admin.shippingCustomers.externalRefs.customerCode')" />
<button type="button" class="btn-primary" :disabled="isSaving || !externalRefForm.source_system.trim() || !externalRefForm.customer_code.trim()" @click="submitExternalRef">{{ t('admin.add') }}</button>
</div>
</section>
<section class="rounded-xl border border-default p-4 space-y-4">
<div><h4 class="font-semibold text-primary">{{ t('admin.shippingCustomers.sites.title') }}</h4><p class="text-xs text-muted mt-1">{{ t('admin.shippingCustomers.sites.hint') }}</p></div>
<div v-if="customer.sites?.length" class="grid gap-2"><div v-for="site in customer.sites" :key="site.id" class="rounded-lg bg-surface-soft p-3"><div class="font-medium text-primary">{{ site.site_name }} · {{ site.site_code }}</div><div class="text-xs text-muted mt-1">{{ [site.address, site.city, site.country].filter(Boolean).join(' · ') || '-' }}</div></div></div>
<p v-else class="text-sm text-muted">{{ t('admin.shippingCustomers.sites.empty') }}</p>
<div class="grid grid-cols-1 md:grid-cols-2 gap-3">
<input v-model="siteForm.site_name" class="input-field text-sm" :placeholder="t('admin.shippingCustomers.sites.siteName')" />
<input v-model="siteForm.site_code" class="input-field text-sm" :placeholder="t('admin.shippingCustomers.sites.siteCode')" />
<input v-model="siteForm.address" class="input-field text-sm md:col-span-2" :placeholder="t('admin.shippingCustomers.sites.address')" />
<input v-model="siteForm.city" class="input-field text-sm" :placeholder="t('admin.shippingCustomers.sites.city')" />
<input v-model="siteForm.country" class="input-field text-sm" :placeholder="t('admin.shippingCustomers.sites.country')" />
</div>
<div class="flex justify-end"><button type="button" class="btn-primary" :disabled="isSaving || !siteForm.site_name.trim() || !siteForm.site_code.trim()" @click="submitSite">{{ t('admin.add') }}</button></div>
</section>
<div class="rounded-xl border border-default overflow-x-auto">
<table class="admin-table min-w-[780px]">
<thead><tr>
@@ -1,13 +1,13 @@
<!--
features/admin/modules/shipping-customers/components/CustomerImportDialog.vue
features/shipping-notice/customers/components/CustomerImportDialog.vue
用途:上传期初客户 Excel、查看预检结果、处理 warning、发布并下载对账。
依赖:shipping-customer.types、vue-i18n。
依赖:customer-master.types、vue-i18n。
逻辑:组件只收集文件和行级决定;上传、发布与下载均委托父级 composable。
-->
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import type { ShippingCustomerImportBatch, ShippingCustomerImportRow, ShippingCustomerRow } from '@/features/admin/types/shipping-customer.types';
import type { ShippingCustomerImportBatch, ShippingCustomerImportRow, ShippingCustomerRow } from '@/features/shipping-notice/types/customer-master.types';
const props = defineProps<{
visible: boolean;
@@ -0,0 +1,59 @@
<!--
features/shipping-notice/customers/components/CustomerLifecyclePanel.vue
用途:展示单个货代客户不可变的生命周期治理审计。
依赖:customer-master.types、vue-i18n。
逻辑:由客户主数据页拉取时间线后传入;仅渲染快照,不触发任何客户写操作。
-->
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
import type { ShippingCustomerLifecycleTimeline, ShippingCustomerRow } from '@/features/shipping-notice/types/customer-master.types';
defineProps<{ visible: boolean; customer: ShippingCustomerRow | null; timeline: ShippingCustomerLifecycleTimeline | null }>();
const emit = defineEmits<{ close: [] }>();
const { t } = useI18n();
/** 将不同事件的变更明细压缩成易读文本,完整结构仍可由审计 API 获取。 */
const changeSummary = (detail: Record<string, unknown>): string => {
const changes = detail.changes;
if (!changes || typeof changes !== 'object') return '-';
return Object.entries(changes as Record<string, { before?: unknown; after?: unknown }>)
.map(([key, value]) => `${key}: ${String(value.before ?? '-')} → ${String(value.after ?? '-')}`)
.join(';');
};
</script>
<template>
<div v-if="visible && customer" class="admin-modal-overlay animate-fade-in items-center">
<div class="admin-modal-panel max-w-5xl max-h-[92vh] scale-100">
<div class="px-6 py-5 border-b border-subtle flex items-start justify-between gap-4">
<div>
<h3 class="section-title">{{ t('admin.shippingCustomers.lifecycle.title') }}</h3>
<p class="section-desc mt-1">{{ customer.standard_name }} · {{ customer.short_code }}</p>
</div>
<button type="button" class="btn-ghost" @click="emit('close')">{{ t('admin.close') }}</button>
</div>
<div class="px-6 py-5 overflow-y-auto">
<div v-if="!timeline" class="py-12 text-center text-sm text-muted">{{ t('admin.shippingCustomers.lifecycle.loading') }}</div>
<div v-else class="overflow-x-auto rounded-xl border border-default">
<table class="admin-table min-w-[760px]">
<thead><tr>
<th class="px-4 py-3 text-left">{{ t('admin.shippingCustomers.lifecycle.time') }}</th>
<th class="px-4 py-3 text-left">{{ t('admin.shippingCustomers.lifecycle.event') }}</th>
<th class="px-4 py-3 text-left">{{ t('admin.shippingCustomers.lifecycle.reason') }}</th>
<th class="px-4 py-3 text-left">{{ t('admin.shippingCustomers.lifecycle.change') }}</th>
</tr></thead>
<tbody>
<tr v-if="!timeline.items.length"><td colspan="4" class="admin-table-empty px-4">{{ t('admin.shippingCustomers.lifecycle.empty') }}</td></tr>
<tr v-for="event in timeline.items" :key="event.id">
<td class="px-4 py-3 text-sm text-muted">{{ event.created_at || '-' }}</td>
<td class="px-4 py-3 text-sm">{{ t(`admin.shippingCustomers.lifecycle.events.${event.event_type}`) }}</td>
<td class="px-4 py-3 text-sm">{{ event.reason || '-' }}</td>
<td class="px-4 py-3 text-sm break-all">{{ changeSummary(event.detail) }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</template>
@@ -0,0 +1,66 @@
<!--
features/shipping-notice/customers/components/CustomerMergeDialog.vue
用途:预览并确认将重复客户归并到启用目标客户。
依赖:customer-master.types、vue-i18n。
逻辑:展示历史保留与未来配置迁移边界;提交必须输入源客户简码和合并原因。
-->
<script setup lang="ts">
import { computed, ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import type { ShippingCustomerMergeImpact, ShippingCustomerRow } from '@/features/shipping-notice/types/customer-master.types';
const props = defineProps<{
visible: boolean;
source: ShippingCustomerRow | null;
impact: ShippingCustomerMergeImpact | null;
customers: ShippingCustomerRow[];
isSaving: boolean;
}>();
const emit = defineEmits<{
close: [];
preview: [targetCustomerId: number];
confirm: [targetCustomerId: number, confirmationShortCode: string, reason: string];
}>();
const { t } = useI18n();
const targetCustomerId = ref<number | null>(null);
const confirmationShortCode = ref('');
const reason = ref('');
const targetOptions = computed(() => props.customers.filter((item) => item.id !== props.source?.id && item.status === 'active'));
watch(() => props.visible, (visible) => {
if (visible) {
targetCustomerId.value = null;
confirmationShortCode.value = '';
reason.value = '';
}
});
/** 选择目标后再调用服务端预检,阻止在未确认归并边界时提交。 */
const preview = (): void => {
if (targetCustomerId.value) emit('preview', targetCustomerId.value);
};
const canSubmit = computed(() => Boolean(
targetCustomerId.value && props.impact && confirmationShortCode.value.trim() && reason.value.trim() && !props.isSaving,
));
</script>
<template>
<div v-if="visible" class="admin-modal-overlay animate-fade-in items-center">
<div class="admin-modal-panel max-w-xl max-h-[92vh] scale-100">
<div class="px-6 py-5 border-b border-subtle"><h3 class="section-title">{{ t('admin.shippingCustomers.mergeDialog.title') }}</h3><p class="section-desc mt-1">{{ t('admin.shippingCustomers.mergeDialog.subtitle') }}</p></div>
<div class="px-6 py-5 space-y-4 overflow-y-auto">
<div v-if="source" class="rounded-lg border border-default bg-surface-secondary p-4 text-sm"><span class="text-muted">{{ t('admin.shippingCustomers.mergeDialog.source') }}</span><div class="font-medium text-primary mt-1">{{ source.standard_name }} <span class="font-mono">({{ source.short_code }})</span></div></div>
<label class="block space-y-1.5"><span class="label-field">{{ t('admin.shippingCustomers.mergeDialog.target') }}</span><select v-model="targetCustomerId" class="input-field text-sm" @change="preview"><option :value="null">{{ t('admin.shippingCustomers.mergeDialog.chooseTarget') }}</option><option v-for="customer in targetOptions" :key="customer.id" :value="customer.id">{{ customer.standard_name }} ({{ customer.short_code }})</option></select></label>
<template v-if="impact">
<div class="rounded-lg border border-default p-4 text-sm"><div class="font-medium text-primary">{{ t('admin.shippingCustomers.mergeDialog.historyTitle') }}</div><p class="mt-1 text-muted">{{ t('admin.shippingCustomers.mergeDialog.historyHint') }}</p><div class="mt-2 text-muted">{{ t('admin.shippingCustomers.mergeDialog.historyCount', { count: Object.values(impact.historical_references).reduce((sum, value) => sum + value, 0) }) }}</div></div>
<div class="rounded-lg border border-default p-4 text-sm"><div class="font-medium text-primary">{{ t('admin.shippingCustomers.mergeDialog.migrateTitle') }}</div><div class="mt-2 grid grid-cols-3 gap-2 text-center"><div><div class="text-lg font-semibold">{{ impact.migrate.identifiers }}</div><div class="text-xs text-muted">{{ t('admin.shippingCustomers.mergeDialog.identifiers') }}</div></div><div><div class="text-lg font-semibold">{{ impact.migrate.duplicate_identifiers }}</div><div class="text-xs text-muted">{{ t('admin.shippingCustomers.mergeDialog.duplicates') }}</div></div><div><div class="text-lg font-semibold">{{ impact.migrate.external_references }}</div><div class="text-xs text-muted">{{ t('admin.shippingCustomers.mergeDialog.references') }}</div></div></div></div>
<p class="text-sm text-amber-700">{{ t('admin.shippingCustomers.mergeDialog.warning') }}</p>
<label class="block space-y-1.5"><span class="label-field">{{ t('admin.shippingCustomers.mergeDialog.confirmationShortCode', { shortCode: impact.source.short_code }) }}</span><input v-model="confirmationShortCode" class="input-field text-sm uppercase" maxlength="6" /></label>
<label class="block space-y-1.5"><span class="label-field">{{ t('admin.shippingCustomers.mergeDialog.reason') }}</span><textarea v-model="reason" rows="3" class="input-field text-sm resize-y" /></label>
</template>
</div>
<div class="admin-modal-footer"><button type="button" class="btn-ghost" @click="emit('close')">{{ t('admin.cancel') }}</button><button type="button" class="btn-primary" :disabled="!canSubmit" @click="targetCustomerId && emit('confirm', targetCustomerId, confirmationShortCode, reason)">{{ isSaving ? t('admin.shippingCustomers.saving') : t('admin.shippingCustomers.mergeDialog.confirm') }}</button></div>
</div>
</div>
</template>
@@ -1,13 +1,13 @@
<!--
features/admin/modules/shipping-customers/components/CustomerShadowQualityPanel.vue
features/shipping-notice/customers/components/CustomerShadowQualityPanel.vue
用途:展示客户影子识别分布、自动确认/纠错指标、人工标注准确率和最近样本。
依赖:shipping-customer.types、vue-i18n。
依赖:customer-master.types、vue-i18n。
逻辑:展示质量卡片、客户事件审计与真值标签;不调用客户绑定、编号或任务接口。
-->
<script setup lang="ts">
import { ref, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import type { ShippingCustomerRow, ShippingCustomerShadowReport } from '@/features/admin/types/shipping-customer.types';
import type { ShippingCustomerRow, ShippingCustomerShadowReport } from '@/features/shipping-notice/types/customer-master.types';
const props = defineProps<{ report: ShippingCustomerShadowReport | null; customers: ShippingCustomerRow[]; loading: boolean }>();
const emit = defineEmits<{ refresh: []; label: [resolutionId: number, customerId: number] }>();
@@ -54,6 +54,18 @@ const eventBusinessChange = (detail: Record<string, unknown>): string => {
['corrected', report.auto_resolution?.corrected_task_count || 0]
]" :key="String(card[0])" class="rounded-xl border border-default p-3"><div class="text-xs text-muted">{{ t(`admin.shippingCustomers.shadow.cards.${card[0]}`) }}</div><div class="text-xl font-semibold">{{ card[1] }}</div></div>
</div>
<div v-if="report?.auto_resolution?.quality_gate" class="rounded-xl border p-4" :class="report.auto_resolution.quality_gate.is_eligible ? 'border-emerald-300 bg-emerald-50/50' : 'border-amber-300 bg-amber-50/50'">
<div class="font-semibold text-primary">{{ t('admin.shippingCustomers.shadow.gate.title') }}</div>
<div class="mt-1 text-sm text-secondary">{{ t(`admin.shippingCustomers.shadow.gate.statuses.${report.auto_resolution.quality_gate.status}`) }}</div>
<div class="mt-2 text-xs text-muted">
{{ t('admin.shippingCustomers.shadow.gate.metrics', {
samples: report.auto_resolution.quality_gate.labeled_sample_count,
minSamples: report.auto_resolution.quality_gate.min_labeled_samples,
accuracy: report.auto_resolution.quality_gate.accuracy == null ? '-' : `${(report.auto_resolution.quality_gate.accuracy * 100).toFixed(1)}%`,
minAccuracy: `${(report.auto_resolution.quality_gate.min_accuracy * 100).toFixed(1)}%`,
}) }}
</div>
</div>
<div v-if="report" class="overflow-x-auto rounded-xl border border-default">
<table class="admin-table min-w-[900px]"><thead><tr>
<th class="px-3 py-3 text-left">{{ t('admin.shippingCustomers.shadow.sample') }}</th><th class="px-3 py-3 text-left">{{ t('admin.shippingCustomers.shadow.status') }}</th><th class="px-3 py-3 text-left">{{ t('admin.shippingCustomers.shadow.topCandidate') }}</th><th class="px-3 py-3 text-left">{{ t('admin.shippingCustomers.shadow.manualLabel') }}</th>
@@ -1,7 +1,7 @@
/**
* features/admin/modules/shipping-customers/composables/useShippingCustomersAdmin.ts
* features/shipping-notice/customers/composables/useShippingCustomersAdmin.ts
* 用途:编排货代客户列表、详情、识别证据、期初导入与发布状态。
* 依赖:admin.api、shipping-customer.types、BusinessError、useMessage。
* 依赖:customer-master.api、customer-master.types、BusinessError、useMessage。
* 逻辑:ShippingCustomersPage 与子组件共享本 composable 暴露的状态和动作。
*/
@@ -9,32 +9,42 @@ import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
import {
createShippingCustomer,
createShippingCustomerExternalRef,
createShippingCustomerIdentifier,
createShippingCustomerSite,
deleteShippingCustomer,
deactivateShippingCustomer,
decideShippingCustomerImportRow,
downloadShippingCustomerImportTemplate,
downloadShippingCustomerReconciliation,
getShippingCustomer,
getShippingCustomerLifecycleImpact,
getShippingCustomerLifecycleTimeline,
getShippingCustomerMergeImpact,
getShippingCustomerShadowReport,
listShippingCustomers,
labelShippingCustomerShadowResolution,
mergeShippingCustomer,
publishShippingCustomerImport,
updateShippingCustomer,
updateShippingCustomerIdentifier,
uploadShippingCustomerImport,
} from '@/features/admin/api/admin.api';
} from '@/features/shipping-notice/api/customer-master.api';
import type {
ShippingCustomerFormState,
ShippingCustomerLifecycleImpact,
ShippingCustomerLifecycleTimeline,
ShippingCustomerMergeImpact,
ShippingCustomerImportBatch,
ShippingCustomerImportRow,
ShippingCustomerRow,
ShippingCustomerShadowReport,
ShippingIdentifierFormState,
} from '@/features/admin/types/shipping-customer.types';
} from '@/features/shipping-notice/types/customer-master.types';
import {
createEmptyShippingCustomerForm,
shippingCustomerToForm,
} from '@/features/admin/types/shipping-customer.types';
} from '@/features/shipping-notice/types/customer-master.types';
import { BusinessError } from '@/shared/api/client';
import { useMessage } from '@/shared/composables/useMessage';
@@ -47,6 +57,12 @@ export function useShippingCustomersAdmin() {
const customerForm = ref<ShippingCustomerFormState>(createEmptyShippingCustomerForm());
const importBatch = ref<ShippingCustomerImportBatch | null>(null);
const shadowReport = ref<ShippingCustomerShadowReport | null>(null);
const deleteCustomer = ref<ShippingCustomerRow | null>(null);
const deleteImpact = ref<ShippingCustomerLifecycleImpact | null>(null);
const lifecycleCustomer = ref<ShippingCustomerRow | null>(null);
const lifecycleTimeline = ref<ShippingCustomerLifecycleTimeline | null>(null);
const mergeCustomer = ref<ShippingCustomerRow | null>(null);
const mergeImpact = ref<ShippingCustomerMergeImpact | null>(null);
const searchQuery = ref('');
const statusFilter = ref('');
const page = ref(1);
@@ -60,6 +76,9 @@ export function useShippingCustomersAdmin() {
const showCustomerModal = ref(false);
const showIdentifiersPanel = ref(false);
const showImportDialog = ref(false);
const showDeleteDialog = ref(false);
const showLifecyclePanel = ref(false);
const showMergeDialog = ref(false);
/** 分页加载全部客户选项,供导入冲突和影子真值标签共用。 */
const loadAllCustomerOptions = async (): Promise<void> => {
@@ -140,6 +159,7 @@ export function useShippingCustomersAdmin() {
short_code: form.short_code.trim().toUpperCase(),
status: form.status,
remark: form.remark.trim(),
reason: form.reason.trim(),
};
if (form.id) await updateShippingCustomer(form.id, payload);
else await createShippingCustomer(payload);
@@ -156,14 +176,138 @@ export function useShippingCustomersAdmin() {
/** 停用客户并保留历史业务引用。 */
const deactivateCustomer = async (customer: ShippingCustomerRow): Promise<void> => {
if (!window.confirm(t('admin.shippingCustomers.confirmDeactivate', { name: customer.standard_name }))) return;
const reason = window.prompt(t('admin.shippingCustomers.prompts.deactivateReason'))?.trim();
if (!reason) return;
try {
await deactivateShippingCustomer(customer.id);
await deactivateShippingCustomer(customer.id, reason);
await loadCustomers();
} catch (error) {
showError(error, 'admin.shippingCustomers.msg.saveFailed');
}
};
/** 打开客户治理时间线;读取失败时不显示过期的其他客户审计。 */
const openLifecycleTimeline = async (customer: ShippingCustomerRow): Promise<void> => {
lifecycleCustomer.value = customer;
lifecycleTimeline.value = null;
showLifecyclePanel.value = true;
try {
const timeline = await getShippingCustomerLifecycleTimeline(customer.id);
if (showLifecyclePanel.value && lifecycleCustomer.value?.id === customer.id) lifecycleTimeline.value = timeline;
} catch (error) {
showError(error, 'admin.shippingCustomers.msg.loadFailed');
}
};
/** 关闭时间线面板并清空快照,避免切换客户时展示错误审计。 */
const closeLifecycleTimeline = (): void => {
showLifecyclePanel.value = false;
lifecycleCustomer.value = null;
lifecycleTimeline.value = null;
};
/** 打开永久删除预检;资格必须以服务端生命周期统计为准。 */
const openDeleteCustomer = async (customer: ShippingCustomerRow): Promise<void> => {
deleteCustomer.value = customer;
deleteImpact.value = null;
showDeleteDialog.value = true;
try {
const impact = await getShippingCustomerLifecycleImpact(customer.id);
// 快速切换行时只接受仍属于当前弹窗客户的预检响应。
if (showDeleteDialog.value && deleteCustomer.value?.id === customer.id) {
deleteImpact.value = impact;
}
} catch (error) {
showError(error, 'admin.shippingCustomers.msg.loadFailed');
}
};
/** 关闭删除窗口并清空预检快照,避免错误复用其他客户的删除资格。 */
const closeDeleteCustomer = (): void => {
showDeleteDialog.value = false;
deleteCustomer.value = null;
deleteImpact.value = null;
};
/** 提交受控永久删除;后端会在同一事务内再次统计引用以处理并发变更。 */
const confirmDeleteCustomer = async (confirmationShortCode: string, reason: string): Promise<void> => {
if (!deleteCustomer.value) return;
isSaving.value = true;
try {
await deleteShippingCustomer(deleteCustomer.value.id, {
confirmation_short_code: confirmationShortCode.trim().toUpperCase(),
reason: reason.trim(),
});
closeDeleteCustomer();
await loadCustomers();
msg.success(t('admin.shippingCustomers.deleteDialog.deleted'));
} catch (error) {
showError(error, 'admin.shippingCustomers.deleteDialog.failed');
if (error instanceof BusinessError && error.code === 'SHIPPING.CUSTOMER_DELETE_BLOCKED') {
try {
deleteImpact.value = await getShippingCustomerLifecycleImpact(deleteCustomer.value.id);
} catch {
// 保留原预检内容;错误提示已由统一处理展示。
}
}
} finally {
isSaving.value = false;
}
};
/** 打开客户归并窗口;目标客户列表只加载可用于未来识别的启用客户。 */
const openMergeCustomer = async (customer: ShippingCustomerRow): Promise<void> => {
mergeCustomer.value = customer;
mergeImpact.value = null;
showMergeDialog.value = true;
try {
await loadAllCustomerOptions();
} catch (error) {
showError(error, 'admin.shippingCustomers.msg.loadFailed');
}
};
/** 选择目标客户后读取服务端预检,不以页面计数推断可归并内容。 */
const previewMergeCustomer = async (targetCustomerId: number): Promise<void> => {
if (!mergeCustomer.value) return;
mergeImpact.value = null;
try {
const impact = await getShippingCustomerMergeImpact(mergeCustomer.value.id, targetCustomerId);
if (showMergeDialog.value && mergeCustomer.value?.id === impact.source.id) {
mergeImpact.value = impact;
}
} catch (error) {
showError(error, 'admin.shippingCustomers.mergeDialog.previewFailed');
}
};
/** 关闭归并窗口并清空源客户和预检快照。 */
const closeMergeCustomer = (): void => {
showMergeDialog.value = false;
mergeCustomer.value = null;
mergeImpact.value = null;
};
/** 提交受控归并;历史业务号和审计引用由服务端保留在源客户。 */
const confirmMergeCustomer = async (targetCustomerId: number, confirmationShortCode: string, reason: string): Promise<void> => {
if (!mergeCustomer.value) return;
isSaving.value = true;
try {
await mergeShippingCustomer(mergeCustomer.value.id, {
target_customer_id: targetCustomerId,
confirmation_short_code: confirmationShortCode.trim().toUpperCase(),
reason: reason.trim(),
});
closeMergeCustomer();
await Promise.all([loadCustomers(), loadAllCustomerOptions()]);
msg.success(t('admin.shippingCustomers.mergeDialog.merged'));
} catch (error) {
showError(error, 'admin.shippingCustomers.mergeDialog.failed');
} finally {
isSaving.value = false;
}
};
/** 拉取客户详情并打开识别证据面板。 */
const openIdentifiers = async (customer: ShippingCustomerRow): Promise<void> => {
try {
@@ -202,13 +346,45 @@ export function useShippingCustomersAdmin() {
const updateIdentifier = async (identifierId: number, payload: Record<string, unknown>): Promise<void> => {
if (!selectedCustomer.value) return;
try {
await updateShippingCustomerIdentifier(identifierId, payload);
const reason = window.prompt(t('admin.shippingCustomers.prompts.identifierChangeReason'))?.trim();
if (!reason) return;
await updateShippingCustomerIdentifier(identifierId, { ...payload, reason });
selectedCustomer.value = await getShippingCustomer(selectedCustomer.value.id);
} catch (error) {
showError(error, 'admin.shippingCustomers.msg.saveFailed');
}
};
/** 新增外部系统客户编码,并重新读取客户详情。 */
const addExternalRef = async (payload: { source_system: string; customer_code: string }): Promise<void> => {
if (!selectedCustomer.value) return;
isSaving.value = true;
try {
await createShippingCustomerExternalRef(selectedCustomer.value.id, payload);
selectedCustomer.value = await getShippingCustomer(selectedCustomer.value.id);
msg.success(t('admin.shippingCustomers.msg.saved'));
} catch (error) {
showError(error, 'admin.shippingCustomers.msg.saveFailed');
} finally {
isSaving.value = false;
}
};
/** 新增送货站点,并重新读取客户详情。 */
const addSite = async (payload: { site_name: string; site_code: string; address?: string; city?: string; country?: string; remark?: string }): Promise<void> => {
if (!selectedCustomer.value) return;
isSaving.value = true;
try {
await createShippingCustomerSite(selectedCustomer.value.id, payload);
selectedCustomer.value = await getShippingCustomer(selectedCustomer.value.id);
msg.success(t('admin.shippingCustomers.msg.saved'));
} catch (error) {
showError(error, 'admin.shippingCustomers.msg.saveFailed');
} finally {
isSaving.value = false;
}
};
/** 打开期初导入对话框并清空上次批次。 */
const openImport = async (): Promise<void> => {
importBatch.value = null;
@@ -315,12 +491,12 @@ export function useShippingCustomersAdmin() {
};
return {
customers, importTargetCustomers, selectedCustomer, customerForm, importBatch, shadowReport,
customers, importTargetCustomers, selectedCustomer, customerForm, importBatch, shadowReport, deleteCustomer, deleteImpact, lifecycleCustomer, lifecycleTimeline, mergeCustomer, mergeImpact,
searchQuery, statusFilter, page, pageSize, total, pages,
isLoading, isSaving, isImporting, isShadowLoading,
showCustomerModal, showIdentifiersPanel, showImportDialog,
showCustomerModal, showIdentifiersPanel, showImportDialog, showDeleteDialog, showLifecyclePanel, showMergeDialog,
loadCustomers, searchCustomers, openCreateCustomer, openEditCustomer, closeCustomerModal,
saveCustomer, deactivateCustomer, openIdentifiers, addIdentifier, updateIdentifier,
saveCustomer, deactivateCustomer, openLifecycleTimeline, closeLifecycleTimeline, openDeleteCustomer, closeDeleteCustomer, confirmDeleteCustomer, openMergeCustomer, previewMergeCustomer, closeMergeCustomer, confirmMergeCustomer, openIdentifiers, addIdentifier, updateIdentifier, addExternalRef, addSite,
openImport, uploadImport, decideImportRow, publishImport, downloadTemplate, downloadReconciliation,
loadShadowReport, labelShadowResolution,
};
@@ -0,0 +1,63 @@
/**
* 用途:验证货代发货通知业务域在四种语言中的文案键保持一致。
* 依赖:admin/chat/workspace 四语言 JSON;只检查货代业务子树,不受其他历史业务域影响。
* 逻辑:递归收集叶子键并比较集合,防止只在单一语言新增或删除货代文案。
*/
import { describe, expect, it } from 'vitest';
import adminEn from '@/locales/en/admin.json';
import adminTh from '@/locales/th/admin.json';
import adminZhCn from '@/locales/zh-CN/admin.json';
import adminZhTw from '@/locales/zh-TW/admin.json';
import chatEn from '@/locales/en/chat.json';
import chatTh from '@/locales/th/chat.json';
import chatZhCn from '@/locales/zh-CN/chat.json';
import chatZhTw from '@/locales/zh-TW/chat.json';
import workspaceEn from '@/locales/en/workspace.json';
import workspaceTh from '@/locales/th/workspace.json';
import workspaceZhCn from '@/locales/zh-CN/workspace.json';
import workspaceZhTw from '@/locales/zh-TW/workspace.json';
type LocaleTree = Record<string, unknown>;
const leafKeys = (value: unknown, prefix = ''): string[] => {
if (!value || typeof value !== 'object' || Array.isArray(value)) return [prefix];
return Object.entries(value as LocaleTree).flatMap(([key, child]) => (
leafKeys(child, prefix ? `${prefix}.${key}` : key)
));
};
const expectSameKeys = (trees: LocaleTree[]) => {
const expected = leafKeys(trees[0]).sort();
trees.slice(1).forEach((tree) => expect(leafKeys(tree).sort()).toEqual(expected));
};
describe('shipping notice i18n parity', () => {
it('keeps admin inventory configuration keys aligned', () => {
expectSameKeys([
adminZhCn.shippingInventory as LocaleTree,
adminZhTw.shippingInventory as LocaleTree,
adminEn.shippingInventory as LocaleTree,
adminTh.shippingInventory as LocaleTree,
]);
});
it('keeps chat shipping notice keys aligned', () => {
expectSameKeys([
chatZhCn.shippingNotice as LocaleTree,
chatZhTw.shippingNotice as LocaleTree,
chatEn.shippingNotice as LocaleTree,
chatTh.shippingNotice as LocaleTree,
]);
});
it('keeps workspace shipping notice keys aligned', () => {
expectSameKeys([
workspaceZhCn.shippingNotice as LocaleTree,
workspaceZhTw.shippingNotice as LocaleTree,
workspaceEn.shippingNotice as LocaleTree,
workspaceTh.shippingNotice as LocaleTree,
]);
});
});
@@ -1,11 +1,11 @@
/**
* features/admin/types/shipping-customer.types.ts
* features/shipping-notice/types/customer-master.types.ts
* 用途:货代客户主数据、识别证据和期初导入管理端类型契约。
* 依赖:无运行时依赖。
* 逻辑:admin.api 返回这些结构;shipping-customers 页面与组件据此渲染和提交。
* 逻辑:customer-master.api 返回这些结构;客户主数据页面与组件据此渲染和提交。
*/
export type ShippingCustomerStatus = 'active' | 'inactive';
export type ShippingCustomerStatus = 'active' | 'inactive' | 'merged';
export type ShippingIdentifierStatus = 'pending' | 'approved' | 'disabled';
export type ShippingImportDecision = 'create' | 'update' | 'merge' | 'skip';
@@ -27,10 +27,13 @@ export interface ShippingCustomerRow {
standard_name: string;
short_code: string;
status: ShippingCustomerStatus;
merged_into_customer_id?: number | null;
remark?: string | null;
case_count: number;
identifier_count: number;
identifiers?: ShippingCustomerIdentifier[];
external_refs?: ShippingCustomerExternalRef[];
sites?: ShippingCustomerSite[];
created_at?: string | null;
updated_at?: string | null;
}
@@ -43,6 +46,84 @@ export interface ShippingCustomerPage {
pages: number;
}
export interface ShippingCustomerExternalRef {
id: number;
customer_id: number;
source_system: string;
customer_code: string;
}
export interface ShippingCustomerSite {
id: number;
customer_id: number;
site_name: string;
site_code: string;
address?: string | null;
city?: string | null;
country?: string | null;
status: string;
remark?: string | null;
identifiers: Array<Record<string, unknown>>;
}
export interface ShippingCustomerLifecycleImpact {
customer: Pick<ShippingCustomerRow, 'id' | 'standard_name' | 'short_code' | 'status'>;
can_delete: boolean;
blockers: {
business_cases: number;
business_sequences: number;
external_references: number;
order_customer_matches: number;
import_target_rows: number;
import_result_rows: number;
shadow_top_candidates: number;
shadow_manual_labels: number;
shadow_candidate_matches: number;
merged_source_customers: number;
merged_into_customer: number;
};
cascade: {
identifiers: number;
sites: number;
};
}
export interface DeleteShippingCustomerRequest {
confirmation_short_code: string;
reason: string;
}
export interface DeleteShippingCustomerResult {
deleted_customer: ShippingCustomerLifecycleImpact['customer'];
cascade: ShippingCustomerLifecycleImpact['cascade'];
lifecycle_event_id: number;
}
export interface ShippingCustomerMergeImpact {
source: Pick<ShippingCustomerRow, 'id' | 'standard_name' | 'short_code' | 'status'>;
target: Pick<ShippingCustomerRow, 'id' | 'standard_name' | 'short_code' | 'status'>;
historical_references: ShippingCustomerLifecycleImpact['blockers'];
migrate: {
identifiers: number;
duplicate_identifiers: number;
external_references: number;
sites: number;
};
}
export interface MergeShippingCustomerRequest {
target_customer_id: number;
confirmation_short_code: string;
reason: string;
}
export interface MergeShippingCustomerResult {
source: ShippingCustomerMergeImpact['source'];
target: ShippingCustomerMergeImpact['target'];
migrate: ShippingCustomerMergeImpact['migrate'];
merge_id: number;
}
export interface ShippingImportIssue {
code: string;
field?: string;
@@ -121,8 +202,16 @@ export interface ShippingCustomerShadowReport {
evaluated_count: number;
auto_confirmed_count: number;
corrected_task_count: number;
historical_backfilled_count: number;
auto_confirmation_rate?: number | null;
quality_gate: {
status: 'eligible' | 'insufficient_labeled_samples' | 'insufficient_accuracy';
is_eligible: boolean;
labeled_sample_count: number;
correct_sample_count: number;
accuracy?: number | null;
min_labeled_samples: number;
min_accuracy: number;
};
recent_events: Array<{
id: number;
task_no: string;
@@ -134,12 +223,29 @@ export interface ShippingCustomerShadowReport {
items: ShippingCustomerShadowItem[];
}
export interface ShippingCustomerLifecycleEvent {
id: number;
event_type: string;
actor_id?: number | null;
reason?: string | null;
detail: Record<string, unknown>;
created_at?: string | null;
}
export interface ShippingCustomerLifecycleTimeline {
customer: Omit<Pick<ShippingCustomerRow, 'id' | 'standard_name' | 'short_code' | 'status'>, 'status'> & {
status: ShippingCustomerStatus | 'deleted';
};
items: ShippingCustomerLifecycleEvent[];
}
export interface ShippingCustomerFormState {
id?: number;
standard_name: string;
short_code: string;
status: ShippingCustomerStatus;
remark: string;
reason: string;
}
export interface ShippingIdentifierFormState {
@@ -156,6 +262,7 @@ export const createEmptyShippingCustomerForm = (): ShippingCustomerFormState =>
short_code: '',
status: 'active',
remark: '',
reason: '',
});
/** 将客户详情转换为可编辑表单快照。 */
@@ -165,6 +272,7 @@ export const shippingCustomerToForm = (customer: ShippingCustomerRow): ShippingC
short_code: customer.short_code,
status: customer.status,
remark: customer.remark || '',
reason: '',
});
/** 创建空识别证据表单,默认待审核且禁止自动匹配。 */
@@ -0,0 +1,30 @@
/**
* features/shipping-notice/utils/exportSelection.spec.ts
* 用途:验证显式任务批量下载选择的去重、取消、可见范围和数量门禁。
* 依赖:Vitest、exportSelection。
* 逻辑:以纯函数覆盖工作台交互边界,不依赖浏览器 DOM。
*/
import { describe, expect, it } from 'vitest';
import {
retainVisibleShippingExportSelection,
selectVisibleShippingExports,
updateShippingExportSelection,
} from './exportSelection';
describe('shipping export selection', () => {
it('adds, deduplicates and removes task numbers', () => {
expect(updateShippingExportSelection([], ' SN-1 ', true)).toEqual(['SN-1']);
expect(updateShippingExportSelection(['SN-1'], 'SN-1', true)).toEqual(['SN-1']);
expect(updateShippingExportSelection(['SN-1', 'SN-2'], 'SN-1', false)).toEqual(['SN-2']);
});
it('rejects selections over the archive limit', () => {
expect(() => selectVisibleShippingExports(['SN-1', 'SN-2'], 1)).toThrowError(RangeError);
expect(() => updateShippingExportSelection(['SN-1'], 'SN-2', true, 1)).toThrowError(RangeError);
});
it('retains only tasks still visible after a refresh', () => {
expect(retainVisibleShippingExportSelection(['SN-1', 'SN-2'], ['SN-2', 'SN-3'])).toEqual(['SN-2']);
});
});
@@ -0,0 +1,43 @@
/**
* features/shipping-notice/utils/exportSelection.ts
* 用途:维护工作台显式勾选的发货任务编号,并与批量下载 100 票上限保持一致。
* 依赖:无。
* 逻辑:所有入口统一去重、过滤空编号,并在加入新任务时执行上限门禁。
*/
export const SHIPPING_EXPORT_SELECTION_LIMIT = 100;
/** 更新单个任务的选择状态;超过服务端上限时拒绝产生新状态。 */
export function updateShippingExportSelection(
current: readonly string[],
taskNo: string,
selected: boolean,
limit = SHIPPING_EXPORT_SELECTION_LIMIT,
): string[] {
const normalizedTaskNo = taskNo.trim();
const normalized = [...new Set(current.map((item) => item.trim()).filter(Boolean))];
if (!normalizedTaskNo) return normalized;
if (!selected) return normalized.filter((item) => item !== normalizedTaskNo);
if (normalized.includes(normalizedTaskNo)) return normalized;
if (normalized.length >= limit) throw new RangeError('SHIPPING_EXPORT_SELECTION_LIMIT');
return [...normalized, normalizedTaskNo];
}
/** 选择当前查询结果;调用方应将超限作为明确错误展示,而不是静默截断。 */
export function selectVisibleShippingExports(
taskNos: readonly string[],
limit = SHIPPING_EXPORT_SELECTION_LIMIT,
): string[] {
const normalized = [...new Set(taskNos.map((item) => item.trim()).filter(Boolean))];
if (normalized.length > limit) throw new RangeError('SHIPPING_EXPORT_SELECTION_LIMIT');
return normalized;
}
/** 刷新查询结果后仅保留仍可见的选择,避免下载陈旧或越界任务。 */
export function retainVisibleShippingExportSelection(
current: readonly string[],
visibleTaskNos: readonly string[],
): string[] {
const visible = new Set(visibleTaskNos.map((item) => item.trim()).filter(Boolean));
return [...new Set(current.map((item) => item.trim()).filter((item) => visible.has(item)))];
}
@@ -0,0 +1,32 @@
/**
* 用途:验证货代任务状态筛选覆盖全部用户可见流程状态。
* 依赖:shippingTaskStatuses 中的统一状态目录。
* 逻辑:锁定等待处理、人工复核、完成和终止状态,防止后续新增徽标时遗漏筛选入口。
*/
import { describe, expect, it } from 'vitest';
import { SHIPPING_TASK_STATUS_FILTERS } from './shippingTaskStatuses';
describe('SHIPPING_TASK_STATUS_FILTERS', () => {
it('covers review, processing, completion and terminal task states', () => {
const values = SHIPPING_TASK_STATUS_FILTERS.map(([value]) => value);
expect(values).toEqual([
'created',
'parsed',
'pending_review',
'shortage_review',
'waiting_inventory',
'inventory_ready',
'matched',
'waiting_upload',
'uploaded',
'upload_failed',
'rejected',
'closed',
]);
expect(new Set(values).size).toBe(values.length);
});
});
@@ -0,0 +1,21 @@
/**
* 用途:集中定义货代任务工作台可筛选的流程状态。
* 依赖:ShippingNoticeView 使用状态值请求后端,并通过 i18n key 渲染业务名称。
* 逻辑:筛选集合与任务状态徽标保持一致,避免可展示状态无法被筛选。
*/
export const SHIPPING_TASK_STATUS_FILTERS = [
['created', 'created'],
['parsed', 'parsed'],
['pending_review', 'pendingReview'],
['shortage_review', 'shortageReview'],
['waiting_inventory', 'waitingInventory'],
['inventory_ready', 'inventoryReady'],
['matched', 'matched'],
['waiting_upload', 'waitingUpload'],
['uploaded', 'uploaded'],
['upload_failed', 'uploadFailed'],
['rejected', 'rejected'],
['closed', 'closed'],
] as const;
@@ -13,8 +13,10 @@ import ShippingWorkflowStepper from '@/features/chat/components/ShippingWorkflow
import ShippingMatchResultCard from '@/features/chat/components/messages/ShippingMatchResultCard.vue';
import ShippingTaskParsedResultCard from '@/features/chat/components/ShippingTaskParsedResultCard.vue';
import { formatLocalDateTime } from '@/shared/utils/dateTime';
import { useMessage } from '@/shared/composables/useMessage';
import {
getWorkspaceShippingTask,
downloadWorkspaceShippingExportArchive,
listShippingChatAgents,
listWorkspaceShippingTasks,
SHIPPING_NOTICE_AGENT_CODE,
@@ -26,6 +28,12 @@ import {
import { getAuthHeaders } from '@/shared/utils/auth';
import { resolveShippingWorkflowSteps } from '@/features/chat/shipping';
import { sanitizeShippingRuntimeStatusText } from '@/features/chat/shipping/shippingText';
import {
retainVisibleShippingExportSelection,
selectVisibleShippingExports,
updateShippingExportSelection,
} from '@/features/shipping-notice/utils/exportSelection';
import { SHIPPING_TASK_STATUS_FILTERS } from '../shippingTaskStatuses';
const props = defineProps<{
embedded?: boolean;
@@ -33,11 +41,14 @@ const props = defineProps<{
const router = useRouter();
const { t, te } = useI18n();
const msg = useMessage();
const loading = ref(false);
const detailLoading = ref(false);
const tasks = ref<ShippingTaskSummary[]>([]);
const selectedTaskNo = ref<string | null>(null);
const selectedExportTaskNos = ref<string[]>([]);
const archiveDownloading = ref(false);
const detail = ref<ShippingTaskDetail | null>(null);
const statusFilter = ref('all');
const chatAgentId = ref<number | null>(null);
@@ -51,13 +62,10 @@ const batchProgressLabel = computed(() => {
const statusOptions = computed(() => [
{ value: 'all', label: t('workspace.shippingNotice.status.all') },
{ value: 'created', label: t('workspace.shippingNotice.status.created') },
{ value: 'waiting_inventory', label: t('workspace.shippingNotice.status.waitingInventory') },
{ value: 'inventory_ready', label: t('workspace.shippingNotice.status.inventoryReady') },
{ value: 'matched', label: t('workspace.shippingNotice.status.matched') },
{ value: 'waiting_upload', label: t('workspace.shippingNotice.status.waitingUpload') },
{ value: 'uploaded', label: t('workspace.shippingNotice.status.uploaded') },
{ value: 'upload_failed', label: t('workspace.shippingNotice.status.uploadFailed') },
...SHIPPING_TASK_STATUS_FILTERS.map(([value, labelKey]) => ({
value,
label: t(`workspace.shippingNotice.status.${labelKey}`),
})),
]);
type ShippingStatusSource = Pick<
@@ -70,7 +78,6 @@ const displayStatusCode = (source: ShippingStatusSource | string) => {
const reason = String(source.pending_human_reason || '').trim();
const reviewStatus = String(source.review_status || '').trim();
if (reason === 'shortage' || reason === 'shortage_review' || reviewStatus === 'shortage_review') return 'shortage_review';
if (reason === 'align_review' || reviewStatus === 'align_review') return 'align_review';
return String(source.process_status || '').trim();
};
@@ -80,7 +87,6 @@ const statusBadge = (source: ShippingStatusSource | string) => {
created: { cls: 'bg-slate-100 text-secondary', label: t('workspace.shippingNotice.status.created') },
parsed: { cls: 'bg-blue-100 text-blue-700', label: t('workspace.shippingNotice.status.parsed') },
pending_review: { cls: 'bg-amber-100 text-amber-700', label: t('workspace.shippingNotice.status.pendingReview') },
align_review: { cls: 'bg-amber-100 text-amber-700', label: t('workspace.shippingNotice.status.alignReview') },
shortage_review: { cls: 'bg-rose-100 text-rose-700', label: t('workspace.shippingNotice.status.shortageReview') },
waiting_inventory: { cls: 'bg-amber-100 text-amber-700', label: t('workspace.shippingNotice.status.waitingInventory') },
inventory_ready: { cls: 'bg-blue-100 text-blue-700', label: t('workspace.shippingNotice.status.inventoryReady') },
@@ -168,7 +174,6 @@ const hasInventorySourceFields = computed(() => {
if (!item) return false;
return !!(
item.inventory_source_code
|| item.inventory_site_id
|| item.inventory_warehouse_id
|| item.inventory_source_status
);
@@ -181,6 +186,10 @@ const loadCases = async () => {
process_status: statusFilter.value === 'all' ? undefined : statusFilter.value,
limit: 100,
});
selectedExportTaskNos.value = retainVisibleShippingExportSelection(
selectedExportTaskNos.value,
tasks.value.map((item) => item.task_no),
);
} catch {
tasks.value = [];
} finally {
@@ -231,6 +240,47 @@ const downloadExport = async (taskNo: string) => {
URL.revokeObjectURL(a.href);
};
/** 下载当前任务所属批次的所有有效 Artifact;缺失票据记录在 ZIP manifest。 */
const downloadBatchExports = async (batchNo: string) => {
await downloadExportArchive({ batch_no: batchNo });
};
/** 下载批次或显式任务集合,并确保临时对象 URL 在点击后释放。 */
const downloadExportArchive = async (payload: { batch_no?: string; task_nos?: string[] }) => {
archiveDownloading.value = true;
try {
const { blob, filename } = await downloadWorkspaceShippingExportArchive(payload);
const a = document.createElement('a');
a.href = URL.createObjectURL(blob); a.download = filename; a.click(); URL.revokeObjectURL(a.href);
} catch {
msg.error(t('workspace.shippingNotice.archiveDownloadFailed'));
} finally {
archiveDownloading.value = false;
}
};
/** 更新单票勾选;数量门禁与后端 100 票限制一致。 */
const toggleExportTask = (taskNo: string, checked: boolean) => {
selectedExportTaskNos.value = updateShippingExportSelection(selectedExportTaskNos.value, taskNo, checked);
};
/** 全选或清空当前查询结果,不跨筛选条件保留不可见任务。 */
const toggleAllVisibleExports = (checked: boolean) => {
selectedExportTaskNos.value = checked
? selectVisibleShippingExports(tasks.value.map((item) => item.task_no))
: [];
};
const allVisibleExportsSelected = computed(() => (
tasks.value.length > 0 && tasks.value.every((item) => selectedExportTaskNos.value.includes(item.task_no))
));
/** 按用户显式选择下载,后端仍逐票执行权限与 Artifact 当前性校验。 */
const downloadSelectedExports = async () => {
if (!selectedExportTaskNos.value.length) return;
await downloadExportArchive({ task_nos: selectedExportTaskNos.value });
};
const shortageLines = computed(() => detail.value?.shortage?.lines || []);
const hasMatchCard = computed(() =>
!!detail.value && (
@@ -290,6 +340,27 @@ onMounted(async () => {
>
{{ $t('workspace.shippingNotice.search') }}
</button>
<label class="ml-auto inline-flex items-center gap-2 text-sm text-secondary">
<input
type="checkbox"
:checked="allVisibleExportsSelected"
:disabled="tasks.length === 0"
@change="toggleAllVisibleExports(($event.target as HTMLInputElement).checked)"
>
{{ $t('workspace.shippingNotice.selectAllVisible') }}
</label>
<span class="text-sm text-muted">
{{ $t('workspace.shippingNotice.selectedCount', { count: selectedExportTaskNos.length }) }}
</span>
<button
type="button"
class="inline-flex items-center gap-1.5 rounded-xl border border-default px-3 py-2 text-sm font-medium text-secondary hover:bg-surface-soft disabled:cursor-not-allowed disabled:opacity-50"
:disabled="selectedExportTaskNos.length === 0 || archiveDownloading"
@click="downloadSelectedExports"
>
<Download class="h-3.5 w-3.5" />
{{ $t('workspace.shippingNotice.downloadSelected') }}
</button>
</div>
<div class="grid gap-5 lg:grid-cols-5">
@@ -300,32 +371,39 @@ onMounted(async () => {
<div v-else-if="tasks.length === 0" class="rounded-2xl border border-dashed border-default py-10 text-center text-sm text-muted">
{{ $t('workspace.shippingNotice.empty') }}
</div>
<button
<article
v-for="item in tasks"
:key="item.task_no"
type="button"
class="w-full rounded-2xl border px-4 py-3 text-left transition-colors"
class="flex w-full items-start gap-3 rounded-2xl border px-4 py-3 transition-colors"
:class="selectedTaskNo === item.task_no ? 'border-brand-400 bg-brand-50/60' : 'border-default hover:bg-surface-soft/70'"
@click="selectedTaskNo = item.task_no"
>
<div class="flex items-center justify-between gap-2">
<span class="font-mono text-sm font-semibold text-primary">{{ item.task_no }}</span>
<span
class="rounded-full px-2 py-0.5 text-xs font-medium"
:class="statusBadge(item).cls"
:title="item.process_status"
>
{{ statusBadge(item).label }}
</span>
</div>
<div class="mt-1 truncate text-sm text-secondary">{{ item.customer_name || '—' }}</div>
<div class="mt-1 flex flex-wrap items-center gap-2 text-xs text-muted">
<span>{{ formatLocalDateTime(item.created_at) }}</span>
<span v-if="item.batch_index && item.batch_total" class="rounded-full bg-sky-50 px-2 py-0.5 font-medium text-sky-700">
{{ t('chat.shippingNoticeUi.batchProgress', { index: item.batch_index, total: item.batch_total }) }}
</span>
</div>
</button>
<input
type="checkbox"
class="mt-1"
:aria-label="$t('workspace.shippingNotice.selectForDownload', { taskNo: item.task_no })"
:checked="selectedExportTaskNos.includes(item.task_no)"
@change="toggleExportTask(item.task_no, ($event.target as HTMLInputElement).checked)"
>
<button type="button" class="min-w-0 flex-1 text-left" @click="selectedTaskNo = item.task_no">
<div class="flex items-center justify-between gap-2">
<span class="font-mono text-sm font-semibold text-primary">{{ item.task_no }}</span>
<span
class="rounded-full px-2 py-0.5 text-xs font-medium"
:class="statusBadge(item).cls"
:title="item.process_status"
>
{{ statusBadge(item).label }}
</span>
</div>
<div class="mt-1 truncate text-sm text-secondary">{{ item.customer_name || '—' }}</div>
<div class="mt-1 flex flex-wrap items-center gap-2 text-xs text-muted">
<span>{{ formatLocalDateTime(item.created_at) }}</span>
<span v-if="item.batch_index && item.batch_total" class="rounded-full bg-sky-50 px-2 py-0.5 font-medium text-sky-700">
{{ t('chat.shippingNoticeUi.batchProgress', { index: item.batch_index, total: item.batch_total }) }}
</span>
</div>
</button>
</article>
</div>
<div class="lg:col-span-3 rounded-2xl border border-default bg-surface/50 p-5">
@@ -368,6 +446,16 @@ onMounted(async () => {
<Download class="h-3.5 w-3.5" />
{{ $t('workspace.shippingNotice.download') }}
</button>
<button
v-if="detail.batch_no"
type="button"
class="inline-flex items-center gap-1 rounded-xl border border-default px-3 py-1.5 text-sm font-medium text-secondary hover:bg-surface-soft"
:disabled="archiveDownloading"
@click="downloadBatchExports(detail.batch_no)"
>
<Download class="h-3.5 w-3.5" />
{{ $t('workspace.shippingNotice.downloadBatch') }}
</button>
</div>
</div>
@@ -437,10 +525,6 @@ onMounted(async () => {
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.status') }}</dt>
<dd>{{ inventorySourceStatusLabel(detail.inventory_source_status) }}</dd>
</div>
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.siteId') }}</dt>
<dd class="font-mono">{{ detail.inventory_site_id || '—' }}</dd>
</div>
<div>
<dt class="text-xs text-muted">{{ $t('workspace.shippingNotice.inventorySource.warehouseId') }}</dt>
<dd class="font-mono">{{ detail.inventory_warehouse_id || '—' }}</dd>
+401 -4
View File
@@ -27,7 +27,398 @@
"requests": "Permission Requests",
"reports": "Data Reports",
"schedules": "Schedule Management",
"shippingCustomers": "Shipping Customers"
"shippingCustomers": "Shipping Customers",
"shippingInventory": "Shipping Configuration"
},
"shippingOrderSchema": {
"eyebrow": "Order field template",
"title": "Order Template Configuration",
"subtitle": "All EML, PDF, and Word orders share one published field contract. Published versions are immutable.",
"schemaName": "Template name",
"description": "Description",
"initialize": "Initialize order template",
"initialized": "Order template initialized",
"fieldCatalog": "Field catalog",
"fieldCatalogHint": "Administrators manage the system ID, location, format, and recognition rules. System IDs can be renamed while historical versions keep the original value.",
"fieldCode": "Field code",
"ruleWorkspace": "Field recognition rules",
"publishedVersion": "Published version V{version}",
"historyOpen": "Version history",
"historyEyebrow": "Immutable snapshot",
"historyTitle": "Version history",
"historyViewing": "Viewing historical version",
"historySelectVersion": "Select a version on the left to view its full snapshot",
"historyLoadMore": "Load more versions",
"historyNoNote": "No change note",
"historyUnknownTime": "Time not recorded",
"historyUnknownActor": "Unknown actor",
"historyPublishedAt": "Published at",
"historyPublisher": "Published by",
"historyChecksum": "Contract checksum",
"historySnapshotFields": "Snapshot fields",
"historyExcluded": "Not included in this version",
"historyStatus": { "draft": "Draft", "published": "Current", "retired": "Retired" },
"diffWithCurrent": "Compare with current workspace V{version}",
"diffEyebrow": "Server semantic diff",
"diffTitle": "Version diff",
"diffComparedWith": "compared with",
"diffEmpty": "Not set",
"diffNoChanges": "No field differences between these versions",
"diffAddedField": "This field was added in the compared version",
"diffRemovedField": "This field existed in the baseline but was removed in the compared version",
"diffOrderChanged": "Order only changed",
"diffStatus": { "added": "Added", "removed": "Removed", "modified": "Modified", "unchanged": "Unchanged" },
"diffField": { "field_code": "Field name (system identifier)", "scope": "Field placement", "value_type": "Data format", "enabled": "Included in current version", "display_name": "Current version display name", "description": "Description", "required": "Business required", "aliases": "Aliases", "normalizer_key": "Text processing", "validator_keys": "Content validation", "enum_options": "Enum options", "relation_role": "Cross-document relation", "comparator_key": "Comparison method", "extraction_instruction": "Extraction instruction", "sequence": "Field order", "evidence_policy.required": "Original evidence required", "evidence_policy.source_precedence": "Recognizable sources", "evidence_policy.conflict_policy": "On content conflict", "evidence_policy.allow_single_source": "Allow one trusted source" },
"auditTitle": "Configuration audit timeline",
"auditEmpty": "No configuration audit events",
"auditLoadMore": "Load more audit events",
"auditFieldSummary": "Added {added}, removed {removed}, changed {changed} fields",
"auditEvent": { "draft_created": "Created draft", "draft_saved": "Saved draft", "published": "Published version", "draft_deleted": "Deleted draft", "cloned": "Copied version to draft", "field_saved": "Saved field catalog", "field_retired": "Retired field catalog entry", "field_deleted": "Deleted or archived field catalog entry" },
"copyToDraft": "Copy to new draft",
"usageOpen": "View usage records",
"usageEyebrow": "Runtime traceability",
"usageTitle": "Version usage records",
"usageTotal": "Total extractions",
"usageFirst": "First used",
"usageLast": "Last used",
"usageRecords": "Extraction records",
"usageEmpty": "This version has not been used for order extraction",
"usageLoadMore": "Load more extraction records",
"extractionStatus": { "created": "Created", "extracting": "Extracting", "needs_review": "Needs review", "accepted": "Accepted", "failed": "Failed", "superseded": "Superseded" },
"runtimeAuditEyebrow": "Frozen runtime evidence",
"runtimeAuditTitle": "Order extraction audit detail",
"runtimeAuditEmpty": "No extraction audit detail found",
"runtimeAuditExtraction": "Extraction",
"runtimeAuditVersion": "Order template version",
"runtimeAuditStatus": "Extraction status",
"runtimeAuditHash": "Input snapshot hash",
"runtimeAuditInput": "Frozen input documents",
"runtimeAuditInputUnavailable": "This historical extraction predates input snapshots; only its snapshot hash is retained.",
"runtimeAuditLlm": "Raw LLM result",
"runtimeAuditNormalized": "Normalized result",
"runtimeAuditValidation": "Validation result",
"runtimeAuditDecisions": "Field decisions",
"runtimeAuditEvidence": "Field evidence",
"runtimeAuditValues": "Accepted field values",
"businessFields": "Fields to extract",
"businessFieldsHint": "Add a field, then select it to manage recognition rules.",
"searchFields": "Search display name or field code",
"fieldCount": "{count} fields",
"selectedInGroup": "Selected",
"noMatchingFields": "No matching fields",
"cancelAddField": "Close add form",
"publishedRuleViewer": "Published field configuration",
"publishedReadOnlyHint": "This is the complete published configuration. Create a draft to make changes.",
"readOnly": "Read only",
"businessFieldName": "Field name",
"fieldName": "Field name (system ID)",
"businessFieldNamePlaceholder": "For example: part_number",
"businessFieldNameHint": "Use lowercase snake case, such as part_number, reservation_id, or request_qty.",
"fieldEditingHint": "The display name and system ID are always editable. Inclusion only controls the current release.",
"businessFieldPlacement": "Field location",
"businessFieldFormat": "Data format",
"placementHeader": "Order information",
"placementLine": "Item details",
"placement": { "header": "Order information", "line": "Item details" },
"fieldType": { "string": "Text", "decimal": "Decimal", "integer": "Whole number", "date": "Date", "boolean": "Yes / No", "enum": "Options" },
"ruleEditor": "Editing",
"unnamedField": "Unnamed field",
"pendingNameField": "Field awaiting name {number}",
"inDraft": "In draft",
"notInDraft": "Not in draft",
"inPublished": "In published version",
"notInPublished": "Not in current version",
"fieldRemovedStatus": "Removed",
"selectField": "Select a field on the left to configure it.",
"addField": "Add field",
"fieldCreated": "Field created",
"fieldUpdated": "Field updated",
"saveField": "Save field",
"retireField": "Retire",
"fieldRetired": "Field retired",
"confirmRetireField": "Retire field {code}? The system will block the action while an order template draft, route, inventory parsing, or shipping template still references it.",
"removeField": "Delete",
"fieldRemoved": "Field removed",
"fieldDeleted": "Field deleted",
"fieldArchived": "Field archived and hidden from current configuration",
"confirmRemoveField": "Delete \"{name}\"? An unused field is deleted permanently; a field with history is archived and hidden. The system blocks deletion while it is used by a routing rule, inventory parsing, or shipping template.",
"versionEditor": "Version rules",
"notPublished": "Not published",
"createDraft": "Create draft",
"draftCreated": "Draft created",
"changeNote": "Change note",
"displayName": "Current version display name",
"includeField": "Include in version",
"aliases": "Aliases (comma separated)",
"normalizer": "Text handling",
"comparator": "Comparison method",
"relationRole": "Cross-document relation",
"conflictPolicy": "When values disagree",
"required": "Business required",
"evidenceRequired": "Source evidence required",
"allowSingleSource": "Allow one trusted source",
"enumOptions": "Enum options (comma separated)",
"validators": "Content validation",
"sourcePrecedence": "Recognizable content sources",
"extractionInstruction": "Recognition guidance (optional)",
"extractionInstructionPlaceholder": "For example: Prefer the manufacturer part number in the order item table",
"advancedRules": "Advanced recognition rules",
"notSet": "Not set",
"changeNotePlaceholder": "Describe this rule change (optional)",
"ruleLabel": { "trim": "Trim spaces", "uppercase_trim": "Uppercase and trim spaces", "lowercase_trim": "Ignore case and trim spaces", "decimal": "Treat as decimal", "integer": "Treat as whole number", "iso_date": "Treat as date", "boolean": "Treat as Yes / No", "normalized_text": "Compare processed text", "case_insensitive_text": "Compare ignoring case", "date": "Compare as date", "exact": "Must match exactly", "block": "Block processing", "review": "Send to manual review", "prefer_attachment": "Prefer attachment content", "prefer_email": "Prefer email content", "prefer_highest_confidence": "Use the higher-confidence result", "atomic_part_number": "Part-number format", "non_empty": "Must not be empty", "positive_decimal": "Must be positive", "non_negative_decimal": "Must not be negative", "positive_integer": "Must be a positive whole number", "reservation_id": "Reservation ID format", "primary_link": "Primary relation", "secondary_link": "Secondary relation", "line_match": "Item-level relation", "order_reference": "Order relationship" },
"sourceLabel": { "attachment_table": "Attachment table", "attachment_text": "Attachment text", "email_body_table": "Email table", "email_body_text": "Email text", "dify_llm": "Intelligent recognition result", "backend_table": "System table recognition" },
"saveDraft": "Save draft",
"draftSaved": "Draft saved",
"deleteDraft": "Delete draft",
"draftDeleted": "Draft deleted",
"publish": "Publish version",
"published": "Order field version published",
"noDraft": "There is no draft. Create one to configure and publish field rules.",
"setupKicker": "Starting point",
"setupTitle": "Define the order fields that the system must recognize and export",
"setupHint": "Order fields are the shared contract for inventory matching, routing, and shipping Excel files. Publish them before configuring inventory parsing profiles and sources.",
"setupActionHint": "The system creates the first order-field workspace with default settings; you can then add fields to extract.",
"setupStepCatalog": "Create stable fields such as part number, name, and quantity",
"setupStepRules": "Set aliases, validation, and EML/PDF evidence rules for each field",
"setupStepPublish": "Publish the field version for downstream configuration",
"operationFailed": "Order template operation failed"
},
"shippingInventory": {
"title": "Shipping Configuration",
"subtitle": "Maintain one traceable shipping configuration flow from order fields and inventory parsing to shipping Excel files and inventory routing.",
"eyebrow": "Shipping Configuration Workspace",
"groupFoundation": "Foundation",
"groupInventory": "Inventory Management",
"groupAudit": "Run Audit",
"orderFields": "Order Parsing",
"orderSchemaRequired": "Publish an Order Fields version first; inventory parsing profiles, shipping Excel templates, and routing rules can then reference order fields.",
"connections": "System Connections",
"parsingProfiles": "Inventory Parsing",
"parsingProfilesHelp": "Maintain inventory file structures, field mappings, and order-field match keys shared by inventory sites.",
"inventoryMapping": "Inventory Parsing",
"inventoryMappingPlans": "Parsing Rules",
"inventoryFields": "Inventory Field Catalog",
"inventoryFieldsHelp": "Maintain business fields shared across DBS, Crane, and other inventory files; each mapping maps actual headers to these fields.",
"inventoryFieldName": "Field name",
"inventoryFieldDescription": "Field description",
"inventoryFieldDescriptionHint": "Describe the business meaning and use of this field",
"inventoryFieldFormat": "Data format",
"inventoryFieldPurpose": "Field purpose",
"inventoryFieldOrder": "Display order",
"inventoryFieldType": { "text": "Text", "integer": "Whole number", "decimal": "Decimal", "date": "Date" },
"inventoryFieldPurposeOption": { "match_identity": "Inventory matching", "inventory_quantity": "Inventory quantity", "warehouse_identity": "Warehouse identification", "general": "General business information" },
"inventoryFieldPurposeHint": "Inventory matching links orders to inventory; inventory quantity calculates availability; warehouse identification is for dynamic-warehouse sites; other fields support display or shipping templates.",
"inventoryFieldUserDefinedHint": "Field names are fully user-defined. Publishing an inventory mapping requires at least one matching field and exactly one quantity field; dynamic-warehouse sites also require one warehouse field.",
"retireInventoryField": "Retire field",
"confirmRetireInventoryField": "Retire this inventory field? It can no longer be used by new inventory parsing or shipping templates.",
"parsingProfileCode": "Parsing profile code",
"temporaryInventorySession": "Confirmed conversation inventory file",
"temporaryInventorySessionNone": "Do not use a conversation inventory file",
"temporaryInventorySessionHint": "This reuses the quality-checked file structure and mapping. You must still enter the code, name, and order match keys; saving creates a draft only.",
"temporaryInventorySessionSelected": "The confirmed temporary mapping is loaded (source: {mapping}); the file structure cannot be changed here.",
"fileFormat": "File format",
"inventorySampleFile": "Inventory Sample File",
"inventorySampleFileHint": "Upload an Excel or CSV file. The system reads worksheets, headers, and a small sample for plan confirmation.",
"inventorySampleAnalysing": "Analysing inventory file structure...",
"inventorySampleRequired": "Upload an inventory sample file and complete structure recognition first.",
"parsingProfileName": "Inventory Parsing Name",
"inventoryAnalysisFailed": "Inventory file structure recognition failed.",
"inventoryAnalysisPreview": "Recognition Preview",
"inventoryAnalysisSummary": "Found {candidate_count} candidate headers with {sample_row_count} sample rows and suggested {valid_inventory_field_suggestions} inventory fields.",
"csvFile": "CSV File",
"headerRowOption": "Row {row}",
"chooseSourceHeader": "Select source column",
"emptyHeader": "Blank column",
"parsingPlanRecommendation": "Reusable Inventory Parsing",
"recommendationLevel": { "exact": "Exact file structure", "compatible": "Compatible core columns" },
"usedBySites": "Used by {count} inventory sites",
"addedColumns": "Added non-critical columns: {columns}",
"columnOrderChanged": "Column order changed, but core columns remain identifiable.",
"adoptParsingPlan": "Use This Plan",
"parsingPlanAdopted": "The inventory parsing is confirmed. No inventory site has been bound.",
"headerRowIndex": "Header row index",
"sheetName": "Worksheet name (optional)",
"fieldMappings": "Inventory field mappings",
"matchKeys": "Order-to-inventory match keys",
"matchKeysHint": "Maintain only identity fields that locate the same inventory record. Configure available quantity above for the later sufficiency check; it is not a match key.",
"matchKeysComplete": "Every mapped inventory identity field is already used as a match key; no additional key is needed.",
"matchKeysAnalysisRequired": "Upload an inventory sample and confirm its structure before adding a match key.",
"inventoryField": "Inventory field",
"orderField": "Order field",
"readonlyFieldMappingsHint": "These are the Excel column relationships locked by the published version.",
"readonlyMatchKeysHint": "Order lines match inventory records using this field combination.",
"publishedParsingImmutable": "Published inventory parsing is retained as an immutable audit definition. Create and publish a new draft to make changes.",
"chooseInventoryField": "Select an inventory field",
"chooseOrderField": "Select an order line field",
"sourceHeader": "Inventory file header",
"addFieldMapping": "Add field mapping",
"addMatchKey": "Add match key",
"publishProfile": "Publish",
"retireProfile": "Retire",
"confirmRetireProfile": "Only unreferenced parsing profiles can be retired. Continue?",
"excelTemplates": "Shipping Template",
"excelTemplateName": "Template Name",
"templateCodeHint": "Identifies one kind of shipping template, for example DBS_SHIPMENT.",
"templateFileHint": "After upload, the system reads worksheets and the first-row headers for target-column selection.",
"filenamePatternHint": "Combine the variables below; using the official business number is recommended.",
"filenamePatternExample": "Recommended: {business_no}.xlsx -> WYC26060201.xlsx",
"filenameVariablesTitle": "Available filename variables",
"filenameVariablesHint": "Use variables in braces. Business variables use the task's locked business snapshot for auditable historical exports.",
"filenameVariableNoMatch": "No matching variables",
"filenameVariableBusinessNo": "Official business number, e.g. WYC26060201 (recommended)",
"filenameVariableCustomer": "Customer short code, e.g. WYC",
"filenameVariableBusinessDate": "Six-digit business date, e.g. 260602",
"filenameVariableSequence": "Two-digit daily customer sequence, e.g. 01",
"filenameVariableTaskNo": "System task number", "filenameVariableSource": "Inventory source code", "filenameVariableDate": "Eight-digit export date, e.g. 20260602", "filenameVariableTimestamp": "Fourteen-digit export timestamp",
"templateMappingsHint": "Each mapping states which business data is written to which worksheet, column, and starting row.",
"mappingItem": "Mapping {number}", "templateSheet": "Target worksheet", "chooseTemplateSheet": "Select a worksheet from the uploaded file", "templateRowMode": "Write mode",
"rowMode": { "header": "Order information (once per file)", "line": "Item details (one row per item)" },
"chooseTargetColumn": "Select a target column in the template", "savedTargetColumn": "Saved column {column}",
"sourceType": "Source type", "sourceField": "Source field",
"sourceKind": { "order_field": "Order template field", "inventory_field": "Inventory template field", "system_fact": "System information", "constant": "Fixed content" },
"sourceKindHint": { "order_field": "Choose a published field from Order Template Configuration.", "inventory_field": "Choose a standard field parsed by Inventory Template Configuration.", "system_fact": "Choose task information supplied by the system." },
"sourceGroupOrder": "Order template fields", "sourceGroupOrderRepeated": "Order information fields (repeated for each item)", "sourceGroupOrderLine": "Item detail fields", "sourceGroupInventory": "Inventory template fields", "sourceGroupSystem": "System information", "noSourceOptions": "No fields available",
"systemFact": { "task_no": "System task number", "business_no": "Official business number", "warehouse_id": "Freight warehouse", "inventory_source_code": "Inventory source code", "export_date": "Export date" },
"orderFieldOptionsEmpty": "There are no published order-template fields. Publish an Order Template Configuration version first; source fields will then appear here.",
"constantValueHint": "Writes the same value for every export, for example a fixed forwarder code.", "valueFormat": "Output format",
"formatter": { "text": "Write as is", "upper": "Uppercase", "lower": "Lowercase", "date_mmddyyyy": "Date: MM/DD/YYYY", "integer": "Whole number", "decimal": "Decimal" },
"templateLayoutReadFailed": "The Excel template worksheets and headers could not be read. Check the file and try again.",
"excelTemplatesHelp": "Upload and publish versioned shipping templates shared by inventory sources with stable order field IDs.",
"templateCode": "Template code",
"templateFile": "Excel template file",
"filenamePattern": "Export filename pattern",
"templateMappings": "Template field mappings",
"startRow": "Start row",
"targetColumn": "Target column number",
"constantValue": "Constant value",
"chooseSourceField": "Select a source field",
"addTemplateMapping": "Add template mapping",
"templateFileRequired": "An xlsx file is required when creating a template draft",
"publishTemplate": "Publish template",
"retireTemplate": "Retire",
"publishedTemplateImmutable": "Published templates cannot be edited directly; create a new version to reuse the saved file and continue editing.",
"createTemplateVersion": "Create new version",
"confirmRetireTemplate": "Retire this template? It can no longer be bound to a new inventory site.",
"connectionsHelp": "Manage login URLs and credentials for separate accounts. A connection only handles login; it does not define browser actions.",
"credentialsHint": "Usernames and passwords are write-only and are never returned by the UI or API.",
"sources": "Inventory Sites",
"sourcesHelp": "Maintain the report path, query inputs, and recognition aliases, then associate the connection that exports the source.",
"rules": "Routing Rules",
"rulesHelp": "Route order lines to inventory sources by business field, operator, and priority. Published rules cannot be edited.",
"snapshots": "Inventory Snapshots",
"snapshotsHelp": "Read-only view of exported inventory files available for shipping matching.",
"exports": "Export Records",
"exportsHelp": "Read-only inventory export results. Retries and manual exports are not initiated here.",
"externalMappings": "Warehouse Mapping",
"mappingsHelp": "Map a freight warehouse, or a source default, to an external system warehouse code.",
"defaultMapping": "Source Default Mapping",
"loadFailed": "Failed to load shipping inventory configuration",
"createNew": "New",
"saving": "Saving...",
"publish": "Publish Rule",
"retire": "Retire Rule",
"flowOrder": "Order Parsing",
"flowInventory": "Inventory Parsing",
"flowTemplate": "Shipping Template",
"flowRoute": "Routing Rules",
"connectionCode": "Connection Code",
"connectionName": "Connection Name",
"inventorySiteName": "Inventory Site Name",
"connectorType": "Freight Type",
"loginUrl": "Login URL",
"username": "Username",
"password": "Password",
"writeOnlyHint": "Leave blank to keep the existing value",
"enabled": "Enabled",
"enabledState": "Enabled",
"disabledState": "Disabled",
"notGenerated": "Not generated",
"notConfigured": "Not configured",
"parsingProfileGeneratedByTest": "Save the site first, then identify or confirm its inventory parsing through a test export.",
"sourceSavedDisabledHint": "The site remains disabled after its first save. Complete the test export, inventory parsing, and shipping template before activation.",
"activationStatus": "Production Readiness",
"activationReady": "The inventory site is enabled and can run in production.",
"activationDraft": "The inventory site is disabled. Complete the following items before activation.",
"activationRequirement": { "rpa_profile": "System connection is available", "parsing_profile": "Inventory file parsing profile", "excel_template": "Shipping template", "configuration_test": "Test export and parsing validation", "parsing_validation": "Part number, reservation ID, and quantity parse correctly in the test file", "warehouse_identification": "The test file identifies the freight warehouse", "warehouse_mapping": "A freight-to-external warehouse mapping is maintained", "template_validation": "All inventory fields used by the shipping template are supplied by the parsing profile" },
"activateSource": "Enable Inventory Site",
"deactivateSource": "Disable Inventory Site",
"activateSourceConfirm": "The system will verify all production prerequisites before enabling this inventory site.",
"deactivateSourceConfirm": "The site will no longer join new inventory routing or export jobs. Continue?",
"configurationTest": "Test Export", "configurationTestHint": "The test file validates the connection, file structure, and inventory mapping only. It never enters production matching or shipping exports.", "startConfigurationTest": "Test Export", "configurationTestRunning": "Test in progress...", "configurationTestFailed": "Inventory site test export failed.", "configurationTestNoRecommendation": "No published inventory mapping can be used directly. Create or refine an inventory mapping from the test result.", "confirmTestProfile": "Confirm and Bind This Mapping", "configurationTestProfileConfirmed": "The inventory mapping is confirmed; the inventory site remains disabled.", "configurationTestStage": { "waiting_worker": "Waiting for the RPA Worker", "analysing_structure": "Recognising inventory file structure", "ready_for_confirmation": "Test complete; confirm the inventory mapping", "failed": "Test failed" },
"connectionBoundary": "Enter only the login information here. The system handles the required page actions, downloads, and waiting for the selected freight platform.",
"platform": { "dbs": "DBS", "crane": "Crane" },
"sourceCode": "Inventory Source ID",
"connection": "Connection",
"chooseConnection": "Select a connection",
"warehouseResolution": "Warehouse Resolution",
"fixedWarehouse": "Fixed Warehouse",
"inventoryMatch": "Match Inventory Row",
"warehouse": "Freight Warehouse",
"dynamicWarehouse": "Resolved from inventory row",
"snapshotTtl": "Snapshot TTL (seconds)",
"reportPath": "DBS Report Path",
"programGroup": "Program Group",
"programLabel": "Program Label",
"reportGroup": "Report Group",
"reportName": "Report Name",
"queryParameters": "Query Inputs",
"parameterName": "Parameter Name",
"parameterValues": "Values (comma-separated)",
"single": "Single",
"multiText": "Multiple text values",
"multiSelect": "Multi-select",
"required": "Required",
"selectAll": "Select all",
"addParameter": "Add Query Input",
"matchAliases": "Recognition Aliases",
"aliasHint": "Separate aliases with commas",
"ruleCode": "Rule Code",
"ruleName": "Rule Name",
"ruleConditions": "Match Conditions",
"addCondition": "Add Condition",
"noExpectedValue": "This operator needs no expected value",
"scope": "Scope",
"priority": "Priority",
"factPath": "Business Field",
"operator": "Operator",
"operatorEquals": "Equals",
"operatorNotEquals": "Does not equal",
"operatorIn": "Is in list",
"operatorNotIn": "Is not in list",
"operatorPrefix": "Starts with",
"operatorSuffix": "Ends with",
"operatorContains": "Contains",
"operatorNumericLength": "Numeric length equals",
"operatorStringLength": "Text length equals",
"operatorIsEmpty": "Is empty",
"operatorIsNotEmpty": "Is not empty",
"expectedValue": "Expected Value",
"routeScope": { "task": "Whole order", "line": "Each item" },
"routeConditionSource": { "order_field": "Order field", "system_fact": "System-provided information" },
"sourceCandidates": "Candidate inventory sources",
"sourceCandidatesHint": "Choose one or more sources. The system evaluates them in rule-priority order.",
"publishedImmutable": "Published rules are retained as immutable audit definitions. Create and publish a new rule instead.",
"source": "Inventory Source",
"chooseSource": "Select an inventory source",
"freightWarehouse": "Freight Warehouse (optional)",
"externalSystem": "Target system",
"externalOrganization": "Target organization (optional)",
"externalSite": "Target site (optional)",
"externalWarehouseCode": "Target warehouse code",
"externalWarehouseName": "Target warehouse name",
"snapshotStatus": "Snapshot Status",
"snapshotFile": "Snapshot file", "expiresAt": "Valid until", "lineCount": "Inventory rows", "lineCountValue": "{count} rows", "sourceRun": "Source run", "runNo": "Run number", "triggerMode": "Trigger", "startedAt": "Started at", "duration": "Duration", "durationValue": "{seconds} sec", "status": "Status", "actions": "Actions", "viewDetail": "View details", "view": "View", "download": "Download", "detail": "Details", "resizeColumn": "Drag to resize {label} column", "downloadFailed": "Failed to download inventory snapshot", "snapshotDetail": "Snapshot details", "exportDetail": "Export details", "historyNotCaptured": "Not captured in historical record", "exportResultReady": "Inventory file created", "auditStatus": { "ready": "Available", "success": "Success", "failed": "Failed", "partial_failed": "Partially failed", "skipped": "Skipped", "awaiting_rpa": "Running", "unknown": "Historical record" }, "trigger": { "scheduled": "Scheduled", "manual": "Manual" },
"exportResult": "Export Result",
"exportedAt": "Exported At",
"emptySnapshots": "No inventory snapshots to show.",
"emptyExports": "No export records to show.",
"emptyConfig": "No configuration yet. Create the first record.",
"saveFailed": "Failed to save shipping inventory configuration",
"confirmRetire": "This rule will no longer participate in new routing. Continue?",
"confirmRetireTitle": "Confirm retirement",
"confirmDeleteTitle": "Confirm deletion",
"confirmDelete": "Only incorrect configuration without references can be deleted. Continue?",
"deleteFailed": "Failed to delete shipping inventory configuration"
},
"platformApps": {
"guideUsage": "Guide Usage",
@@ -1271,14 +1662,20 @@
},
"shippingCustomers": {
"title": "Shipping Customer Master Data", "subtitle": "Maintain stable customer identities, short codes, identifiers, and initial imports", "add": "Add Customer", "edit": "Edit Customer", "saving": "Saving...", "importButton": "Initial Import", "search": "Search", "searchPlaceholder": "Search by customer name or short code", "empty": "No customers", "deactivate": "Deactivate", "confirmDeactivate": "Deactivate customer \"{name}\"? Historical business references will be retained.", "yes": "Yes", "no": "No",
"fields": { "standardName": "Standard customer name", "shortCode": "Customer short code", "shortCodeHint": "2-6 letters; saved in uppercase", "status": "Status", "remark": "Remark" },
"externalRefs": { "title": "External-system customer codes", "hint": "Used for exact Bill-to matching; the short code still comes from the standard customer.", "empty": "No external-system customer codes", "sourceSystem": "Source system, e.g. ERP", "customerCode": "External customer code" },
"sites": { "title": "Delivery sites", "hint": "Used for Ship-to customer and Ship-to Code matching without creating another billing customer.", "empty": "No delivery sites", "siteName": "Site name", "siteCode": "Ship-to Code", "address": "Delivery address", "city": "City", "country": "Country/region" },
"deleteDialog": { "open": "Delete permanently", "title": "Permanently delete customer", "subtitle": "Only mistakenly created customers outside every business and audit chain can be deleted.", "loading": "Checking deletion eligibility...", "identifiers": "{count} identifier(s) will be deleted with this customer.", "blocked": "This customer cannot be deleted permanently", "blockedHint": "Deactivate it or use the customer merge workflow instead.", "warning": "This cannot be undone. Enter the customer short code and a deletion reason to confirm.", "confirmationShortCode": "Enter customer short code {shortCode} to confirm", "reason": "Deletion reason", "confirm": "Delete permanently", "deleted": "Customer deleted permanently", "failed": "Failed to delete customer permanently", "blockers": { "business_cases": "Business cases", "business_sequences": "Business number sequences", "external_references": "External reference keys", "import_target_rows": "Import target rows", "import_result_rows": "Import result rows", "shadow_top_candidates": "Shadow top candidates", "shadow_manual_labels": "Shadow human labels", "shadow_candidate_matches": "Shadow candidate matches", "merged_source_customers": "Merged source customers", "merged_into_customer": "Target customer merge relationship" } },
"mergeDialog": { "open": "Merge customer", "title": "Merge duplicate customers", "subtitle": "Historical business and audit records stay unchanged; only future identity configuration moves to the target customer.", "source": "Source customer", "target": "Target customer", "chooseTarget": "Select an active target customer", "historyTitle": "Historical references retained", "historyHint": "Existing business numbers, cases, imports, and shadow audits remain on the source customer and are not rewritten.", "historyCount": "{count} historical or audit reference(s) remain unchanged", "migrateTitle": "Future configuration merged", "identifiers": "Identifiers moved", "duplicates": "Duplicate identifiers", "references": "Reference keys", "warning": "The source customer becomes merged and cannot be used for new tasks or edited again.", "confirmationShortCode": "Enter source short code {shortCode} to confirm", "reason": "Merge reason", "confirm": "Confirm merge", "merged": "Customer merged", "failed": "Failed to merge customer", "previewFailed": "Failed to load merge preview" },
"fields": { "standardName": "Standard customer name", "shortCode": "Customer short code", "shortCodeHint": "2-6 letters; saved in uppercase", "status": "Status", "remark": "Remark", "changeReason": "Change reason", "changeReasonHint": "Required when changing short code or status" },
"headers": { "name": "Customer", "shortCode": "Short code", "status": "Status", "identifiers": "Identifiers", "cases": "Cases", "actions": "Actions" },
"status": { "all": "All statuses", "active": "Active", "inactive": "Inactive" },
"status": { "all": "All statuses", "active": "Active", "inactive": "Inactive", "merged": "Merged" },
"identifierStatus": { "pending": "Pending", "approved": "Approved", "disabled": "Disabled" },
"identifierTypes": { "name_alias": "Name alias", "email": "Email", "domain": "Domain", "template_fingerprint": "Template fingerprint", "address": "Address", "contact": "Contact" },
"identifiers": { "title": "Customer Identifiers", "type": "Type", "value": "Raw / normalized value", "status": "Review status", "autoMatch": "Auto-match allowed", "empty": "No identifiers", "approve": "Approve", "enableAuto": "Enable auto-match", "disable": "Disable", "add": "Add Identifier", "valuePlaceholder": "Enter alias, email, domain, etc.", "allowAuto": "Allow auto-match" },
"import": { "title": "Initial Customer Import", "subtitle": "Stage upload, validate conflicts, decide warnings, then publish atomically", "file": "Excel file", "sourceSystem": "Source system", "downloadTemplate": "Download template", "upload": "Upload & validate", "uploaded": "File validation completed", "uploadFailed": "Upload validation failed", "row": "Location", "type": "Row type", "key": "Legacy key", "preview": "Preview", "validation": "Validation", "decision": "Publish action", "choose": "Choose", "target": "Select target customer", "publish": "Publish batch", "published": "Customer import published", "publishFailed": "Publish failed", "alreadyPublished": "Published", "downloadReconciliation": "Download reconciliation CSV", "downloadFailed": "File download failed", "decisionFailed": "Failed to save row decision", "stats": { "total": "Total", "valid": "Valid", "warning": "Warnings", "error": "Errors", "published": "Published" }, "rowTypes": { "customer": "Customer", "identifier": "Identifier" }, "validationStatus": { "valid": "Valid", "warning": "Decision required", "error": "Blocked" }, "actions": { "create": "Create", "update": "Update", "merge": "Merge", "skip": "Skip" } },
"shadow": { "title": "Customer Shadow Resolution Quality", "subtitle": "Shadow samples have no side effects; the panel also shows controlled auto-confirmation and admin correction metrics", "refresh": "Refresh report", "loadFailed": "Failed to load shadow report", "labelFailed": "Failed to save human label", "labeled": "Human label saved", "sample": "Candidate / intake", "status": "Shadow result", "topCandidate": "Top candidate", "manualLabel": "Human label", "chooseCustomer": "Select standard customer", "empty": "No shadow samples", "auditTitle": "Customer Resolution and Correction Audit", "auditTask": "Task number", "auditEvent": "Event", "auditBusinessNo": "Business number", "auditTime": "Time", "auditEmpty": "No customer audit events", "cards": { "total": "Total samples", "unique": "Unique candidate", "ambiguous": "Ambiguous", "unmatched": "Unmatched", "accuracy": "Labeled accuracy", "autoBound": "Auto-bound", "autoRate": "Auto-confirm rate", "corrected": "Corrected tasks" }, "statuses": { "unique_candidate": "Unique candidate", "ambiguous": "Ambiguous", "unmatched": "Unmatched", "failed": "Shadow calculation failed" }, "events": { "customer_auto_resolution_evaluated": "Auto-resolution evaluated", "customer_auto_confirmed": "Customer auto-confirmed", "customer_correction_applied": "Customer correction applied", "customer_historical_backfilled": "Historical customer backfilled" } },
"lifecycle": { "open": "Governance timeline", "title": "Customer Governance Timeline", "loading": "Loading timeline...", "empty": "No governance events", "time": "Time", "event": "Event", "reason": "Reason", "change": "Change", "events": { "created": "Customer created", "updated": "Customer updated", "identifier_created": "Identifier added", "identifier_updated": "Identifier updated", "merged_source": "Merged as source", "merged_target": "Merged as target", "deleted": "Permanently deleted" } },
"prompts": { "deactivateReason": "Enter the reason for deactivation", "identifierChangeReason": "Enter the reason for approving, disabling, or authorizing auto-match" },
"shadow": { "title": "Customer Shadow Resolution Quality", "subtitle": "Shadow samples have no side effects; the panel also shows controlled auto-confirmation and admin correction metrics", "refresh": "Refresh report", "loadFailed": "Failed to load shadow report", "labelFailed": "Failed to save human label", "labeled": "Human label saved", "sample": "Candidate / intake", "status": "Shadow result", "topCandidate": "Top candidate", "manualLabel": "Human label", "chooseCustomer": "Select standard customer", "empty": "No shadow samples", "auditTitle": "Customer Resolution and Correction Audit", "auditTask": "Task number", "auditEvent": "Event", "auditBusinessNo": "Business number", "auditTime": "Time", "auditEmpty": "No customer audit events", "cards": { "total": "Total samples", "unique": "Unique candidate", "ambiguous": "Ambiguous", "unmatched": "Unmatched", "accuracy": "Labeled accuracy", "autoBound": "Auto-bound", "autoRate": "Auto-confirm rate", "corrected": "Corrected tasks" }, "statuses": { "unique_candidate": "Unique candidate", "ambiguous": "Ambiguous", "unmatched": "Unmatched", "failed": "Shadow calculation failed" }, "events": { "customer_auto_resolution_evaluated": "Auto-resolution evaluated", "customer_auto_confirmed": "Customer auto-confirmed", "customer_correction_applied": "Customer correction applied" }, "gate": { "title": "Auto-confirmation quality gate", "metrics": "Eligible human-labeled samples {samples}/{minSamples}; accuracy {accuracy} (required {minAccuracy})", "statuses": { "eligible": "Gate passed: unique strong evidence may be auto-confirmed", "insufficient_labeled_samples": "Safety downgrade: insufficient eligible human-labeled samples", "insufficient_accuracy": "Safety downgrade: labeled accuracy is below the threshold" } } },
"msg": { "loadFailed": "Failed to load customers", "nameRequired": "Enter a standard customer name", "shortCodeInvalid": "Short code must contain 2-6 letters", "saved": "Customer saved", "saveFailed": "Save failed", "identifierRequired": "Enter an identifier value", "identifierSaved": "Identifier saved" }
},
"role": {
+18 -34
View File
@@ -15,6 +15,8 @@
"uploading": "Uploading",
"processing": "Processing",
"ready": "Ready",
"parsing": "Parsing",
"parseSucceeded": "Parsed successfully",
"uploadFailed": "Upload failed",
"parseFailed": "Processing failed",
"retry": "Retry upload",
@@ -92,6 +94,17 @@
"shippingNoticeDuplicateResolved": "Duplicate resolution saved.",
"shippingNoticeDuplicateResolveFailed": "Failed to save duplicate resolution.",
"shippingCandidateTitle": "Order candidate review",
"shippingCustomerMatch": {
"title": "Customer matching",
"role": "Role",
"rawName": "Order text",
"standardName": "Standard customer",
"shortCode": "Short code",
"site": "Delivery site",
"statusLabel": "Status",
"roles": { "bill_to": "Bill-to", "ship_to": "Ship-to" },
"status": { "unmatched": "Unmatched", "unique_candidate": "Unique candidate", "ambiguous": "Multiple candidates", "confirmed": "Confirmed" }
},
"shippingCandidateCount": "{count} orders",
"shippingCandidateReady": "Ready",
"shippingCandidateNeedsReview": "Needs review",
@@ -126,23 +139,14 @@
"shippingCandidateUpdateDone": "Order candidate changes were saved.",
"shippingCandidateUpdateFailed": "Failed to save the order candidate.",
"shippingInventoryUploadFailed": "Inventory upload failed.",
"shippingInventorySiteRequired": "Formal inventory files must be imported by an enabled inventory source. To analyse a spreadsheet in the conversation, explicitly state that it is an inventory file.",
"shippingNoticeSpreadsheetIntentRequired": "The spreadsheet is attached. Please explicitly say it is an inventory file (for example, \"This is an inventory file, please analyse it\") before continuing; the system does not infer its purpose from the extension alone.",
"shippingNoticeRefreshDone": "Current task status refreshed.",
"shippingNoticeRetryUploadAction": "Retry freight upload",
"shippingNoticeRetryUploadQueued": "Upload has been triggered again. Refresh later to check the result.",
"shippingNoticeRetryUploadFailed": "Retry upload failed.",
"shippingNoticePasteHint": "Paste inventory rows in the input box, then send.",
"shippingNoticeDecisionDone": "Action completed.",
"shippingNoticePrompt": {
"inventory": {
"prefix": "I have uploaded the inventory file",
"prefixWithFile": "I have uploaded the inventory file \"{fileName}\"",
"prefixBatch": "I have uploaded the batch inventory snapshot for batch {batchNo}",
"prefixBatchWithFile": "I have uploaded the batch inventory snapshot \"{fileName}\" for batch {batchNo}",
"mapInferSuggested": "{prefix}. Continue the inventory column mapping. If a complete mapping is available, apply it directly and reply with one short status sentence that the inventory field confirmation is ready. Do not list operation menus, numbered options, button lists, or phrases like \"choose one of the following\"; clickable actions are rendered by system buttons.",
"mapInferPending": "{prefix}. Continue parsing the inventory column mapping, then reply with one short status sentence when the inventory field confirmation is ready. Do not list operation menus, numbered options, button lists, or phrases like \"choose one of the following\"; clickable actions are rendered by system buttons.",
"alignReview": "{prefix}. Reply with one short sentence saying the inventory field confirmation is ready and ask me to check the columns before continuing. Do not list operation menus, numbered options, button lists, or phrases like \"choose one of the following\"; clickable actions are rendered by system buttons.",
"default": "{prefix}. Continue the inventory import and only state the current status. Do not list operation menus, numbered options, button lists, or phrases like \"choose one of the following\"; clickable actions are rendered by system buttons."
},
"notice": {
"fileLabelSingleFile": "\"{fileName}\"",
"fileLabelMulti": "{fileCount} shipping notices",
@@ -151,29 +155,12 @@
"batchLabel": "batch {batchNo}",
"taskLabel": "current task {taskId}",
"taskList": "Task list: {taskIds}.",
"autoInventoryAction": "Upload inventory and align columns",
"autoNoticeAction": "Create tasks and parse shipping notices",
"autoSpreadsheetAction": "Please specify whether this is an order file or an inventory file",
"multiTask": "{summary}. {taskListText}Please only handle the current focus task. Read the current task status first; if it still needs parsing, parse the shipping notice and save the result. If it is already in a later step, explain the current progress and next step directly. Do not ask me again whether parsing should start, and do not loop through other tasks in the batch.",
"singleTask": "{summary}. Read the current task status first; if it still needs parsing, parse the shipping notice and save the result. If it is already in a later step, explain the current progress and next step directly. Do not ask me again whether parsing should start."
}
},
"shippingNoticeMapping": {
"inventoryHeaders": "Inventory headers",
"headerRow": "Header row: {row}",
"sample": "Sample",
"orderDetails": "Order details",
"orderRowCount": "Order rows: {count}",
"orderPartNumberPreview": "Internal part numbers (first {count}): {partNumbers}",
"partNumberColumnRequired": "Internal part number column (required)",
"availableQtyColumnRequired": "Available qty column (required)",
"reservationIdColumnRequired": "Reservation ID column (required)",
"selectHeader": "Select a header",
"reupload": "Re-upload",
"applying": "Applying...",
"applyAndParse": "Apply mapping and parse",
"empty": "(empty)",
"unrecognized": "(unrecognized)"
},
"shippingParsedResult": {
"title": "Parsed order result",
"statusBlocked": "Blocked",
@@ -299,8 +286,6 @@
"shortageNoDetails": "No inventory shortage was found for task {taskId}.",
"diagnosisInventoryRpaTitle": "Inventory RPA did not return an available inventory snapshot.",
"diagnosisInventoryRpaAdvice": "Retry inventory capture first; if the external system is unavailable, upload an inventory file manually.",
"diagnosisAlignReviewTitle": "Inventory column mapping needs manual confirmation.",
"diagnosisAlignReviewAdvice": "Confirm SKU, Reservation ID, and available-quantity mappings to avoid matching the wrong item.",
"diagnosisParseReviewTitle": "Notice parsing confidence is low and needs review.",
"diagnosisParseReviewAdvice": "Check customer, PO, required date, and order lines before continuing.",
"diagnosisReservationRequiredTitle": "Reservation ID is missing, so inventory cannot be locked by reservation.",
@@ -362,7 +347,6 @@
"blockedUploadRetryable": "Upload failed, retry available",
"suggestedAction": "Suggested action:",
"suggestShortageActions": "View shortage / revise notice / rematch",
"suggestConfirmMapping": "Confirm column mapping, then continue matching",
"suggestReviewParse": "Review parsed fields, then confirm or revise",
"suggestRetryStep": "Inspect the blocker, then retry this step",
"suggestViewOnly": "Review export files or receipts",
@@ -423,7 +407,7 @@
"noticeParse": "Notice parsing",
"parseConfirm": "Confirm parsing",
"inventoryPrepare": "Inventory prep",
"alignConfirm": "Confirm mapping",
"alignConfirm": "Validate inventory",
"inventoryMatch": "Inventory match",
"shortageHandle": "Shortage handling",
"generateExcel": "Generate Excel",
@@ -449,7 +433,7 @@
"noticeSubmit": "Submit notice",
"parseConfirm": "Confirm parsing",
"inventoryPrepare": "Get inventory",
"alignConfirm": "Confirm mapping",
"alignConfirm": "Validate inventory",
"matchInventory": "Match inventory",
"generateFile": "Generate shipment file",
"uploadFreight": "Upload freight"
+109 -4
View File
@@ -1,7 +1,34 @@
{
"generic": "Request failed.",
"codes": {
"SHIPPING_ORDER_SCHEMA_NOT_FOUND": "The order template has not been initialized.",
"SHIPPING_ORDER_SCHEMA_EXISTS": "The order template already exists.",
"SHIPPING_ORDER_SCHEMA_DRAFT_EXISTS": "An order template draft already exists. Complete or publish it first.",
"SHIPPING_ORDER_SCHEMA_VERSION_INVALID": "The order field version configuration is invalid.",
"SHIPPING_ORDER_SCHEMA_LOCK_VERSION_REQUIRED": "The order field draft is missing its version lock. Refresh and try again.",
"SHIPPING_ORDER_SCHEMA_VERSION_CONFLICT": "Another administrator changed this order field draft. The page will reload the latest version.",
"SHIPPING_ORDER_SCHEMA_VERSION_IMMUTABLE": "A published order field version cannot be modified.",
"SHIPPING_ORDER_SCHEMA_VERSION_NOT_FOUND": "The order field version was not found.",
"SHIPPING_ORDER_SCHEMA_VERSION_DELETE_BLOCKED": "Only a draft version can be deleted.",
"SHIPPING_ORDER_SCHEMA_PUBLISH_INVALID": "The current order field version cannot be published.",
"SHIPPING_ORDER_SCHEMA_PUBLISH_DEPENDENCY_BLOCKED": "This version removes order fields still referenced by inventory routes, parsing profiles, or Excel templates. Migrate those configurations first.",
"SHIPPING_ORDER_SCHEMA_NOT_PUBLISHED": "No usable order field version has been published.",
"SHIPPING_ORDER_FIELD_INVALID": "The order field code, scope, or type is invalid.",
"SHIPPING_ORDER_FIELD_NOT_FOUND": "The order field was not found.",
"SHIPPING_ORDER_FIELD_IMMUTABLE": "Order field code, scope, and type are immutable after publication.",
"SHIPPING_ORDER_FIELD_CONFLICT": "The order field code already exists.",
"SHIPPING_ORDER_FIELD_RETIRE_BLOCKED": "The order field is referenced by a draft version and cannot be retired.",
"AUTH_UNAUTHORIZED": "Please log in first.",
"SHIPPING_CUSTOMER_DELETE_REASON_REQUIRED": "A reason is required to delete a customer permanently.",
"SHIPPING_CUSTOMER_DELETE_CONFIRMATION_INVALID": "The deletion confirmation short code is incorrect.",
"SHIPPING_CUSTOMER_DELETE_BLOCKED": "The customer has business or audit references and cannot be deleted permanently.",
"SHIPPING_CUSTOMER_MERGED_LOCKED": "The customer has been merged and cannot be used for new business or edited.",
"SHIPPING_CUSTOMER_MERGE_TARGET_REQUIRED": "Select a target customer to merge into.",
"SHIPPING_CUSTOMER_MERGE_TARGET_INVALID": "The merge target customer must be active.",
"SHIPPING_CUSTOMER_MERGE_SAME_CUSTOMER": "The source and target customers must differ.",
"SHIPPING_CUSTOMER_MERGE_SOURCE_ALREADY_MERGED": "The source customer has already been merged.",
"SHIPPING_CUSTOMER_MERGE_REASON_REQUIRED": "A reason is required to merge customers.",
"SHIPPING_CUSTOMER_MERGE_CONFIRMATION_INVALID": "The source customer short code for merge confirmation is incorrect.",
"AUTH_INCORRECT_PASSWORD": "Incorrect password",
"AUTH_INCORRECT_CURRENT_PASSWORD": "Incorrect current password",
"AUTH_USER_NOT_FOUND": "User not found",
@@ -10,6 +37,80 @@
"RESOURCE_NOT_FOUND": "The requested resource was not found.",
"RESOURCE_CONFLICT": "Request conflict. Please refresh and try again.",
"VALIDATION_INVALID_PARAM": "Invalid request parameters.",
"SHIPPING_INVENTORY_EXTERNAL_MAPPING_NOT_FOUND": "The external system warehouse mapping was not found.",
"SHIPPING_INVENTORY_EXTERNAL_MAPPING_CONFLICT": "An active external system warehouse mapping already exists for this inventory source and freight warehouse.",
"SHIPPING_INVENTORY_SOURCE_CONFIG_INVALID": "The inventory source report path, query parameters, or aliases are invalid.",
"SHIPPING_RPA_PROFILE_CONFIG_INVALID": "The freight login connection configuration is invalid; only username and password authentication is currently supported.",
"SHIPPING_EXCEL_TEMPLATE_ASSET_INVALID": "The Excel template file is invalid or cannot be read.",
"SHIPPING_EXCEL_TEMPLATE_DEFINITION_INVALID": "The Excel template mapping definition is invalid.",
"SHIPPING_EXCEL_TEMPLATE_DELETE_BLOCKED": "Only draft Excel templates can be deleted.",
"SHIPPING_EXCEL_TEMPLATE_DRAFT_EXISTS": "This template already has a draft version.",
"SHIPPING_EXCEL_TEMPLATE_FIELD_INVALID": "The Excel template field mapping is invalid.",
"SHIPPING_EXCEL_TEMPLATE_IMMUTABLE": "Published or retired Excel templates cannot be modified.",
"SHIPPING_EXCEL_TEMPLATE_INVALID": "The Excel template configuration is invalid.",
"SHIPPING_EXCEL_TEMPLATE_NOT_FOUND": "The Excel template was not found.",
"SHIPPING_EXCEL_TEMPLATE_PUBLISH_INVALID": "This Excel template cannot be published.",
"SHIPPING_EXCEL_TEMPLATE_REQUIRED": "A published Excel template is required before enabling an inventory source.",
"SHIPPING_EXCEL_TEMPLATE_RETIRE_BLOCKED": "The Excel template is still referenced by an inventory source and cannot be retired.",
"SHIPPING_EXCEL_TEMPLATE_RETIRE_INVALID": "This Excel template cannot be retired.",
"SHIPPING_EXCEL_TEMPLATE_TARGET_DUPLICATE": "The Excel template contains duplicate target cell mappings.",
"SHIPPING_EXPORT_ARCHIVE_EMPTY": "The selected tasks have no export files available for download.",
"SHIPPING_EXPORT_ARCHIVE_NOT_FOUND": "No export file is available for download.",
"SHIPPING_EXPORT_ARCHIVE_SELECTION_INVALID": "The batch download task selection is invalid.",
"SHIPPING_EXPORT_ARCHIVE_TOO_LARGE": "A batch download supports at most 100 tasks.",
"SHIPPING_INVENTORY_PARSING_PROFILE_DELETE_BLOCKED": "Only draft inventory parsing profiles can be deleted.",
"SHIPPING_INVENTORY_PARSING_PROFILE_IMMUTABLE": "Published or retired inventory parsing profiles cannot be modified.",
"SHIPPING_INVENTORY_PARSING_PROFILE_INVALID": "The inventory parsing profile is invalid.",
"SHIPPING_INVENTORY_PARSING_PROFILE_NOT_FOUND": "The inventory parsing profile was not found.",
"SHIPPING_INVENTORY_PARSING_PROFILE_PUBLISH_INVALID": "This inventory parsing profile cannot be published.",
"SHIPPING_INVENTORY_PARSING_PROFILE_REQUIRED": "A published inventory parsing profile is required before enabling an inventory source.",
"SHIPPING_INVENTORY_PARSING_PROFILE_RETIRE_BLOCKED": "The inventory parsing profile is still referenced by an inventory source and cannot be retired.",
"SHIPPING_INVENTORY_PARSING_PROFILE_RETIRE_INVALID": "This inventory parsing profile cannot be retired.",
"SHIPPING_INVENTORY_FIELD_CONFLICT": "The inventory field name already exists.",
"SHIPPING_INVENTORY_FIELD_DELETE_BLOCKED": "This inventory field is core or still referenced by configuration, so it cannot be deleted or retired.",
"SHIPPING_INVENTORY_FIELD_IMMUTABLE": "A retired inventory field cannot be edited, and a core field's format and purpose are immutable.",
"SHIPPING_INVENTORY_FIELD_INVALID": "The inventory field information is incomplete or invalid.",
"SHIPPING_INVENTORY_FIELD_NOT_FOUND": "The inventory field was not found.",
"SHIPPING_INVENTORY_FIELD_RETIRE_BLOCKED": "This inventory field is still referenced by configuration and cannot be retired.",
"SHIPPING_INVENTORY_RULE_CONDITION_INVALID": "The inventory routing rule condition is invalid.",
"SHIPPING_INVENTORY_RULE_CONDITIONS_REQUIRED": "An inventory routing rule requires at least one condition.",
"SHIPPING_INVENTORY_RULE_CONFLICT": "The inventory routing rule name or priority conflicts with another rule.",
"SHIPPING_INVENTORY_RULE_DELETE_BLOCKED": "Only draft inventory routing rules can be deleted.",
"SHIPPING_INVENTORY_RULE_IMMUTABLE": "Published inventory routing rules cannot be modified.",
"SHIPPING_INVENTORY_RULE_INVALID": "The inventory routing rule configuration is invalid.",
"SHIPPING_INVENTORY_RULE_NOT_FOUND": "The inventory routing rule was not found.",
"SHIPPING_INVENTORY_RULE_PUBLISH_INVALID": "This inventory routing rule cannot be published.",
"SHIPPING_INVENTORY_RULE_SOURCE_INVALID": "The inventory routing rule references an unavailable inventory source.",
"SHIPPING_INVENTORY_RULE_RETIRE_INVALID": "This inventory routing rule cannot be retired.",
"SHIPPING_INVENTORY_SOURCE_DELETE_BLOCKED": "The inventory source is still referenced by business data and cannot be deleted.",
"SHIPPING_INVENTORY_SOURCE_NOT_FOUND": "The inventory source was not found.",
"SHIPPING_INVENTORY_SOURCE_ACTIVATION_REQUIRED": "Complete the test export and activation checks before enabling the inventory site.",
"SHIPPING_INVENTORY_SOURCE_ACTIVATION_BLOCKED": "The inventory site has not completed its production readiness checks and cannot be enabled.",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_FILE_REQUIRED": "Select an inventory sample file.",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_FILE_TOO_LARGE": "The inventory sample file exceeds the 20 MB limit.",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_INVALID": "The inventory sample file cannot be recognised. Check its format and headers.",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_NOT_FOUND": "The inventory file structure recognition record was not found.",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_SELECTION_INVALID": "The selected worksheet, header, or source column is not in the inventory file recognition result.",
"SHIPPING_TEMP_INVENTORY_CONTEXT_INVALID": "The current conversation context cannot process a temporary inventory file.",
"SHIPPING_TEMP_INVENTORY_ASSET_REQUIRED": "Upload an inventory file first.",
"SHIPPING_TEMP_INVENTORY_ASSET_NOT_FOUND": "No inventory file is available in this conversation.",
"SHIPPING_TEMP_INVENTORY_ASSET_NOT_READY": "The inventory file is still uploading. Try again shortly.",
"SHIPPING_TEMP_INVENTORY_FILE_TYPE_INVALID": "Temporary inventory files must be .xls, .xlsx, or .csv.",
"SHIPPING_TEMP_INVENTORY_FILE_TOO_LARGE": "The temporary inventory file exceeds the 20 MB limit.",
"SHIPPING_TEMP_INVENTORY_ANALYSIS_INVALID": "The inventory file structure could not be recognized. Check its format and headers.",
"SHIPPING_TEMP_INVENTORY_SESSION_NOT_FOUND": "The temporary inventory session does not exist, has expired, or is not accessible.",
"SHIPPING_TEMP_INVENTORY_MAPPING_STATE_INVALID": "This temporary inventory session cannot accept another mapping suggestion.",
"SHIPPING_TEMP_INVENTORY_MAPPING_INVALID": "The inventory mapping suggestion is invalid, incomplete, or uses columns not in the file.",
"SHIPPING_TEMP_INVENTORY_CONFIRMATION_INVALID": "Temporary inventory confirmation requirements are not met. Select a recommended profile or mapping again.",
"SHIPPING_TEMP_INVENTORY_QUALITY_INVALID": "The temporary inventory file did not pass part number, reservation ID, or available quantity validation.",
"SHIPPING_TEMP_INVENTORY_SESSION_EXPIRED": "The temporary inventory session has expired. Upload the file again.",
"SHIPPING_TEMP_INVENTORY_TASK_NOT_FOUND": "No shipping task in this conversation can use the temporary inventory.",
"SHIPPING_INVENTORY_CONFIGURATION_TEST_INVALID": "Run the test export while the inventory site is disabled.", "SHIPPING_INVENTORY_CONFIGURATION_TEST_UNAVAILABLE": "The RPA Worker is unavailable and cannot start a test export.", "SHIPPING_INVENTORY_CONFIGURATION_TEST_NOT_FOUND": "The inventory site test export record was not found.", "SHIPPING_INVENTORY_CONFIGURATION_TEST_NOT_READY": "The test export has not completed and its parsing plan cannot be confirmed.", "SHIPPING_INVENTORY_CONFIGURATION_TEST_STALE": "The inventory site configuration changed. Run the test export again.",
"SHIPPING_RPA_PROFILE_CONFLICT": "The freight login profile name already exists.",
"SHIPPING_RPA_PROFILE_DELETE_BLOCKED": "The freight login profile is still referenced by an inventory source and cannot be deleted.",
"SHIPPING_RPA_PROFILE_DISABLE_BLOCKED": "The freight login profile is still referenced by an enabled inventory source and cannot be disabled.",
"SHIPPING_RPA_PROFILE_DISABLED": "Enable the freight login profile before enabling its inventory source.",
"SHIPPING_RPA_PROFILE_NOT_FOUND": "The freight login profile was not found.",
"USER_USERNAME_REQUIRED": "Username is required.",
"USER_USERNAME_EXISTS": "Username already exists.",
"USER_EMAIL_INVALID": "Invalid email format.",
@@ -84,7 +185,8 @@
"SHIPPING_CUSTOMER_SHADOW_LABEL_REQUIRED": "Select a standard customer as the human label.",
"SHIPPING_CUSTOMER_CONFIRMATION_REQUIRED": "The standard customer is not confirmed. Select the official customer first.",
"SHIPPING_CUSTOMER_CONFIRMATION_CUSTOMER_REQUIRED": "Select a standard customer.",
"SHIPPING_CUSTOMER_CONFIRMATION_LEGACY_UNSUPPORTED": "Customer confirmation is not supported for this legacy task.",
"SHIPPING_CUSTOMER_CASE_REQUIRED": "The shipping task is missing its required business case and cannot confirm a customer.",
"SHIPPING_NOTICE_REVISION_CASE_MISSING": "The revision target is missing its required business case and cannot create a revision.",
"SHIPPING_CUSTOMER_INACTIVE": "The selected customer is inactive.",
"SHIPPING_CUSTOMER_NUMBERED_CASE_LOCKED": "A numbered business case cannot silently change customer.",
"SHIPPING_FIELD_CONFLICT_NOT_FOUND": "Order field conflict not found.",
@@ -97,8 +199,6 @@
"SHIPPING_BUSINESS_NUMBER_CUSTOMER_REQUIRED": "Confirm the standard customer before assigning a business number.",
"SHIPPING_BUSINESS_NUMBER_CUSTOMER_INVALID": "The customer is inactive or missing; a business number cannot be assigned.",
"SHIPPING_BUSINESS_NUMBER_SHORT_CODE_INVALID": "The customer short code must contain 2-6 uppercase letters.",
"SHIPPING_HISTORICAL_TASK_NOT_FOUND": "Historical task not found.",
"SHIPPING_HISTORICAL_BACKFILL_INVALID": "This task is not eligible for historical customer backfill.",
"SHIPPING_CUSTOMER_CORRECTION_TASK_REQUIRED": "Enter the technical or business number to correct.",
"SHIPPING_CUSTOMER_CORRECTION_REASON_REQUIRED": "A reason is required for customer correction.",
"SHIPPING_CUSTOMER_CORRECTION_NUMBER_REQUIRED": "Only a numbered business case can be corrected.",
@@ -106,6 +206,11 @@
"SHIPPING_CUSTOMER_CORRECTION_UNCHANGED": "The corrected customer is the same as the current customer.",
"SHIPPING_CUSTOMER_CORRECTION_TASK_MISSING": "The task or business case to correct was not found.",
"SHIPPING_CUSTOMER_CORRECTION_UPLOADED_BLOCKED": "The task was uploaded to the forwarder. Complete the external cancellation workflow first.",
"SHIPPING_CUSTOMER_NOT_FOUND": "Customer not found.", "SHIPPING_CUSTOMER_NAME_REQUIRED": "Standard customer name is required.", "SHIPPING_CUSTOMER_SHORT_CODE_INVALID": "Customer short code must contain 2-6 letters.", "SHIPPING_CUSTOMER_SHORT_CODE_EXISTS": "Customer short code already exists.", "SHIPPING_CUSTOMER_STATUS_INVALID": "Invalid customer status.", "SHIPPING_CUSTOMER_CONFLICT": "Customer data conflict.", "SHIPPING_CUSTOMER_IDENTIFIER_TYPE_INVALID": "Invalid identifier type.", "SHIPPING_CUSTOMER_IDENTIFIER_VALUE_REQUIRED": "Identifier value is required.", "SHIPPING_CUSTOMER_EMAIL_INVALID": "Invalid customer email.", "SHIPPING_CUSTOMER_DOMAIN_INVALID": "Invalid customer domain.", "SHIPPING_CUSTOMER_IDENTIFIER_STATUS_INVALID": "Invalid identifier status.", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_FOUND": "Identifier not found.", "SHIPPING_CUSTOMER_IDENTIFIER_EXISTS": "Identifier already exists.", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_APPROVED": "Only approved identifiers can enable automatic matching.", "SHIPPING_CUSTOMER_PUBLIC_DOMAIN_AUTO_MATCH_FORBIDDEN": "Public email domains cannot be used for automatic matching.", "SHIPPING_CUSTOMER_EXTERNAL_REF_CONFLICT": "The legacy customer key is bound to another customer.", "SHIPPING_CUSTOMER_IMPORT_FILE_REQUIRED": "Select an import file.", "SHIPPING_CUSTOMER_IMPORT_FILE_TYPE_INVALID": "Only .xlsx files are supported.", "SHIPPING_CUSTOMER_IMPORT_FILE_EMPTY": "The import file is empty.", "SHIPPING_CUSTOMER_IMPORT_FILE_TOO_LARGE": "The import file exceeds 5 MB.", "SHIPPING_CUSTOMER_IMPORT_FILE_INVALID": "Invalid import workbook.", "SHIPPING_CUSTOMER_IMPORT_SHEET_MISSING": "A required worksheet is missing.", "SHIPPING_CUSTOMER_IMPORT_COLUMNS_MISSING": "Required import columns are missing.", "SHIPPING_CUSTOMER_IMPORT_KEY_REQUIRED": "Legacy customer key is required.", "SHIPPING_CUSTOMER_IMPORT_DUPLICATE_KEY": "Duplicate legacy key in the same source.", "SHIPPING_CUSTOMER_IMPORT_SHORT_CODE_CONFLICT": "Short code conflicts with an existing customer.", "SHIPPING_CUSTOMER_IMPORT_NAME_MATCH": "Customer name may duplicate an existing customer.", "SHIPPING_CUSTOMER_IMPORT_IDENTIFIER_CUSTOMER_MISSING": "No customer mapping was found for this identifier.", "SHIPPING_CUSTOMER_IMPORT_NOT_FOUND": "Import batch not found.", "SHIPPING_CUSTOMER_IMPORT_ROW_NOT_FOUND": "Import row not found.", "SHIPPING_CUSTOMER_IMPORT_DECISION_INVALID": "Invalid import row action.", "SHIPPING_CUSTOMER_IMPORT_TARGET_REQUIRED": "Select a target customer for update or merge.", "SHIPPING_CUSTOMER_IMPORT_HAS_ERRORS": "The import batch contains blocking errors.", "SHIPPING_CUSTOMER_IMPORT_DECISIONS_REQUIRED": "Resolve all warning rows first.", "SHIPPING_CUSTOMER_IMPORT_ALREADY_PUBLISHED": "The import batch is already published.", "SHIPPING_CUSTOMER_IMPORT_UPLOAD_CONFLICT": "A conflict occurred while staging the import.", "SHIPPING_CUSTOMER_IMPORT_PUBLISH_CONFLICT": "A data conflict occurred while publishing the import."
"SHIPPING_ORDER_EXTRACTION_NOT_FOUND": "The order extraction does not exist or is not accessible.",
"SHIPPING_ORDER_CUSTOMER_REQUIRED": "Select a standard customer.",
"SHIPPING_ORDER_CUSTOMER_ROLE_INVALID": "The customer role is invalid.",
"SHIPPING_ORDER_CUSTOMER_MATCH_NOT_FOUND": "The order customer match does not exist.",
"SHIPPING_ORDER_CUSTOMER_SITE_INVALID": "Select an active delivery site belonging to this customer.",
"SHIPPING_CUSTOMER_NOT_FOUND": "Customer not found.", "SHIPPING_CUSTOMER_CHANGE_REASON_REQUIRED": "A reason is required when changing customer status, short code, or auto-match authorization.", "SHIPPING_CUSTOMER_NAME_REQUIRED": "Standard customer name is required.", "SHIPPING_CUSTOMER_SHORT_CODE_INVALID": "Customer short code must contain 2-6 letters.", "SHIPPING_CUSTOMER_SHORT_CODE_EXISTS": "Customer short code already exists.", "SHIPPING_CUSTOMER_STATUS_INVALID": "Invalid customer status.", "SHIPPING_CUSTOMER_CONFLICT": "Customer data conflict.", "SHIPPING_CUSTOMER_IDENTIFIER_TYPE_INVALID": "Invalid identifier type.", "SHIPPING_CUSTOMER_IDENTIFIER_VALUE_REQUIRED": "Identifier value is required.", "SHIPPING_CUSTOMER_EMAIL_INVALID": "Invalid customer email.", "SHIPPING_CUSTOMER_DOMAIN_INVALID": "Invalid customer domain.", "SHIPPING_CUSTOMER_IDENTIFIER_STATUS_INVALID": "Invalid identifier status.", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_FOUND": "Identifier not found.", "SHIPPING_CUSTOMER_IDENTIFIER_EXISTS": "Identifier already exists.", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_APPROVED": "Only approved identifiers can enable automatic matching.", "SHIPPING_CUSTOMER_PUBLIC_DOMAIN_AUTO_MATCH_FORBIDDEN": "Public email domains cannot be used for automatic matching.", "SHIPPING_CUSTOMER_EXTERNAL_REF_CONFLICT": "The legacy customer key is bound to another customer.", "SHIPPING_CUSTOMER_IMPORT_FILE_REQUIRED": "Select an import file.", "SHIPPING_CUSTOMER_IMPORT_FILE_TYPE_INVALID": "Only .xlsx files are supported.", "SHIPPING_CUSTOMER_IMPORT_FILE_EMPTY": "The import file is empty.", "SHIPPING_CUSTOMER_IMPORT_FILE_TOO_LARGE": "The import file exceeds 5 MB.", "SHIPPING_CUSTOMER_IMPORT_FILE_INVALID": "Invalid import workbook.", "SHIPPING_CUSTOMER_IMPORT_SHEET_MISSING": "A required worksheet is missing.", "SHIPPING_CUSTOMER_IMPORT_COLUMNS_MISSING": "Required import columns are missing.", "SHIPPING_CUSTOMER_IMPORT_KEY_REQUIRED": "Legacy customer key is required.", "SHIPPING_CUSTOMER_IMPORT_DUPLICATE_KEY": "Duplicate legacy key in the same source.", "SHIPPING_CUSTOMER_IMPORT_SHORT_CODE_CONFLICT": "Short code conflicts with an existing customer.", "SHIPPING_CUSTOMER_IMPORT_NAME_MATCH": "Customer name may duplicate an existing customer.", "SHIPPING_CUSTOMER_IMPORT_IDENTIFIER_CUSTOMER_MISSING": "No customer mapping was found for this identifier.", "SHIPPING_CUSTOMER_IMPORT_NOT_FOUND": "Import batch not found.", "SHIPPING_CUSTOMER_IMPORT_ROW_NOT_FOUND": "Import row not found.", "SHIPPING_CUSTOMER_IMPORT_DECISION_INVALID": "Invalid import row action.", "SHIPPING_CUSTOMER_IMPORT_TARGET_REQUIRED": "Select a target customer for update or merge.", "SHIPPING_CUSTOMER_IMPORT_HAS_ERRORS": "The import batch contains blocking errors.", "SHIPPING_CUSTOMER_IMPORT_DECISIONS_REQUIRED": "Resolve all warning rows first.", "SHIPPING_CUSTOMER_IMPORT_ALREADY_PUBLISHED": "The import batch is already published.", "SHIPPING_CUSTOMER_IMPORT_UPLOAD_CONFLICT": "A conflict occurred while staging the import.", "SHIPPING_CUSTOMER_IMPORT_PUBLISH_CONFLICT": "A data conflict occurred while publishing the import."
}
}
+6 -1
View File
@@ -167,6 +167,12 @@
"loadFailed": "Failed to load task",
"openChat": "Continue in Chat",
"download": "Download Excel",
"downloadBatch": "Download batch ZIP",
"selectAllVisible": "Select current results",
"selectedCount": "{count} tasks selected",
"downloadSelected": "Download selected ZIP",
"selectForDownload": "Select task {taskNo} for batch download",
"archiveDownloadFailed": "Batch download failed. Refresh the tasks and try again.",
"lines": "Shipment lines",
"qty": "Qty",
"columns": {
@@ -223,7 +229,6 @@
"created": "Created",
"parsed": "Parsed",
"pendingReview": "Pending review",
"alignReview": "Confirm fields",
"shortageReview": "Inventory shortage",
"waitingInventory": "Waiting inventory",
"inventoryReady": "Inventory ready",
+386 -4
View File
@@ -27,7 +27,383 @@
"requests": "คำขอสิทธิ์",
"reports": "รายงานข้อมูล",
"schedules": "Schedule Management",
"shippingCustomers": "ลูกค้าขนส่ง"
"shippingCustomers": "ลูกค้าขนส่ง",
"shippingInventory": "การตั้งค่าการจัดส่ง"
},
"shippingOrderSchema": {
"eyebrow": "เทมเพลตฟิลด์คำสั่งซื้อ",
"title": "การตั้งค่าเทมเพลตคำสั่งซื้อ",
"subtitle": "คำสั่งซื้อ EML, PDF และ Word ทั้งหมดใช้สัญญาฟิลด์ที่เผยแพร่ชุดเดียว และแก้ไขเวอร์ชันที่เผยแพร่แล้วไม่ได้",
"schemaName": "ชื่อเทมเพลต",
"description": "คำอธิบาย",
"initialize": "เริ่มต้นเทมเพลตคำสั่งซื้อ",
"initialized": "เริ่มต้นเทมเพลตคำสั่งซื้อแล้ว",
"fieldCatalog": "รายการฟิลด์",
"fieldCatalogHint": "ผู้ดูแลกำหนดรหัสระบบ ตำแหน่ง รูปแบบ และกฎการอ่านข้อมูล รหัสระบบเปลี่ยนชื่อได้ โดยเวอร์ชันย้อนหลังยังคงชื่อเดิม",
"fieldCode": "รหัสฟิลด์",
"ruleWorkspace": "กฎการอ่านฟิลด์",
"publishedVersion": "เวอร์ชันที่เผยแพร่ V{version}",
"historyOpen": "ประวัติเวอร์ชัน",
"historyEyebrow": "สแนปช็อตที่เปลี่ยนไม่ได้",
"historyTitle": "ประวัติเวอร์ชัน",
"historyViewing": "กำลังดูเวอร์ชันย้อนหลัง",
"historySelectVersion": "เลือกเวอร์ชันทางซ้ายเพื่อดูสแนปช็อตทั้งหมด",
"historyLoadMore": "โหลดเวอร์ชันเพิ่มเติม",
"historyNoNote": "ไม่มีคำอธิบายการเปลี่ยนแปลง",
"historyUnknownTime": "ไม่ได้บันทึกเวลา",
"historyUnknownActor": "ไม่ทราบผู้ดำเนินการ",
"historyPublishedAt": "เวลาเผยแพร่",
"historyPublisher": "เผยแพร่โดย",
"historyChecksum": "ผลรวมตรวจสอบสัญญา",
"historySnapshotFields": "ฟิลด์ในสแนปช็อต",
"historyExcluded": "ไม่รวมในเวอร์ชันนี้",
"historyStatus": { "draft": "ฉบับร่าง", "published": "เวอร์ชันปัจจุบัน", "retired": "เลิกใช้แล้ว" },
"diffWithCurrent": "เปรียบเทียบกับพื้นที่ทำงานปัจจุบัน V{version}",
"diffEyebrow": "ผลต่างเชิงความหมายจากเซิร์ฟเวอร์",
"diffTitle": "ความแตกต่างของเวอร์ชัน",
"diffComparedWith": "เปรียบเทียบกับ",
"diffEmpty": "ไม่ได้ตั้งค่า",
"diffNoChanges": "ไม่มีความแตกต่างของฟิลด์ระหว่างสองเวอร์ชัน",
"diffAddedField": "เพิ่มฟิลด์นี้ในเวอร์ชันที่เปรียบเทียบ",
"diffRemovedField": "ฟิลด์นี้มีในเวอร์ชันฐาน แต่ถูกลบในเวอร์ชันที่เปรียบเทียบ",
"diffOrderChanged": "เปลี่ยนเฉพาะลำดับ",
"diffStatus": { "added": "เพิ่ม", "removed": "ลบ", "modified": "แก้ไข", "unchanged": "ไม่เปลี่ยนแปลง" },
"diffField": { "field_code": "ชื่อฟิลด์ (ตัวระบุระบบ)", "scope": "ตำแหน่งฟิลด์", "value_type": "รูปแบบข้อมูล", "enabled": "รวมในเวอร์ชันปัจจุบัน", "display_name": "ชื่อที่แสดงของเวอร์ชันปัจจุบัน", "description": "คำอธิบาย", "required": "จำเป็นทางธุรกิจ", "aliases": "ชื่อแทน", "normalizer_key": "การประมวลผลข้อความ", "validator_keys": "การตรวจสอบเนื้อหา", "enum_options": "ตัวเลือก enum", "relation_role": "ความสัมพันธ์ข้ามเอกสาร", "comparator_key": "วิธีเปรียบเทียบ", "extraction_instruction": "คำสั่งสกัดข้อมูล", "sequence": "ลำดับฟิลด์", "evidence_policy.required": "ต้องมีหลักฐานต้นฉบับ", "evidence_policy.source_precedence": "แหล่งเนื้อหาที่จดจำได้", "evidence_policy.conflict_policy": "เมื่อเนื้อหาขัดแย้ง", "evidence_policy.allow_single_source": "อนุญาตแหล่งที่เชื่อถือได้แหล่งเดียว" },
"auditTitle": "ไทม์ไลน์การตรวจสอบการตั้งค่า",
"auditEmpty": "ยังไม่มีเหตุการณ์ตรวจสอบการตั้งค่า",
"auditLoadMore": "โหลดเหตุการณ์ตรวจสอบเพิ่มเติม",
"auditFieldSummary": "เพิ่ม {added}, ลบ {removed}, แก้ไข {changed} ฟิลด์",
"auditEvent": { "draft_created": "สร้างฉบับร่าง", "draft_saved": "บันทึกฉบับร่าง", "published": "เผยแพร่เวอร์ชัน", "draft_deleted": "ลบฉบับร่าง", "cloned": "คัดลอกเวอร์ชันเป็นฉบับร่าง", "field_saved": "บันทึกแค็ตตาล็อกฟิลด์", "field_retired": "เลิกใช้รายการแค็ตตาล็อกฟิลด์", "field_deleted": "ลบหรือเก็บถาวรรายการแค็ตตาล็อกฟิลด์" },
"copyToDraft": "คัดลอกเป็นฉบับร่างใหม่",
"usageOpen": "ดูบันทึกการใช้งาน",
"usageEyebrow": "การติดตามรันไทม์",
"usageTitle": "บันทึกการใช้เวอร์ชัน",
"usageTotal": "จำนวนการแยกวิเคราะห์",
"usageFirst": "ใช้ครั้งแรก",
"usageLast": "ใช้ล่าสุด",
"usageRecords": "บันทึกการแยกวิเคราะห์",
"usageEmpty": "เวอร์ชันนี้ยังไม่ถูกใช้ในการแยกวิเคราะห์คำสั่งซื้อ",
"usageLoadMore": "โหลดบันทึกการแยกวิเคราะห์เพิ่มเติม",
"extractionStatus": { "created": "สร้างแล้ว", "extracting": "กำลังแยกวิเคราะห์", "needs_review": "ต้องตรวจสอบ", "accepted": "ยอมรับแล้ว", "failed": "ล้มเหลว", "superseded": "ถูกแทนที่" },
"runtimeAuditEyebrow": "หลักฐานรันไทม์ที่ตรึงไว้",
"runtimeAuditTitle": "รายละเอียดการตรวจสอบการแยกคำสั่งซื้อ",
"runtimeAuditEmpty": "ไม่พบรายละเอียดการตรวจสอบการแยกวิเคราะห์",
"runtimeAuditExtraction": "การแยกวิเคราะห์",
"runtimeAuditVersion": "เวอร์ชันเทมเพลตคำสั่งซื้อ",
"runtimeAuditStatus": "สถานะการแยกวิเคราะห์",
"runtimeAuditHash": "แฮชสแนปช็อตอินพุต",
"runtimeAuditInput": "เอกสารอินพุตที่ตรึงไว้",
"runtimeAuditInputUnavailable": "การแยกวิเคราะห์ย้อนหลังนี้เกิดก่อนมีสแนปช็อตอินพุต จึงเก็บไว้เฉพาะแฮชของสแนปช็อตเท่านั้น",
"runtimeAuditLlm": "ผลลัพธ์ LLM ดิบ",
"runtimeAuditNormalized": "ผลลัพธ์ที่ทำให้เป็นมาตรฐาน",
"runtimeAuditValidation": "ผลการตรวจสอบ",
"runtimeAuditDecisions": "การตัดสินใจของฟิลด์",
"runtimeAuditEvidence": "หลักฐานของฟิลด์",
"runtimeAuditValues": "ค่าฟิลด์ที่ยอมรับแล้ว",
"businessFields": "ฟิลด์ที่ต้องอ่าน",
"businessFieldsHint": "เพิ่มฟิลด์ แล้วเลือกฟิลด์เพื่อกำหนดกฎการอ่านข้อมูล",
"searchFields": "ค้นหาชื่อที่แสดงหรือรหัสฟิลด์",
"fieldCount": "{count} ฟิลด์",
"selectedInGroup": "ฟิลด์ปัจจุบัน",
"noMatchingFields": "ไม่พบฟิลด์ที่ตรงกัน",
"cancelAddField": "ปิดแบบฟอร์มเพิ่ม",
"publishedRuleViewer": "การตั้งค่าฟิลด์ที่เผยแพร่แล้ว",
"publishedReadOnlyHint": "กำลังแสดงการตั้งค่าฉบับเผยแพร่แบบครบถ้วน สร้างฉบับร่างเพื่อแก้ไข",
"readOnly": "อ่านอย่างเดียว",
"businessFieldName": "ชื่อฟิลด์",
"fieldName": "ชื่อฟิลด์ (รหัสระบบ)",
"businessFieldNamePlaceholder": "เช่น part_number",
"businessFieldNameHint": "ใช้ตัวอักษรภาษาอังกฤษพิมพ์เล็กและขีดล่าง เช่น part_number, reservation_id หรือ request_qty",
"fieldEditingHint": "ชื่อที่แสดงและรหัสระบบแก้ไขได้เสมอ การรวมฟิลด์มีผลเฉพาะการเผยแพร่เวอร์ชันปัจจุบัน",
"businessFieldPlacement": "ตำแหน่งฟิลด์",
"businessFieldFormat": "รูปแบบข้อมูล",
"placementHeader": "ข้อมูลคำสั่งซื้อ",
"placementLine": "รายละเอียดสินค้า",
"placement": { "header": "ข้อมูลคำสั่งซื้อ", "line": "รายละเอียดสินค้า" },
"fieldType": { "string": "ข้อความ", "decimal": "ทศนิยม", "integer": "จำนวนเต็ม", "date": "วันที่", "boolean": "ใช่/ไม่ใช่", "enum": "ตัวเลือก" },
"ruleEditor": "กำลังตั้งค่า",
"unnamedField": "ฟิลด์ไม่มีชื่อ",
"pendingNameField": "ฟิลด์ที่รอตั้งชื่อ {number}",
"inDraft": "อยู่ในฉบับร่าง",
"notInDraft": "ไม่ได้อยู่ในฉบับร่าง",
"inPublished": "อยู่ในเวอร์ชันที่เผยแพร่",
"notInPublished": "ไม่ได้อยู่ในเวอร์ชันปัจจุบัน",
"fieldRemovedStatus": "นำออกแล้ว",
"selectField": "เลือกฟิลด์จากด้านซ้ายเพื่อตั้งค่า",
"addField": "เพิ่มฟิลด์",
"fieldCreated": "สร้างฟิลด์แล้ว",
"fieldUpdated": "อัปเดตฟิลด์แล้ว",
"saveField": "บันทึกฟิลด์",
"retireField": "เลิกใช้งาน",
"fieldRetired": "เลิกใช้งานฟิลด์แล้ว",
"confirmRetireField": "ต้องการเลิกใช้งานฟิลด์ {code} หรือไม่ ระบบจะปฏิเสธหากยังถูกอ้างอิงโดยฉบับร่างเทมเพลตคำสั่งซื้อ กฎการกำหนดเส้นทาง การแมปสินค้าคงคลัง หรือเทมเพลตการจัดส่ง",
"removeField": "ลบ",
"fieldRemoved": "นำฟิลด์ออกแล้ว",
"fieldDeleted": "ลบฟิลด์แล้ว",
"fieldArchived": "เก็บฟิลด์เข้าคลังและซ่อนจากการตั้งค่าปัจจุบันแล้ว",
"confirmRemoveField": "ลบ \"{name}\" หรือไม่ ฟิลด์ที่ยังไม่ถูกใช้งานจะถูกลบถาวร ส่วนฟิลด์ที่มีประวัติจะถูกเก็บเข้าคลังและซ่อน หากยังถูกใช้งานโดยกฎเส้นทาง การแมปสินค้าคงคลัง หรือเทมเพลตการจัดส่ง ระบบจะไม่อนุญาตให้ลบ",
"versionEditor": "กฎเวอร์ชัน",
"notPublished": "ยังไม่เผยแพร่",
"createDraft": "สร้างฉบับร่าง",
"draftCreated": "สร้างฉบับร่างแล้ว",
"changeNote": "คำอธิบายการเปลี่ยนแปลง",
"displayName": "ชื่อที่แสดงของเวอร์ชันปัจจุบัน",
"includeField": "รวมในเวอร์ชันนี้",
"aliases": "ชื่อแทน (คั่นด้วยจุลภาค)",
"normalizer": "วิธีจัดการข้อความ",
"comparator": "วิธีตรวจสอบ",
"relationRole": "ความเกี่ยวข้องข้ามเอกสาร",
"conflictPolicy": "เมื่อข้อมูลไม่ตรงกัน",
"required": "จำเป็นทางธุรกิจ",
"evidenceRequired": "ต้องมีหลักฐานจากต้นฉบับ",
"allowSingleSource": "อนุญาตแหล่งข้อมูลที่เชื่อถือได้แหล่งเดียว",
"enumOptions": "ตัวเลือก enum (คั่นด้วยจุลภาค)",
"validators": "การตรวจสอบเนื้อหา",
"sourcePrecedence": "แหล่งเนื้อหาที่อ่านได้",
"extractionInstruction": "คำแนะนำในการอ่านข้อมูล (ไม่บังคับ)",
"extractionInstructionPlaceholder": "เช่น ให้อ่านรหัสชิ้นส่วนผู้ผลิตจากตารางรายการสินค้าเป็นลำดับแรก",
"advancedRules": "กฎการอ่านขั้นสูง",
"notSet": "ไม่ตั้งค่า",
"changeNotePlaceholder": "อธิบายการเปลี่ยนแปลงกฎครั้งนี้ (ไม่บังคับ)",
"ruleLabel": { "trim": "ตัดช่องว่างหน้าและท้าย", "uppercase_trim": "แปลงเป็นตัวพิมพ์ใหญ่และตัดช่องว่าง", "lowercase_trim": "ไม่สนตัวพิมพ์เล็กใหญ่และตัดช่องว่าง", "decimal": "ประมวลผลเป็นทศนิยม", "integer": "ประมวลผลเป็นจำนวนเต็ม", "iso_date": "ประมวลผลเป็นวันที่", "boolean": "ประมวลผลเป็นใช่/ไม่ใช่", "normalized_text": "ตรวจสอบข้อความหลังปรับรูปแบบ", "case_insensitive_text": "ตรวจสอบโดยไม่สนตัวพิมพ์เล็กใหญ่", "date": "ตรวจสอบเป็นวันที่", "exact": "ต้องตรงกันทั้งหมด", "block": "หยุดการดำเนินการ", "review": "ส่งตรวจสอบโดยผู้ใช้", "prefer_attachment": "ให้ความสำคัญกับเนื้อหาไฟล์แนบ", "prefer_email": "ให้ความสำคัญกับเนื้อหาอีเมล", "prefer_highest_confidence": "ใช้ผลลัพธ์ที่มีความเชื่อมั่นสูงกว่า", "atomic_part_number": "รูปแบบรหัสชิ้นส่วน", "non_empty": "ต้องไม่ว่าง", "positive_decimal": "ต้องเป็นจำนวนบวก", "non_negative_decimal": "ต้องไม่เป็นค่าลบ", "positive_integer": "ต้องเป็นจำนวนเต็มบวก", "reservation_id": "รูปแบบรหัสจอง", "primary_link": "ความเกี่ยวข้องหลัก", "secondary_link": "ความเกี่ยวข้องรอง", "line_match": "ความเกี่ยวข้องระดับรายการ", "order_reference": "ความเกี่ยวข้องกับคำสั่งซื้อ" },
"sourceLabel": { "attachment_table": "ตารางในไฟล์แนบ", "attachment_text": "ข้อความในไฟล์แนบ", "email_body_table": "ตารางในอีเมล", "email_body_text": "ข้อความในอีเมล", "dify_llm": "ผลการอ่านอัจฉริยะ", "backend_table": "การอ่านตารางของระบบ" },
"saveDraft": "บันทึกฉบับร่าง",
"draftSaved": "บันทึกฉบับร่างแล้ว",
"deleteDraft": "ลบฉบับร่าง",
"draftDeleted": "ลบฉบับร่างแล้ว",
"publish": "เผยแพร่เวอร์ชัน",
"published": "เผยแพร่เวอร์ชันฟิลด์คำสั่งซื้อแล้ว",
"noDraft": "ยังไม่มีฉบับร่าง โปรดสร้างเพื่อกำหนดและเผยแพร่กฎฟิลด์",
"setupKicker": "จุดเริ่มต้นการตั้งค่า",
"setupTitle": "กำหนดฟิลด์คำสั่งซื้อที่ระบบต้องอ่านและส่งออกก่อน",
"setupHint": "ฟิลด์คำสั่งซื้อเป็นสัญญาร่วมสำหรับการจับคู่สต็อก การกำหนดเส้นทาง และไฟล์ Excel สำหรับจัดส่ง เผยแพร่ก่อนตั้งค่าโปรไฟล์การอ่านสต็อกและแหล่งสต็อก",
"setupActionHint": "ระบบจะสร้างพื้นที่ทำงานฟิลด์คำสั่งซื้อแรกด้วยการตั้งค่าเริ่มต้น จากนั้นจึงเพิ่มฟิลด์ที่ต้องอ่านได้",
"setupStepCatalog": "สร้างรายการฟิลด์คงที่ เช่น รหัสสินค้า ชื่อ และจำนวน",
"setupStepRules": "กำหนดชื่อเรียก การตรวจสอบ และกฎหลักฐาน EML/PDF ของแต่ละฟิลด์",
"setupStepPublish": "เผยแพร่เวอร์ชันฟิลด์เพื่อให้การตั้งค่าถัดไปอ้างอิงได้อย่างปลอดภัย",
"operationFailed": "ดำเนินการเทมเพลตคำสั่งซื้อไม่สำเร็จ"
},
"shippingInventory": {
"title": "การตั้งค่าการจัดส่ง",
"subtitle": "ดูแลสายการตั้งค่าการจัดส่งที่ตรวจสอบย้อนกลับได้ ตั้งแต่ฟิลด์คำสั่งซื้อ การอ่านสต็อก ไปจนถึง Excel สำหรับจัดส่งและการกำหนดเส้นทางสต็อก",
"eyebrow": "พื้นที่ทำงานการตั้งค่าการจัดส่ง",
"groupFoundation": "ข้อมูลพื้นฐาน",
"groupInventory": "การจัดการสต็อก",
"groupAudit": "บันทึกการทำงาน",
"orderFields": "การอ่านคำสั่งซื้อ",
"orderSchemaRequired": "โปรดเผยแพร่เวอร์ชันฟิลด์คำสั่งซื้อก่อน เพื่อให้โปรไฟล์การแยกวิเคราะห์สต็อก เทมเพลต Excel สำหรับจัดส่ง และกฎการกำหนดเส้นทางอ้างอิงฟิลด์คำสั่งซื้อได้",
"connections": "การเชื่อมต่อระบบ",
"parsingProfiles": "แผนการแยกวิเคราะห์ไฟล์สต็อก",
"parsingProfilesHelp": "จัดการโครงสร้างไฟล์สต็อก การจับคู่ฟิลด์ และคีย์จับคู่ฟิลด์คำสั่งซื้อที่ใช้ร่วมกันได้ระหว่างไซต์สต็อก",
"inventoryMapping": "แผนการแยกวิเคราะห์ไฟล์สต็อก",
"inventoryMappingPlans": "แผนการแยกข้อมูล",
"inventoryFields": "รายการฟิลด์สต็อก",
"inventoryFieldsHelp": "ดูแลฟิลด์ธุรกิจที่ใช้ร่วมกันระหว่างไฟล์สต็อกของ DBS, Crane และอื่น ๆ โดยแต่ละแผนการแยกวิเคราะห์ไฟล์สต็อกจะจับคู่หัวตารางจริงกับฟิลด์เหล่านี้",
"inventoryFieldName": "ชื่อฟิลด์",
"inventoryFieldDescription": "คำอธิบายฟิลด์",
"inventoryFieldDescriptionHint": "อธิบายความหมายทางธุรกิจและการใช้งานของฟิลด์นี้",
"inventoryFieldFormat": "รูปแบบข้อมูล",
"inventoryFieldPurpose": "วัตถุประสงค์ของฟิลด์",
"inventoryFieldOrder": "ลำดับการแสดง",
"inventoryFieldType": { "text": "ข้อความ", "integer": "จำนวนเต็ม", "decimal": "ทศนิยม", "date": "วันที่" },
"inventoryFieldPurposeOption": { "match_identity": "การจับคู่สต็อก", "inventory_quantity": "จำนวนสต็อก", "warehouse_identity": "การระบุคลัง", "general": "ข้อมูลธุรกิจทั่วไป" },
"inventoryFieldPurposeHint": "การจับคู่สต็อกใช้เชื่อมคำสั่งซื้อกับสต็อก ปริมาณสต็อกใช้คำนวณจำนวนที่ส่งได้ การระบุคลังใช้เฉพาะไซต์คลังแบบไดนามิก และฟิลด์อื่นใช้แสดงผลหรือสร้างเทมเพลตจัดส่ง",
"inventoryFieldUserDefinedHint": "ผู้ใช้กำหนดชื่อฟิลด์ทั้งหมดเอง การเผยแพร่การจับคู่สต็อกต้องมีฟิลด์จับคู่อย่างน้อยหนึ่งฟิลด์และฟิลด์ปริมาณหนึ่งฟิลด์เท่านั้น ส่วนไซต์คลังแบบไดนามิกต้องมีฟิลด์ระบุคลังอีกหนึ่งฟิลด์",
"retireInventoryField": "เลิกใช้ฟิลด์",
"confirmRetireInventoryField": "ต้องการเลิกใช้ฟิลด์สต็อกนี้หรือไม่ หลังจากนั้นจะใช้กับแผนการแยกวิเคราะห์ไฟล์สต็อกหรือเทมเพลตการจัดส่งใหม่ไม่ได้",
"parsingProfileCode": "รหัสแผนการแยกวิเคราะห์",
"temporaryInventorySession": "ไฟล์สต็อกจากการสนทนาที่ยืนยันแล้ว",
"temporaryInventorySessionNone": "ไม่ใช้ไฟล์สต็อกจากการสนทนา",
"temporaryInventorySessionHint": "ระบบจะใช้โครงสร้างและการแมปที่ผ่านการตรวจคุณภาพแล้ว คุณยังต้องระบุรหัส ชื่อ และคีย์จับคู่คำสั่งซื้อ การบันทึกจะสร้างเพียงฉบับร่างเท่านั้น",
"temporaryInventorySessionSelected": "โหลดการแมปชั่วคราวที่ยืนยันแล้ว (ที่มา: {mapping}) ไม่สามารถเปลี่ยนโครงสร้างไฟล์ได้ที่นี่",
"fileFormat": "รูปแบบไฟล์",
"inventorySampleFile": "ไฟล์ตัวอย่างสต็อก",
"inventorySampleFileHint": "อัปโหลด Excel หรือ CSV แล้วระบบจะอ่านชีต หัวตาราง และตัวอย่างเล็กน้อยเพื่อยืนยันแผนการอ่าน",
"inventorySampleAnalysing": "กำลังวิเคราะห์โครงสร้างไฟล์สต็อก...",
"inventorySampleRequired": "โปรดอัปโหลดไฟล์ตัวอย่างสต็อกและทำการระบุโครงสร้างให้เสร็จก่อน",
"parsingProfileName": "ชื่อแผนการอ่านไฟล์",
"inventoryAnalysisFailed": "การระบุโครงสร้างไฟล์สต็อกล้มเหลว",
"inventoryAnalysisPreview": "ตัวอย่างผลการระบุ",
"inventoryAnalysisSummary": "พบหัวตารางที่เลือกได้ {candidate_count} รายการ มีแถวตัวอย่าง {sample_row_count} แถว และแนะนำฟิลด์สต็อก {valid_inventory_field_suggestions} รายการ",
"csvFile": "ไฟล์ CSV",
"headerRowOption": "แถว {row}",
"chooseSourceHeader": "เลือกคอลัมน์ต้นทาง",
"emptyHeader": "คอลัมน์ว่าง",
"parsingPlanRecommendation": "แผนการแยกวิเคราะห์ไฟล์สต็อกที่ใช้ซ้ำได้",
"recommendationLevel": { "exact": "โครงสร้างไฟล์ตรงกันทั้งหมด", "compatible": "คอลัมน์หลักเข้ากันได้" },
"usedBySites": "ใช้งานโดยไซต์สต็อก {count} แห่ง",
"addedColumns": "เพิ่มคอลัมน์ที่ไม่สำคัญ: {columns}",
"columnOrderChanged": "ลำดับคอลัมน์เปลี่ยน แต่ยังระบุคอลัมน์หลักได้",
"adoptParsingPlan": "ใช้แผนนี้",
"parsingPlanAdopted": "ยืนยันการใช้แผนการแยกวิเคราะห์ไฟล์สต็อกแล้ว และยังไม่ได้ผูกกับไซต์สต็อกใด",
"headerRowIndex": "ดัชนีแถวหัวตาราง",
"sheetName": "ชื่อเวิร์กชีต (ไม่บังคับ)",
"fieldMappings": "การจับคู่ฟิลด์สินค้าคงคลัง",
"matchKeys": "คีย์จับคู่คำสั่งซื้อกับสินค้าคงคลัง",
"matchKeysHint": "ดูแลเฉพาะฟิลด์ระบุตัวตนที่ใช้ระบุรายการสต็อกเดียวกัน กำหนดจำนวนคงเหลือที่ด้านบนเพื่อใช้ตรวจสอบความเพียงพอภายหลัง ไม่ใช่คีย์จับคู่",
"matchKeysComplete": "ฟิลด์ระบุตัวตนของสต็อกที่แมปไว้ทั้งหมดถูกใช้เป็นคีย์จับคู่แล้ว ไม่จำเป็นต้องเพิ่มอีก",
"matchKeysAnalysisRequired": "โปรดอัปโหลดไฟล์ตัวอย่างสต็อกและยืนยันโครงสร้างก่อนเพิ่มคีย์จับคู่",
"inventoryField": "ฟิลด์สินค้าคงคลัง",
"orderField": "ฟิลด์คำสั่งซื้อ",
"readonlyFieldMappingsHint": "ข้อมูลต่อไปนี้คือความสัมพันธ์ของคอลัมน์ Excel ที่ล็อกไว้โดยเวอร์ชันที่เผยแพร่แล้ว",
"readonlyMatchKeysHint": "รายการคำสั่งซื้อจะจับคู่กับข้อมูลสินค้าคงคลังโดยใช้ชุดฟิลด์นี้",
"publishedParsingImmutable": "การอ่านไฟล์สต็อกที่เผยแพร่แล้วถูกเก็บเป็นคำนิยามตรวจสอบที่แก้ไขไม่ได้ หากต้องการปรับ โปรดสร้างและเผยแพร่ฉบับร่างใหม่",
"chooseInventoryField": "เลือกฟิลด์สินค้าคงคลัง",
"chooseOrderField": "เลือกฟิลด์รายการคำสั่งซื้อ",
"sourceHeader": "ชื่อหัวคอลัมน์ในไฟล์สินค้าคงคลัง",
"addFieldMapping": "เพิ่มการจับคู่ฟิลด์",
"addMatchKey": "เพิ่มคีย์จับคู่",
"publishProfile": "เผยแพร่",
"retireProfile": "เลิกใช้",
"confirmRetireProfile": "เลิกใช้ได้เฉพาะโปรไฟล์ที่ไม่มีแหล่งสินค้าคงคลังอ้างอิง ดำเนินการต่อหรือไม่?",
"excelTemplates": "เทมเพลตการจัดส่ง",
"excelTemplateName": "ชื่อเทมเพลต",
"templateCodeHint": "ใช้ระบุเทมเพลตการจัดส่งประเภทเดียวกัน เช่น DBS_SHIPMENT",
"templateFileHint": "หลังอัปโหลด ระบบจะอ่านชีตและหัวตารางแถวแรกเพื่อใช้เลือกคอลัมน์ปลายทาง",
"filenamePatternHint": "ใช้ตัวแปรด้านล่างประกอบชื่อไฟล์ แนะนำให้ใช้เลขที่ธุรกิจอย่างเป็นทางการ",
"filenamePatternExample": "แนะนำ: {business_no}.xlsx -> WYC26060201.xlsx",
"filenameVariablesTitle": "ตัวแปรชื่อไฟล์ที่ใช้ได้", "filenameVariablesHint": "ใช้ตัวแปรในวงเล็บปีกกา ข้อมูลธุรกิจใช้ภาพรวมที่ล็อกไว้ของงานเพื่อให้ตรวจสอบย้อนหลังได้",
"filenameVariableNoMatch": "ไม่พบตัวแปรที่ตรงกัน",
"filenameVariableBusinessNo": "เลขที่ธุรกิจอย่างเป็นทางการ เช่น WYC26060201 (แนะนำ)", "filenameVariableCustomer": "รหัสย่อลูกค้า เช่น WYC", "filenameVariableBusinessDate": "วันที่ธุรกิจหกหลัก เช่น 260602", "filenameVariableSequence": "ลำดับลูกค้ารายวันสองหลัก เช่น 01", "filenameVariableTaskNo": "หมายเลขงานระบบ", "filenameVariableSource": "รหัสแหล่งสต็อก", "filenameVariableDate": "วันที่ส่งออกแปดหลัก เช่น 20260602", "filenameVariableTimestamp": "เวลาส่งออกสิบสี่หลัก",
"templateMappingsHint": "แต่ละการจับคู่ระบุว่าข้อมูลธุรกิจใดจะถูกเขียนลงในชีต คอลัมน์ และแถวเริ่มต้นใด", "mappingItem": "การจับคู่ {number}", "templateSheet": "ชีตปลายทาง", "chooseTemplateSheet": "เลือกชีตจากไฟล์ที่อัปโหลด", "templateRowMode": "วิธีเขียน", "rowMode": { "header": "ข้อมูลคำสั่งซื้อ (ครั้งเดียวต่อไฟล์)", "line": "รายละเอียดสินค้า (หนึ่งแถวต่อสินค้า)" }, "chooseTargetColumn": "เลือกคอลัมน์ปลายทางในเทมเพลต", "savedTargetColumn": "คอลัมน์ที่บันทึกไว้ {column}",
"sourceType": "ชนิดแหล่งข้อมูล", "sourceField": "ฟิลด์ต้นทาง", "sourceKind": { "order_field": "ฟิลด์เทมเพลตคำสั่งซื้อ", "inventory_field": "ฟิลด์เทมเพลตสต็อก", "system_fact": "ข้อมูลระบบ", "constant": "เนื้อหาคงที่" }, "sourceKindHint": { "order_field": "เลือกฟิลด์ที่เผยแพร่จากการตั้งค่าเทมเพลตคำสั่งซื้อ", "inventory_field": "เลือกฟิลด์มาตรฐานที่อ่านโดยการตั้งค่าเทมเพลตสต็อก", "system_fact": "เลือกข้อมูลงานที่ระบบจัดเตรียม" }, "sourceGroupOrder": "ฟิลด์เทมเพลตคำสั่งซื้อ", "sourceGroupOrderRepeated": "ฟิลด์ข้อมูลคำสั่งซื้อ (เขียนซ้ำในทุกรายการสินค้า)", "sourceGroupOrderLine": "ฟิลด์รายละเอียดสินค้า", "sourceGroupInventory": "ฟิลด์เทมเพลตสต็อก", "sourceGroupSystem": "ข้อมูลระบบ", "noSourceOptions": "ไม่มีฟิลด์ให้เลือก", "orderFieldOptionsEmpty": "ยังไม่มีฟิลด์เทมเพลตคำสั่งซื้อที่เผยแพร่ เผยแพร่เวอร์ชันการตั้งค่าเทมเพลตคำสั่งซื้อก่อน แล้วฟิลด์ต้นทางจะแสดงที่นี่", "constantValueHint": "เขียนค่าเดิมทุกครั้งที่ส่งออก เช่น รหัสผู้ให้บริการขนส่งคงที่", "valueFormat": "รูปแบบการเขียน", "formatter": { "text": "เขียนตามเดิม", "upper": "ตัวพิมพ์ใหญ่", "lower": "ตัวพิมพ์เล็ก", "date_mmddyyyy": "วันที่: เดือน/วัน/ปี", "integer": "จำนวนเต็ม", "decimal": "ทศนิยม" }, "templateLayoutReadFailed": "ไม่สามารถอ่านชีตและหัวตารางของเทมเพลต Excel ได้ โปรดตรวจสอบไฟล์แล้วลองใหม่",
"systemFact": { "task_no": "หมายเลขงานระบบ", "business_no": "เลขที่ธุรกิจอย่างเป็นทางการ", "warehouse_id": "คลังของผู้ให้บริการ", "inventory_source_code": "รหัสแหล่งสต็อก", "export_date": "วันที่ส่งออก" },
"excelTemplatesHelp": "อัปโหลดและเผยแพร่เทมเพลตการจัดส่งแบบมีเวอร์ชันที่ใช้ร่วมกันได้หลายแหล่งสินค้าคงคลังด้วย ID ฟิลด์คำสั่งซื้อที่คงที่",
"templateCode": "รหัสเทมเพลต",
"templateFile": "ไฟล์เทมเพลต Excel",
"filenamePattern": "รูปแบบชื่อไฟล์ส่งออก",
"templateMappings": "การจับคู่ฟิลด์เทมเพลต",
"startRow": "แถวเริ่มต้น",
"targetColumn": "หมายเลขคอลัมน์ปลายทาง",
"constantValue": "ค่าคงที่",
"chooseSourceField": "เลือกฟิลด์ต้นทาง",
"addTemplateMapping": "เพิ่มการจับคู่เทมเพลต",
"templateFileRequired": "ต้องเลือกไฟล์ xlsx เมื่อสร้างฉบับร่างเทมเพลต",
"publishTemplate": "เผยแพร่เทมเพลต",
"retireTemplate": "เลิกใช้",
"publishedTemplateImmutable": "เทมเพลตที่เผยแพร่แล้วแก้ไขโดยตรงไม่ได้ ให้สร้างเวอร์ชันใหม่เพื่อใช้ไฟล์ที่บันทึกไว้และแก้ไขต่อ",
"createTemplateVersion": "สร้างเวอร์ชันใหม่",
"confirmRetireTemplate": "ต้องการเลิกใช้เทมเพลตนี้หรือไม่ หลังจากนั้นจะผูกกับไซต์สินค้าคงคลังใหม่ไม่ได้",
"connectionsHelp": "จัดการ URL เข้าสู่ระบบและข้อมูลรับรองของแต่ละบัญชี การเชื่อมต่อมีหน้าที่เฉพาะการเข้าสู่ระบบ ไม่กำหนดการทำงานของหน้าเว็บ",
"credentialsHint": "ชื่อผู้ใช้และรหัสผ่านเขียนได้เท่านั้น และจะไม่ส่งกลับจากหน้าเว็บหรือ API",
"sources": "ไซต์สต็อก",
"sourcesHelp": "ดูแลเส้นทางรายงาน เงื่อนไขค้นหา และชื่อแทนการระบุ แล้วผูกกับการเชื่อมต่อที่ส่งออกแหล่งข้อมูลนี้",
"rules": "กฎการกำหนดเส้นทาง",
"rulesHelp": "กำหนดเส้นทางรายการคำสั่งซื้อไปยังแหล่งสินค้าคงคลังตามฟิลด์ธุรกิจ ตัวดำเนินการ และลำดับความสำคัญ กฎที่เผยแพร่แล้วแก้ไขไม่ได้",
"snapshots": "สแนปช็อตสต็อก",
"snapshotsHelp": "ดูแบบอ่านอย่างเดียวของไฟล์สต็อกที่ส่งออกและใช้จับคู่การจัดส่งได้",
"exports": "บันทึกการส่งออก",
"exportsHelp": "ดูผลการส่งออกสต็อกแบบอ่านอย่างเดียว ไม่สั่งส่งออกหรือทดลองใหม่ที่นี่",
"externalMappings": "การแมปคลัง",
"mappingsHelp": "แมปคลังของผู้ให้บริการขนส่ง หรือคลังเริ่มต้นของแหล่งข้อมูล ไปยังรหัสคลังของระบบภายนอก",
"defaultMapping": "การแมปเริ่มต้นของแหล่งข้อมูล",
"loadFailed": "โหลดการตั้งค่าสินค้าคงคลังขนส่งไม่สำเร็จ",
"createNew": "สร้างใหม่",
"saving": "กำลังบันทึก...",
"publish": "เผยแพร่กฎ",
"retire": "เก็บกฎเข้าคลัง",
"flowOrder": "การอ่านคำสั่งซื้อ",
"flowInventory": "แผนการแยกวิเคราะห์ไฟล์สต็อก",
"flowTemplate": "เทมเพลตการจัดส่ง",
"flowRoute": "กฎการกำหนดเส้นทาง",
"connectionCode": "รหัสการเชื่อมต่อ",
"connectionName": "ชื่อการเชื่อมต่อ",
"inventorySiteName": "ชื่อไซต์สินค้าคงคลัง",
"connectorType": "ประเภทผู้ให้บริการ",
"loginUrl": "URL เข้าสู่ระบบ",
"username": "ชื่อผู้ใช้",
"password": "รหัสผ่าน",
"writeOnlyHint": "เว้นว่างเพื่อคงค่าเดิม",
"enabled": "เปิดใช้งาน",
"enabledState": "เปิดใช้งาน",
"disabledState": "ปิดใช้งาน",
"notGenerated": "ยังไม่ได้สร้าง",
"notConfigured": "ยังไม่ได้ตั้งค่า",
"parsingProfileGeneratedByTest": "บันทึกไซต์ก่อน แล้วระบุหรือยืนยันแผนการแยกวิเคราะห์ไฟล์สต็อกจากการส่งออกทดสอบ",
"sourceSavedDisabledHint": "ไซต์จะยังปิดใช้งานหลังบันทึกครั้งแรก โปรดทำการส่งออกทดสอบ แผนการอ่าน และเทมเพลตการจัดส่งให้เสร็จก่อนเปิดใช้งาน",
"activationStatus": "การตรวจสอบก่อนใช้งานจริง",
"activationReady": "เปิดใช้งานไซต์สต็อกแล้วและพร้อมใช้งานจริง",
"activationDraft": "ไซต์สต็อกยังปิดใช้งาน โปรดทำรายการต่อไปนี้ให้เสร็จก่อนเปิดใช้งาน",
"activationRequirement": { "rpa_profile": "การเชื่อมต่อระบบพร้อมใช้งาน", "parsing_profile": "แผนการแยกวิเคราะห์ไฟล์สต็อก", "excel_template": "เทมเพลตการจัดส่ง", "configuration_test": "การส่งออกทดสอบและการตรวจสอบการอ่าน", "parsing_validation": "อ่านเลขชิ้นส่วน เลขจอง และจำนวนจากไฟล์ทดสอบได้ถูกต้อง", "warehouse_identification": "ไฟล์ทดสอบระบุคลังของผู้ให้บริการได้", "warehouse_mapping": "มีการดูแลการแมประหว่างคลังผู้ให้บริการและคลังระบบภายนอก", "template_validation": "ฟิลด์สต็อกที่เทมเพลตใช้มีอยู่ในแผนการแยกวิเคราะห์" },
"activateSource": "เปิดใช้งานไซต์สต็อก",
"deactivateSource": "ปิดใช้งานไซต์สต็อก",
"activateSourceConfirm": "ระบบจะตรวจสอบเงื่อนไขก่อนใช้งานจริงทั้งหมดก่อนเปิดใช้งานไซต์สต็อกนี้",
"deactivateSourceConfirm": "ไซต์นี้จะไม่เข้าร่วมการกำหนดเส้นทางหรือการส่งออกสต็อกใหม่ ต้องการดำเนินการต่อหรือไม่?",
"configurationTest": "ส่งออกทดสอบ", "configurationTestHint": "ไฟล์ทดสอบใช้ตรวจสอบการเชื่อมต่อ โครงสร้างไฟล์ และแผนการแยกวิเคราะห์ไฟล์สต็อกเท่านั้น และจะไม่เข้าสู่การจับคู่หรือการส่งออกจริง", "startConfigurationTest": "ส่งออกทดสอบ", "configurationTestRunning": "กำลังทดสอบ...", "configurationTestFailed": "การส่งออกทดสอบไซต์สต็อกล้มเหลว", "configurationTestNoRecommendation": "ไม่พบแผนการแยกวิเคราะห์ไฟล์สต็อกที่เผยแพร่แล้วซึ่งใช้ได้โดยตรง โปรดสร้างหรือปรับปรุงแผนจากผลการทดสอบ", "confirmTestProfile": "ยืนยันและผูกแผนการแยกวิเคราะห์นี้", "configurationTestProfileConfirmed": "ยืนยันแผนการแยกวิเคราะห์ไฟล์สต็อกแล้ว และไซต์สต็อกยังคงปิดใช้งาน", "configurationTestStage": { "waiting_worker": "กำลังรอ RPA Worker", "analysing_structure": "กำลังระบุโครงสร้างไฟล์สต็อก", "ready_for_confirmation": "ทดสอบเสร็จแล้ว รอยืนยันแผนการแยกวิเคราะห์ไฟล์สต็อก", "failed": "ทดสอบล้มเหลว" },
"connectionBoundary": "กรอกเฉพาะข้อมูลเข้าสู่ระบบ ระบบจะดำเนินการหน้าเว็บ ดาวน์โหลด และรอตามแพลตฟอร์มผู้ให้บริการที่เลือกโดยอัตโนมัติ",
"platform": { "dbs": "DBS", "crane": "Crane" },
"sourceCode": "หมายเลขแหล่งสต็อก",
"connection": "การเชื่อมต่อ",
"chooseConnection": "เลือกการเชื่อมต่อ",
"warehouseResolution": "วิธีระบุคลัง",
"fixedWarehouse": "ระบุคลัง",
"inventoryMatch": "จับคู่จากแถวสต็อก",
"warehouse": "คลังผู้ให้บริการ",
"dynamicWarehouse": "ระบุจากแถวสต็อก",
"snapshotTtl": "อายุสแนปช็อต (วินาที)",
"reportPath": "เส้นทางรายงาน DBS",
"programGroup": "กลุ่มโปรแกรม",
"programLabel": "ชื่อโปรแกรม",
"reportGroup": "กลุ่มรายงาน",
"reportName": "ชื่อรายงาน",
"queryParameters": "เงื่อนไขค้นหา",
"parameterName": "ชื่อพารามิเตอร์",
"parameterValues": "ค่า (คั่นด้วยจุลภาค)",
"single": "ค่าเดียว",
"multiText": "หลายค่าที่กรอก",
"multiSelect": "เลือกหลายค่า",
"required": "บังคับ",
"selectAll": "เลือกทั้งหมด",
"addParameter": "เพิ่มเงื่อนไขค้นหา",
"matchAliases": "ชื่อแทนการระบุ",
"aliasHint": "คั่นชื่อแทนด้วยจุลภาค",
"ruleCode": "รหัสกฎ",
"ruleName": "ชื่อกฎ",
"ruleConditions": "เงื่อนไขการจับคู่",
"addCondition": "เพิ่มเงื่อนไข",
"noExpectedValue": "ตัวดำเนินการนี้ไม่ต้องระบุค่า",
"scope": "ขอบเขต",
"priority": "ลำดับความสำคัญ",
"factPath": "ฟิลด์ธุรกิจ",
"operator": "ตัวดำเนินการ",
"operatorEquals": "เท่ากับ",
"operatorNotEquals": "ไม่เท่ากับ",
"operatorIn": "อยู่ในรายการ",
"operatorNotIn": "ไม่อยู่ในรายการ",
"operatorPrefix": "ขึ้นต้นด้วย",
"operatorSuffix": "ลงท้ายด้วย",
"operatorContains": "มีข้อความ",
"operatorNumericLength": "ความยาวตัวเลขเท่ากับ",
"operatorStringLength": "ความยาวข้อความเท่ากับ",
"operatorIsEmpty": "ว่าง",
"operatorIsNotEmpty": "ไม่ว่าง",
"expectedValue": "ค่าที่ต้องการ",
"routeScope": { "task": "ทั้งคำสั่งซื้อ", "line": "สินค้าแต่ละรายการ" },
"routeConditionSource": { "order_field": "ฟิลด์ในคำสั่งซื้อ", "system_fact": "ข้อมูลที่ระบบระบุ" },
"sourceCandidates": "แหล่งสต็อกที่ใช้ได้",
"sourceCandidatesHint": "เลือกได้หนึ่งหรือหลายแหล่ง ระบบจะประเมินตามลำดับความสำคัญของกฎ",
"publishedImmutable": "กฎที่เผยแพร่จะถูกเก็บเป็นคำนิยามตรวจสอบที่แก้ไขไม่ได้ โปรดสร้างและเผยแพร่กฎใหม่แทน",
"source": "แหล่งสต็อก",
"chooseSource": "เลือกแหล่งสต็อก",
"freightWarehouse": "คลังผู้ให้บริการ (ไม่บังคับ)",
"externalSystem": "ระบบปลายทาง",
"externalOrganization": "องค์กรปลายทาง (ไม่บังคับ)",
"externalSite": "สถานที่ปลายทาง (ไม่บังคับ)",
"externalWarehouseCode": "รหัสคลังปลายทาง",
"externalWarehouseName": "ชื่อคลังปลายทาง",
"snapshotStatus": "สถานะสแนปช็อต",
"snapshotFile": "ไฟล์สแนปช็อต", "expiresAt": "ใช้ได้ถึง", "lineCount": "จำนวนรายการสต็อก", "lineCountValue": "{count} รายการ", "sourceRun": "การทำงานต้นทาง", "runNo": "หมายเลขการทำงาน", "triggerMode": "วิธีเริ่ม", "startedAt": "เวลาเริ่ม", "duration": "ระยะเวลา", "durationValue": "{seconds} วินาที", "status": "สถานะ", "actions": "การดำเนินการ", "viewDetail": "ดูรายละเอียด", "view": "ดู", "download": "ดาวน์โหลด", "detail": "รายละเอียด", "resizeColumn": "ลากเพื่อปรับความกว้างคอลัมน์ {label}", "downloadFailed": "ดาวน์โหลดสแนปช็อตสต็อกไม่สำเร็จ", "snapshotDetail": "รายละเอียดสแนปช็อต", "exportDetail": "รายละเอียดการส่งออก", "historyNotCaptured": "ไม่มีข้อมูลในประวัติ", "exportResultReady": "สร้างไฟล์สต็อกแล้ว", "auditStatus": { "ready": "พร้อมใช้", "success": "สำเร็จ", "failed": "ล้มเหลว", "partial_failed": "ล้มเหลวบางส่วน", "skipped": "ข้ามแล้ว", "awaiting_rpa": "กำลังทำงาน", "unknown": "ประวัติ" }, "trigger": { "scheduled": "ตามกำหนด", "manual": "ด้วยตนเอง" },
"exportResult": "ผลการส่งออก",
"exportedAt": "เวลาส่งออก",
"emptySnapshots": "ไม่มีสแนปช็อตสต็อกให้แสดง",
"emptyExports": "ไม่มีบันทึกการส่งออก",
"emptyConfig": "ยังไม่มีการตั้งค่า โปรดสร้างรายการแรก",
"saveFailed": "บันทึกการตั้งค่าสินค้าคงคลังขนส่งไม่สำเร็จ",
"confirmRetire": "กฎนี้จะไม่เข้าร่วมการกำหนดเส้นทางใหม่ต่อไป ต้องการดำเนินการหรือไม่?",
"confirmRetireTitle": "ยืนยันการเก็บเข้าคลัง",
"confirmDeleteTitle": "ยืนยันการลบ",
"confirmDelete": "ลบได้เฉพาะการตั้งค่าที่สร้างผิดและไม่มีการอ้างอิง ต้องการดำเนินการหรือไม่?",
"deleteFailed": "ลบการตั้งค่าสินค้าคงคลังขนส่งไม่สำเร็จ"
},
"platformApps": {
"guideUsage": "ประเภทการใช้งานเอกสาร",
@@ -1141,14 +1517,20 @@
},
"shippingCustomers": {
"title": "ข้อมูลหลักลูกค้าขนส่ง", "subtitle": "จัดการตัวตนลูกค้า รหัสย่อ หลักฐานระบุตัวตน และการนำเข้าข้อมูลตั้งต้น", "add": "เพิ่มลูกค้า", "edit": "แก้ไขลูกค้า", "saving": "กำลังบันทึก...", "importButton": "นำเข้าข้อมูลตั้งต้น", "search": "ค้นหา", "searchPlaceholder": "ค้นหาชื่อลูกค้าหรือรหัสย่อ", "empty": "ไม่มีลูกค้า", "deactivate": "ปิดใช้งาน", "confirmDeactivate": "ยืนยันปิดใช้งานลูกค้า \"{name}\" หรือไม่? ประวัติธุรกิจจะยังคงอยู่", "yes": "ใช่", "no": "ไม่",
"fields": { "standardName": "ชื่อลูกค้ามาตรฐาน", "shortCode": "รหัสย่อลูกค้า", "shortCodeHint": "ตัวอักษร 2-6 ตัว บันทึกเป็นตัวพิมพ์ใหญ่", "status": "สถานะ", "remark": "หมายเหตุ" },
"externalRefs": { "title": "รหัสลูกค้าในระบบภายนอก", "hint": "ใช้จับคู่ Bill-to แบบตรงกัน รหัสย่อยังอ่านจากลูกค้ามาตรฐาน", "empty": "ยังไม่มีรหัสลูกค้าในระบบภายนอก", "sourceSystem": "ระบบต้นทาง เช่น ERP", "customerCode": "รหัสลูกค้าภายนอก" },
"sites": { "title": "สถานที่จัดส่ง", "hint": "ใช้จับคู่ลูกค้า Ship-to และ Ship-to Code โดยไม่สร้างลูกค้าวางบิลใหม่", "empty": "ยังไม่มีสถานที่จัดส่ง", "siteName": "ชื่อสถานที่", "siteCode": "Ship-to Code", "address": "ที่อยู่จัดส่ง", "city": "เมือง", "country": "ประเทศ/ภูมิภาค" },
"deleteDialog": { "open": "ลบถาวร", "title": "ลบลูกค้าถาวร", "subtitle": "ลบได้เฉพาะลูกค้าที่สร้างผิดและยังไม่อยู่ในสายงานธุรกิจหรือการตรวจสอบเท่านั้น", "loading": "กำลังตรวจสอบสิทธิ์การลบ...", "identifiers": "หลักฐานระบุตัวตน {count} รายการจะถูกลบพร้อมลูกค้า", "blocked": "ไม่สามารถลบลูกค้านี้ถาวรได้", "blockedHint": "โปรดปิดใช้งานหรือใช้กระบวนการรวมลูกค้าแทน", "warning": "ไม่สามารถย้อนกลับได้ โปรดกรอกรหัสย่อลูกค้าและเหตุผลการลบเพื่อยืนยัน", "confirmationShortCode": "กรอกรหัสย่อลูกค้า {shortCode} เพื่อยืนยัน", "reason": "เหตุผลการลบ", "confirm": "ยืนยันการลบถาวร", "deleted": "ลบลูกค้าถาวรแล้ว", "failed": "ลบลูกค้าถาวรไม่สำเร็จ", "blockers": { "business_cases": "รายการธุรกิจ", "business_sequences": "ลำดับหมายเลขธุรกิจ", "external_references": "รหัสอ้างอิงภายนอก", "import_target_rows": "แถวเป้าหมายการนำเข้า", "import_result_rows": "แถวผลลัพธ์การนำเข้า", "shadow_top_candidates": "ตัวเลือกเงาอันดับสูงสุด", "shadow_manual_labels": "ป้ายกำกับเงาโดยมนุษย์", "shadow_candidate_matches": "การจับคู่ตัวเลือกเงา", "merged_source_customers": "ลูกค้าต้นทางที่รวมแล้ว", "merged_into_customer": "ความสัมพันธ์การรวมลูกค้าเป้าหมาย" } },
"mergeDialog": { "open": "รวมลูกค้า", "title": "รวมลูกค้าที่ซ้ำ", "subtitle": "ข้อมูลธุรกิจและการตรวจสอบย้อนหลังคงเดิม ย้ายเฉพาะการตั้งค่าระบุตัวตนในอนาคตไปยังลูกค้าเป้าหมาย", "source": "ลูกค้าต้นทาง", "target": "ลูกค้าเป้าหมาย", "chooseTarget": "เลือกลูกค้าเป้าหมายที่ใช้งาน", "historyTitle": "เก็บการอ้างอิงย้อนหลัง", "historyHint": "หมายเลขธุรกิจ รายการธุรกิจ การนำเข้า และการตรวจสอบแบบเงายังคงชี้ไปยังลูกค้าต้นทางและจะไม่ถูกแก้ไข", "historyCount": "มีข้อมูลอ้างอิงย้อนหลังหรือการตรวจสอบ {count} รายการที่คงเดิม", "migrateTitle": "รวมการตั้งค่าอนาคต", "identifiers": "หลักฐานที่ย้าย", "duplicates": "หลักฐานซ้ำ", "references": "รหัสอ้างอิง", "warning": "ลูกค้าต้นทางจะเป็นสถานะรวมแล้ว และใช้กับงานใหม่หรือแก้ไขอีกไม่ได้", "confirmationShortCode": "กรอกรหัสย่อลูกค้าต้นทาง {shortCode} เพื่อยืนยัน", "reason": "เหตุผลการรวม", "confirm": "ยืนยันการรวม", "merged": "รวมลูกค้าแล้ว", "failed": "รวมลูกค้าไม่สำเร็จ", "previewFailed": "โหลดตัวอย่างการรวมไม่สำเร็จ" },
"fields": { "standardName": "ชื่อลูกค้ามาตรฐาน", "shortCode": "รหัสย่อลูกค้า", "shortCodeHint": "ตัวอักษร 2-6 ตัว บันทึกเป็นตัวพิมพ์ใหญ่", "status": "สถานะ", "remark": "หมายเหตุ", "changeReason": "เหตุผลการเปลี่ยนแปลง", "changeReasonHint": "ต้องระบุเมื่อแก้ไขรหัสย่อหรือสถานะ" },
"headers": { "name": "ลูกค้า", "shortCode": "รหัสย่อ", "status": "สถานะ", "identifiers": "หลักฐานระบุตัวตน", "cases": "รายการธุรกิจ", "actions": "การดำเนินการ" },
"status": { "all": "ทุกสถานะ", "active": "ใช้งาน", "inactive": "ปิดใช้งาน" },
"status": { "all": "ทุกสถานะ", "active": "ใช้งาน", "inactive": "ปิดใช้งาน", "merged": "รวมแล้ว" },
"identifierStatus": { "pending": "รอตรวจสอบ", "approved": "อนุมัติแล้ว", "disabled": "ปิดใช้งาน" },
"identifierTypes": { "name_alias": "ชื่อเรียกอื่น", "email": "อีเมล", "domain": "โดเมน", "template_fingerprint": "ลายนิ้วมือเทมเพลต", "address": "ที่อยู่", "contact": "ผู้ติดต่อ" },
"identifiers": { "title": "หลักฐานระบุตัวตนลูกค้า", "type": "ประเภท", "value": "ค่าต้นฉบับ / ค่ามาตรฐาน", "status": "สถานะตรวจสอบ", "autoMatch": "อนุญาตจับคู่อัตโนมัติ", "empty": "ไม่มีหลักฐาน", "approve": "อนุมัติ", "enableAuto": "เปิดจับคู่อัตโนมัติ", "disable": "ปิดใช้งาน", "add": "เพิ่มหลักฐาน", "valuePlaceholder": "กรอกชื่อ อีเมล โดเมน ฯลฯ", "allowAuto": "อนุญาตจับคู่อัตโนมัติ" },
"import": { "title": "นำเข้าลูกค้าเริ่มต้น", "subtitle": "อัปโหลดชั่วคราว ตรวจสอบข้อขัดแย้ง ตัดสินใจคำเตือน แล้วเผยแพร่ทั้งชุด", "file": "ไฟล์ Excel", "sourceSystem": "ระบบต้นทาง", "downloadTemplate": "ดาวน์โหลดเทมเพลต", "upload": "อัปโหลดและตรวจสอบ", "uploaded": "ตรวจสอบไฟล์เสร็จแล้ว", "uploadFailed": "อัปโหลดล้มเหลว", "row": "ตำแหน่ง", "type": "ประเภทแถว", "key": "รหัสเดิม", "preview": "ตัวอย่าง", "validation": "ผลตรวจสอบ", "decision": "การดำเนินการ", "choose": "เลือก", "target": "เลือกลูกค้าเป้าหมาย", "publish": "เผยแพร่ทั้งชุด", "published": "เผยแพร่ข้อมูลลูกค้าแล้ว", "publishFailed": "เผยแพร่ล้มเหลว", "alreadyPublished": "เผยแพร่แล้ว", "downloadReconciliation": "ดาวน์โหลด CSV กระทบยอด", "downloadFailed": "ดาวน์โหลดไฟล์ล้มเหลว", "decisionFailed": "บันทึกการตัดสินใจล้มเหลว", "stats": { "total": "ทั้งหมด", "valid": "ถูกต้อง", "warning": "คำเตือน", "error": "ข้อผิดพลาด", "published": "เผยแพร่แล้ว" }, "rowTypes": { "customer": "ลูกค้า", "identifier": "หลักฐาน" }, "validationStatus": { "valid": "ผ่าน", "warning": "ต้องตัดสินใจ", "error": "ถูกบล็อก" }, "actions": { "create": "สร้าง", "update": "อัปเดต", "merge": "รวม", "skip": "ข้าม" } },
"shadow": { "title": "คุณภาพการระบุลูกค้าแบบเงา", "subtitle": "ตัวอย่างแบบเงาไม่มีผลต่อธุรกิจ และแผงนี้แสดงตัวชี้วัดการยืนยันอัตโนมัติและการแก้ไขโดยผู้ดูแล", "refresh": "รีเฟรชรายงาน", "loadFailed": "โหลดรายงานแบบเงาล้มเหลว", "labelFailed": "บันทึกป้ายกำกับล้มเหลว", "labeled": "บันทึกป้ายกำกับแล้ว", "sample": "รายการ / การรับเข้า", "status": "ผลแบบเงา", "topCandidate": "ตัวเลือกสูงสุด", "manualLabel": "ป้ายกำกับจากผู้ดูแล", "chooseCustomer": "เลือกลูกค้ามาตรฐาน", "empty": "ไม่มีตัวอย่างแบบเงา", "auditTitle": "บันทึกการระบุและแก้ไขลูกค้า", "auditTask": "หมายเลขงาน", "auditEvent": "เหตุการณ์", "auditBusinessNo": "หมายเลขธุรกิจ", "auditTime": "เวลา", "auditEmpty": "ไม่มีเหตุการณ์ตรวจสอบลูกค้า", "cards": { "total": "ตัวอย่างทั้งหมด", "unique": "ตัวเลือกเดียว", "ambiguous": "กำกวม", "unmatched": "ไม่ตรง", "accuracy": "ความแม่นยำที่ติดป้าย", "autoBound": "ผูกอัตโนมัติ", "autoRate": "อัตรายืนยันอัตโนมัติ", "corrected": "งานที่แก้ไขแล้ว" }, "statuses": { "unique_candidate": "ตัวเลือกเดียว", "ambiguous": "กำกวม", "unmatched": "ไม่ตรง", "failed": "คำนวณแบบเงาล้มเหลว" }, "events": { "customer_auto_resolution_evaluated": "ประเมินการระบุอัตโนมัติแล้ว", "customer_auto_confirmed": "ยืนยันลูกค้าอัตโนมัติแล้ว", "customer_correction_applied": "ใช้การแก้ไขลูกค้าแล้ว", "customer_historical_backfilled": "เติมข้อมูลลูกค้าย้อนหลังแล้ว" } },
"lifecycle": { "open": "ไทม์ไลน์การกำกับดูแล", "title": "ไทม์ไลน์การกำกับดูแลลูกค้า", "loading": "กำลังโหลดไทม์ไลน์...", "empty": "ไม่มีเหตุการณ์การกำกับดูแล", "time": "เวลา", "event": "เหตุการณ์", "reason": "เหตุผล", "change": "การเปลี่ยนแปลง", "events": { "created": "สร้างลูกค้า", "updated": "อัปเดตลูกค้า", "identifier_created": "เพิ่มหลักฐาน", "identifier_updated": "อัปเดตหลักฐาน", "merged_source": "รวมเป็นต้นทาง", "merged_target": "รวมเป็นปลายทาง", "deleted": "ลบถาวร" } },
"prompts": { "deactivateReason": "ระบุเหตุผลการปิดใช้งาน", "identifierChangeReason": "ระบุเหตุผลการอนุมัติ ปิดใช้งาน หรืออนุญาตการจับคู่อัตโนมัติ" },
"shadow": { "title": "คุณภาพการระบุลูกค้าแบบเงา", "subtitle": "ตัวอย่างแบบเงาไม่มีผลต่อธุรกิจ และแผงนี้แสดงตัวชี้วัดการยืนยันอัตโนมัติและการแก้ไขโดยผู้ดูแล", "refresh": "รีเฟรชรายงาน", "loadFailed": "โหลดรายงานแบบเงาล้มเหลว", "labelFailed": "บันทึกป้ายกำกับล้มเหลว", "labeled": "บันทึกป้ายกำกับแล้ว", "sample": "รายการ / การรับเข้า", "status": "ผลแบบเงา", "topCandidate": "ตัวเลือกสูงสุด", "manualLabel": "ป้ายกำกับจากผู้ดูแล", "chooseCustomer": "เลือกลูกค้ามาตรฐาน", "empty": "ไม่มีตัวอย่างแบบเงา", "auditTitle": "บันทึกการระบุและแก้ไขลูกค้า", "auditTask": "หมายเลขงาน", "auditEvent": "เหตุการณ์", "auditBusinessNo": "หมายเลขธุรกิจ", "auditTime": "เวลา", "auditEmpty": "ไม่มีเหตุการณ์ตรวจสอบลูกค้า", "cards": { "total": "ตัวอย่างทั้งหมด", "unique": "ตัวเลือกเดียว", "ambiguous": "กำกวม", "unmatched": "ไม่ตรง", "accuracy": "ความแม่นยำที่ติดป้าย", "autoBound": "ผูกอัตโนมัติ", "autoRate": "อัตรายืนยันอัตโนมัติ", "corrected": "งานที่แก้ไขแล้ว" }, "statuses": { "unique_candidate": "ตัวเลือกเดียว", "ambiguous": "กำกวม", "unmatched": "ไม่ตรง", "failed": "คำนวณแบบเงาล้มเหลว" }, "events": { "customer_auto_resolution_evaluated": "ประเมินการระบุอัตโนมัติแล้ว", "customer_auto_confirmed": "ยืนยันลูกค้าอัตโนมัติแล้ว", "customer_correction_applied": "ใช้การแก้ไขลูกค้าแล้ว" }, "gate": { "title": "ประตูคุณภาพการยืนยันอัตโนมัติ", "metrics": "ตัวอย่างที่ติดป้ายโดยมนุษย์ {samples}/{minSamples}; ความแม่นยำ {accuracy} (ต้องการ {minAccuracy})", "statuses": { "eligible": "ผ่านเกณฑ์: ยืนยันอัตโนมัติได้เมื่อหลักฐานเข้มแข็งและไม่กำกวม", "insufficient_labeled_samples": "ลดระดับความปลอดภัย: ตัวอย่างที่ติดป้ายไม่เพียงพอ", "insufficient_accuracy": "ลดระดับความปลอดภัย: ความแม่นยำต่ำกว่าเกณฑ์" } } },
"msg": { "loadFailed": "โหลดลูกค้าล้มเหลว", "nameRequired": "กรอกชื่อลูกค้ามาตรฐาน", "shortCodeInvalid": "รหัสย่อต้องเป็นตัวอักษร 2-6 ตัว", "saved": "บันทึกลูกค้าแล้ว", "saveFailed": "บันทึกล้มเหลว", "identifierRequired": "กรอกค่าหลักฐาน", "identifierSaved": "บันทึกหลักฐานแล้ว" }
},
"role": {
+18 -34
View File
@@ -15,6 +15,8 @@
"uploading": "กำลังอัปโหลด",
"processing": "กำลังประมวลผล",
"ready": "พร้อมใช้งาน",
"parsing": "กำลังแยกวิเคราะห์",
"parseSucceeded": "แยกวิเคราะห์สำเร็จ",
"uploadFailed": "อัปโหลดไม่สำเร็จ",
"parseFailed": "ประมวลผลไม่สำเร็จ",
"retry": "ลองอัปโหลดอีกครั้ง",
@@ -92,6 +94,17 @@
"shippingNoticeDuplicateResolved": "บันทึกวิธีจัดการรายการซ้ำแล้ว",
"shippingNoticeDuplicateResolveFailed": "บันทึกวิธีจัดการรายการซ้ำไม่สำเร็จ",
"shippingCandidateTitle": "ตรวจสอบรายการคำสั่งซื้อ",
"shippingCustomerMatch": {
"title": "การจับคู่ลูกค้า",
"role": "บทบาทลูกค้า",
"rawName": "ข้อความในคำสั่งซื้อ",
"standardName": "ลูกค้ามาตรฐาน",
"shortCode": "รหัสย่อ",
"site": "สถานที่จัดส่ง",
"statusLabel": "สถานะ",
"roles": { "bill_to": "ลูกค้าวางบิล", "ship_to": "ลูกค้าจัดส่ง" },
"status": { "unmatched": "ไม่พบข้อมูล", "unique_candidate": "พบหนึ่งรายการ", "ambiguous": "พบหลายรายการ", "confirmed": "ยืนยันแล้ว" }
},
"shippingCandidateCount": "คำสั่งซื้อ {count} รายการ",
"shippingCandidateReady": "พร้อมสร้างงาน",
"shippingCandidateNeedsReview": "ต้องตรวจสอบ",
@@ -126,23 +139,14 @@
"shippingCandidateUpdateDone": "บันทึกการแก้ไขรายการคำสั่งซื้อแล้ว",
"shippingCandidateUpdateFailed": "บันทึกรายการคำสั่งซื้อไม่สำเร็จ",
"shippingInventoryUploadFailed": "อัปโหลดไฟล์สต็อกล้มเหลว",
"shippingInventorySiteRequired": "ไฟล์สต็อกสำหรับใช้งานจริงต้องนำเข้าโดยแหล่งสต็อกที่เปิดใช้งาน หากต้องการวิเคราะห์ตารางในบทสนทนา โปรดระบุอย่างชัดเจนว่าเป็นไฟล์สต็อก",
"shippingNoticeSpreadsheetIntentRequired": "แนบไฟล์ตารางแล้ว โปรดระบุอย่างชัดเจนว่าเป็นไฟล์สต็อก (เช่น \"นี่คือไฟล์สต็อก โปรดวิเคราะห์\") ก่อนดำเนินการต่อ ระบบจะไม่เดาวัตถุประสงค์จากนามสกุลไฟล์เพียงอย่างเดียว",
"shippingNoticeRefreshDone": "รีเฟรชสถานะงานปัจจุบันแล้ว",
"shippingNoticeRetryUploadAction": "ลองอัปโหลดไปยังระบบขนส่งอีกครั้ง",
"shippingNoticeRetryUploadQueued": "เริ่มอัปโหลดอีกครั้งแล้ว โปรดรีเฟรชภายหลังเพื่อตรวจสอบผลลัพธ์",
"shippingNoticeRetryUploadFailed": "ลองอัปโหลดอีกครั้งไม่สำเร็จ",
"shippingNoticePasteHint": "วางข้อมูลสต็อกในช่องข้อความแล้วส่ง",
"shippingNoticeDecisionDone": "ดำเนินการเสร็จแล้ว",
"shippingNoticePrompt": {
"inventory": {
"prefix": "ฉันได้อัปโหลดไฟล์สต็อกแล้ว",
"prefixWithFile": "ฉันได้อัปโหลดไฟล์สต็อก \"{fileName}\" แล้ว",
"prefixBatch": "ฉันได้อัปโหลดสแนปช็อตสต็อกของชุดงาน {batchNo} แล้ว",
"prefixBatchWithFile": "ฉันได้อัปโหลดสแนปช็อตสต็อก \"{fileName}\" ของชุดงาน {batchNo} แล้ว",
"mapInferSuggested": "{prefix} กรุณาดำเนินการจับคู่คอลัมน์สต็อกต่อ หากระบบรู้จักการจับคู่ครบแล้ว ให้ใช้การจับคู่นั้นได้ทันที และตอบเพียงประโยคสั้น ๆ ว่าพร้อมให้ยืนยันฟิลด์สต็อกแล้ว ห้ามแสดงเมนูการทำงาน ตัวเลือกแบบมีหมายเลข รายการปุ่ม หรือข้อความแนว \"เลือกวิธีต่อไปนี้\" เพราะปุ่มให้ระบบแสดงเอง",
"mapInferPending": "{prefix} กรุณาแยกการจับคู่คอลัมน์สต็อกต่อ และเมื่อพร้อมแล้วให้ตอบเพียงประโยคสั้น ๆ ว่าพร้อมให้ยืนยันฟิลด์สต็อกแล้ว ห้ามแสดงเมนูการทำงาน ตัวเลือกแบบมีหมายเลข รายการปุ่ม หรือข้อความแนว \"เลือกวิธีต่อไปนี้\" เพราะปุ่มให้ระบบแสดงเอง",
"alignReview": "{prefix} กรุณาตอบเพียงประโยคสั้น ๆ ว่าพร้อมให้ยืนยันฟิลด์สต็อกแล้ว และให้ฉันตรวจคอลัมน์ก่อนดำเนินการต่อ ห้ามแสดงเมนูการทำงาน ตัวเลือกแบบมีหมายเลข รายการปุ่ม หรือข้อความแนว \"เลือกวิธีต่อไปนี้\" เพราะปุ่มให้ระบบแสดงเอง",
"default": "{prefix} กรุณาดำเนินการนำเข้าสต็อกต่อและบอกเฉพาะสถานะปัจจุบัน ห้ามแสดงเมนูการทำงาน ตัวเลือกแบบมีหมายเลข รายการปุ่ม หรือข้อความแนว \"เลือกวิธีต่อไปนี้\" เพราะปุ่มให้ระบบแสดงเอง"
},
"notice": {
"fileLabelSingleFile": "\"{fileName}\"",
"fileLabelMulti": "ใบแจ้งจัดส่ง {fileCount} ฉบับ",
@@ -151,29 +155,12 @@
"batchLabel": "ชุดงาน {batchNo}",
"taskLabel": "งานปัจจุบัน {taskId}",
"taskList": "รายการงาน: {taskIds}",
"autoInventoryAction": "อัปโหลดสต็อกและจับคู่คอลัมน์",
"autoNoticeAction": "สร้างงานและแยกข้อมูลใบแจ้งจัดส่ง",
"autoSpreadsheetAction": "โปรดระบุว่าไฟล์นี้เป็นไฟล์คำสั่งซื้อหรือไฟล์สต็อก",
"multiTask": "{summary} {taskListText}กรุณาจัดการเฉพาะงานที่โฟกัสอยู่ในขณะนี้ก่อน อ่านสถานะงานปัจจุบันก่อน หากยังต้องแยกข้อมูล ให้แยกใบแจ้งส่งสินค้าและบันทึกผลลัพธ์ หากเข้าสู่ขั้นตอนถัดไปแล้ว ให้สรุปความคืบหน้าและขั้นตอนถัดไปโดยตรง อย่าถามซ้ำว่าจะเริ่มแยกข้อมูลหรือไม่ และไม่ต้องวนประมวลผลงานอื่นทั้งชุด",
"singleTask": "{summary} กรุณาอ่านสถานะงานปัจจุบันก่อน หากยังต้องแยกข้อมูล ให้แยกใบแจ้งส่งสินค้าและบันทึกผลลัพธ์ หากเข้าสู่ขั้นตอนถัดไปแล้ว ให้สรุปความคืบหน้าและขั้นตอนถัดไปโดยตรง อย่าถามซ้ำว่าจะเริ่มแยกข้อมูลหรือไม่"
}
},
"shippingNoticeMapping": {
"inventoryHeaders": "หัวคอลัมน์สต็อก",
"headerRow": "แถวหัวตาราง: {row}",
"sample": "ตัวอย่าง",
"orderDetails": "รายละเอียดคำสั่งซื้อ",
"orderRowCount": "จำนวนแถวคำสั่งซื้อ: {count}",
"orderPartNumberPreview": "หมายเลขชิ้นส่วนภายใน ({count} รายการแรก): {partNumbers}",
"partNumberColumnRequired": "คอลัมน์หมายเลขชิ้นส่วนภายใน (จำเป็น)",
"availableQtyColumnRequired": "คอลัมน์จำนวนคงเหลือ (จำเป็น)",
"reservationIdColumnRequired": "คอลัมน์ Reservation ID (จำเป็น)",
"selectHeader": "เลือกชื่อหัวคอลัมน์",
"reupload": "อัปโหลดใหม่",
"applying": "กำลังนำไปใช้...",
"applyAndParse": "นำการจับคู่ไปใช้และแยกข้อมูล",
"empty": "(ว่าง)",
"unrecognized": "(ไม่รู้จัก)"
},
"shippingParsedResult": {
"title": "ผลลัพธ์การแยกคำสั่งซื้อ",
"statusBlocked": "ถูกบล็อก",
@@ -299,8 +286,6 @@
"shortageNoDetails": "ไม่พบสต็อกขาดสำหรับงาน {taskId}",
"diagnosisInventoryRpaTitle": "Inventory RPA ยังไม่ส่งคืนสแนปช็อตสต็อกที่ใช้ได้",
"diagnosisInventoryRpaAdvice": "ลองดึงสต็อกใหม่ก่อน หากระบบภายนอกใช้ไม่ได้ ให้อัปโหลดไฟล์สต็อกด้วยตนเอง",
"diagnosisAlignReviewTitle": "ต้องยืนยันการแมปคอลัมน์สต็อกด้วยตนเอง",
"diagnosisAlignReviewAdvice": "ยืนยันการแมป SKU, Reservation ID และจำนวนที่ใช้ได้ เพื่อป้องกันการจับคู่ผิดรายการ",
"diagnosisParseReviewTitle": "ความมั่นใจในการอ่านใบแจ้งต่ำ ต้องตรวจทานข้อมูล",
"diagnosisParseReviewAdvice": "ตรวจลูกค้า PO วันที่ต้องการ และรายการคำสั่งซื้อก่อนดำเนินการต่อ",
"diagnosisReservationRequiredTitle": "ไม่มี Reservation ID จึงล็อกสต็อกตามใบจองไม่ได้",
@@ -362,7 +347,6 @@
"blockedUploadRetryable": "อัปโหลดล้มเหลว ลองใหม่ได้",
"suggestedAction": "คำแนะนำ:",
"suggestShortageActions": "ดูส่วนขาด / กลับไปแก้ไข / จับคู่ใหม่",
"suggestConfirmMapping": "ยืนยันการแมปคอลัมน์ แล้วจับคู่ต่อ",
"suggestReviewParse": "ตรวจข้อมูลที่อ่านได้ แล้วค่อยยืนยันหรือแก้ไข",
"suggestRetryStep": "ตรวจจุดที่ติดขัด แล้วลองขั้นตอนนี้อีกครั้ง",
"suggestViewOnly": "ตรวจไฟล์ส่งออกหรือใบตอบรับ",
@@ -423,7 +407,7 @@
"noticeParse": "แยกใบแจ้ง",
"parseConfirm": "ยืนยันผลแยก",
"inventoryPrepare": "เตรียมสต็อก",
"alignConfirm": "ยืนยันการจับคู่คอลัมน์",
"alignConfirm": "ตรวจสอบสต็อก",
"inventoryMatch": "จับคู่สต็อก",
"shortageHandle": "จัดการส่วนขาด",
"generateExcel": "สร้าง Excel",
@@ -449,7 +433,7 @@
"noticeSubmit": "ส่งใบแจ้ง",
"parseConfirm": "ยืนยันผลแยก",
"inventoryPrepare": "เตรียมสต็อก",
"alignConfirm": "ยืนยันการจับคู่คอลัมน์",
"alignConfirm": "ตรวจสอบสต็อก",
"matchInventory": "จับคู่สต็อก",
"generateFile": "สร้างไฟล์จัดส่ง",
"uploadFreight": "อัปโหลดผู้ให้บริการขนส่ง"
+109 -4
View File
@@ -1,7 +1,34 @@
{
"generic": "คำขอล้มเหลว",
"codes": {
"SHIPPING_ORDER_SCHEMA_NOT_FOUND": "ยังไม่ได้เริ่มต้นเทมเพลตคำสั่งซื้อ",
"SHIPPING_ORDER_SCHEMA_EXISTS": "มีเทมเพลตคำสั่งซื้ออยู่แล้ว",
"SHIPPING_ORDER_SCHEMA_DRAFT_EXISTS": "มีฉบับร่างเทมเพลตคำสั่งซื้ออยู่แล้ว โปรดดำเนินการหรือเผยแพร่ฉบับปัจจุบันก่อน",
"SHIPPING_ORDER_SCHEMA_VERSION_INVALID": "การตั้งค่าเวอร์ชันฟิลด์คำสั่งซื้อไม่ถูกต้อง",
"SHIPPING_ORDER_SCHEMA_LOCK_VERSION_REQUIRED": "ฉบับร่างฟิลด์คำสั่งซื้อไม่มีเวอร์ชันล็อก โปรดรีเฟรชแล้วลองใหม่",
"SHIPPING_ORDER_SCHEMA_VERSION_CONFLICT": "ผู้ดูแลระบบรายอื่นแก้ไขฉบับร่างนี้แล้ว หน้าจะโหลดเวอร์ชันล่าสุดอีกครั้ง",
"SHIPPING_ORDER_SCHEMA_VERSION_IMMUTABLE": "ไม่สามารถแก้ไขเวอร์ชันฟิลด์คำสั่งซื้อที่เผยแพร่แล้ว",
"SHIPPING_ORDER_SCHEMA_VERSION_NOT_FOUND": "ไม่พบเวอร์ชันฟิลด์คำสั่งซื้อ",
"SHIPPING_ORDER_SCHEMA_VERSION_DELETE_BLOCKED": "ลบได้เฉพาะเวอร์ชันฉบับร่าง",
"SHIPPING_ORDER_SCHEMA_PUBLISH_INVALID": "ไม่สามารถเผยแพร่เวอร์ชันฟิลด์คำสั่งซื้อปัจจุบัน",
"SHIPPING_ORDER_SCHEMA_PUBLISH_DEPENDENCY_BLOCKED": "เวอร์ชันนี้ลบฟิลด์คำสั่งซื้อที่ยังถูกอ้างอิงโดยกฎเส้นทาง โปรไฟล์การแยกข้อมูล หรือเทมเพลต Excel โปรดย้ายการตั้งค่าเหล่านั้นก่อน",
"SHIPPING_ORDER_SCHEMA_NOT_PUBLISHED": "ยังไม่มีเวอร์ชันฟิลด์คำสั่งซื้อที่เผยแพร่และใช้งานได้",
"SHIPPING_ORDER_FIELD_INVALID": "รหัส ขอบเขต หรือชนิดของฟิลด์คำสั่งซื้อไม่ถูกต้อง",
"SHIPPING_ORDER_FIELD_NOT_FOUND": "ไม่พบฟิลด์คำสั่งซื้อ",
"SHIPPING_ORDER_FIELD_IMMUTABLE": "ไม่สามารถแก้ไข code ขอบเขต และชนิดของฟิลด์หลังเผยแพร่",
"SHIPPING_ORDER_FIELD_CONFLICT": "รหัสฟิลด์คำสั่งซื้อมีอยู่แล้ว",
"SHIPPING_ORDER_FIELD_RETIRE_BLOCKED": "ฟิลด์คำสั่งซื้อถูกอ้างอิงโดยฉบับร่างและไม่สามารถเลิกใช้งานได้",
"AUTH_UNAUTHORIZED": "กรุณาเข้าสู่ระบบก่อน",
"SHIPPING_CUSTOMER_DELETE_REASON_REQUIRED": "ต้องระบุเหตุผลเพื่อลบลูกค้าถาวร",
"SHIPPING_CUSTOMER_DELETE_CONFIRMATION_INVALID": "รหัสย่อที่ใช้ยืนยันการลบไม่ถูกต้อง",
"SHIPPING_CUSTOMER_DELETE_BLOCKED": "ลูกค้ามีข้อมูลอ้างอิงทางธุรกิจหรือการตรวจสอบ จึงลบถาวรไม่ได้",
"SHIPPING_CUSTOMER_MERGED_LOCKED": "ลูกค้าถูกรวมแล้ว จึงใช้กับธุรกิจใหม่หรือแก้ไขไม่ได้",
"SHIPPING_CUSTOMER_MERGE_TARGET_REQUIRED": "เลือกลูกค้าเป้าหมายสำหรับการรวม",
"SHIPPING_CUSTOMER_MERGE_TARGET_INVALID": "ลูกค้าเป้าหมายสำหรับการรวมต้องอยู่ในสถานะใช้งาน",
"SHIPPING_CUSTOMER_MERGE_SAME_CUSTOMER": "ลูกค้าต้นทางและเป้าหมายต้องไม่ใช่รายเดียวกัน",
"SHIPPING_CUSTOMER_MERGE_SOURCE_ALREADY_MERGED": "ลูกค้าต้นทางถูกรวมแล้ว",
"SHIPPING_CUSTOMER_MERGE_REASON_REQUIRED": "ต้องระบุเหตุผลในการรวมลูกค้า",
"SHIPPING_CUSTOMER_MERGE_CONFIRMATION_INVALID": "รหัสย่อลูกค้าต้นทางที่ใช้ยืนยันการรวมไม่ถูกต้อง",
"AUTH_INCORRECT_PASSWORD": "รหัสผ่านไม่ถูกต้อง",
"AUTH_INCORRECT_CURRENT_PASSWORD": "รหัสผ่านปัจจุบันไม่ถูกต้อง",
"AUTH_USER_NOT_FOUND": "ไม่พบผู้ใช้",
@@ -10,6 +37,80 @@
"RESOURCE_NOT_FOUND": "ไม่พบทรัพยากรที่ร้องขอ",
"RESOURCE_CONFLICT": "คำขอขัดแย้ง โปรดรีเฟรชแล้วลองใหม่",
"VALIDATION_INVALID_PARAM": "พารามิเตอร์คำขอไม่ถูกต้อง",
"SHIPPING_INVENTORY_EXTERNAL_MAPPING_NOT_FOUND": "ไม่พบการแมปคลังระบบภายนอก",
"SHIPPING_INVENTORY_EXTERNAL_MAPPING_CONFLICT": "มีการแมปคลังระบบภายนอกที่ใช้งานอยู่สำหรับแหล่งสินค้าคงคลังและคลังขนส่งนี้แล้ว",
"SHIPPING_INVENTORY_SOURCE_CONFIG_INVALID": "เส้นทางรายงาน พารามิเตอร์ค้นหา หรือนามแฝงของแหล่งสินค้าคงคลังไม่ถูกต้อง",
"SHIPPING_RPA_PROFILE_CONFIG_INVALID": "การตั้งค่าการเชื่อมต่อเข้าสู่ระบบขนส่งไม่ถูกต้อง ขณะนี้รองรับเฉพาะชื่อผู้ใช้และรหัสผ่าน",
"SHIPPING_EXCEL_TEMPLATE_ASSET_INVALID": "ไฟล์เทมเพลต Excel ไม่ถูกต้องหรือไม่สามารถอ่านได้",
"SHIPPING_EXCEL_TEMPLATE_DEFINITION_INVALID": "ข้อกำหนดการจับคู่เทมเพลต Excel ไม่ถูกต้อง",
"SHIPPING_EXCEL_TEMPLATE_DELETE_BLOCKED": "ลบได้เฉพาะเทมเพลต Excel ฉบับร่างเท่านั้น",
"SHIPPING_EXCEL_TEMPLATE_DRAFT_EXISTS": "เทมเพลตนี้มีฉบับร่างอยู่แล้ว",
"SHIPPING_EXCEL_TEMPLATE_FIELD_INVALID": "การจับคู่ฟิลด์เทมเพลต Excel ไม่ถูกต้อง",
"SHIPPING_EXCEL_TEMPLATE_IMMUTABLE": "ไม่สามารถแก้ไขเทมเพลต Excel ที่เผยแพร่หรือเลิกใช้งานแล้ว",
"SHIPPING_EXCEL_TEMPLATE_INVALID": "การตั้งค่าเทมเพลต Excel ไม่ถูกต้อง",
"SHIPPING_EXCEL_TEMPLATE_NOT_FOUND": "ไม่พบเทมเพลต Excel",
"SHIPPING_EXCEL_TEMPLATE_PUBLISH_INVALID": "ไม่สามารถเผยแพร่เทมเพลต Excel นี้ได้",
"SHIPPING_EXCEL_TEMPLATE_REQUIRED": "ต้องผูกเทมเพลต Excel ที่เผยแพร่แล้วก่อนเปิดใช้แหล่งสินค้าคงคลัง",
"SHIPPING_EXCEL_TEMPLATE_RETIRE_BLOCKED": "เทมเพลต Excel ยังถูกอ้างอิงโดยแหล่งสินค้าคงคลังและไม่สามารถเลิกใช้งานได้",
"SHIPPING_EXCEL_TEMPLATE_RETIRE_INVALID": "ไม่สามารถเลิกใช้งานเทมเพลต Excel นี้ได้",
"SHIPPING_EXCEL_TEMPLATE_TARGET_DUPLICATE": "เทมเพลต Excel มีการจับคู่เซลล์ปลายทางซ้ำกัน",
"SHIPPING_EXPORT_ARCHIVE_EMPTY": "งานที่เลือกไม่มีไฟล์ส่งออกให้ดาวน์โหลด",
"SHIPPING_EXPORT_ARCHIVE_NOT_FOUND": "ไม่พบไฟล์ส่งออกที่ดาวน์โหลดได้",
"SHIPPING_EXPORT_ARCHIVE_SELECTION_INVALID": "การเลือกงานสำหรับดาวน์โหลดแบบกลุ่มไม่ถูกต้อง",
"SHIPPING_EXPORT_ARCHIVE_TOO_LARGE": "การดาวน์โหลดแบบกลุ่มรองรับสูงสุด 100 งานต่อครั้ง",
"SHIPPING_INVENTORY_PARSING_PROFILE_DELETE_BLOCKED": "ลบได้เฉพาะโปรไฟล์การแยกข้อมูลสินค้าคงคลังฉบับร่างเท่านั้น",
"SHIPPING_INVENTORY_PARSING_PROFILE_IMMUTABLE": "ไม่สามารถแก้ไขโปรไฟล์การแยกข้อมูลสินค้าคงคลังที่เผยแพร่หรือเลิกใช้งานแล้ว",
"SHIPPING_INVENTORY_PARSING_PROFILE_INVALID": "โปรไฟล์การแยกข้อมูลสินค้าคงคลังไม่ถูกต้อง",
"SHIPPING_INVENTORY_PARSING_PROFILE_NOT_FOUND": "ไม่พบโปรไฟล์การแยกข้อมูลสินค้าคงคลัง",
"SHIPPING_INVENTORY_PARSING_PROFILE_PUBLISH_INVALID": "ไม่สามารถเผยแพร่โปรไฟล์การแยกข้อมูลสินค้าคงคลังนี้ได้",
"SHIPPING_INVENTORY_PARSING_PROFILE_REQUIRED": "ต้องผูกโปรไฟล์การแยกข้อมูลสินค้าคงคลังที่เผยแพร่แล้วก่อนเปิดใช้แหล่งสินค้าคงคลัง",
"SHIPPING_INVENTORY_PARSING_PROFILE_RETIRE_BLOCKED": "โปรไฟล์การแยกข้อมูลสินค้าคงคลังยังถูกอ้างอิงและไม่สามารถเลิกใช้งานได้",
"SHIPPING_INVENTORY_PARSING_PROFILE_RETIRE_INVALID": "ไม่สามารถเลิกใช้งานโปรไฟล์การแยกข้อมูลสินค้าคงคลังนี้ได้",
"SHIPPING_INVENTORY_FIELD_CONFLICT": "ชื่อฟิลด์สต็อกมีอยู่แล้ว",
"SHIPPING_INVENTORY_FIELD_DELETE_BLOCKED": "ฟิลด์สต็อกนี้เป็นฟิลด์หลักหรือยังถูกอ้างอิงโดยการตั้งค่า จึงลบหรือเลิกใช้ไม่ได้",
"SHIPPING_INVENTORY_FIELD_IMMUTABLE": "ฟิลด์สต็อกที่เลิกใช้แล้วแก้ไขไม่ได้ และรูปแบบกับวัตถุประสงค์ของฟิลด์หลักเปลี่ยนไม่ได้",
"SHIPPING_INVENTORY_FIELD_INVALID": "ข้อมูลฟิลด์สต็อกไม่ครบถ้วนหรือไม่ถูกต้อง",
"SHIPPING_INVENTORY_FIELD_NOT_FOUND": "ไม่พบฟิลด์สต็อก",
"SHIPPING_INVENTORY_FIELD_RETIRE_BLOCKED": "ฟิลด์สต็อกนี้ยังถูกอ้างอิงโดยการตั้งค่า จึงเลิกใช้ไม่ได้",
"SHIPPING_INVENTORY_RULE_CONDITION_INVALID": "เงื่อนไขกฎการกำหนดเส้นทางสินค้าคงคลังไม่ถูกต้อง",
"SHIPPING_INVENTORY_RULE_CONDITIONS_REQUIRED": "กฎการกำหนดเส้นทางสินค้าคงคลังต้องมีอย่างน้อยหนึ่งเงื่อนไข",
"SHIPPING_INVENTORY_RULE_CONFLICT": "ชื่อหรือลำดับความสำคัญของกฎการกำหนดเส้นทางสินค้าคงคลังขัดแย้งกัน",
"SHIPPING_INVENTORY_RULE_DELETE_BLOCKED": "ลบได้เฉพาะกฎการกำหนดเส้นทางสินค้าคงคลังฉบับร่างเท่านั้น",
"SHIPPING_INVENTORY_RULE_IMMUTABLE": "ไม่สามารถแก้ไขกฎการกำหนดเส้นทางสินค้าคงคลังที่เผยแพร่แล้ว",
"SHIPPING_INVENTORY_RULE_INVALID": "การตั้งค่ากฎการกำหนดเส้นทางสินค้าคงคลังไม่ถูกต้อง",
"SHIPPING_INVENTORY_RULE_NOT_FOUND": "ไม่พบกฎการกำหนดเส้นทางสินค้าคงคลัง",
"SHIPPING_INVENTORY_RULE_PUBLISH_INVALID": "ไม่สามารถเผยแพร่กฎการกำหนดเส้นทางสินค้าคงคลังนี้ได้",
"SHIPPING_INVENTORY_RULE_SOURCE_INVALID": "กฎการกำหนดเส้นทางสินค้าคงคลังอ้างอิงแหล่งสินค้าคงคลังที่ไม่มีอยู่หรือปิดใช้งานแล้ว",
"SHIPPING_INVENTORY_RULE_RETIRE_INVALID": "ไม่สามารถเลิกใช้งานกฎการกำหนดเส้นทางสินค้าคงคลังนี้ได้",
"SHIPPING_INVENTORY_SOURCE_DELETE_BLOCKED": "แหล่งสินค้าคงคลังยังถูกอ้างอิงโดยข้อมูลธุรกิจและไม่สามารถลบได้",
"SHIPPING_INVENTORY_SOURCE_NOT_FOUND": "ไม่พบแหล่งสินค้าคงคลัง",
"SHIPPING_INVENTORY_SOURCE_ACTIVATION_REQUIRED": "โปรดทำการส่งออกทดสอบและตรวจสอบก่อนเปิดใช้งานไซต์สต็อก",
"SHIPPING_INVENTORY_SOURCE_ACTIVATION_BLOCKED": "ไซต์สต็อกยังไม่ผ่านการตรวจสอบก่อนใช้งานจริง จึงไม่สามารถเปิดใช้งานได้",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_FILE_REQUIRED": "โปรดเลือกไฟล์ตัวอย่างสต็อก",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_FILE_TOO_LARGE": "ไฟล์ตัวอย่างสต็อกเกินขีดจำกัด 20 MB",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_INVALID": "ไม่สามารถระบุไฟล์ตัวอย่างสต็อกได้ โปรดตรวจสอบรูปแบบไฟล์และหัวตาราง",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_NOT_FOUND": "ไม่พบระเบียนการระบุโครงสร้างไฟล์สต็อก",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_SELECTION_INVALID": "ชีต หัวตาราง หรือคอลัมน์ต้นทางที่เลือกไม่อยู่ในผลการระบุไฟล์สต็อก",
"SHIPPING_TEMP_INVENTORY_CONTEXT_INVALID": "บริบทการสนทนาปัจจุบันไม่สามารถประมวลผลไฟล์สต็อกชั่วคราวได้",
"SHIPPING_TEMP_INVENTORY_ASSET_REQUIRED": "โปรดอัปโหลดไฟล์สต็อกก่อน",
"SHIPPING_TEMP_INVENTORY_ASSET_NOT_FOUND": "ไม่พบไฟล์สต็อกที่ใช้ได้ในการสนทนานี้",
"SHIPPING_TEMP_INVENTORY_ASSET_NOT_READY": "ไฟล์สต็อกยังอัปโหลดไม่เสร็จ โปรดลองอีกครั้งภายหลัง",
"SHIPPING_TEMP_INVENTORY_FILE_TYPE_INVALID": "ไฟล์สต็อกชั่วคราวต้องเป็น .xls, .xlsx หรือ .csv เท่านั้น",
"SHIPPING_TEMP_INVENTORY_FILE_TOO_LARGE": "ไฟล์สต็อกชั่วคราวเกินขีดจำกัด 20 MB",
"SHIPPING_TEMP_INVENTORY_ANALYSIS_INVALID": "ไม่สามารถระบุโครงสร้างไฟล์สต็อกได้ โปรดตรวจสอบรูปแบบและส่วนหัว",
"SHIPPING_TEMP_INVENTORY_SESSION_NOT_FOUND": "ไม่พบเซสชันสต็อกชั่วคราว เซสชันหมดอายุ หรือไม่มีสิทธิ์เข้าถึง",
"SHIPPING_TEMP_INVENTORY_MAPPING_STATE_INVALID": "เซสชันสต็อกชั่วคราวนี้ไม่สามารถส่งคำแนะนำการแมปเพิ่มเติมได้",
"SHIPPING_TEMP_INVENTORY_MAPPING_INVALID": "คำแนะนำการแมปฟิลด์สต็อกไม่ถูกต้อง ไม่ครบถ้วน หรือมีคอลัมน์ที่ไม่มีในไฟล์",
"SHIPPING_TEMP_INVENTORY_CONFIRMATION_INVALID": "เงื่อนไขการยืนยันสต็อกชั่วคราวไม่ครบ โปรดเลือกแผนหรือการแมปที่แนะนำอีกครั้ง",
"SHIPPING_TEMP_INVENTORY_QUALITY_INVALID": "ไฟล์สต็อกชั่วคราวไม่ผ่านการตรวจสอบเลขชิ้นส่วน รหัสการจอง หรือจำนวนคงเหลือ",
"SHIPPING_TEMP_INVENTORY_SESSION_EXPIRED": "เซสชันสต็อกชั่วคราวหมดอายุ โปรดอัปโหลดไฟล์อีกครั้ง",
"SHIPPING_TEMP_INVENTORY_TASK_NOT_FOUND": "ไม่พบงานจัดส่งในการสนทนานี้ที่ใช้สต็อกชั่วคราวได้",
"SHIPPING_INVENTORY_CONFIGURATION_TEST_INVALID": "โปรดส่งออกทดสอบขณะที่ไซต์สต็อกปิดใช้งาน", "SHIPPING_INVENTORY_CONFIGURATION_TEST_UNAVAILABLE": "RPA Worker ไม่พร้อมใช้งานและไม่สามารถเริ่มการส่งออกทดสอบได้", "SHIPPING_INVENTORY_CONFIGURATION_TEST_NOT_FOUND": "ไม่พบระเบียนการส่งออกทดสอบของไซต์สต็อก", "SHIPPING_INVENTORY_CONFIGURATION_TEST_NOT_READY": "การส่งออกทดสอบยังไม่เสร็จ จึงยังยืนยันแผนการอ่านไม่ได้", "SHIPPING_INVENTORY_CONFIGURATION_TEST_STALE": "การตั้งค่าไซต์สต็อกเปลี่ยนแล้ว โปรดส่งออกทดสอบอีกครั้ง",
"SHIPPING_RPA_PROFILE_CONFLICT": "ชื่อโปรไฟล์เข้าสู่ระบบขนส่งมีอยู่แล้ว",
"SHIPPING_RPA_PROFILE_DELETE_BLOCKED": "โปรไฟล์เข้าสู่ระบบขนส่งยังถูกอ้างอิงและไม่สามารถลบได้",
"SHIPPING_RPA_PROFILE_DISABLE_BLOCKED": "โปรไฟล์เข้าสู่ระบบขนส่งยังถูกอ้างอิงโดยแหล่งสินค้าคงคลังที่เปิดใช้และไม่สามารถปิดใช้งานได้",
"SHIPPING_RPA_PROFILE_DISABLED": "ต้องเปิดใช้โปรไฟล์เข้าสู่ระบบขนส่งก่อนเปิดใช้แหล่งสินค้าคงคลัง",
"SHIPPING_RPA_PROFILE_NOT_FOUND": "ไม่พบโปรไฟล์เข้าสู่ระบบขนส่ง",
"USER_USERNAME_REQUIRED": "กรุณากรอกชื่อผู้ใช้",
"USER_USERNAME_EXISTS": "ชื่อผู้ใช้นี้มีอยู่แล้ว",
"USER_EMAIL_INVALID": "รูปแบบอีเมลไม่ถูกต้อง",
@@ -84,7 +185,8 @@
"SHIPPING_CUSTOMER_SHADOW_LABEL_REQUIRED": "เลือกลูกค้ามาตรฐานเป็นป้ายกำกับจากผู้ดูแล",
"SHIPPING_CUSTOMER_CONFIRMATION_REQUIRED": "ยังไม่ยืนยันลูกค้ามาตรฐาน โปรดเลือกลูกค้าอย่างเป็นทางการก่อน",
"SHIPPING_CUSTOMER_CONFIRMATION_CUSTOMER_REQUIRED": "เลือกลูกค้ามาตรฐาน",
"SHIPPING_CUSTOMER_CONFIRMATION_LEGACY_UNSUPPORTED": "งานเดิมนี้ยังไม่รองรับการยืนยันลูกค้า",
"SHIPPING_CUSTOMER_CASE_REQUIRED": "งานจัดส่งไม่มีความเชื่อมโยงกับรายการธุรกิจ จึงไม่สามารถยืนยันลูกค้าได้",
"SHIPPING_NOTICE_REVISION_CASE_MISSING": "งานเป้าหมายสำหรับการแก้ไขไม่มีความเชื่อมโยงกับรายการธุรกิจ จึงไม่สามารถสร้างฉบับแก้ไขได้",
"SHIPPING_CUSTOMER_INACTIVE": "ลูกค้าที่เลือกถูกปิดใช้งาน",
"SHIPPING_CUSTOMER_NUMBERED_CASE_LOCKED": "รายการธุรกิจที่มีเลขแล้วไม่สามารถเปลี่ยนลูกค้าโดยเงียบได้",
"SHIPPING_FIELD_CONFLICT_NOT_FOUND": "ไม่พบความขัดแย้งของฟิลด์คำสั่งซื้อ",
@@ -97,8 +199,6 @@
"SHIPPING_BUSINESS_NUMBER_CUSTOMER_REQUIRED": "โปรดยืนยันลูกค้ามาตรฐานก่อนกำหนดหมายเลขธุรกิจ",
"SHIPPING_BUSINESS_NUMBER_CUSTOMER_INVALID": "ลูกค้าถูกปิดใช้งานหรือไม่มีอยู่ จึงไม่สามารถกำหนดหมายเลขธุรกิจได้",
"SHIPPING_BUSINESS_NUMBER_SHORT_CODE_INVALID": "รหัสย่อลูกค้าต้องเป็นตัวอักษรอังกฤษพิมพ์ใหญ่ 2-6 ตัว",
"SHIPPING_HISTORICAL_TASK_NOT_FOUND": "ไม่พบงานย้อนหลัง",
"SHIPPING_HISTORICAL_BACKFILL_INVALID": "งานนี้ไม่เข้าเงื่อนไขการเติมข้อมูลลูกค้าย้อนหลัง",
"SHIPPING_CUSTOMER_CORRECTION_TASK_REQUIRED": "ระบุหมายเลขทางเทคนิคหรือหมายเลขธุรกิจที่ต้องแก้ไข",
"SHIPPING_CUSTOMER_CORRECTION_REASON_REQUIRED": "ต้องระบุเหตุผลในการแก้ไขลูกค้า",
"SHIPPING_CUSTOMER_CORRECTION_NUMBER_REQUIRED": "แก้ไขลูกค้าได้เฉพาะรายการธุรกิจที่มีหมายเลขแล้ว",
@@ -106,6 +206,11 @@
"SHIPPING_CUSTOMER_CORRECTION_UNCHANGED": "ลูกค้าที่แก้ไขเหมือนกับลูกค้าปัจจุบัน",
"SHIPPING_CUSTOMER_CORRECTION_TASK_MISSING": "ไม่พบงานหรือรายการธุรกิจที่ต้องแก้ไข",
"SHIPPING_CUSTOMER_CORRECTION_UPLOADED_BLOCKED": "งานถูกอัปโหลดไปยังผู้รับจัดการขนส่งแล้ว โปรดยกเลิกในระบบภายนอกก่อน",
"SHIPPING_CUSTOMER_NOT_FOUND": "ไม่พบลูกค้า", "SHIPPING_CUSTOMER_NAME_REQUIRED": "ต้องระบุชื่อลูกค้ามาตรฐาน", "SHIPPING_CUSTOMER_SHORT_CODE_INVALID": "รหัสย่อลูกค้าต้องเป็นตัวอักษร 2-6 ตัว", "SHIPPING_CUSTOMER_SHORT_CODE_EXISTS": "รหัสย่อลูกค้ามีอยู่แล้ว", "SHIPPING_CUSTOMER_STATUS_INVALID": "สถานะลูกค้าไม่ถูกต้อง", "SHIPPING_CUSTOMER_CONFLICT": "ข้อมูลลูกค้าขัดแย้ง", "SHIPPING_CUSTOMER_IDENTIFIER_TYPE_INVALID": "ประเภทหลักฐานไม่ถูกต้อง", "SHIPPING_CUSTOMER_IDENTIFIER_VALUE_REQUIRED": "ต้องระบุค่าหลักฐาน", "SHIPPING_CUSTOMER_EMAIL_INVALID": "อีเมลลูกค้าไม่ถูกต้อง", "SHIPPING_CUSTOMER_DOMAIN_INVALID": "โดเมนลูกค้าไม่ถูกต้อง", "SHIPPING_CUSTOMER_IDENTIFIER_STATUS_INVALID": "สถานะหลักฐานไม่ถูกต้อง", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_FOUND": "ไม่พบหลักฐาน", "SHIPPING_CUSTOMER_IDENTIFIER_EXISTS": "หลักฐานนี้มีอยู่แล้ว", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_APPROVED": "เปิดจับคู่อัตโนมัติได้เฉพาะหลักฐานที่อนุมัติแล้ว", "SHIPPING_CUSTOMER_PUBLIC_DOMAIN_AUTO_MATCH_FORBIDDEN": "โดเมนอีเมลสาธารณะใช้จับคู่อัตโนมัติไม่ได้", "SHIPPING_CUSTOMER_EXTERNAL_REF_CONFLICT": "รหัสลูกค้าเดิมผูกกับลูกค้ารายอื่นแล้ว", "SHIPPING_CUSTOMER_IMPORT_FILE_REQUIRED": "เลือกไฟล์นำเข้า", "SHIPPING_CUSTOMER_IMPORT_FILE_TYPE_INVALID": "รองรับเฉพาะไฟล์ .xlsx", "SHIPPING_CUSTOMER_IMPORT_FILE_EMPTY": "ไฟล์นำเข้าว่าง", "SHIPPING_CUSTOMER_IMPORT_FILE_TOO_LARGE": "ไฟล์นำเข้าเกิน 5 MB", "SHIPPING_CUSTOMER_IMPORT_FILE_INVALID": "ไฟล์ Excel นำเข้าไม่ถูกต้อง", "SHIPPING_CUSTOMER_IMPORT_SHEET_MISSING": "ขาดชีตที่จำเป็น", "SHIPPING_CUSTOMER_IMPORT_COLUMNS_MISSING": "ขาดคอลัมน์ที่จำเป็น", "SHIPPING_CUSTOMER_IMPORT_KEY_REQUIRED": "ต้องระบุรหัสลูกค้าเดิม", "SHIPPING_CUSTOMER_IMPORT_DUPLICATE_KEY": "รหัสลูกค้าเดิมซ้ำในแหล่งเดียวกัน", "SHIPPING_CUSTOMER_IMPORT_SHORT_CODE_CONFLICT": "รหัสย่อขัดแย้งกับลูกค้าที่มีอยู่", "SHIPPING_CUSTOMER_IMPORT_NAME_MATCH": "ชื่อลูกค้าอาจซ้ำกับลูกค้าที่มีอยู่", "SHIPPING_CUSTOMER_IMPORT_IDENTIFIER_CUSTOMER_MISSING": "ไม่พบลูกค้าที่ตรงกับหลักฐาน", "SHIPPING_CUSTOMER_IMPORT_NOT_FOUND": "ไม่พบชุดนำเข้า", "SHIPPING_CUSTOMER_IMPORT_ROW_NOT_FOUND": "ไม่พบแถวนำเข้า", "SHIPPING_CUSTOMER_IMPORT_DECISION_INVALID": "การดำเนินการของแถวไม่ถูกต้อง", "SHIPPING_CUSTOMER_IMPORT_TARGET_REQUIRED": "ต้องเลือกลูกค้าเป้าหมายสำหรับอัปเดตหรือรวม", "SHIPPING_CUSTOMER_IMPORT_HAS_ERRORS": "ชุดนำเข้ามีข้อผิดพลาดที่บล็อก", "SHIPPING_CUSTOMER_IMPORT_DECISIONS_REQUIRED": "จัดการแถวคำเตือนทั้งหมดก่อน", "SHIPPING_CUSTOMER_IMPORT_ALREADY_PUBLISHED": "ชุดนำเข้าเผยแพร่แล้ว", "SHIPPING_CUSTOMER_IMPORT_UPLOAD_CONFLICT": "เกิดข้อขัดแย้งระหว่างอัปโหลด", "SHIPPING_CUSTOMER_IMPORT_PUBLISH_CONFLICT": "เกิดข้อขัดแย้งของข้อมูลระหว่างเผยแพร่"
"SHIPPING_ORDER_EXTRACTION_NOT_FOUND": "ไม่พบข้อมูลการแยกคำสั่งซื้อหรือไม่มีสิทธิ์เข้าถึง",
"SHIPPING_ORDER_CUSTOMER_REQUIRED": "โปรดเลือกลูกค้ามาตรฐาน",
"SHIPPING_ORDER_CUSTOMER_ROLE_INVALID": "บทบาทลูกค้าไม่ถูกต้อง",
"SHIPPING_ORDER_CUSTOMER_MATCH_NOT_FOUND": "ไม่พบข้อมูลการจับคู่ลูกค้าของคำสั่งซื้อ",
"SHIPPING_ORDER_CUSTOMER_SITE_INVALID": "โปรดเลือกสถานที่จัดส่งที่ใช้งานอยู่และเป็นของลูกค้ารายนี้",
"SHIPPING_CUSTOMER_NOT_FOUND": "ไม่พบลูกค้า", "SHIPPING_CUSTOMER_CHANGE_REASON_REQUIRED": "ต้องระบุเหตุผลเมื่อแก้ไขสถานะ รหัสย่อ หรือสิทธิ์การจับคู่อัตโนมัติของลูกค้า", "SHIPPING_CUSTOMER_NAME_REQUIRED": "ต้องระบุชื่อลูกค้ามาตรฐาน", "SHIPPING_CUSTOMER_SHORT_CODE_INVALID": "รหัสย่อลูกค้าต้องเป็นตัวอักษร 2-6 ตัว", "SHIPPING_CUSTOMER_SHORT_CODE_EXISTS": "รหัสย่อลูกค้ามีอยู่แล้ว", "SHIPPING_CUSTOMER_STATUS_INVALID": "สถานะลูกค้าไม่ถูกต้อง", "SHIPPING_CUSTOMER_CONFLICT": "ข้อมูลลูกค้าขัดแย้ง", "SHIPPING_CUSTOMER_IDENTIFIER_TYPE_INVALID": "ประเภทหลักฐานไม่ถูกต้อง", "SHIPPING_CUSTOMER_IDENTIFIER_VALUE_REQUIRED": "ต้องระบุค่าหลักฐาน", "SHIPPING_CUSTOMER_EMAIL_INVALID": "อีเมลลูกค้าไม่ถูกต้อง", "SHIPPING_CUSTOMER_DOMAIN_INVALID": "โดเมนลูกค้าไม่ถูกต้อง", "SHIPPING_CUSTOMER_IDENTIFIER_STATUS_INVALID": "สถานะหลักฐานไม่ถูกต้อง", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_FOUND": "ไม่พบหลักฐาน", "SHIPPING_CUSTOMER_IDENTIFIER_EXISTS": "หลักฐานนี้มีอยู่แล้ว", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_APPROVED": "เปิดจับคู่อัตโนมัติได้เฉพาะหลักฐานที่อนุมัติแล้ว", "SHIPPING_CUSTOMER_PUBLIC_DOMAIN_AUTO_MATCH_FORBIDDEN": "โดเมนอีเมลสาธารณะใช้จับคู่อัตโนมัติไม่ได้", "SHIPPING_CUSTOMER_EXTERNAL_REF_CONFLICT": "รหัสลูกค้าเดิมผูกกับลูกค้ารายอื่นแล้ว", "SHIPPING_CUSTOMER_IMPORT_FILE_REQUIRED": "เลือกไฟล์นำเข้า", "SHIPPING_CUSTOMER_IMPORT_FILE_TYPE_INVALID": "รองรับเฉพาะไฟล์ .xlsx", "SHIPPING_CUSTOMER_IMPORT_FILE_EMPTY": "ไฟล์นำเข้าว่าง", "SHIPPING_CUSTOMER_IMPORT_FILE_TOO_LARGE": "ไฟล์นำเข้าเกิน 5 MB", "SHIPPING_CUSTOMER_IMPORT_FILE_INVALID": "ไฟล์ Excel นำเข้าไม่ถูกต้อง", "SHIPPING_CUSTOMER_IMPORT_SHEET_MISSING": "ขาดชีตที่จำเป็น", "SHIPPING_CUSTOMER_IMPORT_COLUMNS_MISSING": "ขาดคอลัมน์ที่จำเป็น", "SHIPPING_CUSTOMER_IMPORT_KEY_REQUIRED": "ต้องระบุรหัสลูกค้าเดิม", "SHIPPING_CUSTOMER_IMPORT_DUPLICATE_KEY": "รหัสลูกค้าเดิมซ้ำในแหล่งเดียวกัน", "SHIPPING_CUSTOMER_IMPORT_SHORT_CODE_CONFLICT": "รหัสย่อขัดแย้งกับลูกค้าที่มีอยู่", "SHIPPING_CUSTOMER_IMPORT_NAME_MATCH": "ชื่อลูกค้าอาจซ้ำกับลูกค้าที่มีอยู่", "SHIPPING_CUSTOMER_IMPORT_IDENTIFIER_CUSTOMER_MISSING": "ไม่พบลูกค้าที่ตรงกับหลักฐาน", "SHIPPING_CUSTOMER_IMPORT_NOT_FOUND": "ไม่พบชุดนำเข้า", "SHIPPING_CUSTOMER_IMPORT_ROW_NOT_FOUND": "ไม่พบแถวนำเข้า", "SHIPPING_CUSTOMER_IMPORT_DECISION_INVALID": "การดำเนินการของแถวไม่ถูกต้อง", "SHIPPING_CUSTOMER_IMPORT_TARGET_REQUIRED": "ต้องเลือกลูกค้าเป้าหมายสำหรับอัปเดตหรือรวม", "SHIPPING_CUSTOMER_IMPORT_HAS_ERRORS": "ชุดนำเข้ามีข้อผิดพลาดที่บล็อก", "SHIPPING_CUSTOMER_IMPORT_DECISIONS_REQUIRED": "จัดการแถวคำเตือนทั้งหมดก่อน", "SHIPPING_CUSTOMER_IMPORT_ALREADY_PUBLISHED": "ชุดนำเข้าเผยแพร่แล้ว", "SHIPPING_CUSTOMER_IMPORT_UPLOAD_CONFLICT": "เกิดข้อขัดแย้งระหว่างอัปโหลด", "SHIPPING_CUSTOMER_IMPORT_PUBLISH_CONFLICT": "เกิดข้อขัดแย้งของข้อมูลระหว่างเผยแพร่"
}
}
+6 -1
View File
@@ -109,6 +109,12 @@
"loadFailed": "โหลดไม่สำเร็จ",
"openChat": "ดำเนินการต่อใน Chat",
"download": "ดาวน์โหลด Excel",
"downloadBatch": "ดาวน์โหลด ZIP ของชุดงาน",
"selectAllVisible": "เลือกผลลัพธ์ปัจจุบันทั้งหมด",
"selectedCount": "เลือกแล้ว {count} งาน",
"downloadSelected": "ดาวน์โหลด ZIP ที่เลือก",
"selectForDownload": "เลือกงาน {taskNo} สำหรับดาวน์โหลดแบบกลุ่ม",
"archiveDownloadFailed": "ดาวน์โหลดแบบกลุ่มไม่สำเร็จ โปรดรีเฟรชงานแล้วลองอีกครั้ง",
"lines": "รายการส่งสินค้า",
"qty": "จำนวน",
"columns": {
@@ -165,7 +171,6 @@
"created": "สร้างแล้ว",
"parsed": "แยกข้อมูลแล้ว",
"pendingReview": "รอตรวจสอบ",
"alignReview": "รอยืนยันฟิลด์",
"shortageReview": "สต็อกขาด",
"waitingInventory": "รอสต็อก",
"inventoryReady": "สต็อกพร้อม",
+446 -4
View File
@@ -28,7 +28,443 @@
"requests": "权限审批",
"reports": "数据报表",
"schedules": "排程管理",
"shippingCustomers": "货代客户"
"shippingCustomers": "货代客户",
"shippingInventory": "货代配置"
},
"shippingOrderSchema": {
"eyebrow": "订单字段模板",
"title": "订单模板配置",
"subtitle": "所有 EML、PDF 和 Word 订单共享同一份已发布字段契约;发布后版本不可原地修改。",
"schemaName": "模板名称",
"description": "说明",
"initialize": "初始化订单模板",
"initialized": "订单模板已初始化",
"fieldCatalog": "字段目录",
"fieldCatalogHint": "管理员维护字段系统标识、位置、格式和识别规则;系统标识可重命名,历史版本保留原名称。",
"fieldCode": "字段编码",
"ruleWorkspace": "字段识别规则",
"publishedVersion": "已发布版本 V{version}",
"historyOpen": "版本历史",
"historyEyebrow": "不可变快照",
"historyTitle": "版本历史",
"historyViewing": "正在查看历史版本",
"historySelectVersion": "从左侧选择一个版本查看完整快照",
"historyLoadMore": "加载更多版本",
"historyNoNote": "未填写变更说明",
"historyUnknownTime": "时间未记录",
"historyUnknownActor": "未知操作人",
"historyPublishedAt": "发布时间",
"historyPublisher": "发布人",
"historyChecksum": "契约校验和",
"historySnapshotFields": "快照字段",
"historyExcluded": "未纳入该版本",
"historyStatus": { "draft": "草稿", "published": "当前发布", "retired": "已退役" },
"diffWithCurrent": "与当前工作区 V{version} 比较",
"diffEyebrow": "服务端语义差异",
"diffTitle": "版本差异",
"diffComparedWith": "对比",
"diffEmpty": "未设置",
"diffNoChanges": "两个版本没有字段差异",
"diffAddedField": "该字段在比较版本中新增",
"diffRemovedField": "该字段在基线版本中存在,但比较版本已移除",
"diffOrderChanged": "仅顺序变化",
"diffStatus": { "added": "新增", "removed": "移除", "modified": "已修改", "unchanged": "未变化" },
"diffField": { "field_code": "字段名称(系统标识)", "scope": "字段位置", "value_type": "数据格式", "enabled": "纳入当前版本", "display_name": "当前版本显示名称", "description": "说明", "required": "业务必填", "aliases": "别名", "normalizer_key": "文本处理方式", "validator_keys": "内容校验", "enum_options": "枚举选项", "relation_role": "跨文档关联", "comparator_key": "核对方式", "extraction_instruction": "识别说明", "sequence": "字段顺序", "evidence_policy.required": "必须提供原文证据", "evidence_policy.source_precedence": "可识别的内容来源", "evidence_policy.conflict_policy": "内容不一致时", "evidence_policy.allow_single_source": "允许单一可信来源" },
"auditTitle": "配置审计时间线",
"auditEmpty": "暂无配置审计事件",
"auditLoadMore": "加载更多审计事件",
"auditFieldSummary": "新增 {added},移除 {removed},修改 {changed} 个字段",
"auditEvent": { "draft_created": "创建草稿", "draft_saved": "保存草稿", "published": "发布版本", "draft_deleted": "删除草稿", "cloned": "复制版本为草稿", "field_saved": "保存字段目录", "field_retired": "退役字段目录", "field_deleted": "删除或归档字段目录" },
"copyToDraft": "复制为新草稿",
"usageOpen": "查看使用记录",
"usageEyebrow": "运行追溯",
"usageTitle": "版本使用记录",
"usageTotal": "解析总数",
"usageFirst": "首次使用",
"usageLast": "最近使用",
"usageRecords": "解析记录",
"usageEmpty": "该版本尚未参与订单解析",
"usageLoadMore": "加载更多解析记录",
"extractionStatus": { "created": "已创建", "extracting": "解析中", "needs_review": "待人工复核", "accepted": "已接受", "failed": "解析失败", "superseded": "已替代" },
"runtimeAuditEyebrow": "冻结运行证据",
"runtimeAuditTitle": "订单解析审计详情",
"runtimeAuditEmpty": "未找到解析审计详情",
"runtimeAuditExtraction": "解析记录",
"runtimeAuditVersion": "订单模板版本",
"runtimeAuditStatus": "解析状态",
"runtimeAuditHash": "输入快照哈希",
"runtimeAuditInput": "冻结输入文档",
"runtimeAuditInputUnavailable": "此历史解析产生于输入快照上线前,仅保留输入快照哈希。",
"runtimeAuditLlm": "LLM 原始结果",
"runtimeAuditNormalized": "归一化结果",
"runtimeAuditValidation": "校验结果",
"runtimeAuditDecisions": "字段裁决",
"runtimeAuditEvidence": "字段证据",
"runtimeAuditValues": "已接受字段值",
"businessFields": "待解析字段",
"businessFieldsHint": "新增后选择字段,维护其识别规则。",
"searchFields": "搜索显示名称或字段编号",
"fieldCount": "{count} 个字段",
"selectedInGroup": "当前字段",
"noMatchingFields": "没有匹配的字段",
"cancelAddField": "收起新增",
"publishedRuleViewer": "已发布字段配置",
"publishedReadOnlyHint": "当前显示已发布版本的完整配置;创建草稿后可修改。",
"readOnly": "只读",
"businessFieldName": "字段名称",
"fieldName": "字段名称(系统标识)",
"businessFieldNamePlaceholder": "例如:part_number",
"businessFieldNameHint": "请填写英文小写下划线标识,如 part_number、reservation_id、request_qty。",
"fieldEditingHint": "显示名称和系统标识始终可编辑;是否纳入只影响当前版本发布。",
"businessFieldPlacement": "字段位置",
"businessFieldFormat": "数据格式",
"placementHeader": "订单信息",
"placementLine": "货品明细",
"placement": { "header": "订单信息", "line": "货品明细" },
"fieldType": { "string": "文本", "decimal": "小数", "integer": "整数", "date": "日期", "boolean": "是/否", "enum": "选项" },
"ruleEditor": "正在配置",
"unnamedField": "未命名字段",
"pendingNameField": "待命名字段 {number}",
"inDraft": "已纳入草稿",
"notInDraft": "未纳入草稿",
"inPublished": "已纳入已发布版本",
"notInPublished": "未纳入当前版本",
"fieldRemovedStatus": "已移除",
"selectField": "请从左侧选择要配置的字段。",
"addField": "新增字段",
"fieldCreated": "字段已创建",
"fieldUpdated": "字段已更新",
"saveField": "保存字段",
"retireField": "退役",
"fieldRetired": "字段已退役",
"confirmRetireField": "确定退役字段 {code} 吗?仍被订单模板草稿、路由、库存解析或发货模板引用时系统会阻止操作。",
"removeField": "删除",
"fieldRemoved": "字段已移除",
"fieldDeleted": "字段已删除",
"fieldArchived": "字段已归档,不再显示在当前配置中",
"confirmRemoveField": "确定删除“{name}”吗?未使用字段会彻底删除;已有历史记录的字段会归档且不再显示。仍被路由规则、库存解析或发货模板引用时,系统会阻止操作。",
"versionEditor": "版本规则",
"notPublished": "尚未发布",
"createDraft": "创建草稿",
"draftCreated": "草稿已创建",
"changeNote": "变更说明",
"displayName": "当前版本显示名称",
"includeField": "纳入当前版本",
"aliases": "别名(逗号分隔)",
"normalizer": "文本处理方式",
"comparator": "核对方式",
"relationRole": "跨文档关联",
"conflictPolicy": "内容不一致时",
"required": "业务必填",
"evidenceRequired": "必须提供原文证据",
"allowSingleSource": "允许单一可信来源",
"enumOptions": "枚举选项(逗号分隔)",
"validators": "内容校验",
"sourcePrecedence": "可识别的内容来源",
"extractionInstruction": "识别说明(可选)",
"extractionInstructionPlaceholder": "例如:优先识别订单明细表中的制造商料号",
"advancedRules": "高级识别规则",
"notSet": "不设置",
"changeNotePlaceholder": "说明本次字段规则调整(可选)",
"ruleLabel": { "trim": "去除前后空格", "uppercase_trim": "转为大写并去除空格", "lowercase_trim": "忽略大小写并去除空格", "decimal": "按小数处理", "integer": "按整数处理", "iso_date": "按日期处理", "boolean": "按是/否处理", "normalized_text": "按处理后的文本核对", "case_insensitive_text": "忽略大小写核对", "date": "按日期核对", "exact": "必须完全一致", "block": "阻止继续处理", "review": "进入人工复核", "prefer_attachment": "优先采用附件内容", "prefer_email": "优先采用邮件内容", "prefer_highest_confidence": "采用可信度更高的结果", "atomic_part_number": "料号格式", "non_empty": "不得为空", "positive_decimal": "必须为正数", "non_negative_decimal": "不得为负数", "positive_integer": "必须为正整数", "reservation_id": "预约号格式", "primary_link": "主要关联", "secondary_link": "次要关联", "line_match": "明细行关联", "order_reference": "订单关联" },
"sourceLabel": { "attachment_table": "附件表格", "attachment_text": "附件正文", "email_body_table": "邮件表格", "email_body_text": "邮件正文", "dify_llm": "智能识别结果", "backend_table": "系统表格识别" },
"saveDraft": "保存草稿",
"draftSaved": "草稿已保存",
"deleteDraft": "删除草稿",
"draftDeleted": "草稿已删除",
"publish": "发布版本",
"published": "订单字段版本已发布",
"noDraft": "当前没有草稿;创建草稿后可配置并发布字段规则。",
"setupKicker": "配置起点",
"setupTitle": "先定义订单模板需要识别和导出的字段",
"setupHint": "订单字段是库存匹配、路由判断和发货 Excel 的共同契约。完成发布后,再继续维护库存解析模板和库存源。",
"setupActionHint": "系统将以默认配置创建首个订单字段工作区,随后即可添加待解析字段。",
"setupStepCatalog": "建立稳定字段目录,例如料号、品名和数量",
"setupStepRules": "为字段配置别名、校验和 EML/PDF 证据规则",
"setupStepPublish": "发布字段版本,供后续配置安全引用",
"operationFailed": "订单模板操作失败"
},
"shippingInventory": {
"title": "货代配置",
"subtitle": "从订单字段、库存解析到发货 Excel 和库存路由,维护一条可追溯的发货配置链路。",
"eyebrow": "货代发货配置工作台",
"groupFoundation": "基础定义",
"groupInventory": "库存管理",
"groupAudit": "运行审计",
"orderFields": "订单解析",
"orderSchemaRequired": "请先在“订单解析”发布一个版本;库存解析、发货模板和路由规则才能引用订单字段。",
"connections": "系统连接",
"parsingProfiles": "库存解析",
"parsingProfilesHelp": "维护可由多个库存站点共享的库存文件结构、字段对应关系和订单字段匹配键。",
"inventoryMapping": "库存解析",
"inventoryMappingPlans": "解析规则",
"inventoryFields": "库存字段目录",
"inventoryFieldsHelp": "维护跨 DBS、Crane 等库存文件共用的业务字段;各库存解析负责把实际表头对应到这些字段。",
"inventoryFieldName": "字段名称",
"inventoryFieldDescription": "字段说明",
"inventoryFieldDescriptionHint": "说明这个字段的业务含义和使用场景",
"inventoryFieldFormat": "数据格式",
"inventoryFieldPurpose": "字段用途",
"inventoryFieldOrder": "显示顺序",
"inventoryFieldType": { "text": "文本", "integer": "整数", "decimal": "小数", "date": "日期" },
"inventoryFieldPurposeOption": { "match_identity": "库存匹配", "inventory_quantity": "库存数量", "warehouse_identity": "仓库识别", "general": "一般业务信息" },
"inventoryFieldPurposeHint": "库存匹配用于关联订单与库存;库存数量用于可发数量计算;仓库识别仅用于动态仓站点;其他字段用于展示或发货模板。",
"inventoryFieldUserDefinedHint": "字段名称完全由用户维护。发布库存映射时至少需要一个库存匹配字段、且只能有一个库存数量字段;动态仓站点还需一个仓库识别字段。",
"retireInventoryField": "停用字段",
"confirmRetireInventoryField": "确定停用这个库存字段吗?停用后不能再用于新的库存解析或发货模板。",
"parsingProfileCode": "库存解析编号",
"temporaryInventorySession": "已确认的对话库存文件",
"temporaryInventorySessionNone": "不使用对话库存文件",
"temporaryInventorySessionHint": "选择后将复用已通过质量校验的文件结构和字段映射;仍须填写方案编码、名称和订单匹配键,保存结果仅为草稿。",
"temporaryInventorySessionSelected": "已载入临时文件的已确认映射(来源:{mapping});不能在此更改文件结构。",
"fileFormat": "文件格式",
"inventorySampleFile": "库存样本文件",
"inventorySampleFileHint": "上传 .xls、.xlsx 或 .csv 后,系统会读取工作表、表头和少量样例,供确认库存解析。",
"inventorySampleAnalysing": "正在分析库存文件结构...",
"inventorySampleRequired": "请先上传库存样本文件并完成结构识别。",
"parsingProfileName": "库存解析名称",
"inventoryAnalysisFailed": "库存文件结构识别失败。",
"inventoryAnalysisPreview": "识别结果预览",
"inventoryAnalysisSummary": "识别到 {candidate_count} 个可选表头,当前样例行数 {sample_row_count};已建议 {valid_inventory_field_suggestions} 个库存字段。",
"csvFile": "CSV 文件",
"headerRowOption": "第 {row} 行",
"chooseSourceHeader": "请选择来源栏位",
"emptyHeader": "空白栏位",
"parsingPlanRecommendation": "可复用的库存解析",
"recommendationLevel": { "exact": "文件结构完全一致", "compatible": "核心栏位可兼容" },
"usedBySites": "已被 {count} 个库存站点使用",
"addedColumns": "新增非关键栏位:{columns}",
"columnOrderChanged": "栏位顺序变化,但核心栏位仍可识别。",
"adoptParsingPlan": "采用此库存解析",
"parsingPlanAdopted": "已确认采用库存解析;尚未绑定任何库存站点。",
"headerRowIndex": "表头行索引",
"sheetName": "工作表名称(可选)",
"fieldMappings": "库存标准字段映射",
"matchKeys": "订单字段与库存字段匹配键",
"matchKeysHint": "只维护用于定位同一库存记录的身份字段。可用库存数量在上方“库存标准字段映射”中维护,用于后续库存充足性判断,不作为匹配键。",
"matchKeysComplete": "当前所有已映射的库存身份字段都已维护为匹配键,无需再添加。",
"matchKeysAnalysisRequired": "请先上传库存样本文件,确认文件结构后再添加匹配键。",
"inventoryField": "库存字段",
"orderField": "订单字段",
"readonlyFieldMappingsHint": "以下内容为已发布版本锁定的 Excel 栏位对应关系。",
"readonlyMatchKeysHint": "订单明细会按以下字段组合与库存记录准确匹配。",
"publishedParsingImmutable": "已发布库存解析作为审计定义保留,不能直接修改。如需调整,请创建新的草稿版本后发布。",
"chooseInventoryField": "请选择库存标准字段",
"chooseOrderField": "请选择订单行字段",
"sourceHeader": "库存文件表头名称",
"addFieldMapping": "添加字段映射",
"addMatchKey": "添加匹配键",
"publishProfile": "发布",
"retireProfile": "退役",
"confirmRetireProfile": "仅无库存站点引用的解析方案可退役,是否继续?",
"excelTemplates": "发货模板",
"excelTemplateName": "模板名称",
"excelTemplatesHelp": "上传并发布可被多个库存源共享的版本化发货模板,配置导出文件名和字段映射。",
"templateCode": "模板编码",
"templateFile": "Excel 模板文件",
"templateCodeHint": "用于识别同一类发货模板,例如 DBS_SHIPMENT。",
"templateFileHint": "上传后系统会读取工作表和首行表头,供下方目标列选择。",
"filenamePattern": "导出文件名规则",
"filenamePatternHint": "可使用下方变量组合文件名;推荐直接使用正式业务单号。",
"filenamePatternExample": "推荐:{business_no}.xlsx → WYC26060201.xlsx",
"filenameVariablesTitle": "可直接使用的文件名变量",
"filenameVariablesHint": "变量使用大括号;业务单变量取任务已锁定的业务单快照,保证历史导出可追溯。",
"filenameVariableNoMatch": "没有匹配的变量",
"filenameVariableBusinessNo": "正式业务单号,例如 WYC26060201(推荐)",
"filenameVariableCustomer": "客户简称,例如 WYC",
"filenameVariableBusinessDate": "业务日期(六位),例如 260602",
"filenameVariableSequence": "客户当日流水(两位),例如 01",
"filenameVariableTaskNo": "系统任务号",
"filenameVariableSource": "库存源编码",
"filenameVariableDate": "导出日期(八位),例如 20260602",
"filenameVariableTimestamp": "导出时间戳(十四位)",
"templateMappings": "模板字段映射",
"templateMappingsHint": "每一条映射说明:把什么业务数据写入模板的哪个工作表、哪一列和哪一行开始的位置。",
"mappingItem": "映射 {number}",
"templateSheet": "目标工作表",
"chooseTemplateSheet": "请选择上传文件中的工作表",
"templateRowMode": "写入方式",
"rowMode": { "header": "订单信息(每个文件写一次)", "line": "货品明细(每条货品写一行)" },
"startRow": "起始行",
"targetColumn": "目标列",
"chooseTargetColumn": "请选择模板中的目标列",
"savedTargetColumn": "已保存列 {column}",
"sourceType": "数据来源类型",
"sourceField": "来源字段",
"sourceKind": { "order_field": "订单模板字段", "inventory_field": "库存模板字段", "system_fact": "系统信息", "constant": "固定内容" },
"sourceKindHint": { "order_field": "选择订单模板配置中已发布的字段。", "inventory_field": "选择库存模板配置解析出的标准字段。", "system_fact": "选择系统自动提供的任务信息。" },
"sourceGroupOrder": "订单模板字段",
"sourceGroupOrderRepeated": "订单信息字段(每条货品明细重复写入)",
"sourceGroupOrderLine": "货品明细字段",
"sourceGroupInventory": "库存模板字段",
"sourceGroupSystem": "系统信息",
"noSourceOptions": "暂无可选字段",
"systemFact": { "task_no": "系统任务号", "business_no": "正式业务单号", "warehouse_id": "货代仓库", "inventory_source_code": "库存源编码", "export_date": "导出日期" },
"orderFieldOptionsEmpty": "当前没有已发布的订单模板字段;请先完成订单模板配置并发布版本,随后此处会显示可选择的来源字段。",
"constantValue": "常量值",
"constantValueHint": "每次导出都写入相同内容,例如固定货代代码。",
"valueFormat": "写入格式",
"formatter": { "text": "按原样写入", "upper": "转为大写", "lower": "转为小写", "date_mmddyyyy": "日期:月/日/年", "integer": "整数", "decimal": "小数" },
"chooseSourceField": "请选择来源字段",
"addTemplateMapping": "添加模板映射",
"templateFileRequired": "创建模板草稿时必须选择 xlsx 文件",
"publishTemplate": "发布模板",
"retireTemplate": "退役",
"publishedTemplateImmutable": "已发布模板不可直接修改;可点击“创建新版本”复用已保存文件后继续调整。",
"createTemplateVersion": "创建新版本",
"confirmRetireTemplate": "确定退役这个模板吗?退役后不能再绑定新的库存站点。",
"templateLayoutReadFailed": "无法读取 Excel 模板的工作表和表头,请确认文件未损坏后重试。",
"connectionsHelp": "维护不同账号的登录地址和凭据;每个连接配置只负责登录,不维护页面点击路径。",
"credentialsHint": "用户名和密码仅可写入,页面和接口不会回显。",
"sources": "库存站点",
"sourcesHelp": "维护报表路径、查询条件和识别别名,并关联用于导出该库存源的连接配置。",
"rules": "路由规则",
"rulesHelp": "按业务字段、匹配符号和优先级将订单行路由到库存源;发布后不可修改。",
"snapshots": "库存快照",
"snapshotsHelp": "只读查看已导出并可用于发货匹配的库存文件。",
"exports": "导出记录",
"exportsHelp": "只读查看库存导出的执行结果;不在此处重试或触发导出。",
"externalMappings": "仓库映射",
"mappingsHelp": "将货代仓库或库存源默认仓库映射到外部系统仓库编码。",
"defaultMapping": "库存源默认映射",
"loadFailed": "加载货代库存配置失败",
"createNew": "新建",
"saving": "保存中...",
"publish": "发布规则",
"retire": "归档规则",
"flowOrder": "订单解析",
"flowInventory": "库存解析",
"flowTemplate": "发货模板",
"flowRoute": "路由规则",
"connectionCode": "连接编码",
"connectionName": "连接名称",
"inventorySiteName": "库存站点名称",
"connectorType": "货代类型",
"loginUrl": "登录地址",
"username": "用户名",
"password": "密码",
"writeOnlyHint": "留空则保持原值",
"enabled": "启用",
"enabledState": "已启用",
"disabledState": "已停用",
"notGenerated": "尚未生成",
"notConfigured": "尚未配置",
"parsingProfileGeneratedByTest": "保存站点后,通过测试导出识别或确认库存解析。",
"sourceSavedDisabledHint": "首次保存后站点保持停用;请完成测试导出、库存解析和发货模板配置后再启用。",
"activationStatus": "正式运行检查",
"activationReady": "库存站点已启用,可进入正式库存运行。",
"activationDraft": "库存站点当前停用;完成以下项目后才可启用。",
"activationRequirement": { "rpa_profile": "系统连接可用", "parsing_profile": "库存解析", "excel_template": "发货模板", "configuration_test": "测试导出与解析验证", "parsing_validation": "测试文件中的料号、预约号和库存数量解析有效", "warehouse_identification": "测试文件中可识别货代仓库", "warehouse_mapping": "已维护货代仓库到外部系统仓库的映射", "template_validation": "发货模板引用的库存字段可由库存解析提供" },
"activateSource": "启用库存站点",
"deactivateSource": "停用库存站点",
"activateSourceConfirm": "系统将复核正式运行前置条件;全部通过后才会启用库存站点。",
"deactivateSourceConfirm": "停用后不会再参与新的库存路由和导出任务,是否继续?",
"configurationTest": "测试导出",
"configurationTestHint": "测试文件只用于验证连接、文件结构和库存解析,不会进入正式库存匹配或发货导出。",
"startConfigurationTest": "测试导出",
"configurationTestRunning": "测试进行中...",
"configurationTestFailed": "库存站点测试导出失败。",
"configurationTestNoRecommendation": "未找到可直接采用的已发布库存解析;请根据测试结果创建或完善库存解析。",
"confirmTestProfile": "确认并绑定此库存解析",
"configurationTestProfileConfirmed": "已确认库存解析,库存站点仍保持停用。",
"configurationTestStage": { "waiting_worker": "等待 RPA Worker 接收测试任务", "analysing_structure": "正在识别库存文件结构", "ready_for_confirmation": "测试完成,等待确认库存解析", "failed": "测试失败" },
"connectionBoundary": "连接配置只填写登录所需信息;系统会按货代平台自动执行页面操作、下载和等待。",
"platform": { "dbs": "DBS 平台", "crane": "Crane 平台" },
"sourceCode": "库存源编号",
"connection": "连接配置",
"chooseConnection": "请选择连接配置",
"warehouseResolution": "仓库识别方式",
"fixedWarehouse": "指定仓库",
"inventoryMatch": "按库存行匹配",
"warehouse": "货代仓库",
"dynamicWarehouse": "由库存行识别",
"snapshotTtl": "快照有效期(秒)",
"reportPath": "DBS 报表路径",
"programGroup": "程序分组",
"programLabel": "程序名称",
"reportGroup": "报表分组",
"reportName": "报表名称",
"queryParameters": "查询条件",
"parameterName": "参数名",
"parameterValues": "参数值(逗号分隔)",
"single": "单值",
"multiText": "多值输入",
"multiSelect": "多选",
"required": "必填",
"selectAll": "全选",
"addParameter": "添加查询条件",
"matchAliases": "识别别名",
"aliasHint": "多个别名以逗号分隔",
"ruleCode": "规则编码",
"ruleName": "规则名称",
"ruleConditions": "匹配条件",
"addCondition": "添加条件",
"noExpectedValue": "此匹配符号无需匹配值",
"scope": "作用范围",
"priority": "优先级",
"factPath": "业务字段",
"operator": "匹配符号",
"operatorEquals": "= 等于",
"operatorNotEquals": "≠ 不等于",
"operatorIn": "属于列表",
"operatorNotIn": "不属于列表",
"operatorPrefix": "以...开头",
"operatorSuffix": "以...结尾",
"operatorContains": "包含",
"operatorNumericLength": "数字长度等于",
"operatorStringLength": "文本长度等于",
"operatorIsEmpty": "为空",
"operatorIsNotEmpty": "不为空",
"expectedValue": "匹配值",
"routeScope": { "task": "整张订单", "line": "每条货品明细" },
"routeConditionSource": { "order_field": "订单中的字段", "system_fact": "系统自动信息" },
"sourceCandidates": "候选库存源",
"sourceCandidatesHint": "可选择一个或多个库存源;系统会按规则优先级依次判断。",
"publishedImmutable": "已发布规则作为审计定义保留,不能修改。请新建规则后重新发布。",
"source": "库存源",
"chooseSource": "请选择库存源",
"freightWarehouse": "货代仓库(可选)",
"externalSystem": "目标系统",
"externalOrganization": "目标组织(可选)",
"externalSite": "目标地点(可选)",
"externalWarehouseCode": "目标仓库编码",
"externalWarehouseName": "目标仓库名称",
"snapshotStatus": "快照状态",
"snapshotFile": "快照文件",
"expiresAt": "有效至",
"lineCount": "库存行数",
"lineCountValue": "{count} 行",
"sourceRun": "来源运行",
"runNo": "运行号",
"triggerMode": "触发方式",
"startedAt": "开始时间",
"duration": "耗时",
"durationValue": "{seconds} 秒",
"status": "状态",
"actions": "操作",
"viewDetail": "查看详情",
"view": "查看",
"download": "下载",
"detail": "详情",
"resizeColumn": "拖拽调整“{label}”列宽",
"downloadFailed": "下载库存快照失败",
"snapshotDetail": "快照详情",
"exportDetail": "导出详情",
"historyNotCaptured": "历史记录未采集",
"exportResultReady": "已生成库存文件",
"auditStatus": { "ready": "可用", "success": "成功", "failed": "失败", "partial_failed": "部分失败", "skipped": "已跳过", "awaiting_rpa": "执行中", "unknown": "历史记录" },
"trigger": { "scheduled": "定时执行", "manual": "手动执行" },
"exportResult": "导出结果",
"exportedAt": "导出时间",
"emptySnapshots": "暂无可查看的库存快照。",
"emptyExports": "暂无导出记录。",
"emptyConfig": "暂无配置,请新建第一条记录。",
"saveFailed": "保存货代库存配置失败",
"confirmRetire": "归档后该规则不再参与新路由,是否继续?",
"confirmRetireTitle": "确认归档",
"confirmDeleteTitle": "确认删除",
"confirmDelete": "仅无引用的错误配置可删除,是否继续?",
"deleteFailed": "删除货代库存配置失败"
},
"platformApps": {
"guideUsage": "资料用途",
@@ -1251,14 +1687,20 @@
},
"shippingCustomers": {
"title": "货代客户主数据", "subtitle": "维护稳定客户身份、客户简码、识别证据与期初导入", "add": "新增客户", "edit": "编辑客户", "saving": "保存中...", "importButton": "期初导入", "search": "查询", "searchPlaceholder": "搜索客户名称或简码", "empty": "暂无客户", "deactivate": "停用", "confirmDeactivate": "确认停用客户“{name}”吗?历史业务引用会保留。", "yes": "是", "no": "否",
"fields": { "standardName": "标准客户名称", "shortCode": "客户简码", "shortCodeHint": "2-6 位英文字母,保存后统一转为大写", "status": "状态", "remark": "备注" },
"externalRefs": { "title": "外部系统客户编码", "hint": "用于账款客户精确匹配;客户简称仍从标准客户读取。", "empty": "尚未维护外部系统客户编码", "sourceSystem": "来源系统,例如 ERP", "customerCode": "外部客户编码" },
"sites": { "title": "送货站点", "hint": "用于送货客户和 Ship-to Code 匹配,不创建新的账款客户。", "empty": "尚未维护送货站点", "siteName": "站点名称", "siteCode": "Ship-to Code", "address": "送货地址", "city": "城市", "country": "国家/地区" },
"deleteDialog": { "open": "永久删除", "title": "永久删除客户", "subtitle": "仅未进入业务或审计链的误建客户可删除。", "loading": "正在检查删除资格...", "identifiers": "将级联删除 {count} 条识别证据。", "blocked": "该客户不能永久删除", "blockedHint": "请改用停用或后续客户合并流程。", "warning": "此操作不可恢复,请输入客户简码和删除原因确认。", "confirmationShortCode": "输入客户简码 {shortCode} 确认", "reason": "删除原因", "confirm": "确认永久删除", "deleted": "客户已永久删除", "failed": "永久删除客户失败", "blockers": { "business_cases": "业务单", "business_sequences": "业务编号流水", "external_references": "外部来源键", "import_target_rows": "导入目标行", "import_result_rows": "导入结果行", "shadow_top_candidates": "影子最高候选", "shadow_manual_labels": "影子人工真值", "shadow_candidate_matches": "影子候选匹配", "merged_source_customers": "已合并源客户", "merged_into_customer": "目标客户归并关系" } },
"mergeDialog": { "open": "合并客户", "title": "合并重复客户", "subtitle": "历史业务与审计保持不变;仅将未来识别配置归并到目标客户。", "source": "源客户", "target": "目标客户", "chooseTarget": "请选择启用的目标客户", "historyTitle": "历史引用保留", "historyHint": "已有业务号、业务单、导入和影子审计仍指向源客户,不会被改写。", "historyCount": "共 {count} 条历史或审计引用保持原状", "migrateTitle": "未来配置归并", "identifiers": "迁移证据", "duplicates": "重复证据", "references": "来源键", "warning": "源客户将标记为“已合并”,不能再用于新任务或再次编辑。", "confirmationShortCode": "输入源客户简码 {shortCode} 确认", "reason": "合并原因", "confirm": "确认合并", "merged": "客户已合并", "failed": "合并客户失败", "previewFailed": "读取合并预检失败" },
"fields": { "standardName": "标准客户名称", "shortCode": "客户简码", "shortCodeHint": "2-6 位英文字母,保存后统一转为大写", "status": "状态", "remark": "备注", "changeReason": "变更原因", "changeReasonHint": "修改简码或状态时必须填写" },
"headers": { "name": "客户名称", "shortCode": "简码", "status": "状态", "identifiers": "识别证据", "cases": "业务单", "actions": "操作" },
"status": { "all": "全部状态", "active": "启用", "inactive": "停用" },
"status": { "all": "全部状态", "active": "启用", "inactive": "停用", "merged": "已合并" },
"identifierStatus": { "pending": "待审核", "approved": "已审核", "disabled": "已停用" },
"identifierTypes": { "name_alias": "名称别名", "email": "邮箱", "domain": "域名", "template_fingerprint": "模板指纹", "address": "地址", "contact": "联系人" },
"identifiers": { "title": "客户识别证据", "type": "类型", "value": "原始值 / 标准值", "status": "审核状态", "autoMatch": "允许自动匹配", "empty": "暂无识别证据", "approve": "审核通过", "enableAuto": "启用自动匹配", "disable": "停用", "add": "新增识别证据", "valuePlaceholder": "输入别名、邮箱、域名等", "allowAuto": "允许自动匹配" },
"import": { "title": "期初客户导入", "subtitle": "上传暂存、预检冲突、人工决策后整批发布", "file": "Excel 文件", "sourceSystem": "来源系统", "downloadTemplate": "下载模板", "upload": "上传预检", "uploaded": "文件已完成预检", "uploadFailed": "上传预检失败", "row": "位置", "type": "行类型", "key": "历史客户键", "preview": "预览", "validation": "校验结果", "decision": "发布动作", "choose": "请选择", "target": "选择目标客户", "publish": "整批发布", "published": "客户导入发布成功", "publishFailed": "发布失败", "alreadyPublished": "已发布", "downloadReconciliation": "下载对账 CSV", "downloadFailed": "文件下载失败", "decisionFailed": "保存行决定失败", "stats": { "total": "总行数", "valid": "有效", "warning": "警告", "error": "错误", "published": "已发布" }, "rowTypes": { "customer": "客户", "identifier": "识别证据" }, "validationStatus": { "valid": "通过", "warning": "需决策", "error": "阻断" }, "actions": { "create": "新增", "update": "更新", "merge": "合并", "skip": "跳过" } },
"shadow": { "title": "客户影子识别质量", "subtitle": "影子样本不产生副作用;面板同时展示受控自动确认与管理员纠错指标", "refresh": "刷新报告", "loadFailed": "加载影子识别报告失败", "labelFailed": "保存人工真值失败", "labeled": "人工真值已保存", "sample": "候选 / 接入记录", "status": "影子结论", "topCandidate": "最高候选", "manualLabel": "人工真值", "chooseCustomer": "选择标准客户", "empty": "暂无影子识别样本", "auditTitle": "客户识别与纠错审计", "auditTask": "任务号", "auditEvent": "事件", "auditBusinessNo": "业务号", "auditTime": "时间", "auditEmpty": "暂无客户审计事件", "cards": { "total": "总样本", "unique": "唯一候选", "ambiguous": "歧义", "unmatched": "未匹配", "accuracy": "已标注准确率", "autoBound": "自动绑定", "autoRate": "自动确认率", "corrected": "已纠错任务" }, "statuses": { "unique_candidate": "唯一候选", "ambiguous": "多候选歧义", "unmatched": "未匹配", "failed": "影子计算失败" }, "events": { "customer_auto_resolution_evaluated": "自动裁决已评估", "customer_auto_confirmed": "客户已自动确认", "customer_correction_applied": "客户纠错已应用", "customer_historical_backfilled": "历史客户已回填" } },
"lifecycle": { "open": "治理时间线", "title": "客户治理时间线", "loading": "正在加载时间线...", "empty": "暂无治理事件", "time": "时间", "event": "事件", "reason": "原因", "change": "变更", "events": { "created": "创建客户", "updated": "更新客户", "identifier_created": "新增识别证据", "identifier_updated": "更新识别证据", "merged_source": "作为源客户合并", "merged_target": "作为目标客户合并", "deleted": "永久删除" } },
"prompts": { "deactivateReason": "请输入停用原因", "identifierChangeReason": "请输入审核、停用或自动匹配授权的变更原因" },
"shadow": { "title": "客户影子识别质量", "subtitle": "影子样本不产生副作用;面板同时展示受控自动确认与管理员纠错指标", "refresh": "刷新报告", "loadFailed": "加载影子识别报告失败", "labelFailed": "保存人工真值失败", "labeled": "人工真值已保存", "sample": "候选 / 接入记录", "status": "影子结论", "topCandidate": "最高候选", "manualLabel": "人工真值", "chooseCustomer": "选择标准客户", "empty": "暂无影子识别样本", "auditTitle": "客户识别与纠错审计", "auditTask": "任务号", "auditEvent": "事件", "auditBusinessNo": "业务号", "auditTime": "时间", "auditEmpty": "暂无客户审计事件", "cards": { "total": "总样本", "unique": "唯一候选", "ambiguous": "歧义", "unmatched": "未匹配", "accuracy": "已标注准确率", "autoBound": "自动绑定", "autoRate": "自动确认率", "corrected": "已纠错任务" }, "statuses": { "unique_candidate": "唯一候选", "ambiguous": "多候选歧义", "unmatched": "未匹配", "failed": "影子计算失败" }, "events": { "customer_auto_resolution_evaluated": "自动裁决已评估", "customer_auto_confirmed": "客户已自动确认", "customer_correction_applied": "客户纠错已应用" }, "gate": { "title": "自动确认质量门禁", "metrics": "有效人工标注样本 {samples}/{minSamples};准确率 {accuracy}(要求 {minAccuracy})", "statuses": { "eligible": "门禁已通过,可执行唯一强证据自动确认", "insufficient_labeled_samples": "门禁降级:有效人工标注样本不足", "insufficient_accuracy": "门禁降级:人工标注准确率未达到阈值" } } },
"msg": { "loadFailed": "加载客户失败", "nameRequired": "请输入标准客户名称", "shortCodeInvalid": "客户简码必须为 2-6 位英文字母", "saved": "客户已保存", "saveFailed": "保存失败", "identifierRequired": "请输入识别证据值", "identifierSaved": "识别证据已保存" }
},
"role": {
+18 -34
View File
@@ -15,6 +15,8 @@
"uploading": "上传中",
"processing": "处理中",
"ready": "处理完成",
"parsing": "解析中",
"parseSucceeded": "解析成功",
"uploadFailed": "上传失败",
"parseFailed": "解析失败",
"retry": "重试上传",
@@ -92,6 +94,17 @@
"shippingNoticeDuplicateResolved": "重复处理方式已保存。",
"shippingNoticeDuplicateResolveFailed": "保存重复处理方式失败。",
"shippingCandidateTitle": "订单候选审核",
"shippingCustomerMatch": {
"title": "客户匹配",
"role": "客户角色",
"rawName": "订单原文",
"standardName": "标准客户",
"shortCode": "客户简称",
"site": "送货站点",
"statusLabel": "匹配状态",
"roles": { "bill_to": "账款客户", "ship_to": "送货客户" },
"status": { "unmatched": "未匹配", "unique_candidate": "唯一候选", "ambiguous": "多个候选", "confirmed": "已确认" }
},
"shippingCandidateCount": "共 {count} 个订单",
"shippingCandidateReady": "可建单",
"shippingCandidateNeedsReview": "需要审核",
@@ -126,23 +139,14 @@
"shippingCandidateUpdateDone": "订单候选修订已保存。",
"shippingCandidateUpdateFailed": "保存订单候选失败。",
"shippingInventoryUploadFailed": "库存文件上传失败。",
"shippingInventorySiteRequired": "正式库存文件请由已启用库存站点导入;如需分析对话中的表格,请明确说明它是库存文件。",
"shippingNoticeSpreadsheetIntentRequired": "已收到表格附件。请明确说明它是库存文件(例如:\"这是库存文件,请分析\")后再继续;系统不会仅根据文件后缀猜测用途。",
"shippingNoticeRefreshDone": "已刷新当前任务状态。",
"shippingNoticeRetryUploadAction": "重试上传货代",
"shippingNoticeRetryUploadQueued": "已重新触发上传,请稍后刷新查看结果。",
"shippingNoticeRetryUploadFailed": "重试上传失败。",
"shippingNoticePasteHint": "请在输入框粘贴库存小表内容后发送。",
"shippingNoticeDecisionDone": "操作已完成。",
"shippingNoticePrompt": {
"inventory": {
"prefix": "我已上传库存文件",
"prefixWithFile": "我已上传库存文件《{fileName}》",
"prefixBatch": "我已为批次 {batchNo} 上传本批库存快照",
"prefixBatchWithFile": "我已为批次 {batchNo} 上传本批库存快照《{fileName}》",
"mapInferSuggested": "{prefix}。请继续处理库存列映射;如果系统已识别出完整映射,请直接应用映射,并只用一句话说明已进入库存字段确认。禁止在正文列出操作菜单、编号选项、按钮清单或“请选择以下方式”;可点击动作由系统按钮展示。",
"mapInferPending": "{prefix}。请继续解析库存列映射,并在拿到可用映射后只用一句话说明已进入库存字段确认。禁止在正文列出操作菜单、编号选项、按钮清单或“请选择以下方式”;可点击动作由系统按钮展示。",
"alignReview": "{prefix}。请只用一句话说明已进入库存字段确认,并提示我检查列名后继续。禁止在正文列出操作菜单、编号选项、按钮清单或“请选择以下方式”;可点击动作由系统按钮展示。",
"default": "{prefix}。请继续处理库存导入,并只说明当前状态。禁止在正文列出操作菜单、编号选项、按钮清单或“请选择以下方式”;可点击动作由系统按钮展示。"
},
"notice": {
"fileLabelSingleFile": "《{fileName}》",
"fileLabelMulti": "{fileCount} 份发货通知",
@@ -151,29 +155,12 @@
"batchLabel": "批次 {batchNo}",
"taskLabel": "当前任务 {taskId}",
"taskList": "任务列表:{taskIds}。",
"autoInventoryAction": "上传库存并进入字段对齐",
"autoNoticeAction": "创建任务并解析发货通知",
"autoSpreadsheetAction": "请说明这是订单文件还是库存文件",
"multiTask": "{summary}。{taskListText}请只处理当前焦点任务。先读取当前任务状态;如果仍待解析,请解析发货通知并保存结果;如果已进入后续步骤,请直接说明当前进度和下一步。不要再次询问我是否开始解析,也不要整批循环处理其他任务。",
"singleTask": "{summary}。请先读取当前任务状态;如果仍待解析,请解析发货通知并保存结果;如果已进入后续步骤,请直接说明当前进度和下一步。不要再次询问我是否开始解析。"
}
},
"shippingNoticeMapping": {
"inventoryHeaders": "库存表头",
"headerRow": "表头行:{row}",
"sample": "样例",
"orderDetails": "订单明细",
"orderRowCount": "订单行数:{count}",
"orderPartNumberPreview": "内部料号(前{count}):{partNumbers}",
"partNumberColumnRequired": "内部料号列(必填)",
"availableQtyColumnRequired": "可用数量列(必填)",
"reservationIdColumnRequired": "Reservation ID 列(必填)",
"selectHeader": "请选择表头列名",
"reupload": "重新上传",
"applying": "应用中...",
"applyAndParse": "应用映射并解析",
"empty": "(空)",
"unrecognized": "(未识别)"
},
"shippingParsedResult": {
"title": "订单解析结果",
"statusBlocked": "流转阻断",
@@ -299,8 +286,6 @@
"shortageNoDetails": "任务 {taskId} 当前未发现库存缺口。",
"diagnosisInventoryRpaTitle": "库存 RPA 未返回可用库存快照。",
"diagnosisInventoryRpaAdvice": "建议先重新获取库存;若外部系统不可用,可人工上传库存文件。",
"diagnosisAlignReviewTitle": "库存字段映射需要人工确认。",
"diagnosisAlignReviewAdvice": "建议确认 SKU、Reservation ID、可用数量等列映射,避免匹配错料。",
"diagnosisParseReviewTitle": "通知单解析置信度不足,需要复核单头或明细。",
"diagnosisParseReviewAdvice": "建议核对客户、PO、需求日期和订单行后再继续。",
"diagnosisReservationRequiredTitle": "缺少 Reservation ID,无法按预订单锁定库存。",
@@ -362,7 +347,6 @@
"blockedUploadRetryable": "上传失败可重试",
"suggestedAction": "建议动作:",
"suggestShortageActions": "查看缺口 / 返回修订 / 重新匹配",
"suggestConfirmMapping": "确认字段对齐后继续匹配",
"suggestReviewParse": "核对解析结果并确认或修订",
"suggestRetryStep": "查看卡点后重试当前步骤",
"suggestViewOnly": "查看导出文件或回执",
@@ -423,7 +407,7 @@
"noticeParse": "通知解析",
"parseConfirm": "确认解析",
"inventoryPrepare": "库存准备",
"alignConfirm": "确认字段对齐",
"alignConfirm": "校验库存",
"inventoryMatch": "库存匹配",
"shortageHandle": "缺口处理",
"generateExcel": "生成 Excel",
@@ -449,7 +433,7 @@
"noticeSubmit": "提交通知",
"parseConfirm": "确认解析",
"inventoryPrepare": "获取库存",
"alignConfirm": "确认字段对齐",
"alignConfirm": "校验库存",
"matchInventory": "匹配库存",
"generateFile": "生成发货文件",
"uploadFreight": "上传货代"
+113 -4
View File
@@ -1,7 +1,34 @@
{
"generic": "请求失败。",
"codes": {
"SHIPPING_ORDER_SCHEMA_NOT_FOUND": "尚未初始化订单模板。",
"SHIPPING_ORDER_SCHEMA_EXISTS": "订单模板已存在。",
"SHIPPING_ORDER_SCHEMA_DRAFT_EXISTS": "已有订单模板草稿,请先完成或发布当前草稿。",
"SHIPPING_ORDER_SCHEMA_VERSION_INVALID": "订单字段版本配置无效。",
"SHIPPING_ORDER_SCHEMA_LOCK_VERSION_REQUIRED": "订单字段草稿缺少版本锁,请刷新页面后重试。",
"SHIPPING_ORDER_SCHEMA_VERSION_CONFLICT": "订单字段草稿已被其他管理员修改,页面将刷新为最新版本。",
"SHIPPING_ORDER_SCHEMA_VERSION_IMMUTABLE": "已发布的订单字段版本不可修改。",
"SHIPPING_ORDER_SCHEMA_VERSION_NOT_FOUND": "未找到订单字段版本。",
"SHIPPING_ORDER_SCHEMA_VERSION_DELETE_BLOCKED": "只有草稿版本可以删除。",
"SHIPPING_ORDER_SCHEMA_PUBLISH_INVALID": "当前订单字段版本不能发布。",
"SHIPPING_ORDER_SCHEMA_PUBLISH_DEPENDENCY_BLOCKED": "当前版本移除了仍被库存路由、解析配置或 Excel 模板引用的订单字段,请先迁移下游配置。",
"SHIPPING_ORDER_SCHEMA_NOT_PUBLISHED": "尚未发布可用的订单字段版本。",
"SHIPPING_ORDER_FIELD_INVALID": "订单字段编码、作用域或类型无效。",
"SHIPPING_ORDER_FIELD_NOT_FOUND": "未找到订单字段。",
"SHIPPING_ORDER_FIELD_IMMUTABLE": "订单字段发布后,编码、作用域和类型不可修改。",
"SHIPPING_ORDER_FIELD_CONFLICT": "订单字段编码已存在。",
"SHIPPING_ORDER_FIELD_RETIRE_BLOCKED": "该订单字段仍被草稿版本引用,不能退役。",
"AUTH_UNAUTHORIZED": "请先登录。",
"SHIPPING_CUSTOMER_DELETE_REASON_REQUIRED": "永久删除客户必须填写原因。",
"SHIPPING_CUSTOMER_DELETE_CONFIRMATION_INVALID": "删除确认的客户简码不正确。",
"SHIPPING_CUSTOMER_DELETE_BLOCKED": "客户存在业务或审计引用,不能永久删除。",
"SHIPPING_CUSTOMER_MERGED_LOCKED": "客户已合并,不能再用于新业务或编辑。",
"SHIPPING_CUSTOMER_MERGE_TARGET_REQUIRED": "请选择合并目标客户。",
"SHIPPING_CUSTOMER_MERGE_TARGET_INVALID": "合并目标客户必须处于启用状态。",
"SHIPPING_CUSTOMER_MERGE_SAME_CUSTOMER": "源客户和目标客户不能相同。",
"SHIPPING_CUSTOMER_MERGE_SOURCE_ALREADY_MERGED": "源客户已完成合并。",
"SHIPPING_CUSTOMER_MERGE_REASON_REQUIRED": "合并客户必须填写原因。",
"SHIPPING_CUSTOMER_MERGE_CONFIRMATION_INVALID": "合并确认的源客户简码不正确。",
"AUTH_INCORRECT_PASSWORD": "密码错误",
"AUTH_INCORRECT_CURRENT_PASSWORD": "当前密码不正确",
"AUTH_USER_NOT_FOUND": "用户不存在",
@@ -10,6 +37,84 @@
"RESOURCE_NOT_FOUND": "请求的资源不存在。",
"RESOURCE_CONFLICT": "请求冲突,请刷新后重试。",
"VALIDATION_INVALID_PARAM": "请求参数不合法。",
"SHIPPING_INVENTORY_EXTERNAL_MAPPING_NOT_FOUND": "外部系统仓库映射不存在。",
"SHIPPING_INVENTORY_EXTERNAL_MAPPING_CONFLICT": "该库存源和货代仓库已存在启用的外部系统仓库映射。",
"SHIPPING_INVENTORY_SOURCE_CONFIG_INVALID": "库存源的报表路径、查询参数或别名配置不合法。",
"SHIPPING_RPA_PROFILE_CONFIG_INVALID": "货代登录连接配置不合法,当前仅支持账号密码登录。",
"SHIPPING_EXCEL_TEMPLATE_ASSET_INVALID": "Excel 模板文件无效或无法读取。",
"SHIPPING_EXCEL_TEMPLATE_DEFINITION_INVALID": "Excel 模板映射定义无效。",
"SHIPPING_EXCEL_TEMPLATE_DELETE_BLOCKED": "只有草稿 Excel 模板可以删除。",
"SHIPPING_EXCEL_TEMPLATE_DRAFT_EXISTS": "该模板已有草稿版本,请先处理当前草稿。",
"SHIPPING_EXCEL_TEMPLATE_FIELD_INVALID": "Excel 模板字段映射无效。",
"SHIPPING_EXCEL_TEMPLATE_IMMUTABLE": "已发布或已退役的 Excel 模板不可修改。",
"SHIPPING_EXCEL_TEMPLATE_INVALID": "Excel 模板配置无效。",
"SHIPPING_EXCEL_TEMPLATE_NOT_FOUND": "未找到 Excel 模板。",
"SHIPPING_EXCEL_TEMPLATE_PUBLISH_INVALID": "当前 Excel 模板不能发布。",
"SHIPPING_EXCEL_TEMPLATE_REQUIRED": "启用库存源前必须绑定已发布的 Excel 模板。",
"SHIPPING_EXCEL_TEMPLATE_RETIRE_BLOCKED": "Excel 模板仍被库存源引用,不能退役。",
"SHIPPING_EXCEL_TEMPLATE_RETIRE_INVALID": "当前 Excel 模板不能退役。",
"SHIPPING_EXCEL_TEMPLATE_TARGET_DUPLICATE": "Excel 模板存在重复的目标单元格映射。",
"SHIPPING_EXPORT_ARCHIVE_EMPTY": "所选任务没有可下载的导出文件。",
"SHIPPING_EXPORT_ARCHIVE_NOT_FOUND": "未找到可下载的导出文件。",
"SHIPPING_EXPORT_ARCHIVE_SELECTION_INVALID": "批量下载的任务选择无效。",
"SHIPPING_EXPORT_ARCHIVE_TOO_LARGE": "单次批量下载最多支持 100 个任务。",
"SHIPPING_INVENTORY_PARSING_PROFILE_DELETE_BLOCKED": "只有草稿库存解析配置可以删除。",
"SHIPPING_INVENTORY_PARSING_PROFILE_IMMUTABLE": "已发布或已退役的库存解析配置不可修改。",
"SHIPPING_INVENTORY_PARSING_PROFILE_INVALID": "库存解析配置无效。",
"SHIPPING_INVENTORY_PARSING_PROFILE_NOT_FOUND": "未找到库存解析配置。",
"SHIPPING_INVENTORY_PARSING_PROFILE_PUBLISH_INVALID": "当前库存解析配置不能发布。",
"SHIPPING_INVENTORY_PARSING_PROFILE_REQUIRED": "启用库存源前必须绑定已发布的库存解析配置。",
"SHIPPING_INVENTORY_PARSING_PROFILE_RETIRE_BLOCKED": "库存解析配置仍被库存源引用,不能退役。",
"SHIPPING_INVENTORY_PARSING_PROFILE_RETIRE_INVALID": "当前库存解析配置不能退役。",
"SHIPPING_INVENTORY_FIELD_CONFLICT": "库存字段名称已存在。",
"SHIPPING_INVENTORY_FIELD_DELETE_BLOCKED": "该库存字段是核心字段或仍被配置引用,不能删除或停用。",
"SHIPPING_INVENTORY_FIELD_IMMUTABLE": "已停用库存字段不可编辑,核心字段的数据格式和字段用途不可修改。",
"SHIPPING_INVENTORY_FIELD_INVALID": "库存字段信息不完整或格式不正确。",
"SHIPPING_INVENTORY_FIELD_NOT_FOUND": "未找到库存字段。",
"SHIPPING_INVENTORY_FIELD_RETIRE_BLOCKED": "该库存字段仍被配置引用,不能停用。",
"SHIPPING_INVENTORY_RULE_CONDITION_INVALID": "库存路由规则条件无效。",
"SHIPPING_INVENTORY_RULE_CONDITIONS_REQUIRED": "库存路由规则至少需要一个条件。",
"SHIPPING_INVENTORY_RULE_CONFLICT": "库存路由规则名称或优先级冲突。",
"SHIPPING_INVENTORY_RULE_DELETE_BLOCKED": "只有草稿库存路由规则可以删除。",
"SHIPPING_INVENTORY_RULE_IMMUTABLE": "已发布的库存路由规则不可修改。",
"SHIPPING_INVENTORY_RULE_INVALID": "库存路由规则配置无效。",
"SHIPPING_INVENTORY_RULE_NOT_FOUND": "未找到库存路由规则。",
"SHIPPING_INVENTORY_RULE_PUBLISH_INVALID": "当前库存路由规则不能发布。",
"SHIPPING_INVENTORY_RULE_SOURCE_INVALID": "库存路由规则引用了不存在或已停用的库存源。",
"SHIPPING_INVENTORY_RULE_RETIRE_INVALID": "当前库存路由规则不能退役。",
"SHIPPING_INVENTORY_SOURCE_DELETE_BLOCKED": "库存源仍被业务数据引用,不能删除。",
"SHIPPING_INVENTORY_SOURCE_NOT_FOUND": "未找到库存源。",
"SHIPPING_INVENTORY_SOURCE_ACTIVATION_REQUIRED": "请先完成测试导出和启用检查,再启用库存站点。",
"SHIPPING_INVENTORY_SOURCE_ACTIVATION_BLOCKED": "库存站点尚未完成正式运行检查,暂不能启用。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_FILE_REQUIRED": "请选择库存样本文件。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_FILE_TOO_LARGE": "库存样本文件超过 20 MB 限制。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_INVALID": "库存样本文件无法识别,请检查文件格式和表头。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_NOT_FOUND": "库存文件结构识别记录不存在。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_SELECTION_INVALID": "所选工作表、表头或来源栏位不在库存文件识别结果中。",
"SHIPPING_TEMP_INVENTORY_CONTEXT_INVALID": "当前对话上下文无效,无法处理临时库存文件。",
"SHIPPING_TEMP_INVENTORY_ASSET_REQUIRED": "请先上传库存文件。",
"SHIPPING_TEMP_INVENTORY_ASSET_NOT_FOUND": "未找到当前对话可用的库存文件。",
"SHIPPING_TEMP_INVENTORY_ASSET_NOT_READY": "库存文件仍在上传中,请稍后重试。",
"SHIPPING_TEMP_INVENTORY_FILE_TYPE_INVALID": "对话库存文件仅支持 .xls、.xlsx 或 .csv。",
"SHIPPING_TEMP_INVENTORY_FILE_TOO_LARGE": "对话库存文件超过 20 MB 限制。",
"SHIPPING_TEMP_INVENTORY_ANALYSIS_INVALID": "无法识别库存文件结构,请检查文件格式和表头。",
"SHIPPING_TEMP_INVENTORY_SESSION_NOT_FOUND": "临时库存会话不存在、已过期或无权访问。",
"SHIPPING_TEMP_INVENTORY_MAPPING_STATE_INVALID": "当前临时库存会话不能再提交字段映射建议。",
"SHIPPING_TEMP_INVENTORY_MAPPING_INVALID": "库存字段映射建议无效、不完整,或包含不在文件中的栏位。",
"SHIPPING_TEMP_INVENTORY_CONFIRMATION_INVALID": "临时库存确认条件不满足,请重新选择已推荐的方案或映射。",
"SHIPPING_TEMP_INVENTORY_QUALITY_INVALID": "临时库存文件未通过料号、预约号或可用库存数量校验。",
"SHIPPING_TEMP_INVENTORY_SESSION_EXPIRED": "临时库存会话已过期,请重新上传文件。",
"SHIPPING_TEMP_INVENTORY_TASK_NOT_FOUND": "当前对话中未找到可使用该临时库存的发货任务。",
"SHIPPING_INVENTORY_CONFIGURATION_TEST_INVALID": "请在库存站点停用状态下执行测试导出。",
"SHIPPING_INVENTORY_CONFIGURATION_TEST_UNAVAILABLE": "RPA Worker 当前不可用,无法发起测试导出。",
"SHIPPING_INVENTORY_CONFIGURATION_TEST_NOT_FOUND": "库存站点测试导出记录不存在。",
"SHIPPING_INVENTORY_CONFIGURATION_TEST_NOT_READY": "测试导出尚未完成,暂不能确认解析方案。",
"SHIPPING_INVENTORY_CONFIGURATION_TEST_STALE": "库存站点配置已变更,请重新测试导出。",
"SHIPPING_RPA_PROFILE_CONFLICT": "货代登录配置名称已存在。",
"SHIPPING_RPA_PROFILE_DELETE_BLOCKED": "货代登录配置仍被库存源引用,不能删除。",
"SHIPPING_RPA_PROFILE_DISABLE_BLOCKED": "货代登录配置仍被启用的库存源引用,不能停用。",
"SHIPPING_RPA_PROFILE_DISABLED": "启用库存源前必须先启用其货代登录配置。",
"SHIPPING_RPA_PROFILE_NOT_FOUND": "未找到货代登录配置。",
"USER_USERNAME_REQUIRED": "用户名必填。",
"USER_USERNAME_EXISTS": "用户名已存在。",
"USER_EMAIL_INVALID": "邮箱格式不正确。",
@@ -84,7 +189,8 @@
"SHIPPING_CUSTOMER_SHADOW_LABEL_REQUIRED": "请选择标准客户作为人工真值。",
"SHIPPING_CUSTOMER_CONFIRMATION_REQUIRED": "标准客户尚未确认,请先选择正式客户。",
"SHIPPING_CUSTOMER_CONFIRMATION_CUSTOMER_REQUIRED": "请选择标准客户。",
"SHIPPING_CUSTOMER_CONFIRMATION_LEGACY_UNSUPPORTED": "该历史任务暂不支持客户确认。",
"SHIPPING_CUSTOMER_CASE_REQUIRED": "发货任务缺少业务单关联,无法确认客户。",
"SHIPPING_NOTICE_REVISION_CASE_MISSING": "修订目标任务缺少业务单关联,无法创建修订。",
"SHIPPING_CUSTOMER_INACTIVE": "所选客户已停用。",
"SHIPPING_CUSTOMER_NUMBERED_CASE_LOCKED": "已编号业务单不能静默更换客户。",
"SHIPPING_FIELD_CONFLICT_NOT_FOUND": "订单字段冲突不存在。",
@@ -97,8 +203,6 @@
"SHIPPING_BUSINESS_NUMBER_CUSTOMER_REQUIRED": "请先确认标准客户再生成业务编号。",
"SHIPPING_BUSINESS_NUMBER_CUSTOMER_INVALID": "客户已停用或不存在,无法生成业务编号。",
"SHIPPING_BUSINESS_NUMBER_SHORT_CODE_INVALID": "客户简码不符合 2-6 位大写英文字母规则。",
"SHIPPING_HISTORICAL_TASK_NOT_FOUND": "历史任务不存在。",
"SHIPPING_HISTORICAL_BACKFILL_INVALID": "该任务不符合历史客户回填条件。",
"SHIPPING_CUSTOMER_CORRECTION_TASK_REQUIRED": "请输入待纠错的技术号或业务号。",
"SHIPPING_CUSTOMER_CORRECTION_REASON_REQUIRED": "客户纠错必须填写原因。",
"SHIPPING_CUSTOMER_CORRECTION_NUMBER_REQUIRED": "只有已编号业务单可执行客户纠错。",
@@ -106,6 +210,11 @@
"SHIPPING_CUSTOMER_CORRECTION_UNCHANGED": "更正客户与当前客户相同。",
"SHIPPING_CUSTOMER_CORRECTION_TASK_MISSING": "待纠错任务或业务单不存在。",
"SHIPPING_CUSTOMER_CORRECTION_UPLOADED_BLOCKED": "任务已上传货代,请先完成外部作废流程再纠错。",
"SHIPPING_CUSTOMER_NOT_FOUND": "客户不存在。", "SHIPPING_CUSTOMER_NAME_REQUIRED": "标准客户名称必填。", "SHIPPING_CUSTOMER_SHORT_CODE_INVALID": "客户简码必须为 2-6 位英文字母。", "SHIPPING_CUSTOMER_SHORT_CODE_EXISTS": "客户简码已存在。", "SHIPPING_CUSTOMER_STATUS_INVALID": "客户状态无效。", "SHIPPING_CUSTOMER_CONFLICT": "客户数据冲突。", "SHIPPING_CUSTOMER_IDENTIFIER_TYPE_INVALID": "识别证据类型无效。", "SHIPPING_CUSTOMER_IDENTIFIER_VALUE_REQUIRED": "识别证据值必填。", "SHIPPING_CUSTOMER_EMAIL_INVALID": "客户邮箱格式无效。", "SHIPPING_CUSTOMER_DOMAIN_INVALID": "客户域名格式无效。", "SHIPPING_CUSTOMER_IDENTIFIER_STATUS_INVALID": "识别证据状态无效。", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_FOUND": "识别证据不存在。", "SHIPPING_CUSTOMER_IDENTIFIER_EXISTS": "该识别证据已存在。", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_APPROVED": "只有已审核证据才能启用自动匹配。", "SHIPPING_CUSTOMER_PUBLIC_DOMAIN_AUTO_MATCH_FORBIDDEN": "公共邮箱域名不能用于自动匹配。", "SHIPPING_CUSTOMER_EXTERNAL_REF_CONFLICT": "历史客户键已绑定其他客户。", "SHIPPING_CUSTOMER_IMPORT_FILE_REQUIRED": "请选择导入文件。", "SHIPPING_CUSTOMER_IMPORT_FILE_TYPE_INVALID": "仅支持 .xlsx 文件。", "SHIPPING_CUSTOMER_IMPORT_FILE_EMPTY": "导入文件为空。", "SHIPPING_CUSTOMER_IMPORT_FILE_TOO_LARGE": "导入文件超过 5 MB。", "SHIPPING_CUSTOMER_IMPORT_FILE_INVALID": "导入 Excel 无效。", "SHIPPING_CUSTOMER_IMPORT_SHEET_MISSING": "导入文件缺少必要 Sheet。", "SHIPPING_CUSTOMER_IMPORT_COLUMNS_MISSING": "导入文件缺少必要列。", "SHIPPING_CUSTOMER_IMPORT_KEY_REQUIRED": "历史客户键必填。", "SHIPPING_CUSTOMER_IMPORT_DUPLICATE_KEY": "同一来源存在重复历史客户键。", "SHIPPING_CUSTOMER_IMPORT_SHORT_CODE_CONFLICT": "客户简码与现有客户冲突。", "SHIPPING_CUSTOMER_IMPORT_NAME_MATCH": "客户名称可能与现有客户重复。", "SHIPPING_CUSTOMER_IMPORT_IDENTIFIER_CUSTOMER_MISSING": "识别证据找不到对应客户。", "SHIPPING_CUSTOMER_IMPORT_NOT_FOUND": "导入批次不存在。", "SHIPPING_CUSTOMER_IMPORT_ROW_NOT_FOUND": "导入行不存在。", "SHIPPING_CUSTOMER_IMPORT_DECISION_INVALID": "导入行处理动作无效。", "SHIPPING_CUSTOMER_IMPORT_TARGET_REQUIRED": "更新或合并时必须选择目标客户。", "SHIPPING_CUSTOMER_IMPORT_HAS_ERRORS": "导入批次存在阻断错误。", "SHIPPING_CUSTOMER_IMPORT_DECISIONS_REQUIRED": "请先处理全部警告行。", "SHIPPING_CUSTOMER_IMPORT_ALREADY_PUBLISHED": "导入批次已发布。", "SHIPPING_CUSTOMER_IMPORT_UPLOAD_CONFLICT": "上传导入批次时发生冲突。", "SHIPPING_CUSTOMER_IMPORT_PUBLISH_CONFLICT": "发布导入批次时发生数据冲突。"
"SHIPPING_ORDER_EXTRACTION_NOT_FOUND": "订单解析记录不存在或无权访问。",
"SHIPPING_ORDER_CUSTOMER_REQUIRED": "请选择标准客户。",
"SHIPPING_ORDER_CUSTOMER_ROLE_INVALID": "客户角色无效。",
"SHIPPING_ORDER_CUSTOMER_MATCH_NOT_FOUND": "订单客户匹配记录不存在。",
"SHIPPING_ORDER_CUSTOMER_SITE_INVALID": "请选择属于该客户的有效送货站点。",
"SHIPPING_CUSTOMER_NOT_FOUND": "客户不存在。", "SHIPPING_CUSTOMER_CHANGE_REASON_REQUIRED": "修改客户状态、简码或自动匹配授权时必须填写原因。", "SHIPPING_CUSTOMER_NAME_REQUIRED": "标准客户名称必填。", "SHIPPING_CUSTOMER_SHORT_CODE_INVALID": "客户简码必须为 2-6 位英文字母。", "SHIPPING_CUSTOMER_SHORT_CODE_EXISTS": "客户简码已存在。", "SHIPPING_CUSTOMER_STATUS_INVALID": "客户状态无效。", "SHIPPING_CUSTOMER_CONFLICT": "客户数据冲突。", "SHIPPING_CUSTOMER_IDENTIFIER_TYPE_INVALID": "识别证据类型无效。", "SHIPPING_CUSTOMER_IDENTIFIER_VALUE_REQUIRED": "识别证据值必填。", "SHIPPING_CUSTOMER_EMAIL_INVALID": "客户邮箱格式无效。", "SHIPPING_CUSTOMER_DOMAIN_INVALID": "客户域名格式无效。", "SHIPPING_CUSTOMER_IDENTIFIER_STATUS_INVALID": "识别证据状态无效。", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_FOUND": "识别证据不存在。", "SHIPPING_CUSTOMER_IDENTIFIER_EXISTS": "该识别证据已存在。", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_APPROVED": "只有已审核证据才能启用自动匹配。", "SHIPPING_CUSTOMER_PUBLIC_DOMAIN_AUTO_MATCH_FORBIDDEN": "公共邮箱域名不能用于自动匹配。", "SHIPPING_CUSTOMER_EXTERNAL_REF_CONFLICT": "历史客户键已绑定其他客户。", "SHIPPING_CUSTOMER_IMPORT_FILE_REQUIRED": "请选择导入文件。", "SHIPPING_CUSTOMER_IMPORT_FILE_TYPE_INVALID": "仅支持 .xlsx 文件。", "SHIPPING_CUSTOMER_IMPORT_FILE_EMPTY": "导入文件为空。", "SHIPPING_CUSTOMER_IMPORT_FILE_TOO_LARGE": "导入文件超过 5 MB。", "SHIPPING_CUSTOMER_IMPORT_FILE_INVALID": "导入 Excel 无效。", "SHIPPING_CUSTOMER_IMPORT_SHEET_MISSING": "导入文件缺少必要 Sheet。", "SHIPPING_CUSTOMER_IMPORT_COLUMNS_MISSING": "导入文件缺少必要列。", "SHIPPING_CUSTOMER_IMPORT_KEY_REQUIRED": "历史客户键必填。", "SHIPPING_CUSTOMER_IMPORT_DUPLICATE_KEY": "同一来源存在重复历史客户键。", "SHIPPING_CUSTOMER_IMPORT_SHORT_CODE_CONFLICT": "客户简码与现有客户冲突。", "SHIPPING_CUSTOMER_IMPORT_NAME_MATCH": "客户名称可能与现有客户重复。", "SHIPPING_CUSTOMER_IMPORT_IDENTIFIER_CUSTOMER_MISSING": "识别证据找不到对应客户。", "SHIPPING_CUSTOMER_IMPORT_NOT_FOUND": "导入批次不存在。", "SHIPPING_CUSTOMER_IMPORT_ROW_NOT_FOUND": "导入行不存在。", "SHIPPING_CUSTOMER_IMPORT_DECISION_INVALID": "导入行处理动作无效。", "SHIPPING_CUSTOMER_IMPORT_TARGET_REQUIRED": "更新或合并时必须选择目标客户。", "SHIPPING_CUSTOMER_IMPORT_HAS_ERRORS": "导入批次存在阻断错误。", "SHIPPING_CUSTOMER_IMPORT_DECISIONS_REQUIRED": "请先处理全部警告行。", "SHIPPING_CUSTOMER_IMPORT_ALREADY_PUBLISHED": "导入批次已发布。", "SHIPPING_CUSTOMER_IMPORT_UPLOAD_CONFLICT": "上传导入批次时发生冲突。", "SHIPPING_CUSTOMER_IMPORT_PUBLISH_CONFLICT": "发布导入批次时发生数据冲突。"
}
}
+6 -1
View File
@@ -168,6 +168,12 @@
"loadFailed": "加载失败",
"openChat": "在 Chat 中继续",
"download": "下载 Excel",
"downloadBatch": "下载本批次 ZIP",
"selectAllVisible": "全选当前结果",
"selectedCount": "已选 {count} 个任务",
"downloadSelected": "下载所选 ZIP",
"selectForDownload": "选择任务 {taskNo} 用于批量下载",
"archiveDownloadFailed": "批量下载失败,请刷新任务后重试。",
"lines": "发货明细",
"qty": "数量",
"columns": {
@@ -224,7 +230,6 @@
"created": "已创建",
"parsed": "已解析",
"pendingReview": "待复核",
"alignReview": "待确认字段",
"shortageReview": "库存缺口",
"waitingInventory": "等待库存",
"inventoryReady": "库存就绪",
+410 -4
View File
@@ -27,7 +27,407 @@
"requests": "權限審批",
"reports": "數據報表",
"schedules": "排程管理",
"shippingCustomers": "貨代客戶"
"shippingCustomers": "貨代客戶",
"shippingInventory": "貨代設定"
},
"shippingOrderSchema": {
"eyebrow": "訂單欄位範本",
"title": "訂單範本設定",
"subtitle": "所有 EML、PDF 和 Word 訂單共享同一份已發布欄位契約;發布後版本不可原地修改。",
"schemaName": "範本名稱",
"description": "說明",
"initialize": "初始化訂單範本",
"initialized": "訂單範本已初始化",
"fieldCatalog": "欄位目錄",
"fieldCatalogHint": "管理員維護欄位系統識別、位置、格式與識別規則;系統識別可重新命名,歷史版本保留原名稱。",
"fieldCode": "欄位編碼",
"ruleWorkspace": "欄位識別規則",
"publishedVersion": "已發布版本 V{version}",
"historyOpen": "版本歷史",
"historyEyebrow": "不可變快照",
"historyTitle": "版本歷史",
"historyViewing": "正在檢視歷史版本",
"historySelectVersion": "從左側選擇一個版本查看完整快照",
"historyLoadMore": "載入更多版本",
"historyNoNote": "未填寫變更說明",
"historyUnknownTime": "未記錄時間",
"historyUnknownActor": "未知操作人",
"historyPublishedAt": "發布時間",
"historyPublisher": "發布人",
"historyChecksum": "契約校驗和",
"historySnapshotFields": "快照欄位",
"historyExcluded": "未納入該版本",
"historyStatus": { "draft": "草稿", "published": "目前發布", "retired": "已退役" },
"diffWithCurrent": "與目前工作區 V{version} 比較",
"diffEyebrow": "伺服器語意差異",
"diffTitle": "版本差異",
"diffComparedWith": "對比",
"diffEmpty": "未設定",
"diffNoChanges": "兩個版本沒有欄位差異",
"diffAddedField": "該欄位在比較版本中新增",
"diffRemovedField": "該欄位在基線版本中存在,但比較版本已移除",
"diffOrderChanged": "僅順序變化",
"diffStatus": { "added": "新增", "removed": "移除", "modified": "已修改", "unchanged": "未變化" },
"diffField": { "field_code": "欄位名稱(系統識別)", "scope": "欄位位置", "value_type": "資料格式", "enabled": "納入目前版本", "display_name": "目前版本顯示名稱", "description": "說明", "required": "業務必填", "aliases": "別名", "normalizer_key": "文字處理方式", "validator_keys": "內容檢核", "enum_options": "列舉選項", "relation_role": "跨文件關聯", "comparator_key": "核對方式", "extraction_instruction": "識別說明", "sequence": "欄位順序", "evidence_policy.required": "必須提供原文證據", "evidence_policy.source_precedence": "可識別的內容來源", "evidence_policy.conflict_policy": "內容不一致時", "evidence_policy.allow_single_source": "允許單一可信來源" },
"auditTitle": "設定審計時間線",
"auditEmpty": "暫無設定審計事件",
"auditLoadMore": "載入更多審計事件",
"auditFieldSummary": "新增 {added},移除 {removed},修改 {changed} 個欄位",
"auditEvent": { "draft_created": "建立草稿", "draft_saved": "儲存草稿", "published": "發佈版本", "draft_deleted": "刪除草稿", "cloned": "複製版本為草稿", "field_saved": "儲存欄位目錄", "field_retired": "退役欄位目錄", "field_deleted": "刪除或歸檔欄位目錄" },
"copyToDraft": "複製為新草稿",
"usageOpen": "查看使用記錄",
"usageEyebrow": "執行追溯",
"usageTitle": "版本使用記錄",
"usageTotal": "解析總數",
"usageFirst": "首次使用",
"usageLast": "最近使用",
"usageRecords": "解析記錄",
"usageEmpty": "此版本尚未參與訂單解析",
"usageLoadMore": "載入更多解析記錄",
"extractionStatus": { "created": "已建立", "extracting": "解析中", "needs_review": "待人工覆核", "accepted": "已接受", "failed": "解析失敗", "superseded": "已替代" },
"runtimeAuditEyebrow": "凍結執行證據",
"runtimeAuditTitle": "訂單解析審計詳情",
"runtimeAuditEmpty": "找不到解析審計詳情",
"runtimeAuditExtraction": "解析記錄",
"runtimeAuditVersion": "訂單範本版本",
"runtimeAuditStatus": "解析狀態",
"runtimeAuditHash": "輸入快照雜湊",
"runtimeAuditInput": "凍結輸入文件",
"runtimeAuditInputUnavailable": "此歷史解析產生於輸入快照上線前,僅保留輸入快照雜湊。",
"runtimeAuditLlm": "LLM 原始結果",
"runtimeAuditNormalized": "正規化結果",
"runtimeAuditValidation": "檢核結果",
"runtimeAuditDecisions": "欄位裁決",
"runtimeAuditEvidence": "欄位證據",
"runtimeAuditValues": "已接受欄位值",
"businessFields": "待解析欄位",
"businessFieldsHint": "新增後選擇欄位,維護其識別規則。",
"searchFields": "搜尋顯示名稱或欄位編號",
"fieldCount": "{count} 個欄位",
"selectedInGroup": "目前欄位",
"noMatchingFields": "沒有符合的欄位",
"cancelAddField": "收起新增",
"publishedRuleViewer": "已發佈欄位設定",
"publishedReadOnlyHint": "目前顯示已發佈版本的完整設定;建立草稿後可修改。",
"readOnly": "唯讀",
"businessFieldName": "欄位名稱",
"fieldName": "欄位名稱(系統識別)",
"businessFieldNamePlaceholder": "例如:part_number",
"businessFieldNameHint": "請填寫英文小寫底線識別碼,例如 part_number、reservation_id、request_qty。",
"fieldEditingHint": "顯示名稱與系統識別始終可編輯;是否納入只影響目前版本發布。",
"businessFieldPlacement": "欄位位置",
"businessFieldFormat": "資料格式",
"placementHeader": "訂單資訊",
"placementLine": "貨品明細",
"placement": { "header": "訂單資訊", "line": "貨品明細" },
"fieldType": { "string": "文字", "decimal": "小數", "integer": "整數", "date": "日期", "boolean": "是/否", "enum": "選項" },
"ruleEditor": "正在設定",
"unnamedField": "未命名欄位",
"pendingNameField": "待命名欄位 {number}",
"inDraft": "已納入草稿",
"notInDraft": "未納入草稿",
"inPublished": "已納入已發布版本",
"notInPublished": "未納入目前版本",
"fieldRemovedStatus": "已移除",
"selectField": "請從左側選擇要設定的欄位。",
"addField": "新增欄位",
"fieldCreated": "欄位已建立",
"fieldUpdated": "欄位已更新",
"saveField": "儲存欄位",
"retireField": "退役",
"fieldRetired": "欄位已退役",
"confirmRetireField": "確定退役欄位 {code} 嗎?若仍被訂單範本草稿、路由、庫存解析或出貨範本引用,系統會阻止操作。",
"removeField": "刪除",
"fieldRemoved": "欄位已移除",
"fieldDeleted": "欄位已刪除",
"fieldArchived": "欄位已歸檔,不再顯示於目前設定",
"confirmRemoveField": "確定刪除「{name}」嗎?未使用欄位會徹底刪除;已有歷史記錄的欄位會歸檔且不再顯示。若仍被路由規則、庫存解析或出貨範本引用,系統會阻止操作。",
"versionEditor": "版本規則",
"notPublished": "尚未發布",
"createDraft": "建立草稿",
"draftCreated": "草稿已建立",
"changeNote": "變更說明",
"displayName": "目前版本顯示名稱",
"includeField": "納入目前版本",
"aliases": "別名(逗號分隔)",
"normalizer": "文字處理方式",
"comparator": "核對方式",
"relationRole": "跨文件關聯",
"conflictPolicy": "內容不一致時",
"required": "業務必填",
"evidenceRequired": "必須提供原文證據",
"allowSingleSource": "允許單一可信來源",
"enumOptions": "列舉選項(逗號分隔)",
"validators": "內容校驗",
"sourcePrecedence": "可識別的內容來源",
"extractionInstruction": "識別說明(可選)",
"extractionInstructionPlaceholder": "例如:優先識別訂單明細表中的製造商料號",
"advancedRules": "進階識別規則",
"notSet": "不設定",
"changeNotePlaceholder": "說明本次欄位規則調整(可選)",
"ruleLabel": { "trim": "移除前後空白", "uppercase_trim": "轉為大寫並移除空白", "lowercase_trim": "忽略大小寫並移除空白", "decimal": "以小數處理", "integer": "以整數處理", "iso_date": "以日期處理", "boolean": "以是/否處理", "normalized_text": "依處理後文字核對", "case_insensitive_text": "忽略大小寫核對", "date": "依日期核對", "exact": "必須完全一致", "block": "阻止繼續處理", "review": "進入人工覆核", "prefer_attachment": "優先採用附件內容", "prefer_email": "優先採用郵件內容", "prefer_highest_confidence": "採用可信度較高的結果", "atomic_part_number": "料號格式", "non_empty": "不得為空", "positive_decimal": "必須為正數", "non_negative_decimal": "不得為負數", "positive_integer": "必須為正整數", "reservation_id": "預約號格式", "primary_link": "主要關聯", "secondary_link": "次要關聯", "line_match": "明細行關聯", "order_reference": "訂單關聯" },
"sourceLabel": { "attachment_table": "附件表格", "attachment_text": "附件正文", "email_body_table": "郵件表格", "email_body_text": "郵件正文", "dify_llm": "智慧識別結果", "backend_table": "系統表格識別" },
"saveDraft": "儲存草稿",
"draftSaved": "草稿已儲存",
"deleteDraft": "刪除草稿",
"draftDeleted": "草稿已刪除",
"publish": "發布版本",
"published": "訂單欄位版本已發布",
"noDraft": "目前沒有草稿;建立草稿後可設定並發布欄位規則。",
"setupKicker": "設定起點",
"setupTitle": "先定義系統要識別與匯出的訂單欄位",
"setupHint": "訂單欄位是庫存比對、路由判斷與發貨 Excel 的共同契約。發布後再繼續維護庫存解析模板與庫存來源。",
"setupActionHint": "系統會以預設設定建立第一個訂單欄位工作區,之後即可新增待解析欄位。",
"setupStepCatalog": "建立穩定欄位目錄,例如料號、品名與數量",
"setupStepRules": "為欄位設定別名、校驗與 EML/PDF 證據規則",
"setupStepPublish": "發布欄位版本,供後續設定安全引用",
"operationFailed": "訂單範本操作失敗"
},
"shippingInventory": {
"title": "貨代設定",
"subtitle": "從訂單欄位、庫存解析到發貨 Excel 與庫存路由,維護一條可追溯的發貨設定鏈路。",
"eyebrow": "貨代發貨設定工作台",
"groupFoundation": "基礎定義",
"groupInventory": "庫存管理",
"groupAudit": "執行稽核",
"orderFields": "訂單解析",
"orderSchemaRequired": "請先在「訂單解析」發佈一個版本;庫存解析、出貨範本和路由規則才能引用訂單欄位。",
"connections": "系統連線",
"parsingProfiles": "庫存解析",
"parsingProfilesHelp": "維護可由多個庫存站點共用的庫存檔案結構、欄位對應與訂單欄位匹配鍵。",
"inventoryMapping": "庫存解析",
"inventoryMappingPlans": "解析規則",
"inventoryFields": "庫存欄位目錄",
"inventoryFieldsHelp": "維護跨 DBS、Crane 等庫存檔案共用的業務欄位;各庫存解析負責把實際標題對應到這些欄位。",
"inventoryFieldName": "欄位名稱",
"inventoryFieldDescription": "欄位說明",
"inventoryFieldDescriptionHint": "說明這個欄位的業務含義和使用情境",
"inventoryFieldFormat": "資料格式",
"inventoryFieldPurpose": "欄位用途",
"inventoryFieldOrder": "顯示順序",
"inventoryFieldType": { "text": "文字", "integer": "整數", "decimal": "小數", "date": "日期" },
"inventoryFieldPurposeOption": { "match_identity": "庫存匹配", "inventory_quantity": "庫存數量", "warehouse_identity": "倉庫識別", "general": "一般業務資訊" },
"inventoryFieldPurposeHint": "庫存匹配用於關聯訂單與庫存;庫存數量用於可出貨數量計算;倉庫識別僅用於動態倉站點;其他欄位用於顯示或出貨範本。",
"inventoryFieldUserDefinedHint": "欄位名稱完全由使用者維護。發布庫存映射時至少需要一個庫存匹配欄位,且只能有一個庫存數量欄位;動態倉站點還需要一個倉庫識別欄位。",
"retireInventoryField": "停用欄位",
"confirmRetireInventoryField": "確定要停用這個庫存欄位嗎?停用後不能再用於新的庫存解析或出貨範本。",
"parsingProfileCode": "庫存解析編碼",
"temporaryInventorySession": "已確認的對話庫存檔案",
"temporaryInventorySessionNone": "不使用對話庫存檔案",
"temporaryInventorySessionHint": "選擇後會重用已通過品質驗證的檔案結構和欄位映射;仍須填寫方案編碼、名稱和訂單匹配鍵,儲存結果僅為草稿。",
"temporaryInventorySessionSelected": "已載入臨時檔案的已確認映射(來源:{mapping});不能在此變更檔案結構。",
"fileFormat": "檔案格式",
"inventorySampleFile": "庫存樣本檔案",
"inventorySampleFileHint": "上傳 .xls、.xlsx 或 .csv 後,系統會讀取工作表、表頭與少量樣例,供確認庫存解析。",
"inventorySampleAnalysing": "正在分析庫存檔案結構...",
"inventorySampleRequired": "請先上傳庫存樣本檔案並完成結構識別。",
"parsingProfileName": "庫存解析名稱",
"inventoryAnalysisFailed": "庫存檔案結構識別失敗。",
"inventoryAnalysisPreview": "識別結果預覽",
"inventoryAnalysisSummary": "識別到 {candidate_count} 個可選表頭,目前樣例行數 {sample_row_count};已建議 {valid_inventory_field_suggestions} 個庫存欄位。",
"csvFile": "CSV 檔案",
"headerRowOption": "第 {row} 行",
"chooseSourceHeader": "請選擇來源欄位",
"emptyHeader": "空白欄位",
"parsingPlanRecommendation": "可重用的庫存解析",
"recommendationLevel": { "exact": "檔案結構完全一致", "compatible": "核心欄位可相容" },
"usedBySites": "已被 {count} 個庫存站點使用",
"addedColumns": "新增非關鍵欄位:{columns}",
"columnOrderChanged": "欄位順序變化,但核心欄位仍可識別。",
"adoptParsingPlan": "採用此方案",
"parsingPlanAdopted": "已確認採用庫存解析;尚未繫結任何庫存站點。",
"headerRowIndex": "表頭列索引",
"sheetName": "工作表名稱(選填)",
"fieldMappings": "庫存標準欄位映射",
"matchKeys": "訂單欄位與庫存欄位匹配鍵",
"matchKeysHint": "只維護用於定位同一筆庫存記錄的身分欄位。可用庫存數量在上方「庫存標準欄位映射」維護,用於後續庫存充足性判斷,不作為匹配鍵。",
"matchKeysComplete": "目前所有已映射的庫存身分欄位都已維護為匹配鍵,無需再新增。",
"matchKeysAnalysisRequired": "請先上傳庫存樣本檔案,確認檔案結構後再新增匹配鍵。",
"inventoryField": "庫存欄位",
"orderField": "訂單欄位",
"readonlyFieldMappingsHint": "以下內容為已發布版本鎖定的 Excel 欄位對應關係。",
"readonlyMatchKeysHint": "訂單明細會按以下欄位組合與庫存記錄準確匹配。",
"publishedParsingImmutable": "已發布庫存解析作為稽核定義保留,不能直接修改。如需調整,請建立新的草稿版本後發布。",
"chooseInventoryField": "請選擇庫存標準欄位",
"chooseOrderField": "請選擇訂單列欄位",
"sourceHeader": "庫存檔案表頭名稱",
"addFieldMapping": "新增欄位映射",
"addMatchKey": "新增匹配鍵",
"publishProfile": "發布",
"retireProfile": "退役",
"confirmRetireProfile": "僅無庫存站點引用的解析方案可退役,是否繼續?",
"excelTemplates": "出貨範本",
"excelTemplateName": "範本名稱",
"templateCodeHint": "用於識別同一類出貨範本,例如 DBS_SHIPMENT。",
"templateFileHint": "上傳後系統會讀取工作表和首列標題,供下方選擇目標欄位。",
"filenamePatternHint": "可使用下方變數組合檔名;建議直接使用正式業務單號。",
"filenamePatternExample": "建議:{business_no}.xlsx → WYC26060201.xlsx",
"filenameVariablesTitle": "可直接使用的檔名變數",
"filenameVariablesHint": "變數使用大括號;業務單變數取任務已鎖定的業務單快照,確保歷史匯出可追溯。",
"filenameVariableNoMatch": "沒有符合的變數",
"filenameVariableBusinessNo": "正式業務單號,例如 WYC26060201(建議)",
"filenameVariableCustomer": "客戶簡稱,例如 WYC",
"filenameVariableBusinessDate": "業務日期(六位),例如 260602",
"filenameVariableSequence": "客戶當日流水(兩位),例如 01",
"filenameVariableTaskNo": "系統任務號",
"filenameVariableSource": "庫存來源編碼",
"filenameVariableDate": "匯出日期(八位),例如 20260602",
"filenameVariableTimestamp": "匯出時間戳(十四位)",
"templateMappingsHint": "每一條映射會說明:將哪個業務資料寫入範本的哪個工作表、哪一欄及從哪一列開始。",
"mappingItem": "映射 {number}",
"templateSheet": "目標工作表",
"chooseTemplateSheet": "請選擇上傳檔案中的工作表",
"templateRowMode": "寫入方式",
"rowMode": { "header": "訂單資訊(每個檔案寫一次)", "line": "貨品明細(每項貨品寫一列)" },
"chooseTargetColumn": "請選擇範本中的目標欄位",
"savedTargetColumn": "已儲存欄位 {column}",
"sourceType": "資料來源類型",
"sourceField": "來源欄位",
"sourceKind": { "order_field": "訂單範本欄位", "inventory_field": "庫存範本欄位", "system_fact": "系統資訊", "constant": "固定內容" },
"sourceKindHint": { "order_field": "選擇訂單範本設定中已發布的欄位。", "inventory_field": "選擇庫存範本設定解析出的標準欄位。", "system_fact": "選擇系統自動提供的任務資訊。" },
"sourceGroupOrder": "訂單範本欄位", "sourceGroupOrderRepeated": "訂單資訊欄位(每筆貨品明細重複寫入)", "sourceGroupOrderLine": "貨品明細欄位", "sourceGroupInventory": "庫存範本欄位", "sourceGroupSystem": "系統資訊", "noSourceOptions": "暫無可選欄位",
"systemFact": { "task_no": "系統任務號", "business_no": "正式業務單號", "warehouse_id": "貨代倉庫", "inventory_source_code": "庫存來源編碼", "export_date": "匯出日期" },
"orderFieldOptionsEmpty": "目前沒有已發布的訂單範本欄位;請先完成訂單範本設定並發布版本,之後此處會顯示可選來源欄位。",
"constantValueHint": "每次匯出都寫入相同內容,例如固定貨代代碼。",
"valueFormat": "寫入格式",
"formatter": { "text": "依原樣寫入", "upper": "轉為大寫", "lower": "轉為小寫", "date_mmddyyyy": "日期:月/日/年", "integer": "整數", "decimal": "小數" },
"templateLayoutReadFailed": "無法讀取 Excel 範本的工作表和標題,請確認檔案未損壞後重試。",
"excelTemplatesHelp": "上傳並發布可由多個庫存來源共用的版本化出貨範本,映射使用穩定訂單欄位 ID。",
"templateCode": "範本編碼",
"templateFile": "Excel 範本檔案",
"filenamePattern": "匯出檔名規則",
"templateMappings": "範本欄位映射",
"startRow": "起始列",
"targetColumn": "目標欄序號",
"constantValue": "常數值",
"chooseSourceField": "請選擇來源欄位",
"addTemplateMapping": "新增範本映射",
"templateFileRequired": "建立範本草稿時必須選擇 xlsx 檔案",
"publishTemplate": "發布範本",
"retireTemplate": "退役",
"publishedTemplateImmutable": "已發布範本不可直接修改;可點擊「建立新版本」複用已保存檔案後繼續調整。",
"createTemplateVersion": "建立新版本",
"confirmRetireTemplate": "確定要退役這個範本嗎?退役後不能再綁定新的庫存站點。",
"connectionsHelp": "維護不同帳號的登入網址和憑據;每個連線設定只負責登入,不維護頁面點擊路徑。",
"credentialsHint": "帳號與密碼只可寫入,頁面及介面不會回傳。",
"sources": "庫存站點",
"sourcesHelp": "維護報表路徑、查詢條件和識別別名,並關聯匯出此庫存來源的連線設定。",
"rules": "路由規則",
"rulesHelp": "依業務欄位、匹配符號和優先級,將訂單列路由至庫存來源;發布後不可修改。",
"snapshots": "庫存快照",
"snapshotsHelp": "唯讀查看已匯出且可供發貨匹配使用的庫存檔案。",
"exports": "匯出記錄",
"exportsHelp": "唯讀查看庫存匯出的執行結果;此處不重試或觸發匯出。",
"externalMappings": "倉庫映射",
"mappingsHelp": "將貨代倉庫或庫存來源預設倉庫對應至外部系統倉庫編碼。",
"defaultMapping": "庫存來源預設對應",
"loadFailed": "載入貨代庫存設定失敗",
"createNew": "新增",
"saving": "儲存中...",
"publish": "發布規則",
"retire": "歸檔規則",
"flowOrder": "訂單解析",
"flowInventory": "庫存解析",
"flowTemplate": "發貨模板",
"flowRoute": "路由規則",
"connectionCode": "連線編碼",
"connectionName": "連線名稱",
"inventorySiteName": "庫存站點名稱",
"connectorType": "貨代類型",
"loginUrl": "登入網址",
"username": "帳號",
"password": "密碼",
"writeOnlyHint": "留空則維持原值",
"enabled": "啟用",
"enabledState": "已啟用",
"disabledState": "已停用",
"notGenerated": "尚未產生",
"notConfigured": "尚未設定",
"parsingProfileGeneratedByTest": "儲存站點後,透過測試匯出識別或確認庫存解析。",
"sourceSavedDisabledHint": "首次儲存後站點保持停用;請完成測試匯出、庫存解析與出貨範本設定後再啟用。",
"activationStatus": "正式執行檢查",
"activationReady": "庫存站點已啟用,可進入正式庫存執行。",
"activationDraft": "庫存站點目前停用;完成以下項目後才可啟用。",
"activationRequirement": { "rpa_profile": "系統連線可用", "parsing_profile": "庫存解析", "excel_template": "出貨範本", "configuration_test": "測試匯出與解析驗證", "parsing_validation": "測試檔案中的料號、預約號與庫存數量可正確解析", "warehouse_identification": "測試檔案可識別貨代倉庫", "warehouse_mapping": "已維護貨代倉庫至外部系統倉庫的對應", "template_validation": "出貨範本引用的庫存欄位可由庫存解析提供" },
"activateSource": "啟用庫存站點",
"deactivateSource": "停用庫存站點",
"activateSourceConfirm": "系統將複核正式執行前置條件;全部通過後才會啟用庫存站點。",
"deactivateSourceConfirm": "停用後不再參與新的庫存路由與匯出任務,是否繼續?",
"configurationTest": "測試匯出", "configurationTestHint": "測試檔案僅用於驗證連線、檔案結構與庫存解析,不會進入正式庫存匹配或出貨匯出。", "startConfigurationTest": "測試匯出", "configurationTestRunning": "測試進行中...", "configurationTestFailed": "庫存站點測試匯出失敗。", "configurationTestNoRecommendation": "找不到可直接採用的已發布庫存解析;請根據測試結果建立或完善庫存解析。", "confirmTestProfile": "確認並繫結此庫存解析", "configurationTestProfileConfirmed": "已確認庫存解析,庫存站點仍保持停用。", "configurationTestStage": { "waiting_worker": "等待 RPA Worker 接收測試任務", "analysing_structure": "正在識別庫存檔案結構", "ready_for_confirmation": "測試完成,等待確認庫存解析", "failed": "測試失敗" },
"connectionBoundary": "連線設定只填寫登入所需資訊;系統會依貨代平台自動執行頁面操作、下載與等待。",
"platform": { "dbs": "DBS 平台", "crane": "Crane 平台" },
"sourceCode": "庫存來源編號",
"connection": "連線設定",
"chooseConnection": "請選擇連線設定",
"warehouseResolution": "倉庫識別方式",
"fixedWarehouse": "指定倉庫",
"inventoryMatch": "依庫存列匹配",
"warehouse": "貨代倉庫",
"dynamicWarehouse": "由庫存列識別",
"snapshotTtl": "快照有效期(秒)",
"reportPath": "DBS 報表路徑",
"programGroup": "程式分組",
"programLabel": "程式名稱",
"reportGroup": "報表分組",
"reportName": "報表名稱",
"queryParameters": "查詢條件",
"parameterName": "參數名稱",
"parameterValues": "參數值(以逗號分隔)",
"single": "單值",
"multiText": "多值輸入",
"multiSelect": "多選",
"required": "必填",
"selectAll": "全選",
"addParameter": "新增查詢條件",
"matchAliases": "識別別名",
"aliasHint": "多個別名以逗號分隔",
"ruleCode": "規則編碼",
"ruleName": "規則名稱",
"ruleConditions": "匹配條件",
"addCondition": "新增條件",
"noExpectedValue": "此匹配符號不需要匹配值",
"scope": "作用範圍",
"priority": "優先級",
"factPath": "業務欄位",
"operator": "匹配符號",
"operatorEquals": "= 等於",
"operatorNotEquals": "≠ 不等於",
"operatorIn": "屬於清單",
"operatorNotIn": "不屬於清單",
"operatorPrefix": "以...開頭",
"operatorSuffix": "以...結尾",
"operatorContains": "包含",
"operatorNumericLength": "數字長度等於",
"operatorStringLength": "文字長度等於",
"operatorIsEmpty": "為空",
"operatorIsNotEmpty": "不為空",
"expectedValue": "匹配值",
"routeScope": { "task": "整張訂單", "line": "每筆貨品明細" },
"routeConditionSource": { "order_field": "訂單中的欄位", "system_fact": "系統自動資訊" },
"sourceCandidates": "候選庫存來源",
"sourceCandidatesHint": "可選擇一個或多個庫存來源;系統會依規則優先級依序判斷。",
"publishedImmutable": "已發布規則作為稽核定義保留,不能修改。請新增規則後重新發布。",
"source": "庫存來源",
"chooseSource": "請選擇庫存來源",
"freightWarehouse": "貨代倉庫(可選)",
"externalSystem": "目標系統",
"externalOrganization": "目標組織(可選)",
"externalSite": "目標地點(可選)",
"externalWarehouseCode": "目標倉庫編碼",
"externalWarehouseName": "目標倉庫名稱",
"snapshotStatus": "快照狀態",
"snapshotFile": "快照檔案", "expiresAt": "有效至", "lineCount": "庫存行數", "lineCountValue": "{count} 行", "sourceRun": "來源執行", "runNo": "執行號", "triggerMode": "觸發方式", "startedAt": "開始時間", "duration": "耗時", "durationValue": "{seconds} 秒", "status": "狀態", "actions": "操作", "viewDetail": "查看詳情", "view": "查看", "download": "下載", "detail": "詳情", "resizeColumn": "拖曳調整「{label}」欄寬", "downloadFailed": "下載庫存快照失敗", "snapshotDetail": "快照詳情", "exportDetail": "匯出詳情", "historyNotCaptured": "歷史記錄未採集", "exportResultReady": "已產生庫存檔案", "auditStatus": { "ready": "可用", "success": "成功", "failed": "失敗", "partial_failed": "部分失敗", "skipped": "已跳過", "awaiting_rpa": "執行中", "unknown": "歷史記錄" }, "trigger": { "scheduled": "定時執行", "manual": "手動執行" },
"exportResult": "匯出結果",
"exportedAt": "匯出時間",
"emptySnapshots": "暫無可查看的庫存快照。",
"emptyExports": "暫無匯出記錄。",
"emptyConfig": "暫無設定,請新增第一筆記錄。",
"saveFailed": "儲存貨代庫存設定失敗",
"confirmRetire": "歸檔後此規則不再參與新路由,是否繼續?",
"confirmRetireTitle": "確認歸檔",
"confirmDeleteTitle": "確認刪除",
"confirmDelete": "只有無引用的錯誤設定可以刪除,是否繼續?",
"deleteFailed": "刪除貨代庫存設定失敗"
},
"platformApps": {
"guideUsage": "資料用途",
@@ -1141,14 +1541,20 @@
},
"shippingCustomers": {
"title": "貨代客戶主資料", "subtitle": "維護穩定客戶身份、客戶簡碼、識別證據與期初匯入", "add": "新增客戶", "edit": "編輯客戶", "saving": "儲存中...", "importButton": "期初匯入", "search": "查詢", "searchPlaceholder": "搜尋客戶名稱或簡碼", "empty": "暫無客戶", "deactivate": "停用", "confirmDeactivate": "確認停用客戶「{name}」嗎?歷史業務引用會保留。", "yes": "是", "no": "否",
"fields": { "standardName": "標準客戶名稱", "shortCode": "客戶簡碼", "shortCodeHint": "2-6 位英文字母,儲存後統一轉為大寫", "status": "狀態", "remark": "備註" },
"externalRefs": { "title": "外部系統客戶編碼", "hint": "用於帳款客戶精確匹配;客戶簡碼仍從標準客戶讀取。", "empty": "尚未維護外部系統客戶編碼", "sourceSystem": "來源系統,例如 ERP", "customerCode": "外部客戶編碼" },
"sites": { "title": "送貨站點", "hint": "用於送貨客戶與 Ship-to Code 匹配,不建立新的帳款客戶。", "empty": "尚未維護送貨站點", "siteName": "站點名稱", "siteCode": "Ship-to Code", "address": "送貨地址", "city": "城市", "country": "國家/地區" },
"deleteDialog": { "open": "永久刪除", "title": "永久刪除客戶", "subtitle": "僅未進入業務或稽核鏈的誤建客戶可刪除。", "loading": "正在檢查刪除資格...", "identifiers": "將級聯刪除 {count} 條識別證據。", "blocked": "此客戶不能永久刪除", "blockedHint": "請改用停用或後續客戶合併流程。", "warning": "此操作無法復原,請輸入客戶簡碼和刪除原因確認。", "confirmationShortCode": "輸入客戶簡碼 {shortCode} 確認", "reason": "刪除原因", "confirm": "確認永久刪除", "deleted": "客戶已永久刪除", "failed": "永久刪除客戶失敗", "blockers": { "business_cases": "業務單", "business_sequences": "業務編號流水", "external_references": "外部來源鍵", "import_target_rows": "匯入目標行", "import_result_rows": "匯入結果行", "shadow_top_candidates": "影子最高候選", "shadow_manual_labels": "影子人工真值", "shadow_candidate_matches": "影子候選匹配", "merged_source_customers": "已合併來源客戶", "merged_into_customer": "目標客戶合併關係" } },
"mergeDialog": { "open": "合併客戶", "title": "合併重複客戶", "subtitle": "歷史業務與稽核維持不變;僅將未來識別配置歸併到目標客戶。", "source": "來源客戶", "target": "目標客戶", "chooseTarget": "請選擇啟用的目標客戶", "historyTitle": "保留歷史引用", "historyHint": "已有業務號、業務單、匯入和影子稽核仍指向來源客戶,不會被改寫。", "historyCount": "共 {count} 條歷史或稽核引用保持原狀", "migrateTitle": "歸併未來配置", "identifiers": "遷移證據", "duplicates": "重複證據", "references": "來源鍵", "warning": "來源客戶將標記為「已合併」,不能再用於新任務或再次編輯。", "confirmationShortCode": "輸入來源客戶簡碼 {shortCode} 確認", "reason": "合併原因", "confirm": "確認合併", "merged": "客戶已合併", "failed": "合併客戶失敗", "previewFailed": "讀取合併預檢失敗" },
"fields": { "standardName": "標準客戶名稱", "shortCode": "客戶簡碼", "shortCodeHint": "2-6 位英文字母,儲存後統一轉為大寫", "status": "狀態", "remark": "備註", "changeReason": "變更原因", "changeReasonHint": "修改簡碼或狀態時必須填寫" },
"headers": { "name": "客戶名稱", "shortCode": "簡碼", "status": "狀態", "identifiers": "識別證據", "cases": "業務單", "actions": "操作" },
"status": { "all": "全部狀態", "active": "啟用", "inactive": "停用" },
"status": { "all": "全部狀態", "active": "啟用", "inactive": "停用", "merged": "已合併" },
"identifierStatus": { "pending": "待審核", "approved": "已審核", "disabled": "已停用" },
"identifierTypes": { "name_alias": "名稱別名", "email": "郵箱", "domain": "網域", "template_fingerprint": "模板指紋", "address": "地址", "contact": "聯絡人" },
"identifiers": { "title": "客戶識別證據", "type": "類型", "value": "原始值 / 標準值", "status": "審核狀態", "autoMatch": "允許自動匹配", "empty": "暫無識別證據", "approve": "審核通過", "enableAuto": "啟用自動匹配", "disable": "停用", "add": "新增識別證據", "valuePlaceholder": "輸入別名、郵箱、網域等", "allowAuto": "允許自動匹配" },
"import": { "title": "期初客戶匯入", "subtitle": "上傳暫存、預檢衝突、人工決策後整批發佈", "file": "Excel 檔案", "sourceSystem": "來源系統", "downloadTemplate": "下載模板", "upload": "上傳預檢", "uploaded": "檔案已完成預檢", "uploadFailed": "上傳預檢失敗", "row": "位置", "type": "行類型", "key": "歷史客戶鍵", "preview": "預覽", "validation": "校驗結果", "decision": "發佈動作", "choose": "請選擇", "target": "選擇目標客戶", "publish": "整批發佈", "published": "客戶匯入發佈成功", "publishFailed": "發佈失敗", "alreadyPublished": "已發佈", "downloadReconciliation": "下載對賬 CSV", "downloadFailed": "檔案下載失敗", "decisionFailed": "儲存行決定失敗", "stats": { "total": "總行數", "valid": "有效", "warning": "警告", "error": "錯誤", "published": "已發佈" }, "rowTypes": { "customer": "客戶", "identifier": "識別證據" }, "validationStatus": { "valid": "通過", "warning": "需決策", "error": "阻斷" }, "actions": { "create": "新增", "update": "更新", "merge": "合併", "skip": "跳過" } },
"shadow": { "title": "客戶影子識別品質", "subtitle": "影子樣本不產生副作用;面板同時顯示受控自動確認與管理員糾錯指標", "refresh": "重新整理報告", "loadFailed": "載入影子識別報告失敗", "labelFailed": "儲存人工真值失敗", "labeled": "人工真值已儲存", "sample": "候選 / 接入記錄", "status": "影子結論", "topCandidate": "最高候選", "manualLabel": "人工真值", "chooseCustomer": "選擇標準客戶", "empty": "暫無影子識別樣本", "auditTitle": "客戶識別與糾錯稽核", "auditTask": "任務號", "auditEvent": "事件", "auditBusinessNo": "業務號", "auditTime": "時間", "auditEmpty": "暫無客戶稽核事件", "cards": { "total": "總樣本", "unique": "唯一候選", "ambiguous": "歧義", "unmatched": "未匹配", "accuracy": "已標註準確率", "autoBound": "自動綁定", "autoRate": "自動確認率", "corrected": "已糾錯任務" }, "statuses": { "unique_candidate": "唯一候選", "ambiguous": "多候選歧義", "unmatched": "未匹配", "failed": "影子計算失敗" }, "events": { "customer_auto_resolution_evaluated": "自動裁決已評估", "customer_auto_confirmed": "客戶已自動確認", "customer_correction_applied": "客戶糾錯已套用", "customer_historical_backfilled": "歷史客戶已回填" } },
"lifecycle": { "open": "治理時間線", "title": "客戶治理時間線", "loading": "正在載入時間線...", "empty": "暫無治理事件", "time": "時間", "event": "事件", "reason": "原因", "change": "變更", "events": { "created": "建立客戶", "updated": "更新客戶", "identifier_created": "新增識別證據", "identifier_updated": "更新識別證據", "merged_source": "作為來源客戶合併", "merged_target": "作為目標客戶合併", "deleted": "永久刪除" } },
"prompts": { "deactivateReason": "請輸入停用原因", "identifierChangeReason": "請輸入審核、停用或自動匹配授權的變更原因" },
"shadow": { "title": "客戶影子識別品質", "subtitle": "影子樣本不產生副作用;面板同時顯示受控自動確認與管理員糾錯指標", "refresh": "重新整理報告", "loadFailed": "載入影子識別報告失敗", "labelFailed": "儲存人工真值失敗", "labeled": "人工真值已儲存", "sample": "候選 / 接入記錄", "status": "影子結論", "topCandidate": "最高候選", "manualLabel": "人工真值", "chooseCustomer": "選擇標準客戶", "empty": "暫無影子識別樣本", "auditTitle": "客戶識別與糾錯稽核", "auditTask": "任務號", "auditEvent": "事件", "auditBusinessNo": "業務號", "auditTime": "時間", "auditEmpty": "暫無客戶稽核事件", "cards": { "total": "總樣本", "unique": "唯一候選", "ambiguous": "歧義", "unmatched": "未匹配", "accuracy": "已標註準確率", "autoBound": "自動綁定", "autoRate": "自動確認率", "corrected": "已糾錯任務" }, "statuses": { "unique_candidate": "唯一候選", "ambiguous": "多候選歧義", "unmatched": "未匹配", "failed": "影子計算失敗" }, "events": { "customer_auto_resolution_evaluated": "自動裁決已評估", "customer_auto_confirmed": "客戶已自動確認", "customer_correction_applied": "客戶糾錯已套用" }, "gate": { "title": "自動確認品質門禁", "metrics": "有效人工標注樣本 {samples}/{minSamples};準確率 {accuracy}(要求 {minAccuracy})", "statuses": { "eligible": "門禁已通過,可執行唯一強證據自動確認", "insufficient_labeled_samples": "門禁降級:有效人工標注樣本不足", "insufficient_accuracy": "門禁降級:人工標注準確率未達閾值" } } },
"msg": { "loadFailed": "載入客戶失敗", "nameRequired": "請輸入標準客戶名稱", "shortCodeInvalid": "客戶簡碼必須為 2-6 位英文字母", "saved": "客戶已儲存", "saveFailed": "儲存失敗", "identifierRequired": "請輸入識別證據值", "identifierSaved": "識別證據已儲存" }
},
"role": {
+18 -34
View File
@@ -15,6 +15,8 @@
"uploading": "上傳中",
"processing": "處理中",
"ready": "處理完成",
"parsing": "解析中",
"parseSucceeded": "解析成功",
"uploadFailed": "上傳失敗",
"parseFailed": "解析失敗",
"retry": "重試上傳",
@@ -92,6 +94,17 @@
"shippingNoticeDuplicateResolved": "重複處理方式已儲存。",
"shippingNoticeDuplicateResolveFailed": "儲存重複處理方式失敗。",
"shippingCandidateTitle": "訂單候選審核",
"shippingCustomerMatch": {
"title": "客戶匹配",
"role": "客戶角色",
"rawName": "訂單原文",
"standardName": "標準客戶",
"shortCode": "客戶簡稱",
"site": "送貨站點",
"statusLabel": "匹配狀態",
"roles": { "bill_to": "帳款客戶", "ship_to": "送貨客戶" },
"status": { "unmatched": "未匹配", "unique_candidate": "唯一候選", "ambiguous": "多個候選", "confirmed": "已確認" }
},
"shippingCandidateCount": "共 {count} 個訂單",
"shippingCandidateReady": "可建單",
"shippingCandidateNeedsReview": "需要審核",
@@ -126,23 +139,14 @@
"shippingCandidateUpdateDone": "訂單候選修訂已儲存。",
"shippingCandidateUpdateFailed": "儲存訂單候選失敗。",
"shippingInventoryUploadFailed": "庫存檔案上傳失敗。",
"shippingInventorySiteRequired": "正式庫存檔案請由已啟用庫存站點匯入;如需分析對話中的表格,請明確說明它是庫存檔案。",
"shippingNoticeSpreadsheetIntentRequired": "已收到表格附件。請明確說明它是庫存檔案(例如:\"這是庫存檔案,請分析\")後再繼續;系統不會只根據副檔名猜測用途。",
"shippingNoticeRefreshDone": "已重新整理目前任務狀態。",
"shippingNoticeRetryUploadAction": "重試上傳貨代",
"shippingNoticeRetryUploadQueued": "已重新觸發上傳,請稍後重新整理查看結果。",
"shippingNoticeRetryUploadFailed": "重試上傳失敗。",
"shippingNoticePasteHint": "請在輸入框貼上庫存小表內容後送出。",
"shippingNoticeDecisionDone": "操作已完成。",
"shippingNoticePrompt": {
"inventory": {
"prefix": "我已上傳庫存檔案",
"prefixWithFile": "我已上傳庫存檔案《{fileName}》",
"prefixBatch": "我已為批次 {batchNo} 上傳本批庫存快照",
"prefixBatchWithFile": "我已為批次 {batchNo} 上傳本批庫存快照《{fileName}》",
"mapInferSuggested": "{prefix}。請繼續處理庫存欄位映射;如果系統已辨識出完整映射,請直接套用映射,並只用一句話說明已進入庫存欄位確認。禁止在正文列出操作選單、編號選項、按鈕清單或「請選擇以下方式」;可點擊動作由系統按鈕展示。",
"mapInferPending": "{prefix}。請繼續解析庫存欄位映射,並在取得可用映射後只用一句話說明已進入庫存欄位確認。禁止在正文列出操作選單、編號選項、按鈕清單或「請選擇以下方式」;可點擊動作由系統按鈕展示。",
"alignReview": "{prefix}。請只用一句話說明已進入庫存欄位確認,並提示我檢查欄位後繼續。禁止在正文列出操作選單、編號選項、按鈕清單或「請選擇以下方式」;可點擊動作由系統按鈕展示。",
"default": "{prefix}。請繼續處理庫存匯入,並只說明目前狀態。禁止在正文列出操作選單、編號選項、按鈕清單或「請選擇以下方式」;可點擊動作由系統按鈕展示。"
},
"notice": {
"fileLabelSingleFile": "《{fileName}》",
"fileLabelMulti": "{fileCount} 份發貨通知",
@@ -151,29 +155,12 @@
"batchLabel": "批次 {batchNo}",
"taskLabel": "當前任務 {taskId}",
"taskList": "任務列表:{taskIds}。",
"autoInventoryAction": "上傳庫存並進入欄位對齊",
"autoNoticeAction": "建立任務並解析發貨通知",
"autoSpreadsheetAction": "請說明這是訂單檔案還是庫存檔案",
"multiTask": "{summary}。{taskListText}請只處理目前焦點任務。先讀取目前任務狀態;如果仍待解析,請解析發貨通知並儲存結果;如果已進入後續步驟,請直接說明目前進度和下一步。不要再次詢問我是否開始解析,也不要整批迴圈處理其他任務。",
"singleTask": "{summary}。請先讀取目前任務狀態;如果仍待解析,請解析發貨通知並儲存結果;如果已進入後續步驟,請直接說明目前進度和下一步。不要再次詢問我是否開始解析。"
}
},
"shippingNoticeMapping": {
"inventoryHeaders": "庫存表頭",
"headerRow": "表頭列:{row}",
"sample": "樣例",
"orderDetails": "訂單明細",
"orderRowCount": "訂單行數:{count}",
"orderPartNumberPreview": "內部料號(前{count}):{partNumbers}",
"partNumberColumnRequired": "內部料號欄位(必填)",
"availableQtyColumnRequired": "可用數量欄位(必填)",
"reservationIdColumnRequired": "Reservation ID 欄位(必填)",
"selectHeader": "請選擇表頭欄位",
"reupload": "重新上傳",
"applying": "套用中...",
"applyAndParse": "套用映射並解析",
"empty": "(空)",
"unrecognized": "(未辨識)"
},
"shippingParsedResult": {
"title": "訂單解析結果",
"statusBlocked": "流轉阻斷",
@@ -299,8 +286,6 @@
"shortageNoDetails": "任務 {taskId} 目前未發現庫存缺口。",
"diagnosisInventoryRpaTitle": "庫存 RPA 未返回可用庫存快照。",
"diagnosisInventoryRpaAdvice": "建議先重試庫存抓取;若外部系統不可用,可人工上傳庫存檔。",
"diagnosisAlignReviewTitle": "庫存欄位映射需要人工確認。",
"diagnosisAlignReviewAdvice": "建議確認 SKU、Reservation ID、可用數量等欄位映射,避免匹配錯料。",
"diagnosisParseReviewTitle": "通知單解析信心不足,需要覆核單頭或明細。",
"diagnosisParseReviewAdvice": "建議核對客戶、PO、需求日期和訂單行後再繼續。",
"diagnosisReservationRequiredTitle": "缺少 Reservation ID,無法按預訂單鎖定庫存。",
@@ -362,7 +347,6 @@
"blockedUploadRetryable": "上傳失敗可重試",
"suggestedAction": "建議動作:",
"suggestShortageActions": "查看缺口 / 返回修訂 / 重新匹配",
"suggestConfirmMapping": "確認欄位對齊後繼續匹配",
"suggestReviewParse": "核對解析結果並確認或修訂",
"suggestRetryStep": "查看卡點後重試目前步驟",
"suggestViewOnly": "查看匯出檔或回執",
@@ -423,7 +407,7 @@
"noticeParse": "通知解析",
"parseConfirm": "確認解析",
"inventoryPrepare": "庫存準備",
"alignConfirm": "確認欄位對齊",
"alignConfirm": "檢核庫存",
"inventoryMatch": "庫存匹配",
"shortageHandle": "缺口處理",
"generateExcel": "生成 Excel",
@@ -449,7 +433,7 @@
"noticeSubmit": "提交通知",
"parseConfirm": "確認解析",
"inventoryPrepare": "獲取庫存",
"alignConfirm": "確認欄位對齊",
"alignConfirm": "檢核庫存",
"matchInventory": "匹配庫存",
"generateFile": "生成發貨文件",
"uploadFreight": "上傳貨代"
+109 -4
View File
@@ -1,7 +1,34 @@
{
"generic": "請求失敗。",
"codes": {
"SHIPPING_ORDER_SCHEMA_NOT_FOUND": "尚未初始化訂單範本。",
"SHIPPING_ORDER_SCHEMA_EXISTS": "訂單範本已存在。",
"SHIPPING_ORDER_SCHEMA_DRAFT_EXISTS": "已有訂單範本草稿,請先完成或發布目前草稿。",
"SHIPPING_ORDER_SCHEMA_VERSION_INVALID": "訂單欄位版本設定無效。",
"SHIPPING_ORDER_SCHEMA_LOCK_VERSION_REQUIRED": "訂單欄位草稿缺少版本鎖,請重新整理頁面後再試。",
"SHIPPING_ORDER_SCHEMA_VERSION_CONFLICT": "訂單欄位草稿已被其他管理員修改,頁面將重新整理為最新版本。",
"SHIPPING_ORDER_SCHEMA_VERSION_IMMUTABLE": "已發布的訂單欄位版本不可修改。",
"SHIPPING_ORDER_SCHEMA_VERSION_NOT_FOUND": "找不到訂單欄位版本。",
"SHIPPING_ORDER_SCHEMA_VERSION_DELETE_BLOCKED": "只有草稿版本可以刪除。",
"SHIPPING_ORDER_SCHEMA_PUBLISH_INVALID": "目前訂單欄位版本不能發布。",
"SHIPPING_ORDER_SCHEMA_PUBLISH_DEPENDENCY_BLOCKED": "目前版本移除了仍被庫存路由、解析設定或 Excel 範本引用的訂單欄位,請先遷移下游設定。",
"SHIPPING_ORDER_SCHEMA_NOT_PUBLISHED": "尚未發布可用的訂單欄位版本。",
"SHIPPING_ORDER_FIELD_INVALID": "訂單欄位編碼、範圍或類型無效。",
"SHIPPING_ORDER_FIELD_NOT_FOUND": "找不到訂單欄位。",
"SHIPPING_ORDER_FIELD_IMMUTABLE": "訂單欄位發布後,編碼、範圍和類型不可修改。",
"SHIPPING_ORDER_FIELD_CONFLICT": "訂單欄位編碼已存在。",
"SHIPPING_ORDER_FIELD_RETIRE_BLOCKED": "該訂單欄位仍被草稿版本引用,不能退役。",
"AUTH_UNAUTHORIZED": "請先登入。",
"SHIPPING_CUSTOMER_DELETE_REASON_REQUIRED": "永久刪除客戶必須填寫原因。",
"SHIPPING_CUSTOMER_DELETE_CONFIRMATION_INVALID": "刪除確認的客戶簡碼不正確。",
"SHIPPING_CUSTOMER_DELETE_BLOCKED": "客戶存在業務或稽核引用,不能永久刪除。",
"SHIPPING_CUSTOMER_MERGED_LOCKED": "客戶已合併,不能再用於新業務或編輯。",
"SHIPPING_CUSTOMER_MERGE_TARGET_REQUIRED": "請選擇合併目標客戶。",
"SHIPPING_CUSTOMER_MERGE_TARGET_INVALID": "合併目標客戶必須處於啟用狀態。",
"SHIPPING_CUSTOMER_MERGE_SAME_CUSTOMER": "來源客戶和目標客戶不能相同。",
"SHIPPING_CUSTOMER_MERGE_SOURCE_ALREADY_MERGED": "來源客戶已完成合併。",
"SHIPPING_CUSTOMER_MERGE_REASON_REQUIRED": "合併客戶必須填寫原因。",
"SHIPPING_CUSTOMER_MERGE_CONFIRMATION_INVALID": "合併確認的來源客戶簡碼不正確。",
"AUTH_INCORRECT_PASSWORD": "密碼錯誤",
"AUTH_INCORRECT_CURRENT_PASSWORD": "當前密碼不正確",
"AUTH_USER_NOT_FOUND": "用戶不存在",
@@ -10,6 +37,80 @@
"RESOURCE_NOT_FOUND": "請求的資源不存在。",
"RESOURCE_CONFLICT": "請求衝突,請刷新後重試。",
"VALIDATION_INVALID_PARAM": "請求參數不合法。",
"SHIPPING_INVENTORY_EXTERNAL_MAPPING_NOT_FOUND": "外部系統倉庫對應不存在。",
"SHIPPING_INVENTORY_EXTERNAL_MAPPING_CONFLICT": "此庫存來源和貨代倉庫已存在啟用的外部系統倉庫對應。",
"SHIPPING_INVENTORY_SOURCE_CONFIG_INVALID": "庫存來源的報表路徑、查詢參數或別名設定不合法。",
"SHIPPING_RPA_PROFILE_CONFIG_INVALID": "貨代登入連線設定不合法,目前僅支援帳號密碼登入。",
"SHIPPING_EXCEL_TEMPLATE_ASSET_INVALID": "Excel 範本檔案無效或無法讀取。",
"SHIPPING_EXCEL_TEMPLATE_DEFINITION_INVALID": "Excel 範本對應定義無效。",
"SHIPPING_EXCEL_TEMPLATE_DELETE_BLOCKED": "只有草稿 Excel 範本可以刪除。",
"SHIPPING_EXCEL_TEMPLATE_DRAFT_EXISTS": "該範本已有草稿版本,請先處理目前草稿。",
"SHIPPING_EXCEL_TEMPLATE_FIELD_INVALID": "Excel 範本欄位對應無效。",
"SHIPPING_EXCEL_TEMPLATE_IMMUTABLE": "已發佈或已退役的 Excel 範本不可修改。",
"SHIPPING_EXCEL_TEMPLATE_INVALID": "Excel 範本設定無效。",
"SHIPPING_EXCEL_TEMPLATE_NOT_FOUND": "找不到 Excel 範本。",
"SHIPPING_EXCEL_TEMPLATE_PUBLISH_INVALID": "目前 Excel 範本不能發佈。",
"SHIPPING_EXCEL_TEMPLATE_REQUIRED": "啟用庫存來源前必須綁定已發佈的 Excel 範本。",
"SHIPPING_EXCEL_TEMPLATE_RETIRE_BLOCKED": "Excel 範本仍被庫存來源引用,不能退役。",
"SHIPPING_EXCEL_TEMPLATE_RETIRE_INVALID": "目前 Excel 範本不能退役。",
"SHIPPING_EXCEL_TEMPLATE_TARGET_DUPLICATE": "Excel 範本存在重複的目標儲存格對應。",
"SHIPPING_EXPORT_ARCHIVE_EMPTY": "所選任務沒有可下載的匯出檔案。",
"SHIPPING_EXPORT_ARCHIVE_NOT_FOUND": "找不到可下載的匯出檔案。",
"SHIPPING_EXPORT_ARCHIVE_SELECTION_INVALID": "批次下載的任務選擇無效。",
"SHIPPING_EXPORT_ARCHIVE_TOO_LARGE": "單次批次下載最多支援 100 個任務。",
"SHIPPING_INVENTORY_PARSING_PROFILE_DELETE_BLOCKED": "只有草稿庫存解析設定可以刪除。",
"SHIPPING_INVENTORY_PARSING_PROFILE_IMMUTABLE": "已發佈或已退役的庫存解析設定不可修改。",
"SHIPPING_INVENTORY_PARSING_PROFILE_INVALID": "庫存解析設定無效。",
"SHIPPING_INVENTORY_PARSING_PROFILE_NOT_FOUND": "找不到庫存解析設定。",
"SHIPPING_INVENTORY_PARSING_PROFILE_PUBLISH_INVALID": "目前庫存解析設定不能發佈。",
"SHIPPING_INVENTORY_PARSING_PROFILE_REQUIRED": "啟用庫存來源前必須綁定已發佈的庫存解析設定。",
"SHIPPING_INVENTORY_PARSING_PROFILE_RETIRE_BLOCKED": "庫存解析設定仍被庫存來源引用,不能退役。",
"SHIPPING_INVENTORY_PARSING_PROFILE_RETIRE_INVALID": "目前庫存解析設定不能退役。",
"SHIPPING_INVENTORY_FIELD_CONFLICT": "庫存欄位名稱已存在。",
"SHIPPING_INVENTORY_FIELD_DELETE_BLOCKED": "該庫存欄位是核心欄位或仍被設定引用,不能刪除或停用。",
"SHIPPING_INVENTORY_FIELD_IMMUTABLE": "已停用庫存欄位不可編輯,核心欄位的資料格式和欄位用途不可修改。",
"SHIPPING_INVENTORY_FIELD_INVALID": "庫存欄位資訊不完整或格式不正確。",
"SHIPPING_INVENTORY_FIELD_NOT_FOUND": "找不到庫存欄位。",
"SHIPPING_INVENTORY_FIELD_RETIRE_BLOCKED": "該庫存欄位仍被設定引用,不能停用。",
"SHIPPING_INVENTORY_RULE_CONDITION_INVALID": "庫存路由規則條件無效。",
"SHIPPING_INVENTORY_RULE_CONDITIONS_REQUIRED": "庫存路由規則至少需要一個條件。",
"SHIPPING_INVENTORY_RULE_CONFLICT": "庫存路由規則名稱或優先順序衝突。",
"SHIPPING_INVENTORY_RULE_DELETE_BLOCKED": "只有草稿庫存路由規則可以刪除。",
"SHIPPING_INVENTORY_RULE_IMMUTABLE": "已發佈的庫存路由規則不可修改。",
"SHIPPING_INVENTORY_RULE_INVALID": "庫存路由規則設定無效。",
"SHIPPING_INVENTORY_RULE_NOT_FOUND": "找不到庫存路由規則。",
"SHIPPING_INVENTORY_RULE_PUBLISH_INVALID": "目前庫存路由規則不能發佈。",
"SHIPPING_INVENTORY_RULE_SOURCE_INVALID": "庫存路由規則引用了不存在或已停用的庫存來源。",
"SHIPPING_INVENTORY_RULE_RETIRE_INVALID": "目前庫存路由規則不能退役。",
"SHIPPING_INVENTORY_SOURCE_DELETE_BLOCKED": "庫存來源仍被業務資料引用,不能刪除。",
"SHIPPING_INVENTORY_SOURCE_NOT_FOUND": "找不到庫存來源。",
"SHIPPING_INVENTORY_SOURCE_ACTIVATION_REQUIRED": "請先完成測試匯出與啟用檢查,再啟用庫存站點。",
"SHIPPING_INVENTORY_SOURCE_ACTIVATION_BLOCKED": "庫存站點尚未完成正式執行檢查,暫時不能啟用。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_FILE_REQUIRED": "請選擇庫存樣本檔案。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_FILE_TOO_LARGE": "庫存樣本檔案超過 20 MB 限制。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_INVALID": "無法識別庫存樣本檔案,請檢查檔案格式與表頭。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_NOT_FOUND": "庫存檔案結構識別記錄不存在。",
"SHIPPING_INVENTORY_STRUCTURE_ANALYSIS_SELECTION_INVALID": "所選工作表、表頭或來源欄位不在庫存檔案識別結果中。",
"SHIPPING_TEMP_INVENTORY_CONTEXT_INVALID": "目前對話上下文無法處理臨時庫存檔案。",
"SHIPPING_TEMP_INVENTORY_ASSET_REQUIRED": "請先上傳庫存檔案。",
"SHIPPING_TEMP_INVENTORY_ASSET_NOT_FOUND": "找不到目前對話可用的庫存檔案。",
"SHIPPING_TEMP_INVENTORY_ASSET_NOT_READY": "庫存檔案仍在上傳中,請稍後再試。",
"SHIPPING_TEMP_INVENTORY_FILE_TYPE_INVALID": "臨時庫存檔案僅支援 .xls、.xlsx 或 .csv。",
"SHIPPING_TEMP_INVENTORY_FILE_TOO_LARGE": "臨時庫存檔案超過 20 MB 限制。",
"SHIPPING_TEMP_INVENTORY_ANALYSIS_INVALID": "無法識別庫存檔案結構,請檢查檔案格式與表頭。",
"SHIPPING_TEMP_INVENTORY_SESSION_NOT_FOUND": "臨時庫存會話不存在、已過期或無權存取。",
"SHIPPING_TEMP_INVENTORY_MAPPING_STATE_INVALID": "目前臨時庫存會話不能再提交欄位映射建議。",
"SHIPPING_TEMP_INVENTORY_MAPPING_INVALID": "庫存欄位映射建議無效、不完整,或包含不在檔案中的欄位。",
"SHIPPING_TEMP_INVENTORY_CONFIRMATION_INVALID": "臨時庫存確認條件不符合,請重新選擇已推薦的方案或映射。",
"SHIPPING_TEMP_INVENTORY_QUALITY_INVALID": "臨時庫存檔案未通過料號、預約號或可用庫存數量驗證。",
"SHIPPING_TEMP_INVENTORY_SESSION_EXPIRED": "臨時庫存會話已過期,請重新上傳檔案。",
"SHIPPING_TEMP_INVENTORY_TASK_NOT_FOUND": "目前對話中找不到可使用該臨時庫存的發貨任務。",
"SHIPPING_INVENTORY_CONFIGURATION_TEST_INVALID": "請在庫存站點停用狀態下執行測試匯出。", "SHIPPING_INVENTORY_CONFIGURATION_TEST_UNAVAILABLE": "RPA Worker 目前不可用,無法發起測試匯出。", "SHIPPING_INVENTORY_CONFIGURATION_TEST_NOT_FOUND": "庫存站點測試匯出記錄不存在。", "SHIPPING_INVENTORY_CONFIGURATION_TEST_NOT_READY": "測試匯出尚未完成,暫時不能確認解析方案。", "SHIPPING_INVENTORY_CONFIGURATION_TEST_STALE": "庫存站點設定已變更,請重新測試匯出。",
"SHIPPING_RPA_PROFILE_CONFLICT": "貨代登入設定名稱已存在。",
"SHIPPING_RPA_PROFILE_DELETE_BLOCKED": "貨代登入設定仍被庫存來源引用,不能刪除。",
"SHIPPING_RPA_PROFILE_DISABLE_BLOCKED": "貨代登入設定仍被啟用的庫存來源引用,不能停用。",
"SHIPPING_RPA_PROFILE_DISABLED": "啟用庫存來源前必須先啟用其貨代登入設定。",
"SHIPPING_RPA_PROFILE_NOT_FOUND": "找不到貨代登入設定。",
"USER_USERNAME_REQUIRED": "用戶名必填。",
"USER_USERNAME_EXISTS": "用戶名已存在。",
"USER_EMAIL_INVALID": "郵箱格式不正確。",
@@ -84,7 +185,8 @@
"SHIPPING_CUSTOMER_SHADOW_LABEL_REQUIRED": "請選擇標準客戶作為人工真值。",
"SHIPPING_CUSTOMER_CONFIRMATION_REQUIRED": "標準客戶尚未確認,請先選擇正式客戶。",
"SHIPPING_CUSTOMER_CONFIRMATION_CUSTOMER_REQUIRED": "請選擇標準客戶。",
"SHIPPING_CUSTOMER_CONFIRMATION_LEGACY_UNSUPPORTED": "該歷史任務暫不支援客戶確認。",
"SHIPPING_CUSTOMER_CASE_REQUIRED": "發貨任務缺少業務單關聯,無法確認客戶。",
"SHIPPING_NOTICE_REVISION_CASE_MISSING": "修訂目標任務缺少業務單關聯,無法建立修訂。",
"SHIPPING_CUSTOMER_INACTIVE": "所選客戶已停用。",
"SHIPPING_CUSTOMER_NUMBERED_CASE_LOCKED": "已編號業務單不能靜默更換客戶。",
"SHIPPING_FIELD_CONFLICT_NOT_FOUND": "訂單欄位衝突不存在。",
@@ -97,8 +199,6 @@
"SHIPPING_BUSINESS_NUMBER_CUSTOMER_REQUIRED": "請先確認標準客戶再產生業務編號。",
"SHIPPING_BUSINESS_NUMBER_CUSTOMER_INVALID": "客戶已停用或不存在,無法產生業務編號。",
"SHIPPING_BUSINESS_NUMBER_SHORT_CODE_INVALID": "客戶簡碼不符合 2-6 位大寫英文字母規則。",
"SHIPPING_HISTORICAL_TASK_NOT_FOUND": "歷史任務不存在。",
"SHIPPING_HISTORICAL_BACKFILL_INVALID": "該任務不符合歷史客戶回填條件。",
"SHIPPING_CUSTOMER_CORRECTION_TASK_REQUIRED": "請輸入待糾錯的技術號或業務號。",
"SHIPPING_CUSTOMER_CORRECTION_REASON_REQUIRED": "客戶糾錯必須填寫原因。",
"SHIPPING_CUSTOMER_CORRECTION_NUMBER_REQUIRED": "只有已編號業務單可執行客戶糾錯。",
@@ -106,6 +206,11 @@
"SHIPPING_CUSTOMER_CORRECTION_UNCHANGED": "更正客戶與目前客戶相同。",
"SHIPPING_CUSTOMER_CORRECTION_TASK_MISSING": "待糾錯任務或業務單不存在。",
"SHIPPING_CUSTOMER_CORRECTION_UPLOADED_BLOCKED": "任務已上傳貨代,請先完成外部作廢流程再糾錯。",
"SHIPPING_CUSTOMER_NOT_FOUND": "客戶不存在。", "SHIPPING_CUSTOMER_NAME_REQUIRED": "標準客戶名稱必填。", "SHIPPING_CUSTOMER_SHORT_CODE_INVALID": "客戶簡碼必須為 2-6 位英文字母。", "SHIPPING_CUSTOMER_SHORT_CODE_EXISTS": "客戶簡碼已存在。", "SHIPPING_CUSTOMER_STATUS_INVALID": "客戶狀態無效。", "SHIPPING_CUSTOMER_CONFLICT": "客戶資料衝突。", "SHIPPING_CUSTOMER_IDENTIFIER_TYPE_INVALID": "識別證據類型無效。", "SHIPPING_CUSTOMER_IDENTIFIER_VALUE_REQUIRED": "識別證據值必填。", "SHIPPING_CUSTOMER_EMAIL_INVALID": "客戶郵箱格式無效。", "SHIPPING_CUSTOMER_DOMAIN_INVALID": "客戶網域格式無效。", "SHIPPING_CUSTOMER_IDENTIFIER_STATUS_INVALID": "識別證據狀態無效。", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_FOUND": "識別證據不存在。", "SHIPPING_CUSTOMER_IDENTIFIER_EXISTS": "該識別證據已存在。", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_APPROVED": "只有已審核證據才能啟用自動匹配。", "SHIPPING_CUSTOMER_PUBLIC_DOMAIN_AUTO_MATCH_FORBIDDEN": "公共郵箱網域不能用於自動匹配。", "SHIPPING_CUSTOMER_EXTERNAL_REF_CONFLICT": "歷史客戶鍵已綁定其他客戶。", "SHIPPING_CUSTOMER_IMPORT_FILE_REQUIRED": "請選擇匯入檔案。", "SHIPPING_CUSTOMER_IMPORT_FILE_TYPE_INVALID": "僅支援 .xlsx 檔案。", "SHIPPING_CUSTOMER_IMPORT_FILE_EMPTY": "匯入檔案為空。", "SHIPPING_CUSTOMER_IMPORT_FILE_TOO_LARGE": "匯入檔案超過 5 MB。", "SHIPPING_CUSTOMER_IMPORT_FILE_INVALID": "匯入 Excel 無效。", "SHIPPING_CUSTOMER_IMPORT_SHEET_MISSING": "匯入檔案缺少必要 Sheet。", "SHIPPING_CUSTOMER_IMPORT_COLUMNS_MISSING": "匯入檔案缺少必要欄位。", "SHIPPING_CUSTOMER_IMPORT_KEY_REQUIRED": "歷史客戶鍵必填。", "SHIPPING_CUSTOMER_IMPORT_DUPLICATE_KEY": "同一來源存在重複歷史客戶鍵。", "SHIPPING_CUSTOMER_IMPORT_SHORT_CODE_CONFLICT": "客戶簡碼與現有客戶衝突。", "SHIPPING_CUSTOMER_IMPORT_NAME_MATCH": "客戶名稱可能與現有客戶重複。", "SHIPPING_CUSTOMER_IMPORT_IDENTIFIER_CUSTOMER_MISSING": "識別證據找不到對應客戶。", "SHIPPING_CUSTOMER_IMPORT_NOT_FOUND": "匯入批次不存在。", "SHIPPING_CUSTOMER_IMPORT_ROW_NOT_FOUND": "匯入行不存在。", "SHIPPING_CUSTOMER_IMPORT_DECISION_INVALID": "匯入行處理動作無效。", "SHIPPING_CUSTOMER_IMPORT_TARGET_REQUIRED": "更新或合併時必須選擇目標客戶。", "SHIPPING_CUSTOMER_IMPORT_HAS_ERRORS": "匯入批次存在阻斷錯誤。", "SHIPPING_CUSTOMER_IMPORT_DECISIONS_REQUIRED": "請先處理全部警告行。", "SHIPPING_CUSTOMER_IMPORT_ALREADY_PUBLISHED": "匯入批次已發佈。", "SHIPPING_CUSTOMER_IMPORT_UPLOAD_CONFLICT": "上傳匯入批次時發生衝突。", "SHIPPING_CUSTOMER_IMPORT_PUBLISH_CONFLICT": "發佈匯入批次時發生資料衝突。"
"SHIPPING_ORDER_EXTRACTION_NOT_FOUND": "訂單解析記錄不存在或無權存取。",
"SHIPPING_ORDER_CUSTOMER_REQUIRED": "請選擇標準客戶。",
"SHIPPING_ORDER_CUSTOMER_ROLE_INVALID": "客戶角色無效。",
"SHIPPING_ORDER_CUSTOMER_MATCH_NOT_FOUND": "訂單客戶匹配記錄不存在。",
"SHIPPING_ORDER_CUSTOMER_SITE_INVALID": "請選擇屬於該客戶的有效送貨站點。",
"SHIPPING_CUSTOMER_NOT_FOUND": "客戶不存在。", "SHIPPING_CUSTOMER_CHANGE_REASON_REQUIRED": "修改客戶狀態、簡碼或自動匹配授權時必須填寫原因。", "SHIPPING_CUSTOMER_NAME_REQUIRED": "標準客戶名稱必填。", "SHIPPING_CUSTOMER_SHORT_CODE_INVALID": "客戶簡碼必須為 2-6 位英文字母。", "SHIPPING_CUSTOMER_SHORT_CODE_EXISTS": "客戶簡碼已存在。", "SHIPPING_CUSTOMER_STATUS_INVALID": "客戶狀態無效。", "SHIPPING_CUSTOMER_CONFLICT": "客戶資料衝突。", "SHIPPING_CUSTOMER_IDENTIFIER_TYPE_INVALID": "識別證據類型無效。", "SHIPPING_CUSTOMER_IDENTIFIER_VALUE_REQUIRED": "識別證據值必填。", "SHIPPING_CUSTOMER_EMAIL_INVALID": "客戶郵箱格式無效。", "SHIPPING_CUSTOMER_DOMAIN_INVALID": "客戶網域格式無效。", "SHIPPING_CUSTOMER_IDENTIFIER_STATUS_INVALID": "識別證據狀態無效。", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_FOUND": "識別證據不存在。", "SHIPPING_CUSTOMER_IDENTIFIER_EXISTS": "該識別證據已存在。", "SHIPPING_CUSTOMER_IDENTIFIER_NOT_APPROVED": "只有已審核證據才能啟用自動匹配。", "SHIPPING_CUSTOMER_PUBLIC_DOMAIN_AUTO_MATCH_FORBIDDEN": "公共郵箱網域不能用於自動匹配。", "SHIPPING_CUSTOMER_EXTERNAL_REF_CONFLICT": "歷史客戶鍵已綁定其他客戶。", "SHIPPING_CUSTOMER_IMPORT_FILE_REQUIRED": "請選擇匯入檔案。", "SHIPPING_CUSTOMER_IMPORT_FILE_TYPE_INVALID": "僅支援 .xlsx 檔案。", "SHIPPING_CUSTOMER_IMPORT_FILE_EMPTY": "匯入檔案為空。", "SHIPPING_CUSTOMER_IMPORT_FILE_TOO_LARGE": "匯入檔案超過 5 MB。", "SHIPPING_CUSTOMER_IMPORT_FILE_INVALID": "匯入 Excel 無效。", "SHIPPING_CUSTOMER_IMPORT_SHEET_MISSING": "匯入檔案缺少必要 Sheet。", "SHIPPING_CUSTOMER_IMPORT_COLUMNS_MISSING": "匯入檔案缺少必要欄位。", "SHIPPING_CUSTOMER_IMPORT_KEY_REQUIRED": "歷史客戶鍵必填。", "SHIPPING_CUSTOMER_IMPORT_DUPLICATE_KEY": "同一來源存在重複歷史客戶鍵。", "SHIPPING_CUSTOMER_IMPORT_SHORT_CODE_CONFLICT": "客戶簡碼與現有客戶衝突。", "SHIPPING_CUSTOMER_IMPORT_NAME_MATCH": "客戶名稱可能與現有客戶重複。", "SHIPPING_CUSTOMER_IMPORT_IDENTIFIER_CUSTOMER_MISSING": "識別證據找不到對應客戶。", "SHIPPING_CUSTOMER_IMPORT_NOT_FOUND": "匯入批次不存在。", "SHIPPING_CUSTOMER_IMPORT_ROW_NOT_FOUND": "匯入行不存在。", "SHIPPING_CUSTOMER_IMPORT_DECISION_INVALID": "匯入行處理動作無效。", "SHIPPING_CUSTOMER_IMPORT_TARGET_REQUIRED": "更新或合併時必須選擇目標客戶。", "SHIPPING_CUSTOMER_IMPORT_HAS_ERRORS": "匯入批次存在阻斷錯誤。", "SHIPPING_CUSTOMER_IMPORT_DECISIONS_REQUIRED": "請先處理全部警告行。", "SHIPPING_CUSTOMER_IMPORT_ALREADY_PUBLISHED": "匯入批次已發佈。", "SHIPPING_CUSTOMER_IMPORT_UPLOAD_CONFLICT": "上傳匯入批次時發生衝突。", "SHIPPING_CUSTOMER_IMPORT_PUBLISH_CONFLICT": "發佈匯入批次時發生資料衝突。"
}
}
+6 -1
View File
@@ -168,6 +168,12 @@
"loadFailed": "載入失敗",
"openChat": "在 Chat 中繼續",
"download": "下載 Excel",
"downloadBatch": "下載本批次 ZIP",
"selectAllVisible": "全選目前結果",
"selectedCount": "已選 {count} 個任務",
"downloadSelected": "下載所選 ZIP",
"selectForDownload": "選擇任務 {taskNo} 用於批次下載",
"archiveDownloadFailed": "批次下載失敗,請重新整理任務後再試。",
"lines": "發貨明細",
"qty": "數量",
"columns": {
@@ -224,7 +230,6 @@
"created": "已建立",
"parsed": "已解析",
"pendingReview": "待覆核",
"alignReview": "待確認欄位",
"shortageReview": "庫存缺口",
"waitingInventory": "等待庫存",
"inventoryReady": "庫存就緒",