ribao.js 50 KB

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