style:设备台账-新增/编辑添加产线分类字段

main
黄伟杰 5 days ago
parent 68970fe136
commit cd3d7212d1

@ -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',

@ -1929,6 +1929,7 @@ export default {
// 设备台账
EquipmentLedger: {
lineCategory: '产线分类',
placeholderLineCategory: '请选择产线分类',
lineCategoryAll: '全部',
createLineCategory: '新增产线分类',
updateLineCategory: '修改产线分类',

@ -47,6 +47,27 @@
</el-col>
</el-row>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
:label="t('EquipmentManagement.EquipmentLedger.lineCategory')"
prop="deviceLine"
required
>
<el-tree-select
v-model="formData.deviceLine"
:data="deviceLineTree"
:props="treeSelectProps"
check-strictly
default-expand-all
value-key="id"
clearable
:placeholder="t('EquipmentManagement.EquipmentLedger.placeholderLineCategory')"
class="!w-full"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
@ -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<FormRules>({
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<DeviceTypeTreeVO[]>([])
const deviceLineTree = ref<DeviceLineTreeVO[]>([])
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 ?? [])

Loading…
Cancel
Save