ribao.js 79 KB

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