ribao.js 79 KB

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