123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- <!doctype html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
- <meta charset="utf-8">
- <title>添加血压</title>
- <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
- <link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
- <link rel="stylesheet" type="text/css" href="../css/ss-style.css" />
- <link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
- <link rel="stylesheet" type="text/css" href="../css/zx-style.css">
- </head>
- <body>
- <div class="c-main">
- <div class="wis-fix c-border-b mt15">
- <ul class="c-list patient-list c-border-t mt fosx-li" data-list="patientInfo">
- <li>
- <div class="c-list-value pr30" style="width: 100px;">
- <h4><em class="star"></em>记录对象</h4>
- </div>
- <div class="c-list-info">
- <div class="input-group width-100">
- <input type="text" class="form-control width-100 no-border" style="background: #FFFFFF;" readonly="readonly" data-code="" id="member">
- </div>
- </div>
- </li>
- <li>
- <div class="c-list-value pr30" style="width: 100px;">
- <h4><em class="star"></em>记录时间</h4>
- </div>
- <div class="c-list-info">
- <div class="input-group width-100">
- <input type="text" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入记录时间" data-time="date" value="" id="date">
- <span class="form-select-arrow"></span>
- </div>
- </div>
- </li>
- <li>
- <div class="c-list-value pr30" style="width: 100px;">
- <h4><em class="star"></em>收缩压(高压)</h4>
- </div>
- <div class="c-list-info">
- <div class="input-group width-100">
- <input type="number" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入数值" value="" id="val_h">
- </div>
- </div>
- </li>
- <li>
- <div class="c-list-value pr30" style="width: 100px;">
- <h4><em class="star"></em>舒张压(低压)</h4>
- </div>
- <div class="c-list-info">
- <div class="input-group width-100">
- <input type="number" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入数值" value="" id="val_l">
- </div>
- </div>
- </li>
- </ul>
- </div>
- <p class="c-f16 c5b plr15 pt10">收缩压 正常范围:<span id="minValue1"></span>-<span id="maxValue1"></span>mmHg</p>
- <p class="c-f16 c5b plr15 pt10">舒张压 正常范围:<span id="minValue2"></span>-<span id="maxValue2"></span>mmHg</p>
- <div class="bottom-box clearfix mt20 plr15">
- <a href="javascript:;" id="save" class="c-btn-full c-btn-75BF00 c-btn-radius fl c-f18">保存</a>
- </div>
- </div>
- </body>
- <script src="../../../js/jquery/2.1.3/jquery.js"></script>
- <script type="text/javascript" src="../../../js/mui.min.js"></script>
- <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
- <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
- <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
- <script src="../../../js/common_http.js"></script>
- <script type="text/javascript" src="../../../js/weixin_common.js" ></script>
- <link rel="stylesheet" type="text/css" href="../../../widget/mobiscroll/2.15.1/css/mobiscroll.css">
- <link rel="stylesheet" type="text/css" href="../css/mobiscroll_numpad.css"/>
- <script src="../js/mobiscroll-2.17.1.js" type="text/javascript" charset="utf-8"></script>
- <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
- <script type="text/javascript" src="../../../js/isRepresented.js"></script>
- <script src="../js/health-index.js"></script>
- <script>
- var Request = GetRequest();
- $(function() {
- isRepresent(function(){
- var userAgent = JSON.parse(window.localStorage.getItem(agentName));
- sendPost("patient/family/authorize_members",{}, "json", "get",null,function(res){
- if(res.status == 200){
- if(res.data.length > 0){
- var data=res.data;
- var $member = $('#member')
- //关联被代理人
- if(userAgent.represented){
- var one = _.find(data,function(item){return item.code == userAgent.represented;})
- $member.attr('data-code',one.code);
- $member.val(one.name);
- }else{
- var one = _.find(data,function(item){return item.code == userAgent.uid;})
- $member.attr('data-code',one.code);
- $member.val(one.name);
- }
- nextWork()
- }else{
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'获取家庭成员数据失败'}).show();
- }
- }
- })
- })
- })
-
- function nextWork(){
- var id = Request['id'],
- code = decodeURIComponent(Request['type']),
- data = decodeURIComponent(Request['time']),
- val1 = decodeURIComponent(Request['val1']),
- val2 = decodeURIComponent(Request['val2']);
- var lastDate = '';
-
- /* 选择日期 */
- var opt1 = {
- preset: 'datetime',
- theme: 'ios',
- lang: 'zh',
- display: "bottom",
- minDate: new Date(1900, 01, 01),
- onSelect: function(valueText, inst) {
- valueText = valueText.replace("/","-").replace("/","-");
- $("#date").val(valueText);
- }
- };
- $('input[data-time=date]').mobiscroll(opt1);
- //初始化时间
- if (id) {
- var date = new Date(data.replace(/\-/g, "/"))
- $("#date").val(date.Format("yyyy-MM-dd HH:mm"));
- } else {
- var date = new Date()
- $("#date").val(date.Format("yyyy-MM-dd HH:mm"));
- }
- $('#val_h').val(val1);
- $('#val_l').val(val2);
- $("input[type=number]").mobiscroll().numpad({
- theme: 'ios',
- display: 'bottom',
- lang: 'zh',
- placeholder: '0',
- fill: 'rtl',
- allowLeadingZero: true,
- maxLength: 6,
- maxScale: 2,
- template: 'ddd',
- buttons: ['set','cancel'],
- onSelect: function(valueText, inst){
- var value = parseFloat(valueText);
- $(this).val(value);
- }
- })
- //保存
- document.getElementById("save").addEventListener("tap", function(){
- var record_date = document.getElementById("date").value;
- var val_h = document.getElementById("val_h").value;
- var val_l = document.getElementById("val_l").value;
- lastDate = record_date.substring(0,10);
- if(!record_date){
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请选择记录时间'}).show();
- return ;
- }
- var p = /^[1-9]([0-9])*$/;
- if(!val_h || !p.test(val_h)){
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请输入收缩压,数值为正整数'}).show();
- return ;
- }
- if(!val_l || !p.test(val_l)){
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请输入舒张压,数值为正整数'}).show();
- return ;
- }
- if (id) {
- editHealthData( eSuccFun, 2, id, record_date,val_h, val_l);
- } else {
- //发送请求到服务器
- addHealthIndex("", record_date+":00", val_h,val_l, 0, 0, 0, 0, 0, 2, eSuccFun);
- }
- })
- //保存回调
- function eSuccFun (res) {
- dd.close();
- if (res.status == 200) {
- dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'保存成功'}).show();
- setTimeout(function () {
- var origin = Request['origin']
- if(origin=="suifang"){
- window.history.back()
- }else{
- window.location.href='xueya-view.html?dateT=' + lastDate;
- }
- },1000)
- } else {
- dialog({contentType:'tipsbox', skin:'bk-popup', content:'保存失败'}).show();
- }
- }
- //查询预警
- sendPost("patient/device/getDeviceStandard", {type:2}, "json", "get",null,function(res){
- if (res.status == 200){
- var list = res.data
- document.getElementById("minValue1").innerHTML = list.minValueSSY;
- document.getElementById("maxValue1").innerHTML = list.maxValueSSY;
- document.getElementById("minValue2").innerHTML = list.minValueSZY;
- document.getElementById("maxValue2").innerHTML = list.maxValueSZY;
- }else{
- dialog({contentType:'tipsbox', skin:'bk-popup', content:'获取预警值失败'}).show();
- }
- })
- }
- </script>
- </html>
|