浏览代码

模板归属筛选

Luolei 6 年之前
父节点
当前提交
e18848e5bf
共有 1 个文件被更改,包括 19 次插入2 次删除
  1. 19 2
      src/components/icss/TemplateMaintenance.vue

+ 19 - 2
src/components/icss/TemplateMaintenance.vue

@@ -14,7 +14,6 @@
                           :label="item.name" 
                           :value="item.val" 
                           :key="item.val" 
-                          v-if="!((filter.templateType === 0 || filter.templateType === 1) && (item.val == 4 || item.val == 5 || item.val == 6))"
                         ></el-option>
                     </el-select>
                 </el-form-item>
@@ -109,6 +108,7 @@
         list: [],
         tagTypes: [],
         Adscriptions: [],
+        tmpAdscriptions: [],
         AdscriptionsType:[],
         AdscriptionsOwnTo:[],
         tagTypesList: [],
@@ -139,7 +139,23 @@
     watch: {
       tmpType(newVal, preVal){
         this.filter.tagAdscription = ''
-        if(newVal != preVal){
+        //根据类型不同删选归属
+        if((newVal+'') && (newVal == 0 || newVal == 1)){
+          this.Adscriptions = this.tmpAdscriptions.filter((item) => {
+            if(item.val != 4 && item.val != 5 && item.val != 6){
+              return item
+            }
+          })
+        }else if(newVal == 2){
+          this.Adscriptions = this.tmpAdscriptions.filter((item) => {
+            if(item.val != 1 && item.val != 31 && item.val != 22 && item.val != 322){
+              return item
+            }
+          })
+        }else{
+          this.Adscriptions = this.tmpAdscriptions
+        }
+        if((newVal+'') != preVal){
           if(newVal == 1){
             this.AdscriptionsOwnTo = this.deptAndDisInfo.deptDTOS
             this.filter.ownTo = ''
@@ -170,6 +186,7 @@
           if(res.data.code === '0') {
             this.tagTypes =  res.data.data[6];
             this.Adscriptions = res.data.data[4];
+            this.tmpAdscriptions = res.data.data[4];
             localStorage.setItem('typeLis',JSON.stringify(res.data.data[4]))
             for (var i = 0; i < this.tagTypes.length; i++) {
               this.tagTypesList.push(this.tagTypes[i].val)