ribao.js 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587
  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; with:60%' 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. }
  537. },
  538. error: function () {
  539. }
  540. });
  541. }
  542. //刷新今日日报
  543. function ribao_refrash() {
  544. var userId = $("#userId").val();
  545. $.ajax({
  546. url: '/home/home/queryRibao',
  547. data: {
  548. userCreate: userId
  549. },
  550. type: 'GET',
  551. success: function (data) {
  552. console.log(data);
  553. if (data.data == undefined) {
  554. $('#rb_family').empty();
  555. }
  556. else {
  557. $('#rb_family').empty();
  558. if (data.data.length > 0) {
  559. hasData = true;
  560. data.data.forEach(function (v) {
  561. ribao_cell(v);
  562. });
  563. } else {
  564. }
  565. }
  566. },
  567. error: function () {
  568. }
  569. });
  570. }
  571. function ribao_cell(v) {
  572. var userName = v.userName + ":";
  573. var grender = getGreder(v.grender);
  574. var age = v.age;
  575. var familyStatus = "";
  576. if (v.familyStatus != 0)
  577. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  578. var medical = "";
  579. if (v.medical != 0)
  580. medical = "是否确诊:" + getMedical(v.medical) + ";";
  581. var singleRoom = "";
  582. if (v.singleRoom != 0)
  583. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  584. if (v.singleRoom == 0 && v.medical != 0)
  585. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  586. var temperature = "体温:" + v.temperature + ";";
  587. var cough = "";
  588. if (v.cough != 0)
  589. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  590. var muscle = "";
  591. if (v.muscle != 0)
  592. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  593. var dyspnea = "";
  594. if (v.dyspnea != 0)
  595. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  596. var fatigue = "";
  597. if (v.fatigue != 0)
  598. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  599. var diarrhea = "";
  600. if (v.diarrhea != 0)
  601. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  602. var others = "";
  603. if (v.others != "")
  604. others = "其他描述:" + v.others + ";";
  605. var scoreRezult = "";
  606. if (v.scoreRezult != 0)
  607. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  608. var workLocal = "";
  609. if (v.workLocal != 0) {
  610. if (v.workLocal < 4)
  611. workLocal = "工作驻地:" + getLocal(v.workLocal) + ";";
  612. else
  613. workLocal = "工作驻地:" + v.workLocalOther + ";";
  614. }
  615. var todayLocal = "";
  616. if (v.todayLocal != 0) {
  617. if (v.todayLocal < 4)
  618. todayLocal = "今日所在地:" + getLocal(v.todayLocal) + ";";
  619. else
  620. todayLocal = "今日所在地:" + v.todayLocalOther + ";";
  621. }
  622. var isTrip = "";
  623. if (v.isTrip != undefined)
  624. isTrip = "是否出行:" + getIsTrip(v.isTrip) + ";"
  625. $('#rb_family').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
  626. ' <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' +
  627. ' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改</a></h4>\n' +
  628. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + '</p>\n' +
  629. ' </div>\n' +
  630. ' '));
  631. }
  632. function ribao_add() {
  633. $('#btnAdd').on('click', function () {
  634. if ($('#ribao')[0].style.display == 'none') {
  635. $('#notOpenRibao').toggle();
  636. $('#ribao')[0].style.display = '';
  637. } else {
  638. $('#notOpenRibao')[0].style.display = '';
  639. $('#ribao')[0].style.display = 'none';
  640. }
  641. var userId = $("#userId").val();
  642. //获取用户家人
  643. $.ajax({
  644. url: '/home/selectAddSuspected',
  645. get: "get",
  646. data: {
  647. "userCreate": userId
  648. },
  649. success: function (data) {
  650. if (data != null || data != '') {
  651. //存在
  652. var suspected = data;
  653. $("#js_input_user_sex").val(getGreder(suspected.grender));
  654. $("#js_input_user_sex").attr("data-values", suspected.grender);
  655. $("#js_input_user_name").val(suspected.userName);
  656. $("#js_input_user_age").val(suspected.age);
  657. //基本情况
  658. if (suspected.familyStatus != "") {
  659. var familyStatusList = suspected.familyStatus.split(",");
  660. if (familyStatusList[0] == 1)
  661. $("input[name='checkbox1']").prop("checked", "checked");
  662. else
  663. $("input[name='checkbox1']").removeAttr("checked");
  664. if (familyStatusList[1] == 1)
  665. $("input[name='checkbox2']").prop("checked", "checked");
  666. else
  667. $("input[name='checkbox2']").removeAttr("checked");
  668. if (familyStatusList[2] == 1)
  669. $("input[name='checkbox3']").prop("checked", "checked");
  670. else
  671. $("input[name='checkbox3']").removeAttr("checked");
  672. if (familyStatusList[3] == 1)
  673. $("input[name='checkbox4']").prop("checked", "checked");
  674. else
  675. $("input[name='checkbox4']").removeAttr("checked");
  676. if (familyStatusList[4] == 1)
  677. $("input[name='checkbox5']").prop("checked", "checked");
  678. else
  679. $("input[name='checkbox5']").removeAttr("checked");
  680. if (familyStatusList[5] == 1)
  681. $("input[name='checkbox6']").prop("checked", "checked");
  682. else
  683. $("input[name='checkbox6']").removeAttr("checked");
  684. if (familyStatusList[6] == 1)
  685. $("input[name='checkbox7']").prop("checked", "checked");
  686. else
  687. $("input[name='checkbox7']").removeAttr("checked");
  688. }
  689. $("#switchQuezhen").val(getMedical(suspected.medical));
  690. $("#switchQuezhen").attr("data-values", suspected.medical);
  691. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  692. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  693. $("#js_input_user_tiwen").val(suspected.temperature);
  694. $("#js_input_user_kesou").val(getCough(suspected.cough));
  695. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  696. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  697. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  698. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  699. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  700. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  701. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  702. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  703. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  704. $("#shuruqita").val(suspected.others);
  705. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  706. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  707. $("#js_input_temperature_score").val(suspected.temperatureScore);
  708. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  709. $("#js_input_score").val(suspected.score);
  710. $("#js_input_sf").val(getIsTrip(0));
  711. $("#js_input_sf").attr("data-values", 0);
  712. $('#none')[0].style.display = 'none';
  713. }
  714. else {
  715. //基本情况
  716. $("input[name='checkbox1']").removeAttr("checked");
  717. $("input[name='checkbox2']").removeAttr("checked");
  718. $("input[name='checkbox3']").removeAttr("checked");
  719. $("input[name='checkbox4']").removeAttr("checked");
  720. $("input[name='checkbox5']").removeAttr("checked");
  721. $("input[name='checkbox6']").removeAttr("checked");
  722. $("input[name='checkbox7']").removeAttr("checked");
  723. $("#switchQuezhen").val(getMedical(0));
  724. $("#switchQuezhen").attr("data-values", 0);
  725. $("#switchDanjiangeli").val(getSingleRoom(0));
  726. $("#switchDanjiangeli").attr("data-values", 0);
  727. $("#js_input_user_tiwen").val(0);
  728. $("#js_input_user_kesou").val(getCough(0));
  729. $("#js_input_user_kesou").attr("data-values", 0);
  730. $("#js_input_user_jirou").val(getMuscle(0));
  731. $("#js_input_user_jirou").attr("data-values", 0);
  732. $("#js_input_user_huxi").val(getDyspnea(0));
  733. $("#js_input_user_huxi").attr("data-values", 0);
  734. $("#js_input_user_fali").val(getFatigue(0));
  735. $("#js_input_user_fali").attr("data-values", 0);
  736. $("#js_input_user_fuxie").val(getDiarrhea(0));
  737. $("#js_input_user_fuxie").attr("data-values", 0);
  738. // $("#js_input_cxfs").empty();
  739. // $("#js_input_cfd").empty();
  740. // $("#js_input_mdd").empty();
  741. // $('#js_input_cxfsq').val("");
  742. // $('#js_input_cfdq').val("");
  743. // $('#js_input_mddq').val("");
  744. // listcx.splice(0,listcx.length);
  745. // $('#tabtr').empty();
  746. // $("#js_input_qtdd").val("");
  747. // $("#js_input_jrszq").val("");
  748. // $("#js_input_sf").val("");
  749. $("#js_input_sf").val(getIsTrip(0));
  750. $("#js_input_sf").attr("data-values", 0);
  751. $('#none')[0].style.display = 'none';
  752. // $("#suspectedId").val("");
  753. // $("#js_input_gzzd").val("");
  754. // $("#js_input_jrszd").val("");
  755. // $('#js_input_mddq').attr("disabled","disabled");
  756. // $('#js_input_jrszq').attr("disabled","disabled");
  757. // $('#js_input_qtdd').attr("disabled","disabled");
  758. // $('#js_input_cfdq').attr("disabled","disabled");
  759. }
  760. },
  761. });
  762. });
  763. }
  764. function ribao_cancel() {
  765. $('#cancel').on('click', function () {
  766. if ($('#ribao')[0].style.display == 'none') {
  767. $('#notOpenRibao').toggle();
  768. $('#ribao')[0].style.display = '';
  769. } else {
  770. $('#notOpenRibao')[0].style.display = '';
  771. $('#ribao')[0].style.display = 'none';
  772. }
  773. clearShow();
  774. });
  775. }
  776. function ribaoCommit() {
  777. var suspectedId = $("#suspectedId").val();
  778. var userId = $("#userId").val();
  779. var userName = $("#js_input_user_name").val();
  780. var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
  781. var age = $("#js_input_user_age").val();
  782. //不能同时选择服用和未服用
  783. if ($("input[name='checkbox1']:checked").val() == "on" && $("input[name='checkbox2']:checked").val() == "on") {
  784. $.alert("心脑血管不能同时选择服用和未服用");
  785. return;
  786. }
  787. //男性不能选择妊娠期
  788. if ($("#js_input_user_sex").attr("data-values") == 1 && $("input[name='checkbox7']:checked").val() == "on") {
  789. $.alert("男性不能选择妊娠期");
  790. return;
  791. }
  792. //家庭状态
  793. var familyStatus = "";
  794. if ($("input[name='checkbox1']:checked").val() == "on")
  795. familyStatus += "1";
  796. else
  797. familyStatus += "0";
  798. if ($("input[name='checkbox2']:checked").val() == "on")
  799. familyStatus += ",1";
  800. else
  801. familyStatus += ",0";
  802. if ($("input[name='checkbox3']:checked").val() == "on")
  803. familyStatus += ",1";
  804. else
  805. familyStatus += ",0";
  806. if ($("input[name='checkbox4']:checked").val() == "on")
  807. familyStatus += ",1";
  808. else
  809. familyStatus += ",0";
  810. if ($("input[name='checkbox5']:checked").val() == "on")
  811. familyStatus += ",1";
  812. else
  813. familyStatus += ",0";
  814. if ($("input[name='checkbox6']:checked").val() == "on")
  815. familyStatus += ",1";
  816. else
  817. familyStatus += ",0";
  818. if ($("input[name='checkbox7']:checked").val() == "on")
  819. familyStatus += ",1";
  820. else
  821. familyStatus += ",0";
  822. //var familyStatus = $("#js_input_user_status").attr("data-values") == undefined ? 0 : $("#js_input_user_status").attr("data-values");
  823. //var statusDesp = $("#jibenmiaoshu").val() == undefined ? "" : $("#jibenmiaoshu").val();
  824. var statusDesp = "";
  825. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  826. var singleRoom = $("#switchDanjiangeli").attr("data-values") == undefined ? 0 : $("#switchDanjiangeli").attr("data-values");
  827. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  828. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  829. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  830. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  831. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  832. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  833. var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
  834. var scoreRezult = $("#js_input_score_rezult_value").val() == undefined ? "" : $("#js_input_score_rezult_value").val();
  835. var temperatureScore = $("#js_input_temperature_score").val() == undefined ? "" : $("#js_input_temperature_score").val();
  836. var scoreHistroy = $("#js_input_score_histroy").val() == undefined ? "" : $("#js_input_score_histroy").val();
  837. var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
  838. if (userName == undefined || userName == '') {
  839. $.alert("请填写姓名");
  840. return;
  841. }
  842. if (grender == 0) {
  843. $.alert("请填写性别");
  844. return;
  845. }
  846. if (age == undefined || age == '') {
  847. $.alert("请填写年龄");
  848. return;
  849. }
  850. if (age > 150 || age < 0) {
  851. $.alert("请填写正确的年龄");
  852. return;
  853. }
  854. if (temperature <= 0) {
  855. $.alert("请填写体温");
  856. return;
  857. }
  858. if (temperature > 50 || temperature < 30) {
  859. $.alert("请填写正确的体温");
  860. return;
  861. }
  862. //lingyun
  863. var gzzd = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
  864. var qtdd = $("#js_input_qtdd").val();
  865. var workLocal = "";
  866. var workLocalOther = "";
  867. if (gzzd == 0) {
  868. $.alert("请选择工作驻地");
  869. return;
  870. } else if (gzzd == 4 && qtdd == "") {
  871. $.alert("请填写工作驻地");
  872. return;
  873. } else if (gzzd != 0 && gzzd != 4) {
  874. if (gzzd == 1) {
  875. workLocal = 1;
  876. } else if (gzzd == 2) {
  877. workLocal = 2;
  878. } else if (gzzd == 3) {
  879. workLocal = 3;
  880. }
  881. } else if (gzzd == 4 && qtdd != "") {
  882. workLocal = 4;
  883. workLocalOther = qtdd;
  884. }
  885. //var listcx = [];
  886. //var person=new Object();
  887. var jrszd = $("#js_input_jrszd").attr("data-values") == undefined ? 0 : $("#js_input_jrszd").attr("data-values");
  888. var jrszq = $("#js_input_jrszq").val();
  889. var todyLocal = "";
  890. var todyLocalOther = "";
  891. if (jrszd == 0) {
  892. $.alert("请选择今日所在地");
  893. return;
  894. } else if (jrszd == 4 && jrszq == "") {
  895. $.alert("请填写今日所在地");
  896. return;
  897. } else if (jrszd != 0 && jrszd != 4) {
  898. if (jrszd == 1) {
  899. todyLocal = 1;
  900. } else if (jrszd == 2) {
  901. todyLocal = 2;
  902. } else if (jrszd == 3) {
  903. todyLocal = 3;
  904. }
  905. } else if (jrszd == 4 && jrszq != "") {
  906. todyLocal = 4;
  907. todyLocalOther = jrszq;
  908. }
  909. var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  910. var isTrip = "";
  911. if (sf == 3) {
  912. $.alert("请选择是否出行");
  913. return;
  914. } else {
  915. isTrip = sf;
  916. }
  917. var data = {
  918. "suspectedId": suspectedId,
  919. "userCreate": userId,
  920. "userName": userName,
  921. "grender": grender,
  922. "age": age,
  923. "familyStatus": familyStatus,
  924. "statusDesp": statusDesp,
  925. "medical": medical,
  926. "singleRoom": singleRoom,
  927. "temperature": temperature,
  928. "cough": cough,
  929. "muscle": muscle,
  930. "dyspnea": dyspnea,
  931. "fatigue": fatigue,
  932. "diarrhea": diarrhea,
  933. "others": others,
  934. "scoreRezult": scoreRezult,
  935. "temperatureScore": temperatureScore,
  936. "scoreHistroy": scoreHistroy,
  937. "score": score,
  938. "workLocal": workLocal,
  939. "workLocalOther": workLocalOther,
  940. "todayLocal": todyLocal,
  941. "todayLocalOther": todyLocalOther,
  942. "isTrip": isTrip,
  943. "tripDet": listcx,
  944. };
  945. $.ajax({
  946. url: '/home/addRibaoTrip',
  947. type: "post",
  948. contentType: "application/json; charset=utf-8",
  949. data: JSON.stringify(data),
  950. success: function (data) {
  951. if (data.msgReport == "2") {
  952. $.toast("家人姓名不能重复,如果重复,可以带上称呼");
  953. return;
  954. }
  955. if ($('#ribao')[0].style.display == 'none') {
  956. $('#notOpenRibao').toggle();
  957. $('#ribao')[0].style.display = '';
  958. } else {
  959. $('#notOpenRibao')[0].style.display = '';
  960. $('#ribao')[0].style.display = 'none';
  961. }
  962. $('#ribao_jinrijujian').empty();
  963. $('#ribao_jinrijujian').append(data.safetyNum);
  964. ribao_refrash();
  965. clearShow();
  966. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  967. },
  968. });
  969. }
  970. function deleteSuspected(suspectedId) {
  971. $.ajax({
  972. url: '/home/deleteSuspected',
  973. type: "post",
  974. data: {
  975. "suspectedId": suspectedId
  976. },
  977. success: function (data) {
  978. $('#ribao_jinrijujian').empty();
  979. $('#ribao_jinrijujian').append(data.safetyNum);
  980. ribao_refrash();
  981. },
  982. });
  983. }
  984. function updateSuspected(suspectedId) {
  985. $("#suspectedId").val("");
  986. if ($('#ribao')[0].style.display == 'none') {
  987. $('#notOpenRibao').toggle();
  988. $('#ribao')[0].style.display = '';
  989. } else {
  990. $('#notOpenRibao')[0].style.display = '';
  991. $('#ribao')[0].style.display = 'none';
  992. }
  993. $.ajax({
  994. url: '/home/selectSuspected',
  995. get: "get",
  996. data: {
  997. "suspectedId": suspectedId
  998. },
  999. success: function (data) {
  1000. // console.log(data);
  1001. if (data) {
  1002. var suspected = data;
  1003. $("#suspectedId").val(suspected.suspectedId);
  1004. $("#js_input_user_sex").val(getGreder(suspected.grender));
  1005. $("#js_input_user_sex").attr("data-values", suspected.grender);
  1006. $("#js_input_user_name").val(suspected.userName);
  1007. $("#js_input_user_age").val(suspected.age);
  1008. //基本情况
  1009. if (suspected.familyStatus != "") {
  1010. var familyStatusList = suspected.familyStatus.split(",");
  1011. if (familyStatusList[0] == 1)
  1012. $("input[name='checkbox1']").prop("checked", "checked");
  1013. else
  1014. $("input[name='checkbox1']").removeAttr("checked");
  1015. if (familyStatusList[1] == 1)
  1016. $("input[name='checkbox2']").prop("checked", "checked");
  1017. else
  1018. $("input[name='checkbox2']").removeAttr("checked");
  1019. if (familyStatusList[2] == 1)
  1020. $("input[name='checkbox3']").prop("checked", "checked");
  1021. else
  1022. $("input[name='checkbox3']").removeAttr("checked");
  1023. if (familyStatusList[3] == 1)
  1024. $("input[name='checkbox4']").prop("checked", "checked");
  1025. else
  1026. $("input[name='checkbox4']").removeAttr("checked");
  1027. if (familyStatusList[4] == 1)
  1028. $("input[name='checkbox5']").prop("checked", "checked");
  1029. else
  1030. $("input[name='checkbox5']").removeAttr("checked");
  1031. if (familyStatusList[5] == 1)
  1032. $("input[name='checkbox6']").prop("checked", "checked");
  1033. else
  1034. $("input[name='checkbox6']").removeAttr("checked");
  1035. if (familyStatusList[6] == 1)
  1036. $("input[name='checkbox7']").prop("checked", "checked");
  1037. else
  1038. $("input[name='checkbox7']").removeAttr("checked");
  1039. }
  1040. // $("#js_input_user_status").val(getFamilyStatus(suspected.familyStatus));
  1041. // $("#js_input_user_status").attr("data-values", suspected.familyStatus);
  1042. // $("#jibenmiaoshu").val(suspected.statusDesp);
  1043. $("#switchQuezhen").val(getMedical(suspected.medical));
  1044. $("#switchQuezhen").attr("data-values", suspected.medical);
  1045. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  1046. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  1047. $("#js_input_user_tiwen").val(suspected.temperature);
  1048. $("#js_input_user_kesou").val(getCough(suspected.cough));
  1049. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  1050. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  1051. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  1052. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  1053. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  1054. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  1055. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  1056. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  1057. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  1058. $("#shuruqita").val(suspected.others);
  1059. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  1060. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  1061. $("#js_input_temperature_score").val(suspected.temperatureScore);
  1062. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  1063. $("#js_input_score").val(suspected.score);
  1064. //行程
  1065. $("#js_input_gzzd").val(getLocal(suspected.workLocal));
  1066. $("#js_input_gzzd").attr("data-values", suspected.workLocal);
  1067. if (suspected.workLocal != 4) {
  1068. $('#js_input_qtdd').attr("disabled", "disabled");
  1069. $("#js_input_qtdd").val("");
  1070. } else {
  1071. $('#js_input_qtdd').removeAttr("disabled")
  1072. }
  1073. $("#js_input_qtdd").val(suspected.workLocalOther);
  1074. $("#js_input_jrszd").val(getLocal(suspected.todayLocal));
  1075. $("#js_input_jrszd").attr("data-values", suspected.todayLocal);
  1076. if (suspected.todayLocal != 4) {
  1077. $('#js_input_jrszq').attr("disabled", "disabled");
  1078. $("#js_input_jrszq").val("");
  1079. } else {
  1080. $('#js_input_jrszq').removeAttr("disabled")
  1081. }
  1082. $("#js_input_jrszq").val(suspected.todayLocalOther);
  1083. $("#js_input_sf").val(getIsTrip(suspected.isTrip));
  1084. $("#js_input_sf").attr("data-values", suspected.isTrip);
  1085. if (suspected.isTrip == 0)
  1086. $('#none')[0].style.display = 'none';
  1087. else
  1088. $('#none')[0].style.display = '';
  1089. //详细
  1090. $.ajax({
  1091. url: '/home/selectTripSuspected',
  1092. get: "get",
  1093. data: {
  1094. "suspectedId": suspectedId
  1095. },
  1096. success: function (data) {
  1097. alert(data);
  1098. },
  1099. });
  1100. }
  1101. },
  1102. });
  1103. }
  1104. function addReport() {
  1105. var userId = $("#userId").val();
  1106. $.ajax({
  1107. url: '/home/addReport',
  1108. type: "post",
  1109. data: {
  1110. "userCreate": userId,
  1111. },
  1112. success: function (data) {
  1113. $.toast(data.msg);
  1114. if (data.msg == "操作成功")
  1115. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1116. },
  1117. });
  1118. }
  1119. $("#my-input-ribao").calendar({
  1120. dateFormat: 'yyyy-mm-dd',
  1121. inputReadOnly: false,
  1122. onChange: function (p, values, displayValues) {
  1123. var reportDate = values.toString();
  1124. var userId = $("#userId").val();
  1125. $.ajax({
  1126. url: '/home/home/queryRibaoReportDate',
  1127. data: {
  1128. "userCreate": userId,
  1129. "reportDate": reportDate,
  1130. },
  1131. type: 'GET',
  1132. success: function (data) {
  1133. if (data.data == undefined) {
  1134. $('#ribao_famliy').empty();
  1135. }
  1136. else {
  1137. if (data.data.length > 0) {
  1138. $('#ribao_famliy').empty();
  1139. data.data.forEach(function (v) {
  1140. helpValue1(v);
  1141. });
  1142. } else {
  1143. }
  1144. }
  1145. },
  1146. error: function () {
  1147. }
  1148. });
  1149. }
  1150. });
  1151. function helpValue1(v) {
  1152. var userName = v.userName + ":";
  1153. var grender = getGreder(v.grender);
  1154. var age = v.age;
  1155. var familyStatus = "";
  1156. if (v.familyStatus != 0)
  1157. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  1158. var medical = "";
  1159. if (v.medical != 0)
  1160. medical = "是否确诊:" + getMedical(v.medical) + ";";
  1161. var singleRoom = "";
  1162. if (v.singleRoom != 0)
  1163. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  1164. if (v.singleRoom == 0 && v.medical != 0)
  1165. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  1166. var temperature = "体温:" + v.temperature + ";";
  1167. var cough = "";
  1168. if (v.cough != 0)
  1169. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  1170. var muscle = "";
  1171. if (v.muscle != 0)
  1172. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  1173. var dyspnea = "";
  1174. if (v.dyspnea != 0)
  1175. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  1176. var fatigue = "";
  1177. if (v.fatigue != 0)
  1178. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  1179. var diarrhea = "";
  1180. if (v.diarrhea != 0)
  1181. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  1182. var others = "";
  1183. if (v.others != "")
  1184. others = "其他描述:" + v.others + ";";
  1185. var scoreRezult = "";
  1186. if (v.scoreRezult != 0)
  1187. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  1188. var workLocal = "";
  1189. if (v.workLocal != 0) {
  1190. if (v.workLocal < 4)
  1191. workLocal = "工作驻地:" + getLocal(v.workLocal) + ";";
  1192. else
  1193. workLocal = "工作驻地:" + v.workLocalOther + ";";
  1194. }
  1195. var todayLocal = "";
  1196. if (v.todayLocal != 0) {
  1197. if (v.todayLocal < 4)
  1198. todayLocal = "今日所在地:" + getLocal(v.todayLocal) + ";";
  1199. else
  1200. todayLocal = "今日所在地:" + v.todayLocalOther + ";";
  1201. }
  1202. var isTrip = "";
  1203. if (v.isTrip != 0)
  1204. isTrip = "是否出行:" + getIsTrip(v.isTrip) + ";"
  1205. $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: 15vh">\n' +
  1206. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
  1207. ' <p class="weui-media-box__desc" style="height: 80%">' + familyStatus + medical + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + '</p>\n' +
  1208. ' </div>\n' +
  1209. ' '));
  1210. }
  1211. function getGreder(greder) {
  1212. if (greder == 1)
  1213. return "男";
  1214. else if (greder == 2)
  1215. return "女";
  1216. return "";
  1217. }
  1218. function getFamilyStatus(familyStatus) {
  1219. var familyStatusList = familyStatus.split(",");
  1220. var familyStatusString = "";
  1221. if (familyStatus == '0,0,0,0,0,0,0')
  1222. familyStatusString += "无病史,";
  1223. else {
  1224. if (familyStatusList[0] == 1)
  1225. familyStatusString += "心脑血管疾病(服用ARB),";
  1226. if (familyStatusList[1] == 1)
  1227. familyStatusString += "心脑血管疾病(未服ARB),";
  1228. if (familyStatusList[2] == 1)
  1229. familyStatusString += "呼吸系统病史,";
  1230. if (familyStatusList[3] == 1)
  1231. familyStatusString += "肿瘤病史,";
  1232. if (familyStatusList[4] == 1)
  1233. familyStatusString += "糖尿病史,";
  1234. if (familyStatusList[5] == 1)
  1235. familyStatusString += "服用过激素药物,";
  1236. if (familyStatusList[6] == 1)
  1237. familyStatusString += "妊娠期,";
  1238. }
  1239. return familyStatusString.substring(0, familyStatusString.length - 1);
  1240. }
  1241. function getCough(cough) {
  1242. if (cough == 0)
  1243. return "无咳嗽";
  1244. else if (cough == 1)
  1245. return "偶尔短暂咳嗽";
  1246. else if (cough == 2)
  1247. return "咳嗽轻度影响生活";
  1248. else if (cough == 3)
  1249. return "咳嗽严重影响生活";
  1250. return "";
  1251. }
  1252. function getMuscle(muscle) {
  1253. if (muscle == 0)
  1254. return "无";
  1255. else if (muscle == 1)
  1256. return "按压有";
  1257. else if (muscle == 2)
  1258. return "偶尔";
  1259. else if (muscle == 3)
  1260. return "持续有";
  1261. return "";
  1262. }
  1263. function getDyspnea(dyspnea) {
  1264. if (dyspnea == 0)
  1265. return "无";
  1266. else if (dyspnea == 1)
  1267. return "急走或上坡气短";
  1268. else if (dyspnea == 2)
  1269. return "气短而走路变慢";
  1270. else if (dyspnea == 3)
  1271. return "走路数分钟后气短";
  1272. else if (dyspnea == 4)
  1273. return "气短无法离开房间";
  1274. return "";
  1275. }
  1276. function getFatigue(fatigue) {
  1277. if (fatigue == 0)
  1278. return "无";
  1279. else if (fatigue == 1)
  1280. return "体力劳动后不能恢复";
  1281. else if (fatigue == 2)
  1282. return "轻体力活非常累";
  1283. else if (fatigue == 3)
  1284. return "不能正常生活";
  1285. return "";
  1286. }
  1287. function getMedical(medical) {
  1288. if (medical == 0)
  1289. return "否";
  1290. else if (medical == 1)
  1291. return "是";
  1292. return "";
  1293. }
  1294. function getSingleRoom(singleRoom) {
  1295. if (singleRoom == 0)
  1296. return "否";
  1297. else if (singleRoom == 1)
  1298. return "是";
  1299. return "";
  1300. }
  1301. function getIsTrip(isTrip) {
  1302. if (isTrip == 0)
  1303. return "否";
  1304. else if (isTrip == 1)
  1305. return "是";
  1306. return "";
  1307. }
  1308. function getLocal(local) {
  1309. if (local == 0)
  1310. return "";
  1311. else if (local == 1)
  1312. return "武汉市";
  1313. else if (local == 2)
  1314. return "宜昌市";
  1315. else if (local == 3)
  1316. return "当阳市";
  1317. else if (local == 4)
  1318. return "其它地点";
  1319. return "";
  1320. }
  1321. function getDiarrhea(diarrhea) {
  1322. if (diarrhea == 0)
  1323. return "无";
  1324. else if (diarrhea == 1)
  1325. return "轻度腹泻(少于3次)";
  1326. else if (diarrhea == 2)
  1327. return "中度腹泻(4-6次)";
  1328. else if (diarrhea == 3)
  1329. return "重度腹泻(超过6次)";
  1330. return "";
  1331. }
  1332. function clearShow() {
  1333. console.log("qingkong")
  1334. $("#suspectedId").val("");
  1335. $("#js_input_user_sex").val("");
  1336. $("#js_input_user_sex").attr("data-values", "");
  1337. $("#js_input_user_name").val("");
  1338. $("#js_input_user_age").val("");
  1339. $("#js_input_user_status").val("");
  1340. $("#js_input_user_status").attr("data-values", "");
  1341. $("#jibenmiaoshu").val("");
  1342. $("#switchQuezhen").val("");
  1343. $("#switchQuezhen").attr("data-values", "");
  1344. $("#switchDanjiangeli").val("");
  1345. $("#switchDanjiangeli").attr("data-values", "");
  1346. $("#js_input_user_tiwen").val("");
  1347. $("#js_input_user_kesou").val("");
  1348. $("#js_input_user_kesou").attr("data-values", "");
  1349. $("#js_input_user_jirou").val("");
  1350. $("#js_input_user_jirou").attr("data-values", "");
  1351. $("#js_input_user_huxi").val("");
  1352. $("#js_input_user_huxi").attr("data-values", "");
  1353. $("#js_input_user_fali").val("");
  1354. $("#js_input_user_fali").attr("data-values", "");
  1355. $("#js_input_user_fuxie").val("");
  1356. $("#js_input_user_fuxie").attr("data-values", "");
  1357. $("#shuruqita").val("");
  1358. $("#js_input_score_rezult").val("");
  1359. $("#js_input_score_rezult_value").val("");
  1360. $("#js_input_temperature_score").val("");
  1361. $("#js_input_score_histroy").val("");
  1362. $("#js_input_score").val("");
  1363. }
  1364. //健康评估
  1365. $('#ribao_score').on('click', function () {
  1366. var suspectedId = $("#suspectedId").val();
  1367. var userId = $("#userId").val();
  1368. var userName = $("#js_input_user_name").val();
  1369. var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  1370. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  1371. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  1372. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  1373. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  1374. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  1375. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  1376. if (userName == undefined || userName == '') {
  1377. $.alert("请填写姓名");
  1378. return;
  1379. }
  1380. if (temperature <= 0) {
  1381. $.alert("请填写体温");
  1382. return;
  1383. }
  1384. if (temperature > 50 || temperature < 30) {
  1385. $.alert("请填写正确的体温");
  1386. return;
  1387. }
  1388. $.ajax({
  1389. url: '/home/addScore',
  1390. type: "post",
  1391. data: {
  1392. "userName": userName,
  1393. "suspectedId": suspectedId,
  1394. "userCreate": userId,
  1395. "medical": medical,
  1396. "temperature": temperature,
  1397. "cough": cough,
  1398. "muscle": muscle,
  1399. "dyspnea": dyspnea,
  1400. "fatigue": fatigue,
  1401. "diarrhea": diarrhea,
  1402. },
  1403. success: function (data) {
  1404. if (data == undefined) {
  1405. $('#js_input_score_rezult').empty();
  1406. $('#js_input_score_rezult_value').empty();
  1407. $('#js_input_temperature_score').empty();
  1408. $('#js_input_score_histroy').empty();
  1409. $('#js_input_score').empty();
  1410. }
  1411. else {
  1412. $('#js_input_score_rezult').empty();
  1413. $('#js_input_temperature_score').empty();
  1414. $('#js_input_score_histroy').empty();
  1415. $('#js_input_score').empty();
  1416. var ScoreRezult = getScoreRezult(data.scoreRezult, data.temperatureScore);
  1417. $("#js_input_score_rezult").val(ScoreRezult);
  1418. $("#js_input_score_rezult_value").val(data.scoreRezult);
  1419. $("#js_input_temperature_score").val(data.temperatureScore);
  1420. $("#js_input_score_histroy").val(data.scoreHistory);
  1421. $("#js_input_score").val(data.score);
  1422. }
  1423. },
  1424. });
  1425. });
  1426. function getScoreRezult(scoreRezult, temperatureScore) {
  1427. if (scoreRezult == 0)
  1428. return "未评估";
  1429. else if (scoreRezult == 1) {
  1430. if (temperatureScore > 1)
  1431. return "正常,间隔时间服用退烧药,多休息,多喝水";
  1432. else
  1433. return "正常";
  1434. }
  1435. else if (scoreRezult == 2) {
  1436. if (temperatureScore > 1)
  1437. return "注意观察,间隔时间服用退烧药,多休息,多喝水";
  1438. else
  1439. return "注意观察";
  1440. }
  1441. else if (scoreRezult == 3)
  1442. return "联系社区医生(或者在线问诊)";
  1443. else if (scoreRezult == 4)
  1444. return "尽快就诊";
  1445. return "";
  1446. }