临时人员打卡
This commit is contained in:
parent
2d3631e3a8
commit
8a5e8bd9c9
|
|
@ -64,7 +64,7 @@ export default {
|
|||
return {
|
||||
userId:uni.getStorageSync('realNameUser').userId,
|
||||
userName:uni.getStorageSync('realNameUser').userName,
|
||||
idNumber:uni.getStorageSync('realNameUser').idNumber,
|
||||
idNumber:"",
|
||||
proId:uni.getStorageSync('realNameUser').proId,
|
||||
teamId:uni.getStorageSync('realNameUser').teamId,
|
||||
teamList:[],//打卡点列表
|
||||
|
|
@ -135,7 +135,7 @@ export default {
|
|||
success: res => {
|
||||
res = res.data;
|
||||
if(res.code==200){
|
||||
console.log(res)
|
||||
|
||||
this.teamList=res.data;
|
||||
if(this.teamList.length>0){
|
||||
this.teamList.forEach((item,index)=>{
|
||||
|
|
@ -214,10 +214,10 @@ export default {
|
|||
//获取人员信息(打卡时间)
|
||||
getWork(){
|
||||
let param={
|
||||
idNumber:this.idNumber
|
||||
proId:this.proId
|
||||
}
|
||||
uni.request({
|
||||
url: config.realAppUrl + '/BasePerson/downloadWorkPerson',
|
||||
url: config.realAppUrl + '/BasePerson/downloadTemporaryWorkPerson',
|
||||
method: 'post',
|
||||
data: param,
|
||||
header: {
|
||||
|
|
@ -228,12 +228,45 @@ export default {
|
|||
res = res.data;
|
||||
if(res.code==200){
|
||||
console.log(res)
|
||||
this.userData=res.data[0]
|
||||
if(res.data[0].isToWork!="0"){
|
||||
this.isToWork=res.data[0].isToWork;
|
||||
}
|
||||
if(res.data[0].isOffWork!="0"){
|
||||
this.isOffWork=res.data[0].isOffWork;
|
||||
if(res.data.length>0){
|
||||
let userIndex = res.data.findIndex(v=>v.idNumber==this.idNumber)
|
||||
console.log(userIndex)
|
||||
if(userIndex>-1){
|
||||
this.userData=res.data[userIndex]
|
||||
console.log(this.userData)
|
||||
if(this.userData.isToWork!="0"){
|
||||
this.isToWork=this.userData.isToWork;
|
||||
}
|
||||
if(this.userData.isOffWork!="0"){
|
||||
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){
|
||||
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){
|
||||
uni.$u.toast('上下班打卡间隔2小时!');
|
||||
}else if(this.userData.lightStatus==0&&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){
|
||||
uni.$u.toast('只有临时人员可在当前页面打卡!');
|
||||
}else{
|
||||
this.uploadAttendance()
|
||||
}
|
||||
|
||||
}else{
|
||||
uni.$u.toast('打卡人员不存在当前工程!');
|
||||
}
|
||||
}else{
|
||||
uni.$u.toast('不存在临时人员!');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -292,34 +325,10 @@ export default {
|
|||
if(uploadFileRes.code==200){
|
||||
if(uploadFileRes.data.face){
|
||||
this.faceData=JSON.parse(uploadFileRes.data.personData)
|
||||
console.log(this.faceData)
|
||||
if(this.faceData){
|
||||
// if(this.faceData.idNumber==this.idNumber){//人脸身份证号与登录身份证号相同
|
||||
// this.idNumber=this.faceData.idNumber;
|
||||
this.idNumber=this.faceData.idNumber;
|
||||
this.getWork()
|
||||
this.userName=this.faceData.name;
|
||||
this.proId=this.faceData.proId;
|
||||
let costTime=this.getTimeDiff(this.userData.isToWork,this.timeStr);
|
||||
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(costTime<2){
|
||||
uni.$u.toast('上下班打卡间隔2小时!');
|
||||
}else if(this.userData.lightStatus==0&&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){
|
||||
uni.$u.toast('只有临时人员可在当前页面打卡!');
|
||||
}else{
|
||||
this.uploadAttendance()
|
||||
}
|
||||
// }else{
|
||||
// uni.$u.toast('不是本人!');
|
||||
// }
|
||||
|
|
|
|||
Loading…
Reference in New Issue