From 637223517a09b9f8a16a57183dea9df4c5b90702 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Mon, 29 Sep 2025 15:29:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(dms):=E4=BF=AE=E5=A4=8D=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=92=8C=E4=BE=9B=E5=BA=94=E5=95=86ID?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将设备类型和供应商ID转换为字符串进行匹配 - 注释掉保养标签的显示 - 修复设备类型名称获取逻辑 --- src/views/dms/prodBaseMachineInfo/index.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/views/dms/prodBaseMachineInfo/index.vue b/src/views/dms/prodBaseMachineInfo/index.vue index d867398..800cf8d 100644 --- a/src/views/dms/prodBaseMachineInfo/index.vue +++ b/src/views/dms/prodBaseMachineInfo/index.vue @@ -268,7 +268,7 @@ v-for="item in deviceTypes" :key="item.deviceTypeId" :label="item.deviceTypeName" - :value="item.deviceTypeId" + :value="String(item.deviceTypeId)" /> @@ -288,7 +288,7 @@ v-for="item in supplierInfoList" :key="item.supplierId" :label="item.supplierName" - :value="item.supplierId" + :value="String(item.supplierId)" /> @@ -999,7 +999,7 @@ const getMachineIcon = (type) => { // 获取设备类型名称 const getDeviceTypeName = (typeId) => { - const type = deviceTypes.value.find(t => t.deviceTypeId === typeId); + const type = deviceTypes.value.find(t => String(t.deviceTypeId) === String(typeId)); return type?.deviceTypeName || '-'; }; @@ -1082,6 +1082,10 @@ const handleUpdate = async (row?: ProdBaseMachineInfoVO) => { const res = await getDmsBaseMachineInfo(_machineId); Object.assign(form.value, res.data); + // 将选择框绑定值统一为字符串,确保显示名称而非ID + form.value.machineType = res.data.machineType != null ? String(res.data.machineType) : undefined; + form.value.supplierId = res.data.supplierId != null ? String(res.data.supplierId) : undefined; + // 处理图片数据 - 只取第一张图片 if (res.data.ossId && res.data.photoAddress) { const ossIdArray = res.data.ossId.split(','); @@ -1304,7 +1308,7 @@ const loadLifecycleData = async () => { time: maint.planBeginTime || maint.createTime, icon: markRaw(Tools), color: '#4facfe', - tags: ['保养', getMaintLevelLabel(maint.maintLevel)], + // tags: ['保养', getMaintLevelLabel(maint.maintLevel)], details: [ { label: '保养单号', value: maint.billsMaintCode }, { label: '保养级别', value: maint.maintLevel, dictOptions: maint_level?.value },