LiGuang 3 éve
szülő
commit
994041a0b2

+ 2 - 2
src/views/system/AttendanceRuleList.vue

@@ -354,14 +354,14 @@
         this.columns.push({
           title: '部门',
           dataIndex: 'deptName',
-          width: '100px',
+          width: '120px',
           fixed: 'left'
         })
         if (this.queryParam.type == "1" || this.queryParam.type == "2" || this.queryParam.type == "3") {
           this.columns.push({
             title: '类型',
             dataIndex: 'type',
-            width: '100px',
+            width: '117px',
             fixed: 'left',
             customRender: function(t, r, index) {
               var name = "";

+ 1 - 1
src/views/system/QuartzJobList.vue

@@ -214,7 +214,7 @@
           this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
         }
         //这种筛选方式只支持单选
-        this.filters.status = filters.status[0];
+        //this.filters.status = filters.status[0];
         this.ipagination = pagination;
         this.loadData();
       },

+ 425 - 249
src/views/system/modules/AttendanceRuleModal.vue

@@ -10,38 +10,38 @@
             <a-radio value="3">自由上下班</a-radio>
           </a-radio-group>
         </a-form-item>
-        
+
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*上班时间" v-if="types==1">
           <a-time-picker showTime format='HH:mm' v-model="startDate">
-          <div slot="addon" style="width:100%;overflow:hidden">
-           <div style="width:50%;float:left;border-right:solid 1px ;text-align:center">
+            <div slot="addon" style="width:100%;overflow:hidden">
+              <div style="width:50%;float:left;border-right:solid 1px ;text-align:center">
                 <div style="padding-top:10%;padding-bottom:10%">
-                 <span style="width:100%;">时</span>
+                  <span style="width:100%;">时</span>
                 </div>
-               </div>
-               <div style="width:50%;float:right;text-align:center">
+              </div>
+              <div style="width:50%;float:right;text-align:center">
                 <div style="padding-top:10%;padding-bottom:10%">
-                 <span style="width:100%;">分</span>
+                  <span style="width:100%;">分</span>
                 </div>
-               </div>
-          </div>
+              </div>
+            </div>
           </a-time-picker>
         </a-form-item>
 
         <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="*下班时间" v-if="types==1">
           <a-time-picker showTime format='HH:mm' v-model="endDate">
-          <div slot="addon" style="width:100%;overflow:hidden">
-           <div style="width:50%;float:left;border-right:solid 1px ;text-align:center">
+            <div slot="addon" style="width:100%;overflow:hidden">
+              <div style="width:50%;float:left;border-right:solid 1px ;text-align:center">
                 <div style="padding-top:10%;padding-bottom:10%">
-                 <span style="width:100%;">时</span>
+                  <span style="width:100%;">时</span>
                 </div>
-               </div>
-               <div style="width:50%;float:right;text-align:center">
+              </div>
+              <div style="width:50%;float:right;text-align:center">
                 <div style="padding-top:10%;padding-bottom:10%">
-                 <span style="width:100%;">分</span>
+                  <span style="width:100%;">分</span>
                 </div>
-               </div>
-          </div>
+              </div>
+            </div>
           </a-time-picker>
         </a-form-item>
       </a-form>
@@ -88,10 +88,11 @@
 
             <span v-for='(d,i) in tpdata' style="margin-left: -11px;" :slot="d" slot-scope="text, record, index">
               <a-dropdown :trigger="['click']">
-                <a-tag color="blue" v-if="text=='休息'" @click="UserType(d,record)">{{text}}</a-tag>
-                <a-tag color="#87d068" v-else-if="text!='休息'&&text!=''&&text!=null" @click="UserType(d,record)">{{text}}
+                <a-tag color="blue" v-if="text=='休息'" @click="UserType(d,record,index)">{{text}}</a-tag>
+                <a-tag color="#87d068" v-else-if="text!='休息'&&text!=''&&text!=null" @click="UserType(d,record,index)">
+                  {{text}}
                 </a-tag>
-                <a-tag color="#FFFFFF" v-else @click="UserType(d,record)" style="width: 40px;">.</a-tag>
+                <a-tag color="#FFFFFF" v-else @click="UserType(d,record,index)" style="width: 40px;">.</a-tag>
                 <a-menu slot="overlay">
                   <a-menu-item key="0">
                     <a @click="shiftOks(0,d,record,index)">休息</a>
@@ -167,13 +168,17 @@
         currentYear: new Date().getYear(),
         days: [],
         selectUsers: [],
-        checkUserIds:"",
+        checkUserIds: "",
         visibles: false,
         shiftDate: null,
         startDate: "",
         endDate: "",
         show: 1,
         id: null,
+        obj: {
+          "cid": "C0",
+          "ctext": "区县"
+        },
         shiftname: "",
         username: "",
         deptlist: null,
@@ -213,7 +218,8 @@
           moth: "/userShift/userShift/queryMothByUser",
           deptlist: "/sys/sysDepart/listAll",
           delUserShift: '/userShift/userShift/delete',
-          edit:'/attendanceRule/attendanceRule/edit'
+          edit: '/attendanceRule/attendanceRule/edit',
+          userShiftDay:'/userShift/userShift/UserShiftType'
         },
       }
     },
