yuliang 5 年之前
父節點
當前提交
61282adc68

+ 15 - 21
whepi-ui/templates/home/ribao.ftl

@@ -50,47 +50,41 @@
                         <input id="js_input_user_status" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh; width: 75%;" />
                     </div>
                     <textarea id="jibenmiaoshu" class="weui-textarea" placeholder="身体基本状况描述" rows="5" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>
+
+                    <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">病情描述</div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">病情描述</div>
-                        <div style="width: 70%;display:flex; flex-direction: row;">
-                            <div style="color: gray;height: 5vh; line-height: 5vh;margin-right: 5vw;">是否确诊</div>
-                            <input hidden="hidden" name="switchQuezhen" id="switchQuezhen" value="off" type="radio" checked="checked"/>
-                            <div class="weui-cell__ft">
-                                <input class="weui-switch" type="checkbox" id="rb_switch" name="rb_switch">
-                            </div>
-                        </div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">是否确诊</div>
+                        <input id="switchQuezhen" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">体温</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">是否单间隔离</div>
+                        <input id="switchDanjiangeli" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
+                    </div>
+
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">体温</div>
                         <input id="js_input_user_tiwen" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">咳嗽</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">咳嗽</div>
                         <input id="js_input_user_kesou" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 30%;">肌肉酸痛</div>
+                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 40%;">肌肉酸痛</div>
                         <input id="js_input_user_jirou" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 30%;">呼吸困难</div>
+                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 40%;">呼吸困难</div>
                         <input id="js_input_user_huxi" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">乏力</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">乏力</div>
                         <input id="js_input_user_fali" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">腹泻</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">腹泻</div>
                         <input id="js_input_user_fuxie" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
-                    <div style="display:flex; flex-direction: row; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; margin-right: 2vw;">是否单间隔离</div>
-                        <input hidden="hidden" name="js_input_user_danjiangeli" id="switchQuezhen" value="off" type="radio" checked="checked"/>
-                        <div class="weui-cell__ft">
-                            <input class="weui-switch" type="checkbox" id="rb_switch_2" name="rb_switch">
-                        </div>
-                    </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                         <div style="color: gray;height: 5vh; line-height: 5vh;margin-right: 2vw;width: 13%;">其他</div>
                         <textarea id="shuruqita" class="weui-textarea" placeholder="输入内容(300字内)" rows="5" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>

+ 157 - 75
whepi-ui/templates/home/ribao.js

@@ -1,6 +1,6 @@
 function ribao_init() {
 
-  $("#js_input_user_sex").val("女");   //设置初始值
+  // $("#js_input_user_sex").val(getGreder(2));   //设置初始值
 
   $('#btnRB').on('click', function () {
     window.location.href = "/yeweihui/home.html";
@@ -125,19 +125,6 @@ function ribao_init() {
       }]
   });
 
-  $("#js_input_user_danjiangeli").select({
-    title: "是否单间隔离",
-    items: [
-      {
-        title: "是",
-        value: "0",
-      },
-      {
-        title: "否",
-        value: "1",
-      }]
-  });
-
   $("#js_input_user_fali").select({
     title: "选择乏力情况",
     items: [
@@ -167,34 +154,63 @@ function ribao_init() {
         value: "0",
       },
       {
-        title: "轻度腹泻少于3次",
-        value: "2",
+        title: "轻度腹泻(少于3次)",
+        value: "1",
       },
       {
-        title: "中度腹泻4-6次",
-        value: "3",
+        title: "中度腹泻(4-6次)",
+        value: "2",
       },
       {
-        title: "重度腹泻超过6次",
-        value: "4",
+        title: "重度腹泻(超过6次)",
+        value: "3",
       }]
   });
 
