ribao.js 86 KB

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