From 1cda80d56e5a6e714029e4aaaedeaa416fb8c434 Mon Sep 17 00:00:00 2001
From: zzyuan <781948537@qq.com>
Date: Mon, 11 Nov 2024 15:19:15 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E5=90=8D=E5=88=B6=E4=B8=B4=E6=97=B6?=
=?UTF-8?q?=E6=89=93=E5=8D=A1=E5=88=A4=E6=96=AD=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../workAttendance/tempClock/index.vue | 46 ++++++++++++-------
1 file changed, 29 insertions(+), 17 deletions(-)
diff --git a/pages/realName/workAttendance/tempClock/index.vue b/pages/realName/workAttendance/tempClock/index.vue
index 98564d7..c672b40 100644
--- a/pages/realName/workAttendance/tempClock/index.vue
+++ b/pages/realName/workAttendance/tempClock/index.vue
@@ -36,7 +36,7 @@
-
+ 已进入考勤范围
下班打卡
@@ -45,7 +45,7 @@
-
+ 已进入考勤范围
@@ -80,6 +80,7 @@ export default {
faceData:{},
photoPath:'',
attendanceImgUrl:'',
+ isShow:false
}
},
onLoad(option) {
@@ -87,7 +88,7 @@ export default {
this.Time();//定时器
this.getPro()
// this.getWork()
- // this.getTeamList()
+ this.getTeamList()
},
onShow() {
@@ -135,16 +136,15 @@ export default {
success: res => {
res = res.data;
if(res.code==200){
-
this.teamList=res.data;
if(this.teamList.length>0){
this.teamList.forEach((item,index)=>{
let distance=this.getDistance(this.latitude,this.longitude,item.lat,item.lon)
- // console.log(distance)
item.distance=distance;
})
this.teamList.sort((a, b) => { return a.distance - b.distance; });
this.rangeName=this.teamList[0].rangeName;
+ console.log(this.teamList)
}
}
},
@@ -170,7 +170,22 @@ export default {
success: e => {
this.longitude=e.longitude;
this.latitude=e.latitude;
+ if(this.teamList.length>0){
+ this.teamList.forEach((item,index)=>{
+ let distance=this.getDistance(this.latitude,this.longitude,item.lat,item.lon)
+ item.distance=distance;
+ })
+ }
+ console.log(this.teamList)
+ var index = this.teamList.findIndex(item => {return item.distance < 6})
+ console.log(index)
+ if(index>-1){//存在-在考勤范围内
+ this.isShow=true;
+ }else{
+ this.isShow=false;
+ }
},fail:e=>{
+
}
});
},
@@ -241,19 +256,16 @@ export default {
this.isOffWork=this.userData.isOffWork;
}
this.proId = this.userData.proId
- let costTime=this.getTimeDiff(this.userData.isToWork,this.timeStr);
- if(this.type==2&&this.userData.isToWork==0){
+ let costTime=this.getTimeDiff(this.userData.isToWork,this.timeStr);
+ var index = this.teamList.findIndex(item => {return item.distance < 6})
+ if(index<0){//存在-在考勤范围内
+ uni.$u.toast('不在考勤范围内!');
+ }else if(this.type==2&&this.userData.isToWork==0){
uni.$u.toast('还未打上班卡!');
- }
- // else if(this.type==1&&this.userData.isToWork!=0){
- // uni.$u.toast('已打过上班卡!');
- // }else if(this.type==2&&this.userData.isOffWork!=0){
- // uni.$u.toast('已打过下班卡!');
- // }
- else if(this.type==2&&costTime<2){
+ }else if(this.type==2&&costTime<2){
uni.$u.toast('上下班打卡间隔2小时!');
- }else if(this.userData.lightStatus==0&&this.userData.attDayNum>7){
- uni.$u.toast('红灯人员只能打7天卡!');
+ }else if(this.userData.attDayNum>7){
+ uni.$u.toast('临时人员只能打7天卡!');
}else if(this.userData.isFurloughPerson==1){
uni.$u.toast('暂退人员无法打卡!');
}else if(this.userData.workerType==1||this.userData.workerType==2){
@@ -327,8 +339,8 @@ export default {
this.faceData=JSON.parse(uploadFileRes.data.personData)
if(this.faceData){
this.idNumber=this.faceData.idNumber;
- this.getWork()
this.userName=this.faceData.name;
+ this.getWork()
// }else{
// uni.$u.toast('不是本人!');
// }