From f0fe6e3f01e8286b37fbe18d8fb99e65a56deca5 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 17 Feb 2026 10:19:35 +0800 Subject: [PATCH] =?UTF-8?q?feat(mes-dv):=20MachineryForm=20=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=203=20=E5=88=97=E5=B8=83=E5=B1=80=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=BC=96=E7=A0=81=E7=94=9F=E6=88=90=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 第一行改为 3 列:设备编码(含生成按钮)、设备名称、品牌 - 编码生成按钮使用 generateRandomStr,编辑模式下禁用 - 调整规格型号到第三行,整体布局更紧凑 Co-Authored-By: Claude Opus 4.6 --- src/views/mes/dv/machinery/MachineryForm.vue | 30 +++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) 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