Jelajahi Sumber

社区机构-分项类别-校验

953954216 1 tahun lalu
induk
melakukan
872051579c
1 mengubah file dengan 36 tambahan dan 21 penghapusan
  1. 36 21
      ruoyi-ui/src/views/organization/jggl/sqJcxx/index.vue

+ 36 - 21
ruoyi-ui/src/views/organization/jggl/sqJcxx/index.vue

@@ -339,10 +339,11 @@
             <el-form-item label="分项类别" prop="fxlb" class="formWidth2">
               <el-select class="fxlb-select" v-model="form.fxlb" placeholder="类别" multiple collapse-tags @change="fxlbChange">
                 <el-option
-                  v-for="dict in dict.type.CZ030"
+                  v-for="(dict,idx) in dict.type.CZ030"
                   :key="dict.value"
                   :label="dict.label"
                   :value="dict.value"
+                  :disabled="disableArr[idx]"
                 ></el-option>
               </el-select>
             </el-form-item>
@@ -1355,26 +1356,40 @@ export default {
     },
   },
   methods: {
-	  fxlbChange(value){
-			const arr = ['01','02','06']
-		  let changeVal = null
-		  if (this.form.fxlb.length > this.oldFxlb.length) {
-			  changeVal = this.form.fxlb.filter(item => !this.oldFxlb.includes(item)).toString()
-			  if(arr.includes(changeVal)){
-				  arr.map((item) => {
-					  this.form.fxlb.push(item)
-				  })
-			  }
-		  } else {
-			  changeVal = this.oldFxlb.filter(item => !this.form.fxlb.includes(item)).toString()
-			  if(arr.includes(changeVal)){
-					this.form.fxlb = this.form.fxlb.filter(item => !arr.includes(item))
-			  }
-		  }
-		  console.log(changeVal)
-			this.form.fxlb = uniqueArr(this.form.fxlb)
-		  this.oldFxlb = this.form.fxlb
-	  },
+    fxlbChange(value){
+      console.log(value)
+      if(value.includes('01')){
+        this.disableArr =[false, false, true, true, true, false]
+      }else if(value.includes('03')){
+        this.disableArr = [true, false, false, true, true, false]
+      }else if(value.includes('02')){
+        this.disableArr = [false, false, false, true, true, false]
+      }else if(value.includes('04')){
+        this.disableArr = [true, true, true, false, true, false]
+      }else if(value.includes('05')){
+        this.disableArr = [true, true, true, true, false, false]
+      }else{
+        this.disableArr =[false, false, false, false, false, false]
+      }
+      // const arr = ['01','02','06']
+      // let changeVal = null
+      // if (this.form.fxlb.length > this.oldFxlb.length) {
+      //   changeVal = this.form.fxlb.filter(item => !this.oldFxlb.includes(item)).toString()
+      //   if(arr.includes(changeVal)){
+      // 	  arr.map((item) => {
+      // 		  this.form.fxlb.push(item)
+      // 	  })
+      //   }
+      // } else {
+      //   changeVal = this.oldFxlb.filter(item => !this.form.fxlb.includes(item)).toString()
+      //   if(arr.includes(changeVal)){
+      // 		this.form.fxlb = this.form.fxlb.filter(item => !arr.includes(item))
+      //   }
+      // }
+      // console.log(changeVal)
+      // this.form.fxlb = uniqueArr(this.form.fxlb)
+      // this.oldFxlb = this.form.fxlb
+    },
     getValid() {
       this.valid(this.rules, "frzjhm",this.form.frzjlx);
     },