ribao.js 100 KB

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