ribao.js 73 KB

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