ribao.js 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441
  1. function ribao_init() {
  2. //lingyun
  3. $('#btnRB').on('click', function () {
  4. window.location.href = "/yeweihui/home.html";
  5. });
  6. $("#js_input_gzzd").select({
  7. title: "选择工作驻地",
  8. items: [
  9. {
  10. title: "武汉市",
  11. value: "1",
  12. },
  13. {
  14. title: "宜昌市",
  15. value: "2",
  16. },
  17. {
  18. title: "当阳市",
  19. value: "3",
  20. },
  21. {
  22. title: "其它地点",
  23. value: "4",
  24. }]
  25. });
  26. $("#js_input_jrszd").select({
  27. title: "选择今日所在地",
  28. items: [
  29. {
  30. title: "武汉市",
  31. value: "1",
  32. }, {
  33. title: "宜昌市",
  34. value: "2",
  35. },
  36. {
  37. title: "当阳市",
  38. value: "3",
  39. },
  40. {
  41. title: "其它地点",
  42. value: "4",
  43. }]
  44. });
  45. $("#js_input_sf").select({
  46. title: "",
  47. items: [
  48. {
  49. title: "否",
  50. value: "0",
  51. },
  52. {
  53. title: "是",
  54. value: "1",
  55. }]
  56. });
  57. $("#js_input_cfd").select({
  58. title: "选择出发地",
  59. items: [
  60. {
  61. title: "武汉市",
  62. value: "1",
  63. }, {
  64. title: "宜昌市",
  65. value: "2",
  66. },
  67. {
  68. title: "当阳市",
  69. value: "3",
  70. },
  71. {
  72. title: "其它地点",
  73. value: "4",
  74. }]
  75. });
  76. $("#js_input_mdd").select({
  77. title: "选择目的地",
  78. items: [
  79. {
  80. title: "武汉市",
  81. value: "1",
  82. }, {
  83. title: "宜昌市",
  84. value: "2",
  85. },
  86. {
  87. title: "当阳市",
  88. value: "3",
  89. },
  90. {
  91. title: "其它地点",
  92. value: "4",
  93. }]
  94. });
  95. $("#js_input_cxfs").select({
  96. title: "选择出行方式",
  97. items: [
  98. {
  99. title: "长途汽车",
  100. value: "1",
  101. },
  102. {
  103. title: "火车",
  104. value: "2",
  105. },
  106. {
  107. title: "飞机",
  108. value: "3",
  109. },
  110. {
  111. title: "自驾",
  112. value: "4",
  113. }]
  114. });
  115. // $("#js_input_user_sex").val(getGreder(2)); //设置初始值
  116. $('#btnRB').on('click', function () {
  117. window.location.href = "/yeweihui/home.html";
  118. });
  119. $("#js_input_user_sex").select({
  120. title: "选择性别",
  121. items: [
  122. {
  123. title: "男",
  124. value: "1",
  125. },
  126. {
  127. title: "女",
  128. value: "2",
  129. }]
  130. });
  131. $("#js_input_user_status").select({
  132. title: "选择基本状况",
  133. items: [
  134. {
  135. title: "无病史",
  136. value: "0",
  137. }, {
  138. title: "心脑血管疾病(服用ARB)",
  139. value: "1",
  140. },
  141. {
  142. title: "心脑血管疾病(未服ARB)",
  143. value: "2",
  144. },
  145. {
  146. title: "呼吸系统病史",
  147. value: "3",
  148. },
  149. {
  150. title: "肿瘤病史",
  151. value: "4",
  152. },
  153. {
  154. title: "糖尿病史",
  155. value: "5",
  156. },
  157. {
  158. title: "服用过激素药物",
  159. value: "6",
  160. },
  161. {
  162. title: "妊娠期",
  163. value: "7",
  164. }]
  165. });
  166. $("#js_input_user_kesou").select({
  167. title: "选择咳嗽情况",
  168. items: [
  169. {
  170. title: "无咳嗽",
  171. value: "0",
  172. },
  173. {
  174. title: "偶有短暂咳嗽",
  175. value: "1",
  176. },
  177. {
  178. title: "咳嗽轻度影响生活",
  179. value: "2",
  180. },
  181. {
  182. title: "咳嗽严重影响生活",
  183. value: "3",
  184. }]
  185. });
  186. $("#js_input_user_jirou").select({
  187. title: "选择肌肉情况",
  188. items: [
  189. {
  190. title: "无",
  191. value: "0",
  192. },
  193. {
  194. title: "按压有",
  195. value: "1",
  196. },
  197. {
  198. title: "偶尔",
  199. value: "2",
  200. },
  201. {
  202. title: "持续有",
  203. value: "3",
  204. }]
  205. });
  206. $("#js_input_user_huxi").select({
  207. title: "选择呼吸情况",
  208. items: [
  209. {
  210. title: "无",
  211. value: "0",
  212. },
  213. {
  214. title: "急走或上坡气短",
  215. value: "1",
  216. },
  217. {
  218. title: "气短而走路变慢",
  219. value: "2",
  220. },
  221. {
  222. title: "走路数分钟后气短",
  223. value: "3",
  224. },
  225. {
  226. title: "气短无法离开房间",
  227. value: "4",
  228. }]
  229. });
  230. $("#js_input_user_fali").select({
  231. title: "选择乏力情况",
  232. items: [
  233. {
  234. title: "无",
  235. value: "0",
  236. },
  237. {
  238. title: "体力劳动后不能恢复",
  239. value: "1",
  240. },
  241. {
  242. title: "轻体力活非常累",
  243. value: "2",
  244. },
  245. {
  246. title: "不能正常生活",
  247. value: "3",
  248. }]
  249. });
  250. $("#js_input_user_fuxie").select({
  251. title: "选择腹泻情况",
  252. items: [
  253. {
  254. title: "无",
  255. value: "0",
  256. },
  257. {
  258. title: "轻度腹泻(少于3次)",
  259. value: "1",
  260. },
  261. {
  262. title: "中度腹泻(4-6次)",
  263. value: "2",
  264. },
  265. {
  266. title: "重度腹泻(超过6次)",
  267. value: "3",
  268. }]
  269. });
  270. $("#switchQuezhen").select({
  271. title: "选择是否确诊",
  272. items: [
  273. {
  274. title: "否",
  275. value: "0",
  276. },
  277. {
  278. title: "是",
  279. value: "1",
  280. }]
  281. });
  282. $("#switchDanjiangeli").select({
  283. title: "选择是否单间隔离",
  284. items: [
  285. {
  286. title: "否",
  287. value: "0",
  288. },
  289. {
  290. title: "是",
  291. value: "1",
  292. }]
  293. });
  294. //
  295. // updateSuspected({
  296. // userName : 'www',
  297. // grender : 2,
  298. // age : 34,
  299. // familyStatus : 1,
  300. // statusDesp : "",
  301. // medical:0,
  302. // singleRoom:1,
  303. // temperature:0,
  304. // cough:2,
  305. // muscle:1,
  306. // dyspnea:1,
  307. // fatigue:1,
  308. // diarrhea:2,
  309. // others:""
  310. // })
  311. //
  312. // var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
  313. // console.log("grender:" + grender)
  314. }
  315. function selectinput1(obj){
  316. var grender = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
  317. if(grender != 4){//js_input_qtdd
  318. // $('#js_input_qtdd')[0].disabled == 'disabled'
  319. $('#js_input_qtdd').attr("disabled","disabled")
  320. }else{
  321. $('#js_input_qtdd').removeAttr("disabled")
  322. }
  323. }
  324. function selectinput2(obj){
  325. var grender = $("#js_input_jrszd").attr("data-values") == undefined ? 0 : $("#js_input_jrszd").attr("data-values");
  326. if(grender != 4){//js_input_qtdd
  327. // $('#js_input_qtdd')[0].disabled == 'disabled'
  328. $('#js_input_jrszq').attr("disabled","disabled")
  329. }else{
  330. $('#js_input_jrszq').removeAttr("disabled")
  331. }
  332. }
  333. function selectinput3(obj){
  334. var grender = $("#js_input_cfd").attr("data-values") == undefined ? 0 : $("#js_input_cfd").attr("data-values");
  335. if(grender != 4 ){
  336. $('#js_input_cfdq').attr("disabled","disabled")
  337. }else{
  338. $('#js_input_cfdq').removeAttr("disabled")
  339. }
  340. }
  341. function selectinput4(obj){
  342. var grender = $("#js_input_mdd").attr("data-values") == undefined ? 0 : $("#js_input_mdd").attr("data-values");
  343. if(grender != 4){
  344. $('#js_input_mddq').attr("disabled","disabled")
  345. }else{
  346. $('#js_input_mddq').removeAttr("disabled")
  347. }
  348. }
  349. function selectinput5(obj){
  350. var grender = $("#js_input_cxfs").attr("data-values") == undefined ? 0 : $("#js_input_cxfs").attr("data-values");
  351. if(grender == 4){
  352. // $('#js_input_cxfsq').attr("disabled","disabled")
  353. }else{
  354. $('#js_input_cxfsq').removeAttr("disabled")
  355. }
  356. }
  357. var listcx = [];
  358. function selectinput6(obj){
  359. var grender = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  360. if(grender == 0){
  361. $('#none')[0].style.display = 'none';
  362. $("#js_input_cxfs").val("");
  363. $("#js_input_cfd").val("");
  364. $("#js_input_mdd").val("");
  365. $('#js_input_cxfsq').val("");
  366. $('#js_input_cfdq').val("");
  367. $('#js_input_mddq').val("");
  368. listcx.splice(0,listcx.length);
  369. $('#tabtr').empty();
  370. }else if(grender == 1){
  371. $('#none')[0].style.display = '';
  372. }
  373. }
  374. //添加出行详情
  375. function insertlingyun(){
  376. var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  377. if(sf == 0 || sf == 3){
  378. $.alert("请选择是否出行");
  379. return;
  380. }
  381. var person=new Object();
  382. var cxfs = $("#js_input_cxfs").attr("data-values") == undefined ? 0 : $("#js_input_cxfs").attr("data-values");
  383. var cfd = $("#js_input_cfd").attr("data-values") == undefined ? 0 : $("#js_input_cfd").attr("data-values");
  384. var mdd = $("#js_input_mdd").attr("data-values") == undefined ? 0 : $("#js_input_mdd").attr("data-values");
  385. if(cxfs != 4 && cxfs !=0){
  386. var val = $('#js_input_cxfsq').val();
  387. if( val == ""){
  388. $.alert("请填写车次/航班/车牌");
  389. return;
  390. }
  391. person.tripTypeDesp = $('#js_input_cxfsq').val();
  392. if(cxfs == 1){
  393. person.tripType = 1;
  394. person.tripTypeStr = "长途汽车"
  395. }else if(cxfs == 2){
  396. person.tripType = 2;
  397. person.tripTypeStr = "火车";
  398. }else if(cxfs == 3){
  399. person.tripType = 3;
  400. person.tripTypeStr = "飞机";
  401. }
  402. }else if(cxfs == 0){
  403. $.alert("请选择出行方式");
  404. return;
  405. }else if(cxfs == 4){
  406. var val6 = $('#js_input_cxfsq').val();
  407. if( val6 == ""){
  408. $.alert("请填写车次/航班/车牌");
  409. return;
  410. }
  411. person.tripTypeStr = "自驾";
  412. person.tripType = 4;
  413. person.tripTypeDesp =$('#js_input_cxfsq').val();
  414. }
  415. if(cfd == 4 && cfd !=0){
  416. var val2 = $('#js_input_cfdq').val();
  417. if(val2 ==""){
  418. $.alert("请填写出发地");
  419. return;
  420. }
  421. person.startLocalOther = $('#js_input_cfdq').val();
  422. person.startLocalStr = $('#js_input_cfdq').val();
  423. }else if(cfd != 4 && cfd !=0){
  424. if(cfd ==1){
  425. person.startLocal = 1;
  426. person.startLocalStr = "武汉市";
  427. }else if(cfd == 2){
  428. person.startLocal = 2;
  429. person.startLocalStr = "宜昌市";
  430. }else if(cfd == 3){
  431. person.startLocal = 3;
  432. person.startLocalStr = "当阳市";
  433. }
  434. }else if(cfd ==0){
  435. $.alert("请选择出发地");
  436. return;
  437. }
  438. if(mdd ==4 && mdd!=0){
  439. var val3 = $('#js_input_mddq').val();
  440. if(val3 == ""){
  441. $.alert("请填写目的地");
  442. return;
  443. }
  444. person.endLocalOther = $('#js_input_mddq').val();
  445. person.endlocalStr = $('#js_input_mddq').val();
  446. }else if(mdd != 4 && mdd !=0){
  447. if(mdd ==1){
  448. person.endLocal = 1;
  449. person.endlocalStr = "武汉市";
  450. }else if(mdd == 2){
  451. person.endLocal = 2;
  452. person.endlocalStr = "宜昌市";
  453. }else if(mdd == 3){
  454. person.endLocal = 3;
  455. person.endlocalStr = "当阳市";
  456. }
  457. }else if(mdd == 0){
  458. $.alert("请选择目的地");
  459. return;
  460. }
  461. listcx.push(person);
  462. $.alert("添加成功");
  463. tab()
  464. }
  465. function tab(){
  466. var xxIds = [];
  467. var xxName = [
  468. "序号",
  469. "出发地",
  470. "目的地",
  471. "出行方式",
  472. "车次/航班/车牌",
  473. "操作"
  474. ];
  475. for (var i = 0; i < xxName.length; i++) {
  476. xxIds.push({
  477. name: xxName[i]
  478. });
  479. }
  480. $('#tabtr').empty();
  481. var html = "<tr style='background-color: #f8f8f8;'>";
  482. for (var i = 0; i < xxIds.length; i++) {
  483. // alert(xxIds[i].name);
  484. html += "<th>" + xxIds[i].name + "</th>";
  485. }
  486. html +="</tr>"
  487. for (var i = 0; i < listcx.length; i++) {//后端传过来的集合遍历
  488. if (i % 2 != 0) {
  489. html += "<tr style='background-color: #f8f8f8;'>";
  490. }
  491. else {
  492. html += "<tr>";
  493. }
  494. html += "<td style='text-align: center;'>" + (i + 1) + "</td>";
  495. // var isValue = false; //记录是否赋值
  496. html += "<td style='text-align: center;' >" + listcx[i].startLocalStr + " </td>";
  497. html += "<td style='text-align: center;' >" + listcx[i].endlocalStr + " </td>";
  498. html += "<td style='text-align: center;' >" + listcx[i].tripTypeStr + " </td>";
  499. html += "<td style='text-align: center;' >" + listcx[i].tripTypeDesp + " </td>";
  500. html += "<td style='text-align: center;' ><button value=" + i + " style='height:3vh;background-color: red;text-align: center;' class='weui-btn weui-btn_mini weui-btn_primary' onclick='splice(this.value)'>" + "删除" + " </button></td>";
  501. html += "</tr>";
  502. $("#tabtr").html(html);
  503. }
  504. }
  505. function splice(obj){
  506. listcx.splice(obj,1);
  507. tab()
  508. }
  509. //近日报告
  510. function ribaoInitialization(reportId) {
  511. if (reportId == null)
  512. return;
  513. $.ajax({
  514. url: '/home/home/queryRibaoRefresh',
  515. data: {
  516. reportId: reportId
  517. },
  518. type: 'GET',
  519. success: function (data) {
  520. console.log(data);
  521. if (data.data.length > 0) {
  522. hasData = true;
  523. data.data.forEach(function (v) {
  524. ribao_cell(v);
  525. });
  526. }
  527. },
  528. error: function () {
  529. }
  530. });
  531. }
  532. //刷新今日日报
  533. function ribao_refrash() {
  534. var userId = $("#userId").val();
  535. $.ajax({
  536. url: '/home/home/queryRibao',
  537. data: {
  538. userCreate: userId
  539. },
  540. type: 'GET',
  541. success: function (data) {
  542. console.log(data);
  543. if (data.data == undefined) {
  544. $('#rb_family').empty();
  545. }
  546. else {
  547. $('#rb_family').empty();
  548. if (data.data.length > 0) {
  549. hasData = true;
  550. data.data.forEach(function (v) {
  551. ribao_cell(v);
  552. });
  553. } else {
  554. }
  555. }
  556. },
  557. error: function () {
  558. }
  559. });
  560. }
  561. function ribao_cell(v) {
  562. var userName = v.userName + ":";
  563. var grender = getGreder(v.grender);
  564. var age = v.age;
  565. var familyStatus = "";
  566. if (v.familyStatus != 0)
  567. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  568. var medical = "";
  569. if (v.medical != 0)
  570. medical = "是否确诊:" + getMedical(v.medical) + ";";
  571. var singleRoom = "";
  572. if (v.singleRoom != 0)
  573. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  574. if (v.singleRoom == 0 && v.medical != 0)
  575. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  576. var temperature = "体温:" + v.temperature + ";";
  577. var cough = "";
  578. if (v.cough != 0)
  579. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  580. var muscle = "";
  581. if (v.muscle != 0)
  582. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  583. var dyspnea = "";
  584. if (v.dyspnea != 0)
  585. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  586. var fatigue = "";
  587. if (v.fatigue != 0)
  588. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  589. var diarrhea = "";
  590. if (v.diarrhea != 0)
  591. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  592. var others = "";
  593. if (v.others != "")
  594. others = "其他描述:" + v.others + ";";
  595. var scoreRezult = "";
  596. if (v.scoreRezult != 0)
  597. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  598. $('#rb_family').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
  599. ' <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' +
  600. ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改</a></h4>\n' +
  601. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
  602. ' </div>\n' +
  603. ' '));
  604. }
  605. function ribao_add() {
  606. $('#btnAdd').on('click', function () {
  607. $("#suspectedId").val("");
  608. if ($('#ribao')[0].style.display == 'none') {
  609. $('#notOpenRibao').toggle();
  610. $('#ribao')[0].style.display = '';
  611. } else {
  612. $('#notOpenRibao')[0].style.display = '';
  613. $('#ribao')[0].style.display = 'none';
  614. }
  615. var userId = $("#userId").val();
  616. //获取用户家人
  617. $.ajax({
  618. url: '/home/selectAddSuspected',
  619. get: "get",
  620. data: {
  621. "userCreate": userId
  622. },
  623. success: function (data) {
  624. if (data != null || data!='') {
  625. //存在
  626. var suspected = data;
  627. $("#js_input_user_sex").val(getGreder(suspected.grender));
  628. $("#js_input_user_sex").attr("data-values", suspected.grender);
  629. $("#js_input_user_name").val(suspected.userName);
  630. $("#js_input_user_age").val(suspected.age);
  631. //基本情况
  632. if (suspected.familyStatus != "") {
  633. var familyStatusList = suspected.familyStatus.split(",");
  634. if (familyStatusList[0] == 1)
  635. $("input[name='checkbox1']").prop("checked", "checked");
  636. else
  637. $("input[name='checkbox1']").removeAttr("checked");
  638. if (familyStatusList[1] == 1)
  639. $("input[name='checkbox2']").prop("checked", "checked");
  640. else
  641. $("input[name='checkbox2']").removeAttr("checked");
  642. if (familyStatusList[2] == 1)
  643. $("input[name='checkbox3']").prop("checked", "checked");
  644. else
  645. $("input[name='checkbox3']").removeAttr("checked");
  646. if (familyStatusList[3] == 1)
  647. $("input[name='checkbox4']").prop("checked", "checked");
  648. else
  649. $("input[name='checkbox4']").removeAttr("checked");
  650. if (familyStatusList[4] == 1)
  651. $("input[name='checkbox5']").prop("checked", "checked");
  652. else
  653. $("input[name='checkbox5']").removeAttr("checked");
  654. if (familyStatusList[5] == 1)
  655. $("input[name='checkbox6']").prop("checked", "checked");
  656. else
  657. $("input[name='checkbox6']").removeAttr("checked");
  658. if (familyStatusList[6] == 1)
  659. $("input[name='checkbox7']").prop("checked", "checked");
  660. else
  661. $("input[name='checkbox7']").removeAttr("checked");
  662. }
  663. $("#switchQuezhen").val(getMedical(suspected.medical));
  664. $("#switchQuezhen").attr("data-values", suspected.medical);
  665. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  666. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  667. $("#js_input_user_tiwen").val(suspected.temperature);
  668. $("#js_input_user_kesou").val(getCough(suspected.cough));
  669. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  670. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  671. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  672. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  673. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  674. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  675. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  676. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  677. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  678. $("#shuruqita").val(suspected.others);
  679. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  680. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  681. $("#js_input_temperature_score").val(suspected.temperatureScore);
  682. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  683. $("#js_input_score").val(suspected.score);
  684. }
  685. else {
  686. //基本情况
  687. $("input[name='checkbox1']").removeAttr("checked");
  688. $("input[name='checkbox2']").removeAttr("checked");
  689. $("input[name='checkbox3']").removeAttr("checked");
  690. $("input[name='checkbox4']").removeAttr("checked");
  691. $("input[name='checkbox5']").removeAttr("checked");
  692. $("input[name='checkbox6']").removeAttr("checked");
  693. $("input[name='checkbox7']").removeAttr("checked");
  694. $("#switchQuezhen").val(getMedical(0));
  695. $("#switchQuezhen").attr("data-values", 0);
  696. $("#switchDanjiangeli").val(getSingleRoom(0));
  697. $("#switchDanjiangeli").attr("data-values", 0);
  698. $("#js_input_user_tiwen").val(0);
  699. $("#js_input_user_kesou").val(getCough(0));
  700. $("#js_input_user_kesou").attr("data-values", 0);
  701. $("#js_input_user_jirou").val(getMuscle(0));
  702. $("#js_input_user_jirou").attr("data-values", 0);
  703. $("#js_input_user_huxi").val(getDyspnea(0));
  704. $("#js_input_user_huxi").attr("data-values", 0);
  705. $("#js_input_user_fali").val(getFatigue(0));
  706. $("#js_input_user_fali").attr("data-values", 0);
  707. $("#js_input_user_fuxie").val(getDiarrhea(0));
  708. $("#js_input_user_fuxie").attr("data-values", 0);
  709. }
  710. },
  711. });
  712. });
  713. }
  714. function ribao_cancel() {
  715. $('#cancel').on('click', function () {
  716. if ($('#ribao')[0].style.display == 'none') {
  717. $('#notOpenRibao').toggle();
  718. $('#ribao')[0].style.display = '';
  719. } else {
  720. $('#notOpenRibao')[0].style.display = '';
  721. $('#ribao')[0].style.display = 'none';
  722. }
  723. clearShow();
  724. });
  725. }
  726. function ribaoCommit() {
  727. var suspectedId = $("#suspectedId").val();
  728. var userId = $("#userId").val();
  729. var userName = $("#js_input_user_name").val();
  730. var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
  731. var age = $("#js_input_user_age").val();
  732. //不能同时选择服用和未服用
  733. if ($("input[name='checkbox1']:checked").val() == "on" && $("input[name='checkbox2']:checked").val() == "on") {
  734. $.alert("心脑血管不能同时选择服用和未服用");
  735. return;
  736. }
  737. //男性不能选择妊娠期
  738. if ($("#js_input_user_sex").attr("data-values") == 1 && $("input[name='checkbox7']:checked").val() == "on") {
  739. $.alert("男性不能选择妊娠期");
  740. return;
  741. }
  742. //家庭状态
  743. var familyStatus = "";
  744. if ($("input[name='checkbox1']:checked").val() == "on")
  745. familyStatus += "1";
  746. else
  747. familyStatus += "0";
  748. if ($("input[name='checkbox2']:checked").val() == "on")
  749. familyStatus += ",1";
  750. else
  751. familyStatus += ",0";
  752. if ($("input[name='checkbox3']:checked").val() == "on")
  753. familyStatus += ",1";
  754. else
  755. familyStatus += ",0";
  756. if ($("input[name='checkbox4']:checked").val() == "on")
  757. familyStatus += ",1";
  758. else
  759. familyStatus += ",0";
  760. if ($("input[name='checkbox5']:checked").val() == "on")
  761. familyStatus += ",1";
  762. else
  763. familyStatus += ",0";
  764. if ($("input[name='checkbox6']:checked").val() == "on")
  765. familyStatus += ",1";
  766. else
  767. familyStatus += ",0";
  768. if ($("input[name='checkbox7']:checked").val() == "on")
  769. familyStatus += ",1";
  770. else
  771. familyStatus += ",0";
  772. //var familyStatus = $("#js_input_user_status").attr("data-values") == undefined ? 0 : $("#js_input_user_status").attr("data-values");
  773. //var statusDesp = $("#jibenmiaoshu").val() == undefined ? "" : $("#jibenmiaoshu").val();
  774. var statusDesp = "";
  775. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  776. var singleRoom = $("#switchDanjiangeli").attr("data-values") == undefined ? 0 : $("#switchDanjiangeli").attr("data-values");
  777. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  778. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  779. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  780. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  781. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  782. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  783. var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
  784. var scoreRezult = $("#js_input_score_rezult_value").val() == undefined ? "" : $("#js_input_score_rezult_value").val();
  785. var temperatureScore = $("#js_input_temperature_score").val() == undefined ? "" : $("#js_input_temperature_score").val();
  786. var scoreHistroy = $("#js_input_score_histroy").val() == undefined ? "" : $("#js_input_score_histroy").val();
  787. var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
  788. if (userName == undefined || userName == '') {
  789. $.alert("请填写姓名");
  790. return;
  791. }
  792. if (grender == 0) {
  793. $.alert("请填写性别");
  794. return;
  795. }
  796. if (age == undefined || age == '') {
  797. $.alert("请填写年龄");
  798. return;
  799. }
  800. if (age > 150 || age < 0) {
  801. $.alert("请填写正确的年龄");
  802. return;
  803. }
  804. if (temperature <= 0) {
  805. $.alert("请填写体温");
  806. return;
  807. }
  808. if (temperature > 50 || temperature < 30) {
  809. $.alert("请填写正确的体温");
  810. return;
  811. }
  812. //lingyun
  813. var gzzd = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
  814. var qtdd = $("#js_input_qtdd").val();
  815. var workLocal="";
  816. var workLocalOther = "";
  817. if(gzzd == 0){
  818. $.alert("请选择工作驻地");
  819. return;
  820. }else if(gzzd == 4 && qtdd == ""){
  821. $.alert("请填写工作驻地");
  822. return;
  823. }else if(gzzd != 0 && gzzd !=4){
  824. if(gzzd ==1){
  825. workLocal = 1;
  826. }else if(gzzd == 2){
  827. workLocal = 2;
  828. }else if(gzzd == 3){
  829. workLocal = 3;
  830. }
  831. }else if(gzzd == 4 && qtdd != ""){
  832. workLocal = 4;
  833. workLocalOther = qtdd;
  834. }
  835. //var listcx = [];
  836. //var person=new Object();
  837. var jrszd = $("#js_input_jrszd").attr("data-values") == undefined ? 0 : $("#js_input_jrszd").attr("data-values");
  838. var jrszq = $("#js_input_jrszq").val();
  839. var todyLocal ="";
  840. var todyLocalOther = "";
  841. if(jrszd == 0){
  842. $.alert("请选择今日所在地");
  843. return;
  844. }else if(jrszd == 4 && jrszq == ""){
  845. $.alert("请填写今日所在地");
  846. return;
  847. }else if(jrszd != 0 && jrszd !=4){
  848. if(jrszd ==1){
  849. todyLocal = 1;
  850. }else if(jrszd == 2){
  851. todyLocal = 2;
  852. }else if(jrszd == 3){
  853. todyLocal = 3;
  854. }
  855. }else if(jrszd == 4 && jrszq != ""){
  856. todyLocal = 4;
  857. todyLocalOther = jrszq;
  858. }
  859. var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  860. var isTrip= "";
  861. if(sf == 3){
  862. $.alert("请选择是否出行");
  863. return;
  864. }else{
  865. isTrip = sf;
  866. }
  867. console.log(JSON.stringify(listcx))
  868. $.ajax({
  869. url: '/home/addRibaoTrip',
  870. type: "post",
  871. data: {
  872. "suspectedId": suspectedId,
  873. "userCreate": userId,
  874. "userName": userName,
  875. "grender": grender,
  876. "age": age,
  877. "familyStatus": familyStatus,
  878. "statusDesp": statusDesp,
  879. "medical": medical,
  880. "singleRoom": singleRoom,
  881. "temperature": temperature,
  882. "cough": cough,
  883. "muscle": muscle,
  884. "dyspnea": dyspnea,
  885. "fatigue": fatigue,
  886. "diarrhea": diarrhea,
  887. "others": others,
  888. "scoreRezult": scoreRezult,
  889. "temperatureScore": temperatureScore,
  890. "scoreHistroy": scoreHistroy,
  891. "score": score,
  892. "workLocal": JSON.stringify(workLocal),
  893. "workLocalOther": JSON.stringify(workLocalOther),
  894. "todyLocal": JSON.stringify(todyLocal),
  895. "todyLocalOther": JSON.stringify(todyLocalOther),
  896. "isTrip": JSON.stringify(isTrip),
  897. "listcx": JSON.stringify(listcx),
  898. },
  899. success: function (data) {
  900. if (data.msgReport == "2") {
  901. $.toast("家人姓名不能重复,如果重复,可以带上称呼");
  902. return;
  903. }
  904. if ($('#ribao')[0].style.display == 'none') {
  905. $('#notOpenRibao').toggle();
  906. $('#ribao')[0].style.display = '';
  907. } else {
  908. $('#notOpenRibao')[0].style.display = '';
  909. $('#ribao')[0].style.display = 'none';
  910. }
  911. $('#ribao_jinrijujian').empty();
  912. $('#ribao_jinrijujian').append(data.safetyNum);
  913. ribao_refrash();
  914. clearShow();
  915. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  916. },
  917. });
  918. }
  919. function deleteSuspected(suspectedId) {
  920. $.ajax({
  921. url: '/home/deleteSuspected',
  922. type: "post",
  923. data: {
  924. "suspectedId": suspectedId
  925. },
  926. success: function (data) {
  927. $('#ribao_jinrijujian').empty();
  928. $('#ribao_jinrijujian').append(data.safetyNum);
  929. ribao_refrash();
  930. },
  931. });
  932. }
  933. function updateSuspected(suspectedId) {
  934. $("#suspectedId").val("");
  935. if ($('#ribao')[0].style.display == 'none') {
  936. $('#notOpenRibao').toggle();
  937. $('#ribao')[0].style.display = '';
  938. } else {
  939. $('#notOpenRibao')[0].style.display = '';
  940. $('#ribao')[0].style.display = 'none';
  941. }
  942. $.ajax({
  943. url: '/home/selectSuspected',
  944. get: "get",
  945. data: {
  946. "suspectedId": suspectedId
  947. },
  948. success: function (data) {
  949. // console.log(data);
  950. if (data) {
  951. var suspected = data;
  952. $("#suspectedId").val(suspected.suspectedId);
  953. $("#js_input_user_sex").val(getGreder(suspected.grender));
  954. $("#js_input_user_sex").attr("data-values", suspected.grender);
  955. $("#js_input_user_name").val(suspected.userName);
  956. $("#js_input_user_age").val(suspected.age);
  957. //基本情况
  958. if (suspected.familyStatus != "") {
  959. var familyStatusList = suspected.familyStatus.split(",");
  960. if (familyStatusList[0] == 1)
  961. $("input[name='checkbox1']").prop("checked", "checked");
  962. else
  963. $("input[name='checkbox1']").removeAttr("checked");
  964. if (familyStatusList[1] == 1)
  965. $("input[name='checkbox2']").prop("checked", "checked");
  966. else
  967. $("input[name='checkbox2']").removeAttr("checked");
  968. if (familyStatusList[2] == 1)
  969. $("input[name='checkbox3']").prop("checked", "checked");
  970. else
  971. $("input[name='checkbox3']").removeAttr("checked");
  972. if (familyStatusList[3] == 1)
  973. $("input[name='checkbox4']").prop("checked", "checked");
  974. else
  975. $("input[name='checkbox4']").removeAttr("checked");
  976. if (familyStatusList[4] == 1)
  977. $("input[name='checkbox5']").prop("checked", "checked");
  978. else
  979. $("input[name='checkbox5']").removeAttr("checked");
  980. if (familyStatusList[5] == 1)
  981. $("input[name='checkbox6']").prop("checked", "checked");
  982. else
  983. $("input[name='checkbox6']").removeAttr("checked");
  984. if (familyStatusList[6] == 1)
  985. $("input[name='checkbox7']").prop("checked", "checked");
  986. else
  987. $("input[name='checkbox7']").removeAttr("checked");
  988. }
  989. // $("#js_input_user_status").val(getFamilyStatus(suspected.familyStatus));
  990. // $("#js_input_user_status").attr("data-values", suspected.familyStatus);
  991. // $("#jibenmiaoshu").val(suspected.statusDesp);
  992. $("#switchQuezhen").val(getMedical(suspected.medical));
  993. $("#switchQuezhen").attr("data-values", suspected.medical);
  994. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  995. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  996. $("#js_input_user_tiwen").val(suspected.temperature);
  997. $("#js_input_user_kesou").val(getCough(suspected.cough));
  998. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  999. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  1000. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  1001. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  1002. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  1003. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  1004. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  1005. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  1006. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  1007. $("#shuruqita").val(suspected.others);
  1008. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  1009. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  1010. $("#js_input_temperature_score").val(suspected.temperatureScore);
  1011. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  1012. $("#js_input_score").val(suspected.score);
  1013. }
  1014. },
  1015. });
  1016. }
  1017. function addReport() {
  1018. var userId = $("#userId").val();
  1019. $.ajax({
  1020. url: '/home/addReport',
  1021. type: "post",
  1022. data: {
  1023. "userCreate": userId,
  1024. },
  1025. success: function (data) {
  1026. $.toast(data.msg);
  1027. if (data.msg == "操作成功")
  1028. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1029. },
  1030. });
  1031. }
  1032. $("#my-input-ribao").calendar({
  1033. dateFormat: 'yyyy-mm-dd',
  1034. inputReadOnly: false,
  1035. onChange: function (p, values, displayValues) {
  1036. var reportDate = values.toString();
  1037. var userId = $("#userId").val();
  1038. $.ajax({
  1039. url: '/home/home/queryRibaoReportDate',
  1040. data: {
  1041. "userCreate": userId,
  1042. "reportDate": reportDate,
  1043. },
  1044. type: 'GET',
  1045. success: function (data) {
  1046. if (data.data == undefined) {
  1047. $('#ribao_famliy').empty();
  1048. }
  1049. else {
  1050. if (data.data.length > 0) {
  1051. $('#ribao_famliy').empty();
  1052. data.data.forEach(function (v) {
  1053. helpValue1(v);
  1054. });
  1055. } else {
  1056. }
  1057. }
  1058. },
  1059. error: function () {
  1060. }
  1061. });
  1062. }
  1063. });
  1064. function helpValue1(v) {
  1065. var userName = v.userName + ":";
  1066. var grender = getGreder(v.grender);
  1067. var age = v.age;
  1068. var familyStatus = "";
  1069. if (v.familyStatus != 0)
  1070. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  1071. var medical = "";
  1072. if (v.medical != 0)
  1073. medical = "是否确诊:" + getMedical(v.medical) + ";";
  1074. var singleRoom = "";
  1075. if (v.singleRoom != 0)
  1076. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  1077. if (v.singleRoom == 0 && v.medical != 0)
  1078. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  1079. var temperature = "体温:" + v.temperature + ";";
  1080. var cough = "";
  1081. if (v.cough != 0)
  1082. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  1083. var muscle = "";
  1084. if (v.muscle != 0)
  1085. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  1086. var dyspnea = "";
  1087. if (v.dyspnea != 0)
  1088. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  1089. var fatigue = "";
  1090. if (v.fatigue != 0)
  1091. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  1092. var diarrhea = "";
  1093. if (v.diarrhea != 0)
  1094. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  1095. var others = "";
  1096. if (v.others != "")
  1097. others = "其他描述:" + v.others + ";";
  1098. var scoreRezult = "";
  1099. if (v.scoreRezult != 0)
  1100. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  1101. $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
  1102. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
  1103. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
  1104. ' </div>\n' +
  1105. ' '));
  1106. }
  1107. function getGreder(greder) {
  1108. if (greder == 1)
  1109. return "男";
  1110. else if (greder == 2)
  1111. return "女";
  1112. return "";
  1113. }
  1114. function getFamilyStatus(familyStatus) {
  1115. var familyStatusList = familyStatus.split(",");
  1116. var familyStatusString = "";
  1117. if (familyStatus == '0,0,0,0,0,0,0')
  1118. familyStatusString += "无病史,";
  1119. else {
  1120. if (familyStatusList[0] == 1)
  1121. familyStatusString += "心脑血管疾病(服用ARB),";
  1122. if (familyStatusList[1] == 1)
  1123. familyStatusString += "心脑血管疾病(未服ARB),";
  1124. if (familyStatusList[2] == 1)
  1125. familyStatusString += "呼吸系统病史,";
  1126. if (familyStatusList[3] == 1)
  1127. familyStatusString += "肿瘤病史,";
  1128. if (familyStatusList[4] == 1)
  1129. familyStatusString += "糖尿病史,";
  1130. if (familyStatusList[5] == 1)
  1131. familyStatusString += "服用过激素药物,";
  1132. if (familyStatusList[6] == 1)
  1133. familyStatusString += "妊娠期,";
  1134. }
  1135. return familyStatusString.substring(0, familyStatusString.length - 1);
  1136. }
  1137. function getCough(cough) {
  1138. if (cough == 0)
  1139. return "无咳嗽";
  1140. else if (cough == 1)
  1141. return "偶尔短暂咳嗽";
  1142. else if (cough == 2)
  1143. return "咳嗽轻度影响生活";
  1144. else if (cough == 3)
  1145. return "咳嗽严重影响生活";
  1146. return "";
  1147. }
  1148. function getMuscle(muscle) {
  1149. if (muscle == 0)
  1150. return "无";
  1151. else if (muscle == 1)
  1152. return "按压有";
  1153. else if (muscle == 2)
  1154. return "偶尔";
  1155. else if (muscle == 3)
  1156. return "持续有";
  1157. return "";
  1158. }
  1159. function getDyspnea(dyspnea) {
  1160. if (dyspnea == 0)
  1161. return "无";
  1162. else if (dyspnea == 1)
  1163. return "急走或上坡气短";
  1164. else if (dyspnea == 2)
  1165. return "气短而走路变慢";
  1166. else if (dyspnea == 3)
  1167. return "走路数分钟后气短";
  1168. else if (dyspnea == 4)
  1169. return "气短无法离开房间";
  1170. return "";
  1171. }
  1172. function getFatigue(fatigue) {
  1173. if (fatigue == 0)
  1174. return "无";
  1175. else if (fatigue == 1)
  1176. return "体力劳动后不能恢复";
  1177. else if (fatigue == 2)
  1178. return "轻体力活非常累";
  1179. else if (fatigue == 3)
  1180. return "不能正常生活";
  1181. return "";
  1182. }
  1183. function getMedical(medical) {
  1184. if (medical == 0)
  1185. return "否";
  1186. else if (medical == 1)
  1187. return "是";
  1188. return "";
  1189. }
  1190. function getSingleRoom(singleRoom) {
  1191. if (singleRoom == 0)
  1192. return "否";
  1193. else if (singleRoom == 1)
  1194. return "是";
  1195. return "";
  1196. }
  1197. function getDiarrhea(diarrhea) {
  1198. if (diarrhea == 0)
  1199. return "无";
  1200. else if (diarrhea == 1)
  1201. return "轻度腹泻(少于3次)";
  1202. else if (diarrhea == 2)
  1203. return "中度腹泻(4-6次)";
  1204. else if (diarrhea == 3)
  1205. return "重度腹泻(超过6次)";
  1206. return "";
  1207. }
  1208. function clearShow() {
  1209. console.log("qingkong")
  1210. $("#suspectedId").val("");
  1211. $("#js_input_user_sex").val("");
  1212. $("#js_input_user_sex").attr("data-values", "");
  1213. $("#js_input_user_name").val("");
  1214. $("#js_input_user_age").val("");
  1215. $("#js_input_user_status").val("");
  1216. $("#js_input_user_status").attr("data-values", "");
  1217. $("#jibenmiaoshu").val("");
  1218. $("#switchQuezhen").val("");
  1219. $("#switchQuezhen").attr("data-values", "");
  1220. $("#switchDanjiangeli").val("");
  1221. $("#switchDanjiangeli").attr("data-values", "");
  1222. $("#js_input_user_tiwen").val("");
  1223. $("#js_input_user_kesou").val("");
  1224. $("#js_input_user_kesou").attr("data-values", "");
  1225. $("#js_input_user_jirou").val("");
  1226. $("#js_input_user_jirou").attr("data-values", "");
  1227. $("#js_input_user_huxi").val("");
  1228. $("#js_input_user_huxi").attr("data-values", "");
  1229. $("#js_input_user_fali").val("");
  1230. $("#js_input_user_fali").attr("data-values", "");
  1231. $("#js_input_user_fuxie").val("");
  1232. $("#js_input_user_fuxie").attr("data-values", "");
  1233. $("#shuruqita").val("");
  1234. $("#js_input_score_rezult").val("");
  1235. $("#js_input_score_rezult_value").val("");
  1236. $("#js_input_temperature_score").val("");
  1237. $("#js_input_score_histroy").val("");
  1238. $("#js_input_score").val("");
  1239. }
  1240. //健康评估
  1241. $('#ribao_score').on('click', function () {
  1242. var suspectedId = $("#suspectedId").val();
  1243. var userId = $("#userId").val();
  1244. var userName = $("#js_input_user_name").val();
  1245. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  1246. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  1247. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  1248. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  1249. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  1250. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  1251. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  1252. if (userName == undefined || userName == '') {
  1253. $.alert("请填写姓名");
  1254. return;
  1255. }
  1256. if (temperature <= 0) {
  1257. $.alert("请填写体温");
  1258. return;
  1259. }
  1260. if (temperature > 50 || temperature < 30) {
  1261. $.alert("请填写正确的体温");
  1262. return;
  1263. }
  1264. $.ajax({
  1265. url: '/home/addScore',
  1266. type: "post",
  1267. data: {
  1268. "userName": userName,
  1269. "suspectedId": suspectedId,
  1270. "userCreate": userId,
  1271. "medical": medical,
  1272. "temperature": temperature,
  1273. "cough": cough,
  1274. "muscle": muscle,
  1275. "dyspnea": dyspnea,
  1276. "fatigue": fatigue,
  1277. "diarrhea": diarrhea,
  1278. },
  1279. success: function (data) {
  1280. if (data == undefined) {
  1281. $('#js_input_score_rezult').empty();
  1282. $('#js_input_score_rezult_value').empty();
  1283. $('#js_input_temperature_score').empty();
  1284. $('#js_input_score_histroy').empty();
  1285. $('#js_input_score').empty();
  1286. }
  1287. else {
  1288. $('#js_input_score_rezult').empty();
  1289. $('#js_input_temperature_score').empty();
  1290. $('#js_input_score_histroy').empty();
  1291. $('#js_input_score').empty();
  1292. var ScoreRezult = getScoreRezult(data.scoreRezult, data.temperatureScore);
  1293. $("#js_input_score_rezult").val(ScoreRezult);
  1294. $("#js_input_score_rezult_value").val(data.scoreRezult);
  1295. $("#js_input_temperature_score").val(data.temperatureScore);
  1296. $("#js_input_score_histroy").val(data.scoreHistory);
  1297. $("#js_input_score").val(data.score);
  1298. }
  1299. },
  1300. });
  1301. });
  1302. function getScoreRezult(scoreRezult, temperatureScore) {
  1303. if (scoreRezult == 0)
  1304. return "未评估";
  1305. else if (scoreRezult == 1) {
  1306. if (temperatureScore > 1)
  1307. return "正常,间隔时间服用退烧药,多休息,多喝水";
  1308. else
  1309. return "正常";
  1310. }
  1311. else if (scoreRezult == 2) {
  1312. if (temperatureScore > 1)
  1313. return "注意观察,间隔时间服用退烧药,多休息,多喝水";
  1314. else
  1315. return "注意观察";
  1316. }
  1317. else if (scoreRezult == 3)
  1318. return "联系社区医生(或者在线问诊)";
  1319. else if (scoreRezult == 4)
  1320. return "尽快就诊";
  1321. return "";
  1322. }