From cd3d7212d1f26936a6f394964e6f9c1ff05d12dd Mon Sep 17 00:00:00 2001 From: hwj Date: Thu, 23 Jul 2026 15:47:14 +0800 Subject: [PATCH] =?UTF-8?q?style=EF=BC=9A=E8=AE=BE=E5=A4=87=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6-=E6=96=B0=E5=A2=9E/=E7=BC=96=E8=BE=91=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E4=BA=A7=E7=BA=BF=E5=88=86=E7=B1=BB=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en.ts | 1 + src/locales/zh-CN.ts | 1 + .../mes/deviceledger/DeviceLedgerForm.vue | 34 ++++++++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/locales/en.ts b/src/locales/en.ts index b816253a..a677a1df 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -1913,6 +1913,7 @@ export default { // Equipment Ledger EquipmentLedger: { lineCategory: 'Production Line Category', + placeholderLineCategory: 'Please select production line category', lineCategoryAll: 'All', createLineCategory: 'Add Production Line Category', updateLineCategory: 'Edit Production Line Category', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 01fbe726..b9fe5ac0 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -1929,6 +1929,7 @@ export default { // 设备台账 EquipmentLedger: { lineCategory: '产线分类', + placeholderLineCategory: '请选择产线分类', lineCategoryAll: '全部', createLineCategory: '新增产线分类', updateLineCategory: '修改产线分类', diff --git a/src/views/mes/deviceledger/DeviceLedgerForm.vue b/src/views/mes/deviceledger/DeviceLedgerForm.vue index 614a8269..39801e8f 100644 --- a/src/views/mes/deviceledger/DeviceLedgerForm.vue +++ b/src/views/mes/deviceledger/DeviceLedgerForm.vue @@ -47,6 +47,27 @@ + + + + + + + @@ -765,6 +786,7 @@ import { DeviceLedgerApi, DeviceLedgerVO } from '@/api/mes/deviceledger' import { CriticalComponentApi, CriticalComponentVO } from '@/api/mes/criticalComponent' import { DeviceTypeApi, DeviceTypeTreeVO } from '@/api/mes/devicetype' +import { DeviceLineApi, DeviceLineTreeVO } from '@/api/mes/deviceline' import { getSimpleUserList, UserVO } from '@/api/system/user' import { formatDate } from '@/utils/formatTime' import type { FormRules } from 'element-plus' @@ -980,6 +1002,13 @@ const formRules = reactive({ trigger: 'change' } ], + deviceLine: [ + { + required: true, + message: t('EquipmentManagement.EquipmentLedger.placeholderLineCategory'), + trigger: 'change' + } + ], ratedCapacity: [ { validator: validateScheduledRequired('棰濆畾浜ц兘'), trigger: ['blur', 'change'] } ] @@ -999,6 +1028,7 @@ watch( const treeSelectProps = { label: 'name', children: 'children' } const deviceTypeTree = ref([]) +const deviceLineTree = ref([]) const findDeviceTypeName = (id: string | number): string | undefined => { const stack = [...deviceTypeTree.value] while (stack.length) { @@ -1287,13 +1317,15 @@ const handleQrcodeRefreshSuccess = async (data: any) => { } const ensureOptionsLoaded = async () => { - const [deviceTypeRes, userRes, criticalRes, beijianRes] = await Promise.all([ + const [deviceTypeRes, deviceLineRes, userRes, criticalRes, beijianRes] = await Promise.all([ DeviceTypeApi.getDeviceTypeTree({ pageNo: 1, pageSize: 10 }), + DeviceLineApi.getDeviceLineTree(), getSimpleUserList(), CriticalComponentApi.getCriticalComponentList(), ProductApi.getProductPage({ pageNo: 1, pageSize: 10, categoryType: SPARE_PART_CATEGORY_TYPE }) ]) deviceTypeTree.value = deviceTypeRes + deviceLineTree.value = deviceLineRes ?? [] users.value = userRes ?? [] criticalComponentOptions.value = buildCriticalComponentOptions(criticalRes ?? []) beijianOptions.value = buildBeijianOptions(beijianRes?.list ?? [])