|
@@ -51,14 +51,24 @@
|
|
|
let list = qlist.concat(calendar).concat(hlist);
|
|
|
this.calendarList = JSON.parse(JSON.stringify(list));
|
|
|
this.calendarList.forEach((c,i)=>{
|
|
|
- this.$set(this.calendarList[i],'select',false);
|
|
|
+ this.$set(this.calendarList[i],'select',new Date().Format('yyyy-MM-dd')==c.nyr?true:false);
|
|
|
let t = this.clockList.find(l=>l.attendanceDate==c.nyr);
|
|
|
if(t&&c.month==month){
|
|
|
- this.$set(this.calendarList[i],'status',t.isLeave===null?2:(t.isLeave===0?0:1));
|
|
|
+ let status = 2;
|
|
|
+ if(t.isLeave===null&&t.checkInTime&&!t.clockOutTime) status = 1;
|
|
|
+ else if(t.isLeave===null&&!t.checkInTime&&t.clockOutTime) status = 1;
|
|
|
+ else if(t.isLeave===null&&!t.checkInTime&&!t.clockOutTime) status = 2;
|
|
|
+ else if(t.isLeave===null&&t.checkInTime&&t.clockOutTime) status = 0;
|
|
|
+ else if(t.isLeave===0) status = 0;
|
|
|
+ else if(t.isLeave===1||t.isLeave===2||t.isLeave===3) status = 1;
|
|
|
+ this.$set(this.calendarList[i],'status',status);
|
|
|
this.$set(this.calendarList[i],'id',t?.id);
|
|
|
}
|
|
|
else this.$set(this.calendarList[i],'status',2);
|
|
|
})
|
|
|
+ let t = this.calendarList.find(c=>c.nyr==new Date().Format('yyyy-MM-dd'));
|
|
|
+ let i = this.calendarList.findIndex(c=>c.nyr==new Date().Format('yyyy-MM-dd'));
|
|
|
+ if(t&&i>-1) this.selectDay(t,i);
|
|
|
},
|
|
|
insertDays(year,month,calendar){
|
|
|
let week = calendar[0].week;
|
|
@@ -111,10 +121,18 @@
|
|
|
let res = await this.$api.get('/wms/outsourced/attendance/'+pre?.id||'');
|
|
|
if(res.data.code!==0) return this.$showToast(res.data.msg)
|
|
|
let d = res.data.data;
|
|
|
- info.clockTimes = d.isLeave===0?2:((d.isLeave===1||d.isLeave===2)?1:0);
|
|
|
+ let ct = 0;
|
|
|
+ if(d.isLeave===null&&d.checkInTime&&!d.clockOutTime) ct =1;
|
|
|
+ else if(d.isLeave===null&&!d.checkInTime&&d.clockOutTime) ct = 1;
|
|
|
+ else if(d.isLeave===null&&d.checkInTime&&d.clockOutTime) ct = 2;
|
|
|
+ else if(d.isLeave===null&&!d.checkInTime&&!d.clockOutTime) ct = 0;
|
|
|
+ else if(d.isLeave===0) ct = 2;
|
|
|
+ else if(d.isLeave===1||d.isLeave===2) ct = 1;
|
|
|
+ else ct = 0;
|
|
|
+ info.clockTimes = ct;
|
|
|
info.workHours = d.workingHours;
|
|
|
- info.sbTime = (d.isLeave===0||d.isLeave===2)?d.checkInTime:'';
|
|
|
- info.xbTime = (d.isLeave===0||d.isLeave===1)?d.clockOutTime:'';
|
|
|
+ info.sbTime = (d.isLeave===0||d.isLeave===2||d.isLeave===null)?d.checkInTime:'';
|
|
|
+ info.xbTime = (d.isLeave===0||d.isLeave===1||d.isLeave===null)?d.clockOutTime:'';
|
|
|
info.status = 1;
|
|
|
}
|
|
|
this.$emit('selectInfo',info);
|