Browse Source

油服编码配置

lipenghui 2 days ago
parent
commit
0f6dfec825

+ 2 - 2
src/views/pms/device/IotDeviceForm.vue

@@ -18,7 +18,7 @@
           <el-col :span="8">
           <el-col :span="8">
             <el-form-item :label="t('iotDevice.yfClass')" prop="yfClass">
             <el-form-item :label="t('iotDevice.yfClass')" prop="yfClass">
               <el-cascader
               <el-cascader
-                :disabled="formData.yfDeviceCode"
+                :disabled="formType==='update'&&formData.yfDeviceCode"
                 style="width: 100%"
                 style="width: 100%"
                 v-model="formData.yfClass"
                 v-model="formData.yfClass"
                 :options="yfclasses"
                 :options="yfclasses"
@@ -740,7 +740,7 @@ const resetForm = () => {
 }
 }
 
 
 .base-expandable-content.is-expanded {
 .base-expandable-content.is-expanded {
-  min-height: 250px; /* 或者根据内容设定一个合适的最大高度 */
+  min-height: 260px; /* 或者根据内容设定一个合适的最大高度 */
 }
 }
 .zz-expandable-content {
 .zz-expandable-content {
   max-height: 0; /* 初始高度为0 */
   max-height: 0; /* 初始高度为0 */

+ 15 - 2
src/views/pms/device/IotDeviceFormAdd.vue

@@ -18,8 +18,8 @@
           <el-col :span="8">
           <el-col :span="8">
             <el-form-item :label="t('iotDevice.yfClass')" prop="yfClass">
             <el-form-item :label="t('iotDevice.yfClass')" prop="yfClass">
               <el-cascader
               <el-cascader
+                :disabled="formType==='update'&&formData.yfDeviceCode"
                 style="width: 100%"
                 style="width: 100%"
-                :disabled="formData.yfDeviceCode"
                 v-model="formData.yfClass"
                 v-model="formData.yfClass"
                 :options="yfclasses"
                 :options="yfclasses"
                 :props="{ expandTrigger: 'hover' }"
                 :props="{ expandTrigger: 'hover' }"
@@ -128,12 +128,22 @@
               <el-button type="info" @click="openModelForm">请选择</el-button>
               <el-button type="info" @click="openModelForm">请选择</el-button>
             </div>
             </div>
           </el-col>
           </el-col>
+          <el-col :span="8">
+            <el-form-item :label="t('deviceForm.useProject')" prop="useProject">
+              <el-input v-model="formData.useProject" :disabled="isDetail" height="60px" />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item :label="t('deviceForm.assetOwner')" prop="assetOwnership">
+              <el-input v-model="formData.assetOwnership" :disabled="isDetail" height="60px" />
+            </el-form-item>
+          </el-col>
           <el-col :span="8">
           <el-col :span="8">
             <el-form-item :label="t('deviceForm.picture')" prop="picUrl">
             <el-form-item :label="t('deviceForm.picture')" prop="picUrl">
               <UploadImg v-model="formData.picUrl" :disabled="isDetail" height="60px" />
               <UploadImg v-model="formData.picUrl" :disabled="isDetail" height="60px" />
             </el-form-item>
             </el-form-item>
           </el-col>
           </el-col>
-          <el-col :span="24">
+          <el-col :span="16">
             <el-form-item :label="t('deviceForm.remark')" prop="remark">
             <el-form-item :label="t('deviceForm.remark')" prop="remark">
               <el-input v-model="formData.remark" type="textarea" :placeholder="t('deviceForm.remarkHolder')" />
               <el-input v-model="formData.remark" type="textarea" :placeholder="t('deviceForm.remarkHolder')" />
             </el-form-item>
             </el-form-item>
@@ -657,6 +667,9 @@ onMounted(async () => {
       formData.value.manufacturerName = iotDevice.zzName;
       formData.value.manufacturerName = iotDevice.zzName;
       formData.value.supplierName = iotDevice.supplierName;
       formData.value.supplierName = iotDevice.supplierName;
       list.value = JSON.parse(iotDevice.templateJson);
       list.value = JSON.parse(iotDevice.templateJson);
+      if (iotDevice.yfClass) {
+        formData.value.yfClass = iotDevice.yfClass.split(',');
+      }
       list.value.forEach((item) => {
       list.value.forEach((item) => {
         formData.value[item.code] = item.value;
         formData.value[item.code] = item.value;
       })
       })