You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
246 lines
12 KiB
246 lines
12 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>体温录入</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<!--标准mui.css-->
|
|
<link rel="stylesheet" href="../../lib/mui/css/mui.min.css">
|
|
<!--App自定义的css-->
|
|
<link rel="stylesheet" href="../../lib/mui/css/app.css">
|
|
<link rel="stylesheet" type="text/css" href="../../lib/mui/css/mui.picker.min.css" />
|
|
</head>
|
|
|
|
<body class="mui-fullscreen">
|
|
<header class="mui-bar mui-bar-nav">
|
|
<h1 class="mui-title">体温录入</h1>
|
|
</header>
|
|
<div class="mui-content">
|
|
<div class="mui-card">
|
|
<ul class="mui-table-view">
|
|
<li class="mui-table-view-cell mui-collapse">
|
|
<a class="mui-navigate-right" href="#">学生信息</a>
|
|
<div class="mui-collapse-content">
|
|
<ul class="mui-table-view" id="ul">
|
|
</ul>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="mui-card" style="margin-bottom: 35px;" id="card"></div>
|
|
<div class="mui-content-padded" id="picker-id"></div>
|
|
<div class="mui-content-padded" id="tiwen"></div>
|
|
<div class="mui-button-row">
|
|
<button type="button" class="mui-btn mui-btn-primary" id="save" style="width: 300px;height: 40px">确认</button>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script src="../../lib/mui/js/mui.min.js"></script>
|
|
<script src="../../lib/mui/js/mui.picker.min.js"></script>
|
|
<script src="../../lib/mui/js/mui.poppicker.js"></script>
|
|
<script type="text/javascript">
|
|
(function($) {
|
|
mui.ready(function () {
|
|
var wx_openid = GetQueryString("wx_openid");
|
|
var person_id = GetQueryString("person_id");
|
|
mui.ajax("/baseService/mobile/wx_stu_infor_person_id", {
|
|
data: {
|
|
person_id: person_id,
|
|
},
|
|
type: "GET",
|
|
dataType: 'json',
|
|
error: function (xhr, status, statusText) {
|
|
alert("请求失败,状态:" + statusText);
|
|
},
|
|
success: function (json) {
|
|
var li1 = "";
|
|
var obj = eval(json);
|
|
mui.each(obj, function (index, array) {
|
|
li1 += "<input id=\"temperature_person_id\"type=\"hidden\" value="+array['person_id']+">";
|
|
li1 += "<li class=\"mui-table-view-cell\"><a>姓名<span class=\"mui-pull-right\">" + array['person_name'];
|
|
li1 += "</span></a></li>";
|
|
li1 += "<li class=\"mui-table-view-cell\"><a>性别<span class=\"mui-pull-right\">" + array['xb_name'];
|
|
li1 += "</span></a></li>";
|
|
if (array['telephone'] == null) {
|
|
li1 += "<li class=\"mui-table-view-cell\"><a>手机号<span class=\"mui-pull-right\">空";
|
|
} else {
|
|
li1 += "<li class=\"mui-table-view-cell\"><a>手机号<span class=\"mui-pull-right\">" + array['telephone'];
|
|
}
|
|
li1 += "<li class=\"mui-table-view-cell\"><a>出生日期<span class=\"mui-pull-right\">" + array['birthday'];
|
|
li1 += "</span></a></li>";
|
|
li1 += "<li class=\"mui-table-view-cell\"><a>民族<span class=\"mui-pull-right\">" + array['mz_name'];
|
|
li1 += "</span></a></li>";
|
|
li1 += "<li class=\"mui-table-view-cell\"><a>班级<span class=\"mui-pull-right\">" + array['class_name'];
|
|
li1 += "</span></a></li>";
|
|
li1 += "<li class=\"mui-table-view-cell\"><a>辅导员<span class=\"mui-pull-right\">" + array['teacher_name'];
|
|
li1 += "</span></a></li>";
|
|
});
|
|
document.getElementById("ul").innerHTML += li1;
|
|
}
|
|
});
|
|
mui.ajax("/baseService/mobile/wx_stu_temperature_yz", {
|
|
data: {
|
|
wx_openid: wx_openid,
|
|
},
|
|
type: "GET",
|
|
dataType: 'json',
|
|
error: function (xhr, status, statusText) {
|
|
alert("请求失败,状态:" + statusText);
|
|
},
|
|
success: function (json) {
|
|
if (json.message == "103") {
|
|
mui.alert("您暂无录入体温权限,请联系辅导员授权!", function () {
|
|
WeixinJSBridge.call('closeWindow');
|
|
});
|
|
} else {
|
|
var li2 = "";
|
|
var obj = eval(json);
|
|
mui.each(obj, function (index, array) {
|
|
li2 += "<input id=\"operator_id\"type=\"hidden\" value="+array['person_id']+">";
|
|
li2 += "<input id=\"operator_name\"type=\"hidden\" value="+array['person_name']+">";
|
|
li2 += "<input id=\"temperature_time\"type=\"hidden\" value="+array['create_time']+">";
|
|
li2 += "<ul class=\"mui-table-view\">";
|
|
li2 += "<li class=\"mui-table-view-cell\"><a>操作者<span class=\"mui-pull-right\">" + array['person_name'];
|
|
li2 += "</span></a></li>";
|
|
li2 += "<li class=\"mui-table-view-cell\"><a>测温时间<span class=\"mui-pull-right\">" + array['create_time'];
|
|
li2 += "</span></a></li>";
|
|
li2 += "</ul>";
|
|
});
|
|
document.getElementById("card").innerHTML += li2;
|
|
}
|
|
}
|
|
});
|
|
mui.ajax("/baseService/mobile/temperature_place", {
|
|
type: "GET",
|
|
dataType: 'json',
|
|
error: function (xhr, status, statusText) {
|
|
alert("请求失败,状态:" + statusText);
|
|
},
|
|
success: function (json) {
|
|
var li3 = "";
|
|
var obj = eval(json);
|
|
li3 += "<button style=\"height: 45px;font-size: 16px\" id=\"temperature_place_id\" class=\"mui-btn mui-btn-block\" type='button'>选择测温地点</button>";
|
|
li3 += "<button style=\"height: 45px;font-size: 16px\" id=\"temperature_state\" class=\"mui-btn mui-btn-block\" type='button'>选择测温状态</button>";
|
|
document.getElementById("picker-id").innerHTML += li3;
|
|
var userPicker = new $.PopPicker();
|
|
var jsonDate = [];
|
|
var obj = eval(json);
|
|
mui.each(obj,function(index,array){
|
|
jsonDate.push({text:array['place_name'],value:array['place_id']});
|
|
});
|
|
userPicker.setData(jsonDate);
|
|
var temperature_place_id = document.getElementById("temperature_place_id");
|
|
temperature_place_id.addEventListener('tap', function(event) {
|
|
userPicker.show(function(items) {
|
|
temperature_place_id.innerText = items[0].text;
|
|
temperature_place_id.value = JSON.stringify(items[0].value);
|
|
});
|
|
}, false);
|
|
<!-- -------------------------------------------------------分割线------------------------------------------------------------------------------ -->
|
|
var userPicker1 = new $.PopPicker();
|
|
userPicker1.setData([{
|
|
value: 1,
|
|
text: '异常'
|
|
}, {
|
|
value: 0,
|
|
text: '正常'
|
|
}]);
|
|
var temperature_state = document.getElementById("temperature_state");
|
|
temperature_state.addEventListener('tap', function(event) {
|
|
userPicker1.show(function(items) {
|
|
temperature_state.innerText = items[0].text;
|
|
temperature_state.value = items[0].value;
|
|
var li="";
|
|
if(temperature_state.value==1){
|
|
if(!document.getElementById("form")){
|
|
li+= "<form class=\"mui-input-group\" id=\"form\"><div class=\"mui-input-row\">";
|
|
li+= "<label style=\"font-size: 15px;\">异常温度:</label><input id=\"temperature\" name=\"temperature\" type=\"text\" placeholder=\"输入异常温度\"></div></form>";
|
|
document.getElementById("tiwen").innerHTML += li;
|
|
}
|
|
}else{
|
|
if(document.getElementById("form")){
|
|
var child=document.getElementById("form");
|
|
child.parentNode.removeChild(child);
|
|
}
|
|
}
|
|
});
|
|
}, false);
|
|
}
|
|
});
|
|
})
|
|
})(mui);
|
|
var save = document.getElementById("save");
|
|
save.addEventListener('tap', function() {
|
|
if(document.getElementById("temperature")){
|
|
var temperature = mui("#temperature")[0].value;
|
|
}
|
|
var temperature_time = mui("#temperature_time")[0].value;
|
|
var temperature_person_id = mui("#temperature_person_id")[0].value;
|
|
var operator_id = mui("#operator_id")[0].value;
|
|
var temperature_place_id = mui("#temperature_place_id")[0].value;
|
|
var operator_name = mui("#operator_name")[0].value;
|
|
var temperature_state = mui("#temperature_state")[0].value;
|
|
if(temperature_place_id==""){
|
|
mui.alert('请选择测温地点');
|
|
return false;
|
|
}
|
|
if(temperature_state==""){
|
|
mui.alert('选择测温状态!');
|
|
return false;
|
|
}
|
|
if(temperature_state==1){
|
|
if(temperature==""){
|
|
mui.alert('请输入异常温度!');
|
|
return false;
|
|
}else if(temperature<37.3){
|
|
mui.alert('录入的体温小于37.3!体温状态无异常!');
|
|
return false;
|
|
}
|
|
}
|
|
mui.ajax("/baseService/mobile/wx_stu_temperature_add",{
|
|
data:{
|
|
temperature:temperature,
|
|
temperature_time:temperature_time,
|
|
temperature_person_id:temperature_person_id,
|
|
operator_id:operator_id,
|
|
temperature_place_id:temperature_place_id,
|
|
operator_name:operator_name,
|
|
temperature_state:temperature_state
|
|
},
|
|
type: "GET",
|
|
dataType: 'json',
|
|
error: function (xhr, status, statusText) {
|
|
alert("请求失败,状态:" + statusText);
|
|
},
|
|
success: function (json) {
|
|
var obj = eval(json);
|
|
if(json.message){
|
|
mui.alert(json.message, function() {
|
|
WeixinJSBridge.call('closeWindow');
|
|
});
|
|
}else{
|
|
var names = "";
|
|
mui.each(obj,function(index,array){
|
|
names+= array['person_name']+",";
|
|
});
|
|
mui.alert("体温录入成功,但有以下校医没有绑定微信!"+names+"信息推送失败!", function() {
|
|
WeixinJSBridge.call('closeWindow');
|
|
});
|
|
}
|
|
}
|
|
});
|
|
})
|
|
function GetQueryString(name) {
|
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
|
var r = window.location.search.substr(1).match(reg);//search,查询?后面的参数,并匹配正则
|
|
if (r != null) {
|
|
return unescape(r[2]);
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
</script>
|
|
|
|
</html> |