aleyds 3 rokov pred
rodič
commit
61e35a9ca6
2 zmenil súbory, kde vykonal 17 pridanie a 1 odobranie
  1. 11 1
      pages/attence/attence.vue
  2. 6 0
      pages/index/index.vue

+ 11 - 1
pages/attence/attence.vue

@@ -109,6 +109,9 @@
 				remarkTip:'',
 				remark:'',
 				workType:1,
+				punchDistance:0, //打卡距离
+				punchRange:0, //打卡范围
+				outwork:0, //是否外勤 0-否 1-是
 				// 地图
 				covers: [],
 				circles:[{  
@@ -153,8 +156,11 @@
 						var src = res.latitude + ',' + res.longitude;
 						var locRet = location?.distance?.(src, dst);
 						that.positionInfo = true;
+						that.punchDistance = locRet.distance;
+						that.punchRange = that.payeeinfo.workDistance;
 						if(locRet.distance <= that.payeeinfo.workDistance){//在打卡范围内
 							that.outPosition = false;
+							that.outwork = 0;
 							if(that.workType==1){
 								let workStartTime = new Date(that.payeeinfo.workStartTime.replace(/-/g,'/'));
 								if(that.currentTime<=workStartTime.getTime()){
@@ -185,6 +191,7 @@
 							that.getPunchIn();
 						}else{//不在打卡范围内
 							that.outPosition = true;
+							that.outwork = 1;
 							// that.remarkPopupShow = true;
 							// console.table({locRet:locRet,workDistance:that.payeeinfo.workDistance,r:locRet<=that.payeeinfo.workDistance});
 							that.$refs.uToast.show({
@@ -219,7 +226,10 @@
 					longitude:that.payeeinfo.longitude,
 					remark:that.remark,
 					roadNo:that.payeeinfo.roadNo,
-					workType:that.workType
+					workType:that.workType,
+					punchDistance: that.punchDistance,
+					punchRange: that.punchRange,
+					outwork: that.outwork
 				}
 				that.$u.api.punchIn(param)
 				.then(res=>{

+ 6 - 0
pages/index/index.vue

@@ -187,6 +187,12 @@
 					// 	type: 'success',
 					// });
 					this.spaceInfo = res.data.spaceInfo;
+					if (res.data.notices){
+						this.noticeList=[];
+						res.data.notices.forEach(item =>{
+							this.noticeList.push(item.title);
+						})
+					}
 					console.log('this.spaceInfo',this.spaceInfo)
 				}).catch(err=>{
 					if(err.errMsg){