Prechádzať zdrojové kódy

工作状态判断是否可以外勤打卡

wgl 4 rokov pred
rodič
commit
ff09fc7144

+ 15 - 10
src/projects/business/views/Master/Attendance/Sign.vue

@@ -4,6 +4,7 @@
 		<top-header :pageTitle="pageTitle" :rightLink="rightLink" :doRightLink="doRightLink"></top-header>
 
 		<div class="mui-content vongi-wordcard">
+
 			<div class="mui-content-padded">
 				<form class="mui-input-group">
 					<div class="mui-input-row">
@@ -127,9 +128,7 @@
 				],
 			}
 		},
-		created() {
-
-		},
+		created() {},
 		methods: {
 			//获取详情
 			getTime() {
@@ -336,12 +335,17 @@
 			})
 		},
 		mounted() {
-			//获取微信配置
-			WxJsApi.getWxConfig(['chooseImage', 'getLocalImgData', 'getLocation']);
-			//获取经纬度
-			this.getPoint();
-			this.getTime();
-			//this.getPsersonList();
+			if (['2', '3'].indexOf(this.person_data.workStatus) == -1) {
+				mui.toast('您当前工作状态无法进行外勤打卡');
+				this.$router.go(-1);
+			} else {
+				//获取微信配置
+				WxJsApi.getWxConfig(['chooseImage', 'getLocalImgData', 'getLocation']);
+				//获取经纬度
+				this.getPoint();
+				this.getTime();
+				//this.getPsersonList();
+			}
 		},
 		destroyed() {},
 		computed: {
@@ -396,7 +400,8 @@
 			...mapGetters({
 				openId: 'wx_openid',
 				token: 'token',
-				default_examine_person: 'default_examine_person'
+				default_examine_person: 'default_examine_person',
+				person_data: 'person_data',
 			})
 		}
 	}