-  $("#rb_switch").bind("click", function () {
-    if ($("#switchQuezhen").val() == "off") {
-      $("#switchQuezhen").val("on");
-    } else {
-      $("#switchQuezhen").val("off");
-    }
+  $("#switchQuezhen").select({
+    title: "选择是否确诊",
+    items: [
+      {
+        title: "否",
+        value: "0",
+      },
+      {
+        title: "是",
+        value: "1",
+      }]
   });
-
-  $("#rb_switch2").bind("click", function () {
-    if ($("#js_input_user_danjiangeli").val() == "off") {
-      $("#js_input_user_danjiangeli").val("on");
-    } else {
-      $("#js_input_user_danjiangeli").val("off");
-    }
+  $("#switchDanjiangeli").select({
+    title: "选择是否单间隔离",
+    items: [
+      {
+        title: "否",
+        value: "0",
+      },
+      {
+        title: "是",
+        value: "1",
+      }]
   });
+  //
+  // updateSuspected({
+  //   userName : 'www',
+  //   grender : 2,
+  //   age : 34,
+  //   familyStatus : 1,
+  //   statusDesp : "",
+  //   medical:0,
+  //   singleRoom:1,
+  //   temperature:0,
+  //   cough:2,
+  //   muscle:1,
+  //   dyspnea:1,
+  //   fatigue:1,
+  //   diarrhea:2,
+  //   others:""
+  // })
+  //
+  // var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
+  // console.log("grender:" + grender)
 }
 
 //近日报告
@@ -260,19 +276,18 @@ function ribao_cell(v) {
   var grender = getGreder(v.grender);
   var age = v.age;
   var familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
-  var medical = "是否确诊:" + getGreder(v.grender) + ";";
+  var medical = "是否确诊:" + getMedical(v.medical) + ";";
+  var singleRoom = "是否单间隔离:"+ getSingleRoom(v.singleRoom) + ";";
   var temperature = "体温:" + v.temperature + ";";
   var cough = "咳嗽:" + getCough(v.cough) + ";";
   var muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
   var dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
-  var chest = "胸闷:" + getChest(v.chest) + ";";
   var fatigue = "乏力:" + getFatigue(v.fatigue) + ";";
   var diarrhea = "腹泻:" + getDiarrhea(v.diarrhea) + ";";
-  var diarrheaNum = "腹泻次数:" + v.diarrheaNum + "次;";
   var others = "其他:" + v.others;
   $('#rb_family').append($('<div class="weui-media-box weui-media-box_text">\n' +
     '                                      <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'deleteSuspected(' + JSON.stringify(v.suspectedId) + ')\'>删除</a></h4>\n' +
-    '                                      <p class="weui-media-box__desc">' + familyStatus + medical + temperature + cough + muscle + dyspnea + chest + fatigue + diarrhea + diarrheaNum + others + '</p>\n' +
+    '                                      <p class="weui-media-box__desc">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + '</p>\n' +
     '                                    </div>\n' +
     '                              '));
 }
@@ -319,25 +334,45 @@ function ribaoCommit() {
   //     "乏力", $("#js_input_user_fali").val(),
   //     "腹泻", $("#js_input_user_fuxie").val(),
   //     "次数", $("#js_input_user_cishu").val(),
-  //     "其他", $("#shuruqita").val(),
+  //     "其他", $("#shuruqita").val()
   // );
   // return;
+
+
+
   var userId = $("#userId").val();
   var userName = $("#js_input_user_name").val();
   var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
-  var age = $("#js_input_user_age").val()== "" ? 0 :  $("#js_input_user_age").val();
+  var age = $("#js_input_user_age").val();
   var familyStatus = $("#js_input_user_status").attr("data-values") == undefined ? 0 : $("#js_input_user_status").attr("data-values");
   var statusDesp = $("#jibenmiaoshu").val()== undefined ? "" : $("#jibenmiaoshu").val();
-  var medical = $("#switchQuezhen").val() == "on" ? 1 : 0;
+  var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
+  var singleRoom = $("#switchDanjiangeli").attr("data-values") == undefined ? 0 : $("#switchDanjiangeli").attr("data-values");
   var temperature = $("#js_input_user_tiwen").val()== "" ? 0 : $("#js_input_user_tiwen").val();
   var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
   var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
   var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
-  var chest = $("#js_input_user_xiongmen").attr("data-values") == undefined ? 0 : $("#js_input_user_xiongmen").attr("data-values");
   var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
   var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
-  var diarrheaNum = $("#js_input_user_cishu").val()== "" ? 0 : $("#jibenmiaoshu").val();
   var others = $("#shuruqita").val()== undefined ? "" : $("#jibenmiaoshu").val();
+
+  if (userName == undefined || userName == '') {
+    alert("请填写姓名");
+    return;
+  }
+  if (age == undefined || age == '') {
+    alert("请填写年龄");
+    return;
+  }
+  if (grender == 0) {
+    alert("请填写性别");
+    return;
+  }
+  if (temperature <= 0) {
+    alert("请填写体温");
+    return;
+  }
+
   $.ajax({
     url: '/home/addRibao',
     type: "post",
@@ -349,14 +384,13 @@ function ribaoCommit() {
       "familyStatus": familyStatus,
       "statusDesp": statusDesp,
       "medical": medical,
+      "singleRoom" : singleRoom,
       "temperature": temperature,
       "cough": cough,
       "muscle": muscle,
       "dyspnea": dyspnea,
-      "chest": chest,
       "fatigue": fatigue,
       "diarrhea": diarrhea,
-      "diarrheaNum": diarrheaNum,
       "others": others,
     },
     success: function (data) {
@@ -385,6 +419,55 @@ function deleteSuspected(suspectedId) {
   });
 }
 
+function updateSuspected(suspectedId) {
+  $.ajax({
+    url: '/home/updateSuspected',
+    get: "post",
+    data: {
+      "suspectedId": suspectedId
+    },
+    success: function (data) {
+      if (data.data) {
+        var suspected = data.data;
+        $("#js_input_user_sex").val(getGreder(suspected.grender));
+        $("#js_input_user_sex").attr("data-values",suspected.grender);
+        $("#js_input_user_name").val(suspected.userName);
+        $("#js_input_user_age").val(suspected.age);
+        $("#js_input_user_status").val(getFamilyStatus(suspected.familyStatus));
+        $("#js_input_user_status").attr("data-values",suspected.familyStatus);
+
+        $("#jibenmiaoshu").val(suspected.statusDesp);
+
+        $("#switchQuezhen").val(getMedical(suspected.medical));
+        $("#switchQuezhen").attr("data-values",suspected.familyStatus);
+
+        $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
+        $("#switchDanjiangeli").attr("data-values",suspected.familyStatus);
+
+        $("#js_input_user_tiwen").val( suspected.temperature);
+
+        $("#js_input_user_kesou").val(getCough(suspected.cough));
+        $("#js_input_user_kesou").attr("data-values",suspected.cough);
+
+        $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
+        $("#js_input_user_jirou").attr("data-values",suspected.muscle);
+
+        $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
+        $("#js_input_user_huxi").attr("data-values",suspected.dyspnea);
+
+        $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
+        $("#js_input_user_fali").attr("data-values",suspected.fatigue);
+
+        $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
+        $("#js_input_user_fuxie").attr("data-values",suspected.diarrhea);
+
+        $("#shuruqita").val(suspected.others);
+      }
+    },
+  });
+
+}
+
 
 function addReport() {
   var userId = $("#userId").val();
@@ -446,19 +529,18 @@ function helpValue1(v) {
   var grender = getGreder(v.grender);
   var age = v.age;
   var familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
-  var medical = "是否确诊:" + getGreder(v.grender) + ";";
+  var medical = "是否确诊:" + getMedical(v.medical) + ";";
+  var singleRoom = "是否单间隔离:"+ getSingleRoom(v.singleRoom) + ";";
   var temperature = "体温:" + v.temperature + ";";
   var cough = "咳嗽:" + getCough(v.cough) + ";";
   var muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
   var dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
-  var chest = "胸闷:" + getChest(v.chest) + ";";
   var fatigue = "乏力:" + getFatigue(v.fatigue) + ";";
   var diarrhea = "腹泻:" + getDiarrhea(v.diarrhea) + ";";
-  var diarrheaNum = "腹泻次数:" + v.diarrheaNum + "次;";
   var others = "其他:" + v.others;
   $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text">\n' +
     '                                      <h4 class="weui-media-box__title">'  + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age  + '</h4>\n' +
-    '                                      <p class="weui-media-box__desc">' +familyStatus + medical + temperature + cough + muscle + dyspnea + chest + fatigue + diarrhea + diarrheaNum + others  + '</p>\n' +
+    '                                      <p class="weui-media-box__desc">' +familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + diarrheaNum + others  + '</p>\n' +
     '                                    </div>\n' +
     '                              '));
 }
@@ -500,9 +582,9 @@ function getCough(cough) {
   else if (cough == 1)
     return "偶尔短暂咳嗽";
   else if (cough == 2)
-    return "频繁咳嗽轻度影响生活";
+    return "咳嗽轻度影响生活";
   else if (cough == 3)
-    return "频繁咳嗽重影响生活";
+    return "咳嗽重影响生活";
   return "";
 }
 
@@ -510,11 +592,11 @@ function getMuscle(muscle) {
   if (muscle == 0)
     return "无";
   else if (muscle == 1)
-    return "加重";
+    return "按压有";
   else if (muscle == 2)
-    return "好转";
+    return "偶尔";
   else if (muscle == 3)
-    return "无变化";
+    return "持续有";
   return "";
 }
 
@@ -522,25 +604,13 @@ function getDyspnea(dyspnea) {
   if (dyspnea == 0)
     return "无";
   else if (dyspnea == 1)
-    return "加重";
+    return "急走或上坡气短";
   else if (dyspnea == 2)
-    return "好转";
+    return "气短而走路变慢";
   else if (dyspnea == 3)
-    return "无变化";
+    return "走路数分钟后气短";
   else if (dyspnea == 4)
-    return "严重";
-  return "";
-}
-
-function getChest(chest) {
-  if (chest == 0)
-    return "无";
-  else if (chest == 1)
-    return "端坐呼吸";
-  else if (chest == 2)
-    return "活动无耐力";
-  else if (chest == 3)
-    return "无变化";
+    return "气短无法离开房间";
   return "";
 }
 
@@ -548,19 +618,27 @@ function getFatigue(fatigue) {
   if (fatigue == 0)
     return "无";
   else if (fatigue == 1)
-    return "加重";
+    return "可体力劳动但觉得累";
   else if (fatigue == 2)
-    return "好转";
+    return "轻体力劳动后长时间不能恢复";
   else if (fatigue == 3)
-    return "无变化";
+    return "不能正常生活";
   return "";
 }
 
 function getMedical(medical) {
   if (medical == 0)
-    return "为确诊";
+    return "";
   else if (medical == 1)
-    return "确诊";
+    return "是";
+  return "";
+}
+
+function getSingleRoom(singleRoom) {
+  if (singleRoom == 0)
+    return "否";
+  else if (singleRoom == 1)
+    return "是";
   return "";
 }
 
@@ -569,7 +647,11 @@ function getDiarrhea(diarrhea) {
   if (diarrhea == 0)
     return "无";
   else if (diarrhea == 1)
-    return "有";
+    return "轻度腹泻(少于3次)";
+  else if (diarrhea == 2)
+    return "中度腹泻(4-6次)";
+  else if (diarrhea == 3)
+    return "重度腹泻(超过6次)";
   return "";
 }
 

+ 1 - 1
whepi-ui/templates/user/changeRole.ftl

@@ -13,7 +13,7 @@
                         <br/>
                         <h1 class="user-title">家园抗击疫情公共服务平台</h1>
                         <br/>
-                        <h1 class="user-title"><#if user ??>${user.nickName!''}</#if>登</h1>
+                        <h1 class="user-title"><#if user ??>${user.nickName!''}</#if>登</h1>
                         <br/>
                         <br/>
                         <br/>

+ 1 - 1
whepi-ui/templates/yeweihui/ribao.ftl

@@ -79,7 +79,7 @@
                     var td;
 
                     if(v.msStatus == 2 && v.reportStatus == 1){//异常
-                        td = '<td style="background-color: yellow" align="center" value="'+v.houseId+'"><a style="height: 100%;width: 100%;background-color: yellow" onclick=\'ribao_ycxq('+JSON.stringify(v.houseId) +');\'>'+v.doorplate+'</a></td>';
+                        td = '<td style="background-color: green" align="center" value="'+v.houseId+'"><p style="height: 100%;width: 100%;background-color: yellow" onclick=\'ribao_ycxq('+JSON.stringify(v.houseId) +');\'>'+v.doorplate+'</p></td>';
                     }else if(v.msStatus != 2 && v.reportStatus == 1 && v.msStatus != null && v.reportStatus !=null){//已报
                         td = '<td style="background-color: #0bb20c" align="center">'+v.doorplate+'</td>';
                     }else if(v.reportStatus == 1 || v.reportStatus == 0){//待报