ribao.js 81 KB

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