Forráskód Böngészése

Merge branch 'master' of http://139.196.39.194:9021/yuansh/GEKE_VIEW

ysh 3 éve
szülő
commit
036377e668

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

@@ -354,14 +354,14 @@
         this.columns.push({
           title: '部门',
           dataIndex: 'deptName',
-          width: '100px',
+          width: '140px',
           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();
       },

+ 426 - 250
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,15 +88,16 @@
 
             <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>
                   </a-menu-item>
-                  <a-menu-item v-for="(item,index) in shiftlist" :key="item.id">
+                  <a-menu-item v-if="isShow" v-for="(item,index) in shiftlist" :key="item.id">
                     <a @click="shiftOks(item,d,record,index)">{{item.name}} ({{item.startDate}} - {{item.endDate}})</a>
                   </a-menu-item>
 
@@ -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)
       }
 
 

+ 5 - 8
src/views/system/modules/StatutoryLeaveModal.vue

@@ -33,16 +33,11 @@
           label="假期开始时间">
           <a-date-picker  format='YYYY-MM-DD' v-decorator="[ 'startDate', validatorRules.startDate]" />
         </a-form-item>
+        
         <a-form-item
           :labelCol="labelCol"
           :wrapperCol="wrapperCol"
-          label="假期结束时间">
-          <a-date-picker  format='YYYY-MM-DD' v-decorator="[ 'endDate',validatorRules.endDate]" />
-        </a-form-item>
-        <a-form-item
-          :labelCol="labelCol"
-          :wrapperCol="wrapperCol"
-          label="日薪资倍数">
+          label="日薪资倍数" v-if="type=='1'">
           <a-input-number id="inputNumber" :min="1" placeholder="请输入日薪资倍数" v-decorator="['sum',{}]" style="width: 180px;"/>
         </a-form-item>
 		
@@ -107,7 +102,9 @@
       },
       edit (record) {
         this.form.resetFields();
-        this.type=record.type;
+        if(record.type!=null&&record.type!=""){
+          this.type=record.type;
+        }
         this.model = Object.assign({}, record);
         this.visible = true;
         this.$nextTick(() => {

+ 55 - 28
src/views/system/modules/UserModal.vue

@@ -33,7 +33,7 @@
           </a-col>
           <a-col :md="6" :sm="8" :lg="12">
             <a-form-item label="身份证号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input placeholder="请输入身份证号码" v-decorator="[ 'sfzCode', validatorRules.sfzCode]" />
+              <a-input maxLength="18" placeholder="请输入身份证号码" v-decorator="[ 'sfzCode', validatorRules.sfzCode]" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -66,7 +66,7 @@
           </a-col>
           <a-col :md="6" :sm="8" :lg="12">
             <a-form-item label="公积金账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input placeholder="请输入公积金账号" v-decorator="['syFund', {}]" />
+              <a-input-number placeholder="请输入公积金账号" style="width: 320px;" v-decorator="['syFund', {}]" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -74,7 +74,7 @@
         <a-row>
           <a-col :md="6" :sm="8" :lg="12">
             <a-form-item label="银行账号" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input placeholder="请输入银行账号" v-decorator="['bankCard', validatorRules.bankCard]" />
+              <a-input-number placeholder="请输入银行账号" style="width: 320px;" v-decorator="['bankCard', validatorRules.bankCard]" />
             </a-form-item>
 
           </a-col>
@@ -104,26 +104,26 @@
         </a-row>
         <a-row>
           <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="基本工资一" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input placeholder="请输入基本工资" v-decorator="['wagesOne', {}]" />
+            <a-form-item label="基本工资一" :labelCol="labelCol" :wrapperCol="wrapperCol" >
+              <a-input-number id="inputNumber" placeholder="请输入基本工资" style="width: 320px;" v-decorator="['wagesOne', {}]" />
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8" :lg="12">
             <a-form-item label="基本工资二" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input placeholder="请输入基本工资" v-decorator="['wagesTwo', {}]" />
+              <a-input-number placeholder="请输入基本工资" style="width: 320px;" v-decorator="['wagesTwo', {}]" />
             </a-form-item>
           </a-col>
         </a-row>
         <a-row>
           <a-col :md="6" :sm="8" :lg="12">
             <a-form-item label="社保基数" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input placeholder="请输入社保基数" v-decorator="['security', {}]" />
+              <a-input-number placeholder="请输入社保基数" style="width: 320px;" v-decorator="['security', {}]" />
             </a-form-item>
           </a-col>
 
           <a-col :md="6" :sm="8" :lg="12">
             <a-form-item label="缴交基数" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-input placeholder="请输入缴交基数" v-decorator="['wagesBase', {}]" />
+              <a-input-number controls="false" placeholder="请输入缴交基数" style="width: 320px;" v-decorator="['wagesBase', {}]" />
             </a-form-item>
 
           </a-col>
@@ -189,35 +189,53 @@
         </a-row>
         <a-row>
           <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]" />
+            <a-form-item label="是否免打卡" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <a-select v-decorator="[ 'isAttendance', {initialValue:'0'}]" placeholder="请选择"
+                :getPopupContainer="(target) => target.parentNode">
+                <a-select-option value="0">否</a-select-option>
+                <a-select-option value="1">是</a-select-option>
+              </a-select>
             </a-form-item>
+            
           </a-col>
           <a-col :md="6" :sm="8" :lg="12">
-            <a-form-item label="附件上传" :labelCol="labelCol" :wrapperCol="wrapperCol">
-              <a-button icon="search" @click="uploads()">选择</a-button>
+            <a-form-item label="职务" :labelCol="labelCol" :wrapperCol="wrapperCol">
+              <j-select-position placeholder="请选择职务" :multiple="false" v-decorator="['post', {}]" />
             </a-form-item>
+            
           </a-col>
         </a-row>
         <a-row>
-          <a-col :lg="15">
+          <a-col :lg="12">
             <a-form-item label="同步信息" :labelCol="labelCol" :wrapperCol="wrapperCol">
               <j-dict-select-tag v-decorator="['infoSy', {initialValue:3}]" placeholder="请选择同步" :type="'radio'"
                 :triggerChange="true" dictCode="info_sy" />
             </a-form-item>
           </a-col>
+          <a-col :md="6" :sm="8" :lg="12">
+           <a-form-item label="附件上传" :labelCol="labelCol" :wrapperCol="wrapperCol">
+             <a-button icon="search" @click="uploads()">选择</a-button>
+           </a-form-item>
+          </a-col>
+          
+        </a-row>
+        <a-row>
+         
           
         </a-row>
       </a-form>
     </a-spin>
     <depart-window ref="departWindow" @ok="modalFormOk"></depart-window>
 
-    <a-modal title="附件" :visible="visiblet" @ok="saveUpload()" @cancel="handleCancelts()">
-      <a-upload action="http://localhost:8080/jeecg-boot/sys/common/upload" list-type="picture" :file-list="fileList"
+    <a-modal title="附件" :visible="visiblet" @ok="saveUpload()" @cancel="handleCancelts()" footer="">
+      <a-upload action="http://58.34.141.138:8085/jeecg-boot/sys/common/upload" list-type="picture" :file-list="fileList"
         @change="t" method="post" @download="handleDownload" :showUploadList="{
               showRemoveIcon: true,
               showDownloadIcon: true
-            }">
+            }"
+            :remove="handleRemove"
+            >
+            
         <a-button>
           <a-icon type="upload" />上传
         </a-button>
