ribao.js 86 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779
  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. if(!$("#suspectedId").val()) {
  1476. suspectedId = "1";
  1477. }
  1478. $.toast("处理中...", 'loading');
  1479. $.ajax({
  1480. url: '/home/addRibaoTrip',
  1481. type: "post",
  1482. contentType: "application/json; charset=utf-8",
  1483. data: JSON.stringify(pdata),
  1484. success: function (data) {
  1485. $.toast.prototype.defaults.duration = tempTimes
  1486. console.log('data:', data.msgReport);
  1487. if (data == {} || data == '' || data == null || data == undefined) {
  1488. $.toast("数据提交失败,请重新提交!", 'forbidden');
  1489. cantijiao = true;
  1490. return;
  1491. }
  1492. if (data.reportId == null || data.reportId == undefined || data.reportId <= 0) {
  1493. $.toast("数据提交失败,请重新提交!", 'forbidden');
  1494. cantijiao = true;
  1495. return;
  1496. }
  1497. if (data.msgReport == "2") {
  1498. cantijiao = true;
  1499. $.toast("家人姓名不能重复,如果重复,可以带上称呼");
  1500. return;
  1501. }
  1502. if (data.msgReport == "4") {
  1503. cantijiao = true;
  1504. $.toast("是否出行,请如实填写!");
  1505. return;
  1506. }
  1507. if ($('#ribao')[0].style.display == 'none') {
  1508. $('#notOpenRibao').toggle();
  1509. $('#ribao')[0].style.display = '';
  1510. } else {
  1511. $('#notOpenRibao')[0].style.display = '';
  1512. $('#ribao')[0].style.display = 'none';
  1513. }
  1514. cantijiao = true
  1515. $('#ribao_jinrijujian').empty();
  1516. $('#ribao_jinrijujian').append(data.safetyNum);
  1517. //修改
  1518. var uptownId = $("#uptownId").val();
  1519. //是凌云
  1520. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  1521. if (suspectedId > 0) {
  1522. var date = new Date();
  1523. var Y = date.getFullYear() + '-';
  1524. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  1525. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
  1526. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
  1527. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
  1528. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
  1529. var time = Y + M + D + h + m + s;
  1530. canSahngbao = false;
  1531. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1532. document.getElementById("txt_shangbao").style['color'] = "#0bb20c";
  1533. document.getElementById("txt_shangbaotime").style['color'] = "#0bb20c";
  1534. $('#txt_shangbao').empty();
  1535. $('#txt_shangbao').append("今日已上报");
  1536. $('#txt_shangbaotime').empty();
  1537. $('#txt_shangbaotime').append("上报时间:" + time);
  1538. }
  1539. else {
  1540. canSahngbao = true;
  1541. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1542. document.getElementById("txt_shangbao").style['color'] = "red";
  1543. $('#txt_shangbao').empty();
  1544. $('#txt_shangbao').append("今日未上报");
  1545. $('#txt_shangbaotime').empty();
  1546. }
  1547. }
  1548. else {
  1549. canSahngbao = true;
  1550. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1551. document.getElementById("txt_shangbao").style['color'] = "red";
  1552. $('#txt_shangbao').empty();
  1553. $('#txt_shangbao').append("今日未上报");
  1554. $('#txt_shangbaotime').empty();
  1555. // $.toast("请点击上报");
  1556. }
  1557. $.toast("操作成功");
  1558. ribao_refrash();
  1559. clearShow();
  1560. },
  1561. });
  1562. }
  1563. function deleteSuspected(suspectedId) {
  1564. $.confirm({
  1565. title: '是否确定删除上报信息?',
  1566. onOK: function () {
  1567. $.ajax({
  1568. url: '/home/deleteSuspected',
  1569. type: "post",
  1570. data: {
  1571. "suspectedId": suspectedId
  1572. },
  1573. success: function (data) {
  1574. $('#ribao_jinrijujian').empty();
  1575. $('#ribao_jinrijujian').append(data.safetyNum);
  1576. //今日未上报
  1577. canSahngbao = true;
  1578. document.getElementById("btn_shangbao").style['background-color'] = "#0bb20c";
  1579. document.getElementById("txt_shangbao").style['color'] = "red";
  1580. $('#txt_shangbao').empty();
  1581. $('#txt_shangbao').append("今日未上报");
  1582. $('#txt_shangbaotime').empty();
  1583. $('#ribao_famliy').empty();
  1584. ribao_refrash();
  1585. clearShow();
  1586. $.toast("删除后请重新添加上报");
  1587. },
  1588. });
  1589. },
  1590. onCancel: function () {
  1591. }
  1592. });
  1593. }
  1594. //重新填报
  1595. function goReport() {
  1596. $("#suspectedId").val("");
  1597. if ($('#ribao')[0].style.display == 'none') {
  1598. $('#notOpenRibao').toggle();
  1599. $('#ribao')[0].style.display = '';
  1600. } else {
  1601. $('#notOpenRibao')[0].style.display = '';
  1602. $('#ribao')[0].style.display = 'none';
  1603. }
  1604. }
  1605. //修改上报
  1606. function updateSuspected(suspectedId) {
  1607. userFamilyStatus = ''
  1608. userFamilyStatusStr = ''
  1609. //病情
  1610. 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'];
  1611. //接触史
  1612. var ids2 = ['isContactView','isSuspectedView'];
  1613. $("#suspectedId").val("");
  1614. if ($('#ribao')[0].style.display == 'none') {
  1615. $('#notOpenRibao').toggle();
  1616. $('#ribao')[0].style.display = '';
  1617. } else {
  1618. $('#notOpenRibao')[0].style.display = '';
  1619. $('#ribao')[0].style.display = 'none';
  1620. }
  1621. $.ajax({
  1622. url: '/home/selectSuspected',
  1623. get: "get",
  1624. data: {
  1625. "suspectedId": suspectedId
  1626. },
  1627. success: function (data) {
  1628. // console.log(data);
  1629. if (data) {
  1630. // 获取定位
  1631. getLocation();
  1632. var suspected = data;
  1633. $("#suspectedId").val(suspected.suspectedId);
  1634. $("#js_input_user_sex").val(getGreder(suspected.grender));
  1635. $("#js_input_user_sex").attr("data-values", suspected.grender);
  1636. $("#js_input_user_name").val(suspected.userName);
  1637. $("#js_input_user_age").val(suspected.age);
  1638. //基本情况
  1639. // if (suspected.familyStatus != "") {
  1640. // var familyStatusList = suspected.familyStatus.split(",");
  1641. // if (familyStatusList[0] == 1)
  1642. // $("input[name='checkbox1']").prop("checked", "checked");
  1643. // else
  1644. // $("input[name='checkbox1']").removeAttr("checked");
  1645. // if (familyStatusList[1] == 1)
  1646. // $("input[name='checkbox2']").prop("checked", "checked");
  1647. // else
  1648. // $("input[name='checkbox2']").removeAttr("checked");
  1649. // if (familyStatusList[2] == 1)
  1650. // $("input[name='checkbox3']").prop("checked", "checked");
  1651. // else
  1652. // $("input[name='checkbox3']").removeAttr("checked");
  1653. // if (familyStatusList[3] == 1)
  1654. // $("input[name='checkbox4']").prop("checked", "checked");
  1655. // else
  1656. // $("input[name='checkbox4']").removeAttr("checked");
  1657. // if (familyStatusList[4] == 1)
  1658. // $("input[name='checkbox5']").prop("checked", "checked");
  1659. // else
  1660. // $("input[name='checkbox5']").removeAttr("checked");
  1661. // if (familyStatusList[5] == 1)
  1662. // $("input[name='checkbox6']").prop("checked", "checked");
  1663. // else
  1664. // $("input[name='checkbox6']").removeAttr("checked");
  1665. // if (familyStatusList[6] == 1)
  1666. // $("input[name='checkbox7']").prop("checked", "checked");
  1667. // else
  1668. // $("input[name='checkbox7']").removeAttr("checked");
  1669. //
  1670. // }
  1671. // userFamilyStatus = formatUserStatus(suspected.familyStatus)
  1672. // userFamilyStatusStr = getFamilyStatus(suspected.familyStatus)
  1673. // $("#js_input_user_status").val(userFamilyStatusStr);
  1674. // $("#js_input_user_status").attr("data-values", formatUserStatus(suspected.familyStatus));
  1675. // $("#js_input_user_status").data("values", userFamilyStatus);
  1676. // $("#jibenmiaoshu").val(suspected.statusDesp);
  1677. if (suspected.medical == 0)
  1678. $("input[id='s18']").prop("checked", "checked");
  1679. if (suspected.medical == 1){
  1680. $("input[id='s19']").prop("checked", "checked");
  1681. // ids.forEach(v=>{
  1682. // $('#'+v).show('fast')
  1683. // });
  1684. $.each(ids,function (i,v) {
  1685. $('#'+v).show('fast')
  1686. })
  1687. }
  1688. // if (suspected.medical == 2)
  1689. // $("input[id='s20']").prop("checked", "checked");
  1690. // if (suspected.medical == 3)
  1691. // $("input[id='s21']").prop("checked", "checked");
  1692. // if (suspected.medical == 4)
  1693. // $("input[id='s22']").prop("checked", "checked");
  1694. // $("#js_input_user_crov19").val(crov19States[suspected.medical].title);
  1695. // $("#js_input_user_crov19").attr("data-values", suspected.medical);
  1696. if (suspected.isContact == 0)
  1697. $("input[id='s28']").prop("checked", "checked");
  1698. if (suspected.isContact == 1)
  1699. $("input[id='s29']").prop("checked", "checked");
  1700. if (suspected.isSuspected == 0)
  1701. $("input[id='s38']").prop("checked", "checked");
  1702. if (suspected.isSuspected == 1)
  1703. $("input[id='s39']").prop("checked", "checked");
  1704. if (suspected.isContact == 0 && suspected.isSuspected == 0)
  1705. $("input[id='s40']").prop("checked", "checked");
  1706. if (suspected.isContact == 1 || suspected.isSuspected == 1){
  1707. $("input[id='s41']").prop("checked", "checked");
  1708. // ids2.forEach(v=>{
  1709. // $('#'+v).show('fast')
  1710. // })
  1711. $.each(ids2,function (i,v) {
  1712. $('#'+v).show('fast')
  1713. })
  1714. }
  1715. if(suspected.isTrip == 0){
  1716. $("input[id='s50']").prop("checked", "checked");
  1717. }else {
  1718. $("input[id='s51']").prop("checked", "checked");
  1719. }
  1720. if(suspected.temperature > 37.2){
  1721. $("input[id='s61']").prop("checked", "checked");
  1722. $("#js_input_user_tiwen").show();
  1723. }else {
  1724. $("input[id='s60']").prop("checked", "checked");
  1725. $("#js_input_user_tiwen").hide();
  1726. }
  1727. // $("#switchQuezhen").val(getMedical(suspected.medical));
  1728. // $("#switchQuezhen").attr("data-values", suspected.medical);
  1729. $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
  1730. $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
  1731. $("#js_input_user_tiwen").val(suspected.temperature||36.5);
  1732. $("#js_input_user_xinguan").val(getXinguan(suspected.medicalState||0));
  1733. $("#js_input_user_xinguan").attr("data-values", suspected.medicalState||0);
  1734. $("#js_input_user_kesou").val(getCough(suspected.cough));
  1735. $("#js_input_user_kesou").attr("data-values", suspected.cough);
  1736. $("#js_input_user_jirou").val(getMuscle(suspected.muscle));
  1737. $("#js_input_user_jirou").attr("data-values", suspected.muscle);
  1738. $("#js_input_user_huxi").val(getDyspnea(suspected.dyspnea));
  1739. $("#js_input_user_huxi").attr("data-values", suspected.dyspnea);
  1740. $("#js_input_user_fali").val(getFatigue(suspected.fatigue));
  1741. $("#js_input_user_fali").attr("data-values", suspected.fatigue);
  1742. $("#js_input_user_fuxie").val(getDiarrhea(suspected.diarrhea));
  1743. $("#js_input_user_fuxie").attr("data-values", suspected.diarrhea);
  1744. $("#shuruqita").val(suspected.others);
  1745. $("#js_input_score_rezult").val(getScoreRezult(suspected.scoreRezult, suspected.temperatureScore));
  1746. $("#js_input_score_rezult_value").val(suspected.scoreRezult);
  1747. $("#js_input_temperature_score").val(suspected.temperatureScore);
  1748. $("#js_input_score_histroy").val(suspected.scoreHistroy);
  1749. $("#js_input_score").val(suspected.score);
  1750. //工作驻地
  1751. $("#js_input_gzzd").val(getLocal(suspected.workLocal));
  1752. $("#js_input_gzzd").attr("data-values", suspected.workLocal);
  1753. if (suspected.workLocal != 4) {
  1754. $('#js_input_qtdd').attr("disabled", "disabled");
  1755. $("#js_input_qtdd").val("");
  1756. } else {
  1757. $('#js_input_qtdd').removeAttr("disabled")
  1758. }
  1759. $("#js_input_qtdd").val(suspected.workLocalOther);
  1760. //今晚驻地
  1761. $("#js_input_jrszd").val(getLocal(suspected.todayLocal));
  1762. $("#js_input_jrszd").attr("data-values", suspected.todayLocal);
  1763. if (suspected.todayLocal != 4) {
  1764. $('#js_input_jrszq').attr("disabled", "disabled");
  1765. $("#js_input_jrszq").val("");
  1766. }
  1767. else {
  1768. $('#js_input_jrszq').removeAttr("disabled")
  1769. }
  1770. $("#js_input_jrszq").val(suspected.todayLocalOther);
  1771. //是否出行
  1772. // $("#js_input_sf").val(getIsTrip(suspected.isTrip));
  1773. // $("#js_input_sf").attr("data-values", suspected.isTrip);
  1774. if (suspected.isTrip == 0){
  1775. $('#none').hide('fast')
  1776. }else {
  1777. $('#none').show('fast')
  1778. }
  1779. //详细
  1780. $.ajax({
  1781. url: '/home/selectTripSuspected',
  1782. get: "get",
  1783. data: {
  1784. "suspectedId": suspectedId
  1785. },
  1786. success: function (data) {
  1787. if (data.data.length != 0) {
  1788. }
  1789. listcx.splice(0, listcx.length);
  1790. $('#tabtr').empty();
  1791. var person = {};
  1792. // var xxIds = [];
  1793. // var xxName = [
  1794. // "序号",
  1795. // "出发地",
  1796. // "目的地",
  1797. // "出行方式",
  1798. // "车次/航班/车牌",
  1799. // "操作"
  1800. // ];
  1801. // for (var i = 0; i < xxName.length; i++) {
  1802. // xxIds.push({
  1803. // name: xxName[i]
  1804. // });
  1805. // }
  1806. // $('#tabtr').empty();
  1807. // var html = "<tr style='background-color: #f8f8f8;'>";
  1808. // for (var i = 0; i < xxIds.length; i++) {
  1809. // html += "<th>" + xxIds[i].name + "</th>";
  1810. // }
  1811. // html += "</tr>"
  1812. // data.data.forEach(function (v) {
  1813. // {
  1814. // person = new Object();
  1815. // person.startLocal = v.startLocal;
  1816. // person.startLocalOther = v.startLocalOther;
  1817. // person.endLocal = v.endLocal;
  1818. // person.endLocalOther = v.endLocalOther;
  1819. // person.tripType = v.tripType;
  1820. // person.startLocalStr = getLocalOther(v.startLocal, v.startLocalOther);
  1821. // person.endlocalStr = getLocalOther(v.endLocal, v.endLocalOther);
  1822. // person.tripTypeStr = getTripType(v.tripType);
  1823. // person.tripTypeDesp = v.tripTypeDesp;
  1824. // listcx.push(person);
  1825. // console.log(listcx,'listcx')
  1826. // // html += "<tr>";
  1827. // // html += "<td style='text-align: center;'>" + v.sort + "</td>";
  1828. // // html += "<td style='text-align: center;' >" + getLocalOther(v.startLocal, v.startLocalOther) + " </td>";
  1829. // // html += "<td style='text-align: center;' >" + getLocalOther(v.endLocal, v.endLocalOther) + " </td>";
  1830. // // html += "<td style='text-align: center;' >" + getTripType(v.tripType) + " </td>";
  1831. // // html += "<td style='text-align: center;' >" + v.tripTypeDesp + " </td>";
  1832. // // 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>";
  1833. // // html += "</tr>";
  1834. // // $("#tabtr").html(html);
  1835. // }
  1836. // });
  1837. $.each(data.data,function (i,v) {
  1838. person = {};
  1839. person.startLocal = v.startLocal;
  1840. person.startLocalOther = v.startLocalOther;
  1841. person.endLocal = v.endLocal;
  1842. person.endLocalOther = v.endLocalOther;
  1843. person.tripType = v.tripType;
  1844. person.startLocalStr = getLocalOther(v.startLocal, v.startLocalOther);
  1845. person.endlocalStr = getLocalOther(v.endLocal, v.endLocalOther);
  1846. person.tripTypeStr = getTripType(v.tripType);
  1847. person.tripTypeDesp = v.tripTypeDesp;
  1848. listcx.push(person);
  1849. })
  1850. tab();
  1851. },
  1852. });
  1853. }
  1854. },
  1855. });
  1856. }
  1857. function addReport() {
  1858. if (!canSahngbao) {
  1859. return;
  1860. }
  1861. var userId = $("#userId").val();
  1862. $.ajax({
  1863. url: '/home/addReport',
  1864. type: "post",
  1865. data: {
  1866. "userCreate": userId,
  1867. },
  1868. success: function (data) {
  1869. $.toast(data.msg)
  1870. var date = new Date();
  1871. var Y = date.getFullYear() + '-';
  1872. var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
  1873. var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
  1874. var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':';
  1875. var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':';
  1876. var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds());
  1877. var time = Y + M + D + h + m + s;
  1878. if (data.msg == "操作成功") {
  1879. canSahngbao = false;
  1880. document.getElementById("btn_shangbao").style['background-color'] = "#D9D9D9";
  1881. document.getElementById("txt_shangbao").style['color'] = "#0bb20c";
  1882. document.getElementById("txt_shangbaotime").style['color'] = "#0bb20c";
  1883. $('#txt_shangbao').empty();
  1884. $('#txt_shangbao').append("今日已上报");
  1885. $('#txt_shangbaotime').empty();
  1886. $('#txt_shangbaotime').append("上报时间:" + time);
  1887. }
  1888. },
  1889. });
  1890. }
  1891. $("#my-input-ribao").calendar({
  1892. dateFormat: 'yyyy-mm-dd',
  1893. inputReadOnly: false,
  1894. onChange: function (p, values, displayValues) {
  1895. var reportDate = values+'';
  1896. var userId = $("#userId").val();
  1897. $.ajax({
  1898. url: '/home/home/queryRibaoReportDate',
  1899. data: {
  1900. "userCreate": userId,
  1901. "reportDate": reportDate,
  1902. },
  1903. type: 'GET',
  1904. success: function (data) {
  1905. if (data.data == undefined || data.data == "") {
  1906. $('#ribao_famliy').empty();
  1907. }
  1908. else {
  1909. if (data.data.length > 0) {
  1910. $('#ribao_famliy').empty();
  1911. // data.data.forEach(function (v) {
  1912. // helpValue1(v);
  1913. // });
  1914. $.each(data.data,function (i,v) {
  1915. helpValue1(v);
  1916. })
  1917. } else {
  1918. }
  1919. }
  1920. },
  1921. error: function () {
  1922. }
  1923. });
  1924. }
  1925. });
  1926. function helpValue1(v) {
  1927. var userName = v.userName + ":";
  1928. var grender = getGreder(v.grender);
  1929. var age = v.age;
  1930. var familyStatus = "";
  1931. // if (v.familyStatus != 0)
  1932. // familyStatus = "基本状况:" + getFamilyStatus(v.familyStatus) + ";";
  1933. var medical = "新冠肺炎:" + getMedical(v.medical) + ";<br/>";
  1934. var isContact = "";
  1935. if (v.isContact != 0)
  1936. isContact = "家庭成员中有新冠肺炎疫情或有过病例接触史人员:" + getIsContact(v.isContact) + ";<br/>";
  1937. var isSuspected = "";
  1938. if (v.isSuspected != 0)
  1939. isSuspected = "近期接触的家庭成员中有感冒、发热、咳嗽等症状:" + getIsContact(v.isContact) + ";<br/>";
  1940. var isContactHistory = '';
  1941. if(!isContact && !isSuspected){
  1942. isContactHistory = "新冠肺炎接触史:无;<br/>";
  1943. }
  1944. var singleRoom = "";
  1945. var uptownId = $("#uptownId").val();
  1946. if (uptownId != xiaoquId && uptownId != ceshixiaoquId) {
  1947. if (v.singleRoom != 0)
  1948. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";<br/>";
  1949. if (v.singleRoom == 0 && v.medical != 0)
  1950. singleRoom = "单间隔离:" + getSingleRoom(v.singleRoom) + ";<br/>";
  1951. }
  1952. var tempTemperature = v.temperature>37.2?'异常,'+v.temperature+'度':'正常,37.2度以下';
  1953. var temperature = "体温:" + tempTemperature + ";<br/>";
  1954. var cough = "";
  1955. if (v.cough != 0)
  1956. cough = "咳嗽现象:" + getCough(v.cough) + ";<br/>";
  1957. var muscle = "";
  1958. if (v.muscle != 0)
  1959. muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";<br/>";
  1960. var dyspnea = "";
  1961. if (v.dyspnea != 0)
  1962. dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";<br/>";
  1963. var fatigue = "";
  1964. if (v.fatigue != 0)
  1965. fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";<br/>";
  1966. var diarrhea = "";
  1967. if (v.diarrhea != 0)
  1968. diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";<br/>";
  1969. var others = "";
  1970. if (v.others != "")
  1971. others = "其他描述:" + v.others + ";<br/>";
  1972. var scoreRezult = "";
  1973. if (v.scoreRezult != 0)
  1974. scoreRezult = "评估结果:" + getScoreRezult(v.scoreRezult, v.temperatureScore) + ";<br/>";
  1975. var workLocal = "";
  1976. var todayLocal = "";
  1977. var isTrip = "";
  1978. var tripDet = "";
  1979. var uptownId = $("#uptownId").val();
  1980. if (uptownId == xiaoquId || uptownId == ceshixiaoquId) {
  1981. // if (v.workLocal != 0) {
  1982. // if (v.workLocal < 4)
  1983. // workLocal = "工作驻地:" + getLocal(v.workLocal) + ";";
  1984. // else
  1985. // workLocal = "工作驻地:其它地点_" + v.workLocalOther + ";";
  1986. // }
  1987. //
  1988. // if (v.todayLocal != 0) {
  1989. // if (v.todayLocal < 4)
  1990. // todayLocal = "今晚住地:" + getLocal(v.todayLocal) + ";";
  1991. // else
  1992. // todayLocal = "今晚住地:其它地点_" + v.todayLocalOther + ";";
  1993. // }
  1994. if (v.isTrip != undefined)
  1995. isTrip = "有无离开工作驻地:" + getIsTrip(v.isTrip) + ";<br/>"
  1996. if (v.tripDet != undefined)
  1997. tripDet = "出行详细:" + v.tripDet + ";<br/>"
  1998. }
  1999. $('#ribao_famliy').append($('<div class="weui-media-box weui-media-box_text" style="height: auto">\n' +
  2000. ' <h4 class="weui-media-box__title">' + userName + '&nbsp;&nbsp;&nbsp;' + grender + '&nbsp;&nbsp;&nbsp;' + age + '</h4>\n' +
  2001. ' <div style="height: auto">' + temperature + familyStatus + medical + singleRoom + cough + muscle + dyspnea + fatigue + diarrhea + others + isContactHistory +isContact + isSuspected + scoreRezult + workLocal + todayLocal + isTrip + tripDet + '</div>\n' +
  2002. ' </div>\n' +
  2003. ' '));
  2004. }
  2005. function getGreder(greder) {
  2006. if (greder == 1)
  2007. return "男";
  2008. else if (greder == 2)
  2009. return "女";
  2010. return "";
  2011. }
  2012. function getFamilyStatus(familyStatus) {
  2013. var familyStatusList = familyStatus.split(",");
  2014. console.log(familyStatusList)
  2015. var familyStatusString = "";
  2016. if (familyStatus == '0,0,0,0,0,0,0'){
  2017. familyStatusString += "无病史";
  2018. return familyStatusString
  2019. } else {
  2020. if (familyStatusList[0] == 1)
  2021. familyStatusString += "心脑血管疾病(服用ARB),";
  2022. if (familyStatusList[1] == 1)
  2023. familyStatusString += "心脑血管疾病(未服ARB),";
  2024. if (familyStatusList[2] == 1)
  2025. familyStatusString += "呼吸系统病史,";
  2026. if (familyStatusList[3] == 1)
  2027. familyStatusString += "肿瘤病史,";
  2028. if (familyStatusList[4] == 1)
  2029. familyStatusString += "糖尿病史,";
  2030. if (familyStatusList[5] == 1)
  2031. familyStatusString += "服用过激素药物,";
  2032. if (familyStatusList[6] == 1)
  2033. familyStatusString += "妊娠期,";
  2034. }
  2035. return familyStatusString.substring(0, familyStatusString.length - 1);
  2036. }
  2037. function formatUserStatus(str) {
  2038. var statusList = str.split(',');
  2039. console.log(statusList)
  2040. var resultStr = '';
  2041. for(var i = 0;i<statusList.length;i++){
  2042. if(statusList[i] == 1){
  2043. resultStr += i+','
  2044. }
  2045. }
  2046. if(resultStr){
  2047. var tempArr = resultStr.split(',')
  2048. tempArr.pop()
  2049. resultStr = tempArr.join(',')
  2050. }else {
  2051. resultStr = '0'
  2052. }
  2053. console.log(resultStr)
  2054. return resultStr
  2055. }
  2056. function getXinguan(cough) {
  2057. if (cough == 0)
  2058. return "无";
  2059. else if (cough == 1)
  2060. return "确诊";
  2061. else if (cough == 2)
  2062. return "疑似";
  2063. else if (cough == 3)
  2064. return "解除隔离";
  2065. return "";
  2066. }
  2067. function getCough(cough) {
  2068. if (cough == 0)
  2069. return "无";
  2070. else if (cough == 1)
  2071. return "偶尔短暂咳嗽";
  2072. else if (cough == 2)
  2073. return "咳嗽轻度影响生活";
  2074. else if (cough == 3)
  2075. return "咳嗽严重影响生活";
  2076. return "";
  2077. }
  2078. function getMuscle(muscle) {
  2079. if (muscle == 0)
  2080. return "无";
  2081. else if (muscle == 1)
  2082. return "按压有";
  2083. else if (muscle == 2)
  2084. return "偶尔";
  2085. else if (muscle == 3)
  2086. return "持续有";
  2087. return "";
  2088. }
  2089. function getDyspnea(dyspnea) {
  2090. if (dyspnea == 0)
  2091. return "无";
  2092. else if (dyspnea == 1)
  2093. return "急走或上坡气短";
  2094. else if (dyspnea == 2)
  2095. return "气短而走路变慢";
  2096. else if (dyspnea == 3)
  2097. return "走路数分钟后气短";
  2098. else if (dyspnea == 4)
  2099. return "气短无法离开房间";
  2100. return "";
  2101. }
  2102. function getFatigue(fatigue) {
  2103. if (fatigue == 0)
  2104. return "无";
  2105. else if (fatigue == 1)
  2106. return "体力劳动后不能恢复";
  2107. else if (fatigue == 2)
  2108. return "轻体力活非常累";
  2109. else if (fatigue == 3)
  2110. return "不能正常生活";
  2111. return "";
  2112. }
  2113. function getMedical(medical) {
  2114. if (medical == 0)
  2115. return "无";
  2116. else if (medical == 1)
  2117. return "确诊";
  2118. else if (medical == 2)
  2119. return "疑似";
  2120. else if (medical == 3)
  2121. return "有接触史";
  2122. else if (medical == 4)
  2123. return "解除隔离";
  2124. return "";
  2125. }
  2126. function getIsContact(isContact) {
  2127. if (isContact == 0)
  2128. return "否";
  2129. else if (isContact == 1)
  2130. return "是";
  2131. return "";
  2132. }
  2133. function getSingleRoom(singleRoom) {
  2134. if (singleRoom == 0)
  2135. return "否";
  2136. else if (singleRoom == 1)
  2137. return "是";
  2138. return "";
  2139. }
  2140. function getIsTrip(isTrip) {
  2141. if (isTrip == 0)
  2142. return "无";
  2143. else if (isTrip == 1)
  2144. return "有";
  2145. return "";
  2146. }
  2147. function getLocal(local) {
  2148. if (local == 0)
  2149. return "";
  2150. else if (local == 1)
  2151. return "武汉市";
  2152. else if (local == 2)
  2153. return "宜昌市";
  2154. else if (local == 3)
  2155. return "当阳市";
  2156. else if (local == 4)
  2157. return "其它地点";
  2158. return "";
  2159. }
  2160. function getLocalOther(local, localOther) {
  2161. if (local == 0)
  2162. return "";
  2163. else if (local == 1)
  2164. return "武汉市";
  2165. else if (local == 2)
  2166. return "宜昌市";
  2167. else if (local == 3)
  2168. return "当阳市";
  2169. else if (local == 4)
  2170. return "其它地点_" + localOther;
  2171. return "";
  2172. }
  2173. function getTripType(tripType) {
  2174. if (tripType == 0)
  2175. return "";
  2176. else if (tripType == 1)
  2177. return "长途汽车";
  2178. else if (tripType == 2)
  2179. return "火车";
  2180. else if (tripType == 3)
  2181. return "飞机";
  2182. else if (tripType == 4)
  2183. return "自驾";
  2184. return "";
  2185. }
  2186. function getDiarrhea(diarrhea) {
  2187. if (diarrhea == 0)
  2188. return "无";
  2189. else if (diarrhea == 1)
  2190. return "轻度腹泻(少于3次)";
  2191. else if (diarrhea == 2)
  2192. return "中度腹泻(4-6次)";
  2193. else if (diarrhea == 3)
  2194. return "重度腹泻(超过6次)";
  2195. return "";
  2196. }
  2197. function clearShow() {
  2198. console.log("qingkong")
  2199. //病情
  2200. 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'];
  2201. // ids.forEach(iv=>{
  2202. // $('#'+iv).hide()
  2203. // })
  2204. $.each(ids,function (i,iv) {
  2205. $('#'+iv).hide()
  2206. })
  2207. //接触史
  2208. var ids2 = ['isContactView','isSuspectedView'];
  2209. // ids2.forEach(iv=>{
  2210. // $('#'+iv).hide()
  2211. // })
  2212. $.each(ids2,function (i,iv) {
  2213. $('#'+iv).hide()
  2214. })
  2215. $("#suspectedId").val("");
  2216. $("#js_input_user_name").val("");
  2217. $("#js_input_user_age").val("");
  2218. $("#js_input_user_sex").val('男');
  2219. $("#js_input_user_sex").attr("data-values", 1);
  2220. $("#switchQuezhen").attr("data-values", "");
  2221. $("#switchQuezhen_zz").val("");
  2222. $("#switchQuezhen_zz").attr("data-values", "");
  2223. $("#switchDanjiangeli").val("");
  2224. $("#switchDanjiangeli").attr("data-values", "");
  2225. $("#js_input_user_tiwen").val("");
  2226. $("#js_input_user_xinguan").val("");
  2227. $("#js_input_user_xinguan").attr("data-values", "");
  2228. $("#js_input_user_kesou").val("");
  2229. $("#js_input_user_kesou").attr("data-values", "");
  2230. $("#js_input_user_jirou").val("");
  2231. $("#js_input_user_jirou").attr("data-values", "");
  2232. $("#js_input_user_huxi").val("");
  2233. $("#js_input_user_huxi").attr("data-values", "");
  2234. $("#js_input_user_fali").val("");
  2235. $("#js_input_user_fali").attr("data-values", "");
  2236. $("#js_input_user_fuxie").val("");
  2237. $("#js_input_user_fuxie").attr("data-values", "");
  2238. $("#shuruqita").val("");
  2239. $("#js_input_score_rezult").val("");
  2240. $("#js_input_score_rezult_value").val("");
  2241. $("#js_input_temperature_score").val("");
  2242. $("#js_input_score_histroy").val("");
  2243. $("#js_input_score").val("");
  2244. //出行
  2245. $("#js_input_gzzd").val("");
  2246. $("#js_input_gzzd").attr("data-values", "");
  2247. $("#js_input_qtdd").val("");
  2248. $("#js_input_jrszd").val("");
  2249. $("#js_input_jrszd").attr("data-values", "");
  2250. $("#js_input_jrszq").val("");
  2251. $("#js_input_sf").val(getIsTrip(0));
  2252. $("#js_input_sf").attr("data-values", 0);
  2253. $('#none').hide();
  2254. $("input[id='s18']").removeAttr("checked");
  2255. $("input[id='s19']").removeAttr("checked");
  2256. // $("input[id='s20']").removeAttr("checked");
  2257. // $("input[id='s21']").removeAttr("checked");
  2258. // $("input[id='s22']").removeAttr("checked");
  2259. // $("#js_input_user_status").val('');
  2260. // $("#js_input_user_status").attr("data-values", '');
  2261. // $("#js_input_user_crov19").val('无');
  2262. // $("#js_input_user_crov19").attr("data-values", '0');
  2263. $("input[id='s28']").removeAttr("checked");
  2264. $("input[id='s29']").removeAttr("checked");
  2265. $("input[id='s38']").removeAttr("checked");
  2266. $("input[id='s39']").removeAttr("checked");
  2267. $("input[id='s40']").removeAttr("checked");
  2268. $("input[id='s41']").removeAttr("checked");
  2269. $("input[id='s50']").removeAttr("checked");
  2270. $("input[id='s51']").removeAttr("checked");
  2271. $("input[id='s60']").removeAttr("checked");
  2272. $("input[id='s61']").removeAttr("checked");
  2273. resetTravelState(true)
  2274. }
  2275. //健康评估
  2276. $('#ribao_score').on('click', function () {
  2277. var suspectedId = $("#suspectedId").val();
  2278. var userId = $("#userId").val();
  2279. var userName = $("#js_input_user_name").val();
  2280. var medical = $("input[name='radio']:checked").val() == undefined ? 0 : $("input[name='radio']:checked").val();
  2281. var medicalzz = $("#switchQuezhen_zz").attr("data-values") == undefined ? 0 : $("#switchQuezhen_zz").attr("data-values");
  2282. var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
  2283. var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
  2284. var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
  2285. var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
  2286. var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
  2287. var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
  2288. if (userName == undefined || userName == '') {
  2289. $.alert("请填写姓名");
  2290. return;
  2291. }
  2292. if (temperature <= 0) {
  2293. $.alert("请填写体温");
  2294. return;
  2295. }
  2296. if (temperature > 50 || temperature < 30) {
  2297. $.alert("请填写正确的体温");
  2298. return;
  2299. }
  2300. $.ajax({
  2301. url: '/home/addScore',
  2302. type: "post",
  2303. data: {
  2304. "userName": userName,
  2305. "suspectedId": suspectedId,
  2306. "userCreate": userId,
  2307. "medical": medical,
  2308. "temperature": temperature,
  2309. "cough": cough,
  2310. "muscle": muscle,
  2311. "dyspnea": dyspnea,
  2312. "fatigue": fatigue,
  2313. "diarrhea": diarrhea,
  2314. },
  2315. success: function (data) {
  2316. if (data == undefined) {
  2317. $('#js_input_score_rezult').empty();
  2318. $('#js_input_score_rezult_value').empty();
  2319. $('#js_input_temperature_score').empty();
  2320. $('#js_input_score_histroy').empty();
  2321. $('#js_input_score').empty();
  2322. }
  2323. else {
  2324. $('#js_input_score_rezult').empty();
  2325. $('#js_input_temperature_score').empty();
  2326. $('#js_input_score_histroy').empty();
  2327. $('#js_input_score').empty();
  2328. var ScoreRezult = getScoreRezult(data.scoreRezult, data.temperatureScore);
  2329. $("#js_input_score_rezult").val(ScoreRezult);
  2330. $("#js_input_score_rezult_value").val(data.scoreRezult);
  2331. $("#js_input_temperature_score").val(data.temperatureScore);
  2332. $("#js_input_score_histroy").val(data.scoreHistory);
  2333. $("#js_input_score").val(data.score);
  2334. }
  2335. },
  2336. });
  2337. });
  2338. function getScoreRezult(scoreRezult, temperatureScore) {
  2339. if (scoreRezult == 0)
  2340. return "未评估";
  2341. else if (scoreRezult == 1) {
  2342. if (temperatureScore > 1)
  2343. return "正常,间隔时间服用退烧药,多休息,多喝水";
  2344. else
  2345. return "正常";
  2346. }
  2347. else if (scoreRezult == 2) {
  2348. if (temperatureScore > 1)
  2349. return "注意观察,间隔时间服用退烧药,多休息,多喝水";
  2350. else
  2351. return "注意观察";
  2352. }
  2353. else if (scoreRezult == 3)
  2354. return "联系社区医生(或者在线问诊)";
  2355. else if (scoreRezult == 4)
  2356. return "尽快就诊";
  2357. return "";
  2358. }
  2359. //2020-06-16
  2360. function initRadioEvent() {
  2361. //各选择器
  2362. var selects = [
  2363. 'js_input_gzzd',
  2364. 'js_input_jrszd',
  2365. 'js_input_sf',
  2366. 'js_input_cfd',
  2367. 'js_input_mdd',
  2368. 'js_input_cxfs',
  2369. 'js_input_user_sex',
  2370. 'js_input_user_xinguan',
  2371. 'js_input_user_jirou',
  2372. 'js_input_user_kesou',
  2373. 'js_input_user_huxi',
  2374. 'js_input_user_fali',
  2375. 'js_input_user_fuxie'
  2376. ];
  2377. //病情
  2378. 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']
  2379. // ids.forEach(iv=>{
  2380. // $('#'+iv).hide()
  2381. // })
  2382. $.each(ids,function (i,iv) {
  2383. $('#'+iv).hide()
  2384. })
  2385. $('input[name="radio"]').on('change',function () {
  2386. // selects.forEach(v=>{
  2387. // $('#'+v).select("close")
  2388. // })
  2389. $.each(selects,function (i,v) {
  2390. $('#'+v).select("close")
  2391. })
  2392. var state = this.value
  2393. // ids.forEach(v=>{
  2394. // if(state == 1){
  2395. // $('#'+v).show('fast')
  2396. // }else {
  2397. // //reset
  2398. // $("#switchQuezhen").val(getMedical(0));
  2399. // $("#switchQuezhen").attr("data-values", 0);
  2400. //
  2401. // $("#switchDanjiangeli").val(getSingleRoom(0));
  2402. // $("#switchDanjiangeli").attr("data-values", 0);
  2403. //
  2404. // $("#js_input_user_xinguan").val(getXinguan(0));
  2405. // $("#js_input_user_xinguan").attr("data-values", 0);
  2406. //
  2407. // $("#js_input_user_kesou").val(getCough(0));
  2408. // $("#js_input_user_kesou").attr("data-values", 0);
  2409. //
  2410. // $("#js_input_user_jirou").val(getMuscle(0));
  2411. // $("#js_input_user_jirou").attr("data-values", 0);
  2412. //
  2413. // $("#js_input_user_huxi").val(getDyspnea(0));
  2414. // $("#js_input_user_huxi").attr("data-values", 0);
  2415. //
  2416. // $("#js_input_user_fali").val(getFatigue(0));
  2417. // $("#js_input_user_fali").attr("data-values", 0);
  2418. //
  2419. // $("#js_input_user_fuxie").val(getDiarrhea(0));
  2420. // $("#js_input_user_fuxie").attr("data-values", 0);
  2421. //
  2422. // $("#shuruqita").val('');
  2423. //
  2424. // $('#'+v).hide('fast')
  2425. // }
  2426. //
  2427. // })
  2428. $.each(ids,function (i,v) {
  2429. if(state == 1){
  2430. $('#'+v).show('fast')
  2431. }else {
  2432. //reset
  2433. $("#switchQuezhen").val(getMedical(0));
  2434. $("#switchQuezhen").attr("data-values", 0);
  2435. $("#switchDanjiangeli").val(getSingleRoom(0));
  2436. $("#switchDanjiangeli").attr("data-values", 0);
  2437. $("#js_input_user_xinguan").val(getXinguan(0));
  2438. $("#js_input_user_xinguan").attr("data-values", 0);
  2439. $("#js_input_user_kesou").val(getCough(0));
  2440. $("#js_input_user_kesou").attr("data-values", 0);
  2441. $("#js_input_user_jirou").val(getMuscle(0));
  2442. $("#js_input_user_jirou").attr("data-values", 0);
  2443. $("#js_input_user_huxi").val(getDyspnea(0));
  2444. $("#js_input_user_huxi").attr("data-values", 0);
  2445. $("#js_input_user_fali").val(getFatigue(0));
  2446. $("#js_input_user_fali").attr("data-values", 0);
  2447. $("#js_input_user_fuxie").val(getDiarrhea(0));
  2448. $("#js_input_user_fuxie").attr("data-values", 0);
  2449. $("#shuruqita").val('');
  2450. $('#'+v).hide('fast')
  2451. }
  2452. })
  2453. })
  2454. //接触史
  2455. var ids2 = ['isContactView','isSuspectedView'];
  2456. // ids2.forEach(iv=>{
  2457. // $('#'+iv).hide()
  2458. // })
  2459. $.each(ids2,function (i,iv) {
  2460. $('#'+iv).hide()
  2461. })
  2462. $('input[name="radio3"]').on('change',function () {
  2463. // selects.forEach(v=>{
  2464. // $('#'+v).select("close")
  2465. // })
  2466. $.each(selects,function (i,v) {
  2467. $('#'+v).select("close")
  2468. })
  2469. var state = this.value
  2470. // ids2.forEach(v=>{
  2471. // if(state == 1){
  2472. // $("input[id='s28']").removeAttr("checked");
  2473. // $("input[id='s38']").removeAttr("checked");
  2474. // $("input[id='s29']").prop("checked", "checked");
  2475. // $("input[id='s39']").prop("checked", "checked");
  2476. // $('#'+v).show('fast')
  2477. // }else {
  2478. // $("input[id='s28']").prop("checked", "checked");
  2479. // $("input[id='s29']").removeAttr("checked");
  2480. // $("input[id='s38']").prop("checked", "checked");
  2481. // $("input[id='s39']").removeAttr("checked");
  2482. // $('#'+v).hide('fast')
  2483. // }
  2484. // })
  2485. $.each(ids2,function (i,v) {
  2486. if(state == 1){
  2487. $("input[id='s28']").removeAttr("checked");
  2488. $("input[id='s38']").removeAttr("checked");
  2489. $("input[id='s29']").prop("checked", "checked");
  2490. $("input[id='s39']").prop("checked", "checked");
  2491. $('#'+v).show('fast')
  2492. }else {
  2493. $("input[id='s28']").prop("checked", "checked");
  2494. $("input[id='s29']").removeAttr("checked");
  2495. $("input[id='s38']").prop("checked", "checked");
  2496. $("input[id='s39']").removeAttr("checked");
  2497. $('#'+v).hide('fast')
  2498. }
  2499. })
  2500. })
  2501. $('input[name="radio1"]').on('click',function () {
  2502. var state = this.value
  2503. if(state == 0 && $('input[name="radio2"]:checked').val() == 0){
  2504. $("input[id='s41']").removeAttr("checked");
  2505. $("input[id='s40']").prop("checked", "checked");
  2506. // ids2.forEach(iv=>{
  2507. // $('#'+iv).hide('fast')
  2508. // })
  2509. $.each(ids2,function (i,iv) {
  2510. $('#'+iv).hide('fast')
  2511. })
  2512. }
  2513. })
  2514. $('input[name="radio2"]').on('click',function () {
  2515. var state = this.value
  2516. if(state == 0 && $('input[name="radio1"]:checked').val() == 0){
  2517. $("input[id='s41']").removeAttr("checked");
  2518. $("input[id='s40']").prop("checked", "checked");
  2519. // ids2.forEach(iv=>{
  2520. // $('#'+iv).hide('fast')
  2521. // })
  2522. $.each(ids2,function (i,iv) {
  2523. $('#'+iv).hide('fast')
  2524. })
  2525. }
  2526. })
  2527. //出行
  2528. $('input[name="radio4"]').on('change',function () {
  2529. var state = this.value
  2530. resetTravelState(state == 0)
  2531. })
  2532. //体温
  2533. $('input[name="radio5"]').on('change',function () {
  2534. var state = this.value
  2535. resetTiwen(state == 0)
  2536. })
  2537. }
  2538. function resetTiwen(bool) {
  2539. if(bool){
  2540. $("#js_input_user_tiwen").hide('fast');
  2541. $("#js_input_user_tiwen").val(36.5);
  2542. }else {
  2543. $("#js_input_user_tiwen").show('fast');
  2544. $("#js_input_user_tiwen").val('');
  2545. }
  2546. }