ribao.js 50 KB

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