瀏覽代碼

方案里能源类型、使用性质、车辆种类加不可删除提示 并隐藏删除按钮

祁鹏飞 5 天之前
父節點
當前提交
570ae82778

+ 1 - 1
src/components/ruleConditionContainer/index.vue

@@ -134,7 +134,7 @@
           </template>
         </el-col>
         <el-col :span="1">
-          <el-icon v-if="!disabled" color="#666" size="18" @click="attrDel(index)">
+          <el-icon v-if="!disabled&&!item.hiddenDelete" color="#666" size="18" @click="attrDel(index)">
             <Delete />
           </el-icon>
         </el-col>

+ 2 - 0
src/views/quoteConfig/project/modules/projectAdd.vue

@@ -633,6 +633,7 @@ const cancelRule = (data) => {
 const handleDel = (index) => {
   // 能源类型、使用性质、车辆种类不可删除
   if (rulesAttrList.value[index].attrName === '能源类型' || rulesAttrList.value[index].attrName === '使用性质' || rulesAttrList.value[index].attrName === '车辆种类') {
+    ElMessage.warning('能源类型、使用性质、车辆种类不可删除')
     return
   } else {
     rulesAttrList.value.splice(index, 1)
@@ -779,6 +780,7 @@ const initAttr = () => {
         return {
           ...a,
           operator: '1',
+          hiddenDelete:true,
           min: a.attrName == '能源类型' ? '0' : '',
           minArray: a.minArray ? a.minArray : a.attrName == '使用性质' || a.attrName == '车辆种类' ? [a.dictLabal[0].code] : []
         }