dedsudiyu 2 年之前
父節點
當前提交
582455d7d6
共有 1 個文件被更改,包括 24 次插入18 次删除
  1. 24 18
      src/views/comprehensive/personnel/onDutyConfiguration/index.vue

+ 24 - 18
src/views/comprehensive/personnel/onDutyConfiguration/index.vue

@@ -304,9 +304,9 @@
         })
         this.$set(this,'getSubList',getSubList);
 
-        this.$set(this,'total',0);
-        this.$set(this,'dataList',[]);
-        this.$set(this,'userCheckList',[]);
+        // this.$set(this,'total',0);
+        // this.$set(this,'dataList',[]);
+        // this.$set(this,'userCheckList',[]);
         this.getList();
       },
       //查询
@@ -326,26 +326,31 @@
       },
       getList(){
         let self = this;
-        // if(!this.getSubList[0]){
-        //   this.$set(this,'total',0);
-        //   this.$set(this,'dataList',[]);
-        //   this.$set(this,'userCheckList',[]);
-        //   return
-        // }
+        if(!this.getSubList[0]){
+          this.$set(this,'total',0);
+          this.$set(this,'dataList',[]);
+          this.$set(this,'userCheckList',[]);
+          return
+        }
         this.loading = true;
         let obj = JSON.parse(JSON.stringify(this.queryParams))
         obj.subjectIds = self.getSubList+'';
         getUserDutyList(obj).then( response => {
           //处理用户数据
-          // for(let i=0;i<self.userCheckList.length;i++){
-          //   let num = 0;
-          //   for(let o=0;o<self.getSubList.length;o++){
-          //   }
-          //   if(num != 0){
-          //     self.userCheckList.splice(i,1);
-          //     i--
-          //   }
-          // }
+          for(let i=0;i<self.userCheckList.length;i++){
+            let num = 0;
+            for(let o=0;o<self.userCheckList[i].subjectIds.length;o++){
+              for(let x=0;x<self.getSubList.length;x++){
+                if(self.userCheckList[i].subjectIds[o] == self.getSubList[x]){
+                  num++
+                }
+              }
+            }
+            if(num == 0){
+              self.userCheckList.splice(i,1);
+              i--
+            }
+          }
           //处理列表数据
           for(let i=0;i<response.rows.length;i++){
             let num = 0;
@@ -358,6 +363,7 @@
           }
           this.$set(this,'dataList',response.rows);
           this.total =  response.total;
+          this.$forceUpdate();
           this.loading = false;
         });
       },