htc 1 month ago
parent
commit
e9a66f3558

+ 0 - 1
pagesClockin/index.vue

@@ -191,7 +191,6 @@
 				success: (res) => {
 				  if(res.result && res.result.elements.length > 0) {
 					this.distance = res.result.elements[0].distance;
-					console.log(this.distance,'distance');
 				  }
 				},
 				fail: (err) => {

+ 23 - 5
pagesStatistics/components/CusCalendar/index.vue

@@ -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);

+ 3 - 2
pagesStatistics/index.vue

@@ -24,8 +24,9 @@
 				<Calendar ref="calendarRef" @selectDay="selectDay" @selectInfo="selectInfo"></Calendar>
 			</div>
 			<div class="c_tip" v-if="info.iswd">当日班次:{{'固定上下班'}} 班次 {{workingTime||'08:30'}}-{{offWorkTime||'17:30'}}</div>
-			<div class="c_tip" v-else>当日班次:休息</div>
-			<div class="c_tip">出勤统计:打卡{{info.clockTimes||0}}次,工时{{info.workHours||0}}小时</div>
+			<div class="c_tip" v-else>当日班次:{{info.iswd===undefined?'- -':'休息'}}</div>
+			<div class="c_tip" v-if="info.iswd!==undefined">出勤统计:打卡{{info.clockTimes||0}}次,工时{{info.workHours||0}}小时</div>
+			<div class="c_tip" v-else>出勤统计:- -</div>
 			<div class="c_time" v-if="info&&info.status==1">
 				<image :src="imgBase+'clockingin/time_line.png'"></image>
 				<div class="ct_info">