ribao.js 25 KB

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