소스 검색

异地打卡必须获取定位

wgl 4 년 전
부모
커밋
5f14db5c56
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      src/projects/business/views/Master/Attendance/Sign.vue

+ 7 - 4
src/projects/business/views/Master/Attendance/Sign.vue

@@ -20,7 +20,7 @@
 			</div>
 			<div class="mui-content-padded">
 				<h5><span class="colorfe616c">*</span>定位</h5>
-				<button class="vongi-yidi-location">{{tjForm.address}}<span class="mui-icon mui-icon-location"></span></button>
+				<button class="vongi-yidi-location" @click="getPoint">{{tjForm.address}}<span class="mui-icon mui-icon-location"></span></button>
 			</div>
 			<div class="mui-content-padded">
 				<h5><span class="colorfe616c">*</span>备注</h5>
@@ -186,6 +186,9 @@
 				} else if (!this.tjForm.content) {
 					mui.toast('请输入申请内容');
 					return false;
+				} else if (!this.tjForm.address) {
+					mui.toast('暂未获取到您的位置');
+					return false;
 				} else {
 					return true;
 				}
@@ -193,10 +196,10 @@
 			//提交
 			submit() {
 				this.tjForm.photoFile = this.picList.join(',');
+				if (this.tjForm.address == '定位中……') {
+					this.tjForm.address = '';
+				}
 				if (this.checkFrom()) {
-					if (this.tjForm.address == '定位中……') {
-						this.tjForm.address = '';
-					}
 					this.isLoading = true;
 					API_Attendance.postPatchCard(this.tjForm).then(response => {
 						this.isLoading = false;