dedsudiyu 2 年之前
父节点
当前提交
9731c76d6f

+ 3 - 3
src/api/laboratory/onDutyConfiguration.js

@@ -42,11 +42,11 @@ export function treeDeptSubSel(query) {
   })
 }
 //获取实验室可选值班人员列表
-export function getUserDutyList(query) {
+export function getUserDutyList(data) {
   return request({
     url: '/system/user/getUserDutyList',
-    method: 'get',
-    params: query
+    method: 'post',
+    data: data
   })
 }
 

+ 29 - 3
src/views/comprehensive/personnel/onDutyConfiguration/index.vue

@@ -31,7 +31,7 @@
           </div>
           <p class="return-year-month-button inquire-button-one" v-show="yearMonthType===1" @click="returnPresent">回到本月</p>
           <p class="flex-p"></p>
-          <p class="all-button add-button-one-90" @click="allButton">{{allButtonType?'取消全选':'全选'}}</p>
+          <!--<p class="all-button add-button-one-90" @click="allButton">{{allButtonType?'取消全选':'全选'}}</p>-->
           <p class="add-button inquire-button-one" @click="addButton"
              v-hasPermi="['laboratory:duty:add']">+ 新增</p>
         </div>
@@ -330,7 +330,8 @@
         }
         this.loading = true;
         let obj = JSON.parse(JSON.stringify(this.queryParams))
-        obj.subjectIds = self.getSubList+'';
+        obj.subjectIds = self.getSubList;
+        obj.dateList = self.checkList.sort(self.compare('time', 'inverted'));
         getUserDutyList(obj).then( response => {
           //处理用户数据
           for(let i=0;i<self.userCheckList.length;i++){
@@ -342,7 +343,7 @@
                 }
               }
             }
-            if(num == 0){
+            if(num != self.getSubList.length){
               self.userCheckList.splice(i,1);
               i--
             }
@@ -363,6 +364,18 @@
           this.loading = false;
         });
       },
+      //时间排序
+      compare(prop, align) {
+        return function(a, b) {
+          var value1 = a[prop];
+          var value2 = b[prop];
+          if (align == "positive") { //正序
+            return new Date(value1) - new Date(value2);
+          } else if (align == "inverted") { //倒序
+            return new Date(value2) - new Date(value1);
+          }
+        }
+      },
       //获取树状实验室列表
       treeDeptSubSel(){
         treeDeptSubSel().then( response => {
@@ -575,7 +588,20 @@
       },
       //勾选
       monthCheck(item){
+        let self = this;
         if(!item.disable&&!item.expire){
+          let num = 0;
+          for(let i=0;i<self.yearDate.length;i++){
+            for(let o=0;o<self.yearDate[i].list.length;o++){
+              if(self.yearDate[i].list[o].checkType){
+                num++
+              }
+            }
+          }
+          if(num >29){
+            this.msgError('最多只可选中30天')
+            return
+          }
           item.checkType = !item.checkType;
           this.allCheckJudgment();
         }