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 },