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 ?? [])