ribao.js 86 KB

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