ribao.js 51 KB

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