ribao.js 27 KB

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