ribao.js 50 KB

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