|
|
@@ -9,8 +9,8 @@
|
|
|
<link href="../../css/mui.min.css" rel="stylesheet" />
|
|
|
<link href="../../css/mui.indexedlist.css" rel="stylesheet" />
|
|
|
<link href="../../css/OA-style.css" rel="stylesheet" />
|
|
|
- <link rel="stylesheet" type="text/css" href="../../css/mui.picker.min.css" />
|
|
|
- <link rel="stylesheet" type="text/css" href="../../css/mui.poppicker.css" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../../css/mui.picker.min.css" />
|
|
|
+ <link rel="stylesheet" type="text/css" href="../../css/mui.poppicker.css" />
|
|
|
<style type="text/css">
|
|
|
.mui-content>.mui-table-view:first-child {
|
|
|
margin-top: -1px;
|
|
|
@@ -19,7 +19,7 @@
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
|
-<body>
|
|
|
+ <body>
|
|
|
<header class="mui-bar mui-bar-nav" id="login">
|
|
|
<a href="" class="mui-action-back back mui-pull-left"><img src="../../images/back.png"></a>
|
|
|
<div id="qiandaolist">
|
|
|
@@ -27,7 +27,7 @@
|
|
|
</div>
|
|
|
<!--<div id="lqlist" style="margin-right: 30px;"><img src="../../images/common_magnifier.png" class="statistics mui-pull-right"></div>-->
|
|
|
</header>
|
|
|
-
|
|
|
+
|
|
|
<div class="mui-content">
|
|
|
<div class="checking-in">
|
|
|
<div class="head-text">
|
|
|
@@ -47,8 +47,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<div class="table_item">
|
|
|
<div class="work">
|
|
|
<div class="mui-clearfix title_box">
|
|
|
@@ -60,9 +60,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
-
|
|
|
-
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
<div class="table_item" id="weizhi" >
|
|
|
<div class="work">
|
|
|
<div class="mui-clearfix title_box">
|
|
|
@@ -78,8 +78,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div id="allmap"></div>
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<div class="table_item" id="waichu" style="display:none;">
|
|
|
<div class="work">
|
|
|
<div class="mui-clearfix title_box">
|
|
|
@@ -92,8 +92,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
<div class="table_item" id="waichu" style="display:none;">
|
|
|
<div class="work">
|
|
|
<div class="mui-clearfix title_box">
|
|
|
@@ -106,16 +106,19 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <div style="height: 15px;"></div>
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- <div style="height: 15px;"></div> -->
|
|
|
+
|
|
|
</div>
|
|
|
+ <div id="allmap" style="display: block;width: 100%;padding: 200px;"></div>
|
|
|
<div class="sign-in" style="display: block;width: 50%;">
|
|
|
<a href="#" id="qiandao">上班签到</a>
|
|
|
</div>
|
|
|
<div class="sign-in" style="display: block;width: 50%;position: fixed;left: 50%;">
|
|
|
<a href="#" id="qiantui">下班签退</a>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
<input type="hidden" name="swqdtimehour" id="swqdtimehour" value="" />
|
|
|
<input type="hidden" name="swqdtimemin" id="swqdtimemin" value="" />
|
|
|
<input type="hidden" name="swqttimehour" id="swqttimehour" value="" />
|
|
|
@@ -124,7 +127,7 @@
|
|
|
<input type="hidden" name="xwqdtimemin" id="xwqdtimemin" value="" />
|
|
|
<input type="hidden" name="xwqttimehour" id="xwqttimehour" value="" />
|
|
|
<input type="hidden" name="xwqttimemin" id="xwqttimemin" value="" />
|
|
|
-
|
|
|
+
|
|
|
<input type="hidden" name="swqdjstimehour" id="swqdjstimehour" value="" />
|
|
|
<input type="hidden" name="swqdjstimemin" id="swqdjstimemin" value="" />
|
|
|
<input type="hidden" name="swqtjstimehour" id="swqtjstimehour" value="" />
|
|
|
@@ -134,7 +137,7 @@
|
|
|
<input type="hidden" name="xwqtjstimehour" id="xwqtjstimehour" value="" />
|
|
|
<input type="hidden" name="xwqtjstimemin" id="xwqtjstimemin" value="" />
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<script src="../../js/mui.min.js"></script>
|
|
|
<script src="../../js/mui.view.js"></script>
|
|
|
<script src="../../js/mui.picker.min.js"></script>
|
|
|
@@ -143,28 +146,28 @@
|
|
|
<script src="../../js/app.js"></script>
|
|
|
<script src="../../js/jquery-1.11.2.min.js"></script>
|
|
|
<!--<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4"></script>-->
|
|
|
- <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=ky0EujqtKcFsOpt8UZA0t5RvIb7VhrsW"></script>
|
|
|
+ <script type="text/javascript" src="http://api.map.baidu.com/api?v=3.0&ak=ky0EujqtKcFsOpt8UZA0t5RvIb7VhrsW"></script>
|
|
|
<script type="text/javascript" src="http://developer.baidu.com/map/jsdemo/demo/convertor.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
-
|
|
|
+
|
|
|
document.getElementById('qiandaolist').addEventListener('tap', function() {
|
|
|
mui.openWindow({
|
|
|
url: 'qiandao.html',
|
|
|
id: 'qiandao.html',
|
|
|
extras:{}
|
|
|
})
|
|
|
- });
|
|
|
-
|
|
|
- var longitude, latitude;
|
|
|
+ });
|
|
|
+
|
|
|
+ var longitude, latitude;
|
|
|
mui.plusReady(function(){
|
|
|
-
|
|
|
+
|
|
|
//开启等待框
|
|
|
var w = plus.nativeUI.showWaiting("定位中,请等待...", {
|
|
|
loading: {
|
|
|
display: "inline"
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
var myDate = new Date();
|
|
|
var mytime=myDate.toLocaleString();
|
|
|
var xingqi=myDate.getDay();
|
|
|
@@ -183,19 +186,19 @@
|
|
|
}if(xingqi=='0'){
|
|
|
document.getElementById('xingqi').innerHTML="星期日";
|
|
|
}
|
|
|
-
|
|
|
- var s = 1900+myDate.getYear() //+ "-"; //取年份
|
|
|
+
|
|
|
+ var s = 1900+myDate.getYear() //+ "-"; //取年份
|
|
|
var y=myDate.getMonth() + 1;
|
|
|
var t=myDate.getDate()
|
|
|
if(y<10){y='0'+y}
|
|
|
if(t<10){t='0'+t}
|
|
|
-
|
|
|
+
|
|
|
var rizi = s+"-"+y+"-"+t;
|
|
|
- document.getElementById('rizi').innerHTML=rizi;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ document.getElementById('rizi').innerHTML=rizi;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
var serviceId = "hr_2018V01CheckAttendance";
|
|
|
var state = app.getState(); //获取登陆信息
|
|
|
var staffId = state.user.useId;
|
|
|
@@ -206,7 +209,7 @@
|
|
|
app.ajax(serviceId,obj, function(data) {
|
|
|
//服务器返回响应
|
|
|
console.log(JSON.stringify(data))
|
|
|
-
|
|
|
+
|
|
|
var list = data.list;
|
|
|
var type1 = true;
|
|
|
var type2 = true;
|
|
|
@@ -218,7 +221,7 @@
|
|
|
var remark=list[i].remark;
|
|
|
|
|
|
//document.getElementById('state').innerHTML="已"+remark;
|
|
|
-
|
|
|
+
|
|
|
if(list[i].att_type_id=="1"){
|
|
|
//document.getElementById('morningCheck').innerHTML=list[i].att_time;
|
|
|
if(type1){ // 第一次为morningCheck赋值
|
|
|
@@ -265,7 +268,7 @@
|
|
|
document.getElementById('xwqdtimemin').value = data.xwqdtimemin;
|
|
|
document.getElementById('xwqttimehour').value = data.xwqttimehour;
|
|
|
document.getElementById('xwqttimemin').value = data.xwqttimemin;
|
|
|
-
|
|
|
+
|
|
|
document.getElementById('swqdjstimehour').value = data.swqdjstimehour;
|
|
|
document.getElementById('swqdjstimemin').value = data.swqdjstimemin;
|
|
|
document.getElementById('swqtjstimehour').value = data.swqtjstimehour;
|
|
|
@@ -276,19 +279,19 @@
|
|
|
document.getElementById('xwqtjstimemin').value = data.xwqtjstimemin;
|
|
|
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
mapPosition();
|
|
|
|
|
|
- setTimeout(function () {
|
|
|
- // var gpsPoint = new BMap.Point(longitude, latitude);
|
|
|
- // BMap.Convertor.translate(gpsPoint, 0, function (point) {
|
|
|
- // var geoc = new BMap.Geocoder({extensions_town: true});
|
|
|
+ setTimeout(function () {
|
|
|
+ // var gpsPoint = new BMap.Point(longitude, latitude);
|
|
|
+ // BMap.Convertor.translate(gpsPoint, 0, function (point) {
|
|
|
+ // var geoc = new BMap.Geocoder({extensions_town: true});
|
|
|
// // var geoc = new BMap.Geolocation();
|
|
|
- // geoc.getLocation(point, function (rs) {
|
|
|
- // var addComp = rs.addressComponents;
|
|
|
-
|
|
|
+ // geoc.getLocation(point, function (rs) {
|
|
|
+ // var addComp = rs.addressComponents;
|
|
|
+
|
|
|
// console.log("==" + JSON.stringify(rs));
|
|
|
- // var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
|
|
|
+ // var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
|
|
|
// document.getElementById('dqweizhi').innerHTML=address;
|
|
|
// console.log(address);
|
|
|
// //关闭等待框
|
|
|
@@ -297,100 +300,107 @@
|
|
|
// w.close();
|
|
|
// clearInterval(t);
|
|
|
// }, 1000);
|
|
|
- // });
|
|
|
- // });
|
|
|
- var myGeo = new BMap.Geocoder({extensions_town: true});
|
|
|
- // 根据坐标得到地址描述
|
|
|
- myGeo.getLocation(new BMap.Point(longitude, latitude), function(result){
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ var map = new BMap.Map("allmap");
|
|
|
+ var myGeo = new BMap.Geocoder({extensions_town: true});
|
|
|
+ var point = new BMap.Point(longitude, latitude);
|
|
|
+ map.centerAndZoom(point, 16);
|
|
|
+ var marker = new BMap.Marker(point); // 创建标注
|
|
|
+ map.addOverlay(marker); // 将标注添加到地图中
|
|
|
+ // 根据坐标得到地址描述
|
|
|
+ myGeo.getLocation(point, function(result){
|
|
|
if (result){
|
|
|
+
|
|
|
console.log("==" + JSON.stringify(result));
|
|
|
document.getElementById('dqweizhi').innerHTML=result.address;
|
|
|
- console.log(result.address);
|
|
|
+ console.log(result.address);
|
|
|
//关闭等待框
|
|
|
var t = setInterval(function() {
|
|
|
w.setTitle("定位中,请等待...");
|
|
|
w.close();
|
|
|
clearInterval(t);
|
|
|
}, 1000);
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
});
|
|
|
- }, 3000);
|
|
|
+ }, 3000);
|
|
|
|
|
|
});
|
|
|
function mapPosition(){
|
|
|
function showLocation(position) {
|
|
|
//alert("进入定位")
|
|
|
- longitude = position.coords.longitude;
|
|
|
+ longitude = position.coords.longitude;
|
|
|
latitude = position.coords.latitude;
|
|
|
document.getElementById('longitude').value=longitude;
|
|
|
document.getElementById('latitude').value=latitude;
|
|
|
}
|
|
|
|
|
|
function errorHandler(error) {
|
|
|
- switch(error.code){
|
|
|
- case error.PERMISSION_DENIED:
|
|
|
- alert("您拒绝对获取地理位置的请求");
|
|
|
- break;
|
|
|
- case error.POSITION_UNAVAILABLE:
|
|
|
- alert("位置信息是不可用的");
|
|
|
- break;
|
|
|
- case error.TIMEOUT:
|
|
|
- alert("请求您的地理位置超时");
|
|
|
- break;
|
|
|
- case error.UNKNOWN_ERROR:
|
|
|
- alert("未知错误");
|
|
|
- break;
|
|
|
+ switch(error.code){
|
|
|
+ case error.PERMISSION_DENIED:
|
|
|
+ alert("您拒绝对获取地理位置的请求");
|
|
|
+ break;
|
|
|
+ case error.POSITION_UNAVAILABLE:
|
|
|
+ alert("位置信息是不可用的");
|
|
|
+ break;
|
|
|
+ case error.TIMEOUT:
|
|
|
+ alert("请求您的地理位置超时");
|
|
|
+ break;
|
|
|
+ case error.UNKNOWN_ERROR:
|
|
|
+ alert("未知错误");
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- var map = new BMap.Map("allmap");
|
|
|
+
|
|
|
+ // var map = new BMap.Map("allmap");
|
|
|
|
|
|
if (navigator.geolocation){
|
|
|
|
|
|
navigator.geolocation.getCurrentPosition(showLocation, errorHandler);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
document.getElementById("remap").addEventListener("click", function() {
|
|
|
mui.plusReady(function(){
|
|
|
//开启等待框
|
|
|
- var w = plus.nativeUI.showWaiting("正在重新定位中,请等待...", {
|
|
|
- loading: {
|
|
|
- display: "inline"
|
|
|
- }
|
|
|
- });
|
|
|
- mapPosition();
|
|
|
- setTimeout(function () {
|
|
|
- var gpsPoint = new BMap.Point(longitude, latitude);
|
|
|
- BMap.Convertor.translate(gpsPoint, 0, function (point) {
|
|
|
- var geoc = new BMap.Geocoder();
|
|
|
- geoc.getLocation(point, function (rs) {
|
|
|
- var addComp = rs.addressComponents;
|
|
|
- var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
|
|
|
- document.getElementById('dqweizhi').innerHTML=address;
|
|
|
- //关闭等待框
|
|
|
- var t = setInterval(function() {
|
|
|
- w.setTitle("正在重新定位中,请等待...");
|
|
|
- w.close();
|
|
|
- clearInterval(t);
|
|
|
- }, 1000);
|
|
|
- });
|
|
|
- });
|
|
|
- }, 3000);
|
|
|
+ var w = plus.nativeUI.showWaiting("正在重新定位中,请等待...", {
|
|
|
+ loading: {
|
|
|
+ display: "inline"
|
|
|
+ }
|
|
|
+ });
|
|
|
+ mapPosition();
|
|
|
+ setTimeout(function () {
|
|
|
+ var gpsPoint = new BMap.Point(longitude, latitude);
|
|
|
+ BMap.Convertor.translate(gpsPoint, 0, function (point) {
|
|
|
+ var geoc = new BMap.Geocoder();
|
|
|
+ geoc.getLocation(point, function (rs) {
|
|
|
+ var addComp = rs.addressComponents;
|
|
|
+ var address = addComp.province + addComp.city + addComp.district + addComp.street + addComp.streetNumber;
|
|
|
+ document.getElementById('dqweizhi').innerHTML=address;
|
|
|
+ //关闭等待框
|
|
|
+ var t = setInterval(function() {
|
|
|
+ w.setTitle("正在重新定位中,请等待...");
|
|
|
+ w.close();
|
|
|
+ clearInterval(t);
|
|
|
+ }, 1000);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }, 3000);
|
|
|
});
|
|
|
})
|
|
|
|
|
|
document.querySelector("#qiandao").addEventListener("tap",function(){
|
|
|
-
|
|
|
- var kaoqin_type='1'; //考勤类型(1上班,2下班,3外出,4外出返回,5加班签到,6加班签退)
|
|
|
+
|
|
|
+ var kaoqin_type='1'; //考勤类型(1上班,2下班,3外出,4外出返回,5加班签到,6加班签退)
|
|
|
var swqdtimehour = 8;
|
|
|
var swqdtimemin = 30;
|
|
|
var swqdjstimehour = 23;
|
|
|
var swqdjstimemin = 0;
|
|
|
-
|
|
|
+
|
|
|
console.log(swqdtimehour + "-----"+ swqdtimemin + "-----"+swqdjstimehour + "-----"+swqdjstimemin );
|
|
|
-
|
|
|
+
|
|
|
var myDate = new Date();
|
|
|
var myhour = myDate.getHours();
|
|
|
var mymin = myDate.getMinutes();
|
|
|
@@ -409,38 +419,38 @@
|
|
|
|
|
|
|
|
|
document.querySelector("#qiantui").addEventListener("tap",function(){
|
|
|
-
|
|
|
- var kaoqin_type='2'; //考勤类型(1上班,2下班,3外出,4外出返回,5加班签到,6加班签退)
|
|
|
-
|
|
|
+
|
|
|
+ var kaoqin_type='2'; //考勤类型(1上班,2下班,3外出,4外出返回,5加班签到,6加班签退)
|
|
|
+
|
|
|
var xwqttimehour = 15;
|
|
|
var xwqttimemin = 0;
|
|
|
var xwqtjstimehour = 20
|
|
|
var xwqtjstimemin = 0;
|
|
|
-
|
|
|
+
|
|
|
var myDate = new Date();
|
|
|
var myhour = myDate.getHours();
|
|
|
var mymin = myDate.getMinutes();
|
|
|
if(myhour>xwqttimehour && myhour<xwqtjstimehour){
|
|
|
kaoqin(kaoqin_type);
|
|
|
}
|
|
|
- else if(myhour==xwqttimehour && mymin>xwqttimemin){
|
|
|
+ else if(myhour==xwqttimehour && mymin>xwqttimemin){
|
|
|
kaoqin(kaoqin_type);
|
|
|
}
|
|
|
else if(myhour==xwqtjstimehour && mymin<xwqtjstimemin){
|
|
|
kaoqin(kaoqin_type);
|
|
|
}else{
|
|
|
mui.toast("不在签退时间15:00--20:00内");
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- function kaoqin(kaoqin_type){
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ function kaoqin(kaoqin_type){
|
|
|
var serviceId = "hr_2018V01CreateAttendance";
|
|
|
var state = app.getState(); //获取登陆信息
|
|
|
var staffId = state.user.useId;
|
|
|
var user_name = state.user.name;
|
|
|
var unitId = state.user.unitId;
|
|
|
var now_date = getNowFormatDate();
|
|
|
-
|
|
|
+
|
|
|
var longitude = document.getElementById('longitude').value;
|
|
|
var latitude = document.getElementById('latitude').value;
|
|
|
|
|
|
@@ -472,7 +482,7 @@
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
function getNowFormatDate() {
|
|
|
var date = new Date();
|
|
|
var seperator1 = "-";
|
|
|
@@ -489,10 +499,10 @@
|
|
|
+ " " + date.getHours() + seperator2 + date.getMinutes()
|
|
|
+ seperator2 + date.getSeconds();
|
|
|
return currentdate;
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- </script>
|
|
|
+ </script>
|
|
|
|
|
|
</body>
|
|
|
</html>
|