health-index-add-bloodpressure.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  5. <meta charset="utf-8">
  6. <title>添加血压</title>
  7. <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
  8. <link rel="stylesheet" type="text/css" href="../../../iconfont/iconfont.css" />
  9. <link rel="stylesheet" type="text/css" href="../css/ss-style.css" />
  10. <link rel="stylesheet" type="text/css" href="../../../css/cross.ui.css" />
  11. <link rel="stylesheet" type="text/css" href="../css/zx-style.css">
  12. </head>
  13. <body>
  14. <div class="c-main">
  15. <div class="wis-fix c-border-b mt15">
  16. <ul class="c-list patient-list c-border-t mt fosx-li" data-list="patientInfo">
  17. <li>
  18. <div class="c-list-value pr30" style="width: 100px;">
  19. <h4><em class="star"></em>记录对象</h4>
  20. </div>
  21. <div class="c-list-info">
  22. <div class="input-group width-100">
  23. <input type="text" class="form-control width-100 no-border" style="background: #FFFFFF;" readonly="readonly" data-code="" id="member">
  24. </div>
  25. </div>
  26. </li>
  27. <li>
  28. <div class="c-list-value pr30" style="width: 100px;">
  29. <h4><em class="star"></em>记录时间</h4>
  30. </div>
  31. <div class="c-list-info">
  32. <div class="input-group width-100">
  33. <input type="text" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入记录时间" data-time="date" value="" id="date">
  34. <span class="form-select-arrow"></span>
  35. </div>
  36. </div>
  37. </li>
  38. <li>
  39. <div class="c-list-value pr30" style="width: 100px;">
  40. <h4><em class="star"></em>收缩压(高压)</h4>
  41. </div>
  42. <div class="c-list-info">
  43. <div class="input-group width-100">
  44. <input type="number" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入数值" value="" id="val_h">
  45. </div>
  46. </div>
  47. </li>
  48. <li>
  49. <div class="c-list-value pr30" style="width: 100px;">
  50. <h4><em class="star"></em>舒张压(低压)</h4>
  51. </div>
  52. <div class="c-list-info">
  53. <div class="input-group width-100">
  54. <input type="number" class="form-control width-100 no-border" style="background: #FFFFFF;" placeholder="请输入数值" value="" id="val_l">
  55. </div>
  56. </div>
  57. </li>
  58. </ul>
  59. </div>
  60. <p class="c-f16 c5b plr15 pt10">收缩压 正常范围:<span id="minValue1"></span>-<span id="maxValue1"></span>mmHg</p>
  61. <p class="c-f16 c5b plr15 pt10">舒张压 正常范围:<span id="minValue2"></span>-<span id="maxValue2"></span>mmHg</p>
  62. <div class="bottom-box clearfix mt20 plr15">
  63. <a href="javascript:;" id="save" class="c-btn-full c-btn-75BF00 c-btn-radius fl c-f18">保存</a>
  64. </div>
  65. </div>
  66. </body>
  67. <script src="../../../js/jquery/2.1.3/jquery.js"></script>
  68. <script type="text/javascript" src="../../../js/mui.min.js"></script>
  69. <script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  70. <link rel="stylesheet" type="text/css" href="../../../widget/artDialog/6.0.5/css/ui-dialog.min.css">
  71. <script src="../../../widget/artDialog/6.0.5/js/dialog-plus.min.js"></script>
  72. <script src="../../../js/common_http.js"></script>
  73. <script type="text/javascript" src="../../../js/weixin_common.js" ></script>
  74. <link rel="stylesheet" type="text/css" href="../../../widget/mobiscroll/2.15.1/css/mobiscroll.css">
  75. <link rel="stylesheet" type="text/css" href="../css/mobiscroll_numpad.css"/>
  76. <script src="../js/mobiscroll-2.17.1.js" type="text/javascript" charset="utf-8"></script>
  77. <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
  78. <script type="text/javascript" src="../../../js/isRepresented.js"></script>
  79. <script src="../js/health-index.js"></script>
  80. <script>
  81. var Request = GetRequest();
  82. $(function() {
  83. isRepresent(function(){
  84. var userAgent = JSON.parse(window.localStorage.getItem(agentName));
  85. sendPost("patient/family/authorize_members",{}, "json", "get",null,function(res){
  86. if(res.status == 200){
  87. if(res.data.length > 0){
  88. var data=res.data;
  89. var $member = $('#member')
  90. //关联被代理人
  91. if(userAgent.represented){
  92. var one = _.find(data,function(item){return item.code == userAgent.represented;})
  93. $member.attr('data-code',one.code);
  94. $member.val(one.name);
  95. }else{
  96. var one = _.find(data,function(item){return item.code == userAgent.uid;})
  97. $member.attr('data-code',one.code);
  98. $member.val(one.name);
  99. }
  100. nextWork()
  101. }else{
  102. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'获取家庭成员数据失败'}).show();
  103. }
  104. }
  105. })
  106. })
  107. })
  108. function nextWork(){
  109. var id = Request['id'],
  110. code = decodeURIComponent(Request['type']),
  111. data = decodeURIComponent(Request['time']),
  112. val1 = decodeURIComponent(Request['val1']),
  113. val2 = decodeURIComponent(Request['val2']);
  114. var lastDate = '';
  115. /* 选择日期 */
  116. var opt1 = {
  117. preset: 'datetime',
  118. theme: 'ios',
  119. lang: 'zh',
  120. display: "bottom",
  121. minDate: new Date(1900, 01, 01),
  122. onSelect: function(valueText, inst) {
  123. valueText = valueText.replace("/","-").replace("/","-");
  124. $("#date").val(valueText);
  125. }
  126. };
  127. $('input[data-time=date]').mobiscroll(opt1);
  128. //初始化时间
  129. if (id) {
  130. var date = new Date(data.replace(/\-/g, "/"))
  131. $("#date").val(date.Format("yyyy-MM-dd HH:mm"));
  132. } else {
  133. var date = new Date()
  134. $("#date").val(date.Format("yyyy-MM-dd HH:mm"));
  135. }
  136. $('#val_h').val(val1);
  137. $('#val_l').val(val2);
  138. $("input[type=number]").mobiscroll().numpad({
  139. theme: 'ios',
  140. display: 'bottom',
  141. lang: 'zh',
  142. placeholder: '0',
  143. fill: 'rtl',
  144. allowLeadingZero: true,
  145. maxLength: 6,
  146. maxScale: 2,
  147. template: 'ddd',
  148. buttons: ['set','cancel'],
  149. onSelect: function(valueText, inst){
  150. var value = parseFloat(valueText);
  151. $(this).val(value);
  152. }
  153. })
  154. //保存
  155. document.getElementById("save").addEventListener("tap", function(){
  156. var record_date = document.getElementById("date").value;
  157. var val_h = document.getElementById("val_h").value;
  158. var val_l = document.getElementById("val_l").value;
  159. lastDate = record_date.substring(0,10);
  160. if(!record_date){
  161. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请选择记录时间'}).show();
  162. return ;
  163. }
  164. var p = /^[1-9]([0-9])*$/;
  165. if(!val_h || !p.test(val_h)){
  166. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请输入收缩压,数值为正整数'}).show();
  167. return ;
  168. }
  169. if(!val_l || !p.test(val_l)){
  170. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'请输入舒张压,数值为正整数'}).show();
  171. return ;
  172. }
  173. if (id) {
  174. editHealthData( eSuccFun, 2, id, record_date,val_h, val_l);
  175. } else {
  176. //发送请求到服务器
  177. addHealthIndex("", record_date+":00", val_h,val_l, 0, 0, 0, 0, 0, 2, eSuccFun);
  178. }
  179. })
  180. //保存回调
  181. function eSuccFun (res) {
  182. dd.close();
  183. if (res.status == 200) {
  184. dialog({contentType:'tipsbox',bottom:true, skin:'bk-popup' , content:'保存成功'}).show();
  185. setTimeout(function () {
  186. var origin = Request['origin']
  187. if(origin=="suifang"){
  188. window.history.back()
  189. }else{
  190. window.location.href='xueya-view.html?dateT=' + lastDate;
  191. }
  192. },1000)
  193. } else {
  194. dialog({contentType:'tipsbox', skin:'bk-popup', content:'保存失败'}).show();
  195. }
  196. }
  197. //查询预警
  198. sendPost("patient/device/getDeviceStandard", {type:2}, "json", "get",null,function(res){
  199. if (res.status == 200){
  200. var list = res.data
  201. document.getElementById("minValue1").innerHTML = list.minValueSSY;
  202. document.getElementById("maxValue1").innerHTML = list.maxValueSSY;
  203. document.getElementById("minValue2").innerHTML = list.minValueSZY;
  204. document.getElementById("maxValue2").innerHTML = list.maxValueSZY;
  205. }else{
  206. dialog({contentType:'tipsbox', skin:'bk-popup', content:'获取预警值失败'}).show();
  207. }
  208. })
  209. }
  210. </script>
  211. </html>