ribao.js 106 KB

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