ribao.js 48 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423
  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. //添加出行详情
  358. var listcx = [];
  359. var person=new Object();
  360. function insertlingyun(){
  361. var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  362. if(sf == 0 || sf == 3){
  363. $.alert("请选择是否出行");
  364. return;
  365. }
  366. var cxfs = $("#js_input_cxfs").attr("data-values") == undefined ? 0 : $("#js_input_cxfs").attr("data-values");
  367. var cfd = $("#js_input_cfd").attr("data-values") == undefined ? 0 : $("#js_input_cfd").attr("data-values");
  368. var mdd = $("#js_input_mdd").attr("data-values") == undefined ? 0 : $("#js_input_mdd").attr("data-values");
  369. if(cxfs != 4 && cxfs !=0){
  370. var val = $('#js_input_cxfsq').val();
  371. if( val == ""){
  372. $.alert("请填写车次/航班/车牌");
  373. return;
  374. }
  375. person.tripTypeDesp = $('#js_input_cxfsq').val();
  376. if(cxfs == 1){
  377. person.tripType = 1;
  378. person.tripTypeStr = "长途汽车"
  379. }else if(cxfs == 2){
  380. person.tripType = 2;
  381. person.tripTypeStr = "火车";
  382. }else if(cxfs == 3){
  383. person.tripType = 3;
  384. person.tripTypeStr = "飞机";
  385. }
  386. }else if(cxfs == 0){
  387. $.alert("请选择出行方式");
  388. return;
  389. }else if(cxfs == 4){
  390. var val6 = $('#js_input_cxfsq').val();
  391. if( val6 == ""){
  392. $.alert("请填写车次/航班/车牌");
  393. return;
  394. }
  395. person.tripTypeStr = "自驾";
  396. person.tripType = 4;
  397. person.tripTypeDesp =$('#js_input_cxfsq').val();
  398. }
  399. if(cfd == 4 && cfd !=0){
  400. var val2 = $('#js_input_cfdq').val();
  401. if(val2 ==""){
  402. $.alert("请填写出发地");
  403. return;
  404. }
  405. person.startLocalOther = $('#js_input_cfdq').val();
  406. person.startLocalStr = $('#js_input_cfdq').val();
  407. }else if(cfd != 4 && cfd !=0){
  408. if(cfd ==1){
  409. person.startLocal = 1;
  410. person.startLocalStr = "武汉市";
  411. }else if(cfd == 2){
  412. person.startLocal = 2;
  413. person.startLocalStr = "宜昌市";
  414. }else if(cfd == 3){
  415. person.startLocal = 3;
  416. person.startLocalStr = "当阳市";
  417. }
  418. }else if(cfd ==0){
  419. $.alert("请选择出发地");
  420. return;
  421. }
  422. if(mdd ==4 && mdd!=0){
  423. var val3 = $('#js_input_mddq').val();
  424. if(val3 == ""){
  425. $.alert("请填写目的地");
  426. return;
  427. }
  428. person.endLocalOther = $('#js_input_mddq').val();
  429. person.endlocalStr = $('#js_input_mddq').val();
  430. }else if(mdd != 4 && mdd !=0){
  431. if(mdd ==1){
  432. person.endLocal = 1;
  433. person.endlocalStr = "武汉市";
  434. }else if(mdd == 2){
  435. person.endLocal = 2;
  436. person.endlocalStr = "宜昌市";
  437. }else if(mdd == 3){
  438. person.endLocal = 3;
  439. person.endlocalStr = "当阳市";
  440. }
  441. }else if(mdd == 0){
  442. $.alert("请选择目的地");
  443. return;
  444. }
  445. listcx.push(person);
  446. $.alert("添加成功");
  447. tab()
  448. }
  449. function tab(){
  450. var xxIds = [];
  451. var xxName = [
  452. "序号",
  453. "出发地",
  454. "目的地",
  455. "出行方式",
  456. "车次/航班/车牌",
  457. "操作"
  458. ];
  459. for (var i = 0; i < xxName.length; i++) {
  460. xxIds.push({
  461. name: xxName[i]
  462. });
  463. }
  464. $('#tabtr').empty();
  465. var html = "<tr style='background-color: #f8f8f8;'>";
  466. for (var i = 0; i < xxIds.length; i++) {
  467. // alert(xxIds[i].name);
  468. html += "<th>" + xxIds[i].name + "</th>";
  469. }
  470. html +="</tr>"
  471. for (var i = 0; i < listcx.length; i++) {//后端传过来的集合遍历
  472. if (i % 2 != 0) {
  473. html += "<tr style='background-color: #f8f8f8;'>";
  474. }
  475. else {
  476. html += "<tr>";
  477. }
  478. html += "<td style='text-align: center;'>" + (i + 1) + "</td>";
  479. // var isValue = false; //记录是否赋值
  480. html += "<td style='text-align: center;' >" + listcx[i].startLocalStr + " </td>";
  481. html += "<td style='text-align: center;' >" + listcx[i].endlocalStr + " </td>";
  482. html += "<td style='text-align: center;' >" + listcx[i].tripTypeStr + " </td>";
  483. html += "<td style='text-align: center;' >" + listcx[i].tripTypeDesp + " </td>";
  484. 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>";
  485. html += "</tr>";
  486. $("#tabtr").html(html);
  487. }
  488. }
  489. function splice(obj){
  490. listcx.splice(obj,1);
  491. tab()
  492. }
  493. //近日报告
  494. function ribaoInitialization(reportId) {
  495. if (reportId == null)
  496. return;
  497. $.ajax({
  498. url: '/home/home/queryRibaoRefresh',
  499. data: {
  500. reportId: reportId
  501. },
  502. type: 'GET',
  503. success: function (data) {
  504. console.log(data);
  505. if (data.data.length > 0) {
  506. hasData = true;
  507. data.data.forEach(function (v) {
  508. ribao_cell(v);
  509. });
  510. }
  511. },
  512. error: function () {
  513. }
  514. });
  515. }
  516. //刷新今日日报
  517. function ribao_refrash() {
  518. var userId = $("#userId").val();
  519. $.ajax({
  520. url: '/home/home/queryRibao',
  521. data: {
  522. userCreate: userId
  523. },
  524. type: 'GET',
  525. success: function (data) {
  526. console.log(data);
  527. if (data.data == undefined) {
  528. $('#rb_family').empty();
  529. }
  530. else {
  531. $('#rb_family').empty();
  532. if (data.data.length > 0) {
  533. hasData = true;
  534. data.data.forEach(function (v) {
  535. ribao_cell(v);
  536. });
  537. } else {
  538. }
  539. }
  540. },
  541. error: function () {
  542. }
  543. });
  544. }
  545. function ribao_cell(v) {
  546. var userName = v.userName + ":";
  547. var grender = getGreder(v.grender);
  548. var age = v.age;
  549. var familyStatus = "";
  550. if (v.familyStatus != 0)
  551. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  552. var medical = "";
  553. if (v.medical != 0)
  554. medical = "是否确诊:" + getMedical(v.medical) + ";";
  555. var singleRoom = "";
  556. if (v.singleRoom != 0)
  557. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  558. if (v.singleRoom == 0 && v.medical != 0)
  559. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  560. var temperature = "体温:" + v.temperature + ";";
  561. var cough = "";
  562. if (v.cough != 0)
  563. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  564. var muscle = "";
  565. if (v.muscle != 0)
  566. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  567. var dyspnea = "";
  568. if (v.dyspnea != 0)
  569. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  570. var fatigue = "";
  571. if (v.fatigue != 0)
  572. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  573. var diarrhea = "";
  574. if (v.diarrhea != 0)
  575. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  576. var others = "";
  577. if (v.others != "")
  578. others = "其他描述:" + v.others + ";";
  579. var scoreRezult = "";
  580. if (v.scoreRezult != 0)
  581. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  582. $('#rb_family').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
  583. ' <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' +
  584. ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改</a></h4>\n' +
  585. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
  586. ' </div>\n' +
  587. ' '));
  588. }
  589. function ribao_add() {
  590. $('#btnAdd').on('click', function () {
  591. $("#suspectedId").val("");
  592. if ($('#ribao')[0].style.display == 'none') {
  593. $('#notOpenRibao').toggle();
  594. $('#ribao')[0].style.display = '';
  595. } else {
  596. $('#notOpenRibao')[0].style.display = '';
  597. $('#ribao')[0].style.display = 'none';
  598. }
  599. var userId = $("#userId").val();
  600. //获取用户家人
  601. $.ajax({
  602. url: '/home/selectAddSuspected',
  603. get: "get",
  604. data: {
  605. "userCreate": userId
  606. },
  607. success: function (data) {
  608. if (data != null || data!='') {
  609. //存在
  610. var suspected = data;
  611. $("#js_input_user_sex").val(getGreder(suspected.grender));
  612. $("#js_input_user_sex").attr("data-values", suspected.grender);
  613. $("#js_input_user_name").val(suspected.userName);
  614. $("#js_input_user_age").val(suspected.age);
  615. //基本情况
  616. if (suspected.familyStatus != "") {
  617. var familyStatusList = suspected.familyStatus.split(",");
  618. if (familyStatusList[0] == 1)
  619. $("input[name='checkbox1']").prop("checked", "checked");
  620. else
  621. $("input[name='checkbox1']").removeAttr("checked");
  622. if (familyStatusList[1] == 1)
  623. $("input[name='checkbox2']").prop("checked", "checked");
  624. else
  625. $("input[name='checkbox2']").removeAttr("checked");
  626. if (familyStatusList[2] == 1)
  627. $("input[name='checkbox3']").prop("checked", "checked");
  628. else
  629. $("input[name='checkbox3']").removeAttr("checked");
  630. if (familyStatusList[3] == 1)
  631. $("input[name='checkbox4']").prop("checked", "checked");
  632. else
  633. $("input[name='checkbox4']").removeAttr("checked");
  634. if (familyStatusList[4] == 1)
  635. $("input[name='checkbox5']").prop("checked", "checked");
  636. else
  637. $("input[name='checkbox5']").removeAttr("checked");
  638. if (familyStatusList[5] == 1)
  639. $("input[name='checkbox6']").prop("checked", "checked");
  640. else
  641. $("input[name='checkbox6']").removeAttr("checked");
  642. if (familyStatusList[6] == 1)
  643. $("input[name='checkbox7']").prop("checked", "checked");
  644. else
  645. $("input[name='checkbox7']").removeAttr("checked");
  646. }
  647. $("#switchQuezhen").val(getMedical(suspected.medical));
  648. $("#switchQuezhen").attr("data-values", suspected.medical);
  649. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  650. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  651. $("#js_input_user_tiwen").val(suspected.temperature);
  652. $("#js_input_user_kesou").val(getCough(suspected.cough));
  653. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  654. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  655. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  656. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  657. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  658. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  659. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  660. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  661. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  662. $("#shuruqita").val(suspected.others);
  663. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  664. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  665. $("#js_input_temperature_score").val(suspected.temperatureScore);
  666. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  667. $("#js_input_score").val(suspected.score);
  668. }
  669. else {
  670. //基本情况
  671. $("input[name='checkbox1']").removeAttr("checked");
  672. $("input[name='checkbox2']").removeAttr("checked");
  673. $("input[name='checkbox3']").removeAttr("checked");
  674. $("input[name='checkbox4']").removeAttr("checked");
  675. $("input[name='checkbox5']").removeAttr("checked");
  676. $("input[name='checkbox6']").removeAttr("checked");
  677. $("input[name='checkbox7']").removeAttr("checked");
  678. $("#switchQuezhen").val(getMedical(0));
  679. $("#switchQuezhen").attr("data-values", 0);
  680. $("#switchDanjiangeli").val(getSingleRoom(0));
  681. $("#switchDanjiangeli").attr("data-values", 0);
  682. $("#js_input_user_tiwen").val(0);
  683. $("#js_input_user_kesou").val(getCough(0));
  684. $("#js_input_user_kesou").attr("data-values", 0);
  685. $("#js_input_user_jirou").val(getMuscle(0));
  686. $("#js_input_user_jirou").attr("data-values", 0);
  687. $("#js_input_user_huxi").val(getDyspnea(0));
  688. $("#js_input_user_huxi").attr("data-values", 0);
  689. $("#js_input_user_fali").val(getFatigue(0));
  690. $("#js_input_user_fali").attr("data-values", 0);
  691. $("#js_input_user_fuxie").val(getDiarrhea(0));
  692. $("#js_input_user_fuxie").attr("data-values", 0);
  693. }
  694. },
  695. });
  696. });
  697. }
  698. function ribao_cancel() {
  699. $('#cancel').on('click', function () {
  700. if ($('#ribao')[0].style.display == 'none') {
  701. $('#notOpenRibao').toggle();
  702. $('#ribao')[0].style.display = '';
  703. } else {
  704. $('#notOpenRibao')[0].style.display = '';
  705. $('#ribao')[0].style.display = 'none';
  706. }
  707. clearShow();
  708. });
  709. }
  710. function ribaoCommit() {
  711. var suspectedId = $("#suspectedId").val();
  712. var userId = $("#userId").val();
  713. var userName = $("#js_input_user_name").val();
  714. var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
  715. var age = $("#js_input_user_age").val();
  716. //不能同时选择服用和未服用
  717. if ($("input[name='checkbox1']:checked").val() == "on" && $("input[name='checkbox2']:checked").val() == "on") {
  718. $.alert("心脑血管不能同时选择服用和未服用");
  719. return;
  720. }
  721. //男性不能选择妊娠期
  722. if ($("#js_input_user_sex").attr("data-values") == 1 && $("input[name='checkbox7']:checked").val() == "on") {
  723. $.alert("男性不能选择妊娠期");
  724. return;
  725. }
  726. //家庭状态
  727. var familyStatus = "";
  728. if ($("input[name='checkbox1']:checked").val() == "on")
  729. familyStatus += "1";
  730. else
  731. familyStatus += "0";
  732. if ($("input[name='checkbox2']:checked").val() == "on")
  733. familyStatus += ",1";
  734. else
  735. familyStatus += ",0";
  736. if ($("input[name='checkbox3']:checked").val() == "on")
  737. familyStatus += ",1";
  738. else
  739. familyStatus += ",0";
  740. if ($("input[name='checkbox4']:checked").val() == "on")
  741. familyStatus += ",1";
  742. else
  743. familyStatus += ",0";
  744. if ($("input[name='checkbox5']:checked").val() == "on")
  745. familyStatus += ",1";
  746. else
  747. familyStatus += ",0";
  748. if ($("input[name='checkbox6']:checked").val() == "on")
  749. familyStatus += ",1";
  750. else
  751. familyStatus += ",0";
  752. if ($("input[name='checkbox7']:checked").val() == "on")
  753. familyStatus += ",1";
  754. else
  755. familyStatus += ",0";
  756. //var familyStatus = $("#js_input_user_status").attr("data-values") == undefined ? 0 : $("#js_input_user_status").attr("data-values");
  757. //var statusDesp = $("#jibenmiaoshu").val() == undefined ? "" : $("#jibenmiaoshu").val();
  758. var statusDesp = "";
  759. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  760. var singleRoom = $("#switchDanjiangeli").attr("data-values") == undefined ? 0 : $("#switchDanjiangeli").attr("data-values");
  761. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  762. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  763. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  764. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  765. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  766. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  767. var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
  768. var scoreRezult = $("#js_input_score_rezult_value").val() == undefined ? "" : $("#js_input_score_rezult_value").val();
  769. var temperatureScore = $("#js_input_temperature_score").val() == undefined ? "" : $("#js_input_temperature_score").val();
  770. var scoreHistroy = $("#js_input_score_histroy").val() == undefined ? "" : $("#js_input_score_histroy").val();
  771. var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
  772. if (userName == undefined || userName == '') {
  773. $.alert("请填写姓名");
  774. return;
  775. }
  776. if (grender == 0) {
  777. $.alert("请填写性别");
  778. return;
  779. }
  780. if (age == undefined || age == '') {
  781. $.alert("请填写年龄");
  782. return;
  783. }
  784. if (age > 150 || age < 0) {
  785. $.alert("请填写正确的年龄");
  786. return;
  787. }
  788. if (temperature <= 0) {
  789. $.alert("请填写体温");
  790. return;
  791. }
  792. if (temperature > 50 || temperature < 30) {
  793. $.alert("请填写正确的体温");
  794. return;
  795. }
  796. //lingyun
  797. var gzzd = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
  798. var qtdd = $("#js_input_qtdd").val();
  799. var workLocal="";
  800. var workLocalOther = "";
  801. if(gzzd == 0){
  802. $.alert("请选择工作驻地");
  803. return;
  804. }else if(gzzd == 4 && qtdd == ""){
  805. $.alert("请填写工作驻地");
  806. return;
  807. }else if(gzzd != 0 && gzzd !=4){
  808. if(gzzd ==1){
  809. workLocal = 1;
  810. }else if(gzzd == 2){
  811. workLocal = 2;
  812. }else if(gzzd == 3){
  813. workLocal = 3;
  814. }
  815. }else if(gzzd == 4 && qtdd != ""){
  816. workLocal = 4;
  817. workLocalOther = qtdd;
  818. }
  819. //var listcx = [];
  820. //var person=new Object();
  821. var jrszd = $("#js_input_jrszd").attr("data-values") == undefined ? 0 : $("#js_input_jrszd").attr("data-values");
  822. var jrszq = $("#js_input_jrszq").val();
  823. var todyLocal ="";
  824. var todyLocalOther = "";
  825. if(jrszd == 0){
  826. $.alert("请选择今日所在地");
  827. return;
  828. }else if(jrszd == 4 && jrszq == ""){
  829. $.alert("请填写今日所在地");
  830. return;
  831. }else if(jrszd != 0 && jrszd !=4){
  832. if(jrszd ==1){
  833. todyLocal = 1;
  834. }else if(jrszd == 2){
  835. todyLocal = 2;
  836. }else if(jrszd == 3){
  837. todyLocal = 3;
  838. }
  839. }else if(jrszd == 4 && jrszq != ""){
  840. todyLocal = 4;
  841. todyLocalOther = jrszq;
  842. }
  843. var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  844. var isTrip= "";
  845. if(sf == 3){
  846. $.alert("请选择是否出行");
  847. return;
  848. }else{
  849. isTrip = sf;
  850. }
  851. console.log(JSON.stringify(listcx))
  852. $.ajax({
  853. url: '/home/addRibaoTrip',
  854. type: "post",
  855. data: {
  856. "suspectedId": suspectedId,
  857. "userCreate": userId,
  858. "userName": userName,
  859. "grender": grender,
  860. "age": age,
  861. "familyStatus": familyStatus,
  862. "statusDesp": statusDesp,
  863. "medical": medical,
  864. "singleRoom": singleRoom,
  865. "temperature": temperature,
  866. "cough": cough,
  867. "muscle": muscle,
  868. "dyspnea": dyspnea,
  869. "fatigue": fatigue,
  870. "diarrhea": diarrhea,
  871. "others": others,
  872. "scoreRezult": scoreRezult,
  873. "temperatureScore": temperatureScore,
  874. "scoreHistroy": scoreHistroy,
  875. "score": score,
  876. "workLocal": JSON.stringify(workLocal),
  877. "workLocalOther": JSON.stringify(workLocalOther),
  878. "todyLocal": JSON.stringify(todyLocal),
  879. "todyLocalOther": JSON.stringify(todyLocalOther),
  880. "isTrip": JSON.stringify(isTrip),
  881. "listcx": JSON.stringify(listcx),
  882. },
  883. success: function (data) {
  884. if (data.msgReport == "2") {
  885. $.toast("家人姓名不能重复,如果重复,可以带上称呼");
  886. return;
  887. }
  888. if ($('#ribao')[0].style.display == 'none') {
  889. $('#notOpenRibao').toggle();
  890. $('#ribao')[0].style.display = '';
  891. } else {
  892. $('#notOpenRibao')[0].style.display = '';
  893. $('#ribao')[0].style.display = 'none';
  894. }
  895. $('#ribao_jinrijujian').empty();
  896. $('#ribao_jinrijujian').append(data.safetyNum);
  897. ribao_refrash();
  898. clearShow();
  899. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  900. },
  901. });
  902. }
  903. function deleteSuspected(suspectedId) {
  904. $.ajax({
  905. url: '/home/deleteSuspected',
  906. type: "post",
  907. data: {
  908. "suspectedId": suspectedId
  909. },
  910. success: function (data) {
  911. $('#ribao_jinrijujian').empty();
  912. $('#ribao_jinrijujian').append(data.safetyNum);
  913. ribao_refrash();
  914. },
  915. });
  916. }
  917. function updateSuspected(suspectedId) {
  918. $("#suspectedId").val("");
  919. if ($('#ribao')[0].style.display == 'none') {
  920. $('#notOpenRibao').toggle();
  921. $('#ribao')[0].style.display = '';
  922. } else {
  923. $('#notOpenRibao')[0].style.display = '';
  924. $('#ribao')[0].style.display = 'none';
  925. }
  926. $.ajax({
  927. url: '/home/selectSuspected',
  928. get: "get",
  929. data: {
  930. "suspectedId": suspectedId
  931. },
  932. success: function (data) {
  933. // console.log(data);
  934. if (data) {
  935. var suspected = data;
  936. $("#suspectedId").val(suspected.suspectedId);
  937. $("#js_input_user_sex").val(getGreder(suspected.grender));
  938. $("#js_input_user_sex").attr("data-values", suspected.grender);
  939. $("#js_input_user_name").val(suspected.userName);
  940. $("#js_input_user_age").val(suspected.age);
  941. //基本情况
  942. if (suspected.familyStatus != "") {
  943. var familyStatusList = suspected.familyStatus.split(",");
  944. if (familyStatusList[0] == 1)
  945. $("input[name='checkbox1']").prop("checked", "checked");
  946. else
  947. $("input[name='checkbox1']").removeAttr("checked");
  948. if (familyStatusList[1] == 1)
  949. $("input[name='checkbox2']").prop("checked", "checked");
  950. else
  951. $("input[name='checkbox2']").removeAttr("checked");
  952. if (familyStatusList[2] == 1)
  953. $("input[name='checkbox3']").prop("checked", "checked");
  954. else
  955. $("input[name='checkbox3']").removeAttr("checked");
  956. if (familyStatusList[3] == 1)
  957. $("input[name='checkbox4']").prop("checked", "checked");
  958. else
  959. $("input[name='checkbox4']").removeAttr("checked");
  960. if (familyStatusList[4] == 1)
  961. $("input[name='checkbox5']").prop("checked", "checked");
  962. else
  963. $("input[name='checkbox5']").removeAttr("checked");
  964. if (familyStatusList[5] == 1)
  965. $("input[name='checkbox6']").prop("checked", "checked");
  966. else
  967. $("input[name='checkbox6']").removeAttr("checked");
  968. if (familyStatusList[6] == 1)
  969. $("input[name='checkbox7']").prop("checked", "checked");
  970. else
  971. $("input[name='checkbox7']").removeAttr("checked");
  972. }
  973. // $("#js_input_user_status").val(getFamilyStatus(suspected.familyStatus));
  974. // $("#js_input_user_status").attr("data-values", suspected.familyStatus);
  975. // $("#jibenmiaoshu").val(suspected.statusDesp);
  976. $("#switchQuezhen").val(getMedical(suspected.medical));
  977. $("#switchQuezhen").attr("data-values", suspected.medical);
  978. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  979. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  980. $("#js_input_user_tiwen").val(suspected.temperature);
  981. $("#js_input_user_kesou").val(getCough(suspected.cough));
  982. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  983. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  984. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  985. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  986. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  987. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  988. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  989. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  990. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  991. $("#shuruqita").val(suspected.others);
  992. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  993. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  994. $("#js_input_temperature_score").val(suspected.temperatureScore);
  995. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  996. $("#js_input_score").val(suspected.score);
  997. }
  998. },
  999. });
  1000. }
  1001. function addReport() {
  1002. var userId = $("#userId").val();
  1003. $.ajax({
  1004. url: '/home/addReport',
  1005. type: "post",
  1006. data: {
  1007. "userCreate": userId,
  1008. },
  1009. success: function (data) {
  1010. $.toast(data.msg);
  1011. if (data.msg == "操作成功")
  1012. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1013. },
  1014. });
  1015. }
  1016. $("#my-input-ribao").calendar({
  1017. dateFormat: 'yyyy-mm-dd',
  1018. inputReadOnly: false,
  1019. onChange: function (p, values, displayValues) {
  1020. var reportDate = values.toString();
  1021. var userId = $("#userId").val();
  1022. $.ajax({
  1023. url: '/home/home/queryRibaoReportDate',
  1024. data: {
  1025. "userCreate": userId,
  1026. "reportDate": reportDate,
  1027. },
  1028. type: 'GET',
  1029. success: function (data) {
  1030. if (data.data == undefined) {
  1031. $('#ribao_famliy').empty();
  1032. }
  1033. else {
  1034. if (data.data.length > 0) {
  1035. $('#ribao_famliy').empty();
  1036. data.data.forEach(function (v) {
  1037. helpValue1(v);
  1038. });
  1039. } else {
  1040. }
  1041. }
  1042. },
  1043. error: function () {
  1044. }
  1045. });
  1046. }
  1047. });
  1048. function helpValue1(v) {
  1049. var userName = v.userName + ":";
  1050. var grender = getGreder(v.grender);
  1051. var age = v.age;
  1052. var familyStatus = "";
  1053. if (v.familyStatus != 0)
  1054. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  1055. var medical = "";
  1056. if (v.medical != 0)
  1057. medical = "是否确诊:" + getMedical(v.medical) + ";";
  1058. var singleRoom = "";
  1059. if (v.singleRoom != 0)
  1060. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  1061. if (v.singleRoom == 0 && v.medical != 0)
  1062. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  1063. var temperature = "体温:" + v.temperature + ";";
  1064. var cough = "";
  1065. if (v.cough != 0)
  1066. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  1067. var muscle = "";
  1068. if (v.muscle != 0)
  1069. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  1070. var dyspnea = "";
  1071. if (v.dyspnea != 0)
  1072. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  1073. var fatigue = "";
  1074. if (v.fatigue != 0)
  1075. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  1076. var diarrhea = "";
  1077. if (v.diarrhea != 0)
  1078. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  1079. var others = "";
  1080. if (v.others != "")
  1081. others = "其他描述:" + v.others + ";";
  1082. var scoreRezult = "";
  1083. if (v.scoreRezult != 0)
  1084. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  1085. $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
  1086. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
  1087. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + '</p>\n' +
  1088. ' </div>\n' +
  1089. ' '));
  1090. }
  1091. function getGreder(greder) {
  1092. if (greder == 1)
  1093. return "男";
  1094. else if (greder == 2)
  1095. return "女";
  1096. return "";
  1097. }
  1098. function getFamilyStatus(familyStatus) {
  1099. var familyStatusList = familyStatus.split(",");
  1100. var familyStatusString = "";
  1101. if (familyStatus == '0,0,0,0,0,0,0')
  1102. familyStatusString += "无病史,";
  1103. else {
  1104. if (familyStatusList[0] == 1)
  1105. familyStatusString += "心脑血管疾病(服用ARB),";
  1106. if (familyStatusList[1] == 1)
  1107. familyStatusString += "心脑血管疾病(未服ARB),";
  1108. if (familyStatusList[2] == 1)
  1109. familyStatusString += "呼吸系统病史,";
  1110. if (familyStatusList[3] == 1)
  1111. familyStatusString += "肿瘤病史,";
  1112. if (familyStatusList[4] == 1)
  1113. familyStatusString += "糖尿病史,";
  1114. if (familyStatusList[5] == 1)
  1115. familyStatusString += "服用过激素药物,";
  1116. if (familyStatusList[6] == 1)
  1117. familyStatusString += "妊娠期,";
  1118. }
  1119. return familyStatusString.substring(0, familyStatusString.length - 1);
  1120. }
  1121. function getCough(cough) {
  1122. if (cough == 0)
  1123. return "无咳嗽";
  1124. else if (cough == 1)
  1125. return "偶尔短暂咳嗽";
  1126. else if (cough == 2)
  1127. return "咳嗽轻度影响生活";
  1128. else if (cough == 3)
  1129. return "咳嗽严重影响生活";
  1130. return "";
  1131. }
  1132. function getMuscle(muscle) {
  1133. if (muscle == 0)
  1134. return "无";
  1135. else if (muscle == 1)
  1136. return "按压有";
  1137. else if (muscle == 2)
  1138. return "偶尔";
  1139. else if (muscle == 3)
  1140. return "持续有";
  1141. return "";
  1142. }
  1143. function getDyspnea(dyspnea) {
  1144. if (dyspnea == 0)
  1145. return "无";
  1146. else if (dyspnea == 1)
  1147. return "急走或上坡气短";
  1148. else if (dyspnea == 2)
  1149. return "气短而走路变慢";
  1150. else if (dyspnea == 3)
  1151. return "走路数分钟后气短";
  1152. else if (dyspnea == 4)
  1153. return "气短无法离开房间";
  1154. return "";
  1155. }
  1156. function getFatigue(fatigue) {
  1157. if (fatigue == 0)
  1158. return "无";
  1159. else if (fatigue == 1)
  1160. return "体力劳动后不能恢复";
  1161. else if (fatigue == 2)
  1162. return "轻体力活非常累";
  1163. else if (fatigue == 3)
  1164. return "不能正常生活";
  1165. return "";
  1166. }
  1167. function getMedical(medical) {
  1168. if (medical == 0)
  1169. return "否";
  1170. else if (medical == 1)
  1171. return "是";
  1172. return "";
  1173. }
  1174. function getSingleRoom(singleRoom) {
  1175. if (singleRoom == 0)
  1176. return "否";
  1177. else if (singleRoom == 1)
  1178. return "是";
  1179. return "";
  1180. }
  1181. function getDiarrhea(diarrhea) {
  1182. if (diarrhea == 0)
  1183. return "无";
  1184. else if (diarrhea == 1)
  1185. return "轻度腹泻(少于3次)";
  1186. else if (diarrhea == 2)
  1187. return "中度腹泻(4-6次)";
  1188. else if (diarrhea == 3)
  1189. return "重度腹泻(超过6次)";
  1190. return "";
  1191. }
  1192. function clearShow() {
  1193. console.log("qingkong")
  1194. $("#suspectedId").val("");
  1195. $("#js_input_user_sex").val("");
  1196. $("#js_input_user_sex").attr("data-values", "");
  1197. $("#js_input_user_name").val("");
  1198. $("#js_input_user_age").val("");
  1199. $("#js_input_user_status").val("");
  1200. $("#js_input_user_status").attr("data-values", "");
  1201. $("#jibenmiaoshu").val("");
  1202. $("#switchQuezhen").val("");
  1203. $("#switchQuezhen").attr("data-values", "");
  1204. $("#switchDanjiangeli").val("");
  1205. $("#switchDanjiangeli").attr("data-values", "");
  1206. $("#js_input_user_tiwen").val("");
  1207. $("#js_input_user_kesou").val("");
  1208. $("#js_input_user_kesou").attr("data-values", "");
  1209. $("#js_input_user_jirou").val("");
  1210. $("#js_input_user_jirou").attr("data-values", "");
  1211. $("#js_input_user_huxi").val("");
  1212. $("#js_input_user_huxi").attr("data-values", "");
  1213. $("#js_input_user_fali").val("");
  1214. $("#js_input_user_fali").attr("data-values", "");
  1215. $("#js_input_user_fuxie").val("");
  1216. $("#js_input_user_fuxie").attr("data-values", "");
  1217. $("#shuruqita").val("");
  1218. $("#js_input_score_rezult").val("");
  1219. $("#js_input_score_rezult_value").val("");
  1220. $("#js_input_temperature_score").val("");
  1221. $("#js_input_score_histroy").val("");
  1222. $("#js_input_score").val("");
  1223. }
  1224. //健康评估
  1225. $('#ribao_score').on('click', function () {
  1226. var suspectedId = $("#suspectedId").val();
  1227. var userId = $("#userId").val();
  1228. var userName = $("#js_input_user_name").val();
  1229. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  1230. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  1231. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  1232. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  1233. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  1234. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  1235. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  1236. if (userName == undefined || userName == '') {
  1237. $.alert("请填写姓名");
  1238. return;
  1239. }
  1240. if (temperature <= 0) {
  1241. $.alert("请填写体温");
  1242. return;
  1243. }
  1244. if (temperature > 50 || temperature < 30) {
  1245. $.alert("请填写正确的体温");
  1246. return;
  1247. }
  1248. $.ajax({
  1249. url: '/home/addScore',
  1250. type: "post",
  1251. data: {
  1252. "userName": userName,
  1253. "suspectedId": suspectedId,
  1254. "userCreate": userId,
  1255. "medical": medical,
  1256. "temperature": temperature,
  1257. "cough": cough,
  1258. "muscle": muscle,
  1259. "dyspnea": dyspnea,
  1260. "fatigue": fatigue,
  1261. "diarrhea": diarrhea,
  1262. },
  1263. success: function (data) {
  1264. if (data == undefined) {
  1265. $('#js_input_score_rezult').empty();
  1266. $('#js_input_score_rezult_value').empty();
  1267. $('#js_input_temperature_score').empty();
  1268. $('#js_input_score_histroy').empty();
  1269. $('#js_input_score').empty();
  1270. }
  1271. else {
  1272. $('#js_input_score_rezult').empty();
  1273. $('#js_input_temperature_score').empty();
  1274. $('#js_input_score_histroy').empty();
  1275. $('#js_input_score').empty();
  1276. var ScoreRezult = getScoreRezult(data.scoreRezult, data.temperatureScore);
  1277. $("#js_input_score_rezult").val(ScoreRezult);
  1278. $("#js_input_score_rezult_value").val(data.scoreRezult);
  1279. $("#js_input_temperature_score").val(data.temperatureScore);
  1280. $("#js_input_score_histroy").val(data.scoreHistory);
  1281. $("#js_input_score").val(data.score);
  1282. }
  1283. },
  1284. });
  1285. });
  1286. function getScoreRezult(scoreRezult, temperatureScore) {
  1287. if (scoreRezult == 0)
  1288. return "未评估";
  1289. else if (scoreRezult == 1) {
  1290. if (temperatureScore > 1)
  1291. return "正常,间隔时间服用退烧药,多休息,多喝水";
  1292. else
  1293. return "正常";
  1294. }
  1295. else if (scoreRezult == 2) {
  1296. if (temperatureScore > 1)
  1297. return "注意观察,间隔时间服用退烧药,多休息,多喝水";
  1298. else
  1299. return "注意观察";
  1300. }
  1301. else if (scoreRezult == 3)
  1302. return "联系社区医生(或者在线问诊)";
  1303. else if (scoreRezult == 4)
  1304. return "尽快就诊";
  1305. return "";
  1306. }