feat(shipping-notice): 添加货代履约策略管理功能,支持策略创建、发布及版本控制,增强订单冻结和预约管理逻辑
This commit is contained in:
1 parent
abd8fc1e16
commit
d62f5107b2
82 files changed
+4914
-514
No files matched your search
@@ -157,7 +157,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
path: "shipping-notice",
|
||||
name: "AdminShippingInventory",
|
||||
component: ShippingInventoryPage,
|
||||
meta: { requiresAdmin: true, adminModule: "shipping_inventory", adminSubModule: 'inventory', title: "库存配置" },
|
||||
meta: { requiresAdmin: true, adminModule: "shipping_inventory", adminSubModule: 'inventory', title: "货代管理" },
|
||||
},
|
||||
{
|
||||
path: "shipping-identity-rules",
|
||||
@@ -169,7 +169,7 @@ export const adminRoutes: RouteRecordRaw[] = [
|
||||
path: "shipping-order-extraction-runs",
|
||||
name: "AdminShippingOrderExtractionRuns",
|
||||
component: ShippingOrderExtractionRunsPage,
|
||||
meta: { requiresAdmin: true, adminModule: "shipping_inventory", adminSubModule: 'order_extraction_runs', title: "订单识别运行" },
|
||||
meta: { requiresAdmin: true, adminModule: "shipping_inventory", adminSubModule: 'order_extraction_runs', title: "识别任务" },
|
||||
},
|
||||
{
|
||||
path: "shipping-order-document-profiles",
|
||||
|
||||
@@ -10,6 +10,9 @@ import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
import type {
|
||||
CreateOrderProfileFromSampleInput,
|
||||
OrderProfileSampleDocument,
|
||||
CoordinateReconstructionPreview,
|
||||
CoordinateReconstructionSuggestion,
|
||||
CoordinateReconstructionSettings,
|
||||
OrderProfileSampleIntake,
|
||||
OrderProfileSamplePreview,
|
||||
ShippingOrderDocumentProfile,
|
||||
@@ -39,12 +42,50 @@ export const getOrderProfileSampleStatus = (intakeNo: string) =>
|
||||
auth(),
|
||||
);
|
||||
|
||||
/** 删除可安全回收的专用模板样本;历史业务附件与盲测样本由服务端保护。 */
|
||||
export const deleteOrderProfileSample = (intakeNo: string) =>
|
||||
requestJson<void>(
|
||||
`/api/admin/shipping-notice/order-document-profile-samples/intakes/${encodeURIComponent(intakeNo)}`,
|
||||
{ method: 'DELETE', ...auth() },
|
||||
);
|
||||
|
||||
/** 读取一个样本文档的网格预览,不返回 HTML 或 bbox。 */
|
||||
export const getOrderProfileSampleTables = (documentId: number) =>
|
||||
requestJson<OrderProfileSamplePreview>(
|
||||
`/api/admin/shipping-notice/order-document-profile-samples/${documentId}/tables`, auth(),
|
||||
);
|
||||
|
||||
/** 以管理员确认的相对列边界生成坐标重建候选;结果始终待人工审核。 */
|
||||
export const previewOrderProfileCoordinateReconstruction = (
|
||||
documentId: number, tableId: string, coordinateReconstruction: CoordinateReconstructionSettings,
|
||||
) => requestJson<CoordinateReconstructionPreview>(
|
||||
'/api/admin/shipping-notice/order-document-profile-samples/coordinate-reconstruction-preview', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ document_id: documentId, table_id: tableId, coordinate_reconstruction: coordinateReconstruction }),
|
||||
...jsonAuth(),
|
||||
},
|
||||
);
|
||||
|
||||
/** 从冻结字符坐标建议全部或指定物理行;rowOffset 省略时保持原有全量识别。 */
|
||||
export const suggestOrderProfileCoordinateReconstruction = (
|
||||
documentId: number, tableId: string, rowOffset?: number,
|
||||
) =>
|
||||
requestJson<CoordinateReconstructionSuggestion>(
|
||||
'/api/admin/shipping-notice/order-document-profile-samples/coordinate-reconstruction-suggestion', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ document_id: documentId, table_id: tableId, row_offset: rowOffset }),
|
||||
...jsonAuth(),
|
||||
},
|
||||
);
|
||||
|
||||
/** 为扫描 PDF 生成 OCR 坐标证据;随后仍必须由管理员审核重建网格。 */
|
||||
export const generateOrderProfileOcrCoordinateEvidence = (documentId: number, tableId: string) =>
|
||||
requestJson<{ document_id: number; table_id: string; source: 'ocr' }>(
|
||||
'/api/admin/shipping-notice/order-document-profile-samples/ocr-coordinate-evidence', {
|
||||
method: 'POST', body: JSON.stringify({ document_id: documentId, table_id: tableId }), ...jsonAuth(),
|
||||
},
|
||||
);
|
||||
|
||||
/** 由真实样本和结构化列选择创建 Profile 草稿。 */
|
||||
export const createOrderProfileFromSample = (payload: CreateOrderProfileFromSampleInput) =>
|
||||
requestJson<ShippingOrderDocumentProfile>('/api/admin/shipping-notice/order-document-profiles/from-sample', {
|
||||
|
||||
@@ -16,6 +16,8 @@ import type {
|
||||
ShippingOrderSchemaVersionDiff,
|
||||
ShippingOrderSchemaVersionPage,
|
||||
ShippingOrderSchemaVersionUsage,
|
||||
ShippingFulfillmentPolicy,
|
||||
ShippingFulfillmentPolicyState,
|
||||
} from '../types/shipping-order-schema.types';
|
||||
|
||||
const auth = () => ({ headers: getAuthHeaders() });
|
||||
@@ -143,3 +145,21 @@ export const publishShippingOrderSchemaDraft = (versionId: number, expectedLockV
|
||||
`/api/admin/shipping-order-schema/versions/${versionId}/publish`,
|
||||
{ method: 'POST', body: JSON.stringify({ expected_lock_version: expectedLockVersion }), ...jsonAuth() },
|
||||
);
|
||||
|
||||
/** 读取受控履约能力目录及策略版本,页面不提供任意表达式配置。 */
|
||||
export const getShippingFulfillmentPolicyState = () =>
|
||||
requestJson<ShippingFulfillmentPolicyState>('/api/admin/shipping-fulfillment-policies', auth());
|
||||
|
||||
/** 创建按稳定字段 ID 绑定的下一履约策略草稿。 */
|
||||
export const createShippingFulfillmentPolicyDraft = (payload: {
|
||||
field_bindings: Array<{ capability_code: string; field_id: string }>;
|
||||
change_note?: string;
|
||||
}) => requestJson<ShippingFulfillmentPolicy>('/api/admin/shipping-fulfillment-policies', {
|
||||
method: 'POST', body: JSON.stringify(payload), ...jsonAuth(),
|
||||
});
|
||||
|
||||
/** 显式发布策略草稿;服务端原子退役上一发布版本。 */
|
||||
export const publishShippingFulfillmentPolicy = (policyId: number, expectedLockVersion: number) =>
|
||||
requestJson<ShippingFulfillmentPolicy>(`/api/admin/shipping-fulfillment-policies/${policyId}/publish`, {
|
||||
method: 'POST', body: JSON.stringify({ expected_lock_version: expectedLockVersion }), ...jsonAuth(),
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/admin/components/AdminNav.vue
|
||||
* 管理后台左侧导航,使用子路由跳转。
|
||||
* 管理后台左侧导航,在模块原始顺序中渲染货代手风琴、企微和报表二级菜单。
|
||||
* 依赖:admin-nav.store、modules 常量、vue-router。
|
||||
* 逻辑:报表/企微子菜单默认折叠;当前路由落在对应模块时自动展开以便看到激活项。
|
||||
*/
|
||||
@@ -10,13 +10,15 @@ 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, Warehouse
|
||||
Settings2, Megaphone, MessageCircleQuestion, Link2, Users, ShieldCheck, BarChart2, AppWindow, Warehouse,
|
||||
ChevronDown, ChevronRight
|
||||
} from 'lucide-vue-next';
|
||||
import type { Component } from 'vue';
|
||||
import { config } from '@/config';
|
||||
import { ADMIN_MODULE_METAS, ADMIN_REPORT_TABLES, SHIPPING_CONFIG_SUB_MODULE_METAS } from '../constants/modules';
|
||||
import { useAdminNavStore } from '../stores/admin-nav.store';
|
||||
import type { AdminModuleId, ShippingConfigSubModuleId } from '../types/admin.types';
|
||||
import type { ShippingManagementGroupKey } from '../stores/admin-nav.store';
|
||||
import type { AdminModuleId } from '../types/admin.types';
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
@@ -45,18 +47,13 @@ const visibleModules = computed(() =>
|
||||
ADMIN_MODULE_METAS.filter((item) => config.admin.modules[item.configKey] !== false),
|
||||
);
|
||||
|
||||
const standardModules = computed(() =>
|
||||
visibleModules.value.filter((item) => item.id !== 'wecom' && item.id !== 'shipping_inventory'),
|
||||
);
|
||||
|
||||
const isModuleActive = (moduleId: AdminModuleId): boolean =>
|
||||
route.meta.adminModule === moduleId;
|
||||
|
||||
const isReportsActive = computed(() => route.meta.adminModule === 'reports');
|
||||
const isWecomActive = computed(() => route.meta.adminModule === 'wecom');
|
||||
const isShippingConfigActive = computed(() => route.meta.adminModule === 'shipping_inventory');
|
||||
const isShippingConfigSubModuleActive = (subModule: ShippingConfigSubModuleId): boolean =>
|
||||
route.meta.adminSubModule === subModule;
|
||||
const isShippingManagementActive = computed(() => route.meta.adminModule === 'shipping_inventory');
|
||||
const shippingNavGroups = [...new Set(SHIPPING_CONFIG_SUB_MODULE_METAS.map((item) => item.groupKey))];
|
||||
|
||||
const wecomSubRoutes = [
|
||||
{ name: 'AdminWecomSettings', labelKey: 'admin.wecom.nav.settings' },
|
||||
@@ -68,8 +65,24 @@ const navigateWecom = (routeName: string): void => {
|
||||
router.push({ name: routeName });
|
||||
};
|
||||
|
||||
const navigateShippingConfig = (routeName: string): void => {
|
||||
router.push({ name: routeName });
|
||||
/** 判断货代二级菜单当前项;综合工作台按 section 深链高亮,库存字段目录归入库存解析。 */
|
||||
const isShippingNavActive = (item: typeof SHIPPING_CONFIG_SUB_MODULE_METAS[number]): boolean => {
|
||||
if (route.name !== item.routeName) return false;
|
||||
if (!item.query) return true;
|
||||
const section = typeof route.query.section === 'string' ? route.query.section : 'orderSchema';
|
||||
if (item.query.section === 'parsing') return section === 'parsing' || section === 'inventoryFields';
|
||||
return section === item.query.section;
|
||||
};
|
||||
|
||||
/** 打开货代独立页面或综合工作台区段,保留可收藏的 section 深链。 */
|
||||
const navigateShipping = (item: typeof SHIPPING_CONFIG_SUB_MODULE_METAS[number]): void => {
|
||||
router.push({ name: item.routeName, query: item.query });
|
||||
};
|
||||
|
||||
/** 返回当前货代页面所在分组,用于路由进入时只展开对应手风琴。 */
|
||||
const currentShippingGroup = (): ShippingManagementGroupKey | null => {
|
||||
const currentItem = SHIPPING_CONFIG_SUB_MODULE_METAS.find(isShippingNavActive);
|
||||
return currentItem?.groupKey ?? null;
|
||||
};
|
||||
|
||||
const getReportTableLabel = (table: string): string => {
|
||||
@@ -88,7 +101,7 @@ const navigateReport = (table: string): void => {
|
||||
};
|
||||
|
||||
/**
|
||||
* 进入报表/企微模块时自动展开子菜单,避免当前页在折叠状态下不可见。
|
||||
* 进入报表、企微或货代模块时自动展开子菜单,避免当前页在折叠状态下不可见。
|
||||
*/
|
||||
watch(
|
||||
isReportsActive,
|
||||
@@ -107,12 +120,22 @@ watch(
|
||||
);
|
||||
|
||||
watch(
|
||||
isShippingConfigActive,
|
||||
isShippingManagementActive,
|
||||
(active) => {
|
||||
if (active) navStore.shippingConfigExpanded = true;
|
||||
if (!active) return;
|
||||
navStore.shippingManagementExpanded = true;
|
||||
navStore.shippingManagementGroup = currentShippingGroup();
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
watch(
|
||||
() => [route.name, route.query.section],
|
||||
() => {
|
||||
if (isShippingManagementActive.value) navStore.shippingManagementGroup = currentShippingGroup();
|
||||
},
|
||||
);
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -121,91 +144,106 @@ watch(
|
||||
:class="navStore.sidebarCollapsed ? 'w-0 md:w-20' : 'w-full md:w-64'"
|
||||
>
|
||||
<nav class="flex md:flex-col p-3 gap-1 overflow-x-auto md:overflow-visible no-scrollbar">
|
||||
<button
|
||||
v-for="item in standardModules"
|
||||
:key="item.id"
|
||||
type="button"
|
||||
class="admin-nav-btn group"
|
||||
:class="{ 'admin-nav-btn--active': isModuleActive(item.id) }"
|
||||
:title="navStore.sidebarCollapsed ? t(item.labelKey) : ''"
|
||||
@click="navigateModule(item.routeName)"
|
||||
>
|
||||
<component
|
||||
:is="iconMap[item.id]"
|
||||
class="w-5 h-5 transition-transform group-hover:scale-110 flex-shrink-0"
|
||||
:class="isModuleActive(item.id) ? 'text-brand-600' : 'text-muted group-hover:text-secondary'"
|
||||
/>
|
||||
<span :class="navStore.sidebarCollapsed ? 'md:hidden' : ''">{{ t(item.labelKey) }}</span>
|
||||
<span
|
||||
v-if="navStore.badgeForModule(item.id) && !navStore.sidebarCollapsed"
|
||||
class="ml-auto bg-red-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full shadow-sm"
|
||||
>
|
||||
{{ navStore.badgeForModule(item.id) }}
|
||||
</span>
|
||||
<div
|
||||
v-if="isModuleActive(item.id)"
|
||||
class="absolute left-0 top-1/2 -translate-y-1/2 w-1 h-6 bg-brand-600 rounded-r-full"
|
||||
/>
|
||||
</button>
|
||||
|
||||
<div v-if="config.admin.modules.wecom !== false" class="flex flex-col flex-shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
class="admin-nav-btn group justify-between"
|
||||
:class="{ 'admin-nav-btn--active': isWecomActive }"
|
||||
@click="navStore.wecomExpanded = !navStore.wecomExpanded"
|
||||
>
|
||||
<div class="flex items-center gap-3">
|
||||
<Link2 class="w-5 h-5 flex-shrink-0" :class="isWecomActive ? 'text-brand-600' : 'text-muted'" />
|
||||
<span :class="navStore.sidebarCollapsed ? 'md:hidden' : ''">{{ t('admin.nav.wecom') }}</span>
|
||||
</div>
|
||||
</button>
|
||||
<div
|
||||
v-if="navStore.wecomExpanded && !navStore.sidebarCollapsed"
|
||||
class="pl-4 space-y-1 mt-1 border-l-2 border-subtle ml-6"
|
||||
>
|
||||
<template v-for="item in visibleModules" :key="item.id">
|
||||
<div v-if="item.id === 'shipping_inventory'" class="flex flex-col flex-shrink-0">
|
||||
<button
|
||||
v-for="sub in wecomSubRoutes"
|
||||
:key="sub.name"
|
||||
type="button"
|
||||
class="admin-nav-subitem"
|
||||
:class="{ 'admin-nav-subitem--active': route.name === sub.name }"
|
||||
@click="navigateWecom(sub.name)"
|
||||
class="admin-nav-btn group justify-between"
|
||||
:class="{ 'admin-nav-btn--active': isShippingManagementActive }"
|
||||
:title="navStore.sidebarCollapsed ? t(item.labelKey) : ''"
|
||||
@click="navStore.shippingManagementExpanded = !navStore.shippingManagementExpanded"
|
||||
>
|
||||
{{ t(sub.labelKey) }}
|
||||
<div class="flex items-center gap-3">
|
||||
<Warehouse class="w-5 h-5 flex-shrink-0" :class="isShippingManagementActive ? 'text-brand-600' : 'text-muted'" />
|
||||
<span :class="navStore.sidebarCollapsed ? 'md:hidden' : ''">{{ t(item.labelKey) }}</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="config.admin.modules.shipping_inventory !== false" class="flex flex-col flex-shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
class="admin-nav-btn group justify-between"
|
||||
:class="{ 'admin-nav-btn--active': isShippingConfigActive }"
|
||||
:title="navStore.sidebarCollapsed ? t('admin.nav.shippingConfig') : ''"
|
||||
@click="navStore.shippingConfigExpanded = !navStore.shippingConfigExpanded"
|
||||
>
|
||||
<div class="flex items-center gap-3">
|
||||
<Warehouse class="w-5 h-5 flex-shrink-0" :class="isShippingConfigActive ? 'text-brand-600' : 'text-muted'" />
|
||||
<span :class="navStore.sidebarCollapsed ? 'md:hidden' : ''">{{ t('admin.nav.shippingConfig') }}</span>
|
||||
<div
|
||||
v-if="navStore.shippingManagementExpanded && !navStore.sidebarCollapsed"
|
||||
class="mt-1 ml-6 space-y-1 border-l-2 border-subtle pl-3 pb-1"
|
||||
>
|
||||
<section v-for="groupKey in shippingNavGroups" :key="groupKey" class="shipping-nav-group">
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs font-semibold text-secondary transition-colors hover:bg-surface-soft"
|
||||
:aria-expanded="navStore.shippingManagementGroup === groupKey"
|
||||
@click="navStore.toggleShippingManagementGroup(groupKey)"
|
||||
>
|
||||
<span>{{ t(groupKey) }}</span>
|
||||
<ChevronDown v-if="navStore.shippingManagementGroup === groupKey" class="h-3.5 w-3.5 text-muted" />
|
||||
<ChevronRight v-else class="h-3.5 w-3.5 text-muted" />
|
||||
</button>
|
||||
<div v-if="navStore.shippingManagementGroup === groupKey" class="ml-2 border-l border-subtle pl-2 py-1 space-y-0.5">
|
||||
<button
|
||||
v-for="sub in SHIPPING_CONFIG_SUB_MODULE_METAS.filter((entry) => entry.groupKey === groupKey)"
|
||||
:key="sub.id"
|
||||
type="button"
|
||||
class="admin-nav-subitem py-1.5 pl-3"
|
||||
:class="{ 'admin-nav-subitem--active': isShippingNavActive(sub) }"
|
||||
@click="navigateShipping(sub)"
|
||||
>
|
||||
{{ t(sub.labelKey) }}
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</button>
|
||||
<div
|
||||
v-if="navStore.shippingConfigExpanded && !navStore.sidebarCollapsed"
|
||||
class="pl-4 space-y-1 mt-1 border-l-2 border-subtle ml-6"
|
||||
>
|
||||
<button
|
||||
v-for="sub in SHIPPING_CONFIG_SUB_MODULE_METAS"
|
||||
:key="sub.id"
|
||||
type="button"
|
||||
class="admin-nav-subitem"
|
||||
:class="{ 'admin-nav-subitem--active': isShippingConfigSubModuleActive(sub.id) }"
|
||||
@click="navigateShippingConfig(sub.routeName)"
|
||||
>
|
||||
{{ t(sub.labelKey) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-else-if="item.id === 'wecom'" class="flex flex-col flex-shrink-0">
|
||||
<button
|
||||
type="button"
|
||||
class="admin-nav-btn group justify-between"
|
||||
:class="{ 'admin-nav-btn--active': isWecomActive }"
|
||||
@click="navStore.wecomExpanded = !navStore.wecomExpanded"
|
||||
>
|
||||
<div class="flex items-center gap-3">
|
||||
<Link2 class="w-5 h-5 flex-shrink-0" :class="isWecomActive ? 'text-brand-600' : 'text-muted'" />
|
||||
<span :class="navStore.sidebarCollapsed ? 'md:hidden' : ''">{{ t(item.labelKey) }}</span>
|
||||
</div>
|
||||
</button>
|
||||
<div
|
||||
v-if="navStore.wecomExpanded && !navStore.sidebarCollapsed"
|
||||
class="pl-4 space-y-1 mt-1 border-l-2 border-subtle ml-6"
|
||||
>
|
||||
<button
|
||||
v-for="sub in wecomSubRoutes"
|
||||
:key="sub.name"
|
||||
type="button"
|
||||
class="admin-nav-subitem"
|
||||
:class="{ 'admin-nav-subitem--active': route.name === sub.name }"
|
||||
@click="navigateWecom(sub.name)"
|
||||
>
|
||||
{{ t(sub.labelKey) }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button
|
||||
v-else
|
||||
type="button"
|
||||
class="admin-nav-btn group"
|
||||
:class="{ 'admin-nav-btn--active': isModuleActive(item.id) }"
|
||||
:title="navStore.sidebarCollapsed ? t(item.labelKey) : ''"
|
||||
@click="navigateModule(item.routeName)"
|
||||
>
|
||||
<component
|
||||
:is="iconMap[item.id]"
|
||||
class="w-5 h-5 transition-transform group-hover:scale-110 flex-shrink-0"
|
||||
:class="isModuleActive(item.id) ? 'text-brand-600' : 'text-muted group-hover:text-secondary'"
|
||||
/>
|
||||
<span :class="navStore.sidebarCollapsed ? 'md:hidden' : ''">{{ t(item.labelKey) }}</span>
|
||||
<span
|
||||
v-if="navStore.badgeForModule(item.id) && !navStore.sidebarCollapsed"
|
||||
class="ml-auto bg-red-500 text-white text-[10px] font-bold px-2 py-0.5 rounded-full shadow-sm"
|
||||
>
|
||||
{{ navStore.badgeForModule(item.id) }}
|
||||
</span>
|
||||
<div
|
||||
v-if="isModuleActive(item.id)"
|
||||
class="absolute left-0 top-1/2 -translate-y-1/2 w-1 h-6 bg-brand-600 rounded-r-full"
|
||||
/>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<div v-if="config.admin.modules.reports !== false" class="flex flex-col flex-shrink-0">
|
||||
<button
|
||||
|
||||
@@ -18,6 +18,8 @@ export interface ShippingConfigSubModuleMeta {
|
||||
routeName: 'AdminShippingInventory' | 'AdminShippingIdentityRules' | 'AdminShippingOrderExtractionRuns' | 'AdminShippingOrderDocumentProfiles';
|
||||
path: 'shipping-notice' | 'shipping-identity-rules' | 'shipping-order-extraction-runs' | 'shipping-order-document-profiles';
|
||||
labelKey: string;
|
||||
groupKey: 'admin.nav.shippingOrderRecognition' | 'admin.nav.shippingInventoryManagement' | 'admin.nav.shippingRunAudit';
|
||||
query?: { section: 'orderSchema' | 'parsing' | 'profiles' | 'sources' | 'mappings' | 'rules' | 'templates' | 'snapshots' | 'exports' };
|
||||
}
|
||||
|
||||
/** 已独立拆分的模块(全部 admin 模块均已拆分) */
|
||||
@@ -33,21 +35,29 @@ export const ADMIN_MODULE_METAS: AdminModuleMeta[] = [
|
||||
{ id: 'agents', routeName: 'AdminAgents', path: 'agents', labelKey: 'admin.nav.agents', configKey: 'agents' },
|
||||
{ id: 'knowledge_base', routeName: 'AdminKnowledgeBase', path: 'knowledge-base', labelKey: 'admin.nav.knowledgeBase', configKey: 'knowledge_base' },
|
||||
{ id: 'schedules', routeName: 'AdminSchedules', path: 'schedules', labelKey: 'admin.nav.schedules', configKey: 'schedules' },
|
||||
{ id: 'shipping_inventory', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.nav.shippingConfig', configKey: 'shipping_inventory' },
|
||||
{ id: 'announcements', routeName: 'AdminAnnouncements', path: 'announcements', labelKey: 'admin.nav.announcements', configKey: 'announcements' },
|
||||
{ id: 'questions', routeName: 'AdminQuestions', path: 'questions', labelKey: 'admin.nav.questions', configKey: 'questions' },
|
||||
{ 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' },
|
||||
];
|
||||
|
||||
/** 货代配置的二级导航唯一真相源;各页面共用父模块权限与可见性开关。 */
|
||||
/** 货代管理的业务导航唯一真相源;按基础定义、适配规则、运行任务的依赖顺序排列。 */
|
||||
export const SHIPPING_CONFIG_SUB_MODULE_METAS: ShippingConfigSubModuleMeta[] = [
|
||||
{ id: 'inventory', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.nav.shippingInventory' },
|
||||
{ id: 'identity_rules', routeName: 'AdminShippingIdentityRules', path: 'shipping-identity-rules', labelKey: 'admin.nav.shippingIdentityRules' },
|
||||
{ id: 'order_extraction_runs', routeName: 'AdminShippingOrderExtractionRuns', path: 'shipping-order-extraction-runs', labelKey: 'admin.nav.shippingOrderExtractionRuns' },
|
||||
{ id: 'order_document_profiles', routeName: 'AdminShippingOrderDocumentProfiles', path: 'shipping-order-document-profiles', labelKey: 'admin.nav.shippingOrderDocumentProfiles' },
|
||||
{ id: 'order_fields', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.nav.shippingOrderFields', groupKey: 'admin.nav.shippingOrderRecognition', query: { section: 'orderSchema' } },
|
||||
{ id: 'order_document_profiles', routeName: 'AdminShippingOrderDocumentProfiles', path: 'shipping-order-document-profiles', labelKey: 'admin.nav.shippingOrderDocumentProfiles', groupKey: 'admin.nav.shippingOrderRecognition' },
|
||||
{ id: 'identity_rules', routeName: 'AdminShippingIdentityRules', path: 'shipping-identity-rules', labelKey: 'admin.nav.shippingIdentityRules', groupKey: 'admin.nav.shippingOrderRecognition' },
|
||||
{ id: 'order_extraction_runs', routeName: 'AdminShippingOrderExtractionRuns', path: 'shipping-order-extraction-runs', labelKey: 'admin.nav.shippingOrderExtractionRuns', groupKey: 'admin.nav.shippingOrderRecognition' },
|
||||
{ id: 'inventory_fields', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.parsingProfiles', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'parsing' } },
|
||||
{ id: 'connections', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.connections', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'profiles' } },
|
||||
{ id: 'inventory_sites', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.sources', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'sources' } },
|
||||
{ id: 'warehouse_mappings', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.externalMappings', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'mappings' } },
|
||||
{ id: 'routing_rules', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.rules', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'rules' } },
|
||||
{ id: 'shipping_templates', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.excelTemplates', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'templates' } },
|
||||
{ id: 'inventory_snapshots', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.snapshots', groupKey: 'admin.nav.shippingRunAudit', query: { section: 'snapshots' } },
|
||||
{ id: 'export_records', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.exports', groupKey: 'admin.nav.shippingRunAudit', query: { section: 'exports' } },
|
||||
];
|
||||
|
||||
export const ADMIN_REPORT_TABLES: AdminReportTableId[] = [
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
features/admin/modules/shipping-inventory/ShippingInventoryPage.vue
|
||||
用途:以统一配置工作台维护订单字段、库存接入、Excel 导出和运行审计。
|
||||
依赖:admin.api、ShippingOrderSchemaPage、Vue Composition API、Vue I18n。
|
||||
逻辑:按订单字段到库存路由的业务链路组织配置;订单字段复用同一页面内的 Schema 编辑器,避免形成割裂入口。
|
||||
用途:以统一货代管理工作台维护订单字段、库存接入、Excel 导出和运行审计。
|
||||
依赖:admin.api、ShippingOrderSchemaPage、Vue Router、Vue Composition API、Vue I18n。
|
||||
逻辑:由 AdminLayout 统一业务目录选择工作区;section 深链与当前工作区双向同步。
|
||||
-->
|
||||
<template>
|
||||
<section class="inventory-console">
|
||||
@@ -21,22 +21,6 @@
|
||||
</header>
|
||||
|
||||
<div class="console-layout">
|
||||
<aside class="section-nav" aria-label="Shipping configuration sections">
|
||||
<section v-for="group in tabGroups" :key="group.labelKey" class="nav-group">
|
||||
<p>{{ t(group.labelKey) }}</p>
|
||||
<button
|
||||
v-for="tab in group.tabs"
|
||||
:key="tab.key"
|
||||
type="button"
|
||||
:class="{ active: activeTab === tab.key || (tab.key === 'parsing' && activeTab === 'inventoryFields') }"
|
||||
@click="selectTab(tab.key)"
|
||||
>
|
||||
<span>{{ t(tab.labelKey) }}</span>
|
||||
<small v-if="tab.count !== null">{{ tab.count }}</small>
|
||||
</button>
|
||||
</section>
|
||||
</aside>
|
||||
|
||||
<main class="workbench">
|
||||
<div v-if="activeTab !== 'orderSchema'" class="workbench-heading">
|
||||
<div>
|
||||
@@ -435,8 +419,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
/** 加载六个库存管理工作区,并将每个工作区限制在各自的真实配置或运行数据边界内。 */
|
||||
import { computed, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { computed, nextTick, onMounted, reactive, ref, watch } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import * as XLSX from 'xlsx';
|
||||
import DeleteConfirmDialog from '@/shared/components/DeleteConfirmDialog.vue';
|
||||
import PaginationBar from '@/shared/components/PaginationBar.vue';
|
||||
@@ -504,6 +489,8 @@ type InventoryFieldForm = { display_name: string; description: string; value_typ
|
||||
type SourceActivation = { ready: boolean; checks: ShippingInventoryReadinessCheck[]; missing_requirements: string[] };
|
||||
|
||||
const { t } = useI18n();
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const message = useMessage();
|
||||
const activeTab = ref<TabKey>('orderSchema');
|
||||
const selectedId = ref<number | null>(null);
|
||||
@@ -639,13 +626,13 @@ const operators = [
|
||||
];
|
||||
|
||||
const tabs = computed(() => [
|
||||
{ key: 'orderSchema' as const, group: 'foundation', labelKey: 'admin.shippingInventory.orderFields', helpKey: '', count: null },
|
||||
{ key: 'parsing' as const, group: 'foundation', labelKey: 'admin.shippingInventory.parsingProfiles', helpKey: 'admin.shippingInventory.parsingProfilesHelp', count: parsingProfiles.value.length },
|
||||
{ key: 'templates' as const, group: 'foundation', labelKey: 'admin.shippingInventory.excelTemplates', helpKey: 'admin.shippingInventory.excelTemplatesHelp', count: excelTemplates.value.length },
|
||||
{ key: 'orderSchema' as const, group: 'order', labelKey: 'admin.shippingInventory.orderFields', helpKey: '', count: null },
|
||||
{ key: 'parsing' as const, group: 'inventory', labelKey: 'admin.shippingInventory.parsingProfiles', helpKey: 'admin.shippingInventory.parsingProfilesHelp', count: parsingProfiles.value.length },
|
||||
{ key: 'profiles' as const, group: 'inventory', labelKey: 'admin.shippingInventory.connections', helpKey: 'admin.shippingInventory.connectionsHelp', count: profiles.value.length },
|
||||
{ key: 'sources' as const, group: 'inventory', labelKey: 'admin.shippingInventory.sources', helpKey: 'admin.shippingInventory.sourcesHelp', count: sources.value.length },
|
||||
{ key: 'rules' as const, group: 'inventory', labelKey: 'admin.shippingInventory.rules', helpKey: 'admin.shippingInventory.rulesHelp', count: rules.value.length },
|
||||
{ key: 'mappings' as const, group: 'inventory', labelKey: 'admin.shippingInventory.externalMappings', helpKey: 'admin.shippingInventory.mappingsHelp', count: mappings.value.length },
|
||||
{ key: 'rules' as const, group: 'inventory', labelKey: 'admin.shippingInventory.rules', helpKey: 'admin.shippingInventory.rulesHelp', count: rules.value.length },
|
||||
{ key: 'templates' as const, group: 'inventory', labelKey: 'admin.shippingInventory.excelTemplates', helpKey: 'admin.shippingInventory.excelTemplatesHelp', count: excelTemplates.value.length },
|
||||
{ key: 'snapshots' as const, group: 'audit', labelKey: 'admin.shippingInventory.snapshots', helpKey: 'admin.shippingInventory.snapshotsHelp', count: snapshots.value.length },
|
||||
{ key: 'exports' as const, group: 'audit', labelKey: 'admin.shippingInventory.exports', helpKey: 'admin.shippingInventory.exportsHelp', count: exports.value.length },
|
||||
]);
|
||||
@@ -653,11 +640,6 @@ const snapshotColumnLabels = computed(() => [t('admin.shippingInventory.snapshot
|
||||
const exportColumnLabels = computed(() => [t('admin.shippingInventory.runNo'), t('admin.shippingInventory.source'), t('admin.shippingInventory.connection'), t('admin.shippingInventory.triggerMode'), t('admin.shippingInventory.startedAt'), t('admin.shippingInventory.duration'), t('admin.shippingInventory.exportResult'), t('admin.shippingInventory.status'), t('admin.shippingInventory.actions')]);
|
||||
const snapshotTableWidth = computed(() => snapshotColumnWidths.value.reduce((total, width) => total + width, 0));
|
||||
const exportTableWidth = computed(() => exportColumnWidths.value.reduce((total, width) => total + width, 0));
|
||||
const tabGroups = computed(() => [
|
||||
{ labelKey: 'admin.shippingInventory.groupFoundation', tabs: tabs.value.filter((tab) => tab.group === 'foundation') },
|
||||
{ labelKey: 'admin.shippingInventory.groupInventory', tabs: tabs.value.filter((tab) => tab.group === 'inventory') },
|
||||
{ labelKey: 'admin.shippingInventory.groupAudit', tabs: tabs.value.filter((tab) => tab.group === 'audit') },
|
||||
]);
|
||||
const currentTab = computed(() => tabs.value.find((item) => item.key === activeTab.value) ?? tabs.value[0]!);
|
||||
const currentSection = computed(() => activeTab.value === 'inventoryFields'
|
||||
? { labelKey: 'admin.shippingInventory.parsingProfiles', helpKey: 'admin.shippingInventory.parsingProfilesHelp' }
|
||||
@@ -801,14 +783,26 @@ async function load(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
/** 切换管理对象时清空选择,避免不同对象的数据残留在编辑器中。 */
|
||||
/** 切换管理对象时同步深链并清空选择,避免不同对象的数据残留在编辑器中。 */
|
||||
function selectTab(tab: TabKey): void {
|
||||
activeTab.value = tab;
|
||||
void router.replace({ query: { ...route.query, section: tab } });
|
||||
if (tab === 'snapshots') snapshotPage.value = 1;
|
||||
if (tab === 'exports') exportPage.value = 1;
|
||||
closeDrawer();
|
||||
}
|
||||
|
||||
/** 接收侧栏或书签中的 section 深链,仅允许打开工作台已注册区段。 */
|
||||
watch(
|
||||
() => route.query.section,
|
||||
(section) => {
|
||||
if (typeof section === 'string' && tabs.value.some((tab) => tab.key === section)) {
|
||||
activeTab.value = section as TabKey;
|
||||
}
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
/** 在库存映射内切换解析方案与字段目录,保持左侧业务入口不分裂。 */
|
||||
function selectInventoryMappingTab(tab: 'parsing' | 'inventoryFields'): void {
|
||||
activeTab.value = tab;
|
||||
@@ -1465,7 +1459,7 @@ function openAuditDetail(item: Item, kind: 'snapshot' | 'export'): void { auditD
|
||||
function paginate(items: Item[], page: number): Item[] { const start = (page - 1) * auditPageSize.value; return items.slice(start, start + auditPageSize.value); }
|
||||
function downloadSnapshot(item: Item): void { void downloadShippingInventorySnapshot(Number(item.id), `${item.inventory_file_no || 'inventory'}.xlsx`).catch((cause) => { showError(cause, 'downloadFailed'); }); }
|
||||
|
||||
/** 将货代配置的操作失败交给平台统一消息弹窗,禁止跨工作区保留页面级错误。 */
|
||||
/** 将货代管理操作失败交给平台统一消息弹窗,禁止跨工作区保留页面级错误。 */
|
||||
function showError(cause: unknown, fallbackKey: 'loadFailed' | 'saveFailed' | 'deleteFailed' | 'downloadFailed' | 'inventoryAnalysisFailed' | 'configurationTestFailed' | 'templateLayoutReadFailed'): void {
|
||||
message.error(cause instanceof Error ? cause.message : t(`admin.shippingInventory.${fallbackKey}`));
|
||||
}
|
||||
@@ -1495,15 +1489,7 @@ onMounted(load);
|
||||
.flow-strip { align-self: center; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #e0f2fe; border-radius: 6px; background: #f0f9ff; color: #0369a1; font-size: 12px; font-weight: 500; }
|
||||
.flow-strip i { color: #7dd3fc; font-style: normal; }
|
||||
.schema-prerequisite { margin: 0 0 14px; border: 1px solid #fde68a; border-radius: 6px; background: #fffbeb; padding: 10px 12px; color: #92400e; font-size: 13px; }
|
||||
.console-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; padding-top: 20px; }
|
||||
.section-nav { display: flex; flex-direction: column; gap: 16px; }
|
||||
.nav-group { display: grid; gap: 3px; }
|
||||
.nav-group > p { margin: 0 10px 3px; color: #94a3b8; font-size: 11px; font-weight: 600; }
|
||||
.section-nav button { display: flex; align-items: center; justify-content: space-between; border: 0; border-left: 2px solid transparent; border-radius: 4px; background: transparent; padding: 9px 10px; color: #64748b; font-size: 13px; text-align: left; cursor: pointer; }
|
||||
.section-nav button:hover { background: #f8fafc; color: #334155; }
|
||||
.section-nav button.active { border-left-color: #0ea5e9; background: #f0f9ff; color: #0369a1; font-weight: 600; }
|
||||
.section-nav small { min-width: 20px; border-radius: 999px; background: #f1f5f9; padding: 2px 5px; color: #94a3b8; font-size: 11px; text-align: center; }
|
||||
.section-nav .active small { background: #e0f2fe; color: #0284c7; }
|
||||
.console-layout { padding-top: 20px; }
|
||||
.workbench-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
|
||||
.workbench-heading h2 { margin: 0; color: #1e293b; font-size: 16px; font-weight: 600; letter-spacing: 0; }
|
||||
.workbench-heading p { max-width: 660px; margin: 5px 0 0; color: #64748b; font-size: 13px; }
|
||||
@@ -1602,6 +1588,6 @@ onMounted(load);
|
||||
.audit-detail dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 0; margin: 0; padding: 18px 20px; }.audit-detail dt, .audit-detail dd { margin: 0; padding: 11px 0; border-bottom: 1px solid #edf2f7; font-size: 13px; }.audit-detail dt { color: #64748b; }.audit-detail dd { overflow-wrap: anywhere; color: #334155; }
|
||||
.object-list .empty-state { grid-column: 1 / -1; display: grid; min-height: 260px; place-items: center; }
|
||||
.empty-state { border: 1px dashed #c9d7e5; border-radius: 10px; background: #f9fbfd; padding: 38px 18px; color: #7b899a; font-size: 13px; text-align: center; }
|
||||
@media (max-width: 980px) { .console-header { display: block; } .flow-strip { display: inline-flex; margin-top: 18px; } .console-layout { grid-template-columns: 1fr; } .section-nav { flex-direction: row; gap: 12px; overflow-x: auto; } .nav-group { display: flex; align-items: center; gap: 4px; } .nav-group > p { display: none; } .section-nav button { min-width: max-content; border-bottom: 3px solid transparent; border-left: 0; } .section-nav button.active { border-bottom-color: #16877f; border-left: 0; } .parameter-row, .condition-row, .mapping-row, .template-mapping, .record-card { grid-template-columns: 1fr 1fr; } .mapping-value-row { grid-template-columns: minmax(0, 1.6fr) minmax(180px, 1fr); }.readiness-audit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
||||
@media (max-width: 980px) { .console-header { display: block; } .flow-strip { display: inline-flex; margin-top: 18px; } .parameter-row, .condition-row, .mapping-row, .template-mapping, .record-card { grid-template-columns: 1fr 1fr; } .mapping-value-row { grid-template-columns: minmax(0, 1.6fr) minmax(180px, 1fr); }.readiness-audit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
|
||||
@media (max-width: 640px) { .inventory-console { padding: 18px; } .editor-form, .parameter-row, .condition-row, .mapping-row, .template-mapping, .record-card, .mapping-value-row, .parsing-mapping-card, .readonly-mapping-section .parsing-mapping-card, .parsing-summary { grid-template-columns: 1fr; } .mapping-arrow { transform: rotate(90deg); }.workbench-heading { display: block; } .workbench-heading .primary-action { margin-top: 12px; }.batch-source-list { grid-template-columns: 1fr; }.batch-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }.batch-run { grid-template-columns: 9px minmax(0, 1fr); }.batch-run-error { grid-column: 2; }.readiness-heading { display: grid; }.readiness-count { justify-self: start; }.readiness-steps li { grid-template-columns: 24px minmax(0, 1fr); }.readiness-action { grid-column: 2; justify-self: start; }.readiness-footer { justify-content: stretch; }.readiness-footer .primary-action { width: 100%; } }
|
||||
</style>
|
||||
+653
-72
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
features/admin/modules/shipping-order-document-profiles/ShippingOrderDocumentProfilesPage.vue
|
||||
用途:通过 MinerU 样本表格可视化创建和发布订单文档 Profile。
|
||||
用途:通过 MinerU/PDF 坐标样本工作台创建、复核和发布订单文档 Profile。
|
||||
依赖:Profile/Schema API、BusinessError、useMessage、Vue I18n。
|
||||
逻辑:管理员选择真实样本、表格、表头行和列目标;浏览器不展示 HTML,也不编辑 JSON/结构指纹。
|
||||
逻辑:管理员选择样本并按物理行编辑列边界和字段;后端提供全量/当前行建议及最终候选,浏览器不展示 HTML 或结构指纹。
|
||||
-->
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, reactive, ref, watch } from 'vue';
|
||||
@@ -14,12 +14,16 @@ import {
|
||||
createOrderProfileSample,
|
||||
createOrderProfileFromSample,
|
||||
deleteOrderDocumentProfile,
|
||||
deleteOrderProfileSample,
|
||||
getOrderProfileSampleTables,
|
||||
getOrderProfileSampleStatus,
|
||||
generateOrderProfileOcrCoordinateEvidence,
|
||||
listOrderDocumentProfiles,
|
||||
listOrderProfileSamples,
|
||||
publishOrderDocumentProfile,
|
||||
retireOrderDocumentProfile,
|
||||
previewOrderProfileCoordinateReconstruction,
|
||||
suggestOrderProfileCoordinateReconstruction,
|
||||
updateOrderProfileFromSample,
|
||||
} from '@/features/admin/api/shipping-order-document-profile.api';
|
||||
import { uploadFileAsset } from '@/shared/api/file-assets.api';
|
||||
@@ -28,11 +32,16 @@ import type {
|
||||
OrderProfileSampleDocument,
|
||||
OrderProfileSamplePreview,
|
||||
OrderProfileSampleTable,
|
||||
CoordinateReconstructionPreview,
|
||||
CoordinateReconstructionSettings,
|
||||
CoordinateSubrowLayout,
|
||||
ShippingOrderDocumentProfile,
|
||||
} from '@/features/admin/types/shipping-order-document-profile.types';
|
||||
import {
|
||||
buildOrderProfileColumnRules,
|
||||
findDuplicateOrderProfileTargets,
|
||||
mergeOrderProfileHeaderLabels,
|
||||
shouldShowStandardOrderProfilePreview,
|
||||
} from './orderProfileForm.utils';
|
||||
import type {
|
||||
ShippingOrderFieldConfig,
|
||||
@@ -49,7 +58,27 @@ const editingProfileId = ref<number | null>(null);
|
||||
const editingLockVersion = ref<number | null>(null);
|
||||
const profiles = ref<ShippingOrderDocumentProfile[]>([]);
|
||||
const samples = ref<OrderProfileSampleDocument[]>([]);
|
||||
const sampleSearch = ref('');
|
||||
const preview = ref<OrderProfileSamplePreview | null>(null);
|
||||
const reconstructionPreview = ref<CoordinateReconstructionPreview | null>(null);
|
||||
const reconstructing = ref(false);
|
||||
const reconstructionPreviewFailed = ref(false);
|
||||
const suggesting = ref(false);
|
||||
const suggestingSubrowIndex = ref<number | null>(null);
|
||||
const ocrGenerating = ref(false);
|
||||
const reconstructionMethod = ref<CoordinateReconstructionSettings['method']>('native_pdf_coordinates.v1');
|
||||
const reconstructionConfirmed = ref(false);
|
||||
const reconstructionFieldSignature = ref('');
|
||||
const columnBoundaryInput = ref('0, 0.10, 0.25, 0.33, 0.52, 0.65, 0.77, 0.88, 0.94, 1');
|
||||
const multiSubrowEnabled = ref(false);
|
||||
type SubrowEditor = {
|
||||
role: CoordinateSubrowLayout['role']; row_offset: number; boundaries: string;
|
||||
fields: Array<string | null>; samples: string[][];
|
||||
};
|
||||
const subrowEditors = ref<SubrowEditor[]>([
|
||||
{ role: 'main', row_offset: 0, boundaries: '0, 1', fields: [null], samples: [] },
|
||||
]);
|
||||
const selectedSubrowIndex = ref(0);
|
||||
const publishedSchemas = ref<ShippingOrderSchemaVersion[]>([]);
|
||||
const form = reactive({
|
||||
profile_code: '', display_name: '', schema_version_id: 0,
|
||||
@@ -62,6 +91,32 @@ const columnRules = ref<Array<{ extractor_key: 'direct' | 'temp_internal_parts';
|
||||
const selectedTable = computed<OrderProfileSampleTable | null>(() => (
|
||||
preview.value?.tables.find((item) => item.table_id === form.table_id) || null
|
||||
));
|
||||
const showStandardPreview = computed(() => shouldShowStandardOrderProfilePreview(
|
||||
Boolean(selectedTable.value?.profile_creation_allowed),
|
||||
multiSubrowEnabled.value,
|
||||
Boolean(selectedTable.value?.coordinate_reconstruction_available),
|
||||
));
|
||||
const displayedTable = computed<OrderProfileSampleTable | CoordinateReconstructionPreview | null>(() => (
|
||||
reconstructionPreview.value || selectedTable.value
|
||||
));
|
||||
const mergedHeaderLabels = computed(() => mergeOrderProfileHeaderLabels(
|
||||
displayedTable.value?.rows || [],
|
||||
form.header_row_index,
|
||||
displayedTable.value?.column_count || 0,
|
||||
));
|
||||
const displayedRowRole = (rowIndex: number) => (
|
||||
reconstructionPreview.value?.row_roles[rowIndex] || (rowIndex <= form.header_row_index ? 'header' : 'data')
|
||||
);
|
||||
const displayedSourceRows = (rowIndex: number) => reconstructionPreview.value?.source_row_indices[rowIndex] || [];
|
||||
const visibleSamples = computed(() => {
|
||||
const keyword = sampleSearch.value.trim().toLowerCase();
|
||||
return samples.value.filter((sample) => !keyword || String(sample.filename || '').toLowerCase().includes(keyword));
|
||||
});
|
||||
const selectedSample = computed(() => samples.value.find((sample) => sample.document_id === form.document_id) || null);
|
||||
const selectedSubrow = computed(() => subrowEditors.value[selectedSubrowIndex.value] || subrowEditors.value[0]);
|
||||
const currentProfileIds = computed(() => new Set(
|
||||
profiles.value.filter((profile) => profile.status === 'published').map((profile) => profile.id),
|
||||
));
|
||||
const selectedSchema = computed(() => publishedSchemas.value.find((item) => item.id === form.schema_version_id) || null);
|
||||
const lineFields = computed<ShippingOrderFieldConfig[]>(() => (
|
||||
selectedSchema.value?.definition?.fields.filter((item) => item.enabled !== false && item.scope === 'line') || []
|
||||
@@ -77,14 +132,25 @@ const duplicateTargets = computed(() => {
|
||||
if (form.row_structure !== 'preserved') return [];
|
||||
return findDuplicateOrderProfileTargets(normalizedRules());
|
||||
});
|
||||
const reconstructionMatchesFields = computed(() => (
|
||||
!reconstructionPreview.value || reconstructionFieldSignature.value === coordinateFieldSignature()
|
||||
));
|
||||
const livePreviewStatusKey = computed(() => {
|
||||
if (reconstructing.value) return 'livePreviewUpdating';
|
||||
if (!subrowEditors.value[0]?.fields.includes('line_no')) return 'livePreviewWaitingLineNo';
|
||||
if (reconstructionPreviewFailed.value) return 'livePreviewFailed';
|
||||
if (reconstructionPreview.value && reconstructionMatchesFields.value) return 'livePreviewReady';
|
||||
return 'livePreviewEmpty';
|
||||
});
|
||||
const canSave = computed(() => Boolean(
|
||||
form.profile_code.trim() && form.display_name.trim() && form.schema_version_id
|
||||
&& form.document_id && form.table_id && selectedTable.value
|
||||
&& selectedTable.value.profile_creation_allowed
|
||||
&& form.document_id && form.table_id && displayedTable.value
|
||||
&& (selectedTable.value?.profile_creation_allowed || reconstructionConfirmed.value)
|
||||
&& form.data_start_row_index > form.header_row_index
|
||||
&& form.header_row_index >= 0
|
||||
&& form.data_start_row_index < (selectedTable.value?.row_count || 0)
|
||||
&& form.data_start_row_index < (displayedTable.value?.row_count || 0)
|
||||
&& duplicateTargets.value.length === 0
|
||||
&& reconstructionMatchesFields.value
|
||||
&& (form.row_structure === 'unsupported_row_structure' || hasConfiguredColumn.value),
|
||||
));
|
||||
|
||||
@@ -115,6 +181,8 @@ const load = async () => {
|
||||
/** 选择样本文档后读取由后端展开的网格。 */
|
||||
const loadPreview = async () => {
|
||||
preview.value = null;
|
||||
reconstructionPreview.value = null;
|
||||
reconstructionConfirmed.value = false;
|
||||
form.table_id = '';
|
||||
if (!form.document_id) return;
|
||||
try {
|
||||
@@ -145,6 +213,8 @@ const uploadSample = async (event: Event) => {
|
||||
await new Promise((resolve) => window.setTimeout(resolve, 1000));
|
||||
}
|
||||
await load();
|
||||
const uploadedSample = samples.value.find((sample) => sample.intake_no === intake.intake_no);
|
||||
if (uploadedSample) form.document_id = uploadedSample.document_id;
|
||||
message.success(t('admin.shippingOrderProfiles.sampleUploaded'));
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
@@ -156,10 +226,274 @@ const uploadSample = async (event: Event) => {
|
||||
|
||||
/** 表格变化时按真实列数初始化受控列映射。 */
|
||||
const resetColumns = () => {
|
||||
const count = selectedTable.value?.column_count || 0;
|
||||
const count = displayedTable.value?.column_count || 0;
|
||||
columnRules.value = Array.from({ length: count }, () => ({ extractor_key: 'direct', target: '' }));
|
||||
form.header_row_index = 0;
|
||||
form.data_start_row_index = Math.min(1, Math.max((selectedTable.value?.row_count || 1) - 1, 0));
|
||||
form.data_start_row_index = Math.min(1, Math.max((displayedTable.value?.row_count || 1) - 1, 0));
|
||||
};
|
||||
|
||||
/** 清理上一张表的坐标重建编辑状态,避免切换样本后隐藏或污染当前配置区。 */
|
||||
const resetCoordinateReconstructionState = () => {
|
||||
if (reconstructionPreviewTimer) window.clearTimeout(reconstructionPreviewTimer);
|
||||
reconstructionPreviewTimer = null;
|
||||
reconstructionPreviewRequestId += 1;
|
||||
multiSubrowEnabled.value = false;
|
||||
subrowEditors.value = [
|
||||
{ role: 'main', row_offset: 0, boundaries: '0, 1', fields: [null], samples: [] },
|
||||
];
|
||||
selectedSubrowIndex.value = 0;
|
||||
reconstructionPreview.value = null;
|
||||
reconstructionPreviewFailed.value = false;
|
||||
reconstructionConfirmed.value = false;
|
||||
reconstructionFieldSignature.value = '';
|
||||
};
|
||||
|
||||
/** 按重建列数保留已有字段映射,并只补齐或裁掉实际变化的列。 */
|
||||
const resizeColumns = (count: number) => {
|
||||
columnRules.value = Array.from({ length: count }, (_, index) => (
|
||||
columnRules.value[index] || { extractor_key: 'direct', target: '' }
|
||||
));
|
||||
};
|
||||
|
||||
/** 解析 0..1 严格递增边界;单内容块物理行允许只使用 0,1。 */
|
||||
const parseBoundaryInput = (raw: string): number[] | null => {
|
||||
const values = raw.split(',').map((item) => Number(item.trim()));
|
||||
if (values.length < 2 || values.some((value) => !Number.isFinite(value)) || values[0] !== 0 || values[values.length - 1] !== 1
|
||||
|| values.some((value, index) => index > 0 && value <= values[index - 1]!)) return null;
|
||||
return values;
|
||||
};
|
||||
|
||||
/** 边界数量变化时保留已有子行字段映射,并补齐新的列。 */
|
||||
const syncSubrowFields = (editor: SubrowEditor) => {
|
||||
const count = Math.max((parseBoundaryInput(editor.boundaries)?.length || 1) - 1, 0);
|
||||
editor.fields = Array.from({ length: count }, (_, index) => editor.fields[index] || null);
|
||||
};
|
||||
|
||||
/** 返回边界尺的有效刻度;输入异常时保留最小可编辑区间。 */
|
||||
const subrowBoundaries = (editor: SubrowEditor) => parseBoundaryInput(editor.boundaries) || [0, 1];
|
||||
|
||||
/** 拖动内部刻度时限制其不能越过相邻边界,并同步字段列数。 */
|
||||
const updateSubrowBoundary = (editor: SubrowEditor, boundaryIndex: number, rawValue: string) => {
|
||||
const values = [...subrowBoundaries(editor)];
|
||||
const previous = values[boundaryIndex - 1] ?? 0;
|
||||
const next = values[boundaryIndex + 1] ?? 1;
|
||||
values[boundaryIndex] = Math.min(next - 0.01, Math.max(previous + 0.01, Number(rawValue)));
|
||||
editor.boundaries = values.map((value) => Number(value.toFixed(2))).join(', ');
|
||||
syncSubrowFields(editor);
|
||||
};
|
||||
|
||||
/** 只有区间宽度足够容纳两个最小 1% 列时才允许继续拆分。 */
|
||||
const canSplitSubrowColumn = (editor: SubrowEditor, columnIndex: number) => {
|
||||
const boundaries = subrowBoundaries(editor);
|
||||
return boundaries[columnIndex + 1]! - boundaries[columnIndex]! >= 0.02;
|
||||
};
|
||||
|
||||
/** 在当前逻辑明细末尾增加任意一条物理子行配置。 */
|
||||
const addSubrow = () => {
|
||||
subrowEditors.value.push({
|
||||
role: 'continuation', row_offset: subrowEditors.value.length,
|
||||
boundaries: '0, 1', fields: [null], samples: [],
|
||||
});
|
||||
selectedSubrowIndex.value = subrowEditors.value.length - 1;
|
||||
};
|
||||
|
||||
/** 删除指定续行并重排 row_offset;首行是新明细锚点,禁止删除。 */
|
||||
const removeSubrow = (index: number) => {
|
||||
if (index <= 0) return;
|
||||
subrowEditors.value.splice(index, 1);
|
||||
subrowEditors.value.forEach((item, rowIndex) => {
|
||||
item.row_offset = rowIndex;
|
||||
item.role = rowIndex === 0 ? 'main' : 'continuation';
|
||||
});
|
||||
selectedSubrowIndex.value = Math.min(selectedSubrowIndex.value, subrowEditors.value.length - 1);
|
||||
};
|
||||
|
||||
/** 在指定列区间中点插入新边界;原列配置保留,新列插入其后等待映射。 */
|
||||
const addSubrowColumn = (editor: SubrowEditor, columnIndex: number) => {
|
||||
const boundaries = [...subrowBoundaries(editor)];
|
||||
const midpoint = Number(((boundaries[columnIndex]! + boundaries[columnIndex + 1]!) / 2).toFixed(2));
|
||||
boundaries.splice(columnIndex + 1, 0, midpoint);
|
||||
editor.boundaries = boundaries.join(', ');
|
||||
editor.fields.splice(columnIndex + 1, 0, null);
|
||||
editor.samples.splice(columnIndex + 1, 0, []);
|
||||
};
|
||||
|
||||
/** 删除当前物理行的一列并合并相邻边界;每行至少保留一列。 */
|
||||
const removeSubrowColumn = (editor: SubrowEditor, columnIndex: number) => {
|
||||
if (editor.fields.length <= 1) return;
|
||||
const boundaries = [...subrowBoundaries(editor)];
|
||||
boundaries.splice(columnIndex === 0 ? 1 : columnIndex, 1);
|
||||
editor.boundaries = boundaries.join(', ');
|
||||
editor.fields.splice(columnIndex, 1);
|
||||
editor.samples.splice(columnIndex, 1);
|
||||
};
|
||||
|
||||
/** 将多子行编辑器转换为严格契约;主行必须映射 line_no 才能识别新明细。 */
|
||||
const multiSubrowLayouts = (): CoordinateSubrowLayout[] | null => {
|
||||
const result: CoordinateSubrowLayout[] = [];
|
||||
for (const editor of subrowEditors.value) {
|
||||
const boundaries = parseBoundaryInput(editor.boundaries);
|
||||
if (!boundaries) return null;
|
||||
const columnCount = boundaries.length - 1;
|
||||
result.push({
|
||||
role: editor.role, row_offset: editor.row_offset,
|
||||
column_boundaries: boundaries,
|
||||
column_field_codes: Array.from({ length: columnCount }, (_, index) => editor.fields[index] || null),
|
||||
});
|
||||
}
|
||||
const main = result.find((item) => item.role === 'main');
|
||||
return main?.column_field_codes.includes('line_no') ? result : null;
|
||||
};
|
||||
|
||||
/** 将管理员确认的相对列边界转为受控坐标重建参数。 */
|
||||
const coordinateReconstructionSettings = (includeFieldRules = false): CoordinateReconstructionSettings | null => {
|
||||
if (multiSubrowEnabled.value) {
|
||||
const layouts = multiSubrowLayouts();
|
||||
return layouts ? { method: reconstructionMethod.value, column_boundaries: [], subrow_layouts: layouts } : null;
|
||||
}
|
||||
const values = parseBoundaryInput(columnBoundaryInput.value);
|
||||
if (!values) return null;
|
||||
const fieldCodes = includeFieldRules ? columnRules.value.map((item) => (
|
||||
item.extractor_key === 'direct' ? (item.target || null) : 'customer_part_number'
|
||||
)) : [];
|
||||
const lineStartColumn = fieldCodes.findIndex((code) => code === 'line_no');
|
||||
return {
|
||||
method: reconstructionMethod.value,
|
||||
column_boundaries: values,
|
||||
column_field_codes: fieldCodes.some(Boolean) ? fieldCodes : [],
|
||||
line_start_column_index: lineStartColumn >= 0 ? lineStartColumn : 0,
|
||||
};
|
||||
};
|
||||
|
||||
/** 生成影响内容适配和新行判断的列映射签名,用于阻止未复核配置直接保存。 */
|
||||
const coordinateFieldSignature = () => JSON.stringify({
|
||||
columnRules: columnRules.value.map((item) => ({ extractor_key: item.extractor_key, target: item.target })),
|
||||
multiSubrowEnabled: multiSubrowEnabled.value,
|
||||
subrows: subrowEditors.value,
|
||||
});
|
||||
|
||||
/** 用后端冻结坐标生成行版式和边界建议;仅确定性行号自动绑定,其余字段由管理员确认。 */
|
||||
const suggestLayouts = async () => {
|
||||
if (!form.document_id || !form.table_id) return;
|
||||
suggesting.value = true;
|
||||
reconstructionPreview.value = null;
|
||||
reconstructionConfirmed.value = false;
|
||||
try {
|
||||
const suggestion = await suggestOrderProfileCoordinateReconstruction(form.document_id, form.table_id);
|
||||
multiSubrowEnabled.value = true;
|
||||
subrowEditors.value = suggestion.subrow_layouts.map((item) => ({
|
||||
role: item.role,
|
||||
row_offset: item.row_offset,
|
||||
boundaries: item.column_boundaries.join(', '),
|
||||
fields: [...item.suggested_field_codes],
|
||||
samples: item.column_samples,
|
||||
}));
|
||||
selectedSubrowIndex.value = 0;
|
||||
message.success(t('admin.shippingOrderProfiles.layoutSuggestionReady'));
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
} finally {
|
||||
suggesting.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 仅重新识别当前物理行,按列位置保留已确认字段,不覆盖其他行版式。 */
|
||||
const suggestCurrentSubrow = async () => {
|
||||
const editor = selectedSubrow.value;
|
||||
if (!editor || !form.document_id || !form.table_id) return;
|
||||
suggestingSubrowIndex.value = editor.row_offset;
|
||||
try {
|
||||
const suggestion = await suggestOrderProfileCoordinateReconstruction(
|
||||
form.document_id, form.table_id, editor.row_offset,
|
||||
);
|
||||
const current = suggestion.subrow_layouts[0];
|
||||
if (!current) return;
|
||||
const previousFields = [...editor.fields];
|
||||
editor.boundaries = current.column_boundaries.join(', ');
|
||||
editor.samples = current.column_samples;
|
||||
editor.fields = current.suggested_field_codes.map((code, index) => code || previousFields[index] || null);
|
||||
message.success(t('admin.shippingOrderProfiles.currentRowSuggestionReady'));
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
} finally {
|
||||
suggestingSubrowIndex.value = null;
|
||||
}
|
||||
};
|
||||
|
||||
/** 对扫描 PDF 生成 OCR 字符坐标,随后重新加载表格并继续人工审核。 */
|
||||
const generateOcrEvidence = async () => {
|
||||
if (!form.document_id || !form.table_id) return;
|
||||
const tableId = form.table_id;
|
||||
ocrGenerating.value = true;
|
||||
try {
|
||||
await generateOrderProfileOcrCoordinateEvidence(form.document_id, form.table_id);
|
||||
reconstructionMethod.value = 'ocr_pdf_coordinates.v1';
|
||||
await loadPreview();
|
||||
form.table_id = preview.value?.tables.some((table) => table.table_id === tableId)
|
||||
? tableId : (preview.value?.tables[0]?.table_id || '');
|
||||
message.success(t('admin.shippingOrderProfiles.ocrEvidenceReady'));
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
} finally {
|
||||
ocrGenerating.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
let reconstructionPreviewTimer: ReturnType<typeof window.setTimeout> | null = null;
|
||||
let reconstructionPreviewRequestId = 0;
|
||||
|
||||
/** 请求只读重建候选;自动刷新静默校验,手动刷新继续给出明确错误。 */
|
||||
const runReconstructionPreview = async (silent = false) => {
|
||||
if (multiSubrowEnabled.value && !subrowEditors.value[0]?.fields.includes('line_no')) {
|
||||
if (!silent) message.error(t('admin.shippingOrderProfiles.lineNoRequired'));
|
||||
return;
|
||||
}
|
||||
const settings = coordinateReconstructionSettings(true);
|
||||
if (!settings || !form.document_id || !form.table_id) {
|
||||
if (!silent) message.error(t('admin.shippingOrderProfiles.reconstructionBoundariesInvalid'));
|
||||
return;
|
||||
}
|
||||
const requestId = ++reconstructionPreviewRequestId;
|
||||
reconstructing.value = true;
|
||||
reconstructionPreviewFailed.value = false;
|
||||
reconstructionConfirmed.value = false;
|
||||
try {
|
||||
const result = await previewOrderProfileCoordinateReconstruction(form.document_id, form.table_id, settings);
|
||||
if (requestId !== reconstructionPreviewRequestId) return;
|
||||
reconstructionPreview.value = result;
|
||||
resizeColumns(reconstructionPreview.value.column_count);
|
||||
if (multiSubrowEnabled.value) {
|
||||
const fieldCodes = multiSubrowLayouts()?.flatMap((item) => item.column_field_codes.filter((code): code is string => Boolean(code))) || [];
|
||||
const uniqueCodes = [...new Set(fieldCodes)];
|
||||
columnRules.value = uniqueCodes.map((target) => ({ extractor_key: 'direct', target }));
|
||||
}
|
||||
reconstructionFieldSignature.value = coordinateFieldSignature();
|
||||
form.header_row_index = 0;
|
||||
form.data_start_row_index = Math.min(1, Math.max(reconstructionPreview.value.row_count - 1, 0));
|
||||
} catch (error) {
|
||||
if (requestId !== reconstructionPreviewRequestId) return;
|
||||
reconstructionPreviewFailed.value = true;
|
||||
if (!silent) showError(error);
|
||||
} finally {
|
||||
if (requestId === reconstructionPreviewRequestId) reconstructing.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 手动重建用于显式复核,并保留完整错误反馈。 */
|
||||
const reconstructTable = () => runReconstructionPreview(false);
|
||||
|
||||
/** 映射编辑停止后自动刷新右侧候选,避免每次选择都产生请求。 */
|
||||
const scheduleReconstructionPreview = () => {
|
||||
if (reconstructionPreviewTimer) window.clearTimeout(reconstructionPreviewTimer);
|
||||
reconstructionPreviewFailed.value = false;
|
||||
reconstructionConfirmed.value = false;
|
||||
if (!multiSubrowEnabled.value || !selectedTable.value?.coordinate_reconstruction_available) return;
|
||||
if (!form.document_id || !form.table_id || !subrowEditors.value[0]?.fields.includes('line_no')) return;
|
||||
if (!coordinateReconstructionSettings(true)) return;
|
||||
reconstructionPreviewTimer = window.setTimeout(() => {
|
||||
reconstructionPreviewTimer = null;
|
||||
void runReconstructionPreview(true);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
/** 转换结构化表单为后端白名单列规则,不提交结构指纹或 HTML。 */
|
||||
@@ -185,6 +519,7 @@ const saveDraft = async () => {
|
||||
profile_code: form.profile_code.trim().toUpperCase(),
|
||||
display_name: form.display_name.trim(),
|
||||
column_rules: form.row_structure === 'preserved' ? normalizedRules() : [],
|
||||
coordinate_reconstruction: reconstructionConfirmed.value ? coordinateReconstructionSettings(true) : null,
|
||||
};
|
||||
if (editingProfileId.value && editingLockVersion.value !== null) {
|
||||
await updateOrderProfileFromSample(editingProfileId.value, {
|
||||
@@ -266,6 +601,26 @@ const removeProfile = async (profile: ShippingOrderDocumentProfile) => {
|
||||
}
|
||||
};
|
||||
|
||||
/** 删除前端专用样本;后端再次校验解析状态、所有权与盲测引用。 */
|
||||
const removeSample = async () => {
|
||||
const sample = selectedSample.value;
|
||||
if (!sample?.can_delete || !window.confirm(t('admin.shippingOrderProfiles.deleteSampleConfirm'))) return;
|
||||
try {
|
||||
await deleteOrderProfileSample(sample.intake_no);
|
||||
await load();
|
||||
form.document_id = samples.value[0]?.document_id || 0;
|
||||
if (!form.document_id) preview.value = null;
|
||||
message.success(t('admin.shippingOrderProfiles.sampleDeleted'));
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
}
|
||||
};
|
||||
|
||||
/** 统一显示上传时间,避免同名样本在下拉框中不可区分。 */
|
||||
const formatSampleTime = (value?: string | null) => (
|
||||
value ? new Intl.DateTimeFormat(undefined, { dateStyle: 'short', timeStyle: 'short' }).format(new Date(value)) : '-'
|
||||
);
|
||||
|
||||
/** 退役当前发布版本;历史运行继续使用冻结快照。 */
|
||||
const retireProfile = async (profile: ShippingOrderDocumentProfile) => {
|
||||
if (!window.confirm(t('admin.shippingOrderProfiles.retireConfirm'))) return;
|
||||
@@ -279,7 +634,29 @@ const retireProfile = async (profile: ShippingOrderDocumentProfile) => {
|
||||
};
|
||||
|
||||
watch(() => form.document_id, loadPreview);
|
||||
watch(() => form.table_id, resetColumns);
|
||||
watch(() => form.table_id, () => {
|
||||
resetCoordinateReconstructionState();
|
||||
resetColumns();
|
||||
});
|
||||
watch(() => form.header_row_index, (headerRowIndex) => {
|
||||
if (form.data_start_row_index <= headerRowIndex) form.data_start_row_index = headerRowIndex + 1;
|
||||
});
|
||||
watch(columnRules, () => {
|
||||
if (reconstructionConfirmed.value && reconstructionFieldSignature.value !== coordinateFieldSignature()) {
|
||||
reconstructionConfirmed.value = false;
|
||||
}
|
||||
}, { deep: true });
|
||||
watch(multiSubrowEnabled, (enabled) => {
|
||||
if (enabled) subrowEditors.value.forEach(syncSubrowFields);
|
||||
reconstructionPreview.value = null;
|
||||
reconstructionPreviewFailed.value = false;
|
||||
reconstructionConfirmed.value = false;
|
||||
scheduleReconstructionPreview();
|
||||
});
|
||||
watch(subrowEditors, () => {
|
||||
if (reconstructionPreview.value) reconstructionConfirmed.value = false;
|
||||
scheduleReconstructionPreview();
|
||||
}, { deep: true });
|
||||
onMounted(load);
|
||||
</script>
|
||||
|
||||
@@ -291,83 +668,242 @@ onMounted(load);
|
||||
<p class="mt-1 text-sm text-slate-500">{{ t('admin.shippingOrderProfiles.subtitle') }}</p>
|
||||
</header>
|
||||
|
||||
<div class="grid gap-6 xl:grid-cols-[420px_minmax(0,1fr)]">
|
||||
<form class="space-y-4 rounded-xl border border-slate-200 bg-white p-5 shadow-sm" @submit.prevent="saveDraft">
|
||||
<div class="flex items-center justify-between gap-3">
|
||||
<div class="space-y-6">
|
||||
<form class="space-y-5 rounded-xl border border-slate-200 bg-white p-5 shadow-sm" @submit.prevent="saveDraft">
|
||||
<div class="flex items-center justify-between gap-3 border-b border-slate-100 pb-4">
|
||||
<h2 class="font-semibold">{{ t(editingProfileId ? 'admin.shippingOrderProfiles.editTitle' : 'admin.shippingOrderProfiles.createTitle') }}</h2>
|
||||
<button v-if="editingProfileId" type="button" class="text-sm text-slate-500" @click="cancelEdit">{{ t('common.cancel') }}</button>
|
||||
<div class="flex items-center gap-2">
|
||||
<button v-if="editingProfileId" type="button" class="h-9 rounded-lg px-3 text-sm text-slate-600 hover:bg-slate-100" @click="cancelEdit">{{ t('common.cancel') }}</button>
|
||||
<button type="submit" :disabled="!canSave || saving" class="h-9 rounded-lg bg-blue-600 px-4 text-sm font-medium text-white hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-50">
|
||||
{{ saving ? t('admin.shippingOrderProfiles.saving') : t(editingProfileId ? 'admin.shippingOrderProfiles.updateDraft' : 'admin.shippingOrderProfiles.createDraft') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<label class="block text-sm">
|
||||
<span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.sample') }}</span>
|
||||
<select v-model.number="form.document_id" class="w-full rounded-lg border border-slate-300 px-3 py-2">
|
||||
<option :value="0">{{ t('admin.shippingOrderProfiles.selectSample') }}</option>
|
||||
<option v-for="sample in samples" :key="sample.document_id" :value="sample.document_id">
|
||||
{{ sample.filename || `Document ${sample.document_id}` }} ({{ sample.table_count }})
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="rounded-lg border border-dashed border-slate-300 p-3">
|
||||
<p class="text-sm text-slate-600">{{ t('admin.shippingOrderProfiles.uploadSampleHint') }}</p>
|
||||
<input ref="sampleInput" class="sr-only" type="file" accept=".pdf,.eml,application/pdf,message/rfc822" @change="uploadSample" />
|
||||
<button type="button" :disabled="sampleUploading" class="mt-2 rounded border border-blue-300 px-3 py-1.5 text-sm text-blue-700 disabled:opacity-50" @click="sampleInput?.click()">
|
||||
{{ sampleUploading ? t('common.loading') : t('admin.shippingOrderProfiles.uploadSample') }}
|
||||
</button>
|
||||
|
||||
<div class="space-y-4">
|
||||
<div class="max-w-[980px]">
|
||||
<label class="block text-xs font-medium text-slate-600">{{ t('admin.shippingOrderProfiles.sample') }}</label>
|
||||
<div class="mt-1.5 flex flex-wrap items-center gap-2">
|
||||
<input v-model="sampleSearch" class="h-9 w-52 rounded-lg border border-slate-300 px-3 text-sm" :placeholder="t('admin.shippingOrderProfiles.searchSample')" />
|
||||
<select v-model.number="form.document_id" class="h-9 min-w-0 flex-1 rounded-lg border border-slate-300 bg-white px-3 text-sm">
|
||||
<option :value="0">{{ t('admin.shippingOrderProfiles.selectSample') }}</option>
|
||||
<option v-for="sample in visibleSamples" :key="sample.document_id" :value="sample.document_id">
|
||||
{{ sample.filename || `Document ${sample.document_id}` }} · {{ formatSampleTime(sample.created_at) }} · {{ sample.parse_status }} · {{ sample.table_count }} {{ t('admin.shippingOrderProfiles.tablesUnit') }}
|
||||
</option>
|
||||
</select>
|
||||
<input ref="sampleInput" class="sr-only" type="file" accept=".pdf,.eml,application/pdf,message/rfc822" @change="uploadSample" />
|
||||
<button type="button" :disabled="sampleUploading" class="h-9 shrink-0 rounded-lg border border-blue-200 px-3 text-sm font-medium text-blue-700 hover:bg-blue-50 disabled:opacity-50" @click="sampleInput?.click()">
|
||||
{{ sampleUploading ? t('common.loading') : t('admin.shippingOrderProfiles.uploadSample') }}
|
||||
</button>
|
||||
<button type="button" :disabled="!selectedSample?.can_delete" class="h-9 shrink-0 rounded-lg border border-red-200 px-3 text-sm font-medium text-red-600 hover:bg-red-50 disabled:cursor-not-allowed disabled:border-slate-200 disabled:text-slate-400" @click="removeSample">
|
||||
{{ t('admin.shippingOrderProfiles.deleteSample') }}
|
||||
</button>
|
||||
</div>
|
||||
<p v-if="selectedSample" class="mt-1.5 text-xs text-slate-500">
|
||||
{{ t('admin.shippingOrderProfiles.sampleDetails', { time: formatSampleTime(selectedSample.created_at), status: selectedSample.parse_status }) }}
|
||||
· {{ selectedSample.is_template_sample ? t('admin.shippingOrderProfiles.templateSampleOnly') : t('admin.shippingOrderProfiles.businessSampleProtected') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-end gap-x-3 gap-y-3">
|
||||
<label class="w-44 text-xs font-medium text-slate-600">
|
||||
<span class="mb-1.5 block">{{ t('admin.shippingOrderProfiles.table') }}</span>
|
||||
<select v-model="form.table_id" class="h-9 w-full rounded-lg border border-slate-300 bg-white px-2.5 text-sm" :disabled="!preview">
|
||||
<option value="">{{ t('admin.shippingOrderProfiles.selectTable') }}</option>
|
||||
<option v-for="table in preview?.tables || []" :key="table.table_id" :value="table.table_id">P{{ table.page_no }} · {{ table.row_count }}×{{ table.column_count }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="w-52 text-xs font-medium text-slate-600">
|
||||
<span class="mb-1.5 block">{{ t('admin.shippingOrderProfiles.schema') }}</span>
|
||||
<select v-model.number="form.schema_version_id" :disabled="Boolean(editingProfileId)" class="h-9 w-full rounded-lg border border-slate-300 bg-white px-2.5 text-sm disabled:bg-slate-100">
|
||||
<option v-for="schema in publishedSchemas" :key="schema.id" :value="schema.id">v{{ schema.version }} · {{ schema.status }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="w-44 text-xs font-medium text-slate-600">
|
||||
<span class="mb-1.5 block">{{ t('admin.shippingOrderProfiles.code') }}</span>
|
||||
<input v-model="form.profile_code" :disabled="Boolean(editingProfileId)" class="h-9 w-full rounded-lg border border-slate-300 px-2.5 text-sm disabled:bg-slate-100" />
|
||||
</label>
|
||||
<label class="w-72 text-xs font-medium text-slate-600">
|
||||
<span class="mb-1.5 block">{{ t('admin.shippingOrderProfiles.name') }}</span>
|
||||
<input v-model="form.display_name" class="h-9 w-full rounded-lg border border-slate-300 px-2.5 text-sm" />
|
||||
</label>
|
||||
<label class="mb-2 flex items-center gap-2 whitespace-nowrap text-sm text-slate-700"><input v-model="form.drop_zero_qty" type="checkbox" />{{ t('admin.shippingOrderProfiles.dropZeroQty') }}</label>
|
||||
</div>
|
||||
|
||||
<details class="max-w-[980px] rounded-lg border border-slate-200 bg-slate-50 px-3 py-2">
|
||||
<summary class="cursor-pointer text-sm font-medium text-slate-700">{{ t('admin.shippingOrderProfiles.advancedSettings') }}</summary>
|
||||
<div class="mt-3 flex flex-wrap items-end gap-3 border-t border-slate-200 pt-3">
|
||||
<label class="w-72 text-xs font-medium text-slate-600"><span class="mb-1.5 block">{{ t('admin.shippingOrderProfiles.rowStructure') }}</span><select v-model="form.row_structure" class="h-9 w-full rounded-lg border border-slate-300 bg-white px-2.5 text-sm"><option value="preserved">{{ t('admin.shippingOrderProfiles.rowPreserved') }}</option><option value="unsupported_row_structure">{{ t('admin.shippingOrderProfiles.rowUnsupported') }}</option></select></label>
|
||||
<label class="w-36 text-xs font-medium text-slate-600"><span class="mb-1.5 block">{{ t('admin.shippingOrderProfiles.headerRow') }}</span><input v-model.number="form.header_row_index" type="number" min="0" :max="Math.max((displayedTable?.row_count || 1) - 2, 0)" class="h-9 w-full rounded-lg border border-slate-300 px-2.5 text-sm" /></label>
|
||||
<label class="w-32 text-xs font-medium text-slate-600"><span class="mb-1.5 block">{{ t('admin.shippingOrderProfiles.dataRow') }}</span><input v-model.number="form.data_start_row_index" type="number" :min="form.header_row_index + 1" :max="Math.max((displayedTable?.row_count || 1) - 1, 0)" class="h-9 w-full rounded-lg border border-slate-300 px-2.5 text-sm" /></label>
|
||||
<label v-if="editingProfileId" class="w-80 text-xs font-medium text-slate-600"><span class="mb-1.5 block">{{ t('admin.shippingOrderProfiles.changeNote') }}</span><input v-model="form.change_note" class="h-9 w-full rounded-lg border border-slate-300 px-2.5 text-sm" /></label>
|
||||
</div>
|
||||
</details>
|
||||
</div>
|
||||
<label class="block text-sm">
|
||||
<span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.table') }}</span>
|
||||
<select v-model="form.table_id" class="w-full rounded-lg border border-slate-300 px-3 py-2" :disabled="!preview">
|
||||
<option value="">{{ t('admin.shippingOrderProfiles.selectTable') }}</option>
|
||||
<option v-for="table in preview?.tables || []" :key="table.table_id" :value="table.table_id">
|
||||
P{{ table.page_no }} · {{ table.row_count }}×{{ table.column_count }}
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<label class="text-sm"><span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.code') }}</span><input v-model="form.profile_code" :disabled="Boolean(editingProfileId)" class="w-full rounded-lg border border-slate-300 px-3 py-2 disabled:bg-slate-100" /></label>
|
||||
<label class="text-sm"><span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.name') }}</span><input v-model="form.display_name" class="w-full rounded-lg border border-slate-300 px-3 py-2" /></label>
|
||||
|
||||
<div v-if="selectedTable && !selectedTable.profile_creation_allowed" class="overflow-hidden rounded-xl border border-slate-200 bg-slate-50">
|
||||
<div class="flex items-start gap-3 border-b border-slate-200 bg-white px-4 py-3">
|
||||
<span class="mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-amber-100 text-sm font-bold text-amber-700">!</span>
|
||||
<div>
|
||||
<p class="text-sm font-semibold text-slate-900">{{ t('admin.shippingOrderProfiles.reconstructionRequired') }}</p>
|
||||
<p v-if="selectedTable.coordinate_reconstruction_available" class="mt-1 text-xs leading-5 text-slate-500">{{ t('admin.shippingOrderProfiles.autoSuggestLayoutHint') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="selectedTable.coordinate_reconstruction_available">
|
||||
<label class="flex items-center gap-2 border-b border-slate-200 px-4 py-2.5 text-sm font-medium text-slate-700">
|
||||
<input v-model="multiSubrowEnabled" type="checkbox" />
|
||||
{{ t('admin.shippingOrderProfiles.multiSubrowEnabled') }}
|
||||
</label>
|
||||
<label v-if="!multiSubrowEnabled" class="block p-4 text-xs"><span class="mb-1 block">{{ t('admin.shippingOrderProfiles.columnBoundaries') }}</span><input v-model="columnBoundaryInput" class="w-full rounded-lg border border-slate-300 bg-white px-3 py-2" /></label>
|
||||
<div v-else class="p-3">
|
||||
<div class="grid min-w-0 gap-3 lg:grid-cols-[180px_minmax(0,1fr)]">
|
||||
<aside class="overflow-hidden rounded-lg border border-slate-200 bg-white">
|
||||
<div class="border-b border-slate-200 px-3 py-2 text-xs font-semibold text-slate-600">{{ t('admin.shippingOrderProfiles.physicalRows') }}</div>
|
||||
<div class="p-1.5">
|
||||
<button v-for="(editor, editorIndex) in subrowEditors" :key="editor.row_offset" type="button" class="mb-1 flex h-9 w-full items-center justify-between rounded-md px-2.5 text-left text-sm last:mb-0" :class="selectedSubrowIndex === editorIndex ? 'bg-blue-50 font-medium text-blue-700' : 'text-slate-700 hover:bg-slate-50'" @click="selectedSubrowIndex = editorIndex">
|
||||
<span>{{ t(editorIndex === 0 ? 'admin.shippingOrderProfiles.firstSubrow' : 'admin.shippingOrderProfiles.followingSubrow', { index: editorIndex + 1 }) }}</span>
|
||||
<span class="text-xs opacity-60">{{ editor.fields.length }}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex border-t border-slate-200 p-1.5">
|
||||
<button type="button" class="h-8 flex-1 rounded-md text-xs font-medium text-blue-700 hover:bg-blue-50" @click="addSubrow">+ {{ t('admin.shippingOrderProfiles.addSubrow') }}</button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<section v-if="selectedSubrow" class="min-w-0 overflow-hidden rounded-lg border border-slate-200 bg-white">
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 border-b border-slate-200 px-3 py-2">
|
||||
<div><span class="text-sm font-semibold text-slate-900">{{ t(selectedSubrowIndex === 0 ? 'admin.shippingOrderProfiles.firstSubrow' : 'admin.shippingOrderProfiles.followingSubrow', { index: selectedSubrowIndex + 1 }) }}</span><span class="ml-2 text-xs text-slate-400">{{ selectedSubrow.fields.length }} {{ t('admin.shippingOrderProfiles.columnsUnit') }}</span></div>
|
||||
<div class="flex items-center gap-1.5">
|
||||
<button type="button" :disabled="suggestingSubrowIndex !== null" class="h-8 rounded-md border border-blue-200 px-2.5 text-xs font-medium text-blue-700 hover:bg-blue-50 disabled:opacity-50" @click="suggestCurrentSubrow">{{ suggestingSubrowIndex === selectedSubrow.row_offset ? t('common.loading') : t('admin.shippingOrderProfiles.suggestCurrentRow') }}</button>
|
||||
<button v-if="selectedSubrowIndex > 0" type="button" class="h-8 rounded-md px-2.5 text-xs font-medium text-red-600 hover:bg-red-50" @click="removeSubrow(selectedSubrowIndex)">{{ t('common.delete') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-3">
|
||||
<div class="mb-2 flex items-center justify-between text-[11px] font-medium text-slate-500">
|
||||
<span>{{ t('admin.shippingOrderProfiles.visualBoundaries') }}</span>
|
||||
<span>{{ t('admin.shippingOrderProfiles.dragBoundaryHint') }}</span>
|
||||
</div>
|
||||
<div class="relative h-12 rounded-md border border-slate-300 bg-slate-50 px-1 pt-1">
|
||||
<div class="flex h-7 overflow-hidden rounded border border-white bg-white shadow-sm">
|
||||
<div v-for="(_, index) in selectedSubrow.fields" :key="index" class="flex min-w-0 items-center justify-center border-r border-blue-100 bg-blue-50/60 px-1 text-[10px] font-medium text-blue-700 last:border-r-0" :style="{ width: `${(subrowBoundaries(selectedSubrow)[index + 1]! - subrowBoundaries(selectedSubrow)[index]!) * 100}%` }">
|
||||
<span class="truncate">{{ index + 1 }} · {{ Math.round((subrowBoundaries(selectedSubrow)[index + 1]! - subrowBoundaries(selectedSubrow)[index]!) * 100) }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
<template v-for="(boundary, boundaryIndex) in subrowBoundaries(selectedSubrow).slice(1, -1)" :key="boundaryIndex">
|
||||
<span class="pointer-events-none absolute bottom-1 top-1 w-px bg-blue-500" :style="{ left: `${boundary * 100}%` }" />
|
||||
<input :value="boundary" type="range" min="0.01" max="0.99" step="0.01" class="boundary-slider absolute inset-x-0 top-5 h-5 w-full" :aria-label="t('admin.shippingOrderProfiles.boundaryHandle', { index: boundaryIndex + 1 })" @input="updateSubrowBoundary(selectedSubrow, boundaryIndex + 1, ($event.target as HTMLInputElement).value)" />
|
||||
</template>
|
||||
</div>
|
||||
<div class="mt-3 flex gap-2 overflow-x-auto pb-2">
|
||||
<article v-for="(_, index) in selectedSubrow.fields" :key="index" class="w-52 shrink-0 rounded-lg border border-slate-200 bg-slate-50 p-2.5">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<span class="text-xs font-semibold text-slate-700">{{ t('admin.shippingOrderProfiles.subrowColumn', { index: index + 1 }) }}</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<button type="button" :disabled="!canSplitSubrowColumn(selectedSubrow, index)" class="rounded px-1.5 py-0.5 text-[11px] font-medium text-blue-700 hover:bg-blue-50 disabled:cursor-not-allowed disabled:text-slate-300 disabled:hover:bg-transparent" @click="addSubrowColumn(selectedSubrow, index)">+ {{ t('admin.shippingOrderProfiles.insertColumnAfter') }}</button>
|
||||
<button v-if="selectedSubrow.fields.length > 1" type="button" class="rounded px-1.5 py-0.5 text-[11px] text-red-600 hover:bg-red-50" @click="removeSubrowColumn(selectedSubrow, index)">{{ t('common.delete') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-2 truncate rounded-md bg-white px-2 py-1.5 text-xs text-slate-500" :title="selectedSubrow.samples[index]?.join(' / ') || '-'">{{ selectedSubrow.samples[index]?.join(' / ') || '-' }}</div>
|
||||
<select v-model="selectedSubrow.fields[index]" class="mt-2 h-8 w-full rounded-md border border-slate-300 bg-white px-2 text-xs">
|
||||
<option :value="null">{{ t('admin.shippingOrderProfiles.ignoreColumn') }}</option>
|
||||
<option v-for="field in lineFields" :key="field.field_id" :value="field.field_code">{{ field.display_name }} · {{ field.field_code }}</option>
|
||||
</select>
|
||||
<div class="mt-2 font-mono text-[10px] text-slate-400">{{ Math.round(subrowBoundaries(selectedSubrow)[index]! * 100) }}%–{{ Math.round(subrowBoundaries(selectedSubrow)[index + 1]! * 100) }}%</div>
|
||||
</article>
|
||||
</div>
|
||||
<details class="mt-2 text-[11px] text-slate-500">
|
||||
<summary class="cursor-pointer select-none font-medium">{{ t('admin.shippingOrderProfiles.preciseBoundaryValues') }}</summary>
|
||||
<input v-model="selectedSubrow.boundaries" class="mt-1.5 w-full rounded-md border border-slate-300 bg-white px-2 py-1.5 font-mono text-[11px]" @change="syncSubrowFields(selectedSubrow)" />
|
||||
</details>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<div class="mt-3 flex flex-wrap items-center gap-2 rounded-lg border border-slate-200 bg-white p-2">
|
||||
<button type="button" :disabled="suggesting" class="h-8 rounded-md border border-blue-200 px-2.5 text-xs font-medium text-blue-700 hover:bg-blue-50 disabled:opacity-50" @click="suggestLayouts">{{ suggesting ? t('common.loading') : t('admin.shippingOrderProfiles.autoSuggestAllRows') }}</button>
|
||||
<button type="button" :disabled="reconstructing" class="h-8 rounded-md bg-blue-600 px-3 text-xs font-medium text-white hover:bg-blue-700 disabled:opacity-50" @click="reconstructTable">{{ t('admin.shippingOrderProfiles.reconstructTable') }}</button>
|
||||
</div>
|
||||
<aside class="mt-3 min-w-0 overflow-hidden rounded-lg border border-slate-200 bg-white">
|
||||
<div class="flex items-center justify-between gap-3 border-b border-slate-200 px-3 py-2">
|
||||
<div>
|
||||
<h3 class="text-sm font-semibold text-slate-900">{{ t('admin.shippingOrderProfiles.livePreview') }}</h3>
|
||||
<p class="mt-0.5 text-[11px]" :class="reconstructionPreviewFailed ? 'text-red-600' : reconstructing ? 'text-blue-600' : 'text-slate-500'">{{ t(`admin.shippingOrderProfiles.${livePreviewStatusKey}`) }}</p>
|
||||
</div>
|
||||
<label v-if="reconstructionPreview" class="flex shrink-0 items-center gap-1.5 text-xs font-medium text-slate-700"><input v-model="reconstructionConfirmed" type="checkbox" />{{ t('admin.shippingOrderProfiles.confirmPreview') }}</label>
|
||||
</div>
|
||||
<div class="max-h-[52vh] min-h-56 overflow-auto">
|
||||
<table v-if="reconstructionPreview" class="min-w-full border-collapse text-xs">
|
||||
<tbody>
|
||||
<tr v-for="(row, rowIndex) in reconstructionPreview.rows" :key="rowIndex" :class="displayedRowRole(rowIndex) === 'deleted' ? 'bg-red-50 text-slate-500' : rowIndex === form.header_row_index ? 'bg-blue-50 font-semibold' : ''">
|
||||
<td class="sticky left-0 min-w-20 border border-slate-200 bg-slate-50 px-2 py-1.5 text-[11px] text-slate-500">
|
||||
<div>{{ t(`admin.shippingOrderProfiles.rowRole.${displayedRowRole(rowIndex)}`) }}</div>
|
||||
<div v-if="displayedSourceRows(rowIndex).length" class="mt-0.5">{{ displayedSourceRows(rowIndex).map((value) => value + 1).join(', ') }}</div>
|
||||
</td>
|
||||
<td v-for="(cell, columnIndex) in row" :key="columnIndex" class="max-w-52 whitespace-nowrap border border-slate-200 px-2 py-1.5" :title="cell">{{ cell }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div v-else class="flex min-h-56 items-center justify-center px-6 text-center text-xs leading-5 text-slate-500">{{ t(`admin.shippingOrderProfiles.${livePreviewStatusKey}`) }}</div>
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center justify-between gap-2 border-t border-slate-200 bg-white px-4 py-2.5">
|
||||
<p class="text-[11px] text-slate-500">{{ t('admin.shippingOrderProfiles.multiSubrowHint') }}</p>
|
||||
<p v-if="reconstructionPreview && !reconstructionMatchesFields" class="text-[11px] font-medium text-amber-700">{{ t('admin.shippingOrderProfiles.rebuildAfterFieldMapping') }}</p>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="flex flex-wrap items-center justify-between gap-3 p-4">
|
||||
<p class="text-xs text-amber-900">{{ t('admin.shippingOrderProfiles.reconstructionUnavailable') }}</p>
|
||||
<button type="button" :disabled="ocrGenerating" class="rounded-lg border border-amber-500 bg-white px-3 py-2 text-sm text-amber-900 disabled:opacity-50" @click="generateOcrEvidence">{{ ocrGenerating ? t('common.loading') : t('admin.shippingOrderProfiles.generateOcrEvidence') }}</button>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<label class="block text-sm">
|
||||
<span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.schema') }}</span>
|
||||
<select v-model.number="form.schema_version_id" :disabled="Boolean(editingProfileId)" class="w-full rounded-lg border border-slate-300 px-3 py-2 disabled:bg-slate-100">
|
||||
<option v-for="schema in publishedSchemas" :key="schema.id" :value="schema.id">v{{ schema.version }} · {{ schema.status }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="block text-sm">
|
||||
<span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.rowStructure') }}</span>
|
||||
<select v-model="form.row_structure" class="w-full rounded-lg border border-slate-300 px-3 py-2">
|
||||
<option value="preserved">{{ t('admin.shippingOrderProfiles.rowPreserved') }}</option>
|
||||
<option value="unsupported_row_structure">{{ t('admin.shippingOrderProfiles.rowUnsupported') }}</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="grid grid-cols-2 gap-3">
|
||||
<label class="text-sm"><span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.headerRow') }}</span><input v-model.number="form.header_row_index" type="number" min="0" class="w-full rounded-lg border border-slate-300 px-3 py-2" /></label>
|
||||
<label class="text-sm"><span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.dataRow') }}</span><input v-model.number="form.data_start_row_index" type="number" min="1" class="w-full rounded-lg border border-slate-300 px-3 py-2" /></label>
|
||||
</div>
|
||||
<label class="flex items-center gap-2 text-sm"><input v-model="form.drop_zero_qty" type="checkbox" />{{ t('admin.shippingOrderProfiles.dropZeroQty') }}</label>
|
||||
<label class="block text-sm">
|
||||
<span class="mb-1 block text-slate-600">{{ t('admin.shippingOrderProfiles.changeNote') }}</span>
|
||||
<textarea v-model="form.change_note" rows="2" class="w-full rounded-lg border border-slate-300 px-3 py-2" />
|
||||
</label>
|
||||
<p v-if="duplicateTargets.length" class="rounded-lg bg-red-50 px-3 py-2 text-sm text-red-700">
|
||||
{{ t('admin.shippingOrderProfiles.duplicateTargets', { fields: duplicateTargets.join(', ') }) }}
|
||||
</p>
|
||||
<p v-if="selectedTable && !selectedTable.profile_creation_allowed" class="rounded-lg bg-amber-50 px-3 py-2 text-sm text-amber-800">
|
||||
<p v-if="selectedTable && !selectedTable.profile_creation_allowed && !reconstructionConfirmed" class="rounded-lg bg-amber-50 px-3 py-2 text-sm text-amber-800">
|
||||
{{ t('admin.shippingOrderProfiles.structureBlocked') }}
|
||||
</p>
|
||||
<button type="submit" :disabled="!canSave || saving" class="w-full rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white disabled:opacity-50">
|
||||
{{ saving ? t('admin.shippingOrderProfiles.saving') : t(editingProfileId ? 'admin.shippingOrderProfiles.updateDraft' : 'admin.shippingOrderProfiles.createDraft') }}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<div class="min-w-0 space-y-4">
|
||||
<div class="overflow-auto rounded-xl border border-slate-200 bg-white shadow-sm">
|
||||
<table v-if="selectedTable" class="min-w-full border-collapse text-sm">
|
||||
<div v-if="showStandardPreview" class="min-w-0 space-y-4">
|
||||
<section v-if="displayedTable && form.header_row_index > 0 && form.row_structure === 'preserved'" class="overflow-hidden rounded-xl border border-blue-200 bg-white shadow-sm">
|
||||
<div class="border-b border-blue-100 bg-blue-50 px-4 py-3">
|
||||
<h3 class="text-sm font-semibold text-slate-900">{{ t('admin.shippingOrderProfiles.multiRowHeaderMapping') }}</h3>
|
||||
<p class="mt-1 text-xs text-slate-600">{{ t('admin.shippingOrderProfiles.multiRowHeaderHint', { end: form.header_row_index }) }}</p>
|
||||
</div>
|
||||
<div class="flex gap-2 overflow-x-auto p-3">
|
||||
<article v-for="(label, columnIndex) in mergedHeaderLabels" :key="columnIndex" class="w-52 shrink-0 rounded-lg border border-slate-200 bg-slate-50 p-2.5">
|
||||
<div class="text-[11px] font-semibold text-slate-500">{{ t('admin.shippingOrderProfiles.mergedHeaderColumn', { index: columnIndex + 1 }) }}</div>
|
||||
<div class="mt-1 min-h-10 break-words text-xs font-medium leading-5 text-slate-800">{{ label || '-' }}</div>
|
||||
<select v-model="columnRule(columnIndex).target" class="mt-2 h-8 w-full rounded-md border border-slate-300 bg-white px-2 text-xs">
|
||||
<option value="">{{ t('admin.shippingOrderProfiles.ignoreColumn') }}</option>
|
||||
<option v-for="field in lineFields" :key="field.field_id" :value="field.field_code">{{ field.display_name }} · {{ field.field_code }}</option>
|
||||
</select>
|
||||
<select v-model="columnRule(columnIndex).extractor_key" class="mt-2 h-8 w-full rounded-md border border-slate-300 bg-white px-2 text-xs">
|
||||
<option value="direct">{{ t('admin.shippingOrderProfiles.direct') }}</option>
|
||||
<option value="temp_internal_parts" :disabled="!compositeExtractorAvailable">{{ t('admin.shippingOrderProfiles.compositePart') }}</option>
|
||||
</select>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
<div class="max-h-[70vh] overflow-auto rounded-xl border border-slate-200 bg-white shadow-sm">
|
||||
<div v-if="reconstructionPreview" class="border-b border-amber-200 bg-amber-50 px-3 py-2 text-sm text-amber-900">{{ t('admin.shippingOrderProfiles.reconstructionPreview') }}</div>
|
||||
<table v-if="displayedTable" class="min-w-full border-collapse text-sm">
|
||||
<tbody>
|
||||
<tr v-for="(row, rowIndex) in selectedTable.rows" :key="rowIndex" :class="rowIndex === form.header_row_index ? 'bg-blue-50 font-semibold' : ''">
|
||||
<td class="sticky left-0 border border-slate-200 bg-slate-50 px-2 py-2 text-xs text-slate-500">{{ rowIndex }}</td>
|
||||
<tr v-for="(row, rowIndex) in displayedTable.rows" :key="rowIndex" :class="rowIndex <= form.header_row_index ? 'bg-blue-50 font-semibold' : displayedRowRole(rowIndex) === 'deleted' ? 'bg-red-50 text-slate-500' : ''">
|
||||
<td class="sticky left-0 min-w-24 border border-slate-200 bg-slate-50 px-2 py-2 text-xs text-slate-500">
|
||||
<div>{{ rowIndex }}</div>
|
||||
<div v-if="reconstructionPreview" class="mt-1 font-medium" :class="displayedRowRole(rowIndex) === 'deleted' ? 'text-red-600' : 'text-emerald-700'">
|
||||
{{ t(`admin.shippingOrderProfiles.rowRole.${displayedRowRole(rowIndex)}`) }}
|
||||
</div>
|
||||
<div v-if="displayedSourceRows(rowIndex).length" class="mt-1 text-[11px]">
|
||||
{{ t('admin.shippingOrderProfiles.sourceRows', { rows: displayedSourceRows(rowIndex).map((value) => value + 1).join(', ') }) }}
|
||||
</div>
|
||||
</td>
|
||||
<td v-for="(cell, columnIndex) in row" :key="columnIndex" class="max-w-[260px] border border-slate-200 px-3 py-2 align-top">
|
||||
<div class="break-words">{{ cell }}</div>
|
||||
<div v-if="rowIndex === form.header_row_index && form.row_structure === 'preserved'" class="mt-2 space-y-1">
|
||||
<div v-if="rowIndex === form.header_row_index && form.header_row_index === 0 && form.row_structure === 'preserved' && !multiSubrowEnabled" class="mt-2 space-y-1">
|
||||
<div v-if="columnRule(columnIndex).extractor_key === 'temp_internal_parts'" class="rounded bg-slate-100 px-2 py-1 text-xs text-slate-600">
|
||||
customer_part_number + part_number
|
||||
</div>
|
||||
@@ -380,6 +916,9 @@ onMounted(load);
|
||||
<option value="temp_internal_parts" :disabled="!compositeExtractorAvailable">{{ t('admin.shippingOrderProfiles.compositePart') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div v-else-if="rowIndex === form.header_row_index && multiSubrowEnabled" class="mt-2 rounded bg-slate-100 px-2 py-1 text-xs text-slate-600">
|
||||
{{ cell }}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -394,7 +933,7 @@ onMounted(load);
|
||||
<div v-if="loading" class="p-6 text-sm text-slate-500">{{ t('common.loading') }}</div>
|
||||
<div v-else class="divide-y divide-slate-100">
|
||||
<div v-for="profile in profiles" :key="profile.id" class="flex flex-wrap items-center justify-between gap-3 px-5 py-4">
|
||||
<div><div class="font-medium">{{ profile.display_name }} · v{{ profile.version }}</div><div class="text-xs text-slate-500">{{ profile.profile_code }} · Schema v{{ profile.schema_version }} · {{ profile.status }}<span v-if="profile.change_note"> · {{ profile.change_note }}</span></div></div>
|
||||
<div><div class="font-medium">{{ profile.display_name }} · v{{ profile.version }} <span v-if="currentProfileIds.has(profile.id)" class="rounded bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-800">{{ t('admin.shippingOrderProfiles.currentVersion') }}</span></div><div class="text-xs text-slate-500">{{ profile.profile_code }} · Schema v{{ profile.schema_version }} · {{ profile.status }}<span v-if="profile.published_at"> · {{ t('admin.shippingOrderProfiles.publishedAt', { time: formatSampleTime(profile.published_at) }) }}</span><span v-if="profile.change_note"> · {{ profile.change_note }}</span></div></div>
|
||||
<div class="flex gap-2">
|
||||
<button v-if="profile.status === 'draft'" class="rounded border border-slate-300 px-3 py-1.5 text-sm text-slate-700" @click="editDraft(profile)">{{ t('common.edit') }}</button>
|
||||
<button v-if="profile.status === 'draft'" class="rounded border border-blue-300 px-3 py-1.5 text-sm text-blue-700" @click="publishProfile(profile)">{{ t('admin.shippingOrderProfiles.publish') }}</button>
|
||||
@@ -408,3 +947,45 @@ onMounted(load);
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.boundary-slider {
|
||||
appearance: none;
|
||||
background: transparent;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.boundary-slider::-webkit-slider-runnable-track {
|
||||
height: 1px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.boundary-slider::-webkit-slider-thumb {
|
||||
width: 12px;
|
||||
height: 20px;
|
||||
margin-top: -10px;
|
||||
appearance: none;
|
||||
border: 2px solid white;
|
||||
border-radius: 4px;
|
||||
background: #2563eb;
|
||||
box-shadow: 0 0 0 1px #2563eb;
|
||||
cursor: ew-resize;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.boundary-slider::-moz-range-track {
|
||||
height: 1px;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.boundary-slider::-moz-range-thumb {
|
||||
width: 10px;
|
||||
height: 18px;
|
||||
border: 2px solid white;
|
||||
border-radius: 4px;
|
||||
background: #2563eb;
|
||||
box-shadow: 0 0 0 1px #2563eb;
|
||||
cursor: ew-resize;
|
||||
pointer-events: auto;
|
||||
}
|
||||
</style>
|
||||
+24
-1
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/admin/modules/shipping-order-document-profiles/orderProfileForm.utils.spec.ts
|
||||
* 用途:验证可视化订单模板表单只生成受控规则并阻止目标字段重复映射。
|
||||
* 用途:验证可视化订单模板表单生成受控规则,并确保切换样本时配置入口不会消失。
|
||||
* 依赖:Vitest、orderProfileForm.utils。
|
||||
* 逻辑:覆盖 direct、复合解析器开关及跨列冲突,避免无效配置进入后端。
|
||||
*/
|
||||
@@ -9,6 +9,8 @@ import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
buildOrderProfileColumnRules,
|
||||
findDuplicateOrderProfileTargets,
|
||||
mergeOrderProfileHeaderLabels,
|
||||
shouldShowStandardOrderProfilePreview,
|
||||
} from './orderProfileForm.utils';
|
||||
|
||||
describe('order profile form rules', () => {
|
||||
@@ -45,4 +47,25 @@ describe('order profile form rules', () => {
|
||||
{ extractor_key: 'temp_internal_parts', target: '' },
|
||||
], false)).toEqual([]);
|
||||
});
|
||||
|
||||
it('keeps directly configurable tables visible despite stale multi-row state', () => {
|
||||
// 断言上一张表残留的多物理行开关不能隐藏当前可直接配置的表格。
|
||||
expect(shouldShowStandardOrderProfilePreview(true, true, true)).toBe(true);
|
||||
expect(shouldShowStandardOrderProfilePreview(false, true, true)).toBe(false);
|
||||
});
|
||||
|
||||
it('merges every physical header row into stable logical column labels', () => {
|
||||
const labels = mergeOrderProfileHeaderLabels([
|
||||
['Item', 'Material', 'Vendor Part Number'],
|
||||
['Item', 'Description', ''],
|
||||
['IncoTerm', '', 'Manufacturer Part'],
|
||||
], 2, 3);
|
||||
|
||||
// 断言同列跨行文字按顺序合并,并去掉展开 rowspan 产生的重复标签。
|
||||
expect(labels).toEqual([
|
||||
'Item / IncoTerm',
|
||||
'Material / Description',
|
||||
'Vendor Part Number / Manufacturer Part',
|
||||
]);
|
||||
});
|
||||
});
|
||||
+34
-1
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* features/admin/modules/shipping-order-document-profiles/orderProfileForm.utils.ts
|
||||
* 用途:构造可视化订单模板的白名单列规则,并在提交前发现目标字段冲突。
|
||||
* 用途:构造可视化订单模板的白名单列规则,并控制样本表格配置区的安全显示。
|
||||
* 依赖:订单 Profile DTO。
|
||||
* 逻辑:页面状态只允许 direct 或已注册复合解析器;同一目标字段跨列只能出现一次。
|
||||
*/
|
||||
@@ -12,6 +12,39 @@ export interface OrderProfileColumnSelection {
|
||||
target: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否显示普通表格预览;可直接创建 Profile 的表格不受上一张表多物理行状态影响。
|
||||
* @param profileCreationAllowed - 当前表格是否可直接创建 Profile
|
||||
* @param multiSubrowEnabled - 当前是否启用多物理行坐标重建
|
||||
* @param coordinateReconstructionAvailable - 当前表格是否具备坐标重建证据
|
||||
* @returns 为 true 时显示普通表格及字段配置入口
|
||||
*/
|
||||
export const shouldShowStandardOrderProfilePreview = (
|
||||
profileCreationAllowed: boolean,
|
||||
multiSubrowEnabled: boolean,
|
||||
coordinateReconstructionAvailable: boolean,
|
||||
): boolean => (
|
||||
profileCreationAllowed || !multiSubrowEnabled || !coordinateReconstructionAvailable
|
||||
);
|
||||
|
||||
/**
|
||||
* 将表头区域内同一逻辑列的多行文字合并为虚拟列头,重复的 rowspan/colspan 文本只保留一次。
|
||||
* @param rows - 后端展开后的样本表格行
|
||||
* @param headerRowIndex - 最后一行表头的零基索引
|
||||
* @param columnCount - 表格逻辑列数
|
||||
* @returns 与逻辑列一一对应的合并表头文字
|
||||
*/
|
||||
export const mergeOrderProfileHeaderLabels = (
|
||||
rows: string[][], headerRowIndex: number, columnCount: number,
|
||||
): string[] => Array.from({ length: columnCount }, (_, columnIndex) => {
|
||||
const labels: string[] = [];
|
||||
rows.slice(0, Math.max(headerRowIndex + 1, 0)).forEach((row) => {
|
||||
const label = String(row[columnIndex] || '').replace(/\s+/g, ' ').trim();
|
||||
if (label && !labels.some((item) => item.toLowerCase() === label.toLowerCase())) labels.push(label);
|
||||
});
|
||||
return labels.join(' / ');
|
||||
});
|
||||
|
||||
/** 将逐列选择转换为后端白名单规则;不可用的复合解析器不会进入请求。 */
|
||||
export const buildOrderProfileColumnRules = (
|
||||
selections: OrderProfileColumnSelection[], compositeExtractorAvailable: boolean,
|
||||
|
||||
+104
-1
@@ -15,6 +15,7 @@ import { useMessage } from '@/shared/composables/useMessage';
|
||||
import {
|
||||
createShippingOrderField,
|
||||
createShippingOrderSchemaDraft,
|
||||
createShippingFulfillmentPolicyDraft,
|
||||
deleteShippingOrderField,
|
||||
deleteShippingOrderSchemaDraft,
|
||||
getShippingOrderSchemaVersion,
|
||||
@@ -22,10 +23,12 @@ import {
|
||||
getShippingOrderSchemaVersionUsage,
|
||||
getShippingOrderExtractionAudit,
|
||||
getShippingOrderSchemaState,
|
||||
getShippingFulfillmentPolicyState,
|
||||
initializeShippingOrderSchema,
|
||||
listShippingOrderSchemaVersions,
|
||||
listShippingOrderSchemaAuditEvents,
|
||||
publishShippingOrderSchemaDraft,
|
||||
publishShippingFulfillmentPolicy,
|
||||
reorderShippingOrderFields,
|
||||
saveShippingOrderSchemaDraft,
|
||||
saveShippingOrderAutoCreationPolicy,
|
||||
@@ -48,6 +51,7 @@ import type {
|
||||
ShippingOrderSchemaVersionDiff,
|
||||
ShippingOrderSchemaVersionUsage,
|
||||
ShippingOrderExtractionAudit,
|
||||
ShippingFulfillmentPolicyState,
|
||||
} from '@/features/admin/types/shipping-order-schema.types';
|
||||
|
||||
type DraftFieldEditor = ShippingOrderFieldConfig & { enabled: boolean };
|
||||
@@ -100,6 +104,9 @@ const selectedVersionUsage = ref<ShippingOrderSchemaVersionUsage | null>(null);
|
||||
const extractionAuditOpen = ref(false);
|
||||
const extractionAuditLoading = ref(false);
|
||||
const selectedExtractionAudit = ref<ShippingOrderExtractionAudit | null>(null);
|
||||
const fulfillmentPolicyState = ref<ShippingFulfillmentPolicyState | null>(null);
|
||||
const fulfillmentPolicyNote = ref('');
|
||||
const fulfillmentBindings = reactive<Record<string, string>>({});
|
||||
|
||||
const draft = computed(() => state.value?.versions.find((item) => item.status === 'draft') || null);
|
||||
const published = computed(() => state.value?.versions.find((item) => item.status === 'published') || null);
|
||||
@@ -125,6 +132,14 @@ const selectedContextOption = computed(() => activeContextOptions.value.find(
|
||||
const selectedExposurePolicies = computed(() => (
|
||||
selectedContextOption.value?.allowed_dify_exposure_policies || ['never']
|
||||
));
|
||||
const publishedPolicy = computed(() => fulfillmentPolicyState.value?.policies.find((item) => item.status === 'published') || null);
|
||||
const draftPolicy = computed(() => fulfillmentPolicyState.value?.policies.find((item) => item.status === 'draft') || null);
|
||||
const policyFieldsFor = (capability: { scope: string; value_type: string }) => (state.value?.fields || []).filter((field) => (
|
||||
field.status === 'active'
|
||||
&& published.value?.definition?.fields.some((config) => config.field_id === field.id && config.enabled !== false)
|
||||
&& field.scope === capability.scope
|
||||
&& field.value_type === capability.value_type
|
||||
));
|
||||
|
||||
/** 左侧字段字典按显示名称和字段编号搜索,并保持通用上下文/订单信息/货品明细分组。 */
|
||||
const groupedFields = computed(() => {
|
||||
@@ -482,7 +497,13 @@ const syncDraftFields = (): void => {
|
||||
const load = async (): Promise<void> => {
|
||||
loading.value = true;
|
||||
try {
|
||||
state.value = await getShippingOrderSchemaState();
|
||||
const schemaState = await getShippingOrderSchemaState();
|
||||
state.value = schemaState;
|
||||
fulfillmentPolicyState.value = schemaState.schema ? await getShippingFulfillmentPolicyState() : null;
|
||||
const source = draftPolicy.value || publishedPolicy.value;
|
||||
for (const binding of source?.definition.field_bindings || []) {
|
||||
fulfillmentBindings[binding.capability_code] = binding.field_id;
|
||||
}
|
||||
syncDraftFields();
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
@@ -491,6 +512,43 @@ const load = async (): Promise<void> => {
|
||||
}
|
||||
};
|
||||
|
||||
/** 创建策略草稿前只提交受控能力与兼容的已发布字段,服务端继续执行最终校验。 */
|
||||
const createFulfillmentPolicyDraft = async (): Promise<void> => {
|
||||
if (!fulfillmentPolicyState.value || draftPolicy.value) return;
|
||||
saving.value = true;
|
||||
try {
|
||||
await createShippingFulfillmentPolicyDraft({
|
||||
field_bindings: fulfillmentPolicyState.value.capabilities.flatMap((capability) => {
|
||||
const fieldId = fulfillmentBindings[capability.capability_code];
|
||||
return fieldId ? [{ capability_code: capability.capability_code, field_id: fieldId }] : [];
|
||||
}),
|
||||
change_note: fulfillmentPolicyNote.value,
|
||||
});
|
||||
message.success(t('admin.shippingOrderSchema.fulfillmentDraftCreated'));
|
||||
await load();
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 发布前使用草稿锁版本,避免两个管理员相互覆盖字段能力定义。 */
|
||||
const publishFulfillmentPolicyDraft = async (): Promise<void> => {
|
||||
if (!draftPolicy.value) return;
|
||||
saving.value = true;
|
||||
try {
|
||||
await publishShippingFulfillmentPolicy(draftPolicy.value.id, draftPolicy.value.lock_version);
|
||||
message.success(t('admin.shippingOrderSchema.fulfillmentPublished'));
|
||||
fulfillmentPolicyNote.value = '';
|
||||
await load();
|
||||
} catch (error) {
|
||||
showError(error);
|
||||
} finally {
|
||||
saving.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
/** 初始化唯一订单 Schema。 */
|
||||
const initialize = async (): Promise<void> => {
|
||||
saving.value = true;
|
||||
@@ -793,6 +851,35 @@ onMounted(async () => {
|
||||
<span><strong>{{ t('admin.shippingOrderSchema.autoCreationEnabled') }}</strong><small>{{ t('admin.shippingOrderSchema.autoCreationHint') }}</small></span>
|
||||
</label>
|
||||
|
||||
<section class="fulfillment-policy-card">
|
||||
<header>
|
||||
<div>
|
||||
<p>{{ t('admin.shippingOrderSchema.fulfillmentEyebrow') }}</p>
|
||||
<h2>{{ t('admin.shippingOrderSchema.fulfillmentTitle') }}</h2>
|
||||
<small>{{ t('admin.shippingOrderSchema.fulfillmentHint') }}</small>
|
||||
</div>
|
||||
<span class="read-only-badge">
|
||||
{{ publishedPolicy ? t('admin.shippingOrderSchema.fulfillmentPublishedVersion', { version: publishedPolicy.version }) : t('admin.shippingOrderSchema.fulfillmentNotPublished') }}
|
||||
</span>
|
||||
</header>
|
||||
<p v-if="!published" class="fulfillment-warning">{{ t('admin.shippingOrderSchema.fulfillmentSchemaRequired') }}</p>
|
||||
<div v-else class="fulfillment-bindings">
|
||||
<label v-for="capability in fulfillmentPolicyState?.capabilities || []" :key="capability.capability_code">
|
||||
<span><strong>{{ t(`admin.shippingOrderSchema.fulfillmentCapability.${capability.capability_code}`) }}</strong><small>{{ capability.required ? t('admin.shippingOrderSchema.fulfillmentRequired') : t('admin.shippingOrderSchema.fulfillmentOptional') }}</small></span>
|
||||
<select v-model="fulfillmentBindings[capability.capability_code]" :disabled="saving || Boolean(draftPolicy)">
|
||||
<option value="">{{ t('admin.shippingOrderSchema.fulfillmentSelectField') }}</option>
|
||||
<option v-for="field in policyFieldsFor(capability)" :key="field.id" :value="field.id">{{ displayNameForField(field, 0) }} ({{ field.field_code }})</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
<footer v-if="published">
|
||||
<label v-if="!draftPolicy"><span>{{ t('admin.shippingOrderSchema.fulfillmentChangeNote') }}</span><input v-model="fulfillmentPolicyNote" :disabled="saving" :placeholder="t('admin.shippingOrderSchema.fulfillmentChangeNotePlaceholder')"></label>
|
||||
<p v-else>{{ t('admin.shippingOrderSchema.fulfillmentDraftHint', { version: draftPolicy.version }) }}</p>
|
||||
<button v-if="!draftPolicy" type="button" class="secondary-button" :disabled="saving" @click="createFulfillmentPolicyDraft">{{ t('admin.shippingOrderSchema.fulfillmentCreateDraft') }}</button>
|
||||
<button v-else type="button" class="primary-button" :disabled="saving" @click="publishFulfillmentPolicyDraft">{{ t('admin.shippingOrderSchema.fulfillmentPublish') }}</button>
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
<div class="schema-workbench">
|
||||
<aside class="field-panel">
|
||||
<div class="panel-heading">
|
||||
@@ -964,6 +1051,22 @@ onMounted(async () => {
|
||||
.auto-creation-switch span { display: grid; gap: 3px; }
|
||||
.auto-creation-switch strong { color: #334155; font-size: 13px; }
|
||||
.auto-creation-switch small { color: #64748b; font-size: 11px; }
|
||||
.fulfillment-policy-card { display: grid; gap: 14px; margin: 0 0 16px; border: 1px solid #dbe6ef; border-radius: 10px; background: #fff; padding: 16px; }
|
||||
.fulfillment-policy-card > header, .fulfillment-policy-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
|
||||
.fulfillment-policy-card h2, .fulfillment-policy-card p { margin: 0; }
|
||||
.fulfillment-policy-card header p { color: #0284c7; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
|
||||
.fulfillment-policy-card h2 { margin-top: 3px; color: #1e293b; font-size: 14px; }
|
||||
.fulfillment-policy-card header small, .fulfillment-policy-card footer p { color: #64748b; font-size: 12px; }
|
||||
.fulfillment-warning { border-radius: 7px; background: #fff7ed; padding: 9px 11px; color: #9a3412; font-size: 12px; }
|
||||
.fulfillment-bindings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
|
||||
.fulfillment-bindings label, .fulfillment-policy-card footer label { display: grid; gap: 5px; color: #64748b; font-size: 12px; }
|
||||
.fulfillment-bindings label { grid-template-columns: minmax(0, 1fr) minmax(180px, .8fr); align-items: center; border: 1px solid #edf1f5; border-radius: 7px; padding: 10px; }
|
||||
.fulfillment-bindings span { display: grid; gap: 2px; }
|
||||
.fulfillment-bindings strong { color: #334155; font-weight: 600; }
|
||||
.fulfillment-bindings small { color: #94a3b8; font-size: 10px; }
|
||||
.fulfillment-bindings select, .fulfillment-policy-card footer input { min-width: 0; border: 1px solid #d9e2ec; border-radius: 6px; background: #fff; padding: 8px 9px; color: #334155; font: inherit; font-size: 12px; }
|
||||
.fulfillment-policy-card footer label { flex: 1; }
|
||||
@media (max-width: 900px) { .fulfillment-bindings { grid-template-columns: 1fr; } }
|
||||
.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; }
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/**
|
||||
* features/admin/shippingConfigNavigation.spec.ts
|
||||
* 用途:锁定货代配置二级导航与后台路由的注册契约。
|
||||
* 依赖:货代配置子模块注册表、后台路由、Vitest。
|
||||
* 用途:锁定货代管理业务分组、深链与后台路由的注册契约。
|
||||
* 依赖:货代管理业务目录注册表、后台路由、Vitest。
|
||||
* 逻辑:防止新增或调整子页面时丢失深链、权限复用或当前子项高亮标识。
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { adminRoutes } from '@/app/router/routes/admin.routes';
|
||||
import { SHIPPING_CONFIG_SUB_MODULE_METAS } from './constants/modules';
|
||||
import { ADMIN_MODULE_METAS, SHIPPING_CONFIG_SUB_MODULE_METAS } from './constants/modules';
|
||||
import type { ShippingManagementGroupKey } from './stores/admin-nav.store';
|
||||
|
||||
const shippingRoutes = adminRoutes[0].children?.filter((route) =>
|
||||
route.name === 'AdminShippingInventory'
|
||||
@@ -17,17 +18,45 @@ const shippingRoutes = adminRoutes[0].children?.filter((route) =>
|
||||
) ?? [];
|
||||
|
||||
describe('shipping configuration navigation contract', () => {
|
||||
it('keeps shipping management between schedules and announcements', () => {
|
||||
// 关键断言:货代管理必须保持在排程管理之后、公告管理之前,匹配后台约定的信息架构。
|
||||
const moduleIds = ADMIN_MODULE_METAS.map((item) => item.id);
|
||||
expect(moduleIds.slice(moduleIds.indexOf('schedules'), moduleIds.indexOf('announcements') + 1)).toEqual([
|
||||
'schedules',
|
||||
'shipping_inventory',
|
||||
'announcements',
|
||||
]);
|
||||
});
|
||||
|
||||
it('registers all shipping configuration subpages with discoverable deep links', () => {
|
||||
// 关键断言:导航注册表与深链路由必须一一对应,避免后台入口不可发现。
|
||||
expect(SHIPPING_CONFIG_SUB_MODULE_METAS).toEqual([
|
||||
{ id: 'inventory', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.nav.shippingInventory' },
|
||||
{ id: 'identity_rules', routeName: 'AdminShippingIdentityRules', path: 'shipping-identity-rules', labelKey: 'admin.nav.shippingIdentityRules' },
|
||||
{ id: 'order_extraction_runs', routeName: 'AdminShippingOrderExtractionRuns', path: 'shipping-order-extraction-runs', labelKey: 'admin.nav.shippingOrderExtractionRuns' },
|
||||
{ id: 'order_document_profiles', routeName: 'AdminShippingOrderDocumentProfiles', path: 'shipping-order-document-profiles', labelKey: 'admin.nav.shippingOrderDocumentProfiles' },
|
||||
{ id: 'order_fields', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.nav.shippingOrderFields', groupKey: 'admin.nav.shippingOrderRecognition', query: { section: 'orderSchema' } },
|
||||
{ id: 'order_document_profiles', routeName: 'AdminShippingOrderDocumentProfiles', path: 'shipping-order-document-profiles', labelKey: 'admin.nav.shippingOrderDocumentProfiles', groupKey: 'admin.nav.shippingOrderRecognition' },
|
||||
{ id: 'identity_rules', routeName: 'AdminShippingIdentityRules', path: 'shipping-identity-rules', labelKey: 'admin.nav.shippingIdentityRules', groupKey: 'admin.nav.shippingOrderRecognition' },
|
||||
{ id: 'order_extraction_runs', routeName: 'AdminShippingOrderExtractionRuns', path: 'shipping-order-extraction-runs', labelKey: 'admin.nav.shippingOrderExtractionRuns', groupKey: 'admin.nav.shippingOrderRecognition' },
|
||||
{ id: 'inventory_fields', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.parsingProfiles', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'parsing' } },
|
||||
{ id: 'connections', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.connections', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'profiles' } },
|
||||
{ id: 'inventory_sites', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.sources', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'sources' } },
|
||||
{ id: 'warehouse_mappings', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.externalMappings', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'mappings' } },
|
||||
{ id: 'routing_rules', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.rules', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'rules' } },
|
||||
{ id: 'shipping_templates', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.excelTemplates', groupKey: 'admin.nav.shippingInventoryManagement', query: { section: 'templates' } },
|
||||
{ id: 'inventory_snapshots', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.snapshots', groupKey: 'admin.nav.shippingRunAudit', query: { section: 'snapshots' } },
|
||||
{ id: 'export_records', routeName: 'AdminShippingInventory', path: 'shipping-notice', labelKey: 'admin.shippingInventory.exports', groupKey: 'admin.nav.shippingRunAudit', query: { section: 'exports' } },
|
||||
]);
|
||||
expect(shippingRoutes).toHaveLength(4);
|
||||
});
|
||||
|
||||
it('keeps exactly three ordered accordion groups', () => {
|
||||
// 关键断言:货代功能量较大,侧栏必须保持三组手风琴,避免所有入口同时平铺。
|
||||
const groups = [...new Set(SHIPPING_CONFIG_SUB_MODULE_METAS.map((item) => item.groupKey))] satisfies ShippingManagementGroupKey[];
|
||||
expect(groups).toEqual([
|
||||
'admin.nav.shippingOrderRecognition',
|
||||
'admin.nav.shippingInventoryManagement',
|
||||
'admin.nav.shippingRunAudit',
|
||||
]);
|
||||
});
|
||||
|
||||
it('keeps all deep links behind the shared shipping inventory admin boundary', () => {
|
||||
// 关键断言:菜单可见性不是授权;所有页面均须保留 requiresAdmin 和共享模块权限标识。
|
||||
expect(shippingRoutes.map((route) => route.meta)).toEqual([
|
||||
|
||||
@@ -11,6 +11,11 @@ import { ref } from 'vue';
|
||||
import { getAdminDashboardBadges } from '@/features/admin/api/admin.api';
|
||||
import type { AdminModuleId } from '../types/admin.types';
|
||||
|
||||
export type ShippingManagementGroupKey =
|
||||
| 'admin.nav.shippingOrderRecognition'
|
||||
| 'admin.nav.shippingInventoryManagement'
|
||||
| 'admin.nav.shippingRunAudit';
|
||||
|
||||
/** 角标缓存有效期(毫秒):此时间内 ensureBadges 直接复用内存中的计数 */
|
||||
const BADGE_CACHE_TTL_MS = 60_000;
|
||||
|
||||
@@ -20,8 +25,10 @@ export const useAdminNavStore = defineStore('adminNav', () => {
|
||||
const reportsExpanded = ref(false);
|
||||
/** 企业微信子菜单:默认折叠 */
|
||||
const wecomExpanded = ref(false);
|
||||
/** 货代配置子菜单:默认折叠,进入库存或识别规则页时由导航自动展开。 */
|
||||
const shippingConfigExpanded = ref(false);
|
||||
/** 货代管理二级菜单:默认折叠,进入货代页面时自动展开。 */
|
||||
const shippingManagementExpanded = ref(false);
|
||||
/** 货代手风琴当前展开分组;单值约束保证同一时间最多展开一组。 */
|
||||
const shippingManagementGroup = ref<ShippingManagementGroupKey | null>(null);
|
||||
/** 「用户审批」导航角标:pending 注册用户数 */
|
||||
const pendingApprovalsCount = ref(0);
|
||||
/** 「权限申请」导航角标:pending 权限申请数 */
|
||||
@@ -36,6 +43,11 @@ export const useAdminNavStore = defineStore('adminNav', () => {
|
||||
sidebarCollapsed.value = !sidebarCollapsed.value;
|
||||
};
|
||||
|
||||
/** 展开指定货代分组;再次点击当前分组时收起全部功能项。 */
|
||||
const toggleShippingManagementGroup = (groupKey: ShippingManagementGroupKey): void => {
|
||||
shippingManagementGroup.value = shippingManagementGroup.value === groupKey ? null : groupKey;
|
||||
};
|
||||
|
||||
const setBadgeCounts = (approvals: number, requests: number): void => {
|
||||
pendingApprovalsCount.value = approvals;
|
||||
pendingRequestsCount.value = requests;
|
||||
@@ -90,10 +102,12 @@ export const useAdminNavStore = defineStore('adminNav', () => {
|
||||
sidebarCollapsed,
|
||||
reportsExpanded,
|
||||
wecomExpanded,
|
||||
shippingConfigExpanded,
|
||||
shippingManagementExpanded,
|
||||
shippingManagementGroup,
|
||||
pendingApprovalsCount,
|
||||
pendingRequestsCount,
|
||||
toggleSidebar,
|
||||
toggleShippingManagementGroup,
|
||||
setBadgeCounts,
|
||||
badgeForModule,
|
||||
ensureBadges,
|
||||
|
||||
@@ -20,8 +20,20 @@ export type AdminModuleId =
|
||||
| 'shipping_inventory'
|
||||
| 'reports';
|
||||
|
||||
/** 货代配置领域下可由侧栏展示和高亮的稳定子页面。 */
|
||||
export type ShippingConfigSubModuleId = 'inventory' | 'identity_rules' | 'order_extraction_runs' | 'order_document_profiles';
|
||||
/** 货代管理领域下可由侧栏展示和高亮的稳定业务页面。 */
|
||||
export type ShippingConfigSubModuleId =
|
||||
| 'order_fields'
|
||||
| 'order_document_profiles'
|
||||
| 'identity_rules'
|
||||
| 'order_extraction_runs'
|
||||
| 'inventory_fields'
|
||||
| 'connections'
|
||||
| 'inventory_sites'
|
||||
| 'warehouse_mappings'
|
||||
| 'routing_rules'
|
||||
| 'shipping_templates'
|
||||
| 'inventory_snapshots'
|
||||
| 'export_records';
|
||||
|
||||
export type AdminReportTableId =
|
||||
| 'usage_analysis'
|
||||
|
||||
@@ -32,6 +32,7 @@ export interface ShippingOrderDocumentProfile {
|
||||
row_structure: 'preserved' | 'unsupported_row_structure';
|
||||
column_rules: OrderProfileColumnRule[];
|
||||
drop_zero_qty: boolean;
|
||||
coordinate_reconstruction?: CoordinateReconstructionSettings | null;
|
||||
};
|
||||
checksum?: string | null;
|
||||
lock_version: number;
|
||||
@@ -44,12 +45,18 @@ export interface ShippingOrderDocumentProfile {
|
||||
export interface OrderProfileSampleDocument {
|
||||
document_id: number;
|
||||
intake_id: number;
|
||||
intake_no: string;
|
||||
filename?: string | null;
|
||||
content_hash?: string | null;
|
||||
provider?: string | null;
|
||||
provider_version?: string | null;
|
||||
table_count: number;
|
||||
created_at?: string | null;
|
||||
purpose: 'shipping_notice' | 'order_document_profile_sample';
|
||||
parse_status: string;
|
||||
is_template_sample: boolean;
|
||||
can_delete: boolean;
|
||||
delete_block_reason?: 'blind_test_referenced' | null;
|
||||
}
|
||||
|
||||
export interface OrderProfileSampleTable {
|
||||
@@ -60,6 +67,44 @@ export interface OrderProfileSampleTable {
|
||||
rows: string[][];
|
||||
issues: string[];
|
||||
profile_creation_allowed: boolean;
|
||||
coordinate_reconstruction_available?: boolean;
|
||||
ocr_coordinate_reconstruction_available?: boolean;
|
||||
}
|
||||
|
||||
export interface CoordinateReconstructionSettings {
|
||||
method: 'native_pdf_coordinates.v1' | 'ocr_pdf_coordinates.v1';
|
||||
column_boundaries: number[];
|
||||
column_field_codes?: Array<string | null>;
|
||||
line_start_column_index?: number;
|
||||
subrow_layouts?: CoordinateSubrowLayout[];
|
||||
}
|
||||
|
||||
export interface CoordinateSubrowLayout {
|
||||
role: 'main' | 'continuation';
|
||||
row_offset: number;
|
||||
column_boundaries: number[];
|
||||
column_field_codes: Array<string | null>;
|
||||
}
|
||||
|
||||
export interface CoordinateReconstructionPreview {
|
||||
table_id: string;
|
||||
row_count: number;
|
||||
column_count: number;
|
||||
rows: string[][];
|
||||
row_roles: Array<'header' | 'data' | 'deleted'>;
|
||||
source_row_indices: number[][];
|
||||
status: 'needs_review';
|
||||
}
|
||||
|
||||
export interface CoordinateSubrowSuggestion extends CoordinateSubrowLayout {
|
||||
column_samples: string[][];
|
||||
suggested_field_codes: Array<string | null>;
|
||||
}
|
||||
|
||||
export interface CoordinateReconstructionSuggestion {
|
||||
table_id: string;
|
||||
subrow_layouts: CoordinateSubrowSuggestion[];
|
||||
status: 'needs_review';
|
||||
}
|
||||
|
||||
export interface OrderProfileSamplePreview {
|
||||
@@ -85,5 +130,6 @@ export interface CreateOrderProfileFromSampleInput {
|
||||
row_structure: 'preserved' | 'unsupported_row_structure';
|
||||
column_rules: OrderProfileColumnRule[];
|
||||
drop_zero_qty: boolean;
|
||||
coordinate_reconstruction?: CoordinateReconstructionSettings | null;
|
||||
change_note?: string;
|
||||
}
|
||||
@@ -214,3 +214,36 @@ export interface ShippingOrderSchemaState {
|
||||
}>;
|
||||
}>;
|
||||
}
|
||||
|
||||
/** 受控货代履约能力及其版本化字段绑定。 */
|
||||
export interface ShippingFulfillmentCapability {
|
||||
capability_code: string;
|
||||
scope: ShippingOrderField['scope'];
|
||||
value_type: ShippingOrderField['value_type'];
|
||||
required: boolean;
|
||||
}
|
||||
|
||||
export interface ShippingFulfillmentPolicyBinding {
|
||||
capability_code: string;
|
||||
field_id: string;
|
||||
field_code: string;
|
||||
scope: ShippingOrderField['scope'];
|
||||
value_type: ShippingOrderField['value_type'];
|
||||
}
|
||||
|
||||
export interface ShippingFulfillmentPolicy {
|
||||
id: number;
|
||||
policy_code: 'SHIP_AVAILABLE_ROLLING_V1';
|
||||
version: number;
|
||||
status: 'draft' | 'published' | 'retired';
|
||||
definition: { field_bindings: ShippingFulfillmentPolicyBinding[] };
|
||||
checksum: string | null;
|
||||
lock_version: number;
|
||||
change_note: string | null;
|
||||
published_at: string | null;
|
||||
}
|
||||
|
||||
export interface ShippingFulfillmentPolicyState {
|
||||
capabilities: ShippingFulfillmentCapability[];
|
||||
policies: ShippingFulfillmentPolicy[];
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
/**
|
||||
* features/admin/views/AdminLayout.vue
|
||||
* 管理后台壳层:顶栏 + AdminNav + 子路由出口。
|
||||
* 角标仅在 Layout 首次挂载时 ensureBadges(store 内 60s TTL 缓存)。
|
||||
* 管理后台壳层:顶栏 + 左侧导航 + 子路由出口。
|
||||
* 依赖:AdminNav、vue-router、admin-nav.store。
|
||||
* 逻辑:AdminNav 统一承担模块和二级目录导航,内容区保持全宽展示当前页面。
|
||||
*/
|
||||
<script setup lang="ts">
|
||||
import { onMounted } from 'vue';
|
||||
@@ -44,7 +45,7 @@ onMounted(() => {
|
||||
|
||||
<main class="flex-1 w-full mx-auto px-4 md:px-8 py-6 md:py-8 flex flex-col md:flex-row gap-8 items-start">
|
||||
<AdminNav />
|
||||
<section class="flex-1 min-w-0 space-y-8 w-full">
|
||||
<section class="flex-1 min-w-0 w-full space-y-8">
|
||||
<router-view />
|
||||
</section>
|
||||
</main>
|
||||
|
||||
@@ -126,6 +126,18 @@ const statusLabel = computed(() => {
|
||||
<div v-if="match.matchedFields?.length" class="mt-1 text-xs text-muted">
|
||||
{{ t('chat.shippingNoticeDuplicateMatchFields', { fields: match.matchedFields.join(', ') }) }}
|
||||
</div>
|
||||
<div v-if="match.reservationDifferences?.length" class="mt-2 space-y-1 border-t border-default pt-2 text-xs">
|
||||
<p class="font-medium text-amber-700">{{ t('chat.shippingNoticeRevisionDifferences') }}</p>
|
||||
<p v-for="difference in match.reservationDifferences" :key="difference.reservationId">
|
||||
{{ t('chat.shippingNoticeRevisionDifference', {
|
||||
reservation: difference.reservationId,
|
||||
previousPart: difference.previous.partNumber,
|
||||
previousQty: difference.previous.qty,
|
||||
proposedPart: difference.proposed.partNumber,
|
||||
proposedQty: difference.proposed.qty,
|
||||
}) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4 space-y-2">
|
||||
|
||||
@@ -151,6 +151,17 @@ export function mapServerCandidate(remote: ShippingNoticeCandidateResponse): Shi
|
||||
matchType: item.match_type,
|
||||
matchedFields: listSafe(item.matched_fields),
|
||||
createdAt: item.created_at,
|
||||
reservationDifferences: (item.reservation_differences || []).map((difference) => ({
|
||||
reservationId: difference.reservation_id,
|
||||
previous: {
|
||||
partNumber: difference.previous.part_number,
|
||||
qty: difference.previous.qty,
|
||||
},
|
||||
proposed: {
|
||||
partNumber: difference.proposed.part_number,
|
||||
qty: difference.proposed.qty,
|
||||
},
|
||||
})),
|
||||
})),
|
||||
allowedActions: (remote.duplicate.allowed_actions || []) as ShippingDuplicateAction[],
|
||||
}
|
||||
|
||||
@@ -716,6 +716,11 @@ export interface ShippingDuplicateMatch {
|
||||
matched_fields: string[];
|
||||
lifecycle?: string;
|
||||
created_at?: string;
|
||||
reservation_differences?: Array<{
|
||||
reservation_id: string;
|
||||
previous: { part_number: string; qty: string };
|
||||
proposed: { part_number: string; qty: string };
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface ShippingDuplicateResult {
|
||||
|
||||
@@ -52,6 +52,11 @@ export interface ShippingDuplicateMatch {
|
||||
matchType: string;
|
||||
matchedFields: string[];
|
||||
createdAt?: string;
|
||||
reservationDifferences?: Array<{
|
||||
reservationId: string;
|
||||
previous: { partNumber: string; qty: string };
|
||||
proposed: { partNumber: string; qty: string };
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface ShippingDuplicateResult {
|
||||
|
||||
@@ -28,16 +28,20 @@
|
||||
"reports": "Data Reports",
|
||||
"schedules": "Schedule Management",
|
||||
"shippingCustomers": "Shipping Customers",
|
||||
"shippingConfig": "Shipping Configuration",
|
||||
"shippingInventory": "Inventory Configuration",
|
||||
"shippingIdentityRules": "Customer Identity Rules",
|
||||
"shippingOrderExtractionRuns": "Order Recognition Runs",
|
||||
"shippingConfig": "Shipping Management",
|
||||
"shippingOrderRecognition": "Order Recognition",
|
||||
"shippingInventoryManagement": "Inventory Management",
|
||||
"shippingRunAudit": "Run Audit",
|
||||
"shippingOrderFields": "Field Rules",
|
||||
"shippingInventory": "Inventory Management",
|
||||
"shippingIdentityRules": "Customer ID",
|
||||
"shippingOrderExtractionRuns": "Recognition Tasks",
|
||||
"platformApps": "Platform Apps",
|
||||
"shippingOrderDocumentProfiles": "Order Document Profiles"
|
||||
"shippingOrderDocumentProfiles": "Doc Templates"
|
||||
},
|
||||
"shippingOrderExtractionRuns": {
|
||||
"eyebrow": "READ-ONLY RUN DIAGNOSTICS",
|
||||
"title": "Order Recognition Runs",
|
||||
"title": "Recognition Tasks",
|
||||
"subtitle": "Inspect asynchronous order-recognition runs, job attempts, and redacted node lifecycles. Order content, prompts, inputs, outputs, and stack traces are never shown.",
|
||||
"refresh": "Refresh",
|
||||
"status": "Status",
|
||||
@@ -53,7 +57,7 @@
|
||||
"next": "Next",
|
||||
"loading": "Loading...",
|
||||
"empty": "No runs found",
|
||||
"loadFailed": "Failed to load order recognition runs",
|
||||
"loadFailed": "Failed to load recognition tasks",
|
||||
"detailFailed": "Failed to load run details",
|
||||
"detailTitle": "Run diagnostics",
|
||||
"workflowRunId": "Workflow Run ID",
|
||||
@@ -75,6 +79,28 @@
|
||||
"eyebrow": "Order field template",
|
||||
"title": "Order Template Configuration",
|
||||
"subtitle": "All EML, PDF, and Word orders share one published field contract. Published versions are immutable.",
|
||||
"fulfillmentEyebrow": "Shipping fulfillment governance",
|
||||
"fulfillmentTitle": "Field capabilities and shipping policy",
|
||||
"fulfillmentHint": "Only compatible fields from the published Schema can bind to controlled capabilities. Frozen orders retain the full policy snapshot.",
|
||||
"fulfillmentPublishedVersion": "Published policy V{version}",
|
||||
"fulfillmentNotPublished": "No fulfillment policy published",
|
||||
"fulfillmentSchemaRequired": "Publish an order Schema before selecting policy binding fields.",
|
||||
"fulfillmentRequired": "Required capability",
|
||||
"fulfillmentOptional": "Optional capability",
|
||||
"fulfillmentSelectField": "Select a compatible field",
|
||||
"fulfillmentChangeNote": "Policy change note (optional)",
|
||||
"fulfillmentChangeNotePlaceholder": "For example: use the customer reservation reference",
|
||||
"fulfillmentCreateDraft": "Create policy draft",
|
||||
"fulfillmentPublish": "Publish policy",
|
||||
"fulfillmentDraftCreated": "Fulfillment policy draft created",
|
||||
"fulfillmentPublished": "Fulfillment policy published; frozen orders are not reinterpreted",
|
||||
"fulfillmentDraftHint": "Policy draft V{version} has locked field bindings. Confirm and publish it.",
|
||||
"fulfillmentCapability": {
|
||||
"fulfillment.reservation_identity": "Reservation identity",
|
||||
"fulfillment.part_number": "Part number",
|
||||
"fulfillment.quantity": "Shipping quantity",
|
||||
"routing.inventory_source_hint": "Inventory source routing hint"
|
||||
},
|
||||
"schemaName": "Template name",
|
||||
"description": "Description",
|
||||
"initialize": "Initialize order template",
|
||||
@@ -369,13 +395,14 @@
|
||||
"orderHeaderIdentityHint": "Order information is a Header field and may provide customer or ship-to candidate evidence. It cannot auto-confirm a customer by itself. Item details do not support this setting."
|
||||
},
|
||||
"shippingInventory": {
|
||||
"title": "Shipping Configuration",
|
||||
"title": "Shipping Management",
|
||||
"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",
|
||||
"groupOrderRecognition": "Order Recognition",
|
||||
"groupInventory": "Inventory Management",
|
||||
"groupAudit": "Run Audit",
|
||||
"orderFields": "Order Parsing",
|
||||
"orderFields": "Order Field Rules",
|
||||
"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",
|
||||
@@ -2469,6 +2496,55 @@
|
||||
"title": "Order Document Profiles",
|
||||
"subtitle": "Configure exact column mappings from MinerU table samples without editing JSON or fingerprints.",
|
||||
"structureBlocked": "This table has a structural error and cannot create a profile. Wait for coordinate-evidence reconstruction and review it; do not repair the raw grid with field mappings.",
|
||||
"reconstructionRequired": "This header contains line data. Confirm column boundaries and rebuild the table first; the result requires manual review.",
|
||||
"columnBoundaries": "Relative column boundaries (0 to 1, comma-separated)",
|
||||
"reconstructTable": "Rebuild table candidate",
|
||||
"confirmReconstruction": "I reviewed the rebuilt grid and allow it to be used for this profile draft",
|
||||
"reconstructionPreview": "Logical line reconstruction (continuations merged; manual review required)",
|
||||
"rowRole": { "header": "Field mapping", "data": "Active line", "deleted": "Deleted" },
|
||||
"sourceRows": "Source visual rows: {rows}",
|
||||
"rebuildAfterFieldMapping": "Field mappings changed. Rebuild the candidate again and review the final logical lines.",
|
||||
"multiSubrowEnabled": "Each line item spans multiple physical rows",
|
||||
"multiSubrowHint": "Row 1 must map its line-number column to line_no. Add rows 2, 3, 4, and beyond as needed; each row has independent boundaries that may overlap other rows.",
|
||||
"subrowColumn": "Column {index}",
|
||||
"firstSubrow": "Row 1 (starts an item)",
|
||||
"followingSubrow": "Row {index}",
|
||||
"addSubrow": "Add row layout",
|
||||
"autoSuggestLayout": "Auto-detect row layout",
|
||||
"autoSuggestLayoutHint": "The system derives row count and column boundaries from PDF/OCR character positions. Confirm fields using the sample text for each column.",
|
||||
"layoutSuggestionReady": "Row layout suggestions are ready. Confirm each field, then rebuild the table candidate.",
|
||||
"columnBoundariesAdvanced": "Column boundaries (advanced calibration; usually unchanged)",
|
||||
"columnSamples": "Samples: {samples}",
|
||||
"lineNoRequired": "Map the order line-number column in row 1 to line_no.",
|
||||
"layoutRow": "Physical row layout",
|
||||
"fieldMapping": "Column samples and field mapping",
|
||||
"rowActions": "Actions",
|
||||
"columnsUnit": "columns",
|
||||
"livePreview": "Live candidate",
|
||||
"livePreviewUpdating": "Updating from the current mapping…",
|
||||
"livePreviewReady": "Updated from the current mapping",
|
||||
"livePreviewWaitingLineNo": "Map the order line-number column in row 1 to line_no first",
|
||||
"livePreviewFailed": "Automatic update failed. Use Rebuild table candidate to view the error",
|
||||
"livePreviewEmpty": "Change a field or boundary to update the candidate here",
|
||||
"confirmPreview": "Confirm candidate",
|
||||
"visualBoundaries": "Visual column boundaries",
|
||||
"dragBoundaryHint": "Drag a blue divider to adjust",
|
||||
"boundaryHandle": "Column boundary {index}",
|
||||
"preciseBoundaryValues": "Exact boundary values",
|
||||
"sourceColumn": "Source",
|
||||
"sampleValue": "Sample value",
|
||||
"targetField": "Mapped field",
|
||||
"advancedSettings": "Advanced settings",
|
||||
"physicalRows": "Physical rows",
|
||||
"addColumn": "Add column",
|
||||
"insertColumnAfter": "Add after",
|
||||
"suggestCurrentRow": "Detect current row",
|
||||
"currentRowSuggestionReady": "The current physical row was detected. Other row settings are unchanged.",
|
||||
"autoSuggestAllRows": "Detect all rows",
|
||||
"reconstructionUnavailable": "This sample has no usable native PDF character coordinates. Upload a PDF with a text layer and try again.",
|
||||
"generateOcrEvidence": "Try OCR reconstruction",
|
||||
"ocrEvidenceReady": "OCR coordinates are ready. Set column boundaries, rebuild, and manually review the candidate grid.",
|
||||
"reconstructionBoundariesInvalid": "Column boundaries must start at 0, end at 1, and be strictly increasing.",
|
||||
"uploadSample": "Upload Template Sample",
|
||||
"uploadSampleHint": "PDF or EML only. It is used only for profile configuration and structural review; no shipping task is created.",
|
||||
"sampleFileTypeInvalid": "Only PDF or EML files are supported as profile samples.",
|
||||
@@ -2476,14 +2552,26 @@
|
||||
"createTitle": "Create Draft from Sample",
|
||||
"editTitle": "Update Draft from Sample",
|
||||
"sample": "Sample document",
|
||||
"searchSample": "Search samples by filename",
|
||||
"selectSample": "Select a parsed document",
|
||||
"tablesUnit": "tables",
|
||||
"sampleDetails": "Uploaded: {time}; parsing status: {status}",
|
||||
"templateSampleOnly": "This sample was uploaded from this page and can be deleted unless a blind test references it.",
|
||||
"businessSampleProtected": "This is a historical business attachment. It is available for review but cannot be deleted here.",
|
||||
"deleteSample": "Delete sample",
|
||||
"deleteSampleConfirm": "Delete this dedicated template sample? Its source file and parsed result will be removed.",
|
||||
"sampleDeleted": "Template sample deleted",
|
||||
"sampleReferencedByBlindTest": "This sample is referenced by a blind test and must be retained for audit.",
|
||||
"table": "Sample table",
|
||||
"selectTable": "Select a table",
|
||||
"code": "Profile code",
|
||||
"name": "Profile name",
|
||||
"schema": "Order schema version",
|
||||
"headerRow": "Header row index",
|
||||
"headerRow": "Last header row",
|
||||
"dataRow": "First data row",
|
||||
"multiRowHeaderMapping": "Multi-row header mapping",
|
||||
"multiRowHeaderHint": "Text in each column is merged from row 0 through row {end}. Map logical columns here; do not configure header rows as line-item layouts.",
|
||||
"mergedHeaderColumn": "Column {index}",
|
||||
"rowStructure": "Line row structure",
|
||||
"rowPreserved": "Table rows and columns are preserved; configure mappings",
|
||||
"rowUnsupported": "Structure is unreliable; register for manual review only",
|
||||
@@ -2497,6 +2585,8 @@
|
||||
"compositePart": "Composite customer/internal part",
|
||||
"previewEmpty": "Select a sample document and table to preview",
|
||||
"versions": "Profile versions",
|
||||
"currentVersion": "Current",
|
||||
"publishedAt": "Published: {time}",
|
||||
"publish": "Publish",
|
||||
"newVersion": "Create new version",
|
||||
"retire": "Retire",
|
||||
|
||||
@@ -72,6 +72,8 @@
|
||||
"shippingNoticeDuplicateMatchTask": "Matched task: {taskNo}",
|
||||
"shippingNoticeDuplicateMatchStatus": "Status: {status}",
|
||||
"shippingNoticeDuplicateMatchFields": "Matched fields: {fields}",
|
||||
"shippingNoticeRevisionDifferences": "This revision changes the following reservations:",
|
||||
"shippingNoticeRevisionDifference": "{reservation}: part number {previousPart} -> {proposedPart}; quantity {previousQty} -> {proposedQty}",
|
||||
"shippingNoticeDuplicateOpenExisting": "Open existing task",
|
||||
"shippingNoticeDuplicateOpenExistingHint": "Do not create a new task; link this file to the existing one.",
|
||||
"shippingNoticeDuplicateCreateRevision": "Create as a revision",
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
{
|
||||
"generic": "Request failed.",
|
||||
"codes": {
|
||||
"SHIPPING.FULFILLMENT_POLICY_INVALID": "The fulfillment policy or field capability binding is invalid.",
|
||||
"SHIPPING.FULFILLMENT_POLICY_NOT_FOUND": "The fulfillment policy was not found.",
|
||||
"SHIPPING.FULFILLMENT_POLICY_CONFLICT": "The fulfillment policy was changed by another administrator. Refresh and try again.",
|
||||
"SHIPPING.FULFILLMENT_POLICY_NOT_PUBLISHED": "No executable fulfillment policy has been published.",
|
||||
"SHIPPING.RESERVATION_PO_REQUIRED": "This reservation already exists. Provide the purchase order before continuing.",
|
||||
"SHIPPING.RESERVATION_PO_CONFLICT": "This reservation is already used by a different purchase order. The duplicate order is blocked.",
|
||||
"SHIPPING.RESERVATION_DUPLICATED_IN_ORDER": "The frozen order contains a duplicate reservation and cannot be frozen.",
|
||||
"SHIPPING.RESERVATION_REVISION_REVIEW_REQUIRED": "The reservation content changed. Show the differences and obtain manual confirmation.",
|
||||
"SHIPPING.RESERVATION_REVISION_LOCKED": "This reservation has an active shipment artifact or has been uploaded, so direct revision is forbidden.",
|
||||
"SHIPPING_NOTICE.BATCH_FILE_LIMIT_EXCEEDED": "The number of uploaded files exceeds the system limit. Split the batch and try again.",
|
||||
"AGENT.EXPOSURE_ROLE_IMMUTABLE": "An application and an internal executor cannot be converted into each other.",
|
||||
"AGENT.ADMIN_SCOPE_INVALID": "The application management tab parameter is invalid.",
|
||||
@@ -25,7 +34,10 @@
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SCHEMA_INVALID": "The profile must bind to a published or retired order schema version.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_FIELD_INVALID": "The profile references an unavailable order line field.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_HEADER_CONTAMINATED": "The sample header contains order line data. Rebuild the table structure before creating a profile.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_RECONSTRUCTION_UNAVAILABLE": "This table has no usable native or OCR character coordinates for logical line reconstruction.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_RECONSTRUCTION_INVALID": "The coordinate reconstruction settings or result are invalid. Check the column boundaries and try again.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SAMPLE_FILE_TYPE_INVALID": "Only PDF or EML files are supported as profile samples.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SAMPLE_DELETE_BLOCKED": "This template sample is still parsing, referenced by a blind test, or its file is used elsewhere and cannot be deleted.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_IMMUTABLE": "A published order document parsing profile cannot be modified.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_LOCK_VERSION_REQUIRED": "The profile lock version is missing. Refresh and try again.",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_VERSION_CONFLICT": "Another administrator changed the profile. Refresh and try again.",
|
||||
|
||||
@@ -28,15 +28,19 @@
|
||||
"reports": "รายงานข้อมูล",
|
||||
"schedules": "Schedule Management",
|
||||
"shippingCustomers": "ลูกค้าขนส่ง",
|
||||
"shippingConfig": "การตั้งค่าการจัดส่ง",
|
||||
"shippingInventory": "การตั้งค่าคลังสินค้า",
|
||||
"shippingIdentityRules": "กฎการระบุตัวตนลูกค้า",
|
||||
"shippingOrderExtractionRuns": "การทำงานระบุคำสั่งซื้อ",
|
||||
"shippingOrderDocumentProfiles": "โปรไฟล์เอกสารคำสั่งซื้อ"
|
||||
"shippingConfig": "การจัดการการจัดส่ง",
|
||||
"shippingOrderRecognition": "การระบุคำสั่งซื้อ",
|
||||
"shippingInventoryManagement": "การจัดการสต็อก",
|
||||
"shippingRunAudit": "ตรวจสอบงาน",
|
||||
"shippingOrderFields": "กฎฟิลด์",
|
||||
"shippingInventory": "การจัดการสต็อก",
|
||||
"shippingIdentityRules": "ระบุลูกค้า",
|
||||
"shippingOrderExtractionRuns": "งานระบุคำสั่งซื้อ",
|
||||
"shippingOrderDocumentProfiles": "แม่แบบเอกสาร"
|
||||
},
|
||||
"shippingOrderExtractionRuns": {
|
||||
"eyebrow": "การวินิจฉัยการทำงานแบบอ่านอย่างเดียว",
|
||||
"title": "การทำงานระบุคำสั่งซื้อ",
|
||||
"title": "งานระบุคำสั่งซื้อ",
|
||||
"subtitle": "ตรวจสอบการทำงานระบุคำสั่งซื้อแบบอะซิงโครนัส ความพยายามของ Job และวงจรโหนดที่ผ่านการปกปิดข้อมูล โดยไม่แสดงเนื้อหาคำสั่งซื้อ พรอมป์ต์ อินพุต เอาต์พุต หรือสแตกข้อผิดพลาด",
|
||||
"refresh": "รีเฟรช",
|
||||
"status": "สถานะ",
|
||||
@@ -52,7 +56,7 @@
|
||||
"next": "ถัดไป",
|
||||
"loading": "กำลังโหลด...",
|
||||
"empty": "ไม่มีรายการทำงาน",
|
||||
"loadFailed": "โหลดการทำงานระบุคำสั่งซื้อไม่สำเร็จ",
|
||||
"loadFailed": "โหลดงานระบุคำสั่งซื้อไม่สำเร็จ",
|
||||
"detailFailed": "โหลดรายละเอียดการทำงานไม่สำเร็จ",
|
||||
"detailTitle": "รายละเอียดการวินิจฉัย",
|
||||
"workflowRunId": "Workflow Run ID",
|
||||
@@ -74,6 +78,28 @@
|
||||
"eyebrow": "เทมเพลตฟิลด์คำสั่งซื้อ",
|
||||
"title": "การตั้งค่าเทมเพลตคำสั่งซื้อ",
|
||||
"subtitle": "คำสั่งซื้อ EML, PDF และ Word ทั้งหมดใช้สัญญาฟิลด์ที่เผยแพร่ชุดเดียว และแก้ไขเวอร์ชันที่เผยแพร่แล้วไม่ได้",
|
||||
"fulfillmentEyebrow": "การกำกับดูแลการจัดส่งของผู้ให้บริการขนส่ง",
|
||||
"fulfillmentTitle": "ความสามารถของฟิลด์และนโยบายการจัดส่ง",
|
||||
"fulfillmentHint": "เฉพาะฟิลด์ที่เข้ากันได้จาก Schema ที่เผยแพร่แล้วเท่านั้นที่ผูกกับความสามารถที่ควบคุมได้ และคำสั่งซื้อที่แช่แข็งจะเก็บสแนปช็อตนโยบายทั้งหมดไว้",
|
||||
"fulfillmentPublishedVersion": "นโยบายที่เผยแพร่ V{version}",
|
||||
"fulfillmentNotPublished": "ยังไม่มีนโยบายการจัดส่งที่เผยแพร่",
|
||||
"fulfillmentSchemaRequired": "เผยแพร่ Schema คำสั่งซื้อก่อนเลือกฟิลด์สำหรับผูกนโยบาย",
|
||||
"fulfillmentRequired": "ความสามารถที่จำเป็น",
|
||||
"fulfillmentOptional": "ความสามารถที่เลือกได้",
|
||||
"fulfillmentSelectField": "เลือกฟิลด์ที่เข้ากันได้",
|
||||
"fulfillmentChangeNote": "บันทึกการเปลี่ยนนโยบาย (ไม่บังคับ)",
|
||||
"fulfillmentChangeNotePlaceholder": "เช่น ใช้ฟิลด์ reservation ของลูกค้า",
|
||||
"fulfillmentCreateDraft": "สร้างร่างนโยบาย",
|
||||
"fulfillmentPublish": "เผยแพร่นโยบาย",
|
||||
"fulfillmentDraftCreated": "สร้างร่างนโยบายการจัดส่งแล้ว",
|
||||
"fulfillmentPublished": "เผยแพร่นโยบายการจัดส่งแล้ว คำสั่งซื้อที่แช่แข็งจะไม่ถูกตีความใหม่",
|
||||
"fulfillmentDraftHint": "ร่างนโยบาย V{version} ล็อกการผูกฟิลด์แล้ว โปรดยืนยันและเผยแพร่",
|
||||
"fulfillmentCapability": {
|
||||
"fulfillment.reservation_identity": "รหัส Reservation",
|
||||
"fulfillment.part_number": "หมายเลขชิ้นส่วน",
|
||||
"fulfillment.quantity": "จำนวนจัดส่ง",
|
||||
"routing.inventory_source_hint": "คำใบ้การกำหนดเส้นทางแหล่งสต็อก"
|
||||
},
|
||||
"schemaName": "ชื่อเทมเพลต",
|
||||
"description": "คำอธิบาย",
|
||||
"initialize": "เริ่มต้นเทมเพลตคำสั่งซื้อ",
|
||||
@@ -368,13 +394,14 @@
|
||||
"orderHeaderIdentityHint": "ข้อมูลคำสั่งซื้อเป็นฟิลด์ Header และใช้เป็นหลักฐานผู้สมัครสำหรับลูกค้าหรือสถานที่จัดส่งได้ ระบบจะไม่ยืนยันลูกค้าอัตโนมัติจากฟิลด์นี้เพียงอย่างเดียว และรายละเอียดสินค้าไม่รองรับการตั้งค่านี้"
|
||||
},
|
||||
"shippingInventory": {
|
||||
"title": "การตั้งค่าการจัดส่ง",
|
||||
"title": "การจัดการการจัดส่ง",
|
||||
"subtitle": "ดูแลสายการตั้งค่าการจัดส่งที่ตรวจสอบย้อนกลับได้ ตั้งแต่ฟิลด์คำสั่งซื้อ การอ่านสต็อก ไปจนถึง Excel สำหรับจัดส่งและการกำหนดเส้นทางสต็อก",
|
||||
"eyebrow": "พื้นที่ทำงานการตั้งค่าการจัดส่ง",
|
||||
"groupFoundation": "ข้อมูลพื้นฐาน",
|
||||
"groupOrderRecognition": "การระบุคำสั่งซื้อ",
|
||||
"groupInventory": "การจัดการสต็อก",
|
||||
"groupAudit": "บันทึกการทำงาน",
|
||||
"orderFields": "การอ่านคำสั่งซื้อ",
|
||||
"orderFields": "กฎฟิลด์คำสั่งซื้อ",
|
||||
"orderSchemaRequired": "โปรดเผยแพร่เวอร์ชันฟิลด์คำสั่งซื้อก่อน เพื่อให้โปรไฟล์การแยกวิเคราะห์สต็อก เทมเพลต Excel สำหรับจัดส่ง และกฎการกำหนดเส้นทางอ้างอิงฟิลด์คำสั่งซื้อได้",
|
||||
"connections": "การเชื่อมต่อระบบ",
|
||||
"parsingProfiles": "แผนการแยกวิเคราะห์ไฟล์สต็อก",
|
||||
@@ -2337,6 +2364,55 @@
|
||||
"title": "โปรไฟล์เอกสารคำสั่งซื้อ",
|
||||
"subtitle": "ตั้งค่าการแมปคอลัมน์จากตัวอย่างตาราง MinerU โดยไม่ต้องแก้ไข JSON หรือลายนิ้วมือโครงสร้าง",
|
||||
"structureBlocked": "ตารางนี้มีข้อผิดพลาดด้านโครงสร้างและไม่สามารถสร้างโปรไฟล์ได้ โปรดรอการสร้างใหม่จากหลักฐานพิกัดแล้วตรวจทาน ห้ามแก้กริดต้นฉบับด้วยการแมปฟิลด์",
|
||||
"reconstructionRequired": "หัวตารางนี้มีข้อมูลรายการ ต้องยืนยันขอบเขตคอลัมน์และสร้างตารางใหม่ก่อน โดยต้องตรวจทานผลลัพธ์ด้วยคน",
|
||||
"columnBoundaries": "ขอบเขตคอลัมน์สัมพัทธ์ (0 ถึง 1 คั่นด้วยจุลภาค)",
|
||||
"reconstructTable": "สร้างตารางตัวเลือกใหม่",
|
||||
"confirmReconstruction": "ฉันตรวจทานกริดที่สร้างใหม่แล้ว และอนุญาตให้ใช้กับฉบับร่างนี้",
|
||||
"reconstructionPreview": "รายการตรรกะที่สร้างใหม่ (รวมบรรทัดต่อเนื่องแล้ว ต้องตรวจทานด้วยคน)",
|
||||
"rowRole": { "header": "การแมปฟิลด์", "data": "รายการที่ใช้งาน", "deleted": "ลบแล้ว" },
|
||||
"sourceRows": "บรรทัดภาพต้นทาง: {rows}",
|
||||
"rebuildAfterFieldMapping": "การแมปฟิลด์เปลี่ยนแปลงแล้ว โปรดสร้างตัวเลือกใหม่อีกครั้งและตรวจทานรายการตรรกะสุดท้าย",
|
||||
"multiSubrowEnabled": "หนึ่งรายการประกอบด้วยหลายบรรทัด",
|
||||
"multiSubrowHint": "บรรทัดที่ 1 ต้องแมปคอลัมน์เลขรายการเป็น line_no สามารถเพิ่มบรรทัดที่ 2, 3, 4 และต่อไปได้ตามรูปแบบจริง โดยแต่ละบรรทัดมีขอบเขตคอลัมน์อิสระและซ้อนทับกันได้",
|
||||
"subrowColumn": "คอลัมน์ {index}",
|
||||
"firstSubrow": "บรรทัดที่ 1 (เริ่มรายการใหม่)",
|
||||
"followingSubrow": "บรรทัดที่ {index}",
|
||||
"addSubrow": "เพิ่มรูปแบบหนึ่งบรรทัด",
|
||||
"autoSuggestLayout": "ตรวจหารูปแบบบรรทัดอัตโนมัติ",
|
||||
"autoSuggestLayoutHint": "ระบบจะสร้างจำนวนบรรทัดและขอบเขตคอลัมน์จากตำแหน่งอักขระ PDF/OCR โปรดยืนยันฟิลด์จากข้อความตัวอย่างของแต่ละคอลัมน์",
|
||||
"layoutSuggestionReady": "สร้างคำแนะนำรูปแบบบรรทัดแล้ว โปรดยืนยันแต่ละฟิลด์แล้วสร้างตารางตัวอย่างใหม่",
|
||||
"columnBoundariesAdvanced": "ขอบเขตคอลัมน์ (การปรับขั้นสูง โดยปกติไม่ต้องแก้ไข)",
|
||||
"columnSamples": "ตัวอย่าง: {samples}",
|
||||
"lineNoRequired": "ต้องแมปคอลัมน์เลขรายการสั่งซื้อในบรรทัดที่ 1 เป็น line_no",
|
||||
"layoutRow": "รูปแบบบรรทัดจริง",
|
||||
"fieldMapping": "ตัวอย่างคอลัมน์และการแมปฟิลด์",
|
||||
"rowActions": "การดำเนินการ",
|
||||
"columnsUnit": "คอลัมน์",
|
||||
"livePreview": "ตัวเลือกแบบเรียลไทม์",
|
||||
"livePreviewUpdating": "กำลังอัปเดตตามการแมปปัจจุบัน…",
|
||||
"livePreviewReady": "อัปเดตตามการแมปปัจจุบันแล้ว",
|
||||
"livePreviewWaitingLineNo": "โปรดแมปคอลัมน์เลขรายการในบรรทัดที่ 1 เป็น line_no ก่อน",
|
||||
"livePreviewFailed": "อัปเดตอัตโนมัติไม่สำเร็จ โปรดใช้ปุ่มสร้างตารางตัวเลือกใหม่เพื่อดูข้อผิดพลาด",
|
||||
"livePreviewEmpty": "แก้ไขฟิลด์หรือขอบเขตคอลัมน์เพื่ออัปเดตตัวเลือกที่นี่",
|
||||
"confirmPreview": "ยืนยันตัวเลือก",
|
||||
"visualBoundaries": "ขอบเขตคอลัมน์แบบภาพ",
|
||||
"dragBoundaryHint": "ลากตัวแบ่งสีน้ำเงินเพื่อปรับ",
|
||||
"boundaryHandle": "ขอบเขตคอลัมน์ที่ {index}",
|
||||
"preciseBoundaryValues": "ค่าขอบเขตแบบละเอียด",
|
||||
"sourceColumn": "คอลัมน์เดิม",
|
||||
"sampleValue": "ค่าตัวอย่าง",
|
||||
"targetField": "ฟิลด์ที่แมป",
|
||||
"advancedSettings": "การตั้งค่าขั้นสูง",
|
||||
"physicalRows": "บรรทัดจริง",
|
||||
"addColumn": "เพิ่มคอลัมน์",
|
||||
"insertColumnAfter": "เพิ่มด้านหลัง",
|
||||
"suggestCurrentRow": "ตรวจหาบรรทัดปัจจุบัน",
|
||||
"currentRowSuggestionReady": "ตรวจพบบรรทัดจริงปัจจุบันแล้ว การตั้งค่าบรรทัดอื่นไม่เปลี่ยนแปลง",
|
||||
"autoSuggestAllRows": "ตรวจหาทุกบรรทัดอัตโนมัติ",
|
||||
"reconstructionUnavailable": "ตัวอย่างนี้ไม่มีพิกัดอักขระ PDF ที่ใช้งานได้ โปรดอัปโหลด PDF ที่มีชั้นข้อความแล้วลองอีกครั้ง",
|
||||
"generateOcrEvidence": "ลองสร้างใหม่ด้วย OCR",
|
||||
"ocrEvidenceReady": "สร้างพิกัด OCR แล้ว โปรดกำหนดขอบเขตคอลัมน์ สร้างใหม่ และตรวจทานกริดด้วยคน",
|
||||
"reconstructionBoundariesInvalid": "ขอบเขตคอลัมน์ต้องเริ่มที่ 0 สิ้นสุดที่ 1 และเพิ่มขึ้นอย่างเคร่งครัด",
|
||||
"uploadSample": "อัปโหลดตัวอย่างเทมเพลต",
|
||||
"uploadSampleHint": "รองรับเฉพาะ PDF หรือ EML ใช้สำหรับตั้งค่าโปรไฟล์และตรวจทานโครงสร้างเท่านั้น และไม่สร้างงานจัดส่ง",
|
||||
"sampleFileTypeInvalid": "ตัวอย่างโปรไฟล์รองรับเฉพาะไฟล์ PDF หรือ EML",
|
||||
@@ -2344,14 +2420,26 @@
|
||||
"createTitle": "สร้างฉบับร่างจากตัวอย่าง",
|
||||
"editTitle": "อัปเดตฉบับร่างจากตัวอย่าง",
|
||||
"sample": "เอกสารตัวอย่าง",
|
||||
"searchSample": "ค้นหาตัวอย่างตามชื่อไฟล์",
|
||||
"selectSample": "เลือกเอกสารที่แยกข้อมูลแล้ว",
|
||||
"tablesUnit": "ตาราง",
|
||||
"sampleDetails": "อัปโหลด: {time}; สถานะการแยกข้อมูล: {status}",
|
||||
"templateSampleOnly": "ตัวอย่างนี้อัปโหลดจากหน้านี้และลบได้หากไม่มี Blind Test อ้างอิง",
|
||||
"businessSampleProtected": "นี่คือไฟล์แนบทางธุรกิจเดิม ใช้ตรวจทานได้ แต่ลบจากหน้านี้ไม่ได้",
|
||||
"deleteSample": "ลบตัวอย่าง",
|
||||
"deleteSampleConfirm": "ลบตัวอย่างเทมเพลตนี้หรือไม่ ไฟล์ต้นทางและผลการแยกข้อมูลจะถูกลบ",
|
||||
"sampleDeleted": "ลบตัวอย่างเทมเพลตแล้ว",
|
||||
"sampleReferencedByBlindTest": "ตัวอย่างนี้ถูกอ้างอิงโดย Blind Test และต้องเก็บไว้เพื่อการตรวจสอบ",
|
||||
"table": "ตารางตัวอย่าง",
|
||||
"selectTable": "เลือกตาราง",
|
||||
"code": "รหัสโปรไฟล์",
|
||||
"name": "ชื่อโปรไฟล์",
|
||||
"schema": "เวอร์ชันสคีมาคำสั่งซื้อ",
|
||||
"headerRow": "ดัชนีแถวหัวตาราง",
|
||||
"headerRow": "แถวหัวตารางสุดท้าย",
|
||||
"dataRow": "แถวข้อมูลแรก",
|
||||
"multiRowHeaderMapping": "การแมปหัวตารางหลายแถว",
|
||||
"multiRowHeaderHint": "ระบบรวมข้อความในคอลัมน์เดียวกันตั้งแต่แถว 0 ถึงแถว {end} ให้แมปคอลัมน์เชิงตรรกะที่นี่ และอย่ากำหนดแถวหัวตารางเป็นรูปแบบรายการ",
|
||||
"mergedHeaderColumn": "คอลัมน์ {index}",
|
||||
"rowStructure": "โครงสร้างแถวรายการ",
|
||||
"rowPreserved": "โครงสร้างแถวและคอลัมน์ครบถ้วน สามารถตั้งค่าการแมปได้",
|
||||
"rowUnsupported": "โครงสร้างไม่น่าเชื่อถือ ลงทะเบียนเพื่อให้ตรวจสอบด้วยคนเท่านั้น",
|
||||
@@ -2365,6 +2453,8 @@
|
||||
"compositePart": "รหัสลูกค้า/ภายในแบบผสม",
|
||||
"previewEmpty": "เลือกเอกสารและตารางตัวอย่างเพื่อดูตัวอย่าง",
|
||||
"versions": "เวอร์ชันโปรไฟล์",
|
||||
"currentVersion": "ใช้งานอยู่",
|
||||
"publishedAt": "เผยแพร่: {time}",
|
||||
"publish": "เผยแพร่",
|
||||
"newVersion": "สร้างเวอร์ชันใหม่",
|
||||
"retire": "ยกเลิกใช้งาน",
|
||||
|
||||
@@ -72,6 +72,8 @@
|
||||
"shippingNoticeDuplicateMatchTask": "งานที่ตรงกัน: {taskNo}",
|
||||
"shippingNoticeDuplicateMatchStatus": "สถานะ: {status}",
|
||||
"shippingNoticeDuplicateMatchFields": "ฟิลด์ที่ตรงกัน: {fields}",
|
||||
"shippingNoticeRevisionDifferences": "การแก้ไขนี้จะเปลี่ยน Reservation ต่อไปนี้:",
|
||||
"shippingNoticeRevisionDifference": "{reservation}: หมายเลขชิ้นส่วน {previousPart} -> {proposedPart}; จำนวน {previousQty} -> {proposedQty}",
|
||||
"shippingNoticeDuplicateOpenExisting": "เปิดงานที่มีอยู่",
|
||||
"shippingNoticeDuplicateOpenExistingHint": "ไม่สร้างงานใหม่ แต่ผูกไฟล์นี้กับงานเดิม",
|
||||
"shippingNoticeDuplicateCreateRevision": "สร้างเป็นเวอร์ชันแก้ไข",
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
{
|
||||
"generic": "คำขอล้มเหลว",
|
||||
"codes": {
|
||||
"SHIPPING.FULFILLMENT_POLICY_INVALID": "นโยบายการปฏิบัติตามหรือการผูกความสามารถของฟิลด์ไม่ถูกต้อง",
|
||||
"SHIPPING.FULFILLMENT_POLICY_NOT_FOUND": "ไม่พบนโยบายการปฏิบัติตาม",
|
||||
"SHIPPING.FULFILLMENT_POLICY_CONFLICT": "นโยบายการปฏิบัติตามถูกแก้ไขโดยผู้ดูแลรายอื่น โปรดรีเฟรชแล้วลองใหม่",
|
||||
"SHIPPING.FULFILLMENT_POLICY_NOT_PUBLISHED": "ยังไม่มีการเผยแพร่นโยบายการปฏิบัติตามที่ใช้งานได้",
|
||||
"SHIPPING.RESERVATION_PO_REQUIRED": "Reservation นี้มีอยู่แล้ว ต้องระบุใบสั่งซื้อก่อนดำเนินการต่อ",
|
||||
"SHIPPING.RESERVATION_PO_CONFLICT": "Reservation นี้ถูกใช้กับใบสั่งซื้ออื่นแล้ว ระบบบล็อกคำสั่งซื้อซ้ำ",
|
||||
"SHIPPING.RESERVATION_DUPLICATED_IN_ORDER": "พบ Reservation ซ้ำในคำสั่งซื้อเดียวกัน จึงไม่สามารถตรึงคำสั่งซื้อได้",
|
||||
"SHIPPING.RESERVATION_REVISION_REVIEW_REQUIRED": "ข้อมูล Reservation เปลี่ยนแปลง ต้องแสดงความแตกต่างและให้มนุษย์ยืนยัน",
|
||||
"SHIPPING.RESERVATION_REVISION_LOCKED": "Reservation นี้มีไฟล์จัดส่งที่ยังใช้ได้หรืออัปโหลดแล้ว จึงห้ามแก้ไขโดยตรง",
|
||||
"SHIPPING_NOTICE.BATCH_FILE_LIMIT_EXCEEDED": "จำนวนไฟล์ที่อัปโหลดเกินขีดจำกัดของระบบ โปรดแบ่งชุดแล้วลองใหม่",
|
||||
"AGENT.EXPOSURE_ROLE_IMMUTABLE": "ไม่สามารถแปลงแอปพลิเคชันเป็นตัวดำเนินการภายในหรือกลับกันได้",
|
||||
"AGENT.ADMIN_SCOPE_INVALID": "พารามิเตอร์แท็บการจัดการแอปพลิเคชันไม่ถูกต้อง",
|
||||
@@ -25,7 +34,10 @@
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SCHEMA_INVALID": "โปรไฟล์ต้องผูกกับเวอร์ชันสคีมาคำสั่งซื้อที่เผยแพร่หรือเลิกใช้งานแล้ว",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_FIELD_INVALID": "โปรไฟล์อ้างอิงฟิลด์รายการคำสั่งซื้อที่ไม่พร้อมใช้งาน",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_HEADER_CONTAMINATED": "ส่วนหัวของตัวอย่างมีข้อมูลรายการคำสั่งซื้อ ต้องสร้างโครงสร้างตารางใหม่ก่อนจึงจะสร้างโปรไฟล์ได้",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_RECONSTRUCTION_UNAVAILABLE": "ตารางนี้ไม่มีพิกัดอักขระแบบต้นฉบับหรือ OCR ที่ใช้งานได้สำหรับสร้างรายการตรรกะใหม่",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_RECONSTRUCTION_INVALID": "การตั้งค่าหรือผลลัพธ์การสร้างใหม่ด้วยพิกัดไม่ถูกต้อง โปรดตรวจสอบขอบเขตคอลัมน์แล้วลองอีกครั้ง",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SAMPLE_FILE_TYPE_INVALID": "ตัวอย่างโปรไฟล์รองรับเฉพาะไฟล์ PDF หรือ EML",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SAMPLE_DELETE_BLOCKED": "ตัวอย่างเทมเพลตนี้ยังอยู่ระหว่างแยกข้อมูล ถูกอ้างอิงโดย Blind Test หรือไฟล์ถูกใช้โดยงานอื่น จึงลบไม่ได้",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_IMMUTABLE": "ไม่สามารถแก้ไขโปรไฟล์เอกสารคำสั่งซื้อที่เผยแพร่แล้ว",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_LOCK_VERSION_REQUIRED": "ไม่มีเวอร์ชันล็อกของโปรไฟล์ โปรดรีเฟรชแล้วลองใหม่",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_VERSION_CONFLICT": "ผู้ดูแลระบบรายอื่นแก้ไขโปรไฟล์แล้ว โปรดรีเฟรชแล้วลองใหม่",
|
||||
|
||||
@@ -29,15 +29,19 @@
|
||||
"reports": "数据报表",
|
||||
"schedules": "排程管理",
|
||||
"shippingCustomers": "货代客户",
|
||||
"shippingConfig": "货代配置",
|
||||
"shippingInventory": "库存配置",
|
||||
"shippingIdentityRules": "客户识别规则",
|
||||
"shippingOrderExtractionRuns": "订单识别运行",
|
||||
"shippingOrderDocumentProfiles": "订单文档模板"
|
||||
"shippingConfig": "货代管理",
|
||||
"shippingOrderRecognition": "订单识别",
|
||||
"shippingInventoryManagement": "库存管理",
|
||||
"shippingRunAudit": "运行审计",
|
||||
"shippingOrderFields": "字段规则",
|
||||
"shippingInventory": "库存管理",
|
||||
"shippingIdentityRules": "客户识别",
|
||||
"shippingOrderExtractionRuns": "识别任务",
|
||||
"shippingOrderDocumentProfiles": "文档模板"
|
||||
},
|
||||
"shippingOrderExtractionRuns": {
|
||||
"eyebrow": "只读运行诊断",
|
||||
"title": "订单识别运行",
|
||||
"title": "识别任务",
|
||||
"subtitle": "用于排查异步订单识别的运行、重试尝试与脱敏节点生命周期;不展示订单正文、提示词、输入输出或错误堆栈。",
|
||||
"refresh": "刷新",
|
||||
"status": "状态",
|
||||
@@ -53,7 +57,7 @@
|
||||
"next": "下一页",
|
||||
"loading": "正在加载...",
|
||||
"empty": "暂无运行记录",
|
||||
"loadFailed": "加载订单识别运行失败",
|
||||
"loadFailed": "加载识别任务失败",
|
||||
"detailFailed": "加载运行详情失败",
|
||||
"detailTitle": "运行诊断详情",
|
||||
"workflowRunId": "Workflow Run ID",
|
||||
@@ -75,6 +79,28 @@
|
||||
"eyebrow": "订单字段模板",
|
||||
"title": "订单模板配置",
|
||||
"subtitle": "所有 EML、PDF 和 Word 订单共享同一份已发布字段契约;发布后版本不可原地修改。",
|
||||
"fulfillmentEyebrow": "货代履约治理",
|
||||
"fulfillmentTitle": "字段能力与发货策略",
|
||||
"fulfillmentHint": "仅可把已发布 Schema 中作用域和格式兼容的字段绑定到受控能力;冻结订单会保留完整策略快照。",
|
||||
"fulfillmentPublishedVersion": "已发布策略 V{version}",
|
||||
"fulfillmentNotPublished": "尚未发布履约策略",
|
||||
"fulfillmentSchemaRequired": "请先发布订单 Schema,才能选择策略绑定字段。",
|
||||
"fulfillmentRequired": "必需能力",
|
||||
"fulfillmentOptional": "可选能力",
|
||||
"fulfillmentSelectField": "请选择兼容字段",
|
||||
"fulfillmentChangeNote": "策略变更说明(可选)",
|
||||
"fulfillmentChangeNotePlaceholder": "例如:改用客户预约单字段",
|
||||
"fulfillmentCreateDraft": "创建策略草稿",
|
||||
"fulfillmentPublish": "发布策略",
|
||||
"fulfillmentDraftCreated": "履约策略草稿已创建",
|
||||
"fulfillmentPublished": "履约策略已发布,历史冻结订单不会被重解释",
|
||||
"fulfillmentDraftHint": "策略草稿 V{version} 已锁定字段绑定,请确认后发布。",
|
||||
"fulfillmentCapability": {
|
||||
"fulfillment.reservation_identity": "Reservation 标识",
|
||||
"fulfillment.part_number": "内部料号",
|
||||
"fulfillment.quantity": "发货数量",
|
||||
"routing.inventory_source_hint": "库存源路由线索"
|
||||
},
|
||||
"schemaName": "模板名称",
|
||||
"description": "说明",
|
||||
"initialize": "初始化订单模板",
|
||||
@@ -369,14 +395,15 @@
|
||||
"operationFailed": "订单模板操作失败"
|
||||
},
|
||||
"shippingInventory": {
|
||||
"title": "货代配置",
|
||||
"title": "货代管理",
|
||||
"subtitle": "从订单字段、库存解析到发货 Excel 和库存路由,维护一条可追溯的发货配置链路。",
|
||||
"eyebrow": "货代发货配置工作台",
|
||||
"groupFoundation": "基础定义",
|
||||
"groupOrderRecognition": "订单识别",
|
||||
"groupInventory": "库存管理",
|
||||
"groupAudit": "运行审计",
|
||||
"orderFields": "订单解析",
|
||||
"orderSchemaRequired": "请先在“订单解析”发布一个版本;库存解析、发货模板和路由规则才能引用订单字段。",
|
||||
"orderFields": "订单字段规则",
|
||||
"orderSchemaRequired": "请先在“订单字段规则”发布一个版本;库存解析、发货模板和路由规则才能引用订单字段。",
|
||||
"connections": "系统连接",
|
||||
"parsingProfiles": "库存解析",
|
||||
"parsingProfilesHelp": "维护可由多个库存站点共享的库存文件结构、字段对应关系和订单字段匹配键。",
|
||||
@@ -576,7 +603,7 @@
|
||||
"saving": "保存中...",
|
||||
"publish": "发布规则",
|
||||
"retire": "归档规则",
|
||||
"flowOrder": "订单解析",
|
||||
"flowOrder": "订单字段规则",
|
||||
"flowInventory": "库存解析",
|
||||
"flowTemplate": "发货模板",
|
||||
"flowRoute": "路由规则",
|
||||
@@ -2447,6 +2474,55 @@
|
||||
"title": "订单文档模板",
|
||||
"subtitle": "从 MinerU 表格样本可视化配置精确列映射;无需编辑 JSON 或结构指纹。",
|
||||
"structureBlocked": "该表格结构异常,不能创建模板。请等待坐标证据重建后再复核,勿通过字段映射修复原始网格。",
|
||||
"reconstructionRequired": "此表头混入明细,需先确认列边界并重建表格;重建结果必须人工审核。",
|
||||
"columnBoundaries": "相对列边界(0 到 1,逗号分隔)",
|
||||
"reconstructTable": "重建表格候选",
|
||||
"confirmReconstruction": "我已审核重建网格,允许将其用于此模板草稿",
|
||||
"reconstructionPreview": "逻辑明细重建候选(续行已合并,待人工审核)",
|
||||
"rowRole": { "header": "字段映射", "data": "有效明细", "deleted": "已删除" },
|
||||
"sourceRows": "来源物理行:{rows}",
|
||||
"rebuildAfterFieldMapping": "字段映射已变化,请再次点击“重建表格候选”并审核最终逻辑明细。",
|
||||
"multiSubrowEnabled": "此模板的一条明细由多行组成",
|
||||
"multiSubrowHint": "第 1 行必须将行号列映射为 line_no;可按实际版式继续增加第 2、3、4…行,每行均可使用独立且相互重叠的列边界。",
|
||||
"subrowColumn": "第 {index} 列",
|
||||
"firstSubrow": "第 1 行(新明细起始)",
|
||||
"followingSubrow": "第 {index} 行",
|
||||
"addSubrow": "增加一行版式",
|
||||
"autoSuggestLayout": "自动识别行版式",
|
||||
"autoSuggestLayoutHint": "系统将根据 PDF/OCR 字符位置自动生成行数和列边界;请根据每列示例文字确认字段。",
|
||||
"layoutSuggestionReady": "已生成行版式建议,请确认各列字段后重建表格候选。",
|
||||
"columnBoundariesAdvanced": "列边界(高级校准,通常无需修改)",
|
||||
"columnSamples": "示例:{samples}",
|
||||
"lineNoRequired": "第 1 行必须将订单行号所在列映射为 line_no。",
|
||||
"layoutRow": "物理行版式",
|
||||
"fieldMapping": "列示例与字段映射",
|
||||
"rowActions": "操作",
|
||||
"columnsUnit": "列",
|
||||
"livePreview": "实时候选",
|
||||
"livePreviewUpdating": "正在按当前映射更新…",
|
||||
"livePreviewReady": "已按当前映射更新",
|
||||
"livePreviewWaitingLineNo": "请先将第 1 行的订单行号列映射为 line_no",
|
||||
"livePreviewFailed": "自动更新失败,可点击“重建表格候选”查看错误",
|
||||
"livePreviewEmpty": "修改字段或列边界后,候选结果将在此自动更新",
|
||||
"confirmPreview": "确认候选",
|
||||
"visualBoundaries": "可视化列边界",
|
||||
"dragBoundaryHint": "拖动蓝色分隔点调整",
|
||||
"boundaryHandle": "第 {index} 个列边界",
|
||||
"preciseBoundaryValues": "精确边界值",
|
||||
"sourceColumn": "原列",
|
||||
"sampleValue": "样例内容",
|
||||
"targetField": "映射字段",
|
||||
"advancedSettings": "高级设置",
|
||||
"physicalRows": "物理行",
|
||||
"addColumn": "添加列",
|
||||
"insertColumnAfter": "后新增",
|
||||
"suggestCurrentRow": "识别当前行",
|
||||
"currentRowSuggestionReady": "当前物理行已识别,其他行配置保持不变。",
|
||||
"autoSuggestAllRows": "自动识别全部行",
|
||||
"reconstructionUnavailable": "此样本没有可用的 PDF 原生字符坐标;请上传带文本层的 PDF 样本后重试。",
|
||||
"generateOcrEvidence": "尝试 OCR 重建",
|
||||
"ocrEvidenceReady": "OCR 坐标已生成。请继续填写列边界、重建并人工审核候选网格。",
|
||||
"reconstructionBoundariesInvalid": "列边界必须从 0 开始、以 1 结束,并按从小到大排列。",
|
||||
"uploadSample": "上传模板样本",
|
||||
"uploadSampleHint": "仅支持 PDF 或 EML,仅用于模板配置和结构复核,不创建发货任务。",
|
||||
"sampleFileTypeInvalid": "模板样本仅支持 PDF 或 EML 文件。",
|
||||
@@ -2454,14 +2530,26 @@
|
||||
"createTitle": "从样本创建草稿",
|
||||
"editTitle": "用样本更新草稿",
|
||||
"sample": "样本文档",
|
||||
"searchSample": "按文件名搜索样本",
|
||||
"selectSample": "选择已解析文档",
|
||||
"tablesUnit": "张表",
|
||||
"sampleDetails": "上传时间:{time};解析状态:{status}",
|
||||
"templateSampleOnly": "这是模板页上传的专用样本;未被盲测引用时可以删除。",
|
||||
"businessSampleProtected": "这是历史业务附件,仅用于复核,不能在模板页删除。",
|
||||
"deleteSample": "删除样本",
|
||||
"deleteSampleConfirm": "确认删除这个模板专用样本?此操作会删除源文件和解析结果。",
|
||||
"sampleDeleted": "模板样本已删除",
|
||||
"sampleReferencedByBlindTest": "此样本已被盲测引用,必须保留审计记录,不能删除。",
|
||||
"table": "样本表格",
|
||||
"selectTable": "选择表格",
|
||||
"code": "模板编码",
|
||||
"name": "模板名称",
|
||||
"schema": "订单字段版本",
|
||||
"headerRow": "表头行索引",
|
||||
"headerRow": "表头结束行",
|
||||
"dataRow": "数据起始行",
|
||||
"multiRowHeaderMapping": "多行表头字段映射",
|
||||
"multiRowHeaderHint": "系统合并第 0 行至第 {end} 行的同列文字;这里只配置逻辑列字段,不要把表头行配置成明细行版式。",
|
||||
"mergedHeaderColumn": "第 {index} 列",
|
||||
"rowStructure": "明细行结构",
|
||||
"rowPreserved": "表格行列结构完整,可配置列映射",
|
||||
"rowUnsupported": "结构不可靠,仅登记模板并转人工复核",
|
||||
@@ -2475,6 +2563,8 @@
|
||||
"compositePart": "复合客户/内部料号",
|
||||
"previewEmpty": "请选择样本文档和表格查看预览",
|
||||
"versions": "模板版本",
|
||||
"currentVersion": "当前生效",
|
||||
"publishedAt": "发布时间:{time}",
|
||||
"publish": "发布",
|
||||
"newVersion": "创建新版本",
|
||||
"retire": "退役",
|
||||
|
||||
@@ -72,6 +72,8 @@
|
||||
"shippingNoticeDuplicateMatchTask": "命中任务:{taskNo}",
|
||||
"shippingNoticeDuplicateMatchStatus": "状态:{status}",
|
||||
"shippingNoticeDuplicateMatchFields": "匹配依据:{fields}",
|
||||
"shippingNoticeRevisionDifferences": "本次修订将变更以下 Reservation:",
|
||||
"shippingNoticeRevisionDifference": "{reservation}:料号 {previousPart} → {proposedPart};数量 {previousQty} → {proposedQty}",
|
||||
"shippingNoticeDuplicateOpenExisting": "打开已有任务",
|
||||
"shippingNoticeDuplicateOpenExistingHint": "不创建新任务,将当前附件关联到已有任务。",
|
||||
"shippingNoticeDuplicateCreateRevision": "作为修订版本创建",
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
{
|
||||
"generic": "请求失败。",
|
||||
"codes": {
|
||||
"SHIPPING.FULFILLMENT_POLICY_INVALID": "货代履约策略或字段能力绑定无效。",
|
||||
"SHIPPING.FULFILLMENT_POLICY_NOT_FOUND": "未找到货代履约策略。",
|
||||
"SHIPPING.FULFILLMENT_POLICY_CONFLICT": "货代履约策略已被其他管理员修改,请刷新后重试。",
|
||||
"SHIPPING.FULFILLMENT_POLICY_NOT_PUBLISHED": "尚未发布可执行的货代履约策略。",
|
||||
"SHIPPING.RESERVATION_PO_REQUIRED": "该预定单号已存在,必须补齐采购订单后才能继续。",
|
||||
"SHIPPING.RESERVATION_PO_CONFLICT": "该预定单号已被其他采购订单使用,已阻断重复订单。",
|
||||
"SHIPPING.RESERVATION_DUPLICATED_IN_ORDER": "同一订单中存在重复的预定单号,无法冻结。",
|
||||
"SHIPPING.RESERVATION_REVISION_REVIEW_REQUIRED": "该预定单号内容已变更,必须展示差异并经人工确认。",
|
||||
"SHIPPING.RESERVATION_REVISION_LOCKED": "该预定单号已生成有效发货文件或已上传,禁止直接修订。",
|
||||
"SHIPPING_NOTICE.BATCH_FILE_LIMIT_EXCEEDED": "本次上传文件数超过系统限制,请拆分后重试。",
|
||||
"AGENT.EXPOSURE_ROLE_IMMUTABLE": "应用与内部执行器不可互相转换。",
|
||||
"AGENT.ADMIN_SCOPE_INVALID": "应用管理页签参数无效。",
|
||||
@@ -25,7 +34,10 @@
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SCHEMA_INVALID": "订单文档解析模板必须绑定已发布或已退役的订单字段版本。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_FIELD_INVALID": "订单文档解析模板引用了不可用的订单明细字段。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_HEADER_CONTAMINATED": "样本表头混入订单明细,必须先重建表格结构,不能创建模板。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_RECONSTRUCTION_UNAVAILABLE": "当前表格缺少可用的原生或 OCR 字符坐标,无法重建逻辑明细。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_RECONSTRUCTION_INVALID": "坐标重建配置或结果无效,请检查列边界后重试。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SAMPLE_FILE_TYPE_INVALID": "模板样本仅支持 PDF 或 EML 文件。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SAMPLE_DELETE_BLOCKED": "该模板样本仍在解析、被盲测引用或其文件被其他业务使用,不能删除。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_IMMUTABLE": "已发布的订单文档解析模板不可修改。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_LOCK_VERSION_REQUIRED": "订单文档解析模板缺少版本锁,请刷新后重试。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_VERSION_CONFLICT": "订单文档解析模板已被其他管理员修改,请刷新后重试。",
|
||||
|
||||
@@ -28,15 +28,19 @@
|
||||
"reports": "數據報表",
|
||||
"schedules": "排程管理",
|
||||
"shippingCustomers": "貨代客戶",
|
||||
"shippingConfig": "貨代設定",
|
||||
"shippingInventory": "庫存設定",
|
||||
"shippingIdentityRules": "客戶識別規則",
|
||||
"shippingOrderExtractionRuns": "訂單識別運行",
|
||||
"shippingOrderDocumentProfiles": "訂單文件範本"
|
||||
"shippingConfig": "貨代管理",
|
||||
"shippingOrderRecognition": "訂單識別",
|
||||
"shippingInventoryManagement": "庫存管理",
|
||||
"shippingRunAudit": "執行稽核",
|
||||
"shippingOrderFields": "欄位規則",
|
||||
"shippingInventory": "庫存管理",
|
||||
"shippingIdentityRules": "客戶識別",
|
||||
"shippingOrderExtractionRuns": "識別任務",
|
||||
"shippingOrderDocumentProfiles": "文件範本"
|
||||
},
|
||||
"shippingOrderExtractionRuns": {
|
||||
"eyebrow": "唯讀執行診斷",
|
||||
"title": "訂單識別運行",
|
||||
"title": "識別任務",
|
||||
"subtitle": "用於排查非同步訂單識別的運行、重試嘗試與脫敏節點生命週期;不顯示訂單正文、提示詞、輸入輸出或錯誤堆疊。",
|
||||
"refresh": "重新整理",
|
||||
"status": "狀態",
|
||||
@@ -52,7 +56,7 @@
|
||||
"next": "下一頁",
|
||||
"loading": "正在載入...",
|
||||
"empty": "暫無運行記錄",
|
||||
"loadFailed": "載入訂單識別運行失敗",
|
||||
"loadFailed": "載入識別任務失敗",
|
||||
"detailFailed": "載入運行詳情失敗",
|
||||
"detailTitle": "運行診斷詳情",
|
||||
"workflowRunId": "Workflow Run ID",
|
||||
@@ -74,6 +78,28 @@
|
||||
"eyebrow": "訂單欄位範本",
|
||||
"title": "訂單範本設定",
|
||||
"subtitle": "所有 EML、PDF 和 Word 訂單共享同一份已發布欄位契約;發布後版本不可原地修改。",
|
||||
"fulfillmentEyebrow": "貨代履約治理",
|
||||
"fulfillmentTitle": "欄位能力與出貨策略",
|
||||
"fulfillmentHint": "只能把已發布 Schema 中範圍和格式相容的欄位綁定到受控能力;凍結訂單會保留完整策略快照。",
|
||||
"fulfillmentPublishedVersion": "已發布策略 V{version}",
|
||||
"fulfillmentNotPublished": "尚未發布履約策略",
|
||||
"fulfillmentSchemaRequired": "請先發布訂單 Schema,才能選擇策略綁定欄位。",
|
||||
"fulfillmentRequired": "必要能力",
|
||||
"fulfillmentOptional": "選用能力",
|
||||
"fulfillmentSelectField": "請選擇相容欄位",
|
||||
"fulfillmentChangeNote": "策略變更說明(選填)",
|
||||
"fulfillmentChangeNotePlaceholder": "例如:改用客戶預約單欄位",
|
||||
"fulfillmentCreateDraft": "建立策略草稿",
|
||||
"fulfillmentPublish": "發布策略",
|
||||
"fulfillmentDraftCreated": "履約策略草稿已建立",
|
||||
"fulfillmentPublished": "履約策略已發布,歷史凍結訂單不會被重新解讀",
|
||||
"fulfillmentDraftHint": "策略草稿 V{version} 已鎖定欄位綁定,請確認後發布。",
|
||||
"fulfillmentCapability": {
|
||||
"fulfillment.reservation_identity": "Reservation 識別",
|
||||
"fulfillment.part_number": "內部料號",
|
||||
"fulfillment.quantity": "出貨數量",
|
||||
"routing.inventory_source_hint": "庫存來源路由線索"
|
||||
},
|
||||
"schemaName": "範本名稱",
|
||||
"description": "說明",
|
||||
"initialize": "初始化訂單範本",
|
||||
@@ -368,14 +394,15 @@
|
||||
"orderHeaderIdentityHint": "訂單資訊屬於 Header 欄位,可作為客戶或送貨站點候選證據;系統不會只憑此欄位自動確認客戶。貨品明細不支援此設定。"
|
||||
},
|
||||
"shippingInventory": {
|
||||
"title": "貨代設定",
|
||||
"title": "貨代管理",
|
||||
"subtitle": "從訂單欄位、庫存解析到發貨 Excel 與庫存路由,維護一條可追溯的發貨設定鏈路。",
|
||||
"eyebrow": "貨代發貨設定工作台",
|
||||
"groupFoundation": "基礎定義",
|
||||
"groupOrderRecognition": "訂單識別",
|
||||
"groupInventory": "庫存管理",
|
||||
"groupAudit": "執行稽核",
|
||||
"orderFields": "訂單解析",
|
||||
"orderSchemaRequired": "請先在「訂單解析」發佈一個版本;庫存解析、出貨範本和路由規則才能引用訂單欄位。",
|
||||
"orderFields": "訂單欄位規則",
|
||||
"orderSchemaRequired": "請先在「訂單欄位規則」發佈一個版本;庫存解析、出貨範本和路由規則才能引用訂單欄位。",
|
||||
"connections": "系統連線",
|
||||
"parsingProfiles": "庫存解析",
|
||||
"parsingProfilesHelp": "維護可由多個庫存站點共用的庫存檔案結構、欄位對應與訂單欄位匹配鍵。",
|
||||
@@ -575,7 +602,7 @@
|
||||
"saving": "儲存中...",
|
||||
"publish": "發布規則",
|
||||
"retire": "歸檔規則",
|
||||
"flowOrder": "訂單解析",
|
||||
"flowOrder": "訂單欄位規則",
|
||||
"flowInventory": "庫存解析",
|
||||
"flowTemplate": "發貨模板",
|
||||
"flowRoute": "路由規則",
|
||||
@@ -2337,6 +2364,55 @@
|
||||
"title": "訂單文件範本",
|
||||
"subtitle": "從 MinerU 表格樣本視覺化設定精確欄位對應;無需編輯 JSON 或結構指紋。",
|
||||
"structureBlocked": "此表格結構異常,不能建立範本。請等待座標證據重建後再複核,勿以欄位對應修復原始網格。",
|
||||
"reconstructionRequired": "此表頭混入明細,需先確認欄位邊界並重建表格;重建結果必須人工複核。",
|
||||
"columnBoundaries": "相對欄位邊界(0 到 1,以逗號分隔)",
|
||||
"reconstructTable": "重建表格候選",
|
||||
"confirmReconstruction": "我已複核重建網格,允許將其用於此範本草稿",
|
||||
"reconstructionPreview": "邏輯明細重建候選(續行已合併,需人工複核)",
|
||||
"rowRole": { "header": "欄位映射", "data": "有效明細", "deleted": "已刪除" },
|
||||
"sourceRows": "來源實體行:{rows}",
|
||||
"rebuildAfterFieldMapping": "欄位映射已變更,請再次點擊「重建表格候選」並複核最終邏輯明細。",
|
||||
"multiSubrowEnabled": "此範本的一筆明細由多行組成",
|
||||
"multiSubrowHint": "第 1 行必須將行號欄映射為 line_no;可依實際版式繼續增加第 2、3、4…行,每行均可使用獨立且互相重疊的欄位邊界。",
|
||||
"subrowColumn": "第 {index} 欄",
|
||||
"firstSubrow": "第 1 行(新明細起始)",
|
||||
"followingSubrow": "第 {index} 行",
|
||||
"addSubrow": "增加一行版式",
|
||||
"autoSuggestLayout": "自動識別行版式",
|
||||
"autoSuggestLayoutHint": "系統將依 PDF/OCR 字元位置自動產生行數與欄位邊界;請依每欄範例文字確認欄位。",
|
||||
"layoutSuggestionReady": "已產生行版式建議,請確認各欄欄位後重建表格候選。",
|
||||
"columnBoundariesAdvanced": "欄位邊界(進階校準,通常無須修改)",
|
||||
"columnSamples": "範例:{samples}",
|
||||
"lineNoRequired": "第 1 行必須將訂單行號所在欄映射為 line_no。",
|
||||
"layoutRow": "物理行版式",
|
||||
"fieldMapping": "欄位範例與欄位映射",
|
||||
"rowActions": "操作",
|
||||
"columnsUnit": "欄",
|
||||
"livePreview": "即時候選",
|
||||
"livePreviewUpdating": "正在依目前映射更新…",
|
||||
"livePreviewReady": "已依目前映射更新",
|
||||
"livePreviewWaitingLineNo": "請先將第 1 行的訂單行號欄映射為 line_no",
|
||||
"livePreviewFailed": "自動更新失敗,可點擊「重建表格候選」查看錯誤",
|
||||
"livePreviewEmpty": "修改欄位或欄位邊界後,候選結果將在此自動更新",
|
||||
"confirmPreview": "確認候選",
|
||||
"visualBoundaries": "視覺化欄位邊界",
|
||||
"dragBoundaryHint": "拖動藍色分隔點調整",
|
||||
"boundaryHandle": "第 {index} 個欄位邊界",
|
||||
"preciseBoundaryValues": "精確邊界值",
|
||||
"sourceColumn": "原欄",
|
||||
"sampleValue": "範例內容",
|
||||
"targetField": "映射欄位",
|
||||
"advancedSettings": "進階設定",
|
||||
"physicalRows": "物理行",
|
||||
"addColumn": "新增欄",
|
||||
"insertColumnAfter": "後新增",
|
||||
"suggestCurrentRow": "識別目前行",
|
||||
"currentRowSuggestionReady": "目前物理行已識別,其他行設定保持不變。",
|
||||
"autoSuggestAllRows": "自動識別全部行",
|
||||
"reconstructionUnavailable": "此樣本沒有可用的 PDF 原生字元座標;請上傳具有文字層的 PDF 樣本後重試。",
|
||||
"generateOcrEvidence": "嘗試 OCR 重建",
|
||||
"ocrEvidenceReady": "OCR 座標已產生。請繼續填寫欄位邊界、重建並人工複核候選網格。",
|
||||
"reconstructionBoundariesInvalid": "欄位邊界必須從 0 開始、以 1 結束,並嚴格遞增。",
|
||||
"uploadSample": "上傳範本樣本",
|
||||
"uploadSampleHint": "僅支援 PDF 或 EML,僅用於範本設定與結構複核,不會建立發貨任務。",
|
||||
"sampleFileTypeInvalid": "範本樣本僅支援 PDF 或 EML 檔案。",
|
||||
@@ -2344,14 +2420,26 @@
|
||||
"createTitle": "從樣本建立草稿",
|
||||
"editTitle": "使用樣本更新草稿",
|
||||
"sample": "樣本文件",
|
||||
"searchSample": "依檔名搜尋樣本",
|
||||
"selectSample": "選擇已解析文件",
|
||||
"tablesUnit": "張表",
|
||||
"sampleDetails": "上傳時間:{time};解析狀態:{status}",
|
||||
"templateSampleOnly": "這是範本頁上傳的專用樣本;未被盲測引用時可以刪除。",
|
||||
"businessSampleProtected": "這是歷史業務附件,僅供複核,不能在範本頁刪除。",
|
||||
"deleteSample": "刪除樣本",
|
||||
"deleteSampleConfirm": "確認刪除這個範本專用樣本?此操作會刪除來源檔案與解析結果。",
|
||||
"sampleDeleted": "範本樣本已刪除",
|
||||
"sampleReferencedByBlindTest": "此樣本已被盲測引用,必須保留稽核記錄,不能刪除。",
|
||||
"table": "樣本表格",
|
||||
"selectTable": "選擇表格",
|
||||
"code": "範本編碼",
|
||||
"name": "範本名稱",
|
||||
"schema": "訂單欄位版本",
|
||||
"headerRow": "表頭列索引",
|
||||
"headerRow": "表頭結束列",
|
||||
"dataRow": "資料起始列",
|
||||
"multiRowHeaderMapping": "多列表頭欄位對應",
|
||||
"multiRowHeaderHint": "系統合併第 0 列至第 {end} 列的同欄文字;此處只設定邏輯欄位,不要把表頭列設定成明細列版式。",
|
||||
"mergedHeaderColumn": "第 {index} 欄",
|
||||
"rowStructure": "明細列結構",
|
||||
"rowPreserved": "表格行列結構完整,可設定欄位對應",
|
||||
"rowUnsupported": "結構不可靠,僅登記範本並轉人工複核",
|
||||
@@ -2365,6 +2453,8 @@
|
||||
"compositePart": "複合客戶/內部料號",
|
||||
"previewEmpty": "請選擇樣本文件和表格查看預覽",
|
||||
"versions": "範本版本",
|
||||
"currentVersion": "目前生效",
|
||||
"publishedAt": "發布時間:{time}",
|
||||
"publish": "發布",
|
||||
"newVersion": "建立新版本",
|
||||
"retire": "退役",
|
||||
|
||||
@@ -72,6 +72,8 @@
|
||||
"shippingNoticeDuplicateMatchTask": "命中任務:{taskNo}",
|
||||
"shippingNoticeDuplicateMatchStatus": "狀態:{status}",
|
||||
"shippingNoticeDuplicateMatchFields": "匹配依據:{fields}",
|
||||
"shippingNoticeRevisionDifferences": "此次修訂將變更以下 Reservation:",
|
||||
"shippingNoticeRevisionDifference": "{reservation}:料號 {previousPart} → {proposedPart};數量 {previousQty} → {proposedQty}",
|
||||
"shippingNoticeDuplicateOpenExisting": "開啟已有任務",
|
||||
"shippingNoticeDuplicateOpenExistingHint": "不建立新任務,將目前附件關聯到已有任務。",
|
||||
"shippingNoticeDuplicateCreateRevision": "作為修訂版本建立",
|
||||
|
||||
@@ -1,6 +1,15 @@
|
||||
{
|
||||
"generic": "請求失敗。",
|
||||
"codes": {
|
||||
"SHIPPING.FULFILLMENT_POLICY_INVALID": "貨代履約策略或欄位能力綁定無效。",
|
||||
"SHIPPING.FULFILLMENT_POLICY_NOT_FOUND": "找不到貨代履約策略。",
|
||||
"SHIPPING.FULFILLMENT_POLICY_CONFLICT": "貨代履約策略已被其他管理員修改,請重新整理後再試。",
|
||||
"SHIPPING.FULFILLMENT_POLICY_NOT_PUBLISHED": "尚未發佈可執行的貨代履約策略。",
|
||||
"SHIPPING.RESERVATION_PO_REQUIRED": "此預定單號已存在,必須補齊採購訂單後才能繼續。",
|
||||
"SHIPPING.RESERVATION_PO_CONFLICT": "此預定單號已被其他採購訂單使用,已阻擋重複訂單。",
|
||||
"SHIPPING.RESERVATION_DUPLICATED_IN_ORDER": "同一訂單中存在重複的預定單號,無法凍結。",
|
||||
"SHIPPING.RESERVATION_REVISION_REVIEW_REQUIRED": "此預定單號內容已變更,必須顯示差異並經人工確認。",
|
||||
"SHIPPING.RESERVATION_REVISION_LOCKED": "此預定單號已產生有效發貨檔案或已上傳,禁止直接修訂。",
|
||||
"SHIPPING_NOTICE.BATCH_FILE_LIMIT_EXCEEDED": "本次上傳檔案數超過系統限制,請拆分後重試。",
|
||||
"AGENT.EXPOSURE_ROLE_IMMUTABLE": "應用與內部執行器不可互相轉換。",
|
||||
"AGENT.ADMIN_SCOPE_INVALID": "應用管理頁籤參數無效。",
|
||||
@@ -25,7 +34,10 @@
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SCHEMA_INVALID": "訂單文件解析範本必須綁定已發布或已退役的訂單欄位版本。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_FIELD_INVALID": "訂單文件解析範本引用了不可用的訂單明細欄位。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_HEADER_CONTAMINATED": "樣本表頭混入訂單明細,必須先重建表格結構,不能建立範本。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_RECONSTRUCTION_UNAVAILABLE": "目前表格缺少可用的原生或 OCR 字元座標,無法重建邏輯明細。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_RECONSTRUCTION_INVALID": "座標重建設定或結果無效,請檢查欄位邊界後重試。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SAMPLE_FILE_TYPE_INVALID": "範本樣本僅支援 PDF 或 EML 檔案。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_SAMPLE_DELETE_BLOCKED": "此範本樣本仍在解析、被盲測引用,或其檔案被其他業務使用,不能刪除。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_IMMUTABLE": "已發布的訂單文件解析範本不可修改。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_LOCK_VERSION_REQUIRED": "訂單文件解析範本缺少版本鎖,請重新整理後再試。",
|
||||
"SHIPPING_ORDER_DOCUMENT_PROFILE_VERSION_CONFLICT": "訂單文件解析範本已被其他管理員修改,請重新整理後再試。",
|
||||
|
||||
Reference in new issue
Block a user