ribao.js 28 KB

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