ribao.js 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118
  1. function ribao_init() {
  2. $.ajax({
  3. url: '/wx/jsApiConfig',
  4. type: "get",
  5. data: {
  6. "url": location.href.split('#')[0]
  7. },
  8. success: function (data) {
  9. wx.config({
  10. debug: false,
  11. appId: data.data.appId,
  12. timestamp: data.data.timestamp,
  13. nonceStr: data.data.nonceStr,
  14. signature: data.data.signature,
  15. jsApiList: [
  16. // 所有要调用的 API 都要加到这个列表中
  17. 'getLocation'
  18. ]
  19. });
  20. wx.ready(function () {
  21. wx.checkJsApi({
  22. jsApiList: [
  23. 'getLocation'
  24. ],
  25. success: function (res) {
  26. // alert(JSON.stringify(res));
  27. // alert(JSON.stringify(res.checkResult.getLocation));
  28. if (res.checkResult.getLocation == false) {
  29. alert('你的微信版本太低,不支持微信JS接口,请升级到最新的微信版本!');
  30. return;
  31. }
  32. }
  33. });
  34. wx.error(function (res) {
  35. alert("接口调取失败")
  36. });
  37. });
  38. },
  39. });
  40. //lingyun
  41. $('#btnRB').on('click', function () {
  42. window.location.href = "/yeweihui/home.html";
  43. });
  44. $("#js_input_gzzd").select({
  45. title: "选择工作驻地",
  46. items: [
  47. {
  48. title: "武汉市",
  49. value: "1",
  50. },
  51. {
  52. title: "宜昌市",
  53. value: "2",
  54. },
  55. {
  56. title: "当阳市",
  57. value: "3",
  58. },
  59. {
  60. title: "其它地点",
  61. value: "4",
  62. }]
  63. });
  64. $("#js_input_jrszd").select({
  65. title: "选择今晚住地",
  66. items: [
  67. {
  68. title: "武汉市",
  69. value: "1",
  70. }, {
  71. title: "宜昌市",
  72. value: "2",
  73. },
  74. {
  75. title: "当阳市",
  76. value: "3",
  77. },
  78. {
  79. title: "其它地点",
  80. value: "4",
  81. }]
  82. });
  83. $("#js_input_sf").select({
  84. title: "",
  85. items: [
  86. {
  87. title: "否",
  88. value: "0",
  89. },
  90. {
  91. title: "是",
  92. value: "1",
  93. }]
  94. });
  95. $("#js_input_cfd").select({
  96. title: "选择出发地",
  97. items: [
  98. {
  99. title: "武汉市",
  100. value: "1",
  101. }, {
  102. title: "宜昌市",
  103. value: "2",
  104. },
  105. {
  106. title: "当阳市",
  107. value: "3",
  108. },
  109. {
  110. title: "其它地点",
  111. value: "4",
  112. }]
  113. });
  114. $("#js_input_mdd").select({
  115. title: "选择目的地",
  116. items: [
  117. {
  118. title: "武汉市",
  119. value: "1",
  120. }, {
  121. title: "宜昌市",
  122. value: "2",
  123. },
  124. {
  125. title: "当阳市",
  126. value: "3",
  127. },
  128. {
  129. title: "其它地点",
  130. value: "4",
  131. }]
  132. });
  133. $("#js_input_cxfs").select({
  134. title: "选择出行方式",
  135. items: [
  136. {
  137. title: "长途汽车",
  138. value: "1",
  139. },
  140. {
  141. title: "火车",
  142. value: "2",
  143. },
  144. {
  145. title: "飞机",
  146. value: "3",
  147. },
  148. {
  149. title: "自驾",
  150. value: "4",
  151. }]
  152. });
  153. // $("#js_input_user_sex").val(getGreder(2)); //设置初始值
  154. $('#btnRB').on('click', function () {
  155. window.location.href = "/yeweihui/home.html";
  156. });
  157. $("#js_input_user_sex").select({
  158. title: "选择性别",
  159. items: [
  160. {
  161. title: "男",
  162. value: "1",
  163. },
  164. {
  165. title: "女",
  166. value: "2",
  167. }]
  168. });
  169. $("#js_input_user_status").select({
  170. title: "选择基本状况",
  171. items: [
  172. {
  173. title: "无病史",
  174. value: "0",
  175. }, {
  176. title: "心脑血管疾病(服用ARB)",
  177. value: "1",
  178. },
  179. {
  180. title: "心脑血管疾病(未服ARB)",
  181. value: "2",
  182. },
  183. {
  184. title: "呼吸系统病史",
  185. value: "3",
  186. },
  187. {
  188. title: "肿瘤病史",
  189. value: "4",
  190. },
  191. {
  192. title: "糖尿病史",
  193. value: "5",
  194. },
  195. {
  196. title: "服用过激素药物",
  197. value: "6",
  198. },
  199. {
  200. title: "妊娠期",
  201. value: "7",
  202. }]
  203. });
  204. $("#js_input_user_kesou").select({
  205. title: "选择咳嗽情况",
  206. items: [
  207. {
  208. title: "无咳嗽",
  209. value: "0",
  210. },
  211. {
  212. title: "偶有短暂咳嗽",
  213. value: "1",
  214. },
  215. {
  216. title: "咳嗽轻度影响生活",
  217. value: "2",
  218. },
  219. {
  220. title: "咳嗽严重影响生活",
  221. value: "3",
  222. }]
  223. });
  224. $("#js_input_user_jirou").select({
  225. title: "选择肌肉情况",
  226. items: [
  227. {
  228. title: "无",
  229. value: "0",
  230. },
  231. {
  232. title: "按压有",
  233. value: "1",
  234. },
  235. {
  236. title: "偶尔",
  237. value: "2",
  238. },
  239. {
  240. title: "持续有",
  241. value: "3",
  242. }]
  243. });
  244. $("#js_input_user_huxi").select({
  245. title: "选择呼吸情况",
  246. items: [
  247. {
  248. title: "无",
  249. value: "0",
  250. },
  251. {
  252. title: "急走或上坡气短",
  253. value: "1",
  254. },
  255. {
  256. title: "气短而走路变慢",
  257. value: "2",
  258. },
  259. {
  260. title: "走路数分钟后气短",
  261. value: "3",
  262. },
  263. {
  264. title: "气短无法离开房间",
  265. value: "4",
  266. }]
  267. });
  268. $("#js_input_user_fali").select({
  269. title: "选择乏力情况",
  270. items: [
  271. {
  272. title: "无",
  273. value: "0",
  274. },
  275. {
  276. title: "体力劳动后不能恢复",
  277. value: "1",
  278. },
  279. {
  280. title: "轻体力活非常累",
  281. value: "2",
  282. },
  283. {
  284. title: "不能正常生活",
  285. value: "3",
  286. }]
  287. });
  288. $("#js_input_user_fuxie").select({
  289. title: "选择腹泻情况",
  290. items: [
  291. {
  292. title: "无",
  293. value: "0",
  294. },
  295. {
  296. title: "轻度腹泻(少于3次)",
  297. value: "1",
  298. },
  299. {
  300. title: "中度腹泻(4-6次)",
  301. value: "2",
  302. },
  303. {
  304. title: "重度腹泻(超过6次)",
  305. value: "3",
  306. }]
  307. });
  308. // $("#switchQuezhen").select({
  309. // title: "选择是否确诊",
  310. // items: [
  311. // {
  312. // title: "否",
  313. // value: "0",
  314. // },
  315. // {
  316. // title: "是",
  317. // value: "1",
  318. // }]
  319. // });
  320. $("#switchQuezhen").select({
  321. title: "选择症状",
  322. items: [
  323. {
  324. title: "无",
  325. value: "0",
  326. },
  327. {
  328. title: "新冠确诊",
  329. value: "1",
  330. },
  331. {
  332. title: "新冠疑似",
  333. value: "2",
  334. },
  335. {
  336. title: "密切接触者",
  337. value: "3",
  338. },
  339. {
  340. title: "解除观察",
  341. value: "4",
  342. }]
  343. });
  344. $("#switchDanjiangeli").select({
  345. title: "选择是否单间隔离",
  346. items: [
  347. {
  348. title: "否",
  349. value: "0",
  350. },
  351. {
  352. title: "是",
  353. value: "1",
  354. }]
  355. });
  356. //
  357. // updateSuspected({
  358. // userName : 'www',
  359. // grender : 2,
  360. // age : 34,
  361. // familyStatus : 1,
  362. // statusDesp : "",
  363. // medical:0,
  364. // singleRoom:1,
  365. // temperature:0,
  366. // cough:2,
  367. // muscle:1,
  368. // dyspnea:1,
  369. // fatigue:1,
  370. // diarrhea:2,
  371. // others:""
  372. // })
  373. //
  374. // var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
  375. // console.log("grender:" + grender)
  376. }
  377. function selectinput1(obj) {
  378. var grender = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
  379. if (grender != 4) {//js_input_qtdd
  380. // $('#js_input_qtdd')[0].disabled == 'disabled'+
  381. +
  382. $("#js_input_qtdd").val("");
  383. } else {
  384. $('#js_input_qtdd').removeAttr("disabled")
  385. }
  386. }
  387. function selectinput2(obj) {
  388. var grender = $("#js_input_jrszd").attr("data-values") == undefined ? 0 : $("#js_input_jrszd").attr("data-values");
  389. if (grender != 4) {//js_input_qtdd
  390. // $('#js_input_qtdd')[0].disabled == 'disabled' js_input_jrszq
  391. $('#js_input_jrszq').attr("disabled", "disabled");
  392. $("#js_input_jrszq").val("");
  393. } else {
  394. $('#js_input_jrszq').removeAttr("disabled")
  395. }
  396. }
  397. function selectinput3(obj) {
  398. var grender = $("#js_input_cfd").attr("data-values") == undefined ? 0 : $("#js_input_cfd").attr("data-values");
  399. if (grender != 4) {
  400. $('#js_input_cfdq').attr("disabled", "disabled");
  401. $("#js_input_cfdq").val("");
  402. } else {
  403. $('#js_input_cfdq').removeAttr("disabled")
  404. }
  405. }
  406. function selectinput4(obj) {
  407. var grender = $("#js_input_mdd").attr("data-values") == undefined ? 0 : $("#js_input_mdd").attr("data-values");
  408. if (grender != 4) {
  409. $('#js_input_mddq').attr("disabled", "disabled");
  410. $("#js_input_mddq").val("");
  411. } else {
  412. $('#js_input_mddq').removeAttr("disabled")
  413. }
  414. }
  415. function selectinput5(obj) {
  416. var grender = $("#js_input_cxfs").attr("data-values") == undefined ? 0 : $("#js_input_cxfs").attr("data-values");
  417. if (grender == 4) {
  418. // $('#js_input_cxfsq').attr("disabled","disabled")
  419. } else {
  420. $('#js_input_cxfsq').removeAttr("disabled")
  421. }
  422. }
  423. var listcx = [];
  424. function selectinput6(obj) {
  425. var grender = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  426. if (grender == 0) {
  427. $('#none')[0].style.display = 'none';
  428. $("#js_input_cfd").val("");
  429. $("#js_input_cfd").attr("data-values", "");
  430. $("#js_input_mdd").val("");
  431. $("#js_input_mdd").attr("data-values", "");
  432. $("#js_input_cxfs").val("");
  433. $("#js_input_cxfs").attr("data-values", "");
  434. $('#js_input_cxfsq').val("");
  435. $('#js_input_cfdq').val("");
  436. $('#js_input_mddq').val("");
  437. listcx.splice(0, listcx.length);
  438. $('#tabtr').empty();
  439. } else if (grender == 1) {
  440. $('#none')[0].style.display = '';
  441. }
  442. }
  443. //添加出行详情
  444. function insertlingyun() {
  445. var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  446. if (sf == 0 || sf == 3) {
  447. cantijiao = true;
  448. $.alert("请选择是否出行");
  449. return;
  450. }
  451. var person = new Object();
  452. var cxfs = $("#js_input_cxfs").attr("data-values") == undefined ? 0 : $("#js_input_cxfs").attr("data-values");
  453. var jrszd = $("#js_input_jrszd").attr("data-values") == undefined ? 0 : $("#js_input_jrszd").attr("data-values");
  454. var cfd = $("#js_input_cfd").attr("data-values") == undefined ? 0 : $("#js_input_cfd").attr("data-values");
  455. var mdd = $("#js_input_mdd").attr("data-values") == undefined ? 0 : $("#js_input_mdd").attr("data-values");
  456. var jrszq = $('#js_input_jrszq').val();
  457. var mddq = $('#js_input_mddq').val();
  458. var cfdq = $('#js_input_cfdq').val();
  459. // if (mdd != jrszd) {
  460. // cantijiao = true;
  461. // $.alert("目的地与今晚住地不一致");
  462. // return;
  463. // }
  464. // if (jrszq != mddq) {
  465. // cantijiao = true;
  466. // $.alert("目的地与今晚住地不一致");
  467. // return;
  468. // }
  469. if (cfd == 4 && mdd == 4) {
  470. if (mddq == cfdq) {
  471. cantijiao = true;
  472. $.alert("出发地与目的地不能一致");
  473. return;
  474. }
  475. } else if (cfd != 4 || mdd != 4) {
  476. if (cfd == mdd) {
  477. cantijiao = true;
  478. $.alert("出发地与目的地不能一致");
  479. return;
  480. }
  481. }
  482. var cxfsq = $('#js_input_cxfsq').val();
  483. for (var i = 0; i < listcx.length; i++) {
  484. if (listcx[i].tripTypeDesp == cxfsq && listcx[i].tripType == cxfs && listcx[i].startLocal == cfd && listcx[i].startLocalOther == cfdq && listcx[i].endLocal == mdd && listcx[i].endLocalOther == mddq) {
  485. cantijiao = true;
  486. $.alert("此行程已添加");
  487. return;
  488. }
  489. }
  490. if (cxfs != 4 && cxfs != 0) {
  491. var val = $('#js_input_cxfsq').val();
  492. if (val == "") {
  493. cantijiao = true;
  494. $.alert("请填写车次/航班/车牌");
  495. return;
  496. }
  497. person.tripTypeDesp = $('#js_input_cxfsq').val();
  498. if (cxfs == 1) {
  499. person.tripType = 1;
  500. person.tripTypeStr = "长途汽车"
  501. } else if (cxfs == 2) {
  502. person.tripType = 2;
  503. person.tripTypeStr = "火车";
  504. } else if (cxfs == 3) {
  505. person.tripType = 3;
  506. person.tripTypeStr = "飞机";
  507. }
  508. } else if (cxfs == 0) {
  509. cantijiao = true;
  510. $.alert("请选择出行方式");
  511. return;
  512. } else if (cxfs == 4) {
  513. var val6 = $('#js_input_cxfsq').val();
  514. if (val6 == "") {
  515. cantijiao = true;
  516. $.alert("请填写车次/航班/车牌");
  517. return;
  518. }
  519. person.tripTypeStr = "自驾";
  520. person.tripType = 4;
  521. person.tripTypeDesp = $('#js_input_cxfsq').val();
  522. }
  523. if (cfd == 4 && cfd != 0) {
  524. var val2 = $('#js_input_cfdq').val();
  525. if (val2 == "") {
  526. cantijiao = true;
  527. $.alert("请填写出发地");
  528. return;
  529. }
  530. person.startLocal = 4;
  531. person.startLocalOther = $('#js_input_cfdq').val();
  532. person.startLocalStr = "其它地点_" + $('#js_input_cfdq').val();
  533. } else if (cfd != 4 && cfd != 0) {
  534. if (cfd == 1) {
  535. person.startLocal = 1;
  536. person.startLocalStr = "武汉市";
  537. person.startLocalOther = $('#js_input_cfdq').val() == undefined ? "" : $('#js_input_cfdq').val();
  538. } else if (cfd == 2) {
  539. person.startLocal = 2;
  540. person.startLocalStr = "宜昌市";
  541. person.startLocalOther = $('#js_input_cfdq').val() == undefined ? "" : $('#js_input_cfdq').val();
  542. } else if (cfd == 3) {
  543. person.startLocal = 3;
  544. person.startLocalStr = "当阳市";
  545. person.startLocalOther = $('#js_input_cfdq').val() == undefined ? "" : $('#js_input_cfdq').val();
  546. }
  547. } else if (cfd == 0) {
  548. cantijiao = true;
  549. $.alert("请选择出发地");
  550. return;
  551. }
  552. if (mdd == 4 && mdd != 0) {
  553. var val3 = $('#js_input_mddq').val();
  554. if (val3 == "") {
  555. cantijiao = true;
  556. $.alert("请填写目的地");
  557. return;
  558. }
  559. person.endLocal = 4;
  560. person.endLocalOther = $('#js_input_mddq').val();
  561. person.endlocalStr = "其它地点_" + $('#js_input_mddq').val();
  562. } else if (mdd != 4 && mdd != 0) {
  563. if (mdd == 1) {
  564. person.endLocal = 1;
  565. person.endlocalStr = "武汉市";
  566. person.endLocalOther = $('#js_input_mddq').val() == undefined ? "" : $('#js_input_mddq').val();
  567. } else if (mdd == 2) {
  568. person.endLocal = 2;
  569. person.endlocalStr = "宜昌市";
  570. person.endLocalOther = $('#js_input_mddq').val() == undefined ? "" : $('#js_input_mddq').val();
  571. } else if (mdd == 3) {
  572. person.endLocal = 3;
  573. person.endlocalStr = "当阳市";
  574. person.endLocalOther = $('#js_input_mddq').val() == undefined ? "" : $('#js_input_mddq').val();
  575. }
  576. } else if (mdd == 0) {
  577. cantijiao = true;
  578. $.alert("请选择目的地");
  579. return;
  580. }
  581. listcx.push(person);
  582. // $.alert("添加成功");
  583. tab()
  584. }
  585. function tab() {
  586. var xxIds = [];
  587. var xxName = [
  588. "序号",
  589. "出发地",
  590. "目的地",
  591. "出行方式",
  592. "车次/航班/车牌",
  593. "操作"
  594. ];
  595. for (var i = 0; i < xxName.length; i++) {
  596. xxIds.push({
  597. name: xxName[i]
  598. });
  599. }
  600. $('#tabtr').empty();
  601. var html = "<tr style='background-color: #f8f8f8;'>";
  602. for (var i = 0; i < xxIds.length; i++) {
  603. // alert(xxIds[i].name);
  604. html += "<th>" + xxIds[i].name + "</th>";
  605. }
  606. html += "</tr>"
  607. for (var i = 0; i < listcx.length; i++) {//后端传过来的集合遍历
  608. if (i % 2 != 0) {
  609. html += "<tr style='background-color: #f8f8f8;'>";
  610. }
  611. else {
  612. html += "<tr>";
  613. }
  614. html += "<td style='text-align: center;'>" + (i + 1) + "</td>";
  615. // var isValue = false; //记录是否赋值
  616. html += "<td style='text-align: center;' >" + listcx[i].startLocalStr + " </td>";
  617. html += "<td style='text-align: center;' >" + listcx[i].endlocalStr + " </td>";
  618. html += "<td style='text-align: center;' >" + listcx[i].tripTypeStr + " </td>";
  619. html += "<td style='text-align: center;' >" + listcx[i].tripTypeDesp + " </td>";
  620. html += "<td style='text-align: center;' ><button value=" + i + " style='height:5vh;background-color: red;text-align: center; with:60%' class='weui-btn weui-btn_mini weui-btn_primary' onclick='splice(this.value)'>" + "删除" + " </button></td>";
  621. html += "</tr>";
  622. $("#tabtr").html(html);
  623. }
  624. }
  625. function splice(obj) {
  626. listcx.splice(obj, 1);
  627. tab()
  628. }
  629. //首次近日报告
  630. function ribaoInitialization(reportId) {
  631. if (reportId == null)
  632. reportId = 0;
  633. var userId = $("#userId").val();
  634. $.ajax({
  635. url: '/home/home/queryRibaoRefresh',
  636. data: {
  637. reportId: reportId,
  638. userCreate: userId
  639. },
  640. type: 'GET',
  641. success: function (data) {
  642. if (data.data == undefined || data.data == "") {
  643. $('#rb_family').empty();
  644. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  645. canSahngbao = false;
  646. }
  647. else {
  648. if (data.data.length > 0) {
  649. hasData = true;
  650. data.data.forEach(function (v) {
  651. ribao_cell(v);
  652. });
  653. }
  654. }
  655. },
  656. error: function () {
  657. }
  658. });
  659. }
  660. //刷新今日日报
  661. function ribao_refrash() {
  662. var userId = $("#userId").val();
  663. $.ajax({
  664. url: '/home/home/queryRibao',
  665. data: {
  666. userCreate: userId
  667. },
  668. type: 'GET',
  669. success: function (data) {
  670. if (data.data == undefined || data.data == "") {
  671. $('#rb_family').empty();
  672. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  673. }
  674. else {
  675. $('#rb_family').empty();
  676. if (data.data.length > 0) {
  677. hasData = true;
  678. data.data.forEach(function (v) {
  679. ribao_cell(v);
  680. });
  681. } else {
  682. }
  683. }
  684. },
  685. error: function () {
  686. }
  687. });
  688. }
  689. function ribao_cell(v) {
  690. var userName = v.userName + ":";
  691. var grender = getGreder(v.grender);
  692. var age = v.age;
  693. var familyStatus = "";
  694. if (v.familyStatus != 0)
  695. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  696. var medical = "";
  697. if (v.medical != 0)
  698. medical = "新冠肺炎:" + getMedical(v.medical) + ";";
  699. var isContact = "";
  700. if (v.isContact != 0)
  701. isContact = "家庭成员中有新冠肺炎疫情或有过病例接触史人员:" + getIsContact(v.isContact) + ";";
  702. var isSuspected = "";
  703. if (v.isSuspected != 0)
  704. isSuspected = "近期接触的家庭成员中有感冒、发热、咳嗽等症状:" + getIsContact(v.isContact) + ";";
  705. var singleRoom = "";
  706. var uptownId = $("#uptownId").val();
  707. if (uptownId != xiaoquId && uptownId != ceshixiaoquId) {
  708. if (v.singleRoom != 0)
  709. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  710. if (v.singleRoom == 0 && v.medical != 0)
  711. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  712. }
  713. var temperature = "体温:" + v.temperature + ";";
  714. var cough = "";
  715. if (v.cough != 0)
  716. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  717. var muscle = "";
  718. if (v.muscle != 0)
  719. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  720. var dyspnea = "";
  721. if (v.dyspnea != 0)
  722. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  723. var fatigue = "";
  724. if (v.fatigue != 0)
  725. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  726. var diarrhea = "";
  727. if (v.diarrhea != 0)
  728. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  729. var others = "";
  730. if (v.others != "")
  731. others = "其他描述:" + v.others + ";";
  732. var scoreRezult = "";
  733. if (v.scoreRezult != 0)
  734. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  735. var workLocal = "";
  736. var todayLocal = "";
  737. var isTrip = "";
  738. var tripDet = "";
  739. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  740. if (v.workLocal != 0) {
  741. if (v.workLocal < 4)
  742. workLocal = "工作驻地:" + getLocal(v.workLocal) + ";";
  743. else
  744. workLocal = "工作驻地:其它地点_" + v.workLocalOther + ";";
  745. }
  746. if (v.todayLocal != 0) {
  747. if (v.todayLocal < 4)
  748. todayLocal = "今晚住地:" + getLocal(v.todayLocal) + ";";
  749. else
  750. todayLocal = "今晚住地:其它地点_" + v.todayLocalOther + ";";
  751. }
  752. if (v.isTrip != undefined)
  753. isTrip = "是否跨市出行:" + getIsTrip(v.isTrip) + ";"
  754. if (v.tripDet != undefined)
  755. tripDet = "出行详细:" + v.tripDet + ";"
  756. }
  757. $('#rb_family').append($('<div class="weui-media-box weui-media-box_text" style="height: auto">\n' +
  758. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '&nbsp;&nbsp;<a style="color: #bc4246" onclick=\'deleteSuspected(' + JSON.stringify(v.suspectedId) + ')\'>删除</a>\n' +
  759. ' &nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改上报</a></h4>\n' +
  760. ' <div style="height: auto">' + familyStatus + medical + isContact + isSuspected + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + tripDet + '</>\n' +
  761. ' </div>\n' +
  762. ' '));
  763. }
  764. function ribao_add() {
  765. $('#btnAdd').on('click', function () {
  766. // 获取定位
  767. getLocation();
  768. if ($('#ribao')[0].style.display == 'none') {
  769. $('#notOpenRibao').toggle();
  770. $('#ribao')[0].style.display = '';
  771. } else {
  772. $('#notOpenRibao')[0].style.display = '';
  773. $('#ribao')[0].style.display = 'none';
  774. }
  775. //基本情况
  776. $("input[name='checkbox1']").removeAttr("checked");
  777. $("input[name='checkbox2']").removeAttr("checked");
  778. $("input[name='checkbox3']").removeAttr("checked");
  779. $("input[name='checkbox4']").removeAttr("checked");
  780. $("input[name='checkbox5']").removeAttr("checked");
  781. $("input[name='checkbox6']").removeAttr("checked");
  782. $("input[name='checkbox7']").removeAttr("checked");
  783. $("#switchQuezhen").val(getMedical(0));
  784. $("#switchQuezhen").attr("data-values", 0);
  785. $("#switchDanjiangeli").val(getSingleRoom(0));
  786. $("#switchDanjiangeli").attr("data-values", 0);
  787. $("#js_input_user_tiwen").val(0);
  788. $("#js_input_user_kesou").val(getCough(0));
  789. $("#js_input_user_kesou").attr("data-values", 0);
  790. $("#js_input_user_jirou").val(getMuscle(0));
  791. $("#js_input_user_jirou").attr("data-values", 0);
  792. $("#js_input_user_huxi").val(getDyspnea(0));
  793. $("#js_input_user_huxi").attr("data-values", 0);
  794. $("#js_input_user_fali").val(getFatigue(0));
  795. $("#js_input_user_fali").attr("data-values", 0);
  796. $("#js_input_user_fuxie").val(getDiarrhea(0));
  797. $("#js_input_user_fuxie").attr("data-values", 0);
  798. $("#js_input_sf").val(getIsTrip(0));
  799. $("#js_input_sf").attr("data-values", 0);
  800. $('#none')[0].style.display = 'none';
  801. $('#tabtr').empty();
  802. // $("#suspectedId").val("");
  803. // $("#js_input_gzzd").val("");
  804. // $("#js_input_jrszd").val("");
  805. // $('#js_input_mddq').attr("disabled","disabled");
  806. // $('#js_input_jrszq').attr("disabled","disabled");
  807. // $('#js_input_qtdd').attr("disabled","disabled");
  808. // $('#js_input_cfdq').attr("disabled","disabled");
  809. // var userId = $("#userId").val();
  810. // //获取用户家人
  811. // $.ajax({
  812. // url: '/home/selectAddSuspected',
  813. // get: "get",
  814. // data: {
  815. // "userCreate": userId
  816. // },
  817. // success: function (data) {
  818. // if (data != null || data != '') {
  819. // //存在
  820. // var suspected = data;
  821. // $("#js_input_user_sex").val(getGreder(suspected.grender));
  822. // $("#js_input_user_sex").attr("data-values", suspected.grender);
  823. // $("#js_input_user_name").val(suspected.userName);
  824. // $("#js_input_user_age").val(suspected.age);
  825. // //基本情况
  826. // if (suspected.familyStatus != "") {
  827. // var familyStatusList = suspected.familyStatus.split(",");
  828. // if (familyStatusList[0] == 1)
  829. // $("input[name='checkbox1']").prop("checked", "checked");
  830. // else
  831. // $("input[name='checkbox1']").removeAttr("checked");
  832. // if (familyStatusList[1] == 1)
  833. // $("input[name='checkbox2']").prop("checked", "checked");
  834. // else
  835. // $("input[name='checkbox2']").removeAttr("checked");
  836. // if (familyStatusList[2] == 1)
  837. // $("input[name='checkbox3']").prop("checked", "checked");
  838. // else
  839. // $("input[name='checkbox3']").removeAttr("checked");
  840. // if (familyStatusList[3] == 1)
  841. // $("input[name='checkbox4']").prop("checked", "checked");
  842. // else
  843. // $("input[name='checkbox4']").removeAttr("checked");
  844. // if (familyStatusList[4] == 1)
  845. // $("input[name='checkbox5']").prop("checked", "checked");
  846. // else
  847. // $("input[name='checkbox5']").removeAttr("checked");
  848. // if (familyStatusList[5] == 1)
  849. // $("input[name='checkbox6']").prop("checked", "checked");
  850. // else
  851. // $("input[name='checkbox6']").removeAttr("checked");
  852. // if (familyStatusList[6] == 1)
  853. // $("input[name='checkbox7']").prop("checked", "checked");
  854. // else
  855. // $("input[name='checkbox7']").removeAttr("checked");
  856. //
  857. // }
  858. //
  859. // $("#switchQuezhen").val(getMedical(suspected.medical));
  860. // $("#switchQuezhen").attr("data-values", suspected.medical);
  861. //
  862. // $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  863. // $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  864. //
  865. // $("#js_input_user_tiwen").val(suspected.temperature);
  866. //
  867. // $("#js_input_user_kesou").val(getCough(suspected.cough));
  868. // $("#js_input_user_kesou").attr("data-values", suspected.cough);
  869. //
  870. // $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  871. // $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  872. //
  873. // $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  874. // $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  875. //
  876. // $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  877. // $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  878. //
  879. // $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  880. // $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  881. //
  882. // $("#shuruqita").val(suspected.others);
  883. // $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  884. // $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  885. // $("#js_input_temperature_score").val(suspected.temperatureScore);
  886. // $("#js_input_score_histroy").val(suspected.scoreHistroy);
  887. // $("#js_input_score").val(suspected.score);
  888. //
  889. // $("#js_input_sf").val(getIsTrip(0));
  890. // $("#js_input_sf").attr("data-values", 0);
  891. // $('#none')[0].style.display = 'none';
  892. // }
  893. // else {
  894. // //基本情况
  895. // $("input[name='checkbox1']").removeAttr("checked");
  896. // $("input[name='checkbox2']").removeAttr("checked");
  897. // $("input[name='checkbox3']").removeAttr("checked");
  898. // $("input[name='checkbox4']").removeAttr("checked");
  899. // $("input[name='checkbox5']").removeAttr("checked");
  900. // $("input[name='checkbox6']").removeAttr("checked");
  901. // $("input[name='checkbox7']").removeAttr("checked");
  902. //
  903. // $("#switchQuezhen").val(getMedical(0));
  904. // $("#switchQuezhen").attr("data-values", 0);
  905. //
  906. // $("#switchDanjiangeli").val(getSingleRoom(0));
  907. // $("#switchDanjiangeli").attr("data-values", 0);
  908. //
  909. // $("#js_input_user_tiwen").val(0);
  910. //
  911. // $("#js_input_user_kesou").val(getCough(0));
  912. // $("#js_input_user_kesou").attr("data-values", 0);
  913. //
  914. // $("#js_input_user_jirou").val(getMuscle(0));
  915. // $("#js_input_user_jirou").attr("data-values", 0);
  916. //
  917. // $("#js_input_user_huxi").val(getDyspnea(0));
  918. // $("#js_input_user_huxi").attr("data-values", 0);
  919. //
  920. // $("#js_input_user_fali").val(getFatigue(0));
  921. // $("#js_input_user_fali").attr("data-values", 0);
  922. //
  923. // $("#js_input_user_fuxie").val(getDiarrhea(0));
  924. // $("#js_input_user_fuxie").attr("data-values", 0);
  925. //
  926. //
  927. // // $("#js_input_cxfs").empty();
  928. // // $("#js_input_cfd").empty();
  929. // // $("#js_input_mdd").empty();
  930. // // $('#js_input_cxfsq').val("");
  931. // // $('#js_input_cfdq').val("");
  932. // // $('#js_input_mddq').val("");
  933. // // listcx.splice(0,listcx.length);
  934. // // $('#tabtr').empty();
  935. // // $("#js_input_qtdd").val("");
  936. // // $("#js_input_jrszq").val("");
  937. // // $("#js_input_sf").val("");
  938. // $("#js_input_sf").val(getIsTrip(0));
  939. // $("#js_input_sf").attr("data-values", 0);
  940. // $('#none')[0].style.display = 'none';
  941. // $('#tabtr').empty();
  942. // // $("#suspectedId").val("");
  943. // // $("#js_input_gzzd").val("");
  944. // // $("#js_input_jrszd").val("");
  945. // // $('#js_input_mddq').attr("disabled","disabled");
  946. // // $('#js_input_jrszq').attr("disabled","disabled");
  947. // // $('#js_input_qtdd').attr("disabled","disabled");
  948. // // $('#js_input_cfdq').attr("disabled","disabled");
  949. //
  950. // }
  951. // },
  952. // });
  953. });
  954. }
  955. function tt() {
  956. alert($("input[name='radio']:checked").val())
  957. }
  958. function ribao_cancel() {
  959. $('#cancel').on('click', function () {
  960. listcx.splice(0, listcx.length);
  961. $('#tabtr').empty();
  962. $("#js_input_cfd").val("");
  963. $("#js_input_cfd").attr("data-values", "");
  964. $("#js_input_mdd").val("");
  965. $("#js_input_mdd").attr("data-values", "");
  966. $("#js_input_cxfs").val("");
  967. $("#js_input_cxfs").attr("data-values", "");
  968. $("#js_input_gzzd").val("");
  969. $("#js_input_gzzd").attr("data-values", "");
  970. $("#js_input_jrszd").val("");
  971. $("#js_input_jrszd").attr("data-values", "");
  972. $("#js_input_sf").val("");
  973. $("#js_input_sf").attr("data-values", "");
  974. $("#js_input_qtdd").val("");
  975. $("#js_input_jrszq").val("");
  976. $("#js_input_cfdq").val("");
  977. $("#js_input_mddq").val("");
  978. $("#js_input_cxfsq").val("");
  979. if ($('#ribao')[0].style.display == 'none') {
  980. $('#notOpenRibao').toggle();
  981. $('#ribao')[0].style.display = '';
  982. } else {
  983. $('#notOpenRibao')[0].style.display = '';
  984. $('#ribao')[0].style.display = 'none';
  985. }
  986. clearShow();
  987. });
  988. }
  989. function ribaoCommit() {
  990. if (cantijiao == false) {
  991. return
  992. }
  993. cantijiao = false
  994. // //判断是否获取到定位
  995. if (longitude == '' && latitude =='') {
  996. cantijiao = true;
  997. $.alert("请先设置微信获取当前位置");
  998. return;
  999. }
  1000. // if (autoLocal == '') {
  1001. // cantijiao = true;
  1002. // $.alert("请先设置微信获取当前位置");
  1003. // return;
  1004. // }
  1005. var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  1006. if (listcx.length == 0 && sf == 1) {
  1007. cantijiao = true;
  1008. $.alert("请添加出行");
  1009. return;
  1010. }
  1011. var suspectedId = $("#suspectedId").val();
  1012. var userId = $("#userId").val();
  1013. var userName = $("#js_input_user_name").val();
  1014. var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
  1015. var age = $("#js_input_user_age").val();
  1016. //不能同时选择服用和未服用
  1017. if ($("input[name='checkbox1']:checked").val() == "on" && $("input[name='checkbox2']:checked").val() == "on") {
  1018. cantijiao = true;
  1019. $.alert("心脑血管不能同时选择服用和未服用");
  1020. return;
  1021. }
  1022. //男性不能选择妊娠期
  1023. if ($("#js_input_user_sex").attr("data-values") == 1 && $("input[name='checkbox7']:checked").val() == "on") {
  1024. cantijiao = true;
  1025. $.alert("男性不能选择妊娠期");
  1026. return;
  1027. }
  1028. //家庭状态
  1029. var familyStatus = "";
  1030. if ($("input[name='checkbox1']:checked").val() == "on")
  1031. familyStatus += "1";
  1032. else
  1033. familyStatus += "0";
  1034. if ($("input[name='checkbox2']:checked").val() == "on")
  1035. familyStatus += ",1";
  1036. else
  1037. familyStatus += ",0";
  1038. if ($("input[name='checkbox3']:checked").val() == "on")
  1039. familyStatus += ",1";
  1040. else
  1041. familyStatus += ",0";
  1042. if ($("input[name='checkbox4']:checked").val() == "on")
  1043. familyStatus += ",1";
  1044. else
  1045. familyStatus += ",0";
  1046. if ($("input[name='checkbox5']:checked").val() == "on")
  1047. familyStatus += ",1";
  1048. else
  1049. familyStatus += ",0";
  1050. if ($("input[name='checkbox6']:checked").val() == "on")
  1051. familyStatus += ",1";
  1052. else
  1053. familyStatus += ",0";
  1054. if ($("input[name='checkbox7']:checked").val() == "on")
  1055. familyStatus += ",1";
  1056. else
  1057. familyStatus += ",0";
  1058. var medical = $("input[name='radio']:checked").val();
  1059. if (medical == undefined) {
  1060. cantijiao = true;
  1061. $.alert("请选择新冠肺炎");
  1062. return;
  1063. }
  1064. var isContact = $("input[name='radio1']:checked").val();
  1065. if (isContact == undefined) {
  1066. cantijiao = true;
  1067. $.alert("请选择家庭成员中有新冠肺炎疫情或有过病例接触史人员");
  1068. return;
  1069. }
  1070. var isSuspected = $("input[name='radio2']:checked").val();
  1071. if (isSuspected == undefined) {
  1072. isSuspected = true;
  1073. $.alert("请选择近期接触的家庭成员中有感冒、发热、咳嗽等症状");
  1074. return;
  1075. }
  1076. //var familyStatus = $("#js_input_user_status").attr("data-values") == undefined ? 0 : $("#js_input_user_status").attr("data-values");
  1077. //var statusDesp = $("#jibenmiaoshu").val() == undefined ? "" : $("#jibenmiaoshu").val();
  1078. var statusDesp = "";
  1079. // var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  1080. var medicalzz = $("#switchQuezhen_zz").attr("data-values") == undefined ? 0 : $("#switchQuezhen_zz").attr("data-values");
  1081. var singleRoom = $("#switchDanjiangeli").attr("data-values") == undefined ? 0 : $("#switchDanjiangeli").attr("data-values");
  1082. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  1083. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  1084. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  1085. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  1086. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  1087. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  1088. var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
  1089. var scoreRezult = $("#js_input_score_rezult_value").val() == undefined ? "" : $("#js_input_score_rezult_value").val();
  1090. var temperatureScore = $("#js_input_temperature_score").val() == undefined ? "" : $("#js_input_temperature_score").val();
  1091. var scoreHistroy = $("#js_input_score_histroy").val() == undefined ? "" : $("#js_input_score_histroy").val();
  1092. var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
  1093. if (userName == undefined || userName == '') {
  1094. cantijiao = true;
  1095. $.alert("请填写姓名");
  1096. return;
  1097. }
  1098. if (grender == 0) {
  1099. cantijiao = true;
  1100. $.alert("请填写性别");
  1101. return;
  1102. }
  1103. if (age == undefined || age == '') {
  1104. cantijiao = true;
  1105. $.alert("请填写年龄");
  1106. return;
  1107. }
  1108. if (age > 150 || age < 0) {
  1109. cantijiao = true;
  1110. $.alert("请填写正确的年龄");
  1111. return;
  1112. }
  1113. if (temperature <= 0) {
  1114. cantijiao = true;
  1115. $.alert("请填写体温");
  1116. return;
  1117. }
  1118. if (temperature > 50 || temperature < 30) {
  1119. cantijiao = true;
  1120. $.alert("请填写正确的体温");
  1121. return;
  1122. }
  1123. //如果是凌云
  1124. var uptownId = $("#uptownId").val();
  1125. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  1126. //lingyun
  1127. var gzzd = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
  1128. var qtdd = $("#js_input_qtdd").val();
  1129. var workLocal = "";
  1130. var workLocalOther = "";
  1131. if (gzzd == 0) {
  1132. cantijiao = true;
  1133. $.alert("请选择工作驻地");
  1134. return;
  1135. } else if (gzzd == 4 && qtdd == "") {
  1136. cantijiao = true;
  1137. $.alert("请填写工作驻地");
  1138. return;
  1139. } else if (gzzd != 0 && gzzd != 4) {
  1140. if (gzzd == 1) {
  1141. workLocal = 1;
  1142. } else if (gzzd == 2) {
  1143. workLocal = 2;
  1144. } else if (gzzd == 3) {
  1145. workLocal = 3;
  1146. }
  1147. } else if (gzzd == 4 && qtdd != "") {
  1148. workLocal = 4;
  1149. workLocalOther = qtdd;
  1150. }
  1151. //var listcx = [];
  1152. //var person=new Object();
  1153. var jrszd = $("#js_input_jrszd").attr("data-values") == undefined ? 0 : $("#js_input_jrszd").attr("data-values");
  1154. var jrszq = $("#js_input_jrszq").val();
  1155. var todyLocal = "";
  1156. var todyLocalOther = "";
  1157. if (jrszd == 0) {
  1158. cantijiao = true;
  1159. $.alert("请先设置微信获取当前位置");
  1160. //$.alert("请选择今晚住地");
  1161. return;
  1162. } else if (jrszd == 4 && jrszq == "") {
  1163. cantijiao = true;
  1164. $.alert("请先设置微信获取当前位置");
  1165. //$.alert("请填写今晚住地");
  1166. return;
  1167. } else if (jrszd != 0 && jrszd != 4) {
  1168. if (jrszd == 1) {
  1169. todyLocal = 1;
  1170. } else if (jrszd == 2) {
  1171. todyLocal = 2;
  1172. } else if (jrszd == 3) {
  1173. todyLocal = 3;
  1174. }
  1175. } else if (jrszd == 4 && jrszq != "") {
  1176. todyLocal = 4;
  1177. todyLocalOther = jrszq;
  1178. }
  1179. var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  1180. var isTrip = "";
  1181. if (sf == 3) {
  1182. cantijiao = true;
  1183. $.alert("请选择是否出行");
  1184. return;
  1185. } else {
  1186. isTrip = sf;
  1187. }
  1188. } else {
  1189. workLocal = 0;
  1190. workLocalOther = "";
  1191. todyLocal = 0;
  1192. todyLocalOther = "";
  1193. isTrip = 0;
  1194. listcx = [];
  1195. }
  1196. var pdata = {
  1197. "suspectedId": suspectedId,
  1198. "userCreate": userId,
  1199. "userName": userName,
  1200. "grender": grender,
  1201. "age": age,
  1202. "familyStatus": familyStatus,
  1203. "statusDesp": statusDesp,
  1204. "medical": medical,
  1205. "singleRoom": singleRoom,
  1206. "temperature": temperature,
  1207. "cough": cough,
  1208. "muscle": muscle,
  1209. "dyspnea": dyspnea,
  1210. "fatigue": fatigue,
  1211. "diarrhea": diarrhea,
  1212. "others": others,
  1213. "scoreRezult": scoreRezult,
  1214. "temperatureScore": temperatureScore,
  1215. "scoreHistroy": scoreHistroy,
  1216. "score": score,
  1217. "isContact": isContact,
  1218. "isSuspected": isSuspected,
  1219. "workLocal": workLocal,
  1220. "workLocalOther": workLocalOther,
  1221. "todayLocal": todyLocal,
  1222. "todayLocalOther": todyLocalOther,
  1223. "autoLocal": autoLocal,
  1224. "autoAddr": autoAddr,
  1225. "isTrip": isTrip,
  1226. "tripDet": listcx,
  1227. "longitude": longitude,
  1228. "latitude": latitude,
  1229. };
  1230. $.ajax({
  1231. url: '/home/addRibaoTrip',
  1232. type: "post",
  1233. contentType: "application/json; charset=utf-8",
  1234. data: JSON.stringify(pdata),
  1235. success: function (data) {
  1236. console.log('data:', data.msgReport);
  1237. if (data == {} || data == '' || data == null || data == undefined) {
  1238. $.toast("数据提交失败,请重新提交!", 'forbidden');
  1239. cantijiao = true;
  1240. return;
  1241. }
  1242. if (data.reportId == null || data.reportId == undefined || data.reportId <= 0) {
  1243. $.toast("数据提交失败,请重新提交!", 'forbidden');
  1244. cantijiao = true;
  1245. return;
  1246. }
  1247. if (data.msgReport == "2") {
  1248. cantijiao = true;
  1249. $.toast("家人姓名不能重复,如果重复,可以带上称呼");
  1250. return;
  1251. }
  1252. if (data.msgReport == "4") {
  1253. cantijiao = true;
  1254. $.toast("是否出行,请如实填写!");
  1255. return;
  1256. }
  1257. if ($('#ribao')[0].style.display == 'none') {
  1258. $('#notOpenRibao').toggle();
  1259. $('#ribao')[0].style.display = '';
  1260. } else {
  1261. $('#notOpenRibao')[0].style.display = '';
  1262. $('#ribao')[0].style.display = 'none';
  1263. }
  1264. cantijiao = true
  1265. $('#ribao_jinrijujian').empty();
  1266. $('#ribao_jinrijujian').append(data.safetyNum);
  1267. //修改
  1268. var uptownId = $("#uptownId").val();
  1269. //是凌云
  1270. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  1271. if (suspectedId > 0) {
  1272. var date = new Date();
  1273. var Y = date.getFullYear() + '-';
  1274. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  1275. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
  1276. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
  1277. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
  1278. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
  1279. var time = Y + M + D + h + m + s;
  1280. canSahngbao = false;
  1281. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1282. document.getElementById("txt_shangbao").style['color'] = "#0bb20c";
  1283. document.getElementById("txt_shangbaotime").style['color'] = "#0bb20c";
  1284. $('#txt_shangbao').empty();
  1285. $('#txt_shangbao').append("今日已上报");
  1286. $('#txt_shangbaotime').empty();
  1287. $('#txt_shangbaotime').append("上报时间:" + time);
  1288. }
  1289. else {
  1290. canSahngbao = true;
  1291. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1292. document.getElementById("txt_shangbao").style['color'] = "red";
  1293. $('#txt_shangbao').empty();
  1294. $('#txt_shangbao').append("今日未上报");
  1295. $('#txt_shangbaotime').empty();
  1296. }
  1297. }
  1298. else {
  1299. canSahngbao = true;
  1300. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1301. document.getElementById("txt_shangbao").style['color'] = "red";
  1302. $('#txt_shangbao').empty();
  1303. $('#txt_shangbao').append("今日未上报");
  1304. $('#txt_shangbaotime').empty();
  1305. // $.toast("请点击上报");
  1306. }
  1307. ribao_refrash();
  1308. clearShow();
  1309. },
  1310. });
  1311. }
  1312. function deleteSuspected(suspectedId) {
  1313. $.ajax({
  1314. url: '/home/deleteSuspected',
  1315. type: "post",
  1316. data: {
  1317. "suspectedId": suspectedId
  1318. },
  1319. success: function (data) {
  1320. $('#ribao_jinrijujian').empty();
  1321. $('#ribao_jinrijujian').append(data.safetyNum);
  1322. //今日未上报
  1323. canSahngbao = true;
  1324. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1325. document.getElementById("txt_shangbao").style['color'] = "red";
  1326. $('#txt_shangbao').empty();
  1327. $('#txt_shangbao').append("今日未上报");
  1328. $('#txt_shangbaotime').empty();
  1329. ribao_refrash();
  1330. $.toast("删除后请重新添加上报");
  1331. },
  1332. });
  1333. }
  1334. function updateSuspected(suspectedId) {
  1335. $("#suspectedId").val("");
  1336. if ($('#ribao')[0].style.display == 'none') {
  1337. $('#notOpenRibao').toggle();
  1338. $('#ribao')[0].style.display = '';
  1339. } else {
  1340. $('#notOpenRibao')[0].style.display = '';
  1341. $('#ribao')[0].style.display = 'none';
  1342. }
  1343. $.ajax({
  1344. url: '/home/selectSuspected',
  1345. get: "get",
  1346. data: {
  1347. "suspectedId": suspectedId
  1348. },
  1349. success: function (data) {
  1350. // console.log(data);
  1351. if (data) {
  1352. // 获取定位
  1353. getLocation();
  1354. var suspected = data;
  1355. $("#suspectedId").val(suspected.suspectedId);
  1356. $("#js_input_user_sex").val(getGreder(suspected.grender));
  1357. $("#js_input_user_sex").attr("data-values", suspected.grender);
  1358. $("#js_input_user_name").val(suspected.userName);
  1359. $("#js_input_user_age").val(suspected.age);
  1360. //基本情况
  1361. if (suspected.familyStatus != "") {
  1362. var familyStatusList = suspected.familyStatus.split(",");
  1363. if (familyStatusList[0] == 1)
  1364. $("input[name='checkbox1']").prop("checked", "checked");
  1365. else
  1366. $("input[name='checkbox1']").removeAttr("checked");
  1367. if (familyStatusList[1] == 1)
  1368. $("input[name='checkbox2']").prop("checked", "checked");
  1369. else
  1370. $("input[name='checkbox2']").removeAttr("checked");
  1371. if (familyStatusList[2] == 1)
  1372. $("input[name='checkbox3']").prop("checked", "checked");
  1373. else
  1374. $("input[name='checkbox3']").removeAttr("checked");
  1375. if (familyStatusList[3] == 1)
  1376. $("input[name='checkbox4']").prop("checked", "checked");
  1377. else
  1378. $("input[name='checkbox4']").removeAttr("checked");
  1379. if (familyStatusList[4] == 1)
  1380. $("input[name='checkbox5']").prop("checked", "checked");
  1381. else
  1382. $("input[name='checkbox5']").removeAttr("checked");
  1383. if (familyStatusList[5] == 1)
  1384. $("input[name='checkbox6']").prop("checked", "checked");
  1385. else
  1386. $("input[name='checkbox6']").removeAttr("checked");
  1387. if (familyStatusList[6] == 1)
  1388. $("input[name='checkbox7']").prop("checked", "checked");
  1389. else
  1390. $("input[name='checkbox7']").removeAttr("checked");
  1391. }
  1392. // $("#js_input_user_status").val(getFamilyStatus(suspected.familyStatus));
  1393. // $("#js_input_user_status").attr("data-values", suspected.familyStatus);
  1394. // $("#jibenmiaoshu").val(suspected.statusDesp);
  1395. if (suspected.medical == 0)
  1396. $("input[id='s18']").prop("checked", "checked");
  1397. if (suspected.medical == 1)
  1398. $("input[id='s19']").prop("checked", "checked");
  1399. if (suspected.medical == 2)
  1400. $("input[id='s20']").prop("checked", "checked");
  1401. if (suspected.medical == 3)
  1402. $("input[id='s21']").prop("checked", "checked");
  1403. if (suspected.medical == 4)
  1404. $("input[id='s22']").prop("checked", "checked");
  1405. if (suspected.isContact == 0)
  1406. $("input[id='s28']").prop("checked", "checked");
  1407. if (suspected.isContact == 1)
  1408. $("input[id='s29']").prop("checked", "checked");
  1409. if (suspected.isSuspected == 0)
  1410. $("input[id='s38']").prop("checked", "checked");
  1411. if (suspected.isSuspected == 1)
  1412. $("input[id='s39']").prop("checked", "checked");
  1413. // $("#switchQuezhen").val(getMedical(suspected.medical));
  1414. // $("#switchQuezhen").attr("data-values", suspected.medical);
  1415. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  1416. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  1417. $("#js_input_user_tiwen").val(suspected.temperature);
  1418. $("#js_input_user_kesou").val(getCough(suspected.cough));
  1419. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  1420. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  1421. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  1422. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  1423. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  1424. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  1425. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  1426. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  1427. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  1428. $("#shuruqita").val(suspected.others);
  1429. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  1430. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  1431. $("#js_input_temperature_score").val(suspected.temperatureScore);
  1432. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  1433. $("#js_input_score").val(suspected.score);
  1434. //工作驻地
  1435. $("#js_input_gzzd").val(getLocal(suspected.workLocal));
  1436. $("#js_input_gzzd").attr("data-values", suspected.workLocal);
  1437. if (suspected.workLocal != 4) {
  1438. $('#js_input_qtdd').attr("disabled", "disabled");
  1439. $("#js_input_qtdd").val("");
  1440. } else {
  1441. $('#js_input_qtdd').removeAttr("disabled")
  1442. }
  1443. $("#js_input_qtdd").val(suspected.workLocalOther);
  1444. //今晚驻地
  1445. $("#js_input_jrszd").val(getLocal(suspected.todayLocal));
  1446. $("#js_input_jrszd").attr("data-values", suspected.todayLocal);
  1447. if (suspected.todayLocal != 4) {
  1448. $('#js_input_jrszq').attr("disabled", "disabled");
  1449. $("#js_input_jrszq").val("");
  1450. }
  1451. else {
  1452. $('#js_input_jrszq').removeAttr("disabled")
  1453. }
  1454. $("#js_input_jrszq").val(suspected.todayLocalOther);
  1455. //是否出行
  1456. $("#js_input_sf").val(getIsTrip(suspected.isTrip));
  1457. $("#js_input_sf").attr("data-values", suspected.isTrip);
  1458. if (suspected.isTrip == 0)
  1459. $('#none')[0].style.display = 'none';
  1460. else
  1461. $('#none')[0].style.display = '';
  1462. //详细
  1463. $.ajax({
  1464. url: '/home/selectTripSuspected',
  1465. get: "get",
  1466. data: {
  1467. "suspectedId": suspectedId
  1468. },
  1469. success: function (data) {
  1470. if (data.data.length != 0) {
  1471. }
  1472. listcx.splice(0, listcx.length);
  1473. $('#tabtr').empty();
  1474. var person;
  1475. // var xxIds = [];
  1476. // var xxName = [
  1477. // "序号",
  1478. // "出发地",
  1479. // "目的地",
  1480. // "出行方式",
  1481. // "车次/航班/车牌",
  1482. // "操作"
  1483. // ];
  1484. // for (var i = 0; i < xxName.length; i++) {
  1485. // xxIds.push({
  1486. // name: xxName[i]
  1487. // });
  1488. // }
  1489. // $('#tabtr').empty();
  1490. // var html = "<tr style='background-color: #f8f8f8;'>";
  1491. // for (var i = 0; i < xxIds.length; i++) {
  1492. // html += "<th>" + xxIds[i].name + "</th>";
  1493. // }
  1494. // html += "</tr>"
  1495. data.data.forEach(function (v) {
  1496. {
  1497. person = new Object();
  1498. person.startLocal = v.startLocal;
  1499. person.startLocalOther = v.startLocalOther;
  1500. person.endLocal = v.endLocal;
  1501. person.endLocalOther = v.endLocalOther;
  1502. person.tripType = v.tripType;
  1503. person.startLocalStr = getLocalOther(v.startLocal, v.startLocalOther);
  1504. person.endlocalStr = getLocalOther(v.endLocal, v.endLocalOther);
  1505. person.tripTypeStr = getTripType(v.tripType);
  1506. person.tripTypeDesp = v.tripTypeDesp;
  1507. listcx.push(person);
  1508. // html += "<tr>";
  1509. // html += "<td style='text-align: center;'>" + v.sort + "</td>";
  1510. // html += "<td style='text-align: center;' >" + getLocalOther(v.startLocal, v.startLocalOther) + " </td>";
  1511. // html += "<td style='text-align: center;' >" + getLocalOther(v.endLocal, v.endLocalOther) + " </td>";
  1512. // html += "<td style='text-align: center;' >" + getTripType(v.tripType) + " </td>";
  1513. // html += "<td style='text-align: center;' >" + v.tripTypeDesp + " </td>";
  1514. // html += "<td style='text-align: center;' ><button value=" + i + " style='height:5vh;background-color: red;text-align: center; with:60%' class='weui-btn weui-btn_mini weui-btn_primary' onclick='splice(this.value)'>" + "删除" + " </button></td>";
  1515. // html += "</tr>";
  1516. // $("#tabtr").html(html);
  1517. }
  1518. });
  1519. tab();
  1520. },
  1521. });
  1522. }
  1523. },
  1524. });
  1525. }
  1526. function addReport() {
  1527. if (!canSahngbao) {
  1528. return;
  1529. }
  1530. var userId = $("#userId").val();
  1531. $.ajax({
  1532. url: '/home/addReport',
  1533. type: "post",
  1534. data: {
  1535. "userCreate": userId,
  1536. },
  1537. success: function (data) {
  1538. $.toast(data.msg)
  1539. var date = new Date();
  1540. var Y = date.getFullYear() + '-';
  1541. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  1542. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
  1543. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
  1544. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
  1545. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
  1546. var time = Y + M + D + h + m + s;
  1547. if (data.msg == "操作成功") {
  1548. canSahngbao = false;
  1549. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1550. document.getElementById("txt_shangbao").style['color'] = "#0bb20c";
  1551. document.getElementById("txt_shangbaotime").style['color'] = "#0bb20c";
  1552. $('#txt_shangbao').empty();
  1553. $('#txt_shangbao').append("今日已上报");
  1554. $('#txt_shangbaotime').empty();
  1555. $('#txt_shangbaotime').append("上报时间:" + time);
  1556. }
  1557. },
  1558. });
  1559. }
  1560. $("#my-input-ribao").calendar({
  1561. dateFormat: 'yyyy-mm-dd',
  1562. inputReadOnly: false,
  1563. onChange: function (p, values, displayValues) {
  1564. var reportDate = values.toString();
  1565. var userId = $("#userId").val();
  1566. $.ajax({
  1567. url: '/home/home/queryRibaoReportDate',
  1568. data: {
  1569. "userCreate": userId,
  1570. "reportDate": reportDate,
  1571. },
  1572. type: 'GET',
  1573. success: function (data) {
  1574. if (data.data == undefined || data.data == "") {
  1575. $('#ribao_famliy').empty();
  1576. }
  1577. else {
  1578. if (data.data.length > 0) {
  1579. $('#ribao_famliy').empty();
  1580. data.data.forEach(function (v) {
  1581. helpValue1(v);
  1582. });
  1583. } else {
  1584. }
  1585. }
  1586. },
  1587. error: function () {
  1588. }
  1589. });
  1590. }
  1591. });
  1592. function helpValue1(v) {
  1593. var userName = v.userName + ":";
  1594. var grender = getGreder(v.grender);
  1595. var age = v.age;
  1596. var familyStatus = "";
  1597. if (v.familyStatus != 0)
  1598. familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  1599. var medical = "";
  1600. if (v.medical != 0)
  1601. medical = "新冠肺炎:" + getMedical(v.medical) + ";";
  1602. var isContact = "";
  1603. if (v.isContact != 0)
  1604. isContact = "家庭成员中有新冠肺炎疫情或有过病例接触史人员:" + getIsContact(v.isContact) + ";";
  1605. var isSuspected = "";
  1606. if (v.isSuspected != 0)
  1607. isSuspected = "近期接触的家庭成员中有感冒、发热、咳嗽等症状:" + getIsContact(v.isContact) + ";";
  1608. var singleRoom = "";
  1609. var uptownId = $("#uptownId").val();
  1610. if (uptownId != xiaoquId && uptownId != ceshixiaoquId) {
  1611. if (v.singleRoom != 0)
  1612. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  1613. if (v.singleRoom == 0 && v.medical != 0)
  1614. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";";
  1615. }
  1616. var temperature = "体温:" + v.temperature + ";";
  1617. var cough = "";
  1618. if (v.cough != 0)
  1619. cough = "咳嗽现象:" + getCough(v.cough) + ";";
  1620. var muscle = "";
  1621. if (v.muscle != 0)
  1622. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
  1623. var dyspnea = "";
  1624. if (v.dyspnea != 0)
  1625. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
  1626. var fatigue = "";
  1627. if (v.fatigue != 0)
  1628. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
  1629. var diarrhea = "";
  1630. if (v.diarrhea != 0)
  1631. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
  1632. var others = "";
  1633. if (v.others != "")
  1634. others = "其他描述:" + v.others + ";";
  1635. var scoreRezult = "";
  1636. if (v.scoreRezult != 0)
  1637. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";";
  1638. var workLocal = "";
  1639. var todayLocal = "";
  1640. var isTrip = "";
  1641. var tripDet = "";
  1642. var uptownId = $("#uptownId").val();
  1643. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  1644. if (v.workLocal != 0) {
  1645. if (v.workLocal < 4)
  1646. workLocal = "工作驻地:" + getLocal(v.workLocal) + ";";
  1647. else
  1648. workLocal = "工作驻地:其它地点_" + v.workLocalOther + ";";
  1649. }
  1650. if (v.todayLocal != 0) {
  1651. if (v.todayLocal < 4)
  1652. todayLocal = "今晚住地:" + getLocal(v.todayLocal) + ";";
  1653. else
  1654. todayLocal = "今晚住地:其它地点_" + v.todayLocalOther + ";";
  1655. }
  1656. if (v.isTrip != undefined)
  1657. isTrip = "是否跨市出行:" + getIsTrip(v.isTrip) + ";"
  1658. if (v.tripDet != undefined)
  1659. tripDet = "出行详细:" + v.tripDet + ";"
  1660. }
  1661. $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: auto">\n' +
  1662. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
  1663. ' <div style="height: auto">' + familyStatus + medical + isContact + isSuspected + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + tripDet + '</div>\n' +
  1664. ' </div>\n' +
  1665. ' '));
  1666. }
  1667. function getGreder(greder) {
  1668. if (greder == 1)
  1669. return "男";
  1670. else if (greder == 2)
  1671. return "女";
  1672. return "";
  1673. }
  1674. function getFamilyStatus(familyStatus) {
  1675. var familyStatusList = familyStatus.split(",");
  1676. var familyStatusString = "";
  1677. if (familyStatus == '0,0,0,0,0,0,0')
  1678. familyStatusString += "无病史,";
  1679. else {
  1680. if (familyStatusList[0] == 1)
  1681. familyStatusString += "心脑血管疾病(服用ARB),";
  1682. if (familyStatusList[1] == 1)
  1683. familyStatusString += "心脑血管疾病(未服ARB),";
  1684. if (familyStatusList[2] == 1)
  1685. familyStatusString += "呼吸系统病史,";
  1686. if (familyStatusList[3] == 1)
  1687. familyStatusString += "肿瘤病史,";
  1688. if (familyStatusList[4] == 1)
  1689. familyStatusString += "糖尿病史,";
  1690. if (familyStatusList[5] == 1)
  1691. familyStatusString += "服用过激素药物,";
  1692. if (familyStatusList[6] == 1)
  1693. familyStatusString += "妊娠期,";
  1694. }
  1695. return familyStatusString.substring(0, familyStatusString.length - 1);
  1696. }
  1697. function getCough(cough) {
  1698. if (cough == 0)
  1699. return "无咳嗽";
  1700. else if (cough == 1)
  1701. return "偶尔短暂咳嗽";
  1702. else if (cough == 2)
  1703. return "咳嗽轻度影响生活";
  1704. else if (cough == 3)
  1705. return "咳嗽严重影响生活";
  1706. return "";
  1707. }
  1708. function getMuscle(muscle) {
  1709. if (muscle == 0)
  1710. return "无";
  1711. else if (muscle == 1)
  1712. return "按压有";
  1713. else if (muscle == 2)
  1714. return "偶尔";
  1715. else if (muscle == 3)
  1716. return "持续有";
  1717. return "";
  1718. }
  1719. function getDyspnea(dyspnea) {
  1720. if (dyspnea == 0)
  1721. return "无";
  1722. else if (dyspnea == 1)
  1723. return "急走或上坡气短";
  1724. else if (dyspnea == 2)
  1725. return "气短而走路变慢";
  1726. else if (dyspnea == 3)
  1727. return "走路数分钟后气短";
  1728. else if (dyspnea == 4)
  1729. return "气短无法离开房间";
  1730. return "";
  1731. }
  1732. function getFatigue(fatigue) {
  1733. if (fatigue == 0)
  1734. return "无";
  1735. else if (fatigue == 1)
  1736. return "体力劳动后不能恢复";
  1737. else if (fatigue == 2)
  1738. return "轻体力活非常累";
  1739. else if (fatigue == 3)
  1740. return "不能正常生活";
  1741. return "";
  1742. }
  1743. function getMedical(medical) {
  1744. if (medical == 0)
  1745. return "无";
  1746. else if (medical == 1)
  1747. return "确诊";
  1748. else if (medical == 2)
  1749. return "疑似";
  1750. else if (medical == 3)
  1751. return "有接触史";
  1752. else if (medical == 4)
  1753. return "解除隔离";
  1754. return "";
  1755. }
  1756. function getIsContact(isContact) {
  1757. if (isContact == 0)
  1758. return "否";
  1759. else if (isContact == 1)
  1760. return "是";
  1761. return "";
  1762. }
  1763. function getSingleRoom(singleRoom) {
  1764. if (singleRoom == 0)
  1765. return "否";
  1766. else if (singleRoom == 1)
  1767. return "是";
  1768. return "";
  1769. }
  1770. function getIsTrip(isTrip) {
  1771. if (isTrip == 0)
  1772. return "否";
  1773. else if (isTrip == 1)
  1774. return "是";
  1775. return "";
  1776. }
  1777. function getLocal(local) {
  1778. if (local == 0)
  1779. return "";
  1780. else if (local == 1)
  1781. return "武汉市";
  1782. else if (local == 2)
  1783. return "宜昌市";
  1784. else if (local == 3)
  1785. return "当阳市";
  1786. else if (local == 4)
  1787. return "其它地点";
  1788. return "";
  1789. }
  1790. function getLocalOther(local, localOther) {
  1791. if (local == 0)
  1792. return "";
  1793. else if (local == 1)
  1794. return "武汉市";
  1795. else if (local == 2)
  1796. return "宜昌市";
  1797. else if (local == 3)
  1798. return "当阳市";
  1799. else if (local == 4)
  1800. return "其它地点_" + localOther;
  1801. return "";
  1802. }
  1803. function getTripType(tripType) {
  1804. if (tripType == 0)
  1805. return "";
  1806. else if (tripType == 1)
  1807. return "长途汽车";
  1808. else if (tripType == 2)
  1809. return "火车";
  1810. else if (tripType == 3)
  1811. return "飞机";
  1812. else if (tripType == 4)
  1813. return "自驾";
  1814. return "";
  1815. }
  1816. function getDiarrhea(diarrhea) {
  1817. if (diarrhea == 0)
  1818. return "无";
  1819. else if (diarrhea == 1)
  1820. return "轻度腹泻(少于3次)";
  1821. else if (diarrhea == 2)
  1822. return "中度腹泻(4-6次)";
  1823. else if (diarrhea == 3)
  1824. return "重度腹泻(超过6次)";
  1825. return "";
  1826. }
  1827. function clearShow() {
  1828. console.log("qingkong")
  1829. $("#suspectedId").val("");
  1830. $("#switchQuezhen").attr("data-values", "");
  1831. $("#switchQuezhen_zz").val("");
  1832. $("#switchQuezhen_zz").attr("data-values", "");
  1833. $("#switchDanjiangeli").val("");
  1834. $("#switchDanjiangeli").attr("data-values", "");
  1835. $("#js_input_user_tiwen").val("");
  1836. $("#js_input_user_kesou").val("");
  1837. $("#js_input_user_kesou").attr("data-values", "");
  1838. $("#js_input_user_jirou").val("");
  1839. $("#js_input_user_jirou").attr("data-values", "");
  1840. $("#js_input_user_huxi").val("");
  1841. $("#js_input_user_huxi").attr("data-values", "");
  1842. $("#js_input_user_fali").val("");
  1843. $("#js_input_user_fali").attr("data-values", "");
  1844. $("#js_input_user_fuxie").val("");
  1845. $("#js_input_user_fuxie").attr("data-values", "");
  1846. $("#shuruqita").val("");
  1847. $("#js_input_score_rezult").val("");
  1848. $("#js_input_score_rezult_value").val("");
  1849. $("#js_input_temperature_score").val("");
  1850. $("#js_input_score_histroy").val("");
  1851. $("#js_input_score").val("");
  1852. //出行
  1853. $("#js_input_gzzd").val("");
  1854. $("#js_input_gzzd").attr("data-values", "");
  1855. $("#js_input_qtdd").val("");
  1856. $("#js_input_jrszd").val("");
  1857. $("#js_input_jrszd").attr("data-values", "");
  1858. $("#js_input_jrszq").val("");
  1859. $("#js_input_sf").val(getIsTrip(0));
  1860. $("#js_input_sf").attr("data-values", 0);
  1861. $('#none')[0].style.display = 'none';
  1862. $("input[id='s18']").removeAttr("checked");
  1863. $("input[id='s19']").removeAttr("checked");
  1864. $("input[id='s20']").removeAttr("checked");
  1865. $("input[id='s21']").removeAttr("checked");
  1866. $("input[id='s22']").removeAttr("checked");
  1867. $("input[id='s28']").removeAttr("checked");
  1868. $("input[id='s29']").removeAttr("checked");
  1869. }
  1870. //健康评估
  1871. $('#ribao_score').on('click', function () {
  1872. var suspectedId = $("#suspectedId").val();
  1873. var userId = $("#userId").val();
  1874. var userName = $("#js_input_user_name").val();
  1875. var medical = $("input[name='radio']:checked").val() == undefined ? 0 : $("input[name='radio']:checked").val();
  1876. var medicalzz = $("#switchQuezhen_zz").attr("data-values") == undefined ? 0 : $("#switchQuezhen_zz").attr("data-values");
  1877. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  1878. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  1879. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  1880. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  1881. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  1882. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  1883. if (userName == undefined || userName == '') {
  1884. $.alert("请填写姓名");
  1885. return;
  1886. }
  1887. if (temperature <= 0) {
  1888. $.alert("请填写体温");
  1889. return;
  1890. }
  1891. if (temperature > 50 || temperature < 30) {
  1892. $.alert("请填写正确的体温");
  1893. return;
  1894. }
  1895. $.ajax({
  1896. url: '/home/addScore',
  1897. type: "post",
  1898. data: {
  1899. "userName": userName,
  1900. "suspectedId": suspectedId,
  1901. "userCreate": userId,
  1902. "medical": medical,
  1903. "temperature": temperature,
  1904. "cough": cough,
  1905. "muscle": muscle,
  1906. "dyspnea": dyspnea,
  1907. "fatigue": fatigue,
  1908. "diarrhea": diarrhea,
  1909. },
  1910. success: function (data) {
  1911. if (data == undefined) {
  1912. $('#js_input_score_rezult').empty();
  1913. $('#js_input_score_rezult_value').empty();
  1914. $('#js_input_temperature_score').empty();
  1915. $('#js_input_score_histroy').empty();
  1916. $('#js_input_score').empty();
  1917. }
  1918. else {
  1919. $('#js_input_score_rezult').empty();
  1920. $('#js_input_temperature_score').empty();
  1921. $('#js_input_score_histroy').empty();
  1922. $('#js_input_score').empty();
  1923. var ScoreRezult = getScoreRezult(data.scoreRezult, data.temperatureScore);
  1924. $("#js_input_score_rezult").val(ScoreRezult);
  1925. $("#js_input_score_rezult_value").val(data.scoreRezult);
  1926. $("#js_input_temperature_score").val(data.temperatureScore);
  1927. $("#js_input_score_histroy").val(data.scoreHistory);
  1928. $("#js_input_score").val(data.score);
  1929. }
  1930. },
  1931. });
  1932. });
  1933. function getScoreRezult(scoreRezult, temperatureScore) {
  1934. if (scoreRezult == 0)
  1935. return "未评估";
  1936. else if (scoreRezult == 1) {
  1937. if (temperatureScore > 1)
  1938. return "正常,间隔时间服用退烧药,多休息,多喝水";
  1939. else
  1940. return "正常";
  1941. }
  1942. else if (scoreRezult == 2) {
  1943. if (temperatureScore > 1)
  1944. return "注意观察,间隔时间服用退烧药,多休息,多喝水";
  1945. else
  1946. return "注意观察";
  1947. }
  1948. else if (scoreRezult == 3)
  1949. return "联系社区医生(或者在线问诊)";
  1950. else if (scoreRezult == 4)
  1951. return "尽快就诊";
  1952. return "";
  1953. }