Selaa lähdekoodia

Merge branch 'master' of http://47.92.161.104:10080/wgl/jp-xpgj

vonin 4 vuotta sitten
vanhempi
commit
c620944136

+ 2 - 2
src/projects/business/views/Master/Attendance/List.vue

@@ -10,7 +10,7 @@
 					<li v-for="(item,index) in recordList" class="mui-table-view-cell">
 						{{item.recordTime}}
 						<div class="mui-media-body">
-							<button type="button" class="mui-btn mui-btn-primary" v-if="item.result=='1' && item.status=='1'" @click="goToInfo(item.fillAttendanceId)">已补卡</button>
+							<button type="button" class="mui-btn mui-btn-primary" v-if="item.result=='1' && item.status=='1'" @click="goToInfo(item.fillAttendanceId)">{{item.type=='1'?'已异地打卡':'已补卡'}}</button>
 							<button type="button" class="mui-btn mui-btn-primary" v-if="item.result=='0' && item.status=='2'" @click="goToInfo(item.fillAttendanceId)">已拒绝</button>
 							<button type="button" class="mui-btn mui-btn-primary" v-if="item.result=='0' && item.status=='0'" @click="goToInfo(item.fillAttendanceId)">审核中</button>
 							<button type="button" class="mui-btn mui-btn-primary" v-if="item.result=='0' && item.status===null" @click="applybk(item.id)">申请补卡</button>
@@ -20,7 +20,7 @@
 				</ul>
 			</div>
 		</div>
-		
+
 	</div>
 </template>
 

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

@@ -18,7 +18,7 @@
 					</div>
 					<div class="mui-input-row">
 						<label><span class="colorfe616c">*</span>定位</label>
-						<div class="vongi-yidi-location mui-ellipsis">
+						<div class="vongi-yidi-location mui-ellipsis" style="width: 80%;">
 							<button class="mui-btn mui-btn-block" type='button' v-text="positionName"></button>
 							<span class="mui-icon mui-icon-location"></span>
 						</div>
@@ -81,6 +81,7 @@
 					workAttendanceId: ''
 				},
 				tjForm: {
+					alarmConfigId: '',
 					workAttendanceDate: '',
 					workAttendanceTime: '',
 					type: '1', //外勤打卡/补卡(1/2)
@@ -88,8 +89,8 @@
 					approvalPersonId: '',
 					workAttendanceId: '',
 					photoFile: '',
-					longitude: '',
-					latitude: '',
+					longitude: 112.198305,
+					latitude: 30.347599,
 				},
 				//typeName: '',
 				approvalPersonName: '',
@@ -109,6 +110,7 @@
 
 					this.tjForm.workAttendanceDate = response.workAttendanceDate;
 					this.tjForm.workAttendanceTime = response.workAttendanceTime;
+					this.tjForm.alarmConfigId = response.alarmConfigId;
 
 					this.isLoading = false;
 				}).catch(error => {
@@ -212,19 +214,26 @@
 			},
 			//获取经纬度
 			getPoint() {
+				this.isLoading = true;
 				WxJsApi.getLocation().then((res) => {
+					this.isLoading = false;
 					this.tjForm.latitude = res.latitude;
 					this.tjForm.longitude = res.longitude;
+
+					//获取定位地址
+					this.getPositionByLonLats()
 				})
 			},
 			//获取定位地址
-			getPositionByLonLats(lng, lat) {
+			getPositionByLonLats() {
 				var _this = this;
 				MapLoader().then(AMap => {
-					var lnglatXY = [lng, lat];
+					var lnglatXY = [_this.tjForm.longitude, _this.tjForm.latitude];
 					AMap.service('AMap.Geocoder', function() {
-						geocoder = new AMap.Geocoder({});
+						let geocoder = new AMap.Geocoder({});
 						geocoder.getAddress(lnglatXY, function(status, result) {
+							console.log(lnglatXY);
+							console.log(status, result);
 							if (status === 'complete' && result.info === 'OK') {
 								var address = result.regeocode.formattedAddress;
 								console.log(address);
@@ -234,6 +243,8 @@
 							}
 						});
 					});
+				}).catch(error => {
+					console.log(error)
 				})
 			},
 			asynCallBack() {
@@ -292,5 +303,6 @@
 </script>
 
 <style scoped src="$project/assets/css/xpwyfyy.css"></style>
-<style>
+<style src="$project/assets/css/mui.picker.min.css"></style>
+<style scoped>
 </style>

+ 8 - 2
src/utils/AMap.js

@@ -1,4 +1,4 @@
-export default function MapLoader() {
+function MapLoader() {
 	return new Promise((resolve, reject) => {
 		if (window.AMap) {
 			resolve(window.AMap)
@@ -6,12 +6,18 @@ export default function MapLoader() {
 			var script = document.createElement('script')
 			script.type = 'text/javascript'
 			script.async = true
-			script.src = 'http://webapi.amap.com/maps?v=1.4.15&callback=initAMap&key=09abadb2e35fc61fd84042c518e9aebf'
+			script.src = 'https://webapi.amap.com/maps?v=1.4.15&key=09abadb2e35fc61fd84042c518e9aebf&plugin=AMap.Geocoder'
 			script.onerror = reject
 			document.head.appendChild(script)
+
+			setTimeout(function() {
+				resolve(window.AMap)
+			}, 1000);
+
 		}
 		window.initAMap = () => {
 			resolve(window.AMap)
 		}
 	})
 }
+export default MapLoader

+ 22 - 18
src/utils/wxJsApi.js

@@ -4,25 +4,29 @@ import * as API_Common from '$project/apis/common'
 
 //获取微信配置
 export function getWxConfig(jsApiList) {
-	let promise = new Promise((resolve, reject) => {
-		var jsApiList = jsApiList || ['chooseImage', 'getLocalImgData'];
-		API_WeiXin.getConfig().then(response => {
-			var wxconfig = response.wxConfig;
-			console.log(wxconfig.nonceStr)
-			wx.config({
-				debug: false, // 开启调试模式,
-				appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
-				timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
-				nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
-				signature: wxconfig.signature, // 必填,签名,见附录1
-				jsApiList: jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
-			});
-			resolve(response);
-		}).catch(error => {
-			mui.toast(error);
-			reject(error);
+	var jsApiList = jsApiList || ['chooseImage', 'getLocalImgData'];
+	let promise = (jsApiList => {
+		new Promise((resolve, reject) => {
+			console.log(jsApiList);
+			API_WeiXin.getConfig().then(response => {
+				var wxconfig = response.wxConfig;
+				console.log(wxconfig.nonceStr)
+				wx.config({
+					debug: false, // 开启调试模式,
+					appId: wxconfig.appId, // 必填,企业号的唯一标识,此处填写企业号corpid
+					timestamp: wxconfig.timestamp, // 必填,生成签名的时间戳
+					nonceStr: wxconfig.nonceStr, // 必填,生成签名的随机串
+					signature: wxconfig.signature, // 必填,签名,见附录1
+					jsApiList: jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
+				});
+				resolve(response);
+			}).catch(error => {
+				mui.toast(error);
+				reject(error);
+			})
 		})
-	})
+	})(jsApiList)
+
 	return promise;
 }