ribao.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853
  1. function ribao_init() {
  2. var xxIds = [];
  3. var xxName = [
  4. "序号",
  5. "出发地",
  6. "目的地",
  7. "出行方式",
  8. "车次/航班/车牌",
  9. "操作"
  10. ];
  11. for (var i = 0; i < xxName.length; i++) {
  12. xxIds.push({
  13. name: xxName[i]
  14. });
  15. }
  16. var html = "<tr style='background-color: #f8f8f8;'>";
  17. for (var i = 0; i < xxIds.length; i++) {
  18. // alert(xxIds[i].name);
  19. html += "<th>" + xxIds[i].name + "</th>";
  20. }
  21. html +="</tr>"
  22. for (var i = 0; i < 10; i++) {//后端传过来的集合遍历
  23. if (i % 2 != 0) {
  24. html += "<tr style='background-color: #f8f8f8;'>";
  25. }
  26. else {
  27. html += "<tr>";
  28. }
  29. html += "<td style='text-align: center;'>" + (i + 1) + "</td>";
  30. // var isValue = false; //记录是否赋值
  31. html += "<td style='text-align: center;' >" + "mao" + " </td>";
  32. html += "<td style='text-align: center;' >" + "mao" + " </td>";
  33. html += "<td style='text-align: center;' >" + "mao" + " </td>";
  34. html += "<td style='text-align: center;' >" + "mao" + " </td>";
  35. html += "<td style='text-align: center;' ><button style='height:3vh;background-color: red;text-align: center;' class='weui-btn weui-btn_mini weui-btn_primary'>" + "删除" + " </button></td>";
  36. html += "</tr>";
  37. $("#tabtr").html(html);
  38. }
  39. $('#btnRB').on('click', function () {
  40. window.location.href = "/yeweihui/home.html";
  41. });
  42. $("#js_input_gzzd").select({
  43. title: "选择工作驻地",
  44. items: [
  45. {
  46. title: "武汉市",
  47. value: "1",
  48. },
  49. {
  50. title: "宜昌市",
  51. value: "2",
  52. },
  53. {
  54. title: "当阳市",
  55. value: "3",
  56. }]
  57. });
  58. $("#js_input_jrszd").select({
  59. title: "选择今日所在地",
  60. items: [
  61. {
  62. title: "武汉市",
  63. value: "1",
  64. }, {
  65. title: "宜昌市",
  66. value: "2",
  67. },
  68. {
  69. title: "当阳市",
  70. value: "3",
  71. },
  72. {
  73. title: "其它地点",
  74. value: "4",
  75. }]
  76. });
  77. $("#js_input_sf").select({
  78. title: "",
  79. items: [
  80. {
  81. title: "是",
  82. value: "1",
  83. },
  84. {
  85. title: "否",
  86. value: "2",
  87. }]
  88. });
  89. $("#js_input_cfd").select({
  90. title: "选择出发地",
  91. items: [
  92. {
  93. title: "武汉市",
  94. value: "1",
  95. }, {
  96. title: "宜昌市",
  97. value: "2",
  98. },
  99. {
  100. title: "当阳市",
  101. value: "3",
  102. },
  103. {
  104. title: "其它地点",
  105. value: "4",
  106. }]
  107. });
  108. $("#js_input_mdd").select({
  109. title: "选择目的地",
  110. items: [
  111. {
  112. title: "武汉市",
  113. value: "1",
  114. }, {
  115. title: "宜昌市",
  116. value: "2",
  117. },
  118. {
  119. title: "当阳市",
  120. value: "3",
  121. },
  122. {
  123. title: "其它地点",
  124. value: "4",
  125. }]
  126. });
  127. $("#js_input_cxfs").select({
  128. title: "选择出行方式",
  129. items: [
  130. {
  131. title: "自驾",
  132. value: "1",
  133. },
  134. {
  135. title: "飞机",
  136. value: "2",
  137. },
  138. {
  139. title: "火车",
  140. value: "3",
  141. },
  142. {
  143. title: "长途汽车",
  144. value: "4",
  145. }]
  146. });
  147. }
  148. function selectinput(obj){
  149. alert($("#js_input_gzzd").attr("data-values"))
  150. }
  151. //近日报告
  152. function ribaoInitialization(reportId) {
  153. if (reportId == null)
  154. return;
  155. $.ajax({
  156. url: '/home/home/queryRibaoRefresh',
  157. data: {
  158. reportId: reportId
  159. },
  160. type: 'GET',
  161. success: function (data) {
  162. console.log(data);
  163. if (data.data.length > 0) {
  164. hasData = true;
  165. data.data.forEach(function (v) {
  166. ribao_cell(v);
  167. });
  168. }
  169. },
  170. error: function () {
  171. }
  172. });
  173. }
  174. //刷新今日日报
  175. function ribao_refrash() {
  176. var userId = $("#userId").val();
  177. $.ajax({
  178. url: '/home/home/queryRibao',
  179. data: {
  180. userCreate: userId
  181. },
  182. type: 'GET',
  183. success: function (data) {
  184. console.log(data);
  185. if (data.data == undefined) {
  186. $('#rb_family').empty();
  187. }
  188. else {
  189. $('#rb_family').empty();
  190. if (data.data.length > 0) {
  191. hasData = true;
  192. data.data.forEach(function (v) {
  193. ribao_cell(v);
  194. });
  195. } else {
  196. }
  197. }
  198. },
  199. error: function () {
  200. }
  201. });
  202. }
  203. function ribao_cell(v) {
  204. var userName = v.userName + ":";
  205. var grender = getGreder(v.grender);
  206. var age = v.age;
  207. var familyStatus = "";
  208. if (v.familyStatus != 0)
  209. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  210. var medical = "";
  211. if (v.medical != 0)
  212. medical = "是否确诊:" + getMedical(v.medical) + ";";
  213. var singleRoom = "";
  214. if (v.singleRoom != 0)
  215. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  216. if (v.singleRoom == 0 && v.medical != 0)
  217. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  218. var temperature = "体温:" + v.temperature + ";";
  219. var cough = "";
  220. if (v.cough != 0)
  221. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  222. var muscle = "";
  223. if (v.muscle != 0)
  224. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  225. var dyspnea = "";
  226. if (v.dyspnea != 0)
  227. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  228. var fatigue = "";
  229. if (v.fatigue != 0)
  230. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  231. var diarrhea = "";
  232. if (v.diarrhea != 0)
  233. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  234. var others = "";
  235. if (v.others != "")
  236. others = "其他描述:" + v.others + ";";
  237. var scoreRezult = "";
  238. if (v.scoreRezult != 0)
  239. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  240. $('#rb_family').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
  241. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #bc4246" onclick=\'deleteSuspected(' + JSON.stringify(v.suspectedId) + ')\'>删除</a>\n' +
  242. ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改</a></h4>\n' +
  243. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
  244. ' </div>\n' +
  245. ' '));
  246. }
  247. function ribao_cancel() {
  248. $('#cancel').on('click', function () {
  249. if ($('#ribao')[0].style.display == 'none') {
  250. $('#notOpenRibao').toggle();
  251. $('#ribao')[0].style.display = '';
  252. } else {
  253. $('#notOpenRibao')[0].style.display = '';
  254. $('#ribao')[0].style.display = 'none';
  255. }
  256. clearShow();
  257. });
  258. }
  259. function ribaoCommit() {
  260. var suspectedId = $("#suspectedId").val();
  261. var userId = $("#userId").val();
  262. var userName = $("#js_input_user_name").val();
  263. var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
  264. var age = $("#js_input_user_age").val();
  265. //不能同时选择服用和未服用
  266. if ($("input[name='checkbox1']:checked").val() == "on" && $("input[name='checkbox2']:checked").val() == "on") {
  267. $.alert("心脑血管不能同时选择服用和未服用");
  268. return;
  269. }
  270. //男性不能选择妊娠期
  271. if ($("#js_input_user_sex").attr("data-values") == 1 && $("input[name='checkbox7']:checked").val() == "on") {
  272. $.alert("男性不能选择妊娠期");
  273. return;
  274. }
  275. //家庭状态
  276. var familyStatus = "";
  277. if ($("input[name='checkbox1']:checked").val() == "on")
  278. familyStatus += "1";
  279. else
  280. familyStatus += "0";
  281. if ($("input[name='checkbox2']:checked").val() == "on")
  282. familyStatus += ",1";
  283. else
  284. familyStatus += ",0";
  285. if ($("input[name='checkbox3']:checked").val() == "on")
  286. familyStatus += ",1";
  287. else
  288. familyStatus += ",0";
  289. if ($("input[name='checkbox4']:checked").val() == "on")
  290. familyStatus += ",1";
  291. else
  292. familyStatus += ",0";
  293. if ($("input[name='checkbox5']:checked").val() == "on")
  294. familyStatus += ",1";
  295. else
  296. familyStatus += ",0";
  297. if ($("input[name='checkbox6']:checked").val() == "on")
  298. familyStatus += ",1";
  299. else
  300. familyStatus += ",0";
  301. if ($("input[name='checkbox7']:checked").val() == "on")
  302. familyStatus += ",1";
  303. else
  304. familyStatus += ",0";
  305. //var familyStatus = $("#js_input_user_status").attr("data-values") == undefined ? 0 : $("#js_input_user_status").attr("data-values");
  306. //var statusDesp = $("#jibenmiaoshu").val() == undefined ? "" : $("#jibenmiaoshu").val();
  307. var statusDesp = "";
  308. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  309. var singleRoom = $("#switchDanjiangeli").attr("data-values") == undefined ? 0 : $("#switchDanjiangeli").attr("data-values");
  310. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  311. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  312. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  313. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  314. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  315. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  316. var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
  317. var scoreRezult = $("#js_input_score_rezult_value").val() == undefined ? "" : $("#js_input_score_rezult_value").val();
  318. var temperatureScore = $("#js_input_temperature_score").val() == undefined ? "" : $("#js_input_temperature_score").val();
  319. var scoreHistroy = $("#js_input_score_histroy").val() == undefined ? "" : $("#js_input_score_histroy").val();
  320. var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
  321. if (userName == undefined || userName == '') {
  322. $.alert("请填写姓名");
  323. return;
  324. }
  325. if (grender == 0) {
  326. $.alert("请填写性别");
  327. return;
  328. }
  329. if (age == undefined || age == '') {
  330. $.alert("请填写年龄");
  331. return;
  332. }
  333. if (age > 150 || age < 0) {
  334. $.alert("请填写正确的年龄");
  335. return;
  336. }
  337. if (temperature <= 0) {
  338. $.alert("请填写体温");
  339. return;
  340. }
  341. if (temperature > 50 || temperature < 30) {
  342. $.alert("请填写正确的体温");
  343. return;
  344. }
  345. $.ajax({
  346. url: '/home/addRibao',
  347. type: "post",
  348. data: {
  349. "suspectedId": suspectedId,
  350. "userCreate": userId,
  351. "userName": userName,
  352. "grender": grender,
  353. "age": age,
  354. "familyStatus": familyStatus,
  355. "statusDesp": statusDesp,
  356. "medical": medical,
  357. "singleRoom": singleRoom,
  358. "temperature": temperature,
  359. "cough": cough,
  360. "muscle": muscle,
  361. "dyspnea": dyspnea,
  362. "fatigue": fatigue,
  363. "diarrhea": diarrhea,
  364. "others": others,
  365. "scoreRezult": scoreRezult,
  366. "temperatureScore": temperatureScore,
  367. "scoreHistroy": scoreHistroy,
  368. "score": score,
  369. },
  370. success: function (data) {
  371. if (data.msgReport == "2") {
  372. $.toast("家人姓名不能重复,如果重复,可以带上称呼");
  373. return;
  374. }
  375. if ($('#ribao')[0].style.display == 'none') {
  376. $('#notOpenRibao').toggle();
  377. $('#ribao')[0].style.display = '';
  378. } else {
  379. $('#notOpenRibao')[0].style.display = '';
  380. $('#ribao')[0].style.display = 'none';
  381. }
  382. $('#ribao_jinrijujian').empty();
  383. $('#ribao_jinrijujian').append(data.safetyNum);
  384. ribao_refrash();
  385. clearShow();
  386. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  387. },
  388. });
  389. }
  390. function deleteSuspected(suspectedId) {
  391. $.ajax({
  392. url: '/home/deleteSuspected',
  393. type: "post",
  394. data: {
  395. "suspectedId": suspectedId
  396. },
  397. success: function (data) {
  398. $('#ribao_jinrijujian').empty();
  399. $('#ribao_jinrijujian').append(data.safetyNum);
  400. ribao_refrash();
  401. },
  402. });
  403. }
  404. function updateSuspected(suspectedId) {
  405. $("#suspectedId").val("");
  406. if ($('#ribao')[0].style.display == 'none') {
  407. $('#notOpenRibao').toggle();
  408. $('#ribao')[0].style.display = '';
  409. } else {
  410. $('#notOpenRibao')[0].style.display = '';
  411. $('#ribao')[0].style.display = 'none';
  412. }
  413. $.ajax({
  414. url: '/home/selectSuspected',
  415. get: "get",
  416. data: {
  417. "suspectedId": suspectedId
  418. },
  419. success: function (data) {
  420. // console.log(data);
  421. if (data) {
  422. var suspected = data;
  423. $("#suspectedId").val(suspected.suspectedId);
  424. $("#js_input_user_sex").val(getGreder(suspected.grender));
  425. $("#js_input_user_sex").attr("data-values", suspected.grender);
  426. $("#js_input_user_name").val(suspected.userName);
  427. $("#js_input_user_age").val(suspected.age);
  428. //基本情况
  429. if (suspected.familyStatus != "") {
  430. var familyStatusList = suspected.familyStatus.split(",");
  431. if (familyStatusList[0] == 1)
  432. $("input[name='checkbox1']").prop("checked", "checked");
  433. else
  434. $("input[name='checkbox1']").removeAttr("checked");
  435. if (familyStatusList[1] == 1)
  436. $("input[name='checkbox2']").prop("checked", "checked");
  437. else
  438. $("input[name='checkbox2']").removeAttr("checked");
  439. if (familyStatusList[2] == 1)
  440. $("input[name='checkbox3']").prop("checked", "checked");
  441. else
  442. $("input[name='checkbox3']").removeAttr("checked");
  443. if (familyStatusList[3] == 1)
  444. $("input[name='checkbox4']").prop("checked", "checked");
  445. else
  446. $("input[name='checkbox4']").removeAttr("checked");
  447. if (familyStatusList[4] == 1)
  448. $("input[name='checkbox5']").prop("checked", "checked");
  449. else
  450. $("input[name='checkbox5']").removeAttr("checked");
  451. if (familyStatusList[5] == 1)
  452. $("input[name='checkbox6']").prop("checked", "checked");
  453. else
  454. $("input[name='checkbox6']").removeAttr("checked");
  455. if (familyStatusList[6] == 1)
  456. $("input[name='checkbox7']").prop("checked", "checked");
  457. else
  458. $("input[name='checkbox7']").removeAttr("checked");
  459. }
  460. // $("#js_input_user_status").val(getFamilyStatus(suspected.familyStatus));
  461. // $("#js_input_user_status").attr("data-values", suspected.familyStatus);
  462. // $("#jibenmiaoshu").val(suspected.statusDesp);
  463. $("#switchQuezhen").val(getMedical(suspected.medical));
  464. $("#switchQuezhen").attr("data-values", suspected.medical);
  465. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  466. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  467. $("#js_input_user_tiwen").val(suspected.temperature);
  468. $("#js_input_user_kesou").val(getCough(suspected.cough));
  469. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  470. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  471. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  472. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  473. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  474. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  475. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  476. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  477. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  478. $("#shuruqita").val(suspected.others);
  479. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  480. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  481. $("#js_input_temperature_score").val(suspected.temperatureScore);
  482. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  483. $("#js_input_score").val(suspected.score);
  484. }
  485. },
  486. });
  487. }
  488. $("#my-input-ribao").calendar({
  489. dateFormat: 'yyyy-mm-dd',
  490. inputReadOnly: false,
  491. onChange: function (p, values, displayValues) {
  492. var reportDate = values.toString();
  493. var userId = $("#userId").val();
  494. $.ajax({
  495. url: '/home/home/queryRibaoReportDate',
  496. data: {
  497. "userCreate": userId,
  498. "reportDate": reportDate,
  499. },
  500. type: 'GET',
  501. success: function (data) {
  502. if (data.data == undefined) {
  503. $('#ribao_famliy').empty();
  504. }
  505. else {
  506. if (data.data.length > 0) {
  507. $('#ribao_famliy').empty();
  508. data.data.forEach(function (v) {
  509. helpValue1(v);
  510. });
  511. } else {
  512. }
  513. }
  514. },
  515. error: function () {
  516. }
  517. });
  518. }
  519. });
  520. function helpValue1(v) {
  521. var userName = v.userName + ":";
  522. var grender = getGreder(v.grender);
  523. var age = v.age;
  524. var familyStatus = "";
  525. if (v.familyStatus != 0)
  526. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  527. var medical = "";
  528. if (v.medical != 0)
  529. medical = "是否确诊:" + getMedical(v.medical) + ";";
  530. var singleRoom = "";
  531. if (v.singleRoom != 0)
  532. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  533. if (v.singleRoom == 0 && v.medical != 0)
  534. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  535. var temperature = "体温:" + v.temperature + ";";
  536. var cough = "";
  537. if (v.cough != 0)
  538. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  539. var muscle = "";
  540. if (v.muscle != 0)
  541. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  542. var dyspnea = "";
  543. if (v.dyspnea != 0)
  544. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  545. var fatigue = "";
  546. if (v.fatigue != 0)
  547. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  548. var diarrhea = "";
  549. if (v.diarrhea != 0)
  550. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  551. var others = "";
  552. if (v.others != "")
  553. others = "其他描述:" + v.others + ";";
  554. var scoreRezult = "";
  555. if (v.scoreRezult != 0)
  556. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  557. $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
  558. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
  559. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
  560. ' </div>\n' +
  561. ' '));
  562. }
  563. function getGreder(greder) {
  564. if (greder == 1)
  565. return "男";
  566. else if (greder == 2)
  567. return "女";
  568. return "";
  569. }
  570. function getFamilyStatus(familyStatus) {
  571. var familyStatusList = familyStatus.split(",");
  572. var familyStatusString = "";
  573. if (familyStatus == '0,0,0,0,0,0,0')
  574. familyStatusString += "无病史,";
  575. else {
  576. if (familyStatusList[0] == 1)
  577. familyStatusString += "心脑血管疾病(服用ARB),";
  578. if (familyStatusList[1] == 1)
  579. familyStatusString += "心脑血管疾病(未服ARB),";
  580. if (familyStatusList[2] == 1)
  581. familyStatusString += "呼吸系统病史,";
  582. if (familyStatusList[3] == 1)
  583. familyStatusString += "肿瘤病史,";
  584. if (familyStatusList[4] == 1)
  585. familyStatusString += "糖尿病史,";
  586. if (familyStatusList[5] == 1)
  587. familyStatusString += "服用过激素药物,";
  588. if (familyStatusList[6] == 1)
  589. familyStatusString += "妊娠期,";
  590. }
  591. return familyStatusString.substring(0, familyStatusString.length - 1);
  592. }
  593. function getCough(cough) {
  594. if (cough == 0)
  595. return "无咳嗽";
  596. else if (cough == 1)
  597. return "偶尔短暂咳嗽";
  598. else if (cough == 2)
  599. return "咳嗽轻度影响生活";
  600. else if (cough == 3)
  601. return "咳嗽严重影响生活";
  602. return "";
  603. }
  604. function getMuscle(muscle) {
  605. if (muscle == 0)
  606. return "无";
  607. else if (muscle == 1)
  608. return "按压有";
  609. else if (muscle == 2)
  610. return "偶尔";
  611. else if (muscle == 3)
  612. return "持续有";
  613. return "";
  614. }
  615. function getDyspnea(dyspnea) {
  616. if (dyspnea == 0)
  617. return "无";
  618. else if (dyspnea == 1)
  619. return "急走或上坡气短";
  620. else if (dyspnea == 2)
  621. return "气短而走路变慢";
  622. else if (dyspnea == 3)
  623. return "走路数分钟后气短";
  624. else if (dyspnea == 4)
  625. return "气短无法离开房间";
  626. return "";
  627. }
  628. function getFatigue(fatigue) {
  629. if (fatigue == 0)
  630. return "无";
  631. else if (fatigue == 1)
  632. return "体力劳动后不能恢复";
  633. else if (fatigue == 2)
  634. return "轻体力活非常累";
  635. else if (fatigue == 3)
  636. return "不能正常生活";
  637. return "";
  638. }
  639. function getMedical(medical) {
  640. if (medical == 0)
  641. return "否";
  642. else if (medical == 1)
  643. return "是";
  644. return "";
  645. }
  646. function getSingleRoom(singleRoom) {
  647. if (singleRoom == 0)
  648. return "否";
  649. else if (singleRoom == 1)
  650. return "是";
  651. return "";
  652. }
  653. function getDiarrhea(diarrhea) {
  654. if (diarrhea == 0)
  655. return "无";
  656. else if (diarrhea == 1)
  657. return "轻度腹泻(少于3次)";
  658. else if (diarrhea == 2)
  659. return "中度腹泻(4-6次)";
  660. else if (diarrhea == 3)
  661. return "重度腹泻(超过6次)";
  662. return "";
  663. }
  664. function clearShow() {
  665. console.log("qingkong")
  666. $("#suspectedId").val("");
  667. $("#js_input_user_sex").val("");
  668. $("#js_input_user_sex").attr("data-values", "");
  669. $("#js_input_user_name").val("");
  670. $("#js_input_user_age").val("");
  671. $("#js_input_user_status").val("");
  672. $("#js_input_user_status").attr("data-values", "");
  673. $("#jibenmiaoshu").val("");
  674. $("#switchQuezhen").val("");
  675. $("#switchQuezhen").attr("data-values", "");
  676. $("#switchDanjiangeli").val("");
  677. $("#switchDanjiangeli").attr("data-values", "");
  678. $("#js_input_user_tiwen").val("");
  679. $("#js_input_user_kesou").val("");
  680. $("#js_input_user_kesou").attr("data-values", "");
  681. $("#js_input_user_jirou").val("");
  682. $("#js_input_user_jirou").attr("data-values", "");
  683. $("#js_input_user_huxi").val("");
  684. $("#js_input_user_huxi").attr("data-values", "");
  685. $("#js_input_user_fali").val("");
  686. $("#js_input_user_fali").attr("data-values", "");
  687. $("#js_input_user_fuxie").val("");
  688. $("#js_input_user_fuxie").attr("data-values", "");
  689. $("#shuruqita").val("");
  690. $("#js_input_score_rezult").val("");
  691. $("#js_input_score_rezult_value").val("");
  692. $("#js_input_temperature_score").val("");
  693. $("#js_input_score_histroy").val("");
  694. $("#js_input_score").val("");
  695. }
  696. //健康评估
  697. $('#ribao_score').on('click', function () {
  698. var suspectedId = $("#suspectedId").val();
  699. var userId = $("#userId").val();
  700. var userName = $("#js_input_user_name").val();
  701. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  702. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  703. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  704. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  705. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  706. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  707. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  708. if (userName == undefined || userName == '') {
  709. $.alert("请填写姓名");
  710. return;
  711. }
  712. if (temperature <= 0) {
  713. $.alert("请填写体温");
  714. return;
  715. }
  716. if (temperature > 50 || temperature < 30) {
  717. $.alert("请填写正确的体温");
  718. return;
  719. }
  720. $.ajax({
  721. url: '/home/addScore',
  722. type: "post",
  723. data: {
  724. "userName": userName,
  725. "suspectedId": suspectedId,
  726. "userCreate": userId,
  727. "medical": medical,
  728. "temperature": temperature,
  729. "cough": cough,
  730. "muscle": muscle,
  731. "dyspnea": dyspnea,
  732. "fatigue": fatigue,
  733. "diarrhea": diarrhea,
  734. },
  735. success: function (data) {
  736. if (data == undefined) {
  737. $('#js_input_score_rezult').empty();
  738. $('#js_input_score_rezult_value').empty();
  739. $('#js_input_temperature_score').empty();
  740. $('#js_input_score_histroy').empty();
  741. $('#js_input_score').empty();
  742. }
  743. else {
  744. $('#js_input_score_rezult').empty();
  745. $('#js_input_temperature_score').empty();
  746. $('#js_input_score_histroy').empty();
  747. $('#js_input_score').empty();
  748. var ScoreRezult = getScoreRezult(data.scoreRezult, data.temperatureScore);
  749. $("#js_input_score_rezult").val(ScoreRezult);
  750. $("#js_input_score_rezult_value").val(data.scoreRezult);
  751. $("#js_input_temperature_score").val(data.temperatureScore);
  752. $("#js_input_score_histroy").val(data.scoreHistory);
  753. $("#js_input_score").val(data.score);
  754. }
  755. },
  756. });
  757. });
  758. function getScoreRezult(scoreRezult, temperatureScore) {
  759. if (scoreRezult == 0)
  760. return "未评估";
  761. else if (scoreRezult == 1) {
  762. if (temperatureScore > 1)
  763. return "正常,间隔时间服用退烧药,多休息,多喝水";
  764. else
  765. return "正常";
  766. }
  767. else if (scoreRezult == 2) {
  768. if (temperatureScore > 1)
  769. return "注意观察,间隔时间服用退烧药,多休息,多喝水";
  770. else
  771. return "注意观察";
  772. }
  773. else if (scoreRezult == 3)
  774. return "联系社区医生(或者在线问诊)";
  775. else if (scoreRezult == 4)
  776. return "尽快就诊";
  777. return "";
  778. }