ribao.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876
  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%">' + familyStatus + 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. var familyStatus = $("#js_input_user_status").attr("data-values") == undefined ? 0 : $("#js_input_user_status").attr("data-values");
  349. var statusDesp = $("#jibenmiaoshu").val() == undefined ? "" : $("#jibenmiaoshu").val();
  350. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  351. var singleRoom = $("#switchDanjiangeli").attr("data-values") == undefined ? 0 : $("#switchDanjiangeli").attr("data-values");
  352. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  353. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  354. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  355. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  356. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  357. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  358. var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
  359. var scoreRezult = $("#js_input_score_rezult_value").val() == undefined ? "" : $("#js_input_score_rezult_value").val();
  360. var temperatureScore = $("#js_input_temperature_score").val() == undefined ? "" : $("#js_input_temperature_score").val();
  361. var scoreHistroy = $("#js_input_score_histroy").val() == undefined ? "" : $("#js_input_score_histroy").val();
  362. var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
  363. if (userName == undefined || userName == '') {
  364. $.alert("请填写姓名");
  365. return;
  366. }
  367. if (grender == 0) {
  368. $.alert("请填写性别");
  369. return;
  370. }
  371. if (age == undefined || age == '') {
  372. $.alert("请填写年龄");
  373. return;
  374. }
  375. if (age > 150 || age < 0) {
  376. $.alert("请填写正确的年龄");
  377. return;
  378. }
  379. if (temperature <= 0) {
  380. $.alert("请填写体温");
  381. return;
  382. }
  383. if (temperature > 50 || temperature < 30) {
  384. $.alert("请填写正确的体温");
  385. return;
  386. }
  387. $.ajax({
  388. url: '/home/addRibao',
  389. type: "post",
  390. data: {
  391. "suspectedId": suspectedId,
  392. "userCreate": userId,
  393. "userName": userName,
  394. "grender": grender,
  395. "age": age,
  396. "familyStatus": familyStatus,
  397. "statusDesp": statusDesp,
  398. "medical": medical,
  399. "singleRoom": singleRoom,
  400. "temperature": temperature,
  401. "cough": cough,
  402. "muscle": muscle,
  403. "dyspnea": dyspnea,
  404. "fatigue": fatigue,
  405. "diarrhea": diarrhea,
  406. "others": others,
  407. "scoreRezult": scoreRezult,
  408. "temperatureScore": temperatureScore,
  409. "scoreHistroy": scoreHistroy,
  410. "score": score,
  411. },
  412. success: function (data) {
  413. if (data.msgReport == "2"){
  414. $.toast("家人姓名不能重复,如果重复,可以带上称呼");
  415. return;
  416. }
  417. if ($('#ribao')[0].style.display == 'none') {
  418. $('#notOpenRibao').toggle();
  419. $('#ribao')[0].style.display = '';
  420. } else {
  421. $('#notOpenRibao')[0].style.display = '';
  422. $('#ribao')[0].style.display = 'none';
  423. }
  424. $('#ribao_jinrijujian').empty();
  425. $('#ribao_jinrijujian').append(data.safetyNum);
  426. ribao_refrash();
  427. clearShow();
  428. },
  429. });
  430. }
  431. function deleteSuspected(suspectedId) {
  432. $.ajax({
  433. url: '/home/deleteSuspected',
  434. type: "post",
  435. data: {
  436. "suspectedId": suspectedId
  437. },
  438. success: function (data) {
  439. $('#ribao_jinrijujian').empty();
  440. $('#ribao_jinrijujian').append(data.safetyNum);
  441. ribao_refrash();
  442. },
  443. });
  444. }
  445. function updateSuspected(suspectedId) {
  446. $("#suspectedId").val("");
  447. if ($('#ribao')[0].style.display == 'none') {
  448. $('#notOpenRibao').toggle();
  449. $('#ribao')[0].style.display = '';
  450. } else {
  451. $('#notOpenRibao')[0].style.display = '';
  452. $('#ribao')[0].style.display = 'none';
  453. }
  454. $.ajax({
  455. url: '/home/selectSuspected',
  456. get: "get",
  457. data: {
  458. "suspectedId": suspectedId
  459. },
  460. success: function (data) {
  461. // console.log(data);
  462. if (data) {
  463. var suspected = data;
  464. $("#suspectedId").val(suspected.suspectedId);
  465. $("#js_input_user_sex").val(getGreder(suspected.grender));
  466. $("#js_input_user_sex").attr("data-values", suspected.grender);
  467. $("#js_input_user_name").val(suspected.userName);
  468. $("#js_input_user_age").val(suspected.age);
  469. $("#js_input_user_status").val(getFamilyStatus(suspected.familyStatus));
  470. $("#js_input_user_status").attr("data-values", suspected.familyStatus);
  471. $("#jibenmiaoshu").val(suspected.statusDesp);
  472. $("#switchQuezhen").val(getMedical(suspected.medical));
  473. $("#switchQuezhen").attr("data-values", suspected.familyStatus);
  474. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  475. $("#switchDanjiangeli").attr("data-values", suspected.familyStatus);
  476. $("#js_input_user_tiwen").val(suspected.temperature);
  477. $("#js_input_user_kesou").val(getCough(suspected.cough));
  478. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  479. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  480. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  481. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  482. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  483. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  484. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  485. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  486. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  487. $("#shuruqita").val(suspected.others);
  488. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  489. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  490. $("#js_input_temperature_score").val(suspected.temperatureScore);
  491. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  492. $("#js_input_score").val(suspected.score);
  493. }
  494. },
  495. });
  496. }
  497. function addReport() {
  498. var userId = $("#userId").val();
  499. $.ajax({
  500. url: '/home/addReport',
  501. type: "post",
  502. data: {
  503. "userCreate": userId,
  504. },
  505. success: function (data) {
  506. $.toast(data.msg);
  507. },
  508. });
  509. }
  510. $("#my-input-ribao").calendar({
  511. dateFormat: 'yyyy-mm-dd',
  512. inputReadOnly: false,
  513. onChange: function (p, values, displayValues) {
  514. var reportDate = values.toString();
  515. var userId = $("#userId").val();
  516. $.ajax({
  517. url: '/home/home/queryRibaoReportDate',
  518. data: {
  519. "userCreate": userId,
  520. "reportDate": reportDate,
  521. },
  522. type: 'GET',
  523. success: function (data) {
  524. if (data.data == undefined) {
  525. $('#ribao_famliy').empty();
  526. }
  527. else {
  528. if (data.data.length > 0) {
  529. $('#ribao_famliy').empty();
  530. data.data.forEach(function (v) {
  531. helpValue1(v);
  532. });
  533. } else {
  534. }
  535. }
  536. },
  537. error: function () {
  538. }
  539. });
  540. }
  541. });
  542. function helpValue1(v) {
  543. var userName = v.userName + ":";
  544. var grender = getGreder(v.grender);
  545. var age = v.age;
  546. var familyStatus = "";
  547. if (v.familyStatus != 0)
  548. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  549. var medical = "";
  550. if (v.medical != 0)
  551. medical = "是否确诊:" + getMedical(v.medical) + ";";
  552. var singleRoom = "";
  553. if (v.singleRoom != 0)
  554. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  555. if (v.singleRoom == 0 && v.medical != 0)
  556. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  557. var temperature = "体温:" + v.temperature + ";";
  558. var cough = "";
  559. if (v.cough != 0)
  560. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  561. var muscle = "";
  562. if (v.muscle != 0)
  563. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  564. var dyspnea = "";
  565. if (v.dyspnea != 0)
  566. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  567. var fatigue = "";
  568. if (v.fatigue != 0)
  569. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  570. var diarrhea = "";
  571. if (v.diarrhea != 0)
  572. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  573. var others = "";
  574. if (v.others != "")
  575. others = "其他:" + v.others;
  576. var scoreRezult = "";
  577. if (v.scoreRezult != 0)
  578. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  579. $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: 12vh">\n' +
  580. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
  581. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
  582. ' </div>\n' +
  583. ' '));
  584. }
  585. function getGreder(greder) {
  586. if (greder == 1)
  587. return "男";
  588. else if (greder == 2)
  589. return "女";
  590. return "";
  591. }
  592. function getFamilyStatus(familyStatus) {
  593. if (familyStatus == 0)
  594. return "无病史";
  595. if (familyStatus == 1)
  596. return "心脑血管疾病(服用ARB)";
  597. else if (familyStatus == 2)
  598. return "心脑血管疾病(未服ARB)";
  599. else if (familyStatus == 3)
  600. return "呼吸系统病史";
  601. else if (familyStatus == 4)
  602. return "肿瘤病史";
  603. else if (familyStatus == 5)
  604. return "糖尿病史";
  605. else if (familyStatus == 6)
  606. return "服用过激素药物";
  607. else if (familyStatus == 7)
  608. return "妊娠期";
  609. return "";
  610. }
  611. function getCough(cough) {
  612. if (cough == 0)
  613. return "无咳嗽";
  614. else if (cough == 1)
  615. return "偶尔短暂咳嗽";
  616. else if (cough == 2)
  617. return "咳嗽轻度影响生活";
  618. else if (cough == 3)
  619. return "咳嗽严重影响生活";
  620. return "";
  621. }
  622. function getMuscle(muscle) {
  623. if (muscle == 0)
  624. return "无";
  625. else if (muscle == 1)
  626. return "按压有";
  627. else if (muscle == 2)
  628. return "偶尔";
  629. else if (muscle == 3)
  630. return "持续有";
  631. return "";
  632. }
  633. function getDyspnea(dyspnea) {
  634. if (dyspnea == 0)
  635. return "无";
  636. else if (dyspnea == 1)
  637. return "急走或上坡气短";
  638. else if (dyspnea == 2)
  639. return "气短而走路变慢";
  640. else if (dyspnea == 3)
  641. return "走路数分钟后气短";
  642. else if (dyspnea == 4)
  643. return "气短无法离开房间";
  644. return "";
  645. }
  646. function getFatigue(fatigue) {
  647. if (fatigue == 0)
  648. return "无";
  649. else if (fatigue == 1)
  650. return "体力劳动后不能恢复";
  651. else if (fatigue == 2)
  652. return "轻体力活非常累";
  653. else if (fatigue == 3)
  654. return "不能正常生活";
  655. return "";
  656. }
  657. function getMedical(medical) {
  658. if (medical == 0)
  659. return "否";
  660. else if (medical == 1)
  661. return "是";
  662. return "";
  663. }
  664. function getSingleRoom(singleRoom) {
  665. if (singleRoom == 0)
  666. return "否";
  667. else if (singleRoom == 1)
  668. return "是";
  669. return "";
  670. }
  671. function getDiarrhea(diarrhea) {
  672. if (diarrhea == 0)
  673. return "无";
  674. else if (diarrhea == 1)
  675. return "轻度腹泻(少于3次)";
  676. else if (diarrhea == 2)
  677. return "中度腹泻(4-6次)";
  678. else if (diarrhea == 3)
  679. return "重度腹泻(超过6次)";
  680. return "";
  681. }
  682. function clearShow() {
  683. console.log("qingkong")
  684. $("#suspectedId").val("");
  685. $("#js_input_user_sex").val("");
  686. $("#js_input_user_sex").attr("data-values", "");
  687. $("#js_input_user_name").val("");
  688. $("#js_input_user_age").val("");
  689. $("#js_input_user_status").val("");
  690. $("#js_input_user_status").attr("data-values", "");
  691. $("#jibenmiaoshu").val("");
  692. $("#switchQuezhen").val("");
  693. $("#switchQuezhen").attr("data-values", "");
  694. $("#switchDanjiangeli").val("");
  695. $("#switchDanjiangeli").attr("data-values", "");
  696. $("#js_input_user_tiwen").val("");
  697. $("#js_input_user_kesou").val("");
  698. $("#js_input_user_kesou").attr("data-values", "");
  699. $("#js_input_user_jirou").val("");
  700. $("#js_input_user_jirou").attr("data-values", "");
  701. $("#js_input_user_huxi").val("");
  702. $("#js_input_user_huxi").attr("data-values", "");
  703. $("#js_input_user_fali").val("");
  704. $("#js_input_user_fali").attr("data-values", "");
  705. $("#js_input_user_fuxie").val("");
  706. $("#js_input_user_fuxie").attr("data-values", "");
  707. $("#shuruqita").val("");
  708. $("#js_input_score_rezult").val("");
  709. $("#js_input_score_rezult_value").val("");
  710. $("#js_input_temperature_score").val("");
  711. $("#js_input_score_histroy").val("");
  712. $("#js_input_score").val("");
  713. }
  714. //健康评估
  715. $('#ribao_score').on('click', function () {
  716. var suspectedId = $("#suspectedId").val();
  717. var userId = $("#userId").val();
  718. var userName = $("#js_input_user_name").val();
  719. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  720. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  721. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  722. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  723. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  724. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  725. if (userName == undefined || userName == '') {
  726. $.alert("请填写姓名");
  727. return;
  728. }
  729. if (temperature <= 0) {
  730. $.alert("请填写体温");
  731. return;
  732. }
  733. if (temperature > 50 || temperature < 30) {
  734. $.alert("请填写正确的体温");
  735. return;
  736. }
  737. $.ajax({
  738. url: '/home/addScore',
  739. type: "post",
  740. data: {
  741. "userName": userName,
  742. "suspectedId": suspectedId,
  743. "userCreate": userId,
  744. "temperature": temperature,
  745. "cough": cough,
  746. "muscle": muscle,
  747. "dyspnea": dyspnea,
  748. "fatigue": fatigue,
  749. "diarrhea": diarrhea,
  750. },
  751. success: function (data) {
  752. if (data == undefined) {
  753. $('#js_input_score_rezult').empty();
  754. $('#js_input_score_rezult_value').empty();
  755. $('#js_input_temperature_score').empty();
  756. $('#js_input_score_histroy').empty();
  757. $('#js_input_score').empty();
  758. }
  759. else {
  760. $('#js_input_score_rezult').empty();
  761. $('#js_input_temperature_score').empty();
  762. $('#js_input_score_histroy').empty();
  763. $('#js_input_score').empty();
  764. var ScoreRezult = getScoreRezult(data.scoreRezult, data.temperatureScore);
  765. $("#js_input_score_rezult").val(ScoreRezult);
  766. $("#js_input_score_rezult_value").val(data.scoreRezult);
  767. $("#js_input_temperature_score").val(data.temperatureScore);
  768. $("#js_input_score_histroy").val(data.scoreHistory);
  769. $("#js_input_score").val(data.score);
  770. }
  771. },
  772. });
  773. });
  774. function getScoreRezult(scoreRezult, temperatureScore) {
  775. if (scoreRezult == 0)
  776. return "未评估";
  777. else if (scoreRezult == 1) {
  778. if (temperatureScore > 1)
  779. return "正常,间隔时间服用退烧药,多休息,多喝水";
  780. else
  781. return "正常";
  782. }
  783. else if (scoreRezult == 2) {
  784. if (temperatureScore > 1)
  785. return "注意观察,间隔时间服用退烧药,多休息,多喝水";
  786. else
  787. return "注意观察";
  788. }
  789. else if (scoreRezult == 3)
  790. return "联系社区医生(或者在线问诊)";
  791. else if (scoreRezult == 4)
  792. return "尽快就诊";
  793. return "";
  794. }