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