@@ -226,123 +232,239 @@
         const tags = this.selectUsers.filter(tag => tag !== e);
         this.selectUsers = tags;
       },
-      UserType(e, a) {
+      UserType(e, a, index) {
         this.isShow = true;
         var d = new Date(this.formatDate(this.currentYear, this.currentMonth, e))
+        var obj = this.dataSource[index];
+        var list = [];
+        var sum=0;
+        var f=false;
+        if (d.getDay() == 1) {
+          list.push(this.getDays(0, d));
+          list.push(this.getDays(1, d));
+          list.push(this.getDays(2, d));
+          list.push(this.getDays(3, d));
+          list.push(this.getDays(4, d));
+          list.push(this.getDays(5, d));
+          list.push(this.getDays(6, d));
+        } else if (d.getDay() == 2) {
+          list.push(this.getDays(-1, d));
+          list.push(this.getDays(0, d));
+          list.push(this.getDays(1, d));
+          list.push(this.getDays(2, d));
+          list.push(this.getDays(3, d));
+          list.push(this.getDays(4, d));
+          list.push(this.getDays(5, d));
+        } else if (d.getDay() == 3) {
+          list.push(this.getDays(-2, d));
+          list.push(this.getDays(-1, d));
+          list.push(this.getDays(0, d));
+          list.push(this.getDays(1, d));
+          list.push(this.getDays(2, d));
+          list.push(this.getDays(3, d));
+          list.push(this.getDays(4, d));
+        } else if (d.getDay() == 4) {
+          list.push(this.getDays(-3, d));
+          list.push(this.getDays(-2, d));
+          list.push(this.getDays(-1, d));
+          list.push(this.getDays(0, d));
+          list.push(this.getDays(1, d));
+          list.push(this.getDays(2, d));
+          list.push(this.getDays(3, d));
+        } else if (d.getDay() == 5) {
+          list.push(this.getDays(-4, d));
+          list.push(this.getDays(-3, d));
+          list.push(this.getDays(-2, d));
+          list.push(this.getDays(-1, d));
+          list.push(this.getDays(0, d));
+          list.push(this.getDays(1, d));
+          list.push(this.getDays(2, d));
+        } else if (d.getDay() == 6) {
+          list.push(this.getDays(-5, d));
+          list.push(this.getDays(-4, d));
+          list.push(this.getDays(-3, d));
+          list.push(this.getDays(-2, d));
+          list.push(this.getDays(-1, d));
+          list.push(this.getDays(0, d));
+          list.push(this.getDays(1, d));
+        } else if (d.getDay() == 0) {
+          list.push(this.getDays(-6, d));
+          list.push(this.getDays(-5, d));
+          list.push(this.getDays(-4, d));
+          list.push(this.getDays(-3, d));
+          list.push(this.getDays(-2, d));
+          list.push(this.getDays(-1, d));
+          list.push(this.getDays(0, d));
+        }
+
+
+        for (var i = 0; i < list.length; i++) {
+          if (list[i].split("-")[0] != this.currentYear || list[i].split("-")[1] != this.currentMonth) {
+            getAction(this.url.userShiftDay, {
+                userid: a.id,
+                shiftDate:moment(new Date(list[i])).format('YYYY-MM-DD HH:mm:ss') ,
+              }
+              ).then((res) => {
+              if (res.success) {
+                if(res.result!=0||res.result!='0'){
+                  sum++;
+                }
+              } 
+            }).finally(() => {
+            })
+            list.splice(i, 1)
+          }
+        }
+
+        for (var o = 0; o< list.length; o++) {
+          for (var t in obj) { //用javascript的for/in循环遍历对象的属性
+            if (t == "shiftid" + list[o].split("-")[2]&&list[o].split("-")[2]==e) {
+              if(obj[t]!=0){
+                sum++;
+                f=true;
+              }
+            }else if(t == "shiftid" + list[o].split("-")[2]){
+              if(obj[t]!=0){
+                sum++;
+              }
+            }
+          }
+
+        }
+
         if (a.category == 106) {
-          if (d.getDay() == 0) {
+          if (sum==6&&f==false) {
             this.isShow = false;
           }
 
-        } else {
-          if (d.getDay() == 0 || d.getDay() == 6) {
+        } else{
+          if (sum==5&&f==false) {
             this.isShow = false;
           }
         }
       },
+      // 获取当前时间,day为number,getDay(-1):昨天的日期;getDay(0):今天的日期;getDay(1):明天的日期;【以此类推】
+      getDays(day, date) {
+        var today = new Date(date);
+        var targetday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24 * day;
+        today.setTime(targetday_milliseconds); //注意,这行是关键代码
+
+        var tYear = today.getFullYear();
+        var tMonth = today.getMonth() + 1;
+        var tDate = today.getDate();
+        return tYear + "-" + tMonth + "-" + tDate;
+      },
+      doHandleMonth(month) {
+        var m = month;
+        if (month.toString().length == 1) {
+          m = "0" + month;
+        }
+        return m;
+      },
+
       shiftOks(a, b, c, d) {
         var date = this.currentYear + "-" + this.currentMonth + "-" + b + " 00:00:000";
         var name = a.name;
-        var shift=a.id;
+        var shift = a.id;
         if (a == 0 || a == "0") {
           name = "休息";
-          shift="0";
+          shift = "0";
         }
 
 
         if (b == 1) {
           c.a1 = name;
-          c.shiftid1=shift;
+          c.shiftid1 = shift;
         } else if (b == 2) {
           c.a2 = name;
-          c.shiftid2=shift;
+          c.shiftid2 = shift;
         } else if (b == 3) {
           c.a3 = name;
-          c.shiftid3=shift;
+          c.shiftid3 = shift;
         } else if (b == 4) {
           c.a4 = name;
-          c.shiftid4=shift;
+          c.shiftid4 = shift;
         } else if (b == 5) {
           c.a5 = name;
-          c.shiftid5=shift;
+          c.shiftid5 = shift;
         } else if (b == 6) {
           c.a6 = name;
-          c.shiftid6=shift;
+          c.shiftid6 = shift;
         } else if (b == 7) {
           c.a7 = name;
-          c.shiftid7=shift;
+          c.shiftid7 = shift;
         } else if (b == 8) {
           c.a8 = name;
-          c.shiftid8=shift;
+          c.shiftid8 = shift;
         } else if (b == 9) {
           c.a9 = name;
-          c.shiftid9=shift;
+          c.shiftid9 = shift;
         } else if (b == 10) {
           c.a10 = name;
-          c.shiftid10=shift;
+          c.shiftid10 = shift;
         } else if (b == 11) {
           c.a11 = name;
-          c.shiftid11=shift;
+          c.shiftid11 = shift;
         } else if (b == 12) {
           c.a12 = name;
-          c.shiftid12=shift;
+          c.shiftid12 = shift;
         } else if (b == 13) {
           c.a13 = name;
-          c.shiftid13=shift;
+          c.shiftid13 = shift;
         } else if (b == 14) {
           c.a14 = name;
-          c.shiftid14=shift;
+          c.shiftid14 = shift;
         } else if (b == 15) {
           c.a15 = name;
-          c.shiftid15=shift;
+          c.shiftid15 = shift;
         } else if (b == 16) {
           c.a16 = name;
-          c.shiftid16=shift;
+          c.shiftid16 = shift;
         } else if (b == 17) {
           c.a17 = name;
-          c.shiftid17=shift;
+          c.shiftid17 = shift;
         } else if (b == 18) {
           c.a18 = name;
-          c.shiftid18=shift;
+          c.shiftid18 = shift;
         } else if (b == 19) {
           c.a19 = name;
-          c.shiftid19=shift;
+          c.shiftid19 = shift;
         } else if (b == 20) {
           c.a20 = name;
-          c.shiftid20=shift;
+          c.shiftid20 = shift;
         } else if (b == 21) {
           c.a21 = name;
-          c.shiftid21=shift;
+          c.shiftid21 = shift;
         } else if (b == 22) {
           c.a22 = name;
-          c.shiftid22=shift;
+          c.shiftid22 = shift;
         } else if (b == 23) {
           c.a23 = name;
-          c.shiftid23=shift;
+          c.shiftid23 = shift;
         } else if (b == 24) {
           c.a24 = name;
-          c.shiftid24=shift;
+          c.shiftid24 = shift;
         } else if (b == 25) {
           c.a25 = name;
-          c.shiftid25=shift;
+          c.shiftid25 = shift;
         } else if (b == 26) {
           c.a26 = name;
-          c.shiftid26=shift;
+          c.shiftid26 = shift;
         } else if (b == 27) {
           c.a27 = name;
-          c.shiftid27=shift;
+          c.shiftid27 = shift;
         } else if (b == 28) {
           c.a28 = name;
-          c.shiftid28=shift;
+          c.shiftid28 = shift;
         } else if (b == 29) {
           c.a29 = name;
-          c.shiftid29=shift;
+          c.shiftid29 = shift;
         } else if (b == 30) {
           c.a30 = name;
-          c.shiftid30=shift;
+          c.shiftid30 = shift;
         } else if (b == 31) {
           c.a31 = name;
-          c.shiftid31=shift;
+          c.shiftid31 = shift;
         }
 
 
@@ -431,7 +553,6 @@
 
       delUserShift(e) {
         this.vs = true;
-        console.log(e)
         deleteAction(this.url.delUserShift, {
           id: e
         }).then((res) => {
@@ -452,7 +573,7 @@
 
       },
 
-     
+
 
       close() {
         this.selectedRowKeys = [];
@@ -462,10 +583,11 @@
         this.$emit('close');
         this.dataSource = [];
         this.visible = false;
-        this.selectUsers=[];
-        this.startDate="";
-        this.endDate="";
-        
+        this.selectUsers = [];
+        this.startDate = "";
+        this.endDate = "";
+        this.initData(null);
+
       },
       queryShift() {
         httpAction(this.url.shift, "", "get").then((res) => {
@@ -486,8 +608,8 @@
         var startDate = "";
         var endDate = "";
         var workDay = "";
-        var obj="";
-        var year=this.currentYear+"-"+this.currentMonth;
+        var obj = "";
+        var year = this.currentYear + "-" + this.currentMonth;
         if (this.types != '2' && this.types != 2) {
           if (this.selectUsers == [] || this.selectUsers.length < 1) {
             this.$message.warning('人员不能为空');
@@ -500,8 +622,8 @@
               this.$message.warning('请选择下班时间');
               return;
             }
-            startDate = moment(this.startDate).format('YYYY-MM-DD HH:mm')+":00";
-            endDate = moment(this.endDate).format('YYYY-MM-DD HH:mm')+":00";
+            startDate = moment(this.startDate).format('YYYY-MM-DD HH:mm') + ":00";
+            endDate = moment(this.endDate).format('YYYY-MM-DD HH:mm') + ":00";
           }
           var ids = [];
           for (var i = 0; i < this.selectUsers.length; i++) {
@@ -510,219 +632,272 @@
           userid = ids.join(',');
           workDay = "1,2,3,4,5";
         } else if (this.types == '2' || this.types == 2) {
-          var data=[];
-          var uids=[];
-          userid=this.checkUserIds;
-          for(var i=0;i<this.dataSource.length;i++){
+          var data = [];
+          var uids = [];
+          userid = this.checkUserIds;
+          for (var i = 0; i < this.dataSource.length; i++) {
             uids.push(this.dataSource[i].id);
-            if(this.dataSource[i].shiftid1!=""&&this.dataSource[i].shiftid1!=null){
-              var str={
-              userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid1,
-              date:year+"-1 00:00:00"
+            if (this.dataSource[i].shiftid1 != "" && this.dataSource[i].shiftid1 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid1,
+                date: year + "-1 00:00:00"
               };
               data.push(str)
-            }if(this.dataSource[i].shiftid2!=""&&this.dataSource[i].shiftid2!=null){
-                var str={
-                  userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid2,
-              date:year+"-2 00:00:00"
+            }
+            if (this.dataSource[i].shiftid2 != "" && this.dataSource[i].shiftid2 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid2,
+                date: year + "-2 00:00:00"
               };
               data.push(str)
-            }if(this.dataSource[i].shiftid3!=""&&this.dataSource[i].shiftid3!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid3,
-              date:year+"-3 00:00:00",
+            }
+            if (this.dataSource[i].shiftid3 != "" && this.dataSource[i].shiftid3 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid3,
+                date: year + "-3 00:00:00",
               };
               data.push(str)
-            }if(this.dataSource[i].shiftid4!=""&&this.dataSource[i].shiftid4!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid4,
-              date:year+"-4 00:00:00"
+            }
+            if (this.dataSource[i].shiftid4 != "" && this.dataSource[i].shiftid4 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid4,
+                date: year + "-4 00:00:00"
               };
               data.push(str)
-            }if(this.dataSource[i].shiftid5!=""&&this.dataSource[i].shiftid5!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid5,
-              date:year+"-5 00:00:00",
+            }
+            if (this.dataSource[i].shiftid5 != "" && this.dataSource[i].shiftid5 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid5,
+                date: year + "-5 00:00:00",
               };
               data.push(str)
-            }if(this.dataSource[i].shiftid6!=""&&this.dataSource[i].shiftid6!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid6,
-              date:year+"-6 00:00:00",
+            }
+            if (this.dataSource[i].shiftid6 != "" && this.dataSource[i].shiftid6 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid6,
+                date: year + "-6 00:00:00",
               };
               data.push(str)
-            }if(this.dataSource[i].shiftid7!=""&&this.dataSource[i].shiftid7!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid7,
-              date:year+"-7 00:00:00"
+            }
+            if (this.dataSource[i].shiftid7 != "" && this.dataSource[i].shiftid7 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid7,
+                date: year + "-7 00:00:00"
               };
               data.push(str)
-            }if(this.dataSource[i].shiftid8!=""&&this.dataSource[i].shiftid8!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid8,
-              date:year+"-8 00:00:00"
+            }
+            if (this.dataSource[i].shiftid8 != "" && this.dataSource[i].shiftid8 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid8,
+                date: year + "-8 00:00:00"
               };
               data.push(str)
-            }if(this.dataSource[i].shiftid9!=""&&this.dataSource[i].shiftid9!=null){
-              var str={
-                userid:this.dataSource[i].id,
-             shiftid:this.dataSource[i].shiftid9,
-              date:year+"-9 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid9 != "" && this.dataSource[i].shiftid9 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid9,
+                date: year + "-9 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid10!=""&&this.dataSource[i].shiftid10!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid10,
-              date:year+"-10 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid10 != "" && this.dataSource[i].shiftid10 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid10,
+                date: year + "-10 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid11!=""&&this.dataSource[i].shiftid11!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid11,
-              date:year+"-11 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid11 != "" && this.dataSource[i].shiftid11 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid11,
+                date: year + "-11 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid12!=""&&this.dataSource[i].shiftid12!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid12,
-              date:year+"-12 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid12 != "" && this.dataSource[i].shiftid12 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid12,
+                date: year + "-12 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid13!=""&&this.dataSource[i].shiftid13!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid13,
-              date:year+"-13 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid13 != "" && this.dataSource[i].shiftid13 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid13,
+                date: year + "-13 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid14!=""&&this.dataSource[i].shiftid14!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid14,
-              date:year+"-14 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid14 != "" && this.dataSource[i].shiftid14 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid14,
+                date: year + "-14 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid15!=""&&this.dataSource[i].shiftid15!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid15,
-              date:year+"-15 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid15 != "" && this.dataSource[i].shiftid15 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid15,
+                date: year + "-15 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid16!=""&&this.dataSource[i].shiftid16!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid16,
-              date:year+"-16 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid16 != "" && this.dataSource[i].shiftid16 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid16,
+                date: year + "-16 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid17!=""&&this.dataSource[i].shiftid17!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid17,
-              date:year+"-17 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid17 != "" && this.dataSource[i].shiftid17 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid17,
+                date: year + "-17 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid18!=""&&this.dataSource[i].shiftid18!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid18,
-              date:year+"-18 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid18 != "" && this.dataSource[i].shiftid18 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid18,
+                date: year + "-18 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid19!=""&&this.dataSource[i].shiftid19!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid19,
-              date:year+"-19 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid19 != "" && this.dataSource[i].shiftid19 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid19,
+                date: year + "-19 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid20!=""&&this.dataSource[i].shiftid20!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid20,
-              date:year+"-20 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid20 != "" && this.dataSource[i].shiftid20 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid20,
+                date: year + "-20 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid21!=""&&this.dataSource[i].shiftid21!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid21,
-              date:year+"-21 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid21 != "" && this.dataSource[i].shiftid21 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid21,
+                date: year + "-21 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid22!=""&&this.dataSource[i].shiftid22!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid22,
-              date:year+"-22 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid22 != "" && this.dataSource[i].shiftid22 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid22,
+                date: year + "-22 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid23!=""&&this.dataSource[i].shiftid23!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid23,
-              date:year+"-23 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid23 != "" && this.dataSource[i].shiftid23 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid23,
+                date: year + "-23 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid24!=""&&this.dataSource[i].shiftid24!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid24,
-             date:year+"-24 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid24 != "" && this.dataSource[i].shiftid24 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid24,
+                date: year + "-24 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid25!=""&&this.dataSource[i].shiftid25!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid25,
-              date:year+"-25 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid25 != "" && this.dataSource[i].shiftid25 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid25,
+                date: year + "-25 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid26!=""&&this.dataSource[i].shiftid26!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid26,
-              date:year+"-26 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid26 != "" && this.dataSource[i].shiftid26 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid26,
+                date: year + "-26 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid27!=""&&this.dataSource[i].shiftid27!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid27,
-              date:year+"-27 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid27 != "" && this.dataSource[i].shiftid27 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid27,
+                date: year + "-27 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid28!=""&&this.dataSource[i].shiftid28!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid28,
-              date:year+"-28 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid28 != "" && this.dataSource[i].shiftid28 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid28,
+                date: year + "-28 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid29!=""&&this.dataSource[i].shiftid29!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid29,
-              date:year+"-29 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid29 != "" && this.dataSource[i].shiftid29 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid29,
+                date: year + "-29 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid30!=""&&this.dataSource[i].shiftid30!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid30,
-              date:year+"-30 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid30 != "" && this.dataSource[i].shiftid30 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid30,
+                date: year + "-30 00:00:00"
+              };
               data.push(str)
-            }if(this.dataSource[i].shiftid31!=""&&this.dataSource[i].shiftid31!=null){
-              var str={
-                userid:this.dataSource[i].id,
-              shiftid:this.dataSource[i].shiftid31,
-              date:year+"-31 00:00:00"};
+            }
+            if (this.dataSource[i].shiftid31 != "" && this.dataSource[i].shiftid31 != null) {
+              var str = {
+                userid: this.dataSource[i].id,
+                shiftid: this.dataSource[i].shiftid31,
+                date: year + "-31 00:00:00"
+              };
               data.push(str)
             }
-            
+
           }
-          obj =JSON.stringify(data);
-          userid=uids.join(",");
+          obj = JSON.stringify(data);
+          userid = uids.join(",");
         }
-        
+
         var url = this.url.add;
         var typet = "post"
         if (this.id != null && this.id != "") {
           url = this.url.edit;
           typet = "put";
         }
-        this.confirmLoading=true;
+        this.confirmLoading = true;
         httpAction(url, {
             id: this.id,
             type: this.types,
@@ -730,7 +905,7 @@
             endDate: endDate,
             userId: userid,
             workDay: workDay,
-            ruleType:obj
+            ruleType: obj
           },
           typet).then((res) => {
           if (res.success) {
@@ -747,27 +922,28 @@
       add(e, a) {
         this.visible = true;
         this.queryParam.usertid = e.join(",");
-        this.checkUserIds=e.join(",");
+        this.checkUserIds = e.join(",");
         this.selectUsers = a;
-        this.queryParam.shiftDate=moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
-        this.queryParam.type="1";
-         this.$options.methods.searchQuery.call(this)
+        this.queryParam.shiftDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
+        this.queryParam.type = "1";
+        this.$options.methods.searchQuery.call(this)
       },
-      edit(e,a){
+      edit(e, a) {
         this.visible = true;
         this.queryParam.usertid = e.join(",");
-        this.checkUserIds=e.join(",");
+        this.checkUserIds = e.join(",");
         this.selectUsers = a;
-        this.types=a[0].type;
-        this.id=a[0].id;
-        this.queryParam.shiftDate=moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
-        this.queryParam.type="2";
-        if(a[0].startDate!=null){
-          this.startDate=moment(new Date(a[0].startDate)).format('YYYY-MM-DD HH:mm:ss');
-        }if(a[0].endDate!=null){
-          this.endDate=moment(new Date(a[0].endDate)).format('YYYY-MM-DD HH:mm:ss');
+        this.types = a[0].type;
+        this.id = a[0].id;
+        this.queryParam.shiftDate = moment(new Date()).format('YYYY-MM-DD HH:mm:ss');
+        this.queryParam.type = "2";
+        if (a[0].startDate != null) {
+          this.startDate = moment(new Date(a[0].startDate)).format('YYYY-MM-DD HH:mm:ss');
         }
-         this.$options.methods.searchQuery.call(this)
+        if (a[0].endDate != null) {
+          this.endDate = moment(new Date(a[0].endDate)).format('YYYY-MM-DD HH:mm:ss');
+        }
+        this.$options.methods.searchQuery.call(this)
       }