ribao.js 32 KB

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