ribao.js 82 KB

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