ribao.js 86 KB

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