diff --git a/src/views/mes/dv/machinery/MachineryForm.vue b/src/views/mes/dv/machinery/MachineryForm.vue index 50615cf6d..d2f85be42 100644 --- a/src/views/mes/dv/machinery/MachineryForm.vue +++ b/src/views/mes/dv/machinery/MachineryForm.vue @@ -11,19 +11,28 @@ label-width="120px" v-loading="formLoading" > - - - + - + + + - + + + + + + @@ -65,11 +74,6 @@ - - - - - @@ -98,6 +102,7 @@ import { DvMachineryTypeApi } from '@/api/mes/dv/machinery/type' import { MdWorkshopApi, MdWorkshopVO } from '@/api/mes/md/workstation/workshop' import { defaultProps, handleTree } from '@/utils/tree' import { MesDvMachineryStatusEnum } from '@/views/mes/utils/constants' +import { generateRandomStr } from '@/utils' defineOptions({ name: 'MachineryForm' }) @@ -130,6 +135,11 @@ const formRef = ref() // 表单 Ref const machineryTypeTree = ref([]) // 设备类型树 const workshopList = ref([]) // 车间列表 +/** 生成设备编码 */ +const generateCode = () => { + formData.value.code = 'M' + generateRandomStr(12) +} + /** 打开弹窗 */ const open = async (type: string, id?: number) => { dialogVisible.value = true