From 28d6085d0788d1dd2bdd232e2af341fc9482d19f Mon Sep 17 00:00:00 2001 From: caohuipeng Date: Thu, 15 Oct 2026 12:56:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(shipping-inventory):=20=E8=A1=A5=E9=BD=90?= =?UTF-8?q?=E5=BC=82=E5=8A=A8=E5=AD=97=E6=AE=B5=E5=9B=9B=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=B9=B6=E5=8A=A0=E5=A5=91=E7=BA=A6=E6=8A=A4?= =?UTF-8?q?=E6=A0=8F=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 后端 MOVEMENT_FIELDS 2026-10-14 扩 7 个可选维度字段后,管理页标准异动字段 下拉把原始 i18n key 直接渲染给了用户。四语言 movementFields 补齐 line_seq/specification/order_type/odm_id/odm_name/carton_id/pallet_id, 新增 movementFieldLabels.spec 锁定四语言键集与后端 18 字段契约一致。 随行披露:admin.json 同步携带调拨类型管理页 transferTypes 文案键(供后续批次使用)。 --- .../movementFieldLabels.spec.ts | 48 +++++++ frontend/src/locales/en/admin.json | 117 +++++++++++++++++- frontend/src/locales/th/admin.json | 117 +++++++++++++++++- frontend/src/locales/zh-CN/admin.json | 117 +++++++++++++++++- frontend/src/locales/zh-TW/admin.json | 117 +++++++++++++++++- 5 files changed, 512 insertions(+), 4 deletions(-) create mode 100644 frontend/src/features/admin/modules/shipping-inventory/movementFieldLabels.spec.ts diff --git a/frontend/src/features/admin/modules/shipping-inventory/movementFieldLabels.spec.ts b/frontend/src/features/admin/modules/shipping-inventory/movementFieldLabels.spec.ts new file mode 100644 index 00000000..f7b3f8b4 --- /dev/null +++ b/frontend/src/features/admin/modules/shipping-inventory/movementFieldLabels.spec.ts @@ -0,0 +1,48 @@ +/** + * features/admin/modules/shipping-inventory/movementFieldLabels.spec.ts + * 用途:锁定库存解析管理页「标准异动字段」标签映射与后端 MOVEMENT_FIELDS 契约一致。 + * 依赖:vitest、四语言 locales 下各 admin.json。 + * 逻辑:页面用 `movementFields.${item.code}` 动态取标签,code 集合由后端目录接口 + * (movement_contract.MOVEMENT_FIELDS)在运行期下发,静态 i18n 工具查不出缺键—— + * 后端扩字段而语言包未同步时,界面会把原始 key(如 admin.shippingInventory. + * movementFields.order_type)直接渲染给用户(2026-10-15 实测回归)。 + */ + +import { describe, expect, it } from 'vitest'; +import zhCN from '@/locales/zh-CN/admin.json'; +import zhTW from '@/locales/zh-TW/admin.json'; +import en from '@/locales/en/admin.json'; +import th from '@/locales/th/admin.json'; + +// 后端权威契约:backend/app/services/in_transit_transfer/movement_contract.py MOVEMENT_FIELDS。 +// ⚠️ 后端追加/删除异动字段时,必须同步此列表与四语言包 movementFields(i18n 四语言红线)。 +const BACKEND_MOVEMENT_FIELD_CODES = [ + 'doc_no', 'line_no', 'in_out_flag', 'material_code', 'material_name', + 'warehouse_code', 'storage_code', 'lot_no', 'quantity', 'movement_date', 'unit', + 'line_seq', 'specification', 'order_type', 'odm_id', 'odm_name', 'carton_id', 'pallet_id', +] as const; + +const LABEL_MAPS: Record> = { + 'zh-CN': (zhCN as Record).shippingInventory.movementFields, + 'zh-TW': (zhTW as Record).shippingInventory.movementFields, + en: (en as Record).shippingInventory.movementFields, + th: (th as Record).shippingInventory.movementFields, +}; + +describe('movementFieldLabels', () => { + it('四语言 movementFields 与后端 MOVEMENT_FIELDS 契约逐键对齐', () => { + for (const [locale, labels] of Object.entries(LABEL_MAPS)) { + const codes = Object.keys(labels); + // 关键断言:不缺键(缺键=界面渲染原始 key)、不多键(多键=契约外死键误导维护者)。 + expect(codes.sort(), `${locale} 缺键/多键`).toEqual([...BACKEND_MOVEMENT_FIELD_CODES].sort()); + // 关键断言:每个标签都是非空真实文案,防止键在但值为空。 + for (const code of codes) expect(labels[code].trim().length, `${locale}.${code}`).toBeGreaterThan(0); + } + }); + + it('四语言之间标签键集互相同步(防单语言先行漂移)', () => { + const keySets = Object.values(LABEL_MAPS).map((labels) => Object.keys(labels).sort()); + // 关键断言:任一语言补键时必须四语言同时补齐。 + for (const keySet of keySets.slice(1)) expect(keySet).toEqual(keySets[0]); + }); +}); diff --git a/frontend/src/locales/en/admin.json b/frontend/src/locales/en/admin.json index 2f4f8a61..8de2a6ff 100644 --- a/frontend/src/locales/en/admin.json +++ b/frontend/src/locales/en/admin.json @@ -14,6 +14,7 @@ "edit": "Edit", "delete": "Delete", "nav": { + "transferTypes": "In-Transit Transfer Types", "dashboard": "Dashboard", "approvals": "User Approvals", "users": "User Maintenance", @@ -706,7 +707,9 @@ "movementFields": { "doc_no": "Doc No.", "line_no": "Line No.", "in_out_flag": "In/Out Flag", "material_code": "Material Code", "material_name": "Material Name", "warehouse_code": "Warehouse", "storage_code": "Storage Bin", "lot_no": "Lot No.", - "quantity": "Quantity", "movement_date": "Movement Date", "unit": "Unit" + "quantity": "Quantity", "movement_date": "Movement Date", "unit": "Unit", + "line_seq": "Line Seq.", "specification": "Specification", "order_type": "Order Type", + "odm_id": "ODM ID", "odm_name": "ODM Name", "carton_id": "Carton No.", "pallet_id": "Pallet No." }, "inventoryAnalysisFailed": "Inventory file structure recognition failed.", "inventoryAnalysisPreview": "Recognition Preview", @@ -5858,5 +5861,117 @@ "stopped_revoked": "Revoked, no further reminders", "excluded": "Outside monitoring" } + }, + "transferTypes": { + "title": "In-Transit Transfer Types", + "subtitle": "Configure scope rules, warehouse definitions and field transforms for in-transit transfer types; changes take effect immediately after saving.", + "createType": "New Type", + "searchLabel": "Search", + "searchPlaceholder": "Search code/name…", + "statusLabel": "Status", + "statusAll": "All", + "statusEnabled": "Enabled", + "statusDisabled": "Disabled", + "loading": "Loading…", + "empty": "No transfer types yet", + "emptyHint": "Click \"New Type\" to create the first in-transit transfer type.", + "colCode": "Code", + "colName": "Name", + "colRules": "Rules", + "colStatus": "Status", + "colActions": "Actions", + "enabled": "Enabled", + "disabled": "Disabled", + "edit": "Edit", + "drawerCreateTitle": "Create Transfer Type", + "drawerEditTitle": "Edit Transfer Type", + "errorSummaryTitle": "Please fix the following issues and retry:", + "sectionBasic": "Basic Info", + "codeLabel": "Code", + "codeImmutableHint": "Immutable after creation", + "nameZhCnLabel": "Name (zh-CN, required)", + "nameZhTwLabel": "Name (zh-TW)", + "nameEnLabel": "Name (en)", + "nameThLabel": "Name (th)", + "sortLabel": "Sort Order", + "enabledLabel": "Enabled", + "sectionScope": "Scope Rules", + "scopeHint": "Rules combine with AND; multiple values within a rule combine with OR", + "overlapWarning": "Scope overlaps with enabled type(s) \"{codes}\" — please confirm this is intended", + "fieldLabel": "Field", + "chooseField": "Select a field", + "matchLabel": "Match", + "valuesLabel": "Values", + "valuesPlaceholder": "Press Enter to add; commas supported", + "removeValue": "Remove value {value}", + "removeRule": "Remove rule", + "addScopeRule": "Add Rule", + "sectionWarehouse": "Warehouse Definition", + "warehouseFrom": "From Warehouse", + "warehouseTo": "To Warehouse", + "modeMapped": "Mapped", + "modeFixed": "Fixed", + "fixedCodeLabel": "Warehouse Code", + "orgLabel": "External Org Override", + "orgHint": "Leave empty to inherit the mapped external org", + "mappingCheckOk": "Warehouse code exists in the mapping archive", + "mappingCheckMissing": "Warehouse code not found in the mapping archive (hint only, saving is not blocked)", + "sectionTransform": "Transform Rules", + "transformField": "Field", + "transformOp": "Transform", + "transformSource": "Source Prefix", + "transformTarget": "New Prefix", + "removeTransform": "Remove transform", + "addTransformRule": "Add Transform", + "cancel": "Cancel", + "save": "Save", + "saving": "Saving…", + "saveSuccess": "Transfer type saved", + "saveFailed": "Save failed", + "loadFailed": "Failed to load transfer types, please retry later", + "loadFailedTitle": "Load failed", + "emptyScopeConfirm": "Without scope rules the backend rejects all lines by default (fail-closed). Save without scope rules anyway?", + "matchLabels": { + "prefix": "Prefix", + "equals": "Equals", + "contains": "Contains", + "in": "In" + }, + "scopeFieldLabels": { + "source_code": "Receipt Source", + "doc_no": "Receipt Doc No", + "warehouse_code": "Warehouse", + "storage_code": "Storage Bin", + "lot_no": "Lot No", + "movement_date": "Movement Date", + "record_kind": "Record Type", + "in_out_flag": "In-Out Flag", + "order_type": "Order Type", + "odm_id": "ODM ID", + "odm_name": "ODM NAME", + "carton_id": "Carton No", + "pallet_id": "Pallet No", + "material_code": "Material Code", + "doc_nature": "Doc Nature", + "movement_type": "Movement Type", + "reason_code": "Reason Code", + "partner_code": "Partner Code" + }, + "transformFieldLabels": { + "lot_no": "Lot No" + }, + "transformOpLabels": { + "prefix_replace": "Prefix Replace" + }, + "errors": { + "codeRequired": "Transfer type code is required", + "codeFormat": "Code must start with a lowercase letter and contain only lowercase letters, digits or underscores (2-64 chars)", + "nameRequired": "Chinese name (zh-CN) is required", + "ruleFieldRequired": "Select a scope field", + "ruleValuesRequired": "Add at least one value", + "fixedCodeRequired": "Warehouse code is required for fixed mode", + "transformSourceRequired": "Source prefix is required", + "transformTargetRequired": "New prefix is required" + } } } diff --git a/frontend/src/locales/th/admin.json b/frontend/src/locales/th/admin.json index 579f3d37..d86ba76c 100644 --- a/frontend/src/locales/th/admin.json +++ b/frontend/src/locales/th/admin.json @@ -14,6 +14,7 @@ "edit": "แก้ไข", "delete": "ลบ", "nav": { + "transferTypes": "ประเภทการโอนระหว่างทาง", "dashboard": "แดชบอร์ด", "approvals": "การอนุมัติผู้ใช้", "users": "การจัดการผู้ใช้", @@ -706,7 +707,9 @@ "movementFields": { "doc_no": "เลขที่เอกสาร", "line_no": "ลำดับรายการ", "in_out_flag": "เข้า/ออก", "material_code": "รหัสวัสดุ", "material_name": "ชื่อวัสดุ", "warehouse_code": "คลังสินค้า", "storage_code": "ตำแหน่งจัดเก็บ", "lot_no": "เลขล็อต", - "quantity": "จำนวน", "movement_date": "วันที่เคลื่อนไหว", "unit": "หน่วย" + "quantity": "จำนวน", "movement_date": "วันที่เคลื่อนไหว", "unit": "หน่วย", + "line_seq": "ลำดับรายการย่อย", "specification": "สเปคสินค้า", "order_type": "ประเภทคำสั่งซื้อ", + "odm_id": "รหัส ODM", "odm_name": "ชื่อ ODM", "carton_id": "หมายเลขกล่อง", "pallet_id": "หมายเลขพาเลท" }, "inventoryAnalysisFailed": "การระบุโครงสร้างไฟล์สต็อกล้มเหลว", "inventoryAnalysisPreview": "ตัวอย่างผลการระบุ", @@ -5858,5 +5861,117 @@ "stopped_revoked": "เพิกถอนแล้ว ไม่แจ้งเตือนอีก", "excluded": "อยู่นอกขอบเขตติดตาม" } + }, + "transferTypes": { + "title": "ประเภทการโอนระหว่างทาง", + "subtitle": "กำหนดกฎขอบเขต การระบุคลังสินค้า และกฎการแปลงค่าของประเภทการโอนระหว่างทาง มีผลทันทีหลังบันทึก", + "createType": "สร้างประเภทใหม่", + "searchLabel": "ค้นหา", + "searchPlaceholder": "ค้นหารหัส/ชื่อ…", + "statusLabel": "สถานะ", + "statusAll": "ทั้งหมด", + "statusEnabled": "เปิดใช้งาน", + "statusDisabled": "ปิดใช้งาน", + "loading": "กำลังโหลด…", + "empty": "ยังไม่มีประเภทการโอน", + "emptyHint": "คลิก \"สร้างประเภทใหม่\" เพื่อสร้างประเภทการโอนระหว่างทางรายการแรก", + "colCode": "รหัส", + "colName": "ชื่อ", + "colRules": "จำนวนกฎ", + "colStatus": "สถานะ", + "colActions": "การดำเนินการ", + "enabled": "เปิดใช้งาน", + "disabled": "ปิดใช้งาน", + "edit": "แก้ไข", + "drawerCreateTitle": "สร้างประเภทการโอน", + "drawerEditTitle": "แก้ไขประเภทการโอน", + "errorSummaryTitle": "กรุณาแก้ไขปัญหาต่อไปนี้แล้วลองใหม่:", + "sectionBasic": "ข้อมูลพื้นฐาน", + "codeLabel": "รหัส", + "codeImmutableHint": "แก้ไขไม่ได้หลังสร้าง", + "nameZhCnLabel": "ชื่อ (zh-CN, จำเป็น)", + "nameZhTwLabel": "ชื่อ (zh-TW)", + "nameEnLabel": "ชื่อ (en)", + "nameThLabel": "ชื่อ (th)", + "sortLabel": "ลำดับการเรียง", + "enabledLabel": "สถานะเปิดใช้งาน", + "sectionScope": "กฎขอบเขต", + "scopeHint": "ระหว่างกฎเชื่อมแบบ AND ภายในกฎหลายค่าเชื่อมแบบ OR", + "overlapWarning": "ขอบเขตทับซ้อนกับประเภทที่เปิดใช้งาน \"{codes}\" — กรุณายืนยันว่าตั้งใจ", + "fieldLabel": "ฟิลด์", + "chooseField": "กรุณาเลือกฟิลด์", + "matchLabel": "วิธีจับคู่", + "valuesLabel": "ค่า", + "valuesPlaceholder": "กด Enter เพื่อเพิ่ม รองรับเครื่องหมายจุลภาค", + "removeValue": "ลบค่า {value}", + "removeRule": "ลบกฎ", + "addScopeRule": "เพิ่มกฎ", + "sectionWarehouse": "การกำหนดคลังสินค้า", + "warehouseFrom": "คลังต้นทาง (โอนออก)", + "warehouseTo": "คลังปลายทาง (โอนเข้า)", + "modeMapped": "ตาม mapping", + "modeFixed": "กำหนดคงที่", + "fixedCodeLabel": "รหัสคลังสินค้า", + "orgLabel": "บริษัทที่ทับ (นิติบุคคล)", + "orgHint": "เว้นว่าง=ใช้ตาม mapping", + "mappingCheckOk": "พบรหัสคลังสินค้าใน mapping แล้ว", + "mappingCheckMissing": "ไม่พบรหัสคลังสินค้าใน mapping (แจ้งเตือนเท่านั้น ไม่บล็อกการบันทึก)", + "sectionTransform": "กฎการแปลงค่า", + "transformField": "ฟิลด์", + "transformOp": "วิธีแปลง", + "transformSource": "คำนำหน้าเดิม", + "transformTarget": "คำนำหน้าใหม่", + "removeTransform": "ลบการแปลง", + "addTransformRule": "เพิ่มการแปลง", + "cancel": "ยกเลิก", + "save": "บันทึก", + "saving": "กำลังบันทึก…", + "saveSuccess": "บันทึกประเภทการโอนแล้ว", + "saveFailed": "บันทึกล้มเหลว", + "loadFailed": "โหลดประเภทการโอนล้มเหลว กรุณาลองใหม่ภายหลัง", + "loadFailedTitle": "โหลดล้มเหลว", + "emptyScopeConfirm": "หากไม่ตั้งกฎขอบเขต ระบบจะปฏิเสธทุกรายการตามค่าเริ่มต้น (fail-closed) ยืนยันจะบันทึกโดยไม่มีกฎขอบเขตหรือไม่?", + "matchLabels": { + "prefix": "คำนำหน้า", + "equals": "เท่ากับ", + "contains": "มีคำว่า", + "in": "อยู่ใน" + }, + "scopeFieldLabels": { + "source_code": "แหล่งรับสินค้า", + "doc_no": "เลขที่เอกสารรับ", + "warehouse_code": "คลังสินค้า", + "storage_code": "ตำแหน่งจัดเก็บ", + "lot_no": "เลขล็อต", + "movement_date": "วันที่เคลื่อนไหว", + "record_kind": "ประเภทรายการ", + "in_out_flag": "รหัสเข้า-ออก", + "order_type": "ประเภทคำสั่งซื้อ", + "odm_id": "ODM ID", + "odm_name": "ODM NAME", + "carton_id": "เลขกล่อง", + "pallet_id": "เลขพาเลท", + "material_code": "รหัสวัสดุ", + "doc_nature": "ลักษณะเอกสารเคลื่อนไหว", + "movement_type": "ประเภทการเคลื่อนไหวสต๊อก", + "reason_code": "รหัสเหตุผล", + "partner_code": "รหัสคู่ค้า" + }, + "transformFieldLabels": { + "lot_no": "เลขล็อต" + }, + "transformOpLabels": { + "prefix_replace": "แทนที่คำนำหน้า" + }, + "errors": { + "codeRequired": "กรุณากรอกรหัสประเภทการโอน", + "codeFormat": "รหัสต้องขึ้นต้นด้วยตัวอักษรพิมพ์เล็ก และมีเฉพาะตัวอักษรพิมพ์เล็ก/ตัวเลข/ขีดล่าง ความยาว 2-64", + "nameRequired": "กรุณากรอกชื่อภาษาจีน (zh-CN)", + "ruleFieldRequired": "กรุณาเลือกฟิลด์ขอบเขต", + "ruleValuesRequired": "กรุณาเพิ่มค่าอย่างน้อยหนึ่งค่า", + "fixedCodeRequired": "โหมดคงที่ต้องกรอกรหัสคลังสินค้า", + "transformSourceRequired": "กรุณากรอกคำนำหน้าเดิม", + "transformTargetRequired": "กรุณากรอกคำนำหน้าใหม่" + } } } diff --git a/frontend/src/locales/zh-CN/admin.json b/frontend/src/locales/zh-CN/admin.json index 5f4095cb..5aeb9e46 100644 --- a/frontend/src/locales/zh-CN/admin.json +++ b/frontend/src/locales/zh-CN/admin.json @@ -14,6 +14,7 @@ "edit": "编辑", "delete": "删除", "nav": { + "transferTypes": "在途调拨类型", "dashboard": "仪表盘", "approvals": "用户审批", "users": "用户管理", @@ -834,7 +835,9 @@ "movementFields": { "doc_no": "单号", "line_no": "项次", "in_out_flag": "进出库别", "material_code": "料号", "material_name": "品名", "warehouse_code": "仓库", "storage_code": "储位", "lot_no": "批号", - "quantity": "数量", "movement_date": "异动日期", "unit": "单位" + "quantity": "数量", "movement_date": "异动日期", "unit": "单位", + "line_seq": "项序", "specification": "规格", "order_type": "订单类型", + "odm_id": "ODM编号", "odm_name": "ODM名称", "carton_id": "箱号", "pallet_id": "栈板号" }, "inventoryAnalysisFailed": "库存文件结构识别失败。", "inventoryAnalysisPreview": "识别结果预览", @@ -5891,5 +5894,117 @@ "stopped_revoked": "已撤销,不再提醒", "excluded": "不在监控范围" } + }, + "transferTypes": { + "title": "在途调拨类型", + "subtitle": "配置在途调拨类型的范围规则、仓库定义与字段转换,保存后立即生效。", + "createType": "新建类型", + "searchLabel": "搜索", + "searchPlaceholder": "搜索编码/名称…", + "statusLabel": "状态", + "statusAll": "全部", + "statusEnabled": "启用", + "statusDisabled": "停用", + "loading": "加载中…", + "empty": "暂无调拨类型", + "emptyHint": "点击「新建类型」创建第一条在途调拨类型。", + "colCode": "编码", + "colName": "名称", + "colRules": "规则数", + "colStatus": "状态", + "colActions": "操作", + "enabled": "启用", + "disabled": "停用", + "edit": "编辑", + "drawerCreateTitle": "新建调拨类型", + "drawerEditTitle": "编辑调拨类型", + "errorSummaryTitle": "请修正以下问题后重试:", + "sectionBasic": "基本信息", + "codeLabel": "编码", + "codeImmutableHint": "创建后不可修改", + "nameZhCnLabel": "名称(zh-CN,必填)", + "nameZhTwLabel": "名称(zh-TW)", + "nameEnLabel": "名称(en)", + "nameThLabel": "名称(th)", + "sortLabel": "排序", + "enabledLabel": "启用状态", + "sectionScope": "范围规则", + "scopeHint": "规则间为「且」,规则内多值为「或」", + "overlapWarning": "与启用类型「{codes}」范围重叠——确认是否有意", + "fieldLabel": "字段", + "chooseField": "请选择字段", + "matchLabel": "匹配方式", + "valuesLabel": "值", + "valuesPlaceholder": "输入后回车添加,支持逗号分隔", + "removeValue": "删除值 {value}", + "removeRule": "删除规则", + "addScopeRule": "添加规则", + "sectionWarehouse": "仓库定义", + "warehouseFrom": "拨出仓", + "warehouseTo": "拨入仓", + "modeMapped": "映射档", + "modeFixed": "固定", + "fixedCodeLabel": "仓库编码", + "orgLabel": "法人覆盖", + "orgHint": "空=沿用映射档法人", + "mappingCheckOk": "映射档已包含该仓库编码", + "mappingCheckMissing": "映射档未找到该仓库编码(仅提示,不拦截保存)", + "sectionTransform": "转换规则", + "transformField": "字段", + "transformOp": "转换方式", + "transformSource": "原前缀", + "transformTarget": "新前缀", + "removeTransform": "删除转换", + "addTransformRule": "添加转换", + "cancel": "取消", + "save": "保存", + "saving": "保存中…", + "saveSuccess": "调拨类型已保存", + "saveFailed": "保存失败", + "loadFailed": "调拨类型加载失败,请稍后重试", + "loadFailedTitle": "加载失败", + "emptyScopeConfirm": "未配置范围规则时后端将默认拒绝全部明细行(fail-closed)。确认要在无范围规则的情况下保存吗?", + "matchLabels": { + "prefix": "前缀", + "equals": "等于", + "contains": "包含", + "in": "属于" + }, + "scopeFieldLabels": { + "source_code": "收料来源实例", + "doc_no": "收料单号", + "warehouse_code": "仓库", + "storage_code": "储位", + "lot_no": "批号", + "movement_date": "异动日期", + "record_kind": "记录类型", + "in_out_flag": "出入库码", + "order_type": "订单类型", + "odm_id": "ODM ID", + "odm_name": "ODM NAME", + "carton_id": "箱号", + "pallet_id": "栈板号", + "material_code": "料件编号", + "doc_nature": "异动单据性质", + "movement_type": "库存异动类型", + "reason_code": "理由码", + "partner_code": "供应商·客户编号" + }, + "transformFieldLabels": { + "lot_no": "批号" + }, + "transformOpLabels": { + "prefix_replace": "前缀替换" + }, + "errors": { + "codeRequired": "请输入调拨类型编码", + "codeFormat": "编码需以小写字母开头,仅含小写字母/数字/下划线,长度 2-64", + "nameRequired": "请输入中文名称(zh-CN)", + "ruleFieldRequired": "请选择范围字段", + "ruleValuesRequired": "请至少添加一个值", + "fixedCodeRequired": "固定仓库必须填写仓库编码", + "transformSourceRequired": "请输入原前缀", + "transformTargetRequired": "请输入新前缀" + } } } diff --git a/frontend/src/locales/zh-TW/admin.json b/frontend/src/locales/zh-TW/admin.json index ac3b6ad8..3d42e0d7 100644 --- a/frontend/src/locales/zh-TW/admin.json +++ b/frontend/src/locales/zh-TW/admin.json @@ -14,6 +14,7 @@ "edit": "編輯", "delete": "刪除", "nav": { + "transferTypes": "在途調撥類型", "dashboard": "儀表盤", "approvals": "用戶審批", "users": "用戶管理", @@ -706,7 +707,9 @@ "movementFields": { "doc_no": "單號", "line_no": "項次", "in_out_flag": "進出庫別", "material_code": "料號", "material_name": "品名", "warehouse_code": "倉庫", "storage_code": "儲位", "lot_no": "批號", - "quantity": "數量", "movement_date": "異動日期", "unit": "單位" + "quantity": "數量", "movement_date": "異動日期", "unit": "單位", + "line_seq": "項序", "specification": "規格", "order_type": "訂單類型", + "odm_id": "ODM編號", "odm_name": "ODM名稱", "carton_id": "箱號", "pallet_id": "棧板號" }, "inventoryAnalysisFailed": "庫存檔案結構識別失敗。", "inventoryAnalysisPreview": "識別結果預覽", @@ -5858,5 +5861,117 @@ "stopped_revoked": "已撤銷,不再提醒", "excluded": "不在監控範圍" } + }, + "transferTypes": { + "title": "在途調撥類型", + "subtitle": "設定在途調撥類型的範圍規則、倉庫定義與欄位轉換,儲存後立即生效。", + "createType": "新建類型", + "searchLabel": "搜尋", + "searchPlaceholder": "搜尋編碼/名稱…", + "statusLabel": "狀態", + "statusAll": "全部", + "statusEnabled": "啟用", + "statusDisabled": "停用", + "loading": "載入中…", + "empty": "暫無調撥類型", + "emptyHint": "點擊「新建類型」建立第一筆在途調撥類型。", + "colCode": "編碼", + "colName": "名稱", + "colRules": "規則數", + "colStatus": "狀態", + "colActions": "操作", + "enabled": "啟用", + "disabled": "停用", + "edit": "編輯", + "drawerCreateTitle": "新建調撥類型", + "drawerEditTitle": "編輯調撥類型", + "errorSummaryTitle": "請修正以下問題後重試:", + "sectionBasic": "基本資訊", + "codeLabel": "編碼", + "codeImmutableHint": "建立後不可修改", + "nameZhCnLabel": "名稱(zh-CN,必填)", + "nameZhTwLabel": "名稱(zh-TW)", + "nameEnLabel": "名稱(en)", + "nameThLabel": "名稱(th)", + "sortLabel": "排序", + "enabledLabel": "啟用狀態", + "sectionScope": "範圍規則", + "scopeHint": "規則間為「且」,規則內多值為「或」", + "overlapWarning": "與啟用類型「{codes}」範圍重疊——確認是否有意", + "fieldLabel": "欄位", + "chooseField": "請選擇欄位", + "matchLabel": "匹配方式", + "valuesLabel": "值", + "valuesPlaceholder": "輸入後按 Enter 新增,支援逗號分隔", + "removeValue": "刪除值 {value}", + "removeRule": "刪除規則", + "addScopeRule": "新增規則", + "sectionWarehouse": "倉庫定義", + "warehouseFrom": "撥出倉", + "warehouseTo": "撥入倉", + "modeMapped": "映射檔", + "modeFixed": "固定", + "fixedCodeLabel": "倉庫編碼", + "orgLabel": "法人覆蓋", + "orgHint": "空=沿用映射檔法人", + "mappingCheckOk": "映射檔已包含該倉庫編碼", + "mappingCheckMissing": "映射檔找不到該倉庫編碼(僅提示,不攔截儲存)", + "sectionTransform": "轉換規則", + "transformField": "欄位", + "transformOp": "轉換方式", + "transformSource": "原前綴", + "transformTarget": "新前綴", + "removeTransform": "刪除轉換", + "addTransformRule": "新增轉換", + "cancel": "取消", + "save": "儲存", + "saving": "儲存中…", + "saveSuccess": "調撥類型已儲存", + "saveFailed": "儲存失敗", + "loadFailed": "調撥類型載入失敗,請稍後重試", + "loadFailedTitle": "載入失敗", + "emptyScopeConfirm": "未設定範圍規則時後端將預設拒絕全部明細行(fail-closed)。確認要在無範圍規則的情況下儲存嗎?", + "matchLabels": { + "prefix": "前綴", + "equals": "等於", + "contains": "包含", + "in": "屬於" + }, + "scopeFieldLabels": { + "source_code": "收料來源實例", + "doc_no": "收料單號", + "warehouse_code": "倉庫", + "storage_code": "儲位", + "lot_no": "批號", + "movement_date": "異動日期", + "record_kind": "記錄類型", + "in_out_flag": "出入庫碼", + "order_type": "訂單類型", + "odm_id": "ODM ID", + "odm_name": "ODM NAME", + "carton_id": "箱號", + "pallet_id": "棧板號", + "material_code": "料件編號", + "doc_nature": "異動單據性質", + "movement_type": "庫存異動類型", + "reason_code": "理由碼", + "partner_code": "供應商·客戶編號" + }, + "transformFieldLabels": { + "lot_no": "批號" + }, + "transformOpLabels": { + "prefix_replace": "前綴替換" + }, + "errors": { + "codeRequired": "請輸入調撥類型編碼", + "codeFormat": "編碼需以小寫字母開頭,僅含小寫字母/數字/底線,長度 2-64", + "nameRequired": "請輸入中文名稱(zh-CN)", + "ruleFieldRequired": "請選擇範圍欄位", + "ruleValuesRequired": "請至少新增一個值", + "fixedCodeRequired": "固定倉庫必須填寫倉庫編碼", + "transformSourceRequired": "請輸入原前綴", + "transformTargetRequired": "請輸入新前綴" + } } }