ribao.js 81 KB

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