ribao.js 29 KB

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