@@ -238,7 +256,8 @@
   } from "@/store/mutation-types"
   import {
     getAction,
-    httpAction
+    httpAction,
+    deleteAction
   } from '@/api/manage'
   import {
     addUser,
@@ -385,7 +404,8 @@
           syncUserByUserName: "/act/process/extActProcess/doSyncUserByUserName", //同步用户到工作流
           queryTenantList: '/sys/tenant/queryList',
           xzupload: '/sys/common/static',
-          sysFile: '/sysFile/sysFile/queryByUserId'
+          sysFile: '/sysFile/sysFile/queryByUserId',
+          delSysFile:'/sysFile/sysFile/deleteById'
         },
         identity: "1",
         fileList: [],
@@ -408,14 +428,23 @@
       }
     },
     methods: {
+      handleRemove(file){
+        if(this.userId!=null&&this.userId!=""){
+        deleteAction(this.url.delSysFile, {userid:this.userId,name:file.name}).then((res) => {
+          if (res.success) {
+          } 
+        }).finally(() => {
+        });
+        }
+      },
       handleCancelts() {
-        this.fileList = [];
+       // this.fileList = [];
         this.visiblet = false;
       },
       // 文件下载
       handleDownload(file) {
         console.log(file.response.message)
-        window.location.href = "http://localhost:8080/jeecg-boot/sys/common/static/" + file.response.message;
+        window.location.href = "http://58.34.141.138:8085/jeecg-boot/sys/common/static/" + file.response.message;
       },
       t(info) {
         // this.files = [];
@@ -439,9 +468,6 @@
       },
       uploads() {
         this.visiblet = true;
-        if (this.userId != null && this.userId != "") {
-          this.queryFiles(this.userId)
-        }
       },
       isDisabledAuth(code) {
         return disabledAuthFilter(code);
@@ -492,15 +518,13 @@
                   name: res.result[i].txtName,
                   status: "done",
                   response: rs,
-                  url: "http://localhost:8080/jeecg-boot/" + res.result[i].txtName,
+                  url: "http://58.34.141.138:8085/jeecg-boot/" + res.result[i].txtName,
                 };
                 this.fileList.push(fileInfo)
               }
             }
           }
         })
-
-        console.log("==========" + this.fileList)
       },
       initTenantList() {
         getAction(this.url.queryTenantList).then(res => {
@@ -589,7 +613,7 @@
         that.model = Object.assign({}, record);
         that.$nextTick(() => {
           that.form.setFieldsValue(pick(this.model, 'sex', 'email', 'phone', 'post', 'urgentName', 'urgentPhone',
-            'bankAddr', 'bankCard', 'realname', 'egName', 'sfzCode',
+            'bankAddr', 'bankCard', 'realname', 'egName', 'sfzCode','isAttendance',
             'infoSy', 'syFund', 'category', 'employmentStatus', 'wagesOne', 'wagesTwo', 'security','wagesBase'))
         });
         //身份为上级显示负责部门,否则不显示
@@ -616,6 +640,9 @@
         // 调用查询用户对应的部门信息的方法
         that.checkedDepartKeys = [];
         that.loadCheckedDeparts();
+        if (this.userId != null && this.userId != "") {
+          this.queryFiles(this.userId)
+        }
       },
       //
       loadCheckedDeparts() {
@@ -671,8 +698,8 @@
         this.resultDepartOptions = [];
         this.departIds = [];
         this.departIdShow = false;
+        this.fileList=[];
         this.identity = "1";
-        this.fileList = [];
         this.bankAddr = "";
         this.bankCard = "";
         this.syFund = "";