ribao.js 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776
  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. $.each(data.data,function (i,v) {
  807. ribao_cell(v);
  808. })
  809. }else {
  810. changeReportBtnState(data.data)
  811. }
  812. }
  813. },
  814. error: function () {
  815. }
  816. });
  817. }
  818. //刷新今日日报
  819. function ribao_refrash() {
  820. var userId = $("#userId").val();
  821. $.ajax({
  822. url: '/home/home/queryRibao',
  823. data: {
  824. userCreate: userId
  825. },
  826. type: 'GET',
  827. success: function (data) {
  828. if (data.data == undefined || data.data == "") {
  829. $('#rb_family').empty();
  830. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  831. changeReportBtnState(data.data)
  832. }
  833. else {
  834. $('#rb_family').empty();
  835. if (data.data.length > 0) {
  836. changeReportBtnState(data.data)
  837. hasData = true;
  838. // data.data.forEach(function (v) {
  839. // ribao_cell(v);
  840. // });
  841. $.each(data.data,function (i,v) {
  842. ribao_cell(v);
  843. })
  844. } else {
  845. changeReportBtnState(data.data)
  846. }
  847. }
  848. },
  849. error: function () {
  850. }
  851. });
  852. }
  853. function ribao_cell(v) {
  854. //console.log(v,'vvvvvvvvvvvvv')
  855. var userName = v.userName;
  856. var grender = getGreder(v.grender);
  857. var age = v.age;
  858. var familyStatus = "";
  859. // if (v.familyStatus != 0)
  860. // familyStatus = getFamilyStatus(v.familyStatus) + ";";
  861. var medical = "新冠肺炎:" + getMedical(v.medical) + ";<br/>";
  862. var isContact = "";
  863. if (v.isContact != 0)
  864. isContact = "家庭成员中有新冠肺炎疫情或有过病例接触史人员:" + getIsContact(v.isContact) + ";<br/>";
  865. var isSuspected = "";
  866. if (v.isSuspected != 0)
  867. isSuspected = "近期接触的家庭成员中有感冒、发热、咳嗽等症状:" + getIsContact(v.isContact) + ";<br/>";
  868. var isContactHistory = '';
  869. if(!isContact && !isSuspected){
  870. isContactHistory = "新冠肺炎接触史:无;<br/>";
  871. }
  872. var singleRoom = "";
  873. var uptownId = $("#uptownId").val();
  874. if (uptownId != xiaoquId && uptownId != ceshixiaoquId) {
  875. if (v.singleRoom != 0)
  876. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";<br/>";
  877. if (v.singleRoom == 0 && v.medical != 0)
  878. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";<br/>";
  879. }
  880. var tempTemperature = v.temperature>37.2?'异常,'+v.temperature+'度':'正常,37.2度以下';
  881. var temperature = "体温:" + tempTemperature + ";<br/>";
  882. var cough = "";
  883. if (v.cough != 0)
  884. cough = "咳嗽现象:" + getCough(v.cough) + ";<br/>";
  885. var muscle = "";
  886. if (v.muscle != 0)
  887. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";<br/>";
  888. var dyspnea = "";
  889. if (v.dyspnea != 0)
  890. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";<br/>";
  891. var fatigue = "";
  892. if (v.fatigue != 0)
  893. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";<br/>";
  894. var diarrhea = "";
  895. if (v.diarrhea != 0)
  896. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";<br/>";
  897. var others = "";
  898. if (v.others != "")
  899. others = "其他描述:" + v.others + ";<br/>";
  900. var scoreRezult = "";
  901. if (v.scoreRezult != 0)
  902. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";<br/>";
  903. var workLocal = "";
  904. var todayLocal = "";
  905. var isTrip = "";
  906. var tripDet = "";
  907. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  908. // if (v.workLocal != 0) {
  909. // if (v.workLocal < 4)
  910. // workLocal = "工作驻地:" + getLocal(v.workLocal) + ";";
  911. // else
  912. // workLocal = "工作驻地:其它地点_" + v.workLocalOther + ";";
  913. // }
  914. //
  915. // if (v.todayLocal != 0) {
  916. // if (v.todayLocal < 4)
  917. // todayLocal = "今晚住地:" + getLocal(v.todayLocal) + ";";
  918. // else
  919. // todayLocal = "今晚住地:其它地点_" + v.todayLocalOther + ";";
  920. // }
  921. if (v.isTrip != undefined)
  922. isTrip = "有无离开工作驻地:" + getIsTrip(v.isTrip) + ";<br/>"
  923. if (v.tripDet != undefined)
  924. tripDet = "出行详细:" + v.tripDet + ";<br/>"
  925. }
  926. // $('#rb_family').append($('<div class="weui-media-box weui-media-box_text" style="height: auto">\n' +
  927. // ' <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' +
  928. // ' &nbsp;&nbsp;<a style="color: #2a62bc" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改上报</a></h4>\n' +
  929. // ' <div style="height: auto">' + familyStatus + medical + isContact + isSuspected + singleRoom + temperature + cough + muscle + dyspnea + fatigue + diarrhea + others + scoreRezult + workLocal + todayLocal + isTrip + tripDet + '</>\n' +
  930. // ' </div>\n' +
  931. // ' '));
  932. $('#rb_family').append($('<div class="weui-form-preview">\n' +
  933. ' <div class="weui-form-preview__hd">\n' +
  934. ' <label class="weui-form-preview__label">员工</label>\n' +
  935. ' <em class="weui-form-preview__value">'+userName + '&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '&nbsp;&nbsp;' +
  936. ' </em>\n' +
  937. ' </div>\n' +
  938. ' <div class="weui-form-preview__bd">\n' +
  939. ' <div class="weui-form-preview__item">\n' +
  940. ' <label class="weui-form-preview__label">基本情况</label>\n' +
  941. ' <span class="weui-form-preview__value" style="text-align: left;">'+ temperature + familyStatus + medical + singleRoom + cough + muscle + dyspnea + fatigue + diarrhea + others + isContactHistory + isContact + isSuspected + scoreRezult + workLocal + todayLocal + isTrip + tripDet+'</span>\n' +
  942. ' </div>\n' +
  943. ' </div>\n' +
  944. ' <div class="weui-form-preview__ft">\n' +
  945. ' <a class="weui-form-preview__btn weui-form-preview__btn_default" style="color: #bc4246" href="javascript:" onclick=\'deleteSuspected(' + JSON.stringify(v.suspectedId) + ')\'>删除</a>\n' +
  946. ' <button class="weui-form-preview__btn weui-form-preview__btn_primary" style="color:#2a62bc" href="javascript:" onclick=\'updateSuspected(' + JSON.stringify(v.suspectedId) + ')\'>修改上报</button>\n' +
  947. ' </div>\n' +
  948. '</div>'));
  949. }
  950. function ribao_add() {
  951. $('#btnAdd').on('click', function () {
  952. // userFamilyStatus = '';
  953. // userFamilyStatusStr = '';
  954. if ($('#ribao')[0].style.display == 'none') {
  955. $('#notOpenRibao').toggle();
  956. $('#ribao')[0].style.display = '';
  957. } else {
  958. $('#notOpenRibao')[0].style.display = '';
  959. $('#ribao')[0].style.display = 'none';
  960. }
  961. //基本情况
  962. // $("input[name='checkbox1']").removeAttr("checked");
  963. // $("input[name='checkbox2']").removeAttr("checked");
  964. // $("input[name='checkbox3']").removeAttr("checked");
  965. // $("input[name='checkbox4']").removeAttr("checked");
  966. // $("input[name='checkbox5']").removeAttr("checked");
  967. // $("input[name='checkbox6']").removeAttr("checked");
  968. // $("input[name='checkbox7']").removeAttr("checked");
  969. $("#js_input_user_sex").val('男');
  970. $("#js_input_user_sex").attr("data-values", 1);
  971. // $("#js_input_user_status").val('');
  972. // $("#js_input_user_status").attr("data-values", '');
  973. // $("#js_input_user_crov19").val('无');
  974. // $("#js_input_user_crov19").attr("data-values", 0);
  975. $("input[id='s18']").prop("checked", "checked");
  976. $("input[id='s28']").prop("checked", "checked");
  977. $("input[id='s38']").prop("checked", "checked");
  978. $("input[id='s40']").prop("checked", "checked");
  979. $("input[id='s50']").prop("checked", "checked");
  980. $("input[id='s60']").prop("checked", "checked");
  981. $("#switchQuezhen").val(getMedical(0));
  982. $("#switchQuezhen").attr("data-values", 0);
  983. $("#switchDanjiangeli").val(getSingleRoom(0));
  984. $("#switchDanjiangeli").attr("data-values", 0);
  985. $("#js_input_user_tiwen").val(36.5);
  986. $("#js_input_user_xinguan").val(getXinguan(0));
  987. $("#js_input_user_xinguan").attr("data-values", 0);
  988. $("#js_input_user_kesou").val(getCough(0));
  989. $("#js_input_user_kesou").attr("data-values", 0);
  990. $("#js_input_user_jirou").val(getMuscle(0));
  991. $("#js_input_user_jirou").attr("data-values", 0);
  992. $("#js_input_user_huxi").val(getDyspnea(0));
  993. $("#js_input_user_huxi").attr("data-values", 0);
  994. $("#js_input_user_fali").val(getFatigue(0));
  995. $("#js_input_user_fali").attr("data-values", 0);
  996. $("#js_input_user_fuxie").val(getDiarrhea(0));
  997. $("#js_input_user_fuxie").attr("data-values", 0);
  998. $("#shuruqita").val('');
  999. $("#js_input_sf").val(getIsTrip(0));
  1000. $("#js_input_sf").attr("data-values", 0);
  1001. $('#none')[0].style.display = 'none';
  1002. $('#tabtr').empty();
  1003. // $("#suspectedId").val("");
  1004. // $("#js_input_gzzd").val("");
  1005. // $("#js_input_jrszd").val("");
  1006. // $('#js_input_mddq').attr("disabled","disabled");
  1007. // $('#js_input_jrszq').attr("disabled","disabled");
  1008. // $('#js_input_qtdd').attr("disabled","disabled");
  1009. // $('#js_input_cfdq').attr("disabled","disabled");
  1010. // var userId = $("#userId").val();
  1011. // //获取用户家人
  1012. // $.ajax({
  1013. // url: '/home/selectAddSuspected',
  1014. // get: "get",
  1015. // data: {
  1016. // "userCreate": userId
  1017. // },
  1018. // success: function (data) {
  1019. // if (data != null || data != '') {
  1020. // //存在
  1021. // var suspected = data;
  1022. // $("#js_input_user_sex").val(getGreder(suspected.grender));
  1023. // $("#js_input_user_sex").attr("data-values", suspected.grender);
  1024. // $("#js_input_user_name").val(suspected.userName);
  1025. // $("#js_input_user_age").val(suspected.age);
  1026. // //基本情况
  1027. // if (suspected.familyStatus != "") {
  1028. // var familyStatusList = suspected.familyStatus.split(",");
  1029. // if (familyStatusList[0] == 1)
  1030. // $("input[name='checkbox1']").prop("checked", "checked");
  1031. // else
  1032. // $("input[name='checkbox1']").removeAttr("checked");
  1033. // if (familyStatusList[1] == 1)
  1034. // $("input[name='checkbox2']").prop("checked", "checked");
  1035. // else
  1036. // $("input[name='checkbox2']").removeAttr("checked");
  1037. // if (familyStatusList[2] == 1)
  1038. // $("input[name='checkbox3']").prop("checked", "checked");
  1039. // else
  1040. // $("input[name='checkbox3']").removeAttr("checked");
  1041. // if (familyStatusList[3] == 1)
  1042. // $("input[name='checkbox4']").prop("checked", "checked");
  1043. // else
  1044. // $("input[name='checkbox4']").removeAttr("checked");
  1045. // if (familyStatusList[4] == 1)
  1046. // $("input[name='checkbox5']").prop("checked", "checked");
  1047. // else
  1048. // $("input[name='checkbox5']").removeAttr("checked");
  1049. // if (familyStatusList[5] == 1)
  1050. // $("input[name='checkbox6']").prop("checked", "checked");
  1051. // else
  1052. // $("input[name='checkbox6']").removeAttr("checked");
  1053. // if (familyStatusList[6] == 1)
  1054. // $("input[name='checkbox7']").prop("checked", "checked");
  1055. // else
  1056. // $("input[name='checkbox7']").removeAttr("checked");
  1057. //
  1058. // }
  1059. //
  1060. // $("#switchQuezhen").val(getMedical(suspected.medical));
  1061. // $("#switchQuezhen").attr("data-values", suspected.medical);
  1062. //
  1063. // $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  1064. // $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  1065. //
  1066. // $("#js_input_user_tiwen").val(suspected.temperature);
  1067. //
  1068. // $("#js_input_user_kesou").val(getCough(suspected.cough));
  1069. // $("#js_input_user_kesou").attr("data-values", suspected.cough);
  1070. //
  1071. // $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  1072. // $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  1073. //
  1074. // $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  1075. // $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  1076. //
  1077. // $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  1078. // $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  1079. //
  1080. // $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  1081. // $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  1082. //
  1083. // $("#shuruqita").val(suspected.others);
  1084. // $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  1085. // $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  1086. // $("#js_input_temperature_score").val(suspected.temperatureScore);
  1087. // $("#js_input_score_histroy").val(suspected.scoreHistroy);
  1088. // $("#js_input_score").val(suspected.score);
  1089. //
  1090. // $("#js_input_sf").val(getIsTrip(0));
  1091. // $("#js_input_sf").attr("data-values", 0);
  1092. // $('#none')[0].style.display = 'none';
  1093. // }
  1094. // else {
  1095. // //基本情况
  1096. // $("input[name='checkbox1']").removeAttr("checked");
  1097. // $("input[name='checkbox2']").removeAttr("checked");
  1098. // $("input[name='checkbox3']").removeAttr("checked");
  1099. // $("input[name='checkbox4']").removeAttr("checked");
  1100. // $("input[name='checkbox5']").removeAttr("checked");
  1101. // $("input[name='checkbox6']").removeAttr("checked");
  1102. // $("input[name='checkbox7']").removeAttr("checked");
  1103. //
  1104. // $("#switchQuezhen").val(getMedical(0));
  1105. // $("#switchQuezhen").attr("data-values", 0);
  1106. //
  1107. // $("#switchDanjiangeli").val(getSingleRoom(0));
  1108. // $("#switchDanjiangeli").attr("data-values", 0);
  1109. //
  1110. // $("#js_input_user_tiwen").val(0);
  1111. //
  1112. // $("#js_input_user_kesou").val(getCough(0));
  1113. // $("#js_input_user_kesou").attr("data-values", 0);
  1114. //
  1115. // $("#js_input_user_jirou").val(getMuscle(0));
  1116. // $("#js_input_user_jirou").attr("data-values", 0);
  1117. //
  1118. // $("#js_input_user_huxi").val(getDyspnea(0));
  1119. // $("#js_input_user_huxi").attr("data-values", 0);
  1120. //
  1121. // $("#js_input_user_fali").val(getFatigue(0));
  1122. // $("#js_input_user_fali").attr("data-values", 0);
  1123. //
  1124. // $("#js_input_user_fuxie").val(getDiarrhea(0));
  1125. // $("#js_input_user_fuxie").attr("data-values", 0);
  1126. //
  1127. //
  1128. // // $("#js_input_cxfs").empty();
  1129. // // $("#js_input_cfd").empty();
  1130. // // $("#js_input_mdd").empty();
  1131. // // $('#js_input_cxfsq').val("");
  1132. // // $('#js_input_cfdq').val("");
  1133. // // $('#js_input_mddq').val("");
  1134. // // listcx.splice(0,listcx.length);
  1135. // // $('#tabtr').empty();
  1136. // // $("#js_input_qtdd").val("");
  1137. // // $("#js_input_jrszq").val("");
  1138. // // $("#js_input_sf").val("");
  1139. // $("#js_input_sf").val(getIsTrip(0));
  1140. // $("#js_input_sf").attr("data-values", 0);
  1141. // $('#none')[0].style.display = 'none';
  1142. // $('#tabtr').empty();
  1143. // // $("#suspectedId").val("");
  1144. // // $("#js_input_gzzd").val("");
  1145. // // $("#js_input_jrszd").val("");
  1146. // // $('#js_input_mddq').attr("disabled","disabled");
  1147. // // $('#js_input_jrszq').attr("disabled","disabled");
  1148. // // $('#js_input_qtdd').attr("disabled","disabled");
  1149. // // $('#js_input_cfdq').attr("disabled","disabled");
  1150. //
  1151. // }
  1152. // },
  1153. // });
  1154. getLocation()
  1155. });
  1156. }
  1157. function tt() {
  1158. alert($("input[name='radio']:checked").val())
  1159. }
  1160. function ribao_cancel() {
  1161. $('#cancel').on('click', function () {
  1162. listcx.splice(0, listcx.length);
  1163. $('#tabtr').empty();
  1164. $("#js_input_cfd").val("");
  1165. $("#js_input_cfd").attr("data-values", "");
  1166. $("#js_input_mdd").val("");
  1167. $("#js_input_mdd").attr("data-values", "");
  1168. $("#js_input_cxfs").val("");
  1169. $("#js_input_cxfs").attr("data-values", "");
  1170. $("#js_input_gzzd").val("");
  1171. $("#js_input_gzzd").attr("data-values", "");
  1172. $("#js_input_jrszd").val("");
  1173. $("#js_input_jrszd").attr("data-values", "");
  1174. $("#js_input_sf").val("");
  1175. $("#js_input_sf").attr("data-values", "");
  1176. $("#js_input_qtdd").val("");
  1177. $("#js_input_jrszq").val("");
  1178. $("#js_input_cfdq").val("");
  1179. $("#js_input_mddq").val("");
  1180. $("#js_input_cxfsq").val("");
  1181. if ($('#ribao')[0].style.display == 'none') {
  1182. $('#notOpenRibao').toggle();
  1183. $('#ribao')[0].style.display = '';
  1184. } else {
  1185. $('#notOpenRibao')[0].style.display = '';
  1186. $('#ribao')[0].style.display = 'none';
  1187. }
  1188. clearShow();
  1189. });
  1190. }
  1191. function filterUserStatus(values) {
  1192. if(!values) return []
  1193. return values.split(',')
  1194. }
  1195. function ribaoCommit() {
  1196. if (cantijiao == false) {
  1197. return
  1198. }
  1199. cantijiao = false
  1200. // //判断是否获取到定位
  1201. var hrefs = location.href
  1202. if(!/http:\/\/127\.0\.0\.1/.test(hrefs)){
  1203. if (longitude == '' && latitude =='') {
  1204. cantijiao = true;
  1205. $.alert("请检查是否开启手机定位和微信定位");
  1206. return;
  1207. }
  1208. }
  1209. // if (autoLocal == '') {
  1210. // cantijiao = true;
  1211. // $.alert("请先设置微信获取当前位置");
  1212. // return;
  1213. // }
  1214. //var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  1215. var sf = $("input[name=radio4]:checked").val()
  1216. if (listcx.length == 0 && sf == 1) {
  1217. cantijiao = true;
  1218. $.alert("请添加出行信息");
  1219. return;
  1220. }
  1221. var suspectedId = $("#suspectedId").val();
  1222. var userId = $("#userId").val();
  1223. var userName = $("#js_input_user_name").val();
  1224. var grender = $("#js_input_user_sex").attr("data-values") == undefined ? 0 : $("#js_input_user_sex").attr("data-values");
  1225. var age = $("#js_input_user_age").val();
  1226. // var userStatus = filterUserStatus($("#js_input_user_status").data().values)
  1227. var userStatus = []
  1228. // //不能同时选择服用和未服用
  1229. // if (userStatus.indexOf('1')>-1 && userStatus.indexOf('2')>-1) {
  1230. // cantijiao = true;
  1231. // $.alert("心脑血管不能同时选择服用和未服用");
  1232. // return;
  1233. // }
  1234. // //男性不能选择妊娠期
  1235. // if ($("#js_input_user_sex").attr("data-values") == 1 && userStatus.indexOf('7')>-1) {
  1236. // cantijiao = true;
  1237. // $.alert("男性不能选择妊娠期");
  1238. // return;
  1239. // }
  1240. //家庭状态
  1241. var familyStatus = "";
  1242. if(!userStatus.length){
  1243. familyStatus += '0,0,0,0,0,0,0'
  1244. }else {
  1245. if (userStatus.indexOf('1')>-1)
  1246. familyStatus += "1";
  1247. else
  1248. familyStatus += "0";
  1249. if (userStatus.indexOf('2')>-1)
  1250. familyStatus += ",1";
  1251. else
  1252. familyStatus += ",0";
  1253. if (userStatus.indexOf('3')>-1)
  1254. familyStatus += ",1";
  1255. else
  1256. familyStatus += ",0";
  1257. if (userStatus.indexOf('4')>-1)
  1258. familyStatus += ",1";
  1259. else
  1260. familyStatus += ",0";
  1261. if (userStatus.indexOf('5')>-1)
  1262. familyStatus += ",1";
  1263. else
  1264. familyStatus += ",0";
  1265. if (userStatus.indexOf('6')>-1)
  1266. familyStatus += ",1";
  1267. else
  1268. familyStatus += ",0";
  1269. if (userStatus.indexOf('7')>-1)
  1270. familyStatus += ",1";
  1271. else
  1272. familyStatus += ",0";
  1273. }
  1274. // var medical = $("#js_input_user_crov19").data().values;
  1275. var medical = $("input[name='radio']:checked").val();
  1276. if (medical == undefined) {
  1277. cantijiao = true;
  1278. $.alert("请选择新冠肺炎");
  1279. return;
  1280. }
  1281. var medicalState = $("#js_input_user_xinguan").data().values;
  1282. if(medical == 1){
  1283. if(medicalState == undefined){
  1284. cantijiao = true;
  1285. $.alert("请选择新冠现象");
  1286. return;
  1287. }
  1288. }
  1289. var isContact = $("input[name='radio1']:checked").val();
  1290. if (isContact == undefined) {
  1291. cantijiao = true;
  1292. $.alert("请选择家庭成员中有新冠肺炎疫情或有过病例接触史人员");
  1293. return;
  1294. }
  1295. var isSuspected = $("input[name='radio2']:checked").val();
  1296. if (isSuspected == undefined) {
  1297. isSuspected = true;
  1298. $.alert("请选择近期接触的家庭成员中有感冒、发热、咳嗽等症状");
  1299. return;
  1300. }
  1301. //var familyStatus = $("#js_input_user_status").attr("data-values") == undefined ? 0 : $("#js_input_user_status").attr("data-values");
  1302. //var statusDesp = $("#jibenmiaoshu").val() == undefined ? "" : $("#jibenmiaoshu").val();
  1303. var statusDesp = "";
  1304. // var medical = $("#switchQuezhen").attr("data-values") == undefined ? 0 : $("#switchQuezhen").attr("data-values");
  1305. var medicalzz = $("#switchQuezhen_zz").attr("data-values") == undefined ? 0 : $("#switchQuezhen_zz").attr("data-values");
  1306. var singleRoom = $("#switchDanjiangeli").attr("data-values") == undefined ? 0 : $("#switchDanjiangeli").attr("data-values");
  1307. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  1308. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  1309. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  1310. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  1311. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  1312. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  1313. var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
  1314. var scoreRezult = $("#js_input_score_rezult_value").val() == undefined ? "" : $("#js_input_score_rezult_value").val();
  1315. var temperatureScore = $("#js_input_temperature_score").val() == undefined ? "" : $("#js_input_temperature_score").val();
  1316. var scoreHistroy = $("#js_input_score_histroy").val() == undefined ? "" : $("#js_input_score_histroy").val();
  1317. var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
  1318. if (userName == undefined || userName == '') {
  1319. cantijiao = true;
  1320. $.alert("请填写姓名");
  1321. return;
  1322. }
  1323. if (grender == 0) {
  1324. cantijiao = true;
  1325. $.alert("请填写性别");
  1326. return;
  1327. }
  1328. if (age == undefined || age == '') {
  1329. cantijiao = true;
  1330. $.alert("请填写年龄");
  1331. return;
  1332. }
  1333. if (age > 150 || age < 0) {
  1334. cantijiao = true;
  1335. $.alert("请填写正确的年龄");
  1336. return;
  1337. }
  1338. if (temperature <= 0) {
  1339. cantijiao = true;
  1340. $.alert("请填写体温");
  1341. return;
  1342. }
  1343. if (temperature > 50 || temperature < 30) {
  1344. cantijiao = true;
  1345. $.alert("请填写正确的体温");
  1346. return;
  1347. }
  1348. if (temperature > 30 && temperature < 37.3) {
  1349. $("#js_input_user_tiwen").hide();
  1350. $("input[radio='s61']").removeAttr("checked");
  1351. $("input[radio='s60']").prop("checked", "checked");
  1352. }
  1353. if(medical == 1 && medicalState == 0 && cough ==0 && muscle == 0 && dyspnea == 0 && fatigue == 0 && diarrhea == 0 && !others){
  1354. $("input[id='s18']").prop("checked", "checked");
  1355. $("input[id='s19']").removeAttr('checked');
  1356. 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']
  1357. // ids.forEach(iv=>{
  1358. // $('#'+iv).hide()
  1359. // })
  1360. $.each(ids,function (i,v) {
  1361. $('#'+v).hide()
  1362. })
  1363. medical = $("input[name='radio']:checked").val()
  1364. }
  1365. //如果是凌云
  1366. var uptownId = $("#uptownId").val();
  1367. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  1368. //lingyun
  1369. var gzzd = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
  1370. var qtdd = $("#js_input_qtdd").val();
  1371. var workLocal = 0;
  1372. var workLocalOther = "";
  1373. // if (gzzd == 0) {
  1374. // cantijiao = true;
  1375. // $.alert("请选择工作驻地");
  1376. // return;
  1377. // } else if (gzzd == 4 && qtdd == "") {
  1378. // cantijiao = true;
  1379. // $.alert("请填写工作驻地");
  1380. // return;
  1381. // } else if (gzzd != 0 && gzzd != 4) {
  1382. // if (gzzd == 1) {
  1383. // workLocal = 1;
  1384. // } else if (gzzd == 2) {
  1385. // workLocal = 2;
  1386. // } else if (gzzd == 3) {
  1387. // workLocal = 3;
  1388. // }
  1389. // } else if (gzzd == 4 && qtdd != "") {
  1390. // workLocal = 4;
  1391. // workLocalOther = qtdd;
  1392. // }
  1393. //var listcx = [];
  1394. //var person=new Object();
  1395. var jrszd = $("#js_input_jrszd").attr("data-values") == undefined ? 0 : $("#js_input_jrszd").attr("data-values");
  1396. var jrszq = $("#js_input_jrszq").val();
  1397. var todyLocal = 0;
  1398. var todyLocalOther = "";
  1399. // if (jrszd == 0) {
  1400. // cantijiao = true;
  1401. // $.alert("请检查是否开启手机定位和微信定位");
  1402. // //$.alert("请选择今晚住地");
  1403. // return;
  1404. // } else if (jrszd == 4 && jrszq == "") {
  1405. // cantijiao = true;
  1406. // $.alert("请检查是否开启手机定位和微信定位");
  1407. // //$.alert("请填写今晚住地");
  1408. // return;
  1409. // } else if (jrszd != 0 && jrszd != 4) {
  1410. // if (jrszd == 1) {
  1411. // todyLocal = 1;
  1412. // } else if (jrszd == 2) {
  1413. // todyLocal = 2;
  1414. // } else if (jrszd == 3) {
  1415. // todyLocal = 3;
  1416. // }
  1417. // } else if (jrszd == 4 && jrszq != "") {
  1418. // todyLocal = 4;
  1419. // todyLocalOther = jrszq;
  1420. // }
  1421. //var sf = $("#js_input_sf").attr("data-values") == undefined ? 3 : $("#js_input_sf").attr("data-values");
  1422. //var sf = $("input[name=radio4]:checked").val()
  1423. var isTrip = $("input[name=radio4]:checked").val();
  1424. // if (sf == 1) {
  1425. // cantijiao = true;
  1426. // $.alert("请选择是否出行");
  1427. // return;
  1428. // } else {
  1429. // isTrip = sf;
  1430. // }
  1431. } else {
  1432. workLocal = 0;
  1433. workLocalOther = "";
  1434. todyLocal = 0;
  1435. todyLocalOther = "";
  1436. isTrip = 0;
  1437. listcx = [];
  1438. }
  1439. var pdata = {
  1440. "suspectedId": suspectedId,
  1441. "userCreate": userId,
  1442. "userName": userName,
  1443. "grender": grender,
  1444. "age": age,
  1445. "familyStatus": familyStatus,
  1446. "statusDesp": statusDesp,
  1447. "medical": medical,
  1448. "medicalState": medicalState,
  1449. "singleRoom": singleRoom,
  1450. "temperature": temperature,
  1451. "cough": cough,
  1452. "muscle": muscle,
  1453. "dyspnea": dyspnea,
  1454. "fatigue": fatigue,
  1455. "diarrhea": diarrhea,
  1456. "others": others,
  1457. "scoreRezult": scoreRezult,
  1458. "temperatureScore": temperatureScore,
  1459. "scoreHistroy": scoreHistroy,
  1460. "score": score,
  1461. "isContact": isContact,
  1462. "isSuspected": isSuspected,
  1463. "workLocal": workLocal,
  1464. "workLocalOther": workLocalOther,
  1465. "todayLocal": todyLocal,
  1466. "todayLocalOther": todyLocalOther,
  1467. "autoLocal": autoLocal,
  1468. "autoAddr": autoAddr,
  1469. "isTrip": isTrip,
  1470. "tripDet": listcx,
  1471. };
  1472. //loading
  1473. var tempTimes = $.toast.prototype.defaults.duration
  1474. $.toast.prototype.defaults.duration = 0
  1475. $.toast("处理中...", 'loading');
  1476. $.ajax({
  1477. url: '/home/addRibaoTrip',
  1478. type: "post",
  1479. contentType: "application/json; charset=utf-8",
  1480. data: JSON.stringify(pdata),
  1481. success: function (data) {
  1482. $.toast.prototype.defaults.duration = tempTimes
  1483. console.log('data:', data.msgReport);
  1484. if (data == {} || data == '' || data == null || data == undefined) {
  1485. $.toast("数据提交失败,请重新提交!", 'forbidden');
  1486. cantijiao = true;
  1487. return;
  1488. }
  1489. if (data.reportId == null || data.reportId == undefined || data.reportId <= 0) {
  1490. $.toast("数据提交失败,请重新提交!", 'forbidden');
  1491. cantijiao = true;
  1492. return;
  1493. }
  1494. if (data.msgReport == "2") {
  1495. cantijiao = true;
  1496. $.toast("家人姓名不能重复,如果重复,可以带上称呼");
  1497. return;
  1498. }
  1499. if (data.msgReport == "4") {
  1500. cantijiao = true;
  1501. $.toast("是否出行,请如实填写!");
  1502. return;
  1503. }
  1504. if ($('#ribao')[0].style.display == 'none') {
  1505. $('#notOpenRibao').toggle();
  1506. $('#ribao')[0].style.display = '';
  1507. } else {
  1508. $('#notOpenRibao')[0].style.display = '';
  1509. $('#ribao')[0].style.display = 'none';
  1510. }
  1511. cantijiao = true
  1512. $('#ribao_jinrijujian').empty();
  1513. $('#ribao_jinrijujian').append(data.safetyNum);
  1514. //修改
  1515. var uptownId = $("#uptownId").val();
  1516. //是凌云
  1517. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  1518. if (suspectedId > 0) {
  1519. var date = new Date();
  1520. var Y = date.getFullYear() + '-';
  1521. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  1522. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
  1523. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
  1524. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
  1525. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
  1526. var time = Y + M + D + h + m + s;
  1527. canSahngbao = false;
  1528. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1529. document.getElementById("txt_shangbao").style['color'] = "#0bb20c";
  1530. document.getElementById("txt_shangbaotime").style['color'] = "#0bb20c";
  1531. $('#txt_shangbao').empty();
  1532. $('#txt_shangbao').append("今日已上报");
  1533. $('#txt_shangbaotime').empty();
  1534. $('#txt_shangbaotime').append("上报时间:" + time);
  1535. }
  1536. else {
  1537. canSahngbao = true;
  1538. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1539. document.getElementById("txt_shangbao").style['color'] = "red";
  1540. $('#txt_shangbao').empty();
  1541. $('#txt_shangbao').append("今日未上报");
  1542. $('#txt_shangbaotime').empty();
  1543. }
  1544. }
  1545. else {
  1546. canSahngbao = true;
  1547. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1548. document.getElementById("txt_shangbao").style['color'] = "red";
  1549. $('#txt_shangbao').empty();
  1550. $('#txt_shangbao').append("今日未上报");
  1551. $('#txt_shangbaotime').empty();
  1552. // $.toast("请点击上报");
  1553. }
  1554. $.toast("操作成功");
  1555. ribao_refrash();
  1556. clearShow();
  1557. },
  1558. });
  1559. }
  1560. function deleteSuspected(suspectedId) {
  1561. $.confirm({
  1562. title: '是否确定删除上报信息?',
  1563. onOK: function () {
  1564. $.ajax({
  1565. url: '/home/deleteSuspected',
  1566. type: "post",
  1567. data: {
  1568. "suspectedId": suspectedId
  1569. },
  1570. success: function (data) {
  1571. $('#ribao_jinrijujian').empty();
  1572. $('#ribao_jinrijujian').append(data.safetyNum);
  1573. //今日未上报
  1574. canSahngbao = true;
  1575. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1576. document.getElementById("txt_shangbao").style['color'] = "red";
  1577. $('#txt_shangbao').empty();
  1578. $('#txt_shangbao').append("今日未上报");
  1579. $('#txt_shangbaotime').empty();
  1580. $('#ribao_famliy').empty();
  1581. ribao_refrash();
  1582. clearShow();
  1583. $.toast("删除后请重新添加上报");
  1584. },
  1585. });
  1586. },
  1587. onCancel: function () {
  1588. }
  1589. });
  1590. }
  1591. //重新填报
  1592. function goReport() {
  1593. $("#suspectedId").val("");
  1594. if ($('#ribao')[0].style.display == 'none') {
  1595. $('#notOpenRibao').toggle();
  1596. $('#ribao')[0].style.display = '';
  1597. } else {
  1598. $('#notOpenRibao')[0].style.display = '';
  1599. $('#ribao')[0].style.display = 'none';
  1600. }
  1601. }
  1602. //修改上报
  1603. function updateSuspected(suspectedId) {
  1604. userFamilyStatus = ''
  1605. userFamilyStatusStr = ''
  1606. //病情
  1607. var ids = ['js_input_user_tiwen','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'];
  1608. //接触史
  1609. var ids2 = ['isContactView','isSuspectedView'];
  1610. $("#suspectedId").val("");
  1611. if ($('#ribao')[0].style.display == 'none') {
  1612. $('#notOpenRibao').toggle();
  1613. $('#ribao')[0].style.display = '';
  1614. } else {
  1615. $('#notOpenRibao')[0].style.display = '';
  1616. $('#ribao')[0].style.display = 'none';
  1617. }
  1618. $.ajax({
  1619. url: '/home/selectSuspected',
  1620. get: "get",
  1621. data: {
  1622. "suspectedId": suspectedId
  1623. },
  1624. success: function (data) {
  1625. // console.log(data);
  1626. if (data) {
  1627. // 获取定位
  1628. getLocation();
  1629. var suspected = data;
  1630. $("#suspectedId").val(suspected.suspectedId);
  1631. $("#js_input_user_sex").val(getGreder(suspected.grender));
  1632. $("#js_input_user_sex").attr("data-values", suspected.grender);
  1633. $("#js_input_user_name").val(suspected.userName);
  1634. $("#js_input_user_age").val(suspected.age);
  1635. //基本情况
  1636. // if (suspected.familyStatus != "") {
  1637. // var familyStatusList = suspected.familyStatus.split(",");
  1638. // if (familyStatusList[0] == 1)
  1639. // $("input[name='checkbox1']").prop("checked", "checked");
  1640. // else
  1641. // $("input[name='checkbox1']").removeAttr("checked");
  1642. // if (familyStatusList[1] == 1)
  1643. // $("input[name='checkbox2']").prop("checked", "checked");
  1644. // else
  1645. // $("input[name='checkbox2']").removeAttr("checked");
  1646. // if (familyStatusList[2] == 1)
  1647. // $("input[name='checkbox3']").prop("checked", "checked");
  1648. // else
  1649. // $("input[name='checkbox3']").removeAttr("checked");
  1650. // if (familyStatusList[3] == 1)
  1651. // $("input[name='checkbox4']").prop("checked", "checked");
  1652. // else
  1653. // $("input[name='checkbox4']").removeAttr("checked");
  1654. // if (familyStatusList[4] == 1)
  1655. // $("input[name='checkbox5']").prop("checked", "checked");
  1656. // else
  1657. // $("input[name='checkbox5']").removeAttr("checked");
  1658. // if (familyStatusList[5] == 1)
  1659. // $("input[name='checkbox6']").prop("checked", "checked");
  1660. // else
  1661. // $("input[name='checkbox6']").removeAttr("checked");
  1662. // if (familyStatusList[6] == 1)
  1663. // $("input[name='checkbox7']").prop("checked", "checked");
  1664. // else
  1665. // $("input[name='checkbox7']").removeAttr("checked");
  1666. //
  1667. // }
  1668. // userFamilyStatus = formatUserStatus(suspected.familyStatus)
  1669. // userFamilyStatusStr = getFamilyStatus(suspected.familyStatus)
  1670. // $("#js_input_user_status").val(userFamilyStatusStr);
  1671. // $("#js_input_user_status").attr("data-values", formatUserStatus(suspected.familyStatus));
  1672. // $("#js_input_user_status").data("values", userFamilyStatus);
  1673. // $("#jibenmiaoshu").val(suspected.statusDesp);
  1674. if (suspected.medical == 0)
  1675. $("input[id='s18']").prop("checked", "checked");
  1676. if (suspected.medical == 1){
  1677. $("input[id='s19']").prop("checked", "checked");
  1678. // ids.forEach(v=>{
  1679. // $('#'+v).show('fast')
  1680. // });
  1681. $.each(ids,function (i,v) {
  1682. $('#'+v).show('fast')
  1683. })
  1684. }
  1685. // if (suspected.medical == 2)
  1686. // $("input[id='s20']").prop("checked", "checked");
  1687. // if (suspected.medical == 3)
  1688. // $("input[id='s21']").prop("checked", "checked");
  1689. // if (suspected.medical == 4)
  1690. // $("input[id='s22']").prop("checked", "checked");
  1691. // $("#js_input_user_crov19").val(crov19States[suspected.medical].title);
  1692. // $("#js_input_user_crov19").attr("data-values", suspected.medical);
  1693. if (suspected.isContact == 0)
  1694. $("input[id='s28']").prop("checked", "checked");
  1695. if (suspected.isContact == 1)
  1696. $("input[id='s29']").prop("checked", "checked");
  1697. if (suspected.isSuspected == 0)
  1698. $("input[id='s38']").prop("checked", "checked");
  1699. if (suspected.isSuspected == 1)
  1700. $("input[id='s39']").prop("checked", "checked");
  1701. if (suspected.isContact == 0 && suspected.isSuspected == 0)
  1702. $("input[id='s40']").prop("checked", "checked");
  1703. if (suspected.isContact == 1 || suspected.isSuspected == 1){
  1704. $("input[id='s41']").prop("checked", "checked");
  1705. // ids2.forEach(v=>{
  1706. // $('#'+v).show('fast')
  1707. // })
  1708. $.each(ids2,function (i,v) {
  1709. $('#'+v).show('fast')
  1710. })
  1711. }
  1712. if(suspected.isTrip == 0){
  1713. $("input[id='s50']").prop("checked", "checked");
  1714. }else {
  1715. $("input[id='s51']").prop("checked", "checked");
  1716. }
  1717. if(suspected.temperature > 37.2){
  1718. $("input[id='s61']").prop("checked", "checked");
  1719. $("#js_input_user_tiwen").show();
  1720. }else {
  1721. $("input[id='s60']").prop("checked", "checked");
  1722. $("#js_input_user_tiwen").hide();
  1723. }
  1724. // $("#switchQuezhen").val(getMedical(suspected.medical));
  1725. // $("#switchQuezhen").attr("data-values", suspected.medical);
  1726. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  1727. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  1728. $("#js_input_user_tiwen").val(suspected.temperature||36.5);
  1729. $("#js_input_user_xinguan").val(getXinguan(suspected.medicalState||0));
  1730. $("#js_input_user_xinguan").attr("data-values", suspected.medicalState||0);
  1731. $("#js_input_user_kesou").val(getCough(suspected.cough));
  1732. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  1733. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  1734. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  1735. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  1736. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  1737. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  1738. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  1739. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  1740. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  1741. $("#shuruqita").val(suspected.others);
  1742. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  1743. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  1744. $("#js_input_temperature_score").val(suspected.temperatureScore);
  1745. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  1746. $("#js_input_score").val(suspected.score);
  1747. //工作驻地
  1748. $("#js_input_gzzd").val(getLocal(suspected.workLocal));
  1749. $("#js_input_gzzd").attr("data-values", suspected.workLocal);
  1750. if (suspected.workLocal != 4) {
  1751. $('#js_input_qtdd').attr("disabled", "disabled");
  1752. $("#js_input_qtdd").val("");
  1753. } else {
  1754. $('#js_input_qtdd').removeAttr("disabled")
  1755. }
  1756. $("#js_input_qtdd").val(suspected.workLocalOther);
  1757. //今晚驻地
  1758. $("#js_input_jrszd").val(getLocal(suspected.todayLocal));
  1759. $("#js_input_jrszd").attr("data-values", suspected.todayLocal);
  1760. if (suspected.todayLocal != 4) {
  1761. $('#js_input_jrszq').attr("disabled", "disabled");
  1762. $("#js_input_jrszq").val("");
  1763. }
  1764. else {
  1765. $('#js_input_jrszq').removeAttr("disabled")
  1766. }
  1767. $("#js_input_jrszq").val(suspected.todayLocalOther);
  1768. //是否出行
  1769. // $("#js_input_sf").val(getIsTrip(suspected.isTrip));
  1770. // $("#js_input_sf").attr("data-values", suspected.isTrip);
  1771. if (suspected.isTrip == 0){
  1772. $('#none').hide('fast')
  1773. }else {
  1774. $('#none').show('fast')
  1775. }
  1776. //详细
  1777. $.ajax({
  1778. url: '/home/selectTripSuspected',
  1779. get: "get",
  1780. data: {
  1781. "suspectedId": suspectedId
  1782. },
  1783. success: function (data) {
  1784. if (data.data.length != 0) {
  1785. }
  1786. listcx.splice(0, listcx.length);
  1787. $('#tabtr').empty();
  1788. var person = {};
  1789. // var xxIds = [];
  1790. // var xxName = [
  1791. // "序号",
  1792. // "出发地",
  1793. // "目的地",
  1794. // "出行方式",
  1795. // "车次/航班/车牌",
  1796. // "操作"
  1797. // ];
  1798. // for (var i = 0; i < xxName.length; i++) {
  1799. // xxIds.push({
  1800. // name: xxName[i]
  1801. // });
  1802. // }
  1803. // $('#tabtr').empty();
  1804. // var html = "<tr style='background-color: #f8f8f8;'>";
  1805. // for (var i = 0; i < xxIds.length; i++) {
  1806. // html += "<th>" + xxIds[i].name + "</th>";
  1807. // }
  1808. // html += "</tr>"
  1809. // data.data.forEach(function (v) {
  1810. // {
  1811. // person = new Object();
  1812. // person.startLocal = v.startLocal;
  1813. // person.startLocalOther = v.startLocalOther;
  1814. // person.endLocal = v.endLocal;
  1815. // person.endLocalOther = v.endLocalOther;
  1816. // person.tripType = v.tripType;
  1817. // person.startLocalStr = getLocalOther(v.startLocal, v.startLocalOther);
  1818. // person.endlocalStr = getLocalOther(v.endLocal, v.endLocalOther);
  1819. // person.tripTypeStr = getTripType(v.tripType);
  1820. // person.tripTypeDesp = v.tripTypeDesp;
  1821. // listcx.push(person);
  1822. // console.log(listcx,'listcx')
  1823. // // html += "<tr>";
  1824. // // html += "<td style='text-align: center;'>" + v.sort + "</td>";
  1825. // // html += "<td style='text-align: center;' >" + getLocalOther(v.startLocal, v.startLocalOther) + " </td>";
  1826. // // html += "<td style='text-align: center;' >" + getLocalOther(v.endLocal, v.endLocalOther) + " </td>";
  1827. // // html += "<td style='text-align: center;' >" + getTripType(v.tripType) + " </td>";
  1828. // // html += "<td style='text-align: center;' >" + v.tripTypeDesp + " </td>";
  1829. // // 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>";
  1830. // // html += "</tr>";
  1831. // // $("#tabtr").html(html);
  1832. // }
  1833. // });
  1834. $.each(data.data,function (i,v) {
  1835. person = {};
  1836. person.startLocal = v.startLocal;
  1837. person.startLocalOther = v.startLocalOther;
  1838. person.endLocal = v.endLocal;
  1839. person.endLocalOther = v.endLocalOther;
  1840. person.tripType = v.tripType;
  1841. person.startLocalStr = getLocalOther(v.startLocal, v.startLocalOther);
  1842. person.endlocalStr = getLocalOther(v.endLocal, v.endLocalOther);
  1843. person.tripTypeStr = getTripType(v.tripType);
  1844. person.tripTypeDesp = v.tripTypeDesp;
  1845. listcx.push(person);
  1846. })
  1847. tab();
  1848. },
  1849. });
  1850. }
  1851. },
  1852. });
  1853. }
  1854. function addReport() {
  1855. if (!canSahngbao) {
  1856. return;
  1857. }
  1858. var userId = $("#userId").val();
  1859. $.ajax({
  1860. url: '/home/addReport',
  1861. type: "post",
  1862. data: {
  1863. "userCreate": userId,
  1864. },
  1865. success: function (data) {
  1866. $.toast(data.msg)
  1867. var date = new Date();
  1868. var Y = date.getFullYear() + '-';
  1869. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  1870. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
  1871. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
  1872. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
  1873. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
  1874. var time = Y + M + D + h + m + s;
  1875. if (data.msg == "操作成功") {
  1876. canSahngbao = false;
  1877. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1878. document.getElementById("txt_shangbao").style['color'] = "#0bb20c";
  1879. document.getElementById("txt_shangbaotime").style['color'] = "#0bb20c";
  1880. $('#txt_shangbao').empty();
  1881. $('#txt_shangbao').append("今日已上报");
  1882. $('#txt_shangbaotime').empty();
  1883. $('#txt_shangbaotime').append("上报时间:" + time);
  1884. }
  1885. },
  1886. });
  1887. }
  1888. $("#my-input-ribao").calendar({
  1889. dateFormat: 'yyyy-mm-dd',
  1890. inputReadOnly: false,
  1891. onChange: function (p, values, displayValues) {
  1892. var reportDate = values+'';
  1893. var userId = $("#userId").val();
  1894. $.ajax({
  1895. url: '/home/home/queryRibaoReportDate',
  1896. data: {
  1897. "userCreate": userId,
  1898. "reportDate": reportDate,
  1899. },
  1900. type: 'GET',
  1901. success: function (data) {
  1902. if (data.data == undefined || data.data == "") {
  1903. $('#ribao_famliy').empty();
  1904. }
  1905. else {
  1906. if (data.data.length > 0) {
  1907. $('#ribao_famliy').empty();
  1908. // data.data.forEach(function (v) {
  1909. // helpValue1(v);
  1910. // });
  1911. $.each(data.data,function (i,v) {
  1912. helpValue1(v);
  1913. })
  1914. } else {
  1915. }
  1916. }
  1917. },
  1918. error: function () {
  1919. }
  1920. });
  1921. }
  1922. });
  1923. function helpValue1(v) {
  1924. var userName = v.userName + ":";
  1925. var grender = getGreder(v.grender);
  1926. var age = v.age;
  1927. var familyStatus = "";
  1928. // if (v.familyStatus != 0)
  1929. // familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  1930. var medical = "新冠肺炎:" + getMedical(v.medical) + ";<br/>";
  1931. var isContact = "";
  1932. if (v.isContact != 0)
  1933. isContact = "家庭成员中有新冠肺炎疫情或有过病例接触史人员:" + getIsContact(v.isContact) + ";<br/>";
  1934. var isSuspected = "";
  1935. if (v.isSuspected != 0)
  1936. isSuspected = "近期接触的家庭成员中有感冒、发热、咳嗽等症状:" + getIsContact(v.isContact) + ";<br/>";
  1937. var isContactHistory = '';
  1938. if(!isContact && !isSuspected){
  1939. isContactHistory = "新冠肺炎接触史:无;<br/>";
  1940. }
  1941. var singleRoom = "";
  1942. var uptownId = $("#uptownId").val();
  1943. if (uptownId != xiaoquId && uptownId != ceshixiaoquId) {
  1944. if (v.singleRoom != 0)
  1945. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";<br/>";
  1946. if (v.singleRoom == 0 && v.medical != 0)
  1947. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";<br/>";
  1948. }
  1949. var tempTemperature = v.temperature>37.2?'异常,'+v.temperature+'度':'正常,37.2度以下';
  1950. var temperature = "体温:" + tempTemperature + ";<br/>";
  1951. var cough = "";
  1952. if (v.cough != 0)
  1953. cough = "咳嗽现象:" + getCough(v.cough) + ";<br/>";
  1954. var muscle = "";
  1955. if (v.muscle != 0)
  1956. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";<br/>";
  1957. var dyspnea = "";
  1958. if (v.dyspnea != 0)
  1959. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";<br/>";
  1960. var fatigue = "";
  1961. if (v.fatigue != 0)
  1962. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";<br/>";
  1963. var diarrhea = "";
  1964. if (v.diarrhea != 0)
  1965. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";<br/>";
  1966. var others = "";
  1967. if (v.others != "")
  1968. others = "其他描述:" + v.others + ";<br/>";
  1969. var scoreRezult = "";
  1970. if (v.scoreRezult != 0)
  1971. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";<br/>";
  1972. var workLocal = "";
  1973. var todayLocal = "";
  1974. var isTrip = "";
  1975. var tripDet = "";
  1976. var uptownId = $("#uptownId").val();
  1977. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  1978. // if (v.workLocal != 0) {
  1979. // if (v.workLocal < 4)
  1980. // workLocal = "工作驻地:" + getLocal(v.workLocal) + ";";
  1981. // else
  1982. // workLocal = "工作驻地:其它地点_" + v.workLocalOther + ";";
  1983. // }
  1984. //
  1985. // if (v.todayLocal != 0) {
  1986. // if (v.todayLocal < 4)
  1987. // todayLocal = "今晚住地:" + getLocal(v.todayLocal) + ";";
  1988. // else
  1989. // todayLocal = "今晚住地:其它地点_" + v.todayLocalOther + ";";
  1990. // }
  1991. if (v.isTrip != undefined)
  1992. isTrip = "有无离开工作驻地:" + getIsTrip(v.isTrip) + ";<br/>"
  1993. if (v.tripDet != undefined)
  1994. tripDet = "出行详细:" + v.tripDet + ";<br/>"
  1995. }
  1996. $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: auto">\n' +
  1997. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
  1998. ' <div style="height: auto">' + temperature + familyStatus + medical + singleRoom + cough + muscle + dyspnea + fatigue + diarrhea + others + isContactHistory +isContact + isSuspected + scoreRezult + workLocal + todayLocal + isTrip + tripDet + '</div>\n' +
  1999. ' </div>\n' +
  2000. ' '));
  2001. }
  2002. function getGreder(greder) {
  2003. if (greder == 1)
  2004. return "男";
  2005. else if (greder == 2)
  2006. return "女";
  2007. return "";
  2008. }
  2009. function getFamilyStatus(familyStatus) {
  2010. var familyStatusList = familyStatus.split(",");
  2011. console.log(familyStatusList)
  2012. var familyStatusString = "";
  2013. if (familyStatus == '0,0,0,0,0,0,0'){
  2014. familyStatusString += "无病史";
  2015. return familyStatusString
  2016. } else {
  2017. if (familyStatusList[0] == 1)
  2018. familyStatusString += "心脑血管疾病(服用ARB),";
  2019. if (familyStatusList[1] == 1)
  2020. familyStatusString += "心脑血管疾病(未服ARB),";
  2021. if (familyStatusList[2] == 1)
  2022. familyStatusString += "呼吸系统病史,";
  2023. if (familyStatusList[3] == 1)
  2024. familyStatusString += "肿瘤病史,";
  2025. if (familyStatusList[4] == 1)
  2026. familyStatusString += "糖尿病史,";
  2027. if (familyStatusList[5] == 1)
  2028. familyStatusString += "服用过激素药物,";
  2029. if (familyStatusList[6] == 1)
  2030. familyStatusString += "妊娠期,";
  2031. }
  2032. return familyStatusString.substring(0, familyStatusString.length - 1);
  2033. }
  2034. function formatUserStatus(str) {
  2035. var statusList = str.split(',');
  2036. console.log(statusList)
  2037. var resultStr = '';
  2038. for(var i = 0;i<statusList.length;i++){
  2039. if(statusList[i] == 1){
  2040. resultStr += i+','
  2041. }
  2042. }
  2043. if(resultStr){
  2044. var tempArr = resultStr.split(',')
  2045. tempArr.pop()
  2046. resultStr = tempArr.join(',')
  2047. }else {
  2048. resultStr = '0'
  2049. }
  2050. console.log(resultStr)
  2051. return resultStr
  2052. }
  2053. function getXinguan(cough) {
  2054. if (cough == 0)
  2055. return "无";
  2056. else if (cough == 1)
  2057. return "确诊";
  2058. else if (cough == 2)
  2059. return "疑似";
  2060. else if (cough == 3)
  2061. return "解除隔离";
  2062. return "";
  2063. }
  2064. function getCough(cough) {
  2065. if (cough == 0)
  2066. return "无";
  2067. else if (cough == 1)
  2068. return "偶尔短暂咳嗽";
  2069. else if (cough == 2)
  2070. return "咳嗽轻度影响生活";
  2071. else if (cough == 3)
  2072. return "咳嗽严重影响生活";
  2073. return "";
  2074. }
  2075. function getMuscle(muscle) {
  2076. if (muscle == 0)
  2077. return "无";
  2078. else if (muscle == 1)
  2079. return "按压有";
  2080. else if (muscle == 2)
  2081. return "偶尔";
  2082. else if (muscle == 3)
  2083. return "持续有";
  2084. return "";
  2085. }
  2086. function getDyspnea(dyspnea) {
  2087. if (dyspnea == 0)
  2088. return "无";
  2089. else if (dyspnea == 1)
  2090. return "急走或上坡气短";
  2091. else if (dyspnea == 2)
  2092. return "气短而走路变慢";
  2093. else if (dyspnea == 3)
  2094. return "走路数分钟后气短";
  2095. else if (dyspnea == 4)
  2096. return "气短无法离开房间";
  2097. return "";
  2098. }
  2099. function getFatigue(fatigue) {
  2100. if (fatigue == 0)
  2101. return "无";
  2102. else if (fatigue == 1)
  2103. return "体力劳动后不能恢复";
  2104. else if (fatigue == 2)
  2105. return "轻体力活非常累";
  2106. else if (fatigue == 3)
  2107. return "不能正常生活";
  2108. return "";
  2109. }
  2110. function getMedical(medical) {
  2111. if (medical == 0)
  2112. return "无";
  2113. else if (medical == 1)
  2114. return "确诊";
  2115. else if (medical == 2)
  2116. return "疑似";
  2117. else if (medical == 3)
  2118. return "有接触史";
  2119. else if (medical == 4)
  2120. return "解除隔离";
  2121. return "";
  2122. }
  2123. function getIsContact(isContact) {
  2124. if (isContact == 0)
  2125. return "否";
  2126. else if (isContact == 1)
  2127. return "是";
  2128. return "";
  2129. }
  2130. function getSingleRoom(singleRoom) {
  2131. if (singleRoom == 0)
  2132. return "否";
  2133. else if (singleRoom == 1)
  2134. return "是";
  2135. return "";
  2136. }
  2137. function getIsTrip(isTrip) {
  2138. if (isTrip == 0)
  2139. return "无";
  2140. else if (isTrip == 1)
  2141. return "有";
  2142. return "";
  2143. }
  2144. function getLocal(local) {
  2145. if (local == 0)
  2146. return "";
  2147. else if (local == 1)
  2148. return "武汉市";
  2149. else if (local == 2)
  2150. return "宜昌市";
  2151. else if (local == 3)
  2152. return "当阳市";
  2153. else if (local == 4)
  2154. return "其它地点";
  2155. return "";
  2156. }
  2157. function getLocalOther(local, localOther) {
  2158. if (local == 0)
  2159. return "";
  2160. else if (local == 1)
  2161. return "武汉市";
  2162. else if (local == 2)
  2163. return "宜昌市";
  2164. else if (local == 3)
  2165. return "当阳市";
  2166. else if (local == 4)
  2167. return "其它地点_" + localOther;
  2168. return "";
  2169. }
  2170. function getTripType(tripType) {
  2171. if (tripType == 0)
  2172. return "";
  2173. else if (tripType == 1)
  2174. return "长途汽车";
  2175. else if (tripType == 2)
  2176. return "火车";
  2177. else if (tripType == 3)
  2178. return "飞机";
  2179. else if (tripType == 4)
  2180. return "自驾";
  2181. return "";
  2182. }
  2183. function getDiarrhea(diarrhea) {
  2184. if (diarrhea == 0)
  2185. return "无";
  2186. else if (diarrhea == 1)
  2187. return "轻度腹泻(少于3次)";
  2188. else if (diarrhea == 2)
  2189. return "中度腹泻(4-6次)";
  2190. else if (diarrhea == 3)
  2191. return "重度腹泻(超过6次)";
  2192. return "";
  2193. }
  2194. function clearShow() {
  2195. console.log("qingkong")
  2196. //病情
  2197. var ids = ['js_input_user_tiwen','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'];
  2198. // ids.forEach(iv=>{
  2199. // $('#'+iv).hide()
  2200. // })
  2201. $.each(ids,function (i,iv) {
  2202. $('#'+iv).hide()
  2203. })
  2204. //接触史
  2205. var ids2 = ['isContactView','isSuspectedView'];
  2206. // ids2.forEach(iv=>{
  2207. // $('#'+iv).hide()
  2208. // })
  2209. $.each(ids2,function (i,iv) {
  2210. $('#'+iv).hide()
  2211. })
  2212. $("#suspectedId").val("");
  2213. $("#js_input_user_name").val("");
  2214. $("#js_input_user_age").val("");
  2215. $("#js_input_user_sex").val('男');
  2216. $("#js_input_user_sex").attr("data-values", 1);
  2217. $("#switchQuezhen").attr("data-values", "");
  2218. $("#switchQuezhen_zz").val("");
  2219. $("#switchQuezhen_zz").attr("data-values", "");
  2220. $("#switchDanjiangeli").val("");
  2221. $("#switchDanjiangeli").attr("data-values", "");
  2222. $("#js_input_user_tiwen").val("");
  2223. $("#js_input_user_xinguan").val("");
  2224. $("#js_input_user_xinguan").attr("data-values", "");
  2225. $("#js_input_user_kesou").val("");
  2226. $("#js_input_user_kesou").attr("data-values", "");
  2227. $("#js_input_user_jirou").val("");
  2228. $("#js_input_user_jirou").attr("data-values", "");
  2229. $("#js_input_user_huxi").val("");
  2230. $("#js_input_user_huxi").attr("data-values", "");
  2231. $("#js_input_user_fali").val("");
  2232. $("#js_input_user_fali").attr("data-values", "");
  2233. $("#js_input_user_fuxie").val("");
  2234. $("#js_input_user_fuxie").attr("data-values", "");
  2235. $("#shuruqita").val("");
  2236. $("#js_input_score_rezult").val("");
  2237. $("#js_input_score_rezult_value").val("");
  2238. $("#js_input_temperature_score").val("");
  2239. $("#js_input_score_histroy").val("");
  2240. $("#js_input_score").val("");
  2241. //出行
  2242. $("#js_input_gzzd").val("");
  2243. $("#js_input_gzzd").attr("data-values", "");
  2244. $("#js_input_qtdd").val("");
  2245. $("#js_input_jrszd").val("");
  2246. $("#js_input_jrszd").attr("data-values", "");
  2247. $("#js_input_jrszq").val("");
  2248. $("#js_input_sf").val(getIsTrip(0));
  2249. $("#js_input_sf").attr("data-values", 0);
  2250. $('#none').hide();
  2251. $("input[id='s18']").removeAttr("checked");
  2252. $("input[id='s19']").removeAttr("checked");
  2253. // $("input[id='s20']").removeAttr("checked");
  2254. // $("input[id='s21']").removeAttr("checked");
  2255. // $("input[id='s22']").removeAttr("checked");
  2256. // $("#js_input_user_status").val('');
  2257. // $("#js_input_user_status").attr("data-values", '');
  2258. // $("#js_input_user_crov19").val('无');
  2259. // $("#js_input_user_crov19").attr("data-values", '0');
  2260. $("input[id='s28']").removeAttr("checked");
  2261. $("input[id='s29']").removeAttr("checked");
  2262. $("input[id='s38']").removeAttr("checked");
  2263. $("input[id='s39']").removeAttr("checked");
  2264. $("input[id='s40']").removeAttr("checked");
  2265. $("input[id='s41']").removeAttr("checked");
  2266. $("input[id='s50']").removeAttr("checked");
  2267. $("input[id='s51']").removeAttr("checked");
  2268. $("input[id='s60']").removeAttr("checked");
  2269. $("input[id='s61']").removeAttr("checked");
  2270. resetTravelState(true)
  2271. }
  2272. //健康评估
  2273. $('#ribao_score').on('click', function () {
  2274. var suspectedId = $("#suspectedId").val();
  2275. var userId = $("#userId").val();
  2276. var userName = $("#js_input_user_name").val();
  2277. var medical = $("input[name='radio']:checked").val() == undefined ? 0 : $("input[name='radio']:checked").val();
  2278. var medicalzz = $("#switchQuezhen_zz").attr("data-values") == undefined ? 0 : $("#switchQuezhen_zz").attr("data-values");
  2279. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  2280. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  2281. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  2282. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  2283. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  2284. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  2285. if (userName == undefined || userName == '') {
  2286. $.alert("请填写姓名");
  2287. return;
  2288. }
  2289. if (temperature <= 0) {
  2290. $.alert("请填写体温");
  2291. return;
  2292. }
  2293. if (temperature > 50 || temperature < 30) {
  2294. $.alert("请填写正确的体温");
  2295. return;
  2296. }
  2297. $.ajax({
  2298. url: '/home/addScore',
  2299. type: "post",
  2300. data: {
  2301. "userName": userName,
  2302. "suspectedId": suspectedId,
  2303. "userCreate": userId,
  2304. "medical": medical,
  2305. "temperature": temperature,
  2306. "cough": cough,
  2307. "muscle": muscle,
  2308. "dyspnea": dyspnea,
  2309. "fatigue": fatigue,
  2310. "diarrhea": diarrhea,
  2311. },
  2312. success: function (data) {
  2313. if (data == undefined) {
  2314. $('#js_input_score_rezult').empty();
  2315. $('#js_input_score_rezult_value').empty();
  2316. $('#js_input_temperature_score').empty();
  2317. $('#js_input_score_histroy').empty();
  2318. $('#js_input_score').empty();
  2319. }
  2320. else {
  2321. $('#js_input_score_rezult').empty();
  2322. $('#js_input_temperature_score').empty();
  2323. $('#js_input_score_histroy').empty();
  2324. $('#js_input_score').empty();
  2325. var ScoreRezult = getScoreRezult(data.scoreRezult, data.temperatureScore);
  2326. $("#js_input_score_rezult").val(ScoreRezult);
  2327. $("#js_input_score_rezult_value").val(data.scoreRezult);
  2328. $("#js_input_temperature_score").val(data.temperatureScore);
  2329. $("#js_input_score_histroy").val(data.scoreHistory);
  2330. $("#js_input_score").val(data.score);
  2331. }
  2332. },
  2333. });
  2334. });
  2335. function getScoreRezult(scoreRezult, temperatureScore) {
  2336. if (scoreRezult == 0)
  2337. return "未评估";
  2338. else if (scoreRezult == 1) {
  2339. if (temperatureScore > 1)
  2340. return "正常,间隔时间服用退烧药,多休息,多喝水";
  2341. else
  2342. return "正常";
  2343. }
  2344. else if (scoreRezult == 2) {
  2345. if (temperatureScore > 1)
  2346. return "注意观察,间隔时间服用退烧药,多休息,多喝水";
  2347. else
  2348. return "注意观察";
  2349. }
  2350. else if (scoreRezult == 3)
  2351. return "联系社区医生(或者在线问诊)";
  2352. else if (scoreRezult == 4)
  2353. return "尽快就诊";
  2354. return "";
  2355. }
  2356. //2020-06-16
  2357. function initRadioEvent() {
  2358. //各选择器
  2359. var selects = [
  2360. 'js_input_gzzd',
  2361. 'js_input_jrszd',
  2362. 'js_input_sf',
  2363. 'js_input_cfd',
  2364. 'js_input_mdd',
  2365. 'js_input_cxfs',
  2366. 'js_input_user_sex',
  2367. 'js_input_user_xinguan',
  2368. 'js_input_user_jirou',
  2369. 'js_input_user_kesou',
  2370. 'js_input_user_huxi',
  2371. 'js_input_user_fali',
  2372. 'js_input_user_fuxie'
  2373. ];
  2374. //病情
  2375. 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']
  2376. // ids.forEach(iv=>{
  2377. // $('#'+iv).hide()
  2378. // })
  2379. $.each(ids,function (i,iv) {
  2380. $('#'+iv).hide()
  2381. })
  2382. $('input[name="radio"]').on('change',function () {
  2383. // selects.forEach(v=>{
  2384. // $('#'+v).select("close")
  2385. // })
  2386. $.each(selects,function (i,v) {
  2387. $('#'+v).select("close")
  2388. })
  2389. var state = this.value
  2390. // ids.forEach(v=>{
  2391. // if(state == 1){
  2392. // $('#'+v).show('fast')
  2393. // }else {
  2394. // //reset
  2395. // $("#switchQuezhen").val(getMedical(0));
  2396. // $("#switchQuezhen").attr("data-values", 0);
  2397. //
  2398. // $("#switchDanjiangeli").val(getSingleRoom(0));
  2399. // $("#switchDanjiangeli").attr("data-values", 0);
  2400. //
  2401. // $("#js_input_user_xinguan").val(getXinguan(0));
  2402. // $("#js_input_user_xinguan").attr("data-values", 0);
  2403. //
  2404. // $("#js_input_user_kesou").val(getCough(0));
  2405. // $("#js_input_user_kesou").attr("data-values", 0);
  2406. //
  2407. // $("#js_input_user_jirou").val(getMuscle(0));
  2408. // $("#js_input_user_jirou").attr("data-values", 0);
  2409. //
  2410. // $("#js_input_user_huxi").val(getDyspnea(0));
  2411. // $("#js_input_user_huxi").attr("data-values", 0);
  2412. //
  2413. // $("#js_input_user_fali").val(getFatigue(0));
  2414. // $("#js_input_user_fali").attr("data-values", 0);
  2415. //
  2416. // $("#js_input_user_fuxie").val(getDiarrhea(0));
  2417. // $("#js_input_user_fuxie").attr("data-values", 0);
  2418. //
  2419. // $("#shuruqita").val('');
  2420. //
  2421. // $('#'+v).hide('fast')
  2422. // }
  2423. //
  2424. // })
  2425. $.each(ids,function (i,v) {
  2426. if(state == 1){
  2427. $('#'+v).show('fast')
  2428. }else {
  2429. //reset
  2430. $("#switchQuezhen").val(getMedical(0));
  2431. $("#switchQuezhen").attr("data-values", 0);
  2432. $("#switchDanjiangeli").val(getSingleRoom(0));
  2433. $("#switchDanjiangeli").attr("data-values", 0);
  2434. $("#js_input_user_xinguan").val(getXinguan(0));
  2435. $("#js_input_user_xinguan").attr("data-values", 0);
  2436. $("#js_input_user_kesou").val(getCough(0));
  2437. $("#js_input_user_kesou").attr("data-values", 0);
  2438. $("#js_input_user_jirou").val(getMuscle(0));
  2439. $("#js_input_user_jirou").attr("data-values", 0);
  2440. $("#js_input_user_huxi").val(getDyspnea(0));
  2441. $("#js_input_user_huxi").attr("data-values", 0);
  2442. $("#js_input_user_fali").val(getFatigue(0));
  2443. $("#js_input_user_fali").attr("data-values", 0);
  2444. $("#js_input_user_fuxie").val(getDiarrhea(0));
  2445. $("#js_input_user_fuxie").attr("data-values", 0);
  2446. $("#shuruqita").val('');
  2447. $('#'+v).hide('fast')
  2448. }
  2449. })
  2450. })
  2451. //接触史
  2452. var ids2 = ['isContactView','isSuspectedView'];
  2453. // ids2.forEach(iv=>{
  2454. // $('#'+iv).hide()
  2455. // })
  2456. $.each(ids2,function (i,iv) {
  2457. $('#'+iv).hide()
  2458. })
  2459. $('input[name="radio3"]').on('change',function () {
  2460. // selects.forEach(v=>{
  2461. // $('#'+v).select("close")
  2462. // })
  2463. $.each(selects,function (i,v) {
  2464. $('#'+v).select("close")
  2465. })
  2466. var state = this.value
  2467. // ids2.forEach(v=>{
  2468. // if(state == 1){
  2469. // $("input[id='s28']").removeAttr("checked");
  2470. // $("input[id='s38']").removeAttr("checked");
  2471. // $("input[id='s29']").prop("checked", "checked");
  2472. // $("input[id='s39']").prop("checked", "checked");
  2473. // $('#'+v).show('fast')
  2474. // }else {
  2475. // $("input[id='s28']").prop("checked", "checked");
  2476. // $("input[id='s29']").removeAttr("checked");
  2477. // $("input[id='s38']").prop("checked", "checked");
  2478. // $("input[id='s39']").removeAttr("checked");
  2479. // $('#'+v).hide('fast')
  2480. // }
  2481. // })
  2482. $.each(ids2,function (i,v) {
  2483. if(state == 1){
  2484. $("input[id='s28']").removeAttr("checked");
  2485. $("input[id='s38']").removeAttr("checked");
  2486. $("input[id='s29']").prop("checked", "checked");
  2487. $("input[id='s39']").prop("checked", "checked");
  2488. $('#'+v).show('fast')
  2489. }else {
  2490. $("input[id='s28']").prop("checked", "checked");
  2491. $("input[id='s29']").removeAttr("checked");
  2492. $("input[id='s38']").prop("checked", "checked");
  2493. $("input[id='s39']").removeAttr("checked");
  2494. $('#'+v).hide('fast')
  2495. }
  2496. })
  2497. })
  2498. $('input[name="radio1"]').on('click',function () {
  2499. var state = this.value
  2500. if(state == 0 && $('input[name="radio2"]:checked').val() == 0){
  2501. $("input[id='s41']").removeAttr("checked");
  2502. $("input[id='s40']").prop("checked", "checked");
  2503. // ids2.forEach(iv=>{
  2504. // $('#'+iv).hide('fast')
  2505. // })
  2506. $.each(ids2,function (i,iv) {
  2507. $('#'+iv).hide('fast')
  2508. })
  2509. }
  2510. })
  2511. $('input[name="radio2"]').on('click',function () {
  2512. var state = this.value
  2513. if(state == 0 && $('input[name="radio1"]:checked').val() == 0){
  2514. $("input[id='s41']").removeAttr("checked");
  2515. $("input[id='s40']").prop("checked", "checked");
  2516. // ids2.forEach(iv=>{
  2517. // $('#'+iv).hide('fast')
  2518. // })
  2519. $.each(ids2,function (i,iv) {
  2520. $('#'+iv).hide('fast')
  2521. })
  2522. }
  2523. })
  2524. //出行
  2525. $('input[name="radio4"]').on('change',function () {
  2526. var state = this.value
  2527. resetTravelState(state == 0)
  2528. })
  2529. //体温
  2530. $('input[name="radio5"]').on('change',function () {
  2531. var state = this.value
  2532. resetTiwen(state == 0)
  2533. })
  2534. }
  2535. function resetTiwen(bool) {
  2536. if(bool){
  2537. $("#js_input_user_tiwen").hide('fast');
  2538. $("#js_input_user_tiwen").val(36.5);
  2539. }else {
  2540. $("#js_input_user_tiwen").show('fast');
  2541. $("#js_input_user_tiwen").val('');
  2542. }
  2543. }