collectInfo.js 152 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962
  1. const util = require('../../utils/util.js');
  2. const tools = require('../../utils/tools.js');
  3. var QQMapWX = require('../../libs/qqmap-wx-jssdk.min.js');
  4. var isonShow;
  5. var isTwoOnshow;
  6. Page({
  7. data: {
  8. // isVisittimesnull: true,
  9. // visitWaysFromOther: true,
  10. color: '#898989',
  11. paizhaofalg: false,
  12. activeIndex: 0,
  13. addOldname: '',
  14. addOldname1: '',
  15. showAdress: false,
  16. pleaseChoose: true,
  17. chooseAdressArr: [],
  18. currentIndex: 0,
  19. showBj: false,
  20. showBj1: false,
  21. src1: '../../images/mz/5.png',
  22. src2: '../../images/mz/1.png',
  23. src3: '../../images/mz/6.png',
  24. src4: '../../images/mz/2.png',
  25. src5: '../../images/mz/7.png',
  26. src6: '../../images/mz/3.png',
  27. src7: '../../images/mz/8.png',
  28. src8: '../../images/mz/4.png',
  29. sexArr: [{
  30. value: '男',
  31. name: '男'
  32. },
  33. {
  34. value: '女',
  35. name: '女',
  36. }
  37. ],
  38. nameArr: [],
  39. oldCard: [{
  40. name: false
  41. }],
  42. oldCard1: [{
  43. name: false
  44. }],
  45. oldCard2: [{
  46. name: false
  47. }],
  48. // tab1老人信息
  49. oldInfo: [{
  50. name: '',
  51. isSameWithAddress: [{
  52. name: '现居地址与户籍地址一致'
  53. }],
  54. addressExt: '',
  55. nativePlaceExt: '',
  56. oldSex: [{
  57. name: '男'
  58. }, {
  59. name: '女'
  60. }],
  61. nation: '', //民族
  62. idNumber: '', //身份证号
  63. phone: '',
  64. chooseAdressArr: [],
  65. chooseAdressArr1: [],
  66. oldMarry: [{
  67. name: "未婚"
  68. }, {
  69. name: "已婚"
  70. }, {
  71. name: "离异"
  72. }, {
  73. name: "丧偶"
  74. }],
  75. partnerName: '',
  76. partnerIdNumber: '',
  77. healthAyy: [{
  78. name: "健康",
  79. disabled: false
  80. }, {
  81. name: "残疾",
  82. disabled: false
  83. }, {
  84. name: "患重特大疾病",
  85. disabled: false
  86. }, {
  87. name: "老年人慢性病",
  88. disabled: false
  89. }],
  90. disabilityAyy: [{
  91. name: "视力残疾"
  92. }, {
  93. name: "听力残疾"
  94. }, {
  95. name: "言语残疾"
  96. }, {
  97. name: "肢体残疾"
  98. }, {
  99. name: "智力残疾"
  100. }, {
  101. name: "精神残疾"
  102. }, {
  103. name: "多重残疾"
  104. }],
  105. disabilityLevel: '', //残疾人类别
  106. sickType: [{
  107. name: "重大器官类疾病"
  108. }, {
  109. name: "心脑血管类疾病"
  110. }, {
  111. name: "神经与代谢类疾病"
  112. }, {
  113. name: "肢体与病毒类疾病"
  114. }, {
  115. name: "恶性肿瘤"
  116. }],
  117. ability: '', //老年人能力情况
  118. livingCondition: '', //生活经济情况
  119. moneyFromAyy: [{
  120. name: "家庭经营性收入"
  121. }, {
  122. name: "工资性收入"
  123. }, {
  124. name: "转移性收入"
  125. }, {
  126. name: "财产性收入"
  127. }, {
  128. name: "其它"
  129. }],
  130. income: '',
  131. sourceOfIncomeExt: '', //其他收入情况
  132. familyHelpArr: [{
  133. name: "低保"
  134. }, {
  135. name: "建档立卡贫困户"
  136. }, {
  137. name: "医疗救助"
  138. }, {
  139. name: "临时救助"
  140. }, {
  141. name: "老年人福利津贴"
  142. }, {
  143. name: "残疾人两项补贴(或一项补贴)"
  144. }, {
  145. name: "其他救助"
  146. }],
  147. rescueStateExt: '', //其他救助
  148. loneArr: [{
  149. name: "是"
  150. }, {
  151. name: "否"
  152. }],
  153. liveStatus: [{
  154. name: "无人陪伴居住",
  155. disabled: false
  156. }, {
  157. name: "配偶",
  158. disabled: false
  159. }, {
  160. name: "近亲属",
  161. disabled: false
  162. }, {
  163. name: "未成年孙子女",
  164. disabled: false
  165. }, {
  166. name: "其他情形",
  167. disabled: false
  168. }],
  169. accompanyExt: '', //陪伴居住其他
  170. oftenMan: [{
  171. name: "无人照料",
  172. disabled: false
  173. }, {
  174. name: "近亲属",
  175. disabled: false
  176. }, {
  177. name: "配偶",
  178. disabled: false
  179. }, {
  180. name: "邻里互助",
  181. disabled: false
  182. }, {
  183. name: "购买养老服务",
  184. disabled: false
  185. }, {
  186. name: "其他人员",
  187. disabled: false
  188. }],
  189. lookAfterExt: '', //其他日常生活照料人关系
  190. mainLookName: '', //日常生活照料人姓名
  191. mainLookSex: [{
  192. name: "男"
  193. }, {
  194. name: "女"
  195. }],
  196. mainLookPhone: '', //
  197. loveRequire: [{
  198. name: "生活照料"
  199. },
  200. {
  201. name: "生产帮助"
  202. },
  203. {
  204. name: "精神慰藉"
  205. },
  206. {
  207. name: "医疗保健"
  208. },
  209. {
  210. name: "权益维护"
  211. },
  212. {
  213. name: "安全监护"
  214. },
  215. {
  216. name: "文化娱乐"
  217. },
  218. {
  219. name: "紧急救助"
  220. },
  221. {
  222. name: "其它"
  223. },
  224. ],
  225. oldType: [{
  226. name: "农村留守老年人",
  227. disable: false,
  228. checked: false
  229. }, {
  230. name: "分散供养特困老年人",
  231. disable: false,
  232. checked: false
  233. }, {
  234. name: "计划生育特殊家庭老人",
  235. disable: false,
  236. checked: false
  237. }, {
  238. name: "空巢老年人",
  239. disable: false,
  240. checked: false
  241. }, {
  242. name: "独居老年人",
  243. disable: false,
  244. checked: false
  245. }, {
  246. name: "重残老年人",
  247. disable: false,
  248. checked: false
  249. }, {
  250. name: "高龄老年人",
  251. disable: false,
  252. checked: false
  253. }],
  254. isHavePhoto: false,
  255. imgPath: '',
  256. photoAndLocation: '',
  257. }],
  258. mzArr: ["汉族", "壮族", "满族", "回族", "苗族", "维吾尔族", "土家族", "彝族", "蒙古族", "藏族", "布依族", "侗族", "瑶族", "朝鲜族", "白族", "哈尼族",
  259. "哈萨克族", "黎族", "傣族", "畲族", "傈僳族", "仡佬族", "东乡族", "高山族", "拉祜族", "水族", "佤族", "纳西族", "羌族", "土族", "仫佬族", "锡伯族",
  260. "柯尔克孜族", "达斡尔族", "景颇族", "毛南族", "撒拉族", "布朗族", "塔吉克族", "阿昌族", "普米族", "鄂温克族", "怒族", "京族", "基诺族", "德昂族", "保安族",
  261. "俄罗斯族", "裕固族", "乌孜别克族", "门巴族", "鄂伦春族", "独龙族", "塔塔尔族", "赫哲族", "珞巴族"
  262. ],
  263. ableStatus: ["完全自理", "半失能(部分自理)", "完全失能"], //老年人能力情况
  264. chooseAdressArr: [],
  265. disableLeval: ["一级", "二级", "三级", "四级"],
  266. moneyStatus: ["建档立卡贫困户", "一般家庭", "低保", "特困供养人员"],
  267. payMoney: ["5000元以下", "5000-10000元", "10000元以上"],
  268. loveRequire: [{
  269. name: "生活照料"
  270. },
  271. {
  272. name: "生产帮助"
  273. },
  274. {
  275. name: "精神慰藉"
  276. },
  277. {
  278. name: "医疗保健"
  279. },
  280. {
  281. name: "权益维护"
  282. },
  283. {
  284. name: "安全监护"
  285. },
  286. {
  287. name: "文化娱乐"
  288. },
  289. {
  290. name: "紧急救助"
  291. },
  292. {
  293. name: "其它"
  294. },
  295. ],
  296. isHavePhoto: false,
  297. // tab2
  298. childInfo: [{
  299. childrenNum: ''
  300. }],
  301. childNumArr: [
  302. '0个', '1个', '2个', '3个', '3个以上'
  303. ],
  304. ischildName: [false, false, false],
  305. childSexArr: ['男', '女'],
  306. ischildPhone: [false, false, false],
  307. childIsout: ['是', '否'],
  308. showchildOut: [false, false, false],
  309. ischildOutReason: [false, false, false],
  310. region0: [
  311. ['', '', ''],
  312. ['', '', ''],
  313. ['', '', '']
  314. ],
  315. childLeaveDate: ['', '', ''],
  316. childIsMArry: ['是', '否'],
  317. ischildMarry: [false, false, false],
  318. ischildMarryName: [false, false, false],
  319. ischildMarryPhone: [false, false, false],
  320. childTfTimes: ['0次', '1次', '2次及以上'],
  321. // tab3
  322. otherInfo: [{
  323. isHasOther: '',
  324. Info: {
  325. name: '', // 其他赡养人姓名,
  326. sex: '', //其他赡养人性别
  327. phone: '', //其他赡养人电话,
  328. relation: '', //与被赡养人关系 如果选了其他也是必填 单选
  329. relationExt: '', //与被赡养人关系--其他
  330. isHasGoOut: '', //是否外出
  331. outgoingCause: '', //外出原因
  332. outgoingplace: '', // 外出地点
  333. outgoingTime: '', // 最后一次离家时间
  334. isHasPartner: '', //是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0:是 1:否
  335. name2: '',
  336. phone2: '',
  337. visit: '', //平均一年探望次数
  338. othersyrSexArr: [{
  339. name: '男',
  340. checked: false
  341. },
  342. {
  343. name: '女',
  344. checked: false
  345. },
  346. ]
  347. }
  348. }],
  349. othersyrArr: ['是', '否'],
  350. othersyrSexArr: ['男', '女'],
  351. othersyrRelation: [
  352. "近亲属", "孙子女", "兄弟姐妹", "其他"
  353. ],
  354. othersyrIsout: ['是', '否'],
  355. region: ['', '', ''],
  356. othersyrIsMarry: ['是', '否'],
  357. othersyrTfTimes: [
  358. '0次', '1次', '2次及以上'
  359. ],
  360. // tab4
  361. // regularsInfo: {
  362. // visitMode: '', //巡访方式 如果选了其他也是必填 多选
  363. // visitModeExt: '', //巡访方式--其它
  364. // visitCount: '', //巡访频次, 如果选了其他也是必填 单选
  365. // visitCountExt: '', //巡访频次--其它
  366. // },
  367. // visitWays: [{
  368. // name: '电话问候'
  369. // }, {
  370. // name: '上门巡访'
  371. // }, {
  372. // name: '其它'
  373. // }],
  374. // visitTimes: [{
  375. // name: '每天'
  376. // }, {
  377. // name: '每周'
  378. // }, {
  379. // name: '每月'
  380. // }, {
  381. // name: '每季'
  382. // }, {
  383. // name: '其它'
  384. // }],
  385. // syrIndex:
  386. regularsInfos: [{
  387. visitMode: [{
  388. name: '电话问候',
  389. checked: false
  390. }, {
  391. name: '上门巡访',
  392. checked: false
  393. }, {
  394. name: '其它',
  395. checked: false
  396. }],
  397. visitModeExt: '', //巡访其他
  398. visitCount: [{
  399. name: '每天',
  400. checked: false
  401. }, {
  402. name: '每周',
  403. checked: false
  404. }, {
  405. name: '每月',
  406. checked: false
  407. }, {
  408. name: '每季',
  409. checked: false
  410. }, {
  411. name: '其它',
  412. checked: false
  413. }],
  414. visitCountExt: '', // 频次的其他
  415. }],
  416. regularsInfo: [{
  417. visitMode: '',
  418. visitModeExt: '', //巡访其他
  419. visitCount: '',
  420. visitCountExt: '', // 频次的其他
  421. }],
  422. },
  423. // 左侧点击
  424. turn(e) {
  425. let index = e.currentTarget.dataset.index
  426. this.setData({
  427. currentIndex: index
  428. })
  429. },
  430. addOldName(e) {
  431. this.setData({
  432. addOldname: e.detail.value
  433. })
  434. },
  435. addOldName1(e) {
  436. this.setData({
  437. addOldname1: e.detail.value
  438. })
  439. },
  440. qx() {
  441. wx.switchTab({
  442. url: '/pages/index/index',
  443. })
  444. },
  445. qx1() {
  446. this.setData({
  447. showBj1: false
  448. })
  449. },
  450. switchNameTab(e) {
  451. console.log(this.data.childInfo, "$%^&%$#%^&^%$%^&")
  452. this.setData({
  453. activeIndex: e.currentTarget.dataset.index,
  454. currentIndex: 0
  455. })
  456. // wx.request({
  457. // url: util.globalData.publicUrl + '/wxinfo/one',
  458. // method: "get",
  459. // header: {
  460. // appletsId: wx.getStorageSync('openId')
  461. // },
  462. // data: {
  463. // id: e.currentTarget.dataset.item._id
  464. // },
  465. // success: (res) => {
  466. // if (res.data.code == 0) {
  467. // }
  468. // }
  469. // })
  470. },
  471. sure() {
  472. let han = /^[\u4e00-\u9fa5]+$/;
  473. if (this.data.addOldname == '' || this.data.addOldname == null) {
  474. wx.showModal({
  475. showCancel: false,
  476. content: '老人姓名不可以为空哦'
  477. })
  478. return false
  479. }
  480. if (!han.test(this.data.addOldname)) {
  481. wx.showModal({
  482. showCancel: false,
  483. content: '您输入的内容不是汉字哦'
  484. })
  485. return false;
  486. };
  487. if (this.data.addOldname.length < 2) {
  488. wx.showModal({
  489. showCancel: false,
  490. content: '老人姓名不可以少于两个字哦'
  491. })
  492. return false
  493. }
  494. this.setData({
  495. showBj: false,
  496. activeIndex: 0
  497. })
  498. wx.request({
  499. url: util.globalData.publicUrl + '/wxinfo/add',
  500. method: "post",
  501. header: {
  502. appletsId: wx.getStorageSync('openId')
  503. },
  504. data: {
  505. name: this.data.addOldname
  506. },
  507. success: (res) => {
  508. if (res.data.code == 0) {
  509. let name = 'oldInfo[' + this.data.activeIndex + '].name'
  510. this.setData({
  511. nameArr: this.data.nameArr.concat(res.data.data),
  512. familyFid: res.data.data.fid,
  513. [name]: this.data.addOldname,
  514. oldInfo: this.data.oldInfo
  515. })
  516. this.getSelfLocation();
  517. console.log(this.data.nameArr)
  518. console.log(this.data.oldInfo, "添加的他");
  519. }
  520. }
  521. })
  522. },
  523. sure1() {
  524. let han = /^[\u4e00-\u9fa5]+$/;
  525. if (this.data.addOldname1 == '' || this.data.addOldname1 == null) {
  526. wx.showModal({
  527. showCancel: false,
  528. content: '老人姓名不可以为空哦'
  529. })
  530. return false
  531. }
  532. if (!han.test(this.data.addOldname1)) {
  533. wx.showModal({
  534. showCancel: false,
  535. content: '您输入的内容不是汉字哦'
  536. })
  537. return false;
  538. };
  539. if (this.data.addOldname1.length < 2) {
  540. wx.showModal({
  541. showCancel: false,
  542. content: '老人姓名不可以少于两个字哦'
  543. })
  544. return false
  545. }
  546. this.setData({
  547. showBj1: false,
  548. currentIndex: 0
  549. })
  550. wx.request({
  551. url: util.globalData.publicUrl + '/wxinfo/add',
  552. method: "post",
  553. header: {
  554. appletsId: wx.getStorageSync('openId')
  555. },
  556. data: {
  557. name: this.data.addOldname1,
  558. fid: this.data.familyFid
  559. },
  560. success: (res) => {
  561. if (res.data.code == 0) {
  562. this.data.oldCard.push({
  563. name: false
  564. })
  565. this.data.oldCard1.push({
  566. name: false
  567. })
  568. this.data.oldCard2.push({
  569. name: false
  570. })
  571. this.data.oldInfo.push({
  572. name: this.data.addOldname1,
  573. addressExt: '',
  574. nativePlaceExt: '',
  575. isSameWithAddress: [{
  576. name: '现居地址与户籍地址一致'
  577. }],
  578. oldSex: [{
  579. name: '男'
  580. }, {
  581. name: '女'
  582. }],
  583. nation: '',
  584. idNumber: '',
  585. phone: '',
  586. chooseAdressArr: [],
  587. chooseAdressArr1: [],
  588. oldMarry: [{
  589. name: "未婚"
  590. }, {
  591. name: "已婚"
  592. }, {
  593. name: "离异"
  594. }, {
  595. name: "丧偶"
  596. }],
  597. partnerName: '',
  598. partnerIdNumber: '',
  599. healthAyy: [{
  600. name: "健康",
  601. disabled: false
  602. }, {
  603. name: "残疾",
  604. disabled: false
  605. }, {
  606. name: "患重特大疾病",
  607. disabled: false
  608. }, {
  609. name: "老年人慢性病",
  610. disabled: false
  611. }],
  612. disabilityAyy: [{
  613. name: "视力残疾"
  614. }, {
  615. name: "听力残疾"
  616. }, {
  617. name: "言语残疾"
  618. }, {
  619. name: "肢体残疾"
  620. }, {
  621. name: "智力残疾"
  622. }, {
  623. name: "精神残疾"
  624. }, {
  625. name: "多重残疾"
  626. }],
  627. disabilityLevel: '', //残疾人等级
  628. sickType: [{
  629. name: "重大器官类疾病"
  630. }, {
  631. name: "心脑血管类疾病"
  632. }, {
  633. name: "神经与代谢类疾病"
  634. }, {
  635. name: "肢体与病毒类疾病"
  636. }, {
  637. name: "恶性肿瘤"
  638. }],
  639. ability: '',
  640. moneyFromAyy: [{
  641. name: "家庭经营性收入"
  642. }, {
  643. name: "工资性收入"
  644. }, {
  645. name: "转移性收入"
  646. }, {
  647. name: "财产性收入"
  648. }, {
  649. name: "其它"
  650. }],
  651. income: '',
  652. sourceOfIncomeExt: '',
  653. familyHelpArr: [{
  654. name: "低保"
  655. }, {
  656. name: "建档立卡贫困户"
  657. }, {
  658. name: "医疗救助"
  659. }, {
  660. name: "临时救助"
  661. }, {
  662. name: "老年人福利津贴"
  663. }, {
  664. name: "残疾人两项补贴(或一项补贴)"
  665. }, {
  666. name: "其他救助"
  667. }],
  668. rescueStateExt: '', //其他救助
  669. loneArr: [{
  670. name: "是"
  671. }, {
  672. name: "否"
  673. }],
  674. liveStatus: [{
  675. name: "无人陪伴居住",
  676. disabled: false
  677. }, {
  678. name: "配偶",
  679. disabled: false
  680. }, {
  681. name: "近亲属",
  682. disabled: false
  683. }, {
  684. name: "未成年孙子女",
  685. disabled: false
  686. }, {
  687. name: "其他情形",
  688. disabled: false
  689. }],
  690. accompanyExt: '', //陪伴居住其他
  691. oftenMan: [{
  692. name: "无人照料",
  693. disabled: false
  694. }, {
  695. name: "近亲属",
  696. disabled: false
  697. }, {
  698. name: "配偶",
  699. disabled: false
  700. }, {
  701. name: "邻里互助",
  702. disabled: false
  703. }, {
  704. name: "购买养老服务",
  705. disabled: false
  706. }, {
  707. name: "其他人员",
  708. disabled: false
  709. }],
  710. lookAfterExt: '', //其他日常生活照料人
  711. mainLookName: '', //日常生活照料人姓名
  712. mainLookSex: [{
  713. name: "男"
  714. }, {
  715. name: "女"
  716. }],
  717. mainLookPhone: '', //日常生活照料人电话
  718. loveRequire: [{
  719. name: "生活照料"
  720. },
  721. {
  722. name: "生产帮助"
  723. },
  724. {
  725. name: "精神慰藉"
  726. },
  727. {
  728. name: "医疗保健"
  729. },
  730. {
  731. name: "权益维护"
  732. },
  733. {
  734. name: "安全监护"
  735. },
  736. {
  737. name: "文化娱乐"
  738. },
  739. {
  740. name: "紧急救助"
  741. },
  742. {
  743. name: "其它"
  744. },
  745. ],
  746. oldType: [{
  747. name: "农村留守老年人",
  748. disable: false,
  749. checked: false
  750. }, {
  751. name: "分散供养特困老年人",
  752. disable: false,
  753. checked: false
  754. }, {
  755. name: "计划生育特殊家庭老人",
  756. disable: false,
  757. checked: false
  758. }, {
  759. name: "空巢老年人",
  760. disable: false,
  761. checked: false
  762. }, {
  763. name: "独居老年人",
  764. disable: false,
  765. checked: false
  766. }, {
  767. name: "重残老年人",
  768. disable: false,
  769. checked: false
  770. }, {
  771. name: "高龄老年人",
  772. disable: false,
  773. checked: false
  774. }],
  775. regularsInfos: {
  776. visitMode: [{
  777. name: '电话问候'
  778. }, {
  779. name: '上门巡访'
  780. }, {
  781. name: '其它'
  782. }],
  783. visitModeExt: '', //巡访其他
  784. visitCount: [{
  785. name: '每天'
  786. }, {
  787. name: '每周'
  788. }, {
  789. name: '每月'
  790. }, {
  791. name: '每季'
  792. }, {
  793. name: '其它'
  794. }],
  795. visitCountExt: '', // 频次的其他
  796. },
  797. regularsInfo: {
  798. visitMode: '',
  799. visitModeExt: '', //巡访其他
  800. visitCount: '',
  801. visitCountExt: '', // 频次的其他
  802. },
  803. isHavePhoto: false,
  804. imgPath: '',
  805. photoAndLocation: '',
  806. })
  807. this.data.childInfo.push({
  808. childrenNum: '',
  809. Info: []
  810. })
  811. this.data.otherInfo.push({
  812. isHasOther: '',
  813. Info: {
  814. name: '', // 其他赡养人姓名,
  815. sex: '', //其他赡养人性别
  816. phone: '', //其他赡养人电话,
  817. relation: '', //与被赡养人关系 如果选了其他也是必填 单选
  818. relationExt: '', //与被赡养人关系--其他
  819. isHasGoOut: '', //是否外出
  820. outgoingCause: '', //外出原因
  821. outgoingplace: '', // 外出地点
  822. outgoingTime: '', // 最后一次离家时间
  823. isHasPartner: '', //是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0:是 1:否
  824. name2: '',
  825. phone2: '',
  826. visit: '', //平均一年探望次数
  827. othersyrSexArr: [{
  828. name: '男',
  829. checked: false
  830. },
  831. {
  832. name: '女',
  833. checked: false
  834. },
  835. ]
  836. }
  837. })
  838. this.data.regularsInfos.push({
  839. visitMode: [{
  840. name: '电话问候',
  841. checked: false
  842. }, {
  843. name: '上门巡访',
  844. checked: false
  845. }, {
  846. name: '其它',
  847. checked: false
  848. }],
  849. visitModeExt: '', //巡访其他
  850. visitCount: [{
  851. name: '每天',
  852. checked: false
  853. }, {
  854. name: '每周',
  855. checked: false
  856. }, {
  857. name: '每月',
  858. checked: false
  859. }, {
  860. name: '每季',
  861. checked: false
  862. }, {
  863. name: '其它',
  864. checked: false
  865. }],
  866. visitCountExt: '', // 频次的其他
  867. })
  868. this.data.regularsInfo.push({
  869. visitMode: '',
  870. visitModeExt: '', //巡访其他
  871. visitCount: '',
  872. visitCountExt: '', // 频次的其他
  873. })
  874. console.log(this.data.childInfo)
  875. this.setData({
  876. activeIndex: this.data.nameArr.concat(res.data.data).length - 1,
  877. nameArr: this.data.nameArr.concat(res.data.data),
  878. oldInfo: this.data.oldInfo,
  879. childInfo: this.data.childInfo,
  880. otherInfo: this.data.otherInfo,
  881. regularsInfos: this.data.regularsInfos,
  882. regularsInfo: this.data.regularsInfo
  883. })
  884. this.getSelfLocation();
  885. }
  886. }
  887. })
  888. },
  889. // 删除上方名字
  890. deleteName(e) {
  891. let index = e.currentTarget.dataset.index
  892. console.log(index);
  893. wx.showModal({
  894. showCancel: true,
  895. content: '确认删除该条记录吗',
  896. success: (res) => {
  897. if (res.cancel) {
  898. //点击取消,默认隐藏弹框
  899. } else {
  900. wx.request({
  901. url: util.globalData.publicUrl + '/wxinfo/delete',
  902. method: "get",
  903. header: {
  904. appletsId: wx.getStorageSync('openId')
  905. },
  906. data: {
  907. id: e.currentTarget.dataset.item._id
  908. },
  909. success: (res) => {
  910. console.log(res)
  911. if (res.data.code == 0) {
  912. this.data.nameArr.splice(index, 1)
  913. this.data.oldInfo.splice(index, 1)
  914. this.data.otherInfo.splice(index, 1)
  915. this.data.childInfo.splice(index, 1)
  916. this.setData({
  917. oldInfo: this.data.oldInfo,
  918. nameArr: this.data.nameArr,
  919. otherInfo: this.data.otherInfo,
  920. childInfo: this.data.childInfo,
  921. })
  922. if ((this.data.activeIndex == index && this.data.activeIndex > 0) || (this.data.activeIndex > index && this.data.activeIndex > 0)) {
  923. this.setData({
  924. activeIndex: this.data.activeIndex - 1
  925. })
  926. }
  927. if (this.data.nameArr.length == 0) {
  928. wx.switchTab({
  929. url: '/pages/index/index',
  930. })
  931. }
  932. }
  933. }
  934. })
  935. }
  936. }
  937. })
  938. },
  939. // 添加带fid的老人
  940. addFamilyOldman() {
  941. this.setData({
  942. showBj1: true,
  943. addOldname1: ''
  944. })
  945. },
  946. goOcr() {
  947. console.log(this.data.nameArr)
  948. isonShow = true;
  949. wx.showLoading({
  950. title: '加载中',
  951. })
  952. let _this = this
  953. wx.request({
  954. url: util.globalData.publicUrl + '/applet/getToken',
  955. method: "GET",
  956. header: {
  957. appletsId: wx.getStorageSync('openId')
  958. },
  959. success: (res) => {
  960. console.log(res.data, "0000");
  961. if (res.data.data.status == 200) {
  962. let token = res.data.data.token;
  963. if (token) {
  964. wx.chooseImage({
  965. count: 1, // 默认9
  966. sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
  967. sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
  968. success: function (res) {
  969. // 拿文件转换base64
  970. const app = getApp()
  971. app.globalData.id = '-1'
  972. wx.getFileSystemManager().readFile({
  973. filePath: res.tempFilePaths[0],
  974. encoding: 'base64',
  975. success: res1 => {
  976. console.log("返回临时文件路径");
  977. //返回临时文件路径
  978. let img = 'data:image/png;base64,' + res1.data
  979. console.log(img,"1232323231222222");
  980. wx.request({
  981. url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/idcard?access_token=' + token,
  982. method: 'POST',
  983. header: {
  984. 'content-type': 'application/x-www-form-urlencoded'
  985. },
  986. data: {
  987. id_card_side: 'front',
  988. image: img
  989. },
  990. dataType: 'json',
  991. success: (e) => {
  992. console.log(e,"看看那ocr返回了么数据呢");
  993. // 扫描后赋值
  994. _this.setData({
  995. showBj: false,
  996. fid: _this.data.familyFid
  997. })
  998. if (e.data.idcard_number_type == 1) {
  999. console.log(e.data.words_result, '我是ocr识别出来的内容')
  1000. console.log(_this.data.oldInfo[_this.data.activeIndex].name, "啊实打实大师多撒大所多撒");
  1001. if (_this.data.oldInfo[_this.data.activeIndex].name == e.data.words_result['姓名'].words) {
  1002. let idNumber = 'oldInfo[' + _this.data.activeIndex + '].idNumber'
  1003. let name = 'oldInfo[' + _this.data.activeIndex + '].name'
  1004. let nation = 'oldInfo[' + _this.data.activeIndex + '].nation'
  1005. let data = _this.data.oldInfo[_this.data.activeIndex].oldSex.map(v => {
  1006. if (v.name == e.data.words_result['性别'].words) {
  1007. return {
  1008. name: v.name,
  1009. checked: true
  1010. }
  1011. }
  1012. return {
  1013. name: v.name,
  1014. checked: false
  1015. }
  1016. })
  1017. let oldSex = 'oldInfo[' + _this.data.activeIndex + '].oldSex'
  1018. _this.setData({
  1019. [idNumber]: e.data.words_result['公民身份号码'].words,
  1020. [name]: e.data.words_result['姓名'].words,
  1021. [nation]: e.data.words_result['民族'].words + '族',
  1022. [oldSex]: data
  1023. })
  1024. _this.SubmitOldmanInfo({
  1025. id: _this.data.nameArr[_this.data.activeIndex]._id,
  1026. idNumber: e.data.words_result['公民身份号码'].words
  1027. })
  1028. _this.SubmitOldmanInfo({
  1029. id: _this.data.nameArr[_this.data.activeIndex]._id,
  1030. name: e.data.words_result['姓名'].words
  1031. })
  1032. _this.SubmitOldmanInfo({
  1033. id: _this.data.nameArr[_this.data.activeIndex]._id,
  1034. nation: e.data.words_result['民族'].words + '族'
  1035. })
  1036. _this.SubmitOldmanInfo({
  1037. id: _this.data.nameArr[_this.data.activeIndex]._id,
  1038. sex: e.data.words_result['性别'].words
  1039. })
  1040. } else {
  1041. console.log("姓名不一样的");
  1042. // wx.showToast({
  1043. // title: "添加当前老人名字和扫描身份证名字不一致,请重新扫描",
  1044. // icon: 'none',
  1045. // duration: 2000,
  1046. // })
  1047. wx.showModal({
  1048. showCancel: false,
  1049. content: '添加当前老人名字和扫描身份证名字不一致,请重新扫描'
  1050. })
  1051. }
  1052. } else {
  1053. wx.showModal({
  1054. showCancel: false,
  1055. content: '身份证OCR识别失败'
  1056. })
  1057. // wx.showToast({
  1058. // title: "身份证OCR识别失败",
  1059. // icon: 'none',
  1060. // duration: 2000,
  1061. // })
  1062. }
  1063. },
  1064. complete: (e) => {
  1065. wx.hideLoading();
  1066. }
  1067. })
  1068. },
  1069. // 错误信息
  1070. fail: console.error
  1071. })
  1072. },
  1073. fail: function () {
  1074. wx.hideLoading();
  1075. },
  1076. complete: function () {
  1077. _this.setData({
  1078. showBj: false,
  1079. })
  1080. }
  1081. })
  1082. } else {
  1083. wx.showToast({
  1084. title: '身份证识别失败,token失效',
  1085. icon: 'none',
  1086. duration: 2000,
  1087. })
  1088. }
  1089. }
  1090. },
  1091. })
  1092. },
  1093. // 老人姓名
  1094. tab1Change1: function (e) {
  1095. if (e.detail.value == null || e.detail.value == '') {
  1096. this.setData({
  1097. oldName: true
  1098. })
  1099. return
  1100. } else {
  1101. console.log(this.data.nameArr)
  1102. let han = /^[\u4e00-\u9fa5]+$/;
  1103. if (!han.test(e.detail.value )) {
  1104. wx.showModal({
  1105. showCancel: false,
  1106. content: '您输入的内容不是汉字哦'
  1107. })
  1108. return false;
  1109. };
  1110. if (e.detail.value .length < 2) {
  1111. wx.showModal({
  1112. showCancel: false,
  1113. content: '老人姓名不可以少于两个字哦'
  1114. })
  1115. return false
  1116. }
  1117. let name = 'nameArr[' + this.data.activeIndex + '].name'
  1118. let oldName = 'oldInfo[' + this.data.activeIndex + '].name'
  1119. this.setData({
  1120. oldName: false,
  1121. [name]: e.detail.value,
  1122. [oldName]: e.detail.value
  1123. })
  1124. console.log(this.data.nameArr)
  1125. }
  1126. this.SubmitOldmanInfo({
  1127. id: this.data.nameArr[this.data.activeIndex]._id,
  1128. name: e.detail.value
  1129. })
  1130. },
  1131. // 性别单选
  1132. tab1Change2(e) {
  1133. let data = this.data.oldInfo[this.data.activeIndex].oldSex.map(v => {
  1134. if (v.name == e.detail.value) {
  1135. return {
  1136. name: v.name,
  1137. checked: true
  1138. }
  1139. }
  1140. return {
  1141. name: v.name,
  1142. checked: false
  1143. }
  1144. })
  1145. let oldSex = 'oldInfo[' + this.data.activeIndex + '].oldSex'
  1146. this.setData({
  1147. [oldSex]: data
  1148. })
  1149. this.SubmitOldmanInfo({
  1150. id: this.data.nameArr[this.data.activeIndex]._id,
  1151. sex: e.detail.value
  1152. })
  1153. },
  1154. // 民族选择
  1155. tab1Change3: function (e) {
  1156. console.log('picker发送选择改变,携带值为', e.detail.value)
  1157. let nation = 'oldInfo[' + this.data.activeIndex + '].nation'
  1158. this.setData({
  1159. [nation]: this.data.mzArr[e.detail.value]
  1160. })
  1161. this.SubmitOldmanInfo({
  1162. id: this.data.nameArr[this.data.activeIndex]._id,
  1163. nation: this.data.mzArr[e.detail.value]
  1164. })
  1165. },
  1166. // 身份证号
  1167. tab1Change4: function (e) {
  1168. console.log('身份证变化了')
  1169. let Info = 'oldCard[' + this.data.activeIndex + '].name'
  1170. let Info1 = 'oldCard1[' + this.data.activeIndex + '].name'
  1171. if (e.detail.value == null || e.detail.value == '') {
  1172. this.setData({
  1173. [Info]: true
  1174. })
  1175. return
  1176. } else {
  1177. this.setData({
  1178. [Info]: false
  1179. })
  1180. }
  1181. if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(e.detail.value)) && e.detail.value.length != 18) {
  1182. this.setData({
  1183. [Info1]: true
  1184. })
  1185. return
  1186. } else {
  1187. this.setData({
  1188. [Info1]: false
  1189. })
  1190. }
  1191. this.IdCard(e.detail.value)
  1192. let idNumber = 'oldInfo[' + this.data.activeIndex + '].idNumber'
  1193. this.setData({
  1194. [idNumber]: e.detail.value
  1195. })
  1196. this.SubmitOldmanInfo({
  1197. id: this.data.nameArr[this.data.activeIndex]._id,
  1198. idNumber: e.detail.value
  1199. })
  1200. },
  1201. IdCard(UUserCard) {
  1202. //获取年龄
  1203. let Info2 = 'oldCard2[' + this.data.activeIndex + '].name'
  1204. var myDate = new Date();
  1205. var month = myDate.getMonth() + 1;
  1206. var day = myDate.getDate();
  1207. var age = myDate.getFullYear() - UUserCard.substring(6, 10) - 1;
  1208. if (UUserCard.substring(10, 12) < month || UUserCard.substring(10, 12) == month && UUserCard.substring(12, 14) <= day) {
  1209. age++;
  1210. }
  1211. if (age < 60) {
  1212. this.setData({
  1213. [Info2]: true
  1214. })
  1215. } else {
  1216. this.setData({
  1217. [Info2]: false
  1218. })
  1219. }
  1220. },
  1221. // 联系电话
  1222. tab1Change5: function (e) {
  1223. if (e.detail.value == null || e.detail.value == '') {
  1224. this.setData({
  1225. oldPhone: true
  1226. })
  1227. return
  1228. } else {
  1229. this.setData({
  1230. oldPhone: false
  1231. })
  1232. }
  1233. if (!(/^[0-9]*$/.test(e.detail.value))) {
  1234. this.setData({
  1235. oldPhone1: true
  1236. })
  1237. return
  1238. } else {
  1239. this.setData({
  1240. oldPhone1: false
  1241. })
  1242. }
  1243. let phone = 'oldInfo[' + this.data.activeIndex + '].phone'
  1244. this.setData({
  1245. [phone]: e.detail.value
  1246. })
  1247. this.SubmitOldmanInfo({
  1248. id: this.data.nameArr[this.data.activeIndex]._id,
  1249. phone: e.detail.value
  1250. })
  1251. console.log(this.data.oldInfo)
  1252. },
  1253. // 补充户籍地址
  1254. tab1Change6(e) {
  1255. console.log(e.detail.value)
  1256. let Info = 'oldInfo[' + this.data.activeIndex + '].nativePlaceExt'
  1257. this.setData({
  1258. [Info]: e.detail.value,
  1259. })
  1260. this.SubmitOldmanInfo({
  1261. id: this.data.nameArr[this.data.activeIndex]._id,
  1262. nativePlaceExt: e.detail.value
  1263. })
  1264. },
  1265. // 现居地址与户籍地址一致
  1266. tab1change6_1(e) {
  1267. console.log(e.detail.value)
  1268. let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
  1269. let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
  1270. const items = this.data.oldInfo[this.data.activeIndex].isSameWithAddress
  1271. const values = e.detail.value
  1272. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1273. items[i].checked = false
  1274. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1275. if (items[i].name === values[j]) {
  1276. items[i].checked = true
  1277. break
  1278. }
  1279. }
  1280. }
  1281. let isSameWithAddress = 'oldInfo[' + this.data.activeIndex + '].isSameWithAddress'
  1282. this.setData({
  1283. [isSameWithAddress]: items
  1284. })
  1285. let address = 'oldInfo[' + this.data.activeIndex + '].address'
  1286. console.log(this.data.oldInfo[this.data.activeIndex].nativePlaceExt, "打印下这个");
  1287. if (e.detail.value[0] == '现居地址与户籍地址一致') {
  1288. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 5) {
  1289. let nativePlaceId = '';
  1290. let nativePlace = '';
  1291. for (let value of this.data.oldInfo[this.data.activeIndex].chooseAdressArr) {
  1292. nativePlace += value.CIVILREGIONALISMNAME + '/'
  1293. nativePlaceId += value.CIVILREGIONALISMID + ','
  1294. console.log(value, "打印下");
  1295. }
  1296. this.SubmitOldmanInfo({
  1297. id: this.data.nameArr[this.data.activeIndex]._id,
  1298. address: nativePlace.substring(0, nativePlace.length - 1),
  1299. addressId: nativePlaceId.substring(0, nativePlaceId.length - 1),
  1300. })
  1301. }
  1302. this.SubmitOldmanInfo({
  1303. id: this.data.nameArr[this.data.activeIndex]._id,
  1304. isSameWithAddress: '是',
  1305. addressExt: this.data.oldInfo[this.data.activeIndex].nativePlaceExt,
  1306. })
  1307. this.setData({
  1308. [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr,
  1309. [Infos]: this.data.oldInfo[this.data.activeIndex].nativePlaceExt,
  1310. })
  1311. } else {
  1312. this.SubmitOldmanInfo({
  1313. id: this.data.nameArr[this.data.activeIndex]._id,
  1314. isSameWithAddress: '否',
  1315. addressExt: '',
  1316. })
  1317. this.setData({
  1318. [Info]: null,
  1319. [Infos]: '',
  1320. })
  1321. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1)
  1322. }
  1323. },
  1324. // 补充现居住地址
  1325. tab1Change7(e) {
  1326. console.log(e.detail.value)
  1327. let Info = 'oldInfo[' + this.data.activeIndex + '].addressExt'
  1328. this.setData({
  1329. [Info]: e.detail.value
  1330. })
  1331. this.SubmitOldmanInfo({
  1332. id: this.data.nameArr[this.data.activeIndex]._id,
  1333. addressExt: e.detail.value
  1334. })
  1335. },
  1336. // 婚姻以及配偶情况
  1337. tab1Change8: function (e) {
  1338. console.log(e.detail.value)
  1339. if (e.detail.value == '已婚') {
  1340. this.setData({
  1341. oldisMarry: true
  1342. })
  1343. } else {
  1344. this.setData({
  1345. oldisMarry: false,
  1346. oldisMarryName: false,
  1347. oldisMarryPhone: false
  1348. })
  1349. }
  1350. let data = this.data.oldInfo[this.data.activeIndex].oldMarry.map(v => {
  1351. if (v.name == e.detail.value) {
  1352. console.log("我选了")
  1353. return {
  1354. name: v.name,
  1355. checked: true
  1356. }
  1357. }
  1358. return {
  1359. name: v.name,
  1360. checked: false
  1361. }
  1362. })
  1363. console.log(data)
  1364. let oldMarry = 'oldInfo[' + this.data.activeIndex + '].oldMarry'
  1365. this.setData({
  1366. [oldMarry]: data
  1367. })
  1368. console.log(this.data.oldInfo)
  1369. this.SubmitOldmanInfo({
  1370. id: this.data.nameArr[this.data.activeIndex]._id,
  1371. partnerState: e.detail.value
  1372. })
  1373. },
  1374. //配偶的姓名
  1375. tab1Change8_1(e) {
  1376. if (e.detail.value == '' || e.detail.value == null) {
  1377. this.setData({
  1378. oldisMarryName: true
  1379. })
  1380. return
  1381. } else {
  1382. this.setData({
  1383. oldisMarryName: false
  1384. })
  1385. }
  1386. let partnerName = 'oldInfo[' + this.data.activeIndex + '].partnerName'
  1387. this.setData({
  1388. [partnerName]: e.detail.value
  1389. })
  1390. this.SubmitOldmanInfo({
  1391. id: this.data.nameArr[this.data.activeIndex]._id,
  1392. partnerName: e.detail.value
  1393. })
  1394. },
  1395. //配偶身份证号
  1396. tab1Change8_2(e) {
  1397. if (e.detail.value == '' || e.detail.value == null) {
  1398. this.setData({
  1399. oldisMarryPhone: true
  1400. })
  1401. return
  1402. } else {
  1403. this.setData({
  1404. oldisMarryPhone: false
  1405. })
  1406. }
  1407. if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(e.detail.value)) && e.detail.value.length != 18) {
  1408. this.setData({
  1409. oldisMarryPhoneGs: true
  1410. })
  1411. return
  1412. } else {
  1413. let partnerIdNumber = 'oldInfo[' + this.data.activeIndex + '].partnerIdNumber'
  1414. this.setData({
  1415. oldisMarryPhoneGs: false,
  1416. [partnerIdNumber]: e.detail.value
  1417. })
  1418. this.SubmitOldmanInfo({
  1419. id: this.data.nameArr[this.data.activeIndex]._id,
  1420. partnerIdNumber: e.detail.value
  1421. })
  1422. }
  1423. },
  1424. //老人健康状况
  1425. tab1Change9: function (e) {
  1426. console.log(e.detail.value)
  1427. const items = this.data.oldInfo[this.data.activeIndex].healthAyy
  1428. const values = e.detail.value
  1429. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1430. items[i].checked = false
  1431. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1432. if (items[i].name === values[j]) {
  1433. items[i].checked = true
  1434. break
  1435. }
  1436. }
  1437. }
  1438. let healthAyy = 'oldInfo[' + this.data.activeIndex + '].healthAyy'
  1439. this.setData({
  1440. [healthAyy]: items
  1441. })
  1442. console.log(this.data.oldInfo)
  1443. let revise1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].disabled'
  1444. let revise2 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[2].disabled'
  1445. let revise3 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[3].disabled'
  1446. let rev1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].checked'
  1447. let rev2 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[2].checked'
  1448. let rev3 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[3].checked'
  1449. if (e.detail.value.length == 0) {
  1450. this.setData({
  1451. oldHealth1: true,
  1452. [revise1]: false,
  1453. [revise2]: false,
  1454. [revise3]: false,
  1455. })
  1456. return
  1457. } else {
  1458. this.setData({
  1459. oldHealth1: false
  1460. })
  1461. }
  1462. let index = e.detail.value.indexOf('健康');
  1463. let index1 = e.detail.value.indexOf('残疾');
  1464. let index2 = e.detail.value.indexOf('患重特大疾病');
  1465. if (index >= 0) {
  1466. this.setData({
  1467. [revise1]: true,
  1468. [revise2]: true,
  1469. [revise3]: true,
  1470. [rev1]: false,
  1471. [rev2]: false,
  1472. [rev3]: false
  1473. })
  1474. this.SubmitOldmanInfo({
  1475. id: this.data.nameArr[this.data.activeIndex]._id,
  1476. health: JSON.stringify(['健康'])
  1477. })
  1478. } else {
  1479. this.setData({
  1480. [revise1]: false,
  1481. [revise2]: false,
  1482. [revise3]: false,
  1483. })
  1484. }
  1485. // if (index1 >= 0 && index < 0) {
  1486. // this.setData({
  1487. // oldHealth2: true
  1488. // })
  1489. // } else {
  1490. // this.setData({
  1491. // oldHealth2: false,
  1492. // oldDisableType: false,
  1493. // issickTypeNull: false
  1494. // })
  1495. // }
  1496. if (index2 >= 0 && index < 0) {
  1497. this.setData({
  1498. isSick: true
  1499. })
  1500. } else {
  1501. this.setData({
  1502. isSick: false,
  1503. oldDisableType: false,
  1504. issickTypeNull: false
  1505. })
  1506. }
  1507. if (index < 0 && e.detail.value.length != 0) {
  1508. this.SubmitOldmanInfo({
  1509. id: this.data.nameArr[this.data.activeIndex]._id,
  1510. health: JSON.stringify(e.detail.value)
  1511. })
  1512. }
  1513. },
  1514. // 残疾类别
  1515. tab1Change10: function (e) {
  1516. console.log(e.detail.value)
  1517. const items = this.data.oldInfo[this.data.activeIndex].disabilityAyy
  1518. const values = e.detail.value
  1519. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1520. items[i].checked = false
  1521. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1522. if (items[i].name === values[j]) {
  1523. items[i].checked = true
  1524. break
  1525. }
  1526. }
  1527. }
  1528. let disabilityAyy = 'oldInfo[' + this.data.activeIndex + '].disabilityAyy'
  1529. this.setData({
  1530. [disabilityAyy]: items
  1531. })
  1532. if (e.detail.value == null || e.detail.value == '') {
  1533. this.setData({
  1534. oldDisableType: true
  1535. })
  1536. return
  1537. } else {
  1538. this.setData({
  1539. oldDisableType: false
  1540. })
  1541. }
  1542. this.SubmitOldmanInfo({
  1543. id: this.data.nameArr[this.data.activeIndex]._id,
  1544. disabilityCategory: JSON.stringify(e.detail.value)
  1545. })
  1546. },
  1547. // 重特大疾病类别
  1548. tab1Change10_1: function (e) {
  1549. console.log(e.detail.value)
  1550. const items = this.data.oldInfo[this.data.activeIndex].sickType
  1551. const values = e.detail.value
  1552. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1553. items[i].checked = false
  1554. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1555. if (items[i].name === values[j]) {
  1556. items[i].checked = true
  1557. break
  1558. }
  1559. }
  1560. }
  1561. let sickType = 'oldInfo[' + this.data.activeIndex + '].sickType'
  1562. this.setData({
  1563. [sickType]: items
  1564. })
  1565. console.log(this.data.sickType)
  1566. if (e.detail.value.length == 0) {
  1567. this.setData({
  1568. issickTypeNull: true
  1569. })
  1570. return
  1571. } else {
  1572. this.setData({
  1573. issickTypeNull: false
  1574. })
  1575. }
  1576. this.SubmitOldmanInfo({
  1577. id: this.data.nameArr[this.data.activeIndex]._id,
  1578. majorDiseases: JSON.stringify(e.detail.value)
  1579. })
  1580. },
  1581. // 残疾人等级
  1582. tab1Change11: function (e) {
  1583. // this.setData({
  1584. // levalIndex: e.detail.value
  1585. // })
  1586. let disabilityLevel = 'oldInfo[' + this.data.activeIndex + '].disabilityLevel'
  1587. this.setData({
  1588. [disabilityLevel]: this.data.disableLeval[e.detail.value]
  1589. })
  1590. this.SubmitOldmanInfo({
  1591. id: this.data.nameArr[this.data.activeIndex]._id,
  1592. disabilityLevel: this.data.oldInfo[this.data.activeIndex].disabilityLevel
  1593. })
  1594. },
  1595. // 老年人能力情况
  1596. tab1Change12: function (e) {
  1597. let ability = 'oldInfo[' + this.data.activeIndex + '].ability'
  1598. let Info = 'oldInfo[' + this.data.activeIndex + '].oldType'
  1599. this.setData({
  1600. [ability]: this.data.ableStatus[e.detail.value]
  1601. })
  1602. if (e.detail.value == 2) {
  1603. this.setData({
  1604. [Info]: this.data.oldInfo[this.data.activeIndex].oldType.concat({
  1605. name: "失能老人",
  1606. disable: true,
  1607. checked: true
  1608. })
  1609. })
  1610. }
  1611. this.SubmitOldmanInfo({
  1612. id: this.data.nameArr[this.data.activeIndex]._id,
  1613. ability: this.data.disableLeval[e.detail.value]
  1614. })
  1615. },
  1616. // 生活经济情况
  1617. tab1Change13: function (e) {
  1618. let livingCondition = 'oldInfo[' + this.data.activeIndex + '].livingCondition'
  1619. this.setData({
  1620. [livingCondition]: this.data.moneyStatus[e.detail.value]
  1621. })
  1622. this.SubmitOldmanInfo({
  1623. id: this.data.nameArr[this.data.activeIndex]._id,
  1624. livingCondition: this.data.moneyStatus[e.detail.value]
  1625. })
  1626. },
  1627. // 收入来源
  1628. tab1Change14: function (e) {
  1629. console.log(e.detail.value)
  1630. const items = this.data.oldInfo[this.data.activeIndex].moneyFromAyy
  1631. const values = e.detail.value
  1632. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1633. items[i].checked = false
  1634. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1635. if (items[i].name === values[j]) {
  1636. items[i].checked = true
  1637. break
  1638. }
  1639. }
  1640. }
  1641. let moneyFromAyy = 'oldInfo[' + this.data.activeIndex + '].moneyFromAyy'
  1642. this.setData({
  1643. [moneyFromAyy]: items
  1644. })
  1645. if (e.detail.value.length == 0) {
  1646. this.setData({
  1647. moneyFromOther: true
  1648. })
  1649. return
  1650. } else {
  1651. this.setData({
  1652. moneyFromOther: false
  1653. })
  1654. }
  1655. this.SubmitOldmanInfo({
  1656. id: this.data.nameArr[this.data.activeIndex]._id,
  1657. sourceOfIncome: JSON.stringify(e.detail.value)
  1658. })
  1659. },
  1660. // 其他收入来源sourceOfIncomeExt
  1661. tab1Change14_1: function (e) {
  1662. if (e.detail.value == null || e.detail.value == '') {
  1663. this.setData({
  1664. moneyOtherQtnull: true
  1665. })
  1666. } else {
  1667. this.setData({
  1668. moneyOtherQtnull: false
  1669. })
  1670. this.SubmitOldmanInfo({
  1671. id: this.data.nameArr[this.data.activeIndex]._id,
  1672. sourceOfIncomeExt: e.detail.value
  1673. })
  1674. }
  1675. },
  1676. // 本人上年度可支配收入
  1677. tab1Change15: function (e) {
  1678. let income = 'oldInfo[' + this.data.activeIndex + '].income'
  1679. this.setData({
  1680. [income]: this.data.payMoney[e.detail.value]
  1681. })
  1682. this.SubmitOldmanInfo({
  1683. id: this.data.nameArr[this.data.activeIndex]._id,
  1684. income: this.data.payMoney[e.detail.value]
  1685. })
  1686. },
  1687. // 家庭救助帮扶情况
  1688. tab1Change16: function (e) {
  1689. console.log(e.detail.value)
  1690. const items = this.data.oldInfo[this.data.activeIndex].familyHelpArr
  1691. const values = e.detail.value
  1692. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1693. items[i].checked = false
  1694. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1695. if (items[i].name === values[j]) {
  1696. items[i].checked = true
  1697. break
  1698. }
  1699. }
  1700. }
  1701. let familyHelpArr = 'oldInfo[' + this.data.activeIndex + '].familyHelpArr'
  1702. this.setData({
  1703. [familyHelpArr]: items
  1704. })
  1705. if (e.detail.value.length == 0) {
  1706. this.setData({
  1707. familyHelp: true
  1708. })
  1709. return
  1710. } else {
  1711. this.setData({
  1712. familyHelp: false
  1713. })
  1714. }
  1715. this.SubmitOldmanInfo({
  1716. id: this.data.nameArr[this.data.activeIndex]._id,
  1717. rescueState: JSON.stringify(e.detail.value)
  1718. })
  1719. },
  1720. // 其他救助帮扶情况
  1721. tab1Change16_1: function (e) {
  1722. if (e.detail.value == null || e.detail.value == '') {
  1723. this.setData({
  1724. otherhelpQtnull: true
  1725. })
  1726. } else {
  1727. this.setData({
  1728. otherhelpQtnull: false
  1729. })
  1730. let rescueStateExt = 'oldInfo[' + this.data.activeIndex + '].rescueStateExt'
  1731. this.setData({
  1732. [rescueStateExt]: e.detail.value
  1733. })
  1734. this.SubmitOldmanInfo({
  1735. id: this.data.nameArr[this.data.activeIndex]._id,
  1736. rescueStateExt: e.detail.value
  1737. })
  1738. }
  1739. },
  1740. // 是否为失独家庭
  1741. tab1Change17: function (e) {
  1742. console.log(e.detail.value)
  1743. let data = this.data.oldInfo[this.data.activeIndex].loneArr.map(v => {
  1744. if (v.name == e.detail.value) {
  1745. return {
  1746. name: v.name,
  1747. checked: true
  1748. }
  1749. }
  1750. return {
  1751. name: v.name,
  1752. checked: false
  1753. }
  1754. })
  1755. let loneArr = 'oldInfo[' + this.data.activeIndex + '].loneArr'
  1756. this.setData({
  1757. [loneArr]: data
  1758. })
  1759. this.SubmitOldmanInfo({
  1760. id: this.data.nameArr[this.data.activeIndex]._id,
  1761. isLoss: e.detail.value
  1762. })
  1763. },
  1764. // 陪伴居住情况
  1765. tab1Change18: function (e) {
  1766. console.log(e.detail.value)
  1767. const items = this.data.oldInfo[this.data.activeIndex].liveStatus
  1768. const values = e.detail.value
  1769. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1770. items[i].checked = false
  1771. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1772. if (items[i].name === values[j]) {
  1773. items[i].checked = true
  1774. break
  1775. }
  1776. }
  1777. }
  1778. let liveStatus = 'oldInfo[' + this.data.activeIndex + '].liveStatus'
  1779. this.setData({
  1780. [liveStatus]: items
  1781. })
  1782. let revise1 = "oldInfo[" + this.data.activeIndex + "].liveStatus[1].disabled";
  1783. let revise2 = "oldInfo[" + this.data.activeIndex + "].liveStatus[2].disabled";
  1784. let revise3 = "oldInfo[" + this.data.activeIndex + "].liveStatus[3].disabled";
  1785. let revise4 = "oldInfo[" + this.data.activeIndex + "].liveStatus[4].disabled";
  1786. let rev1 = "oldInfo[" + this.data.activeIndex + "].liveStatus[1].checked";
  1787. let rev2 = "oldInfo[" + this.data.activeIndex + "].liveStatus[2].checked";
  1788. let rev3 = "oldInfo[" + this.data.activeIndex + "].liveStatus[3].checked";
  1789. let rev4 = "oldInfo[" + this.data.activeIndex + "].liveStatus[4].checked";
  1790. if (e.detail.value.length == 0) {
  1791. this.setData({
  1792. isliveNull: true
  1793. })
  1794. } else {
  1795. this.setData({
  1796. isliveNull: false
  1797. })
  1798. }
  1799. let index = e.detail.value.indexOf('无人陪伴居住');
  1800. if (index >= 0) {
  1801. console.log('有无人陪伴居住')
  1802. this.setData({
  1803. [revise1]: true,
  1804. [revise2]: true,
  1805. [revise3]: true,
  1806. [revise4]: true,
  1807. [rev1]: false,
  1808. [rev2]: false,
  1809. [rev3]: false,
  1810. [rev4]: false,
  1811. })
  1812. this.SubmitOldmanInfo({
  1813. id: this.data.nameArr[this.data.activeIndex]._id,
  1814. accompany: JSON.stringify(['无人陪伴居住'])
  1815. })
  1816. console.log(this.data.oldInfo[this.data.activeIndex].liveStatus)
  1817. } else {
  1818. this.setData({
  1819. [revise1]: false,
  1820. [revise2]: false,
  1821. [revise3]: false,
  1822. [revise4]: false
  1823. })
  1824. }
  1825. if (index < 0 && e.detail.value.length != 0) {
  1826. this.SubmitOldmanInfo({
  1827. id: this.data.nameArr[this.data.activeIndex]._id,
  1828. accompany: JSON.stringify(e.detail.value)
  1829. })
  1830. }
  1831. },
  1832. // 其他陪伴居住情况
  1833. tab1Change18_1: function (e) {
  1834. if (e.detail.value == null || e.detail.value == '') {
  1835. this.setData({
  1836. isliveQtNull: true
  1837. })
  1838. } else {
  1839. this.setData({
  1840. isliveQtNull: false
  1841. })
  1842. let accompanyExt = 'oldInfo[' + this.data.activeIndex + '].accompanyExt'
  1843. this.setData({
  1844. [accompanyExt]: e.detail.value
  1845. })
  1846. this.SubmitOldmanInfo({
  1847. id: this.data.nameArr[this.data.activeIndex]._id,
  1848. accompanyExt: e.detail.value
  1849. })
  1850. }
  1851. },
  1852. // 日常生活照料人
  1853. tab1Change19: function (e) {
  1854. console.log(e.detail.value)
  1855. const items = this.data.oldInfo[this.data.activeIndex].oftenMan
  1856. const values = e.detail.value
  1857. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1858. items[i].checked = false
  1859. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1860. if (items[i].name === values[j]) {
  1861. items[i].checked = true
  1862. break
  1863. }
  1864. }
  1865. }
  1866. let oftenMan = 'oldInfo[' + this.data.activeIndex + '].oftenMan'
  1867. this.setData({
  1868. [oftenMan]: items
  1869. })
  1870. let revise1 = "oldInfo[" + this.data.activeIndex + "].oftenMan[1].disabled";
  1871. let revise2 = "oldInfo[" + this.data.activeIndex + "].oftenMan[2].disabled";
  1872. let revise3 = "oldInfo[" + this.data.activeIndex + "].oftenMan[3].disabled";
  1873. let revise4 = "oldInfo[" + this.data.activeIndex + "].oftenMan[4].disabled";
  1874. let revise5 = "oldInfo[" + this.data.activeIndex + "].oftenMan[5].disabled";
  1875. let rev1 = "oldInfo[" + this.data.activeIndex + "].oftenMan[1].checked";
  1876. let rev2 = "oldInfo[" + this.data.activeIndex + "].oftenMan[2].checked";
  1877. let rev3 = "oldInfo[" + this.data.activeIndex + "].oftenMan[3].checked";
  1878. let rev4 = "oldInfo[" + this.data.activeIndex + "].oftenMan[4].checked";
  1879. let rev5 = "oldInfo[" + this.data.activeIndex + "].oftenMan[5].checked";
  1880. if (e.detail.value.length == 0) {
  1881. this.setData({
  1882. isoftenManNull: true
  1883. })
  1884. } else {
  1885. this.setData({
  1886. isoftenManNull: false
  1887. })
  1888. }
  1889. let index = e.detail.value.indexOf('无人照料');
  1890. if (index >= 0) {
  1891. this.setData({
  1892. [revise1]: true,
  1893. [revise2]: true,
  1894. [revise3]: true,
  1895. [revise4]: true,
  1896. [revise5]: true,
  1897. [rev1]: false,
  1898. [rev2]: false,
  1899. [rev3]: false,
  1900. [rev4]: false,
  1901. [rev5]: false,
  1902. })
  1903. this.SubmitOldmanInfo({
  1904. id: this.data.nameArr[this.data.activeIndex]._id,
  1905. lookAfter: JSON.stringify(['无人照料'])
  1906. })
  1907. } else {
  1908. this.setData({
  1909. [revise1]: false,
  1910. [revise2]: false,
  1911. [revise3]: false,
  1912. [revise4]: false,
  1913. [revise5]: false
  1914. })
  1915. }
  1916. if (index < 0 && e.detail.value.length != 0) {
  1917. // this.setData({
  1918. // ofenmanDetail: true
  1919. // })
  1920. this.SubmitOldmanInfo({
  1921. id: this.data.nameArr[this.data.activeIndex]._id,
  1922. lookAfter: JSON.stringify(e.detail.value)
  1923. })
  1924. }
  1925. // else {
  1926. // this.setData({
  1927. // ofenmanDetail: false
  1928. // })
  1929. // }
  1930. },
  1931. // 其他人员关系
  1932. tab1Change20: function (e) {
  1933. if (e.detail.value == null || e.detail.value == '') {
  1934. this.setData({
  1935. isoftenReaNull: true
  1936. })
  1937. } else {
  1938. this.setData({
  1939. isoftenReaNull: false
  1940. })
  1941. let lookAfterExt = 'oldInfo[' + this.data.activeIndex + '].lookAfterExt'
  1942. this.setData({
  1943. [lookAfterExt]: e.detail.value
  1944. })
  1945. this.SubmitOldmanInfo({
  1946. id: this.data.nameArr[this.data.activeIndex]._id,
  1947. lookAfterExt: e.detail.value
  1948. })
  1949. }
  1950. },
  1951. // 主要照料人姓名
  1952. tab1Change21: function (e) {
  1953. if (e.detail.value == null || e.detail.value == '') {
  1954. this.setData({
  1955. lookAfterName: true
  1956. })
  1957. } else {
  1958. this.setData({
  1959. lookAfterName: false
  1960. })
  1961. let mainLookName = 'oldInfo[' + this.data.activeIndex + '].mainLookName'
  1962. this.setData({
  1963. [mainLookName]: e.detail.value
  1964. })
  1965. this.SubmitOldmanInfo({
  1966. id: this.data.nameArr[this.data.activeIndex]._id,
  1967. mainLookName: e.detail.value
  1968. })
  1969. }
  1970. },
  1971. // 主要照料人性别
  1972. tab1Change22: function (e) {
  1973. console.log(e.detail.value)
  1974. let data = this.data.oldInfo[this.data.activeIndex].mainLookSex.map(v => {
  1975. if (v.name == e.detail.value) {
  1976. return {
  1977. name: v.name,
  1978. checked: true
  1979. }
  1980. }
  1981. return {
  1982. name: v.name,
  1983. checked: false
  1984. }
  1985. })
  1986. let mainLookSex = 'oldInfo[' + this.data.activeIndex + '].mainLookSex'
  1987. this.setData({
  1988. [mainLookSex]: data
  1989. })
  1990. this.SubmitOldmanInfo({
  1991. id: this.data.nameArr[this.data.activeIndex]._id,
  1992. mainLookSex: e.detail.value
  1993. })
  1994. },
  1995. // 主要照料人电话
  1996. tab1Change23: function (e) {
  1997. if (e.detail.value == '' || e.detail.value == null) {
  1998. this.setData({
  1999. islookPhoneNull: true
  2000. })
  2001. } else {
  2002. this.setData({
  2003. islookPhoneNull: false
  2004. })
  2005. let mainLookPhone = 'oldInfo[' + this.data.activeIndex + '].mainLookPhone'
  2006. this.setData({
  2007. [mainLookPhone]: e.detail.value
  2008. })
  2009. this.SubmitOldmanInfo({
  2010. id: this.data.nameArr[this.data.activeIndex]._id,
  2011. mainLookPhone: e.detail.value
  2012. })
  2013. }
  2014. },
  2015. // 关爱服务需求
  2016. tab1Change24: function (e) {
  2017. console.log(e.detail.value)
  2018. const items = this.data.oldInfo[this.data.activeIndex].loveRequire
  2019. const values = e.detail.value
  2020. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  2021. items[i].checked = false
  2022. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  2023. if (items[i].name === values[j]) {
  2024. items[i].checked = true
  2025. break
  2026. }
  2027. }
  2028. }
  2029. let loveRequire = 'oldInfo[' + this.data.activeIndex + '].loveRequire'
  2030. this.setData({
  2031. [loveRequire]: items
  2032. })
  2033. if (e.detail.value == '' || e.detail.value == null) {
  2034. this.setData({
  2035. isloveNull: true
  2036. })
  2037. } else {
  2038. this.setData({
  2039. isloveNull: false
  2040. })
  2041. this.SubmitOldmanInfo({
  2042. id: this.data.nameArr[this.data.activeIndex]._id,
  2043. demand: JSON.stringify(e.detail.value)
  2044. })
  2045. }
  2046. },
  2047. tab1Change24_1:function(e){
  2048. let Info = 'oldInfo[' + this.data.activeIndex + '].demandExt'
  2049. this.setData({
  2050. [Info]: e.detail.value
  2051. })
  2052. this.SubmitOldmanInfo({
  2053. id: this.data.nameArr[this.data.activeIndex]._id,
  2054. demandExt: e.detail.value
  2055. })
  2056. },
  2057. tab1change25: function (e) {
  2058. if (e.detail.value == null || e.detail.value == '') {
  2059. this.setData({
  2060. isloveNull: true
  2061. })
  2062. } else {
  2063. this.setData({
  2064. isloveNull: false
  2065. })
  2066. this.SubmitOldmanInfo({
  2067. id: this.data.nameArr[this.data.activeIndex]._id,
  2068. demandExt: e.detail.value
  2069. })
  2070. }
  2071. },
  2072. // 老年人类别
  2073. tab1Change26: function (e) {
  2074. console.log(e.detail.value)
  2075. if (e.detail.value == '' || e.detail.value == null) {
  2076. this.setData({
  2077. isoldtypeNull: true
  2078. })
  2079. } else {
  2080. this.setData({
  2081. isoldtypeNull: false,
  2082. })
  2083. }
  2084. let index1 = e.detail.value.indexOf('农村留守老年人')
  2085. let index2 = e.detail.value.indexOf('分散供养特困老年人')
  2086. let index3 = e.detail.value.indexOf('计划生育特殊家庭老人')
  2087. let index4 = e.detail.value.indexOf('空巢老年人')
  2088. // let revise1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].disabled'
  2089. let revise1 = "oldInfo[" + this.data.activeIndex + "].oldType[0].disable";
  2090. let revise2 = "oldInfo[" + this.data.activeIndex + "].oldType[1].disable";
  2091. let revise3 = "oldInfo[" + this.data.activeIndex + "].oldType[2].disable";
  2092. let revise4 = "oldInfo[" + this.data.activeIndex + "].oldType[3].disable";
  2093. let revise5 = "oldInfo[" + this.data.activeIndex + "].oldType[3].checked";
  2094. this.SubmitOldmanInfo({
  2095. id: this.data.nameArr[this.data.activeIndex]._id,
  2096. oldType: JSON.stringify(e.detail.value)
  2097. })
  2098. // if (index1 >= 0) {
  2099. // this.setData({
  2100. // [revise2]: true,
  2101. // [revise3]: true,
  2102. // [revise4]: true,
  2103. // [revise5]: true
  2104. // })
  2105. // return false;
  2106. // } else {
  2107. // console.log("反選的");
  2108. // this.setData({
  2109. // // [revise1]: false,
  2110. // [revise2]: false,
  2111. // [revise3]: false,
  2112. // [revise4]: false,
  2113. // [revise5]: false
  2114. // })
  2115. // index4 = -1;
  2116. // }
  2117. if (index2 >= 0) {
  2118. this.setData({
  2119. [revise1]: true,
  2120. [revise3]: true,
  2121. [revise4]: true
  2122. })
  2123. return false;
  2124. } else {
  2125. this.setData({
  2126. [revise1]: false,
  2127. [revise3]: false,
  2128. [revise4]: false
  2129. })
  2130. }
  2131. if (index3 >= 0) {
  2132. this.setData({
  2133. [revise1]: true,
  2134. [revise2]: true,
  2135. [revise4]: true
  2136. })
  2137. return false;
  2138. } else {
  2139. this.setData({
  2140. [revise1]: false,
  2141. [revise2]: false,
  2142. [revise4]: false
  2143. })
  2144. }
  2145. // if (index4 >= 0) {
  2146. // this.setData({
  2147. // [revise1]: true,
  2148. // [revise2]: true,
  2149. // [revise3]: true
  2150. // })
  2151. // return false;
  2152. // } else {
  2153. // this.setData({
  2154. // [revise1]: false,
  2155. // [revise2]: false,
  2156. // [revise3]: false
  2157. // })
  2158. // }
  2159. if (index1 >= 0) {
  2160. this.setData({
  2161. [revise2]: true,
  2162. [revise3]: true,
  2163. [revise4]: true,
  2164. [revise5]: true
  2165. })
  2166. return false;
  2167. } else if(index4 >= 0){
  2168. this.setData({
  2169. [revise1]: false,
  2170. [revise2]: false,
  2171. [revise3]: false,
  2172. [revise4]: false,
  2173. [revise5]: true
  2174. })
  2175. }else {
  2176. this.setData({
  2177. [revise1]: false,
  2178. [revise2]: false,
  2179. [revise3]: false,
  2180. [revise4]: false,
  2181. })
  2182. }
  2183. },
  2184. goPhoto() {
  2185. let that = this;
  2186. isTwoOnshow = true;
  2187. const app = getApp()
  2188. wx.setStorageSync('isTwoOnshow', true)
  2189. wx.showLoading({
  2190. title: '加载中',
  2191. })
  2192. wx.chooseImage({
  2193. count: 1,
  2194. sizeType: ['compressed'],
  2195. sourceType: ['camera'],
  2196. success: function (res) {
  2197. const app = getApp()
  2198. app.globalData.id = '-1'
  2199. let tempFilePaths = res.tempFilePaths
  2200. wx.uploadFile({
  2201. url: util.globalData.publicUrl + '/sys/user/upload',
  2202. filePath: tempFilePaths[0],
  2203. name: 'uploadFile',
  2204. formData: {
  2205. "user": "test",
  2206. },
  2207. header: {
  2208. appletsId: wx.getStorageSync('openId'),
  2209. },
  2210. success: function (res) {
  2211. const app = getApp()
  2212. app.globalData.id = '-2'
  2213. let datas = JSON.parse(res.data)
  2214. let imgPath = 'oldInfo[' + that.data.activeIndex + '].imgPath'
  2215. let isHavePhoto = 'oldInfo[' + that.data.activeIndex + '].isHavePhoto'
  2216. // if (datas.code == 0) {
  2217. that.setData({
  2218. [imgPath]: datas.data,
  2219. [isHavePhoto]: true,
  2220. })
  2221. that.SubmitOldmanInfo({
  2222. id: that.data.nameArr[that.data.activeIndex]._id,
  2223. photo: datas.data,
  2224. })
  2225. }
  2226. })
  2227. },
  2228. complete: (e) => {
  2229. wx.hideLoading();
  2230. }
  2231. })
  2232. },
  2233. closeImage(e) {
  2234. console.log(e.currentTarget.dataset.activeindex, "121212");
  2235. let imgPath = 'oldInfo[' + e.currentTarget.dataset.activeindex + '].imgPath'
  2236. this.setData({
  2237. [imgPath]: '',
  2238. })
  2239. this.SubmitOldmanInfo({
  2240. id: this.data.nameArr[this.data.activeIndex]._id,
  2241. photo: '',
  2242. })
  2243. },
  2244. // 子女个数
  2245. tab2Change1: function (e) {
  2246. console.log(e.detail.value)
  2247. let childrenNum = 'childInfo[' + this.data.activeIndex + '].childrenNum'
  2248. let Info = 'childInfo[' + this.data.activeIndex + '].Info'
  2249. this.setData({
  2250. [childrenNum]: this.data.childNumArr[e.detail.value],
  2251. })
  2252. if (e.detail.value == 0) {
  2253. this.setData({
  2254. [Info]: []
  2255. })
  2256. // this.SubmitOldmanInfo({
  2257. // id: this.data.nameArr[this.data.activeIndex]._id,
  2258. // childInfo:JSON.stringify([]),
  2259. // })
  2260. } else if (e.detail.value == 1) {
  2261. this.setData({
  2262. [Info]: [{
  2263. name: '', // 姓名
  2264. sex: '',
  2265. phone: '', // 常用联系电话,
  2266. isHasGoOut: '', // 子女是否外出
  2267. outgoingplace: '', // 外出地点
  2268. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2269. name2: '', // 子女配偶姓名
  2270. phone2: '', // 子女配偶电话
  2271. outgoingTime: '', // 最后一次离家时间
  2272. outgoingCause: '', // 外出原因
  2273. visit: '', // 平均一年探望次数
  2274. }]
  2275. })
  2276. } else if (e.detail.value == 2) {
  2277. this.setData({
  2278. [Info]: [{
  2279. name: '', // 姓名
  2280. sex: '',
  2281. phone: '', // 常用联系电话,
  2282. isHasGoOut: '', // 子女是否外出
  2283. outgoingplace: '', // 外出地点
  2284. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2285. name2: '', // 子女配偶姓名
  2286. phone2: '', // 子女配偶电话
  2287. outgoingTime: '', // 最后一次离家时间
  2288. outgoingCause: '', // 外出原因
  2289. visit: '', // 平均一年探望次数
  2290. }, {
  2291. name: '', // 姓名
  2292. sex: '',
  2293. phone: '', // 常用联系电话,
  2294. isHasGoOut: '', // 子女是否外出
  2295. outgoingplace: '', // 外出地点
  2296. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2297. name2: '', // 子女配偶姓名
  2298. phone2: '', // 子女配偶电话
  2299. outgoingTime: '', // 最后一次离家时间
  2300. outgoingCause: '', // 外出原因
  2301. visit: '', // 平均一年探望次数
  2302. }]
  2303. })
  2304. } else {
  2305. this.setData({
  2306. [Info]: [{
  2307. name: '', // 姓名
  2308. sex: '',
  2309. phone: '', // 常用联系电话,
  2310. isHasGoOut: '', // 子女是否外出
  2311. outgoingplace: '', // 外出地点
  2312. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2313. name2: '', // 子女配偶姓名
  2314. phone2: '', // 子女配偶电话
  2315. outgoingTime: '', // 最后一次离家时间
  2316. outgoingCause: '', // 外出原因
  2317. visit: '', // 平均一年探望次数
  2318. }, {
  2319. name: '', // 姓名
  2320. sex: '',
  2321. phone: '', // 常用联系电话,
  2322. isHasGoOut: '', // 子女是否外出
  2323. outgoingplace: '', // 外出地点
  2324. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2325. name2: '', // 子女配偶姓名
  2326. phone2: '', // 子女配偶电话
  2327. outgoingTime: '', // 最后一次离家时间
  2328. outgoingCause: '', // 外出原因
  2329. visit: '', // 平均一年探望次数
  2330. }, {
  2331. name: '', // 姓名
  2332. sex: '',
  2333. phone: '', // 常用联系电话,
  2334. isHasGoOut: '', // 子女是否外出
  2335. outgoingplace: '', // 外出地点
  2336. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2337. name2: '', // 子女配偶姓名
  2338. phone2: '', // 子女配偶电话
  2339. outgoingTime: '', // 最后一次离家时间
  2340. outgoingCause: '', // 外出原因
  2341. visit: '', // 平均一年探望次数
  2342. }]
  2343. })
  2344. }
  2345. this.SubmitOldmanInfo({
  2346. id: this.data.nameArr[this.data.activeIndex]._id,
  2347. childrenNum: e.detail.value,
  2348. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2349. // childrenNum: this.data.childNums[e.detail.value].substring(0, 1)
  2350. })
  2351. },
  2352. // 子女姓名
  2353. tab2Change2: function (e) {
  2354. let han = /^[\u4e00-\u9fa5]+$/;
  2355. if (!han.test(e.detail.value )) {
  2356. wx.showModal({
  2357. showCancel: false,
  2358. content: '您输入的内容不是汉字哦'
  2359. })
  2360. return false;
  2361. };
  2362. if (e.detail.value .length < 2) {
  2363. wx.showModal({
  2364. showCancel: false,
  2365. content: '赡养人姓名不可以少于两个字哦'
  2366. })
  2367. return false
  2368. }
  2369. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name';
  2370. console.log(this.data.childInfo[this.data.activeIndex].Info, "多个数字的问题");
  2371. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info));
  2372. this.setData({
  2373. [child]: e.detail.value
  2374. })
  2375. this.SubmitOldmanInfo({
  2376. id: this.data.nameArr[this.data.activeIndex]._id,
  2377. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2378. })
  2379. // }
  2380. },
  2381. // 子女性别
  2382. tab2Change3: function (e) {
  2383. console.log(e, '000000000000')
  2384. console.log(e.currentTarget.dataset.index + "@@@@@@@@@@@@@@@@@@@@@@")
  2385. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].sex';
  2386. this.setData({
  2387. [child]: this.data.childSexArr[e.detail.value]
  2388. })
  2389. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info) + "#####################")
  2390. this.SubmitOldmanInfo({
  2391. id: this.data.nameArr[this.data.activeIndex]._id,
  2392. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2393. })
  2394. },
  2395. // 子女联系电话
  2396. tab2Change4: function (e) {
  2397. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].phone';
  2398. this.setData({
  2399. [child]: e.detail.value
  2400. })
  2401. this.SubmitOldmanInfo({
  2402. id: this.data.nameArr[this.data.activeIndex]._id,
  2403. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2404. })
  2405. },
  2406. // 子女是否外出
  2407. tab2Change5: function (e) {
  2408. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].isHasGoOut';
  2409. this.setData({
  2410. [child]: this.data.childIsout[e.detail.value]
  2411. })
  2412. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info) + "#####################")
  2413. this.SubmitOldmanInfo({
  2414. id: this.data.nameArr[this.data.activeIndex]._id,
  2415. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2416. })
  2417. },
  2418. //外出原因
  2419. tab2Change6: function (e) {
  2420. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingCause';
  2421. this.setData({
  2422. [child]: e.detail.value
  2423. })
  2424. this.SubmitOldmanInfo({
  2425. id: this.data.nameArr[this.data.activeIndex]._id,
  2426. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2427. })
  2428. },
  2429. // 外出地点
  2430. tab2Change7: function (e) {
  2431. console.log(e.detail.value)
  2432. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingplace';
  2433. this.setData({
  2434. [child]: e.detail.value
  2435. })
  2436. this.SubmitOldmanInfo({
  2437. id: this.data.nameArr[this.data.activeIndex]._id,
  2438. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2439. })
  2440. },
  2441. // 最后一次离家时间
  2442. tab2Change8: function (e) {
  2443. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingTime';
  2444. this.setData({
  2445. [child]: e.detail.value
  2446. })
  2447. this.SubmitOldmanInfo({
  2448. id: this.data.nameArr[this.data.activeIndex]._id,
  2449. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2450. })
  2451. },
  2452. // 是否有配偶
  2453. tab2Change9: function (e) {
  2454. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].isHasPartner';
  2455. this.setData({
  2456. [child]: this.data.childIsMArry[e.detail.value]
  2457. })
  2458. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info) + "#####################")
  2459. this.SubmitOldmanInfo({
  2460. id: this.data.nameArr[this.data.activeIndex]._id,
  2461. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2462. })
  2463. },
  2464. // 配偶姓名
  2465. tab2Change10: function (e) {
  2466. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name2';
  2467. this.setData({
  2468. [child]: e.detail.value
  2469. })
  2470. this.SubmitOldmanInfo({
  2471. id: this.data.nameArr[this.data.activeIndex]._id,
  2472. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2473. })
  2474. },
  2475. // 配偶联系电话
  2476. tab2Change11: function (e) {
  2477. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].phone2';
  2478. this.setData({
  2479. [child]: e.detail.value
  2480. })
  2481. this.SubmitOldmanInfo({
  2482. id: this.data.nameArr[this.data.activeIndex]._id,
  2483. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2484. })
  2485. },
  2486. // 一年探望次数
  2487. tab2Change12: function (e) {
  2488. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].visit';
  2489. this.setData({
  2490. [child]: this.data.childTfTimes[e.detail.value]
  2491. })
  2492. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info) + "#####################")
  2493. this.SubmitOldmanInfo({
  2494. id: this.data.nameArr[this.data.activeIndex]._id,
  2495. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2496. })
  2497. },
  2498. // tab3是否有赡养人状态改变
  2499. tab3Change1: function (e) {
  2500. // 否是1
  2501. console.log(e.detail.value, "1111111");
  2502. let isHasOther = 'otherInfo[' + this.data.activeIndex + '].isHasOther'
  2503. if (e.detail.value == '0') {
  2504. this.setData({
  2505. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2506. })
  2507. console.log("1111111");
  2508. this.SubmitOldmanInfo({
  2509. id: this.data.nameArr[this.data.activeIndex]._id,
  2510. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2511. })
  2512. } else {
  2513. this.setData({
  2514. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2515. })
  2516. this.SubmitOldmanInfo({
  2517. id: this.data.nameArr[this.data.activeIndex]._id,
  2518. otherInfo: ''
  2519. })
  2520. }
  2521. this.setData({
  2522. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2523. })
  2524. },
  2525. // 其他赡养人姓名
  2526. tab3Change2: function (e) {
  2527. let han = /^[\u4e00-\u9fa5]+$/;
  2528. if (!han.test(e.detail.value )) {
  2529. wx.showModal({
  2530. showCancel: false,
  2531. content: '您输入的内容不是汉字哦'
  2532. })
  2533. return false;
  2534. };
  2535. if (e.detail.value .length < 2) {
  2536. wx.showModal({
  2537. showCancel: false,
  2538. content: '赡养人姓名不可以少于两个字哦'
  2539. })
  2540. return false
  2541. }
  2542. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name'
  2543. this.setData({
  2544. [Info]: e.detail.value,
  2545. })
  2546. this.SubmitOldmanInfo({
  2547. id: this.data.nameArr[this.data.activeIndex]._id,
  2548. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2549. })
  2550. },
  2551. // 其他赡养人性别
  2552. tab3Change3: function (e) {
  2553. let data = this.data.otherInfo[this.data.activeIndex].Info.othersyrSexArr.map(v => {
  2554. if (v.name == e.detail.value) {
  2555. return {
  2556. name: v.name,
  2557. checked: true
  2558. }
  2559. }
  2560. return {
  2561. name: v.name,
  2562. checked: false
  2563. }
  2564. })
  2565. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.sex'
  2566. let othersyrSexArr = 'otherInfo[' + this.data.activeIndex + '].Info.othersyrSexArr'
  2567. this.setData({
  2568. [Info]: e.detail.value,
  2569. [othersyrSexArr]: data,
  2570. })
  2571. this.SubmitOldmanInfo({
  2572. id: this.data.nameArr[this.data.activeIndex]._id,
  2573. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2574. })
  2575. },
  2576. // 其他赡养人电话
  2577. tab3Change4: function (e) {
  2578. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.phone'
  2579. this.setData({
  2580. [Info]: e.detail.value,
  2581. })
  2582. this.SubmitOldmanInfo({
  2583. id: this.data.nameArr[this.data.activeIndex]._id,
  2584. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2585. })
  2586. },
  2587. // 与被赡养人关系状态改变
  2588. tab3Change5: function (e) {
  2589. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.relation'
  2590. this.setData({
  2591. [Info]: this.data.othersyrRelation[e.detail.value],
  2592. })
  2593. this.SubmitOldmanInfo({
  2594. id: this.data.nameArr[this.data.activeIndex]._id,
  2595. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2596. })
  2597. },
  2598. // 输选择其他时入与被赡养人其他关系
  2599. tab3Change6: function (e) {
  2600. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.relationExt'
  2601. this.setData({
  2602. [Info]: e.detail.value,
  2603. })
  2604. this.SubmitOldmanInfo({
  2605. id: this.data.nameArr[this.data.activeIndex]._id,
  2606. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2607. })
  2608. },
  2609. // 是否外出
  2610. tab3Change7: function (e) {
  2611. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.isHasGoOut'
  2612. this.setData({
  2613. [Info]: this.data.othersyrIsout[e.detail.value],
  2614. })
  2615. this.SubmitOldmanInfo({
  2616. id: this.data.nameArr[this.data.activeIndex]._id,
  2617. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2618. })
  2619. },
  2620. // 外出原因
  2621. tab3Change8: function (e) {
  2622. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingCause'
  2623. this.setData({
  2624. [Info]: e.detail.value,
  2625. })
  2626. this.SubmitOldmanInfo({
  2627. id: this.data.nameArr[this.data.activeIndex]._id,
  2628. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2629. })
  2630. },
  2631. // 外出地点改变
  2632. tab3Change9: function (e) {
  2633. console.log(e)
  2634. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingplace'
  2635. this.setData({
  2636. [Info]: e.detail.value,
  2637. })
  2638. this.SubmitOldmanInfo({
  2639. id: this.data.nameArr[this.data.activeIndex]._id,
  2640. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2641. })
  2642. },
  2643. //最后一次离家时间
  2644. tab3Change10: function (e) {
  2645. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingTime'
  2646. this.setData({
  2647. [Info]: e.detail.value,
  2648. })
  2649. this.SubmitOldmanInfo({
  2650. id: this.data.nameArr[this.data.activeIndex]._id,
  2651. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2652. })
  2653. },
  2654. //是否有配偶
  2655. tab3Change11: function (e) {
  2656. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.isHasPartner'
  2657. this.setData({
  2658. [Info]: this.data.othersyrIsMarry[e.detail.value],
  2659. })
  2660. this.SubmitOldmanInfo({
  2661. id: this.data.nameArr[this.data.activeIndex]._id,
  2662. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2663. })
  2664. },
  2665. // 配偶姓名
  2666. tab3Change12: function (e) {
  2667. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name2'
  2668. this.setData({
  2669. [Info]: e.detail.value,
  2670. })
  2671. this.SubmitOldmanInfo({
  2672. id: this.data.nameArr[this.data.activeIndex]._id,
  2673. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2674. })
  2675. },
  2676. // 配偶电话
  2677. tab3Change13: function (e) {
  2678. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.phone2'
  2679. this.setData({
  2680. [Info]: e.detail.value,
  2681. })
  2682. this.SubmitOldmanInfo({
  2683. id: this.data.nameArr[this.data.activeIndex]._id,
  2684. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2685. })
  2686. },
  2687. //平均一年探望次数
  2688. tab3Change14: function (e) {
  2689. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.visit'
  2690. this.setData({
  2691. [Info]: this.data.othersyrTfTimes[e.detail.value],
  2692. })
  2693. this.SubmitOldmanInfo({
  2694. id: this.data.nameArr[this.data.activeIndex]._id,
  2695. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2696. })
  2697. },
  2698. //tab4巡访方式
  2699. tab4Change1: function (e) {
  2700. console.log(this.data.regularsInfos, "提交的regularsInfos");
  2701. console.log(this.data.regularsInfo, "提交的regularsInfo000000000000000000000");
  2702. const items = this.data.regularsInfos[this.data.activeIndex].visitMode
  2703. const values = e.detail.value
  2704. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  2705. items[i].checked = false
  2706. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  2707. if (items[i].name === values[j]) {
  2708. items[i].checked = true
  2709. break
  2710. }
  2711. }
  2712. }
  2713. let visitMode = 'regularsInfos[' + this.data.activeIndex + '].visitMode'
  2714. let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
  2715. this.setData({
  2716. [visitMode]: items,
  2717. [visitMode1]:JSON.stringify( e.detail.value)
  2718. })
  2719. console.log(this.data.regularsInfo, "我是?????????????");
  2720. this.SubmitOldmanInfo({
  2721. id: this.data.nameArr[this.data.activeIndex]._id,
  2722. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2723. })
  2724. },
  2725. // 巡防方式其他内容
  2726. tab4Change2: function (e) {
  2727. let Info = 'regularsInfos[' + this.data.activeIndex + '].visitModeExt'
  2728. let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitModeExt'
  2729. this.setData({
  2730. [Info]: e.detail.value,
  2731. [Info1]: e.detail.value
  2732. })
  2733. this.SubmitOldmanInfo({
  2734. id: this.data.nameArr[this.data.activeIndex]._id,
  2735. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2736. })
  2737. },
  2738. // 巡访频次
  2739. tab4Change3: function (e) {
  2740. let data = this.data.regularsInfos[this.data.activeIndex].visitCount.map(v => {
  2741. if (v.name == e.detail.value) {
  2742. return {
  2743. name: v.name,
  2744. checked: true
  2745. }
  2746. }
  2747. return {
  2748. name: v.name,
  2749. checked: false
  2750. }
  2751. })
  2752. let visitCount = 'regularsInfos[' + this.data.activeIndex + '].visitCount'
  2753. let visitCount1 = 'regularsInfo[' + this.data.activeIndex + '].visitCount'
  2754. this.setData({
  2755. [visitCount]: data,
  2756. [visitCount1]: e.detail.value
  2757. })
  2758. this.SubmitOldmanInfo({
  2759. id: this.data.nameArr[this.data.activeIndex]._id,
  2760. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2761. })
  2762. },
  2763. // 巡防方式其他内容
  2764. tab4change4: function (e) {
  2765. let Info = 'regularsInfos[' + this.data.activeIndex + '].visitCountExt'
  2766. let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitCountExt'
  2767. this.setData({
  2768. [Info]: e.detail.value,
  2769. [Info1]: e.detail.value
  2770. })
  2771. this.SubmitOldmanInfo({
  2772. id: this.data.nameArr[this.data.activeIndex]._id,
  2773. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2774. })
  2775. },
  2776. formSubmit(e) {
  2777. console.log('form发生了submit事件,携带数据为:', e.detail.value)
  2778. },
  2779. removeExcess(data) {
  2780. if (data) {
  2781. data = JSON.parse(data);
  2782. }
  2783. return data;
  2784. },
  2785. huixian(id, name) {
  2786. if (!id) {
  2787. let showbj = true;
  2788. console.log("我是没有fid的");
  2789. let oldInfo = [{
  2790. name: '',
  2791. oldSex: [{
  2792. name: '男'
  2793. }, {
  2794. name: '女'
  2795. }],
  2796. isSameWithAddress: [{
  2797. name: '现居地址与户籍地址一致'
  2798. }],
  2799. addressExt: '',
  2800. nativePlaceExt: '',
  2801. nation: '', //民族
  2802. idNumber: '', //身份证号
  2803. phone: '',
  2804. chooseAdressArr: [],
  2805. chooseAdressArr1: [],
  2806. oldMarry: [{
  2807. name: "未婚"
  2808. }, {
  2809. name: "已婚"
  2810. }, {
  2811. name: "离异"
  2812. }, {
  2813. name: "丧偶"
  2814. }],
  2815. partnerName: '',
  2816. partnerIdNumber: '',
  2817. healthAyy: [{
  2818. name: "健康",
  2819. disabled: false
  2820. }, {
  2821. name: "残疾",
  2822. disabled: false
  2823. }, {
  2824. name: "患重特大疾病",
  2825. disabled: false
  2826. }, {
  2827. name: "老年人慢性病",
  2828. disabled: false
  2829. }],
  2830. disabilityAyy: [{
  2831. name: "视力残疾"
  2832. }, {
  2833. name: "听力残疾"
  2834. }, {
  2835. name: "言语残疾"
  2836. }, {
  2837. name: "肢体残疾"
  2838. }, {
  2839. name: "智力残疾"
  2840. }, {
  2841. name: "精神残疾"
  2842. }, {
  2843. name: "多重残疾"
  2844. }],
  2845. disabilityLevel: '', //残疾人类别
  2846. sickType: [{
  2847. name: "重大器官类疾病"
  2848. }, {
  2849. name: "心脑血管类疾病"
  2850. }, {
  2851. name: "神经与代谢类疾病"
  2852. }, {
  2853. name: "肢体与病毒类疾病"
  2854. }, {
  2855. name: "恶性肿瘤"
  2856. }],
  2857. ability: '', //老年人能力情况
  2858. livingCondition: '', //生活经济情况
  2859. moneyFromAyy: [{
  2860. name: "家庭经营性收入"
  2861. }, {
  2862. name: "工资性收入"
  2863. }, {
  2864. name: "转移性收入"
  2865. }, {
  2866. name: "财产性收入"
  2867. }, {
  2868. name: "其它"
  2869. }],
  2870. income: '',
  2871. sourceOfIncomeExt: '', //其他收入情况
  2872. familyHelpArr: [{
  2873. name: "低保"
  2874. }, {
  2875. name: "建档立卡贫困户"
  2876. }, {
  2877. name: "医疗救助"
  2878. }, {
  2879. name: "临时救助"
  2880. }, {
  2881. name: "老年人福利津贴"
  2882. }, {
  2883. name: "残疾人两项补贴(或一项补贴)"
  2884. }, {
  2885. name: "其他救助"
  2886. }],
  2887. rescueStateExt: '', //其他救助
  2888. loneArr: [{
  2889. name: "是"
  2890. }, {
  2891. name: "否"
  2892. }],
  2893. liveStatus: [{
  2894. name: "无人陪伴居住",
  2895. disabled: false
  2896. }, {
  2897. name: "配偶",
  2898. disabled: false
  2899. }, {
  2900. name: "近亲属",
  2901. disabled: false
  2902. }, {
  2903. name: "未成年孙子女",
  2904. disabled: false
  2905. }, {
  2906. name: "其他情形",
  2907. disabled: false
  2908. }],
  2909. accompanyExt: '', //陪伴居住其他
  2910. oftenMan: [{
  2911. name: "无人照料",
  2912. disabled: false
  2913. }, {
  2914. name: "近亲属",
  2915. disabled: false
  2916. }, {
  2917. name: "配偶",
  2918. disabled: false
  2919. }, {
  2920. name: "邻里互助",
  2921. disabled: false
  2922. }, {
  2923. name: "购买养老服务",
  2924. disabled: false
  2925. }, {
  2926. name: "其他人员",
  2927. disabled: false
  2928. }],
  2929. lookAfterExt: '', //其他日常生活照料人关系
  2930. mainLookName: '', //日常生活照料人姓名
  2931. mainLookSex: [{
  2932. name: "男"
  2933. }, {
  2934. name: "女"
  2935. }],
  2936. mainLookPhone: '', //
  2937. loveRequire: [{
  2938. name: "生活照料"
  2939. },
  2940. {
  2941. name: "生产帮助"
  2942. },
  2943. {
  2944. name: "精神慰藉"
  2945. },
  2946. {
  2947. name: "医疗保健"
  2948. },
  2949. {
  2950. name: "权益维护"
  2951. },
  2952. {
  2953. name: "安全监护"
  2954. },
  2955. {
  2956. name: "文化娱乐"
  2957. },
  2958. {
  2959. name: "紧急救助"
  2960. },
  2961. {
  2962. name: "其它"
  2963. },
  2964. ],
  2965. oldType: [{
  2966. name: "农村留守老年人",
  2967. disable: false,
  2968. checked: false
  2969. }, {
  2970. name: "分散供养特困老年人",
  2971. disable: false,
  2972. checked: false
  2973. }, {
  2974. name: "计划生育特殊家庭老人",
  2975. disable: false,
  2976. checked: false
  2977. }, {
  2978. name: "空巢老年人",
  2979. disable: false,
  2980. checked: false
  2981. }, {
  2982. name: "独居老年人",
  2983. disable: false,
  2984. checked: false
  2985. }, {
  2986. name: "重残老年人",
  2987. disable: false,
  2988. checked: false
  2989. }, {
  2990. name: "高龄老年人",
  2991. disable: false,
  2992. checked: false
  2993. }],
  2994. isHavePhoto: false,
  2995. imgPath: '',
  2996. photoAndLocation: '',
  2997. }];
  2998. let regularsInfos = [{
  2999. visitMode: [{
  3000. name: '电话问候',
  3001. checked: false
  3002. }, {
  3003. name: '上门巡访',
  3004. checked: false
  3005. }, {
  3006. name: '其它',
  3007. checked: false
  3008. }],
  3009. visitModeExt: '', //巡访其他
  3010. visitCount: [{
  3011. name: '每天',
  3012. checked: false
  3013. }, {
  3014. name: '每周',
  3015. checked: false
  3016. }, {
  3017. name: '每月',
  3018. checked: false
  3019. }, {
  3020. name: '每季',
  3021. checked: false
  3022. }, {
  3023. name: '其它',
  3024. checked: false
  3025. }],
  3026. visitCountExt: '', // 频次的其他
  3027. }];
  3028. let otherInfo = [{
  3029. isHasOther: '',
  3030. Info: {
  3031. name: '', // 其他赡养人姓名,
  3032. sex: '', //其他赡养人性别
  3033. phone: '', //其他赡养人电话,
  3034. relation: '', //与被赡养人关系 如果选了其他也是必填 单选
  3035. relationExt: '', //与被赡养人关系--其他
  3036. isHasGoOut: '', //是否外出
  3037. outgoingCause: '', //外出原因
  3038. outgoingplace: '', // 外出地点
  3039. outgoingTime: '', // 最后一次离家时间
  3040. isHasPartner: '', //是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0:是 1:否
  3041. name2: '',
  3042. phone2: '',
  3043. visit: '', //平均一年探望次数
  3044. othersyrSexArr: [{
  3045. name: '男',
  3046. checked: false
  3047. },
  3048. {
  3049. name: '女',
  3050. checked: false
  3051. },
  3052. ]
  3053. }
  3054. }];
  3055. let childInfo = [{
  3056. childrenNum: ''
  3057. }]
  3058. this.setData({
  3059. showBj: showbj,
  3060. showAdress: false,
  3061. showAdress1: false,
  3062. nameArr: [],
  3063. oldInfo: oldInfo,
  3064. childInfo: childInfo,
  3065. otherInfo: otherInfo,
  3066. regularsInfos: regularsInfos,
  3067. })
  3068. console.log(this.data.regularsInfos);
  3069. console.log(this.data.showBj, "444444444444444444444444444444444444444444444");
  3070. } else if (id == '-1') {
  3071. } else if (id) {
  3072. wx.showLoading({
  3073. title: '加载中',
  3074. })
  3075. this.setData({
  3076. showBj: false,
  3077. showBj1: false,
  3078. showAdress: false,
  3079. showAdress1: false,
  3080. nameArr: [],
  3081. activeIndex: 0,
  3082. familyFid: id,
  3083. color: 'transparent',
  3084. })
  3085. console.log(this.data.showBj, "关闭提示添加");
  3086. var that = this;
  3087. wx.request({
  3088. url: util.globalData.publicUrl + '/wxinfo/listByFid',
  3089. method: "GET",
  3090. data: {
  3091. fid: id,
  3092. },
  3093. header: {
  3094. appletsId: wx.getStorageSync('openId')
  3095. },
  3096. success: (res) => {
  3097. wx.hideLoading()
  3098. console.log(res.data.data, "单查赋值锕")
  3099. that.setData({
  3100. oldInfo: res.data.data
  3101. })
  3102. let datass = res.data.data;
  3103. let fristIndex = datass.findIndex((item) => {
  3104. return name == item.name;
  3105. });
  3106. let fristArray = datass.filter((item) => {
  3107. return name == item.name;
  3108. });
  3109. datass.splice(fristIndex, 1);
  3110. datass.unshift(fristArray[0]);
  3111. //regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  3112. // regularsInfo:data[this.data.activeIndex]
  3113. that.setData({
  3114. nameArr: datass,
  3115. // regularsInfo: datass[that.data.activeIndex].regularsInfo
  3116. })
  3117. console.log(that.data.regularsInfo, "赋值是么");
  3118. let oldSex = [{
  3119. name: '男',
  3120. checked: false
  3121. },
  3122. {
  3123. name: '女',
  3124. checked: false
  3125. }
  3126. ]
  3127. let oldMarry = [{
  3128. name: "未婚"
  3129. }, {
  3130. name: "已婚"
  3131. }, {
  3132. name: "离异"
  3133. }, {
  3134. name: "丧偶"
  3135. }];
  3136. let loneArr = [{
  3137. name: "是"
  3138. }, {
  3139. name: "否"
  3140. }];
  3141. let mainLookSex = [{
  3142. name: "男"
  3143. }, {
  3144. name: "女"
  3145. }];
  3146. let abc = datass.map(item => {
  3147. let otherInfo = ''
  3148. let imgPath = ''
  3149. if (item.photo) {
  3150. imgPath = item.photo;
  3151. } else {
  3152. imgPath = ''
  3153. }
  3154. let disabilityAyyss = [{
  3155. name: "视力残疾"
  3156. }, {
  3157. name: "听力残疾"
  3158. }, {
  3159. name: "言语残疾"
  3160. }, {
  3161. name: "肢体残疾"
  3162. }, {
  3163. name: "智力残疾"
  3164. }, {
  3165. name: "精神残疾"
  3166. }, {
  3167. name: "多重残疾"
  3168. }];
  3169. let sickType = [{
  3170. name: "重大器官类疾病"
  3171. }, {
  3172. name: "心脑血管类疾病"
  3173. }, {
  3174. name: "神经与代谢类疾病"
  3175. }, {
  3176. name: "肢体与病毒类疾病"
  3177. }, {
  3178. name: "恶性肿瘤"
  3179. }];
  3180. let moneyFromAyy = [{
  3181. name: "家庭经营性收入"
  3182. }, {
  3183. name: "工资性收入"
  3184. }, {
  3185. name: "转移性收入"
  3186. }, {
  3187. name: "财产性收入"
  3188. }, {
  3189. name: "其它"
  3190. }];
  3191. let familyHelpArr = [{
  3192. name: "低保"
  3193. }, {
  3194. name: "建档立卡贫困户"
  3195. }, {
  3196. name: "医疗救助"
  3197. }, {
  3198. name: "临时救助"
  3199. }, {
  3200. name: "老年人福利津贴"
  3201. }, {
  3202. name: "残疾人两项补贴(或一项补贴)"
  3203. }, {
  3204. name: "其他救助"
  3205. }];
  3206. let loveRequire = [{
  3207. name: "生活照料"
  3208. },
  3209. {
  3210. name: "生产帮助"
  3211. },
  3212. {
  3213. name: "精神慰藉"
  3214. },
  3215. {
  3216. name: "医疗保健"
  3217. },
  3218. {
  3219. name: "权益维护"
  3220. },
  3221. {
  3222. name: "安全监护"
  3223. },
  3224. {
  3225. name: "文化娱乐"
  3226. },
  3227. {
  3228. name: "紧急救助"
  3229. },
  3230. {
  3231. name: "其它"
  3232. },
  3233. ];
  3234. let isSameWithAddresss = [{
  3235. name: '现居地址与户籍地址一致'
  3236. }]
  3237. let finalarr = [];
  3238. if (item.health.includes("健康")) {
  3239. for (let i = 0; i < 4; i++) {
  3240. let obj = new Object();
  3241. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  3242. obj.checked = (i == 0 ? true : false);
  3243. obj.disabled = (i == 0 ? false : true);
  3244. finalarr.push(obj)
  3245. }
  3246. } else {
  3247. for (let i = 0; i < 4; i++) {
  3248. let obj = new Object();
  3249. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  3250. obj.checked = (i == 0 ? false : false);
  3251. obj.disabled = (i == 0 ? false : false);
  3252. finalarr.push(obj)
  3253. }
  3254. if (item.health.includes("残疾")) {
  3255. finalarr[1].checked = true;
  3256. }
  3257. if (item.health.includes("患重特大疾病")) {
  3258. finalarr[2].checked = true;
  3259. }
  3260. if (item.health.includes("老年人慢性病")) {
  3261. finalarr[3].checked = true;
  3262. }
  3263. }
  3264. let accompanyArr = [];
  3265. if (item.accompany.includes("无人陪伴居住")) {
  3266. for (let i = 0; i < 5; i++) {
  3267. let obj = new Object();
  3268. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  3269. obj.checked = (i == 0 ? true : false);
  3270. obj.disabled = (i == 0 ? false : true);
  3271. accompanyArr.push(obj)
  3272. }
  3273. } else {
  3274. for (let i = 0; i < 5; i++) {
  3275. let obj = new Object();
  3276. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  3277. obj.checked = (i == 0 ? false : false);
  3278. obj.disabled = (i == 0 ? false : false);
  3279. accompanyArr.push(obj)
  3280. }
  3281. if (item.accompany.includes("配偶")) {
  3282. accompanyArr[1].checked = true;
  3283. }
  3284. if (item.accompany.includes("近亲属")) {
  3285. accompanyArr[2].checked = true;
  3286. }
  3287. if (item.accompany.includes("未成年孙子女")) {
  3288. accompanyArr[3].checked = true;
  3289. }
  3290. if (item.accompany.includes("其他情形")) {
  3291. accompanyArr[4].checked = true;
  3292. }
  3293. }
  3294. let lookAfterArr = [];
  3295. if (item.lookAfter.includes("无人照料")) {
  3296. for (let i = 0; i < 6; i++) {
  3297. let obj = new Object();
  3298. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  3299. obj.checked = (i == 0 ? true : false);
  3300. obj.disabled = (i == 0 ? false : true);
  3301. lookAfterArr.push(obj)
  3302. }
  3303. } else {
  3304. for (let i = 0; i < 6; i++) {
  3305. let obj = new Object();
  3306. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  3307. obj.checked = (i == 0 ? false : false);
  3308. obj.disabled = (i == 0 ? false : false);
  3309. lookAfterArr.push(obj)
  3310. }
  3311. if (item.lookAfter.includes("近亲属")) {
  3312. lookAfterArr[1].checked = true;
  3313. }
  3314. if (item.lookAfter.includes("配偶")) {
  3315. lookAfterArr[2].checked = true;
  3316. }
  3317. if (item.lookAfter.includes("邻里互助")) {
  3318. lookAfterArr[3].checked = true;
  3319. }
  3320. if (item.lookAfter.includes("购买养老服务")) {
  3321. lookAfterArr[4].checked = true;
  3322. }
  3323. if (item.lookAfter.includes("其他人员")) {
  3324. lookAfterArr[5].checked = true;
  3325. }
  3326. }
  3327. let oldTypeArr = [];
  3328. for (let i = 0; i < 8; i++) {
  3329. let obj = new Object();
  3330. obj.name = (i == 0 ? "农村留守老年人" : i == 1 ? "分散供养特困老年人" : i == 2 ? "计划生育特殊家庭老人" : i == 3 ? "空巢老年人" : i == 4 ? "独居老年人" : i == 5 ? "重残老人" : i == 6 ? "高龄老人" : "失能老人");
  3331. obj.checked = (i == 0 ? false : false);
  3332. obj.disable = (i == 0 ? false : false);
  3333. oldTypeArr.push(obj)
  3334. }
  3335. if (item.oldType.includes("农村留守老年人")) {
  3336. oldTypeArr[0].checked = true;
  3337. oldTypeArr[1].disable = true;
  3338. oldTypeArr[2].disable = true;
  3339. oldTypeArr[3].checked = true;
  3340. oldTypeArr[3].disable = true;
  3341. }
  3342. if (item.oldType.includes("分散供养特困老年人")) {
  3343. oldTypeArr[1].checked = true;
  3344. oldTypeArr[0].disable = true;
  3345. oldTypeArr[2].disable = true;
  3346. oldTypeArr[3].disable = true;
  3347. }
  3348. if (item.oldType.includes("计划生育特殊家庭老人")) {
  3349. oldTypeArr[2].checked = true;
  3350. oldTypeArr[0].disable = true;
  3351. oldTypeArr[1].disable = true;
  3352. oldTypeArr[3].disable = true;
  3353. }
  3354. if (item.oldType.includes("空巢老年人") && item.oldType.includes("农村留守老年人")) {
  3355. oldTypeArr[3].checked = true;
  3356. oldTypeArr[1].disable = true;
  3357. oldTypeArr[2].disable = true;
  3358. }
  3359. if (item.oldType.includes("空巢老年人") && !item.oldType.includes("农村留守老年人")) {
  3360. oldTypeArr[3].checked = true;
  3361. oldTypeArr[1].disable = true;
  3362. oldTypeArr[2].disable = true;
  3363. oldTypeArr[0].disable = true;
  3364. }
  3365. if (item.oldType.includes("独居老年人")) {
  3366. oldTypeArr[4].checked = true;
  3367. }
  3368. if (item.oldType.includes("重残老人")) {
  3369. oldTypeArr[5].checked = true;
  3370. }
  3371. if (item.oldType.includes("高龄老人")) {
  3372. oldTypeArr[6].checked = true;
  3373. }
  3374. if (item.oldType.includes("失能老人")) {
  3375. oldTypeArr[7].checked = true;
  3376. }
  3377. disabilityAyyss.forEach(itemss => {
  3378. item.disabilityCategory.forEach(item => {
  3379. if (itemss.name == item) {
  3380. itemss.checked = true;
  3381. }
  3382. })
  3383. })
  3384. familyHelpArr.forEach(itemss => {
  3385. item.rescueState.forEach(item => {
  3386. if (itemss.name == item) {
  3387. itemss.checked = true;
  3388. }
  3389. })
  3390. })
  3391. moneyFromAyy.forEach(itemss => {
  3392. item.sourceOfIncome.forEach(item => {
  3393. if (itemss.name == item) {
  3394. itemss.checked = true;
  3395. }
  3396. })
  3397. })
  3398. if(item.majorDiseases[0]){
  3399. let patorl = this.removeExcess(item.majorDiseases[0]);
  3400. sickType.forEach(items => {
  3401. patorl.forEach(itemss => {
  3402. if (items.name == itemss) {
  3403. items.checked = true;
  3404. }
  3405. })
  3406. })
  3407. }
  3408. loveRequire.forEach(itemss => {
  3409. item.demand.forEach(item => {
  3410. if (itemss.name == item) {
  3411. itemss.checked = true;
  3412. }
  3413. })
  3414. })
  3415. let chooseAdressArr = [];
  3416. let chooseAdressArr1 = [];
  3417. if (item.nativePlace && item.nativePlaceId) {
  3418. let nativePlaces = item.nativePlace.split('/');
  3419. let nativePlaceId = item.nativePlaceId.split(',');
  3420. chooseAdressArr = nativePlaces.map((item, i) => ({
  3421. CIVILREGIONALISMNAME: item,
  3422. CIVILREGIONALISMID: nativePlaceId[i]
  3423. }));
  3424. if (item.isSameWithAddress == '是') {
  3425. isSameWithAddresss.forEach(item => {
  3426. item.checked = true;
  3427. })
  3428. chooseAdressArr1 = chooseAdressArr;
  3429. }
  3430. }
  3431. let addressExts = '';
  3432. if (item.addressExt) {
  3433. addressExts = item.addressExt
  3434. }
  3435. let nativePlaceExts = '';
  3436. if (item.nativePlaceExt) {
  3437. nativePlaceExts = item.nativePlaceExt
  3438. }
  3439. if (item.address && item.nativePlaceId) {
  3440. let address = item.address.split('/');
  3441. let addressId = item.addressId.split(',');
  3442. chooseAdressArr1 = address.map((item, i) => ({
  3443. CIVILREGIONALISMNAME: item,
  3444. CIVILREGIONALISMID: addressId[i]
  3445. }));
  3446. }
  3447. return {
  3448. ...item,
  3449. sickType:sickType,
  3450. oldSex: oldSex.map(items => {
  3451. if (items.name == item.sex) {
  3452. return {
  3453. name: items.name,
  3454. checked: true
  3455. }
  3456. }
  3457. return {
  3458. name: items.name,
  3459. checked: false
  3460. }
  3461. }),
  3462. oldMarry: oldMarry.map(items => {
  3463. if (items.name == item.partnerState) {
  3464. return {
  3465. name: items.name,
  3466. checked: true
  3467. }
  3468. }
  3469. return {
  3470. name: items.name,
  3471. checked: false
  3472. }
  3473. }),
  3474. addressExt: addressExts,
  3475. nativePlaceExt: nativePlaceExts,
  3476. imgPath: imgPath,
  3477. healthAyy: finalarr,
  3478. disabilityAyy: disabilityAyyss,
  3479. moneyFromAyy: moneyFromAyy,
  3480. familyHelpArr: familyHelpArr,
  3481. otherInfo: otherInfo, //赡养人存在么
  3482. mainLookSex: mainLookSex.map(items => {
  3483. if (items.name == item.mainLookSex) {
  3484. return {
  3485. name: items.name,
  3486. checked: true
  3487. }
  3488. }
  3489. return {
  3490. name: items.name,
  3491. checked: false
  3492. }
  3493. }),
  3494. loneArr: loneArr.map(items => {
  3495. if (items.name == item.isLoss) {
  3496. return {
  3497. name: items.name,
  3498. checked: true
  3499. }
  3500. }
  3501. return {
  3502. name: items.name,
  3503. checked: false
  3504. }
  3505. }),
  3506. liveStatus: accompanyArr,
  3507. oftenMan: lookAfterArr,
  3508. loveRequire: loveRequire,
  3509. oldType: oldTypeArr,
  3510. chooseAdressArr: chooseAdressArr,
  3511. isSameWithAddress: isSameWithAddresss,
  3512. chooseAdressArr1: chooseAdressArr1,
  3513. }
  3514. })
  3515. let def = datass.map(item => {
  3516. console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
  3517. let sexs = [{
  3518. name: '男',
  3519. checked: false
  3520. },
  3521. {
  3522. name: '女',
  3523. checked: false
  3524. }
  3525. ]
  3526. let otherInfo = '';
  3527. let name = '';
  3528. let phone = ''
  3529. let relation = ''
  3530. let relationExt = ''
  3531. let outgoingCause = ''
  3532. let isHasGoOut = ''
  3533. let outgoingTime = ''
  3534. let isHasPartner = ''
  3535. let outgoingplace = ''
  3536. let phone2 = ''
  3537. let name2 = ''
  3538. let sex = '';
  3539. let visit = '';
  3540. if (item.otherInfo) {
  3541. let partol = this.removeExcess(item.otherInfo);
  3542. otherInfo = '是'
  3543. if (partol.name) {
  3544. name = partol.name
  3545. }
  3546. if (partol.sex) {
  3547. sexs.forEach(items => {
  3548. if (items.name == partol.sex) {
  3549. items.checked = true;
  3550. sex = partol.sex ;
  3551. }
  3552. })
  3553. }
  3554. if (partol.phone) {
  3555. phone = partol.phone
  3556. }
  3557. if (partol.relation) {
  3558. relation = partol.relation
  3559. }
  3560. if (partol.relationExt) {
  3561. relationExt = partol.relationExt
  3562. }
  3563. if (partol.visit) {
  3564. visit = partol.visit;
  3565. }
  3566. if (partol.isHasGoOut) {
  3567. isHasGoOut = partol.isHasGoOut;
  3568. }
  3569. if (partol.outgoingCause) {
  3570. outgoingCause = partol.outgoingCause;
  3571. }
  3572. if (partol.outgoingTime) {
  3573. outgoingTime = partol.outgoingTime;
  3574. }
  3575. if (partol.isHasPartner) {
  3576. isHasPartner = partol.isHasPartner;
  3577. }
  3578. if (partol.outgoingplace) {
  3579. outgoingplace = partol.outgoingplace;
  3580. }
  3581. if (partol.name2) {
  3582. name2 = partol.name2;
  3583. }
  3584. if (partol.phone2) {
  3585. phone2 = partol.phone2;
  3586. }
  3587. } else if (item.otherInfo == '') {
  3588. otherInfo = '否'
  3589. } else {
  3590. otherInfo = ''
  3591. }
  3592. return {
  3593. ...item,
  3594. isHasOther: otherInfo, //赡养人存在
  3595. // name: name,
  3596. // othersyrSexArr: sex,
  3597. // phone: phone,
  3598. // othersyrRelationValue: othersyrRelationValue,
  3599. // relationExt: relationExt,
  3600. // visit: visit,
  3601. Info: {
  3602. name: name,
  3603. phone: phone,
  3604. relation: relation,
  3605. relationExt: relationExt,
  3606. isHasGoOut: isHasGoOut,
  3607. outgoingCause: outgoingCause,
  3608. outgoingTime: outgoingTime,
  3609. isHasPartner: isHasPartner,
  3610. outgoingplace: outgoingplace,
  3611. visit: visit,
  3612. name2: name2,
  3613. phone2: phone2,
  3614. othersyrSexArr: sexs,
  3615. sex :sex ,
  3616. }
  3617. }
  3618. })
  3619. let ghi = datass.map(item => {
  3620. // console.log(item, "8888888888888888888888888888888888888888888888888888");
  3621. let childrenNum = '';
  3622. if (item.childrenNum) {
  3623. if (item.childrenNum == '4') {
  3624. childrenNum = '3个以上'
  3625. } else {
  3626. childrenNum = item.childrenNum + '个'
  3627. }
  3628. } else {
  3629. childrenNum = ''
  3630. }
  3631. let Info = [];
  3632. if (item.childInfo) {
  3633. let partol = this.removeExcess(item.childInfo);
  3634. Info = partol
  3635. } else {
  3636. if (parseInt(childrenNum) == 5) {
  3637. for (let i = 0; i < parseInt(childrenNum) - 1; i++) {
  3638. let chlidInfos = {
  3639. name: '', // 姓名
  3640. sex: '',
  3641. phone: '', // 常用联系电话,
  3642. isHasGoOut: '', // 子女是否外出
  3643. outgoingplace: '', // 外出地点
  3644. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  3645. name2: '', // 子女配偶姓名
  3646. phone2: '', // 子女配偶电话
  3647. outgoingTime: '', // 最后一次离家时间
  3648. outgoingCause: '', // 外出原因
  3649. visit: '', // 平均一年探望次数
  3650. }
  3651. Info.push(chlidInfos)
  3652. }
  3653. } else {
  3654. for (let i = 0; i < parseInt(childrenNum); i++) {
  3655. let chlidInfos = {
  3656. name: '', // 姓名
  3657. sex: '',
  3658. phone: '', // 常用联系电话,
  3659. isHasGoOut: '', // 子女是否外出
  3660. outgoingplace: '', // 外出地点
  3661. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  3662. name2: '', // 子女配偶姓名
  3663. phone2: '', // 子女配偶电话
  3664. outgoingTime: '', // 最后一次离家时间
  3665. outgoingCause: '', // 外出原因
  3666. visit: '', // 平均一年探望次数
  3667. }
  3668. Info.push(chlidInfos)
  3669. }
  3670. }
  3671. }
  3672. return {
  3673. ...item,
  3674. childrenNum: childrenNum,
  3675. Info: Info
  3676. }
  3677. })
  3678. let zzz = datass.map(item => {
  3679. let visitModeExt = ''
  3680. let visitCountExt = ''
  3681. let visitMode = [{
  3682. name: '电话问候',
  3683. checked: false
  3684. }, {
  3685. name: '上门巡访',
  3686. checked: false
  3687. }, {
  3688. name: '其它',
  3689. checked: false
  3690. }]
  3691. let visitCounts = [{
  3692. name: '每天',
  3693. checked: false
  3694. }, {
  3695. name: '每周',
  3696. checked: false
  3697. }, {
  3698. name: '每月',
  3699. checked: false
  3700. },
  3701. {
  3702. name: '每季',
  3703. checked: false
  3704. },
  3705. {
  3706. name: '其它',
  3707. checked: false
  3708. }
  3709. ];
  3710. if (item.regularsInfo) {
  3711. let partol = this.removeExcess(item.regularsInfo);
  3712. let partols = this.removeExcess(partol.visitMode);
  3713. if (partol.visitMode) {
  3714. visitMode.forEach(items => {
  3715. partols.forEach(itemss => {
  3716. if (items.name == itemss) {
  3717. items.checked = true;
  3718. }
  3719. })
  3720. })
  3721. }
  3722. if (partol.visitCount) {
  3723. visitCounts.forEach(items => {
  3724. if (items.name == partol.visitCount) {
  3725. items.checked = true;
  3726. }
  3727. })
  3728. }
  3729. if (partol.visitCountExt) {
  3730. visitCountExt = partol.visitCountExt;
  3731. }
  3732. if (partol.visitModeExt) {
  3733. visitModeExt = partol.visitModeExt;
  3734. }
  3735. }
  3736. return {
  3737. ...item,
  3738. visitCountExt: visitCountExt,
  3739. visitModeExt: visitModeExt,
  3740. visitMode: visitMode,
  3741. visitCount: visitCounts,
  3742. }
  3743. })
  3744. let mmm = datass.map(item => {
  3745. if (item.regularsInfo) {
  3746. let partol = this.removeExcess(item.regularsInfo);
  3747. let partols = this.removeExcess(partol.visitMode);
  3748. console.log(partol, "111111111111111111111");
  3749. console.log(partols, "99999999999999999999");
  3750. return {
  3751. visitCount: partol.visitCount,
  3752. visitCountExt: partol.visitCountExt,
  3753. visitMode: partols,
  3754. visitModeExt: partol.visitModeExt,
  3755. }
  3756. }
  3757. })
  3758. console.log(mmm,"mmmmmmmmmmmmmm");
  3759. // if (datass[that.data.activeIndex].regularsInfo) {
  3760. // let regularsInfo = that.removeExcess(datass[that.data.activeIndex].regularsInfo);
  3761. // console.log(regularsInfo,"解析的regularsInfo");
  3762. // that.setData({
  3763. // regularsInfo: regularsInfo
  3764. // })
  3765. // }
  3766. that.setData({
  3767. oldInfo: abc,
  3768. otherInfo: def,
  3769. childInfo: ghi,
  3770. regularsInfos: zzz,
  3771. regularsInfo: mmm,
  3772. })
  3773. console.log(that.data.oldInfo, "老人的返现数组")
  3774. console.log(that.data.otherInfo, "其他的返现数组")
  3775. console.log(that.data.childInfo, "孩子的返现数组")
  3776. console.log(that.data.regularsInfos, "q巡访的返现数组")
  3777. console.log(that.data.regularsInfo, "巡访传值的返回")
  3778. // let ghi = res.data.data.map(item => {
  3779. // console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
  3780. // let sex = [{
  3781. // name: '男',
  3782. // checked: false
  3783. // },
  3784. // {
  3785. // name: '女',
  3786. // checked: false
  3787. // }
  3788. // ]
  3789. // let otherInfo = '';
  3790. // let name = '';
  3791. // let phone = ''
  3792. // let othersyrRelationValue = ''
  3793. // let relationExt = ''
  3794. // let visit = ''
  3795. // if (item.otherInfo) {
  3796. // let partol = this.removeExcess(item.otherInfo);
  3797. // otherInfo = '是'
  3798. // if (partol.name) {
  3799. // name = partol.name
  3800. // }
  3801. // if (partol.sex) {
  3802. // sex.forEach(items => {
  3803. // if (items.name == partol.sex) {
  3804. // items.checked = true;
  3805. // }
  3806. // })
  3807. // }
  3808. // if (partol.phone) {
  3809. // phone = partol.phone
  3810. // }
  3811. // if (partol.relation) {
  3812. // othersyrRelationValue = partol.relation
  3813. // }
  3814. // if (partol.relationExt) {
  3815. // relationExt = partol.relationExt
  3816. // }
  3817. // if (partol.visit) {
  3818. // visit = partol.visit;
  3819. // }
  3820. // } else {
  3821. // otherInfo = ''
  3822. // }
  3823. // return {
  3824. // ...item,
  3825. // otherInfo: otherInfo, //赡养人存在
  3826. // name: name,
  3827. // othersyrSexArr: sex,
  3828. // phone: phone,
  3829. // othersyrRelationValue: othersyrRelationValue,
  3830. // relationExt: relationExt,
  3831. // visit: visit,
  3832. // }
  3833. // })
  3834. // that.setData({
  3835. // oldInfo: abc,
  3836. // otherInfo: def,
  3837. // childInfo: ghi
  3838. // })
  3839. }
  3840. })
  3841. } else {
  3842. }
  3843. },
  3844. chooseAdress() {
  3845. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr)
  3846. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 0) {
  3847. wx.request({
  3848. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3849. method: "get",
  3850. header: {
  3851. appletsId: wx.getStorageSync('openId')
  3852. },
  3853. success: (res) => {
  3854. this.setData({
  3855. showAdress: true,
  3856. provinceArr: res.data.data
  3857. })
  3858. console.log(this.data.provinceArr)
  3859. }
  3860. })
  3861. }
  3862. this.setData({
  3863. showAdress: true
  3864. })
  3865. },
  3866. // 选择现居地址
  3867. chooseAdress1() {
  3868. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length == 0) {
  3869. wx.request({
  3870. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3871. method: "get",
  3872. header: {
  3873. appletsId: wx.getStorageSync('openId')
  3874. },
  3875. success: (res) => {
  3876. console.log(res.data.data)
  3877. this.setData({
  3878. showAdress1: true,
  3879. provinceArr1: res.data.data
  3880. })
  3881. }
  3882. })
  3883. }
  3884. this.setData({
  3885. showAdress1: true
  3886. })
  3887. },
  3888. provinceClick(e) {
  3889. console.log(e.currentTarget.dataset.item)
  3890. wx.showLoading({
  3891. title: '选择中',
  3892. mask: true
  3893. })
  3894. this.data.oldInfo[this.data.activeIndex].chooseAdressArr.push(e.currentTarget.dataset.item)
  3895. wx.request({
  3896. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3897. method: "get",
  3898. header: {
  3899. appletsId: wx.getStorageSync('openId')
  3900. },
  3901. data: {
  3902. fid: e.currentTarget.dataset.item.CIVILREGIONALISMID
  3903. },
  3904. success: (res) => {
  3905. this.setData({
  3906. provinceArr: res.data.data,
  3907. isAdress: true,
  3908. oldInfo: this.data.oldInfo
  3909. })
  3910. if (res.data.data.length == 0) {
  3911. this.setData({
  3912. pleaseChoose: false
  3913. })
  3914. }
  3915. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 5) {
  3916. let nativePlaceId = '';
  3917. let nativePlace = '';
  3918. for (let value of this.data.oldInfo[this.data.activeIndex].chooseAdressArr) {
  3919. nativePlace += value.CIVILREGIONALISMNAME + '/'
  3920. nativePlaceId += value.CIVILREGIONALISMID + ','
  3921. console.log(value, "打印下");
  3922. }
  3923. this.SubmitOldmanInfo({
  3924. id: this.data.nameArr[this.data.activeIndex]._id,
  3925. nativePlace: nativePlace.substring(0, nativePlace.length - 1),
  3926. nativePlaceId: nativePlaceId.substring(0, nativePlaceId.length - 1),
  3927. })
  3928. }
  3929. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr, '我是添加的数组')
  3930. wx.hideLoading()
  3931. }
  3932. })
  3933. // }
  3934. },
  3935. provinceClick1(e) {
  3936. console.log(e.currentTarget.dataset.item)
  3937. wx.showLoading({
  3938. title: '选择中',
  3939. mask: true
  3940. })
  3941. this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.push(e.currentTarget.dataset.item)
  3942. wx.request({
  3943. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3944. method: "get",
  3945. header: {
  3946. appletsId: wx.getStorageSync('openId')
  3947. },
  3948. data: {
  3949. fid: e.currentTarget.dataset.item.CIVILREGIONALISMID
  3950. },
  3951. success: (res) => {
  3952. this.setData({
  3953. provinceArr1: res.data.data,
  3954. isAdress1: true,
  3955. oldInfo: this.data.oldInfo
  3956. })
  3957. if (res.data.data.length == 0) {
  3958. this.setData({
  3959. pleaseChoose1: false
  3960. })
  3961. }
  3962. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length == 5) {
  3963. let addressId = '';
  3964. let address = '';
  3965. for (let value of this.data.oldInfo[this.data.activeIndex].chooseAdressArr1) {
  3966. address += value.CIVILREGIONALISMNAME + '/'
  3967. addressId += value.CIVILREGIONALISMID + ','
  3968. console.log(value, "打印下");
  3969. }
  3970. this.SubmitOldmanInfo({
  3971. id: this.data.nameArr[this.data.activeIndex]._id,
  3972. address: address.substring(0, address.length - 1),
  3973. addressId: addressId.substring(0, addressId.length - 1),
  3974. })
  3975. }
  3976. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1, '我是添加的数组')
  3977. wx.hideLoading()
  3978. }
  3979. })
  3980. // }
  3981. },
  3982. closeAdress() {
  3983. this.setData({
  3984. showAdress: false
  3985. })
  3986. },
  3987. closeAdress1() {
  3988. this.setData({
  3989. showAdress1: false
  3990. })
  3991. },
  3992. reSelect(e) {
  3993. let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr'
  3994. console.log(e.currentTarget.dataset.index)
  3995. this.setData({
  3996. [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr.slice(0, e.currentTarget.dataset.index),
  3997. oldInfo: this.data.oldInfo
  3998. })
  3999. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr)
  4000. let fid;
  4001. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length != 0) {
  4002. fid = this.data.oldInfo[this.data.activeIndex].chooseAdressArr[this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length - 1].CIVILREGIONALISMID;
  4003. } else {
  4004. fid = ''
  4005. }
  4006. wx.request({
  4007. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  4008. method: "get",
  4009. header: {
  4010. appletsId: wx.getStorageSync('openId')
  4011. },
  4012. data: {
  4013. fid
  4014. },
  4015. success: (res) => {
  4016. this.setData({
  4017. provinceArr: res.data.data,
  4018. isAdress: true,
  4019. oldInfo: this.data.oldInfo
  4020. })
  4021. if (res.data.data.length == 0) {
  4022. this.setData({
  4023. pleaseChoose: false
  4024. })
  4025. }
  4026. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr, '我是添加的数组')
  4027. wx.hideLoading()
  4028. // this.setData({
  4029. // provinceArr: res.data.data,
  4030. // isAdress: true,
  4031. // [Info]: this.data.oldInfo
  4032. // })
  4033. // if (res.data.data.length == 0) {
  4034. // this.setData({
  4035. // pleaseChoose: false
  4036. // })
  4037. // }
  4038. }
  4039. })
  4040. },
  4041. reSelect1(e) {
  4042. let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
  4043. console.log(e.currentTarget.dataset.index)
  4044. this.setData({
  4045. [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.slice(0, e.currentTarget.dataset.index),
  4046. oldInfo: this.data.oldInfo
  4047. })
  4048. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1)
  4049. let fid;
  4050. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length != 0) {
  4051. fid = this.data.oldInfo[this.data.activeIndex].chooseAdressArr1[this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length - 1].CIVILREGIONALISMID;
  4052. } else {
  4053. fid = ''
  4054. }
  4055. wx.request({
  4056. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  4057. method: "get",
  4058. header: {
  4059. appletsId: wx.getStorageSync('openId')
  4060. },
  4061. data: {
  4062. fid
  4063. },
  4064. success: (res) => {
  4065. this.setData({
  4066. provinceArr1: res.data.data,
  4067. isAdress1: true,
  4068. oldInfo: this.data.oldInfo
  4069. })
  4070. if (res.data.data.length == 0) {
  4071. this.setData({
  4072. pleaseChoose1: false
  4073. })
  4074. }
  4075. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1, '我是添加的数组')
  4076. wx.hideLoading()
  4077. }
  4078. })
  4079. },
  4080. // 提交老人采集信息
  4081. SubmitOldmanInfo(data) {
  4082. console.log(data, ' 提交老人信息带过来的数据')
  4083. console.log(this.data.nameArr[this.data.activeIndex])
  4084. wx.request({
  4085. url: util.globalData.publicUrl + '/wxinfo/update',
  4086. method: "post",
  4087. header: {
  4088. appletsId: wx.getStorageSync('openId')
  4089. },
  4090. data,
  4091. success: (res) => {
  4092. console.log(res)
  4093. }
  4094. })
  4095. },
  4096. onReady() {
  4097. console.log("onReadyonReadyonReadyonReadyonReadyonReadyonReadyonReadyonReadyonReady");
  4098. isTwoOnshow = false;
  4099. isonShow = false;
  4100. },
  4101. onShow() {
  4102. console.log("Onshow。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。");
  4103. if (wx.getStorageSync('user') == '') {
  4104. wx.redirectTo({
  4105. url: '/pages/login/login',
  4106. })
  4107. }else {
  4108. const app = getApp();
  4109. if (isTwoOnshow) {
  4110. isTwoOnshow = false;
  4111. return;
  4112. };
  4113. if (isonShow) {
  4114. isonShow = false;
  4115. return;
  4116. };
  4117. this.setData({
  4118. addOldname: '',
  4119. currentIndex: 0
  4120. })
  4121. console.log(app.globalData.id, "传参的一户的值");
  4122. this.huixian(app.globalData.id, app.globalData.name);
  4123. }
  4124. },
  4125. onHide() {
  4126. const app = getApp()
  4127. if (app.globalData.id != -1) {
  4128. app.globalData.id = ''
  4129. }
  4130. app.globalData.name = ''
  4131. this.setData({
  4132. showBj: false,
  4133. })
  4134. // isonShow = false
  4135. // isTwoOnshow = false
  4136. console.log(this.data.showBj, "我关闭页面隐藏属性");
  4137. console.log(app.globalData.id, "清空了么");
  4138. },
  4139. //获取位置
  4140. getSelfLocation: function (varSendOrgId) {
  4141. // 实例化API核心类
  4142. var qqmapsdk = new QQMapWX({
  4143. key: 'B5DBZ-NGIHP-SQMD4-LHMG3-NJ72Z-7KFOV' //申请的开发者秘钥key
  4144. });
  4145. var that = this; //用户授权过可以直接获取位置
  4146. wx.getLocation({
  4147. //type: 'wgs84',
  4148. type: 'gcj02',
  4149. success: function (res) {
  4150. console.log(res, "0000000");
  4151. // 返回当前定位的经纬度
  4152. var latitude = parseFloat(res.latitude).toFixed(5);
  4153. var longitude = parseFloat(res.longitude).toFixed(5);
  4154. qqmapsdk.reverseGeocoder({
  4155. location: {
  4156. latitude: res.latitude,
  4157. longitude: res.longitude
  4158. },
  4159. success: function (res) {
  4160. //获取当前地址成功
  4161. // that.setData({
  4162. // visitLocation: res.result.address
  4163. // })
  4164. let photoAndLocation = 'oldInfo[' + that.data.activeIndex + '].photoAndLocation'
  4165. let gps = longitude + '/' + latitude + '/' + res.result.address
  4166. that.setData({
  4167. [photoAndLocation]: gps
  4168. })
  4169. console.log(that.data.nameArr[that.data.activeIndex], "定位的问题");
  4170. that.SubmitOldmanInfo({
  4171. id: that.data.nameArr[that.data.activeIndex]._id,
  4172. photoAndLocation: gps
  4173. })
  4174. },
  4175. fail: function (res) {
  4176. console.log('获取当前地址失败');
  4177. }
  4178. });
  4179. },
  4180. fail: function (res) {}
  4181. });
  4182. },
  4183. onLoad(value) {
  4184. console.log(wx.getStorageSync('user'), "打印");
  4185. if (wx.getStorageSync('user') == '') {
  4186. wx.redirectTo({
  4187. url: '/pages/login/login',
  4188. })
  4189. }else {
  4190. console.log(value, "onLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoad");
  4191. this.huixian1(value.id, value.name);
  4192. }
  4193. // this.getSelfLocation();
  4194. },
  4195. huixian1(id, name) {
  4196. if (id) {
  4197. wx.showLoading({
  4198. title: '加载中',
  4199. })
  4200. this.setData({
  4201. showBj: false,
  4202. showBj1: false,
  4203. showAdress: false,
  4204. showAdress1: false,
  4205. nameArr: [],
  4206. activeIndex: 0,
  4207. familyFid: id,
  4208. color: 'transparent',
  4209. })
  4210. console.log(this.data.showBj, "关闭提示添加");
  4211. var that = this;
  4212. wx.request({
  4213. url: util.globalData.publicUrl + '/wxinfo/listByFid',
  4214. method: "GET",
  4215. data: {
  4216. fid: id,
  4217. },
  4218. header: {
  4219. appletsId: wx.getStorageSync('openId')
  4220. },
  4221. success: (res) => {
  4222. wx.hideLoading()
  4223. console.log(res.data.data, "单查赋值锕")
  4224. that.setData({
  4225. oldInfo: res.data.data
  4226. })
  4227. let datass = res.data.data;
  4228. let fristIndex = datass.findIndex((item) => {
  4229. return name == item.name;
  4230. });
  4231. let fristArray = datass.filter((item) => {
  4232. return name == item.name;
  4233. });
  4234. datass.splice(fristIndex, 1);
  4235. datass.unshift(fristArray[0]);
  4236. that.setData({
  4237. nameArr: datass,
  4238. })
  4239. // if (datass[that.data.activeIndex].regularsInfo) {
  4240. // let regularsInfo = that.removeExcess(datass[that.data.activeIndex].regularsInfo);
  4241. // that.setData({
  4242. // regularsInfo: regularsInfo
  4243. // })
  4244. // }
  4245. // console.log(that.data.regularsInfo, "onload赋值是么");
  4246. // console.log(data, "dadadsadasdasdsadsadsadsa");
  4247. let oldSex = [{
  4248. name: '男',
  4249. checked: false
  4250. },
  4251. {
  4252. name: '女',
  4253. checked: false
  4254. }
  4255. ]
  4256. let oldMarry = [{
  4257. name: "未婚"
  4258. }, {
  4259. name: "已婚"
  4260. }, {
  4261. name: "离异"
  4262. }, {
  4263. name: "丧偶"
  4264. }];
  4265. let loneArr = [{
  4266. name: "是"
  4267. }, {
  4268. name: "否"
  4269. }];
  4270. let mainLookSex = [{
  4271. name: "男"
  4272. }, {
  4273. name: "女"
  4274. }];
  4275. let abc = datass.map(item => {
  4276. let otherInfo = ''
  4277. let imgPath = ''
  4278. if (item.photo) {
  4279. imgPath = item.photo;
  4280. } else {
  4281. imgPath = ''
  4282. }
  4283. let disabilityAyyss = [{
  4284. name: "视力残疾"
  4285. }, {
  4286. name: "听力残疾"
  4287. }, {
  4288. name: "言语残疾"
  4289. }, {
  4290. name: "肢体残疾"
  4291. }, {
  4292. name: "智力残疾"
  4293. }, {
  4294. name: "精神残疾"
  4295. }, {
  4296. name: "多重残疾"
  4297. }];
  4298. let moneyFromAyy = [{
  4299. name: "家庭经营性收入"
  4300. }, {
  4301. name: "工资性收入"
  4302. }, {
  4303. name: "转移性收入"
  4304. }, {
  4305. name: "财产性收入"
  4306. }, {
  4307. name: "其它"
  4308. }];
  4309. let familyHelpArr = [{
  4310. name: "低保"
  4311. }, {
  4312. name: "建档立卡贫困户"
  4313. }, {
  4314. name: "医疗救助"
  4315. }, {
  4316. name: "临时救助"
  4317. }, {
  4318. name: "老年人福利津贴"
  4319. }, {
  4320. name: "残疾人两项补贴(或一项补贴)"
  4321. }, {
  4322. name: "其他救助"
  4323. }];
  4324. let loveRequire = [{
  4325. name: "生活照料"
  4326. },
  4327. {
  4328. name: "生产帮助"
  4329. },
  4330. {
  4331. name: "精神慰藉"
  4332. },
  4333. {
  4334. name: "医疗保健"
  4335. },
  4336. {
  4337. name: "权益维护"
  4338. },
  4339. {
  4340. name: "安全监护"
  4341. },
  4342. {
  4343. name: "文化娱乐"
  4344. },
  4345. {
  4346. name: "紧急救助"
  4347. },
  4348. {
  4349. name: "其它"
  4350. },
  4351. ];
  4352. let isSameWithAddresss = [{
  4353. name: '现居地址与户籍地址一致'
  4354. }]
  4355. let finalarr = [];
  4356. if (item.health.includes("健康")) {
  4357. for (let i = 0; i < 4; i++) {
  4358. let obj = new Object();
  4359. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  4360. obj.checked = (i == 0 ? true : false);
  4361. obj.disabled = (i == 0 ? false : true);
  4362. finalarr.push(obj)
  4363. }
  4364. } else {
  4365. for (let i = 0; i < 4; i++) {
  4366. let obj = new Object();
  4367. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  4368. obj.checked = (i == 0 ? false : false);
  4369. obj.disabled = (i == 0 ? false : false);
  4370. finalarr.push(obj)
  4371. }
  4372. if (item.health.includes("残疾")) {
  4373. finalarr[1].checked = true;
  4374. }
  4375. if (item.health.includes("患重特大疾病")) {
  4376. finalarr[2].checked = true;
  4377. }
  4378. if (item.health.includes("老年人慢性病")) {
  4379. finalarr[3].checked = true;
  4380. }
  4381. }
  4382. let accompanyArr = [];
  4383. if (item.accompany.includes("无人陪伴居住")) {
  4384. for (let i = 0; i < 5; i++) {
  4385. let obj = new Object();
  4386. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  4387. obj.checked = (i == 0 ? true : false);
  4388. obj.disabled = (i == 0 ? false : true);
  4389. accompanyArr.push(obj)
  4390. }
  4391. } else {
  4392. for (let i = 0; i < 5; i++) {
  4393. let obj = new Object();
  4394. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  4395. obj.checked = (i == 0 ? false : false);
  4396. obj.disabled = (i == 0 ? false : false);
  4397. accompanyArr.push(obj)
  4398. }
  4399. if (item.accompany.includes("配偶")) {
  4400. accompanyArr[1].checked = true;
  4401. }
  4402. if (item.accompany.includes("近亲属")) {
  4403. accompanyArr[2].checked = true;
  4404. }
  4405. if (item.accompany.includes("未成年孙子女")) {
  4406. accompanyArr[3].checked = true;
  4407. }
  4408. if (item.accompany.includes("其他情形")) {
  4409. accompanyArr[4].checked = true;
  4410. }
  4411. }
  4412. let lookAfterArr = [];
  4413. if (item.lookAfter.includes("无人照料")) {
  4414. for (let i = 0; i < 6; i++) {
  4415. let obj = new Object();
  4416. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  4417. obj.checked = (i == 0 ? true : false);
  4418. obj.disabled = (i == 0 ? false : true);
  4419. lookAfterArr.push(obj)
  4420. }
  4421. } else {
  4422. for (let i = 0; i < 6; i++) {
  4423. let obj = new Object();
  4424. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  4425. obj.checked = (i == 0 ? false : false);
  4426. obj.disabled = (i == 0 ? false : false);
  4427. lookAfterArr.push(obj)
  4428. }
  4429. if (item.lookAfter.includes("近亲属")) {
  4430. lookAfterArr[1].checked = true;
  4431. }
  4432. if (item.lookAfter.includes("配偶")) {
  4433. lookAfterArr[2].checked = true;
  4434. }
  4435. if (item.lookAfter.includes("邻里互助")) {
  4436. lookAfterArr[3].checked = true;
  4437. }
  4438. if (item.lookAfter.includes("购买养老服务")) {
  4439. lookAfterArr[4].checked = true;
  4440. }
  4441. if (item.lookAfter.includes("其他人员")) {
  4442. lookAfterArr[5].checked = true;
  4443. }
  4444. }
  4445. let oldTypeArr = [];
  4446. for (let i = 0; i < 8; i++) {
  4447. let obj = new Object();
  4448. obj.name = (i == 0 ? "农村留守老年人" : i == 1 ? "分散供养特困老年人" : i == 2 ? "计划生育特殊家庭老人" : i == 3 ? "空巢老年人" : i == 4 ? "独居老年人" : i == 5 ? "重残老人" : i == 6 ? "高龄老人" : "失能老人");
  4449. obj.checked = (i == 0 ? false : false);
  4450. obj.disable = (i == 0 ? false : false);
  4451. oldTypeArr.push(obj)
  4452. }
  4453. if (item.oldType.includes("农村留守老年人")) {
  4454. oldTypeArr[0].checked = true;
  4455. oldTypeArr[1].disable = true;
  4456. oldTypeArr[2].disable = true;
  4457. oldTypeArr[3].checked = true;
  4458. oldTypeArr[3].disable = true;
  4459. }
  4460. if (item.oldType.includes("分散供养特困老年人")) {
  4461. oldTypeArr[1].checked = true;
  4462. oldTypeArr[0].disable = true;
  4463. oldTypeArr[2].disable = true;
  4464. oldTypeArr[3].disable = true;
  4465. }
  4466. if (item.oldType.includes("计划生育特殊家庭老人")) {
  4467. oldTypeArr[2].checked = true;
  4468. oldTypeArr[0].disable = true;
  4469. oldTypeArr[1].disable = true;
  4470. oldTypeArr[3].disable = true;
  4471. }
  4472. if (item.oldType.includes("空巢老年人") && item.oldType.includes("农村留守老年人")) {
  4473. oldTypeArr[3].checked = true;
  4474. oldTypeArr[1].disable = true;
  4475. oldTypeArr[2].disable = true;
  4476. }
  4477. if (item.oldType.includes("空巢老年人") && !item.oldType.includes("农村留守老年人")) {
  4478. oldTypeArr[3].checked = true;
  4479. oldTypeArr[1].disable = true;
  4480. oldTypeArr[2].disable = true;
  4481. oldTypeArr[0].disable = true;
  4482. }
  4483. if (item.oldType.includes("独居老年人")) {
  4484. oldTypeArr[4].checked = true;
  4485. }
  4486. if (item.oldType.includes("重残老人")) {
  4487. oldTypeArr[5].checked = true;
  4488. }
  4489. if (item.oldType.includes("高龄老人")) {
  4490. oldTypeArr[6].checked = true;
  4491. }
  4492. if (item.oldType.includes("失能老人")) {
  4493. oldTypeArr[7].checked = true;
  4494. }
  4495. disabilityAyyss.forEach(itemss => {
  4496. item.disabilityCategory.forEach(item => {
  4497. if (itemss.name == item) {
  4498. itemss.checked = true;
  4499. }
  4500. })
  4501. })
  4502. familyHelpArr.forEach(itemss => {
  4503. item.rescueState.forEach(item => {
  4504. if (itemss.name == item) {
  4505. itemss.checked = true;
  4506. }
  4507. })
  4508. })
  4509. moneyFromAyy.forEach(itemss => {
  4510. item.sourceOfIncome.forEach(item => {
  4511. if (itemss.name == item) {
  4512. itemss.checked = true;
  4513. }
  4514. })
  4515. })
  4516. loveRequire.forEach(itemss => {
  4517. item.demand.forEach(item => {
  4518. if (itemss.name == item) {
  4519. itemss.checked = true;
  4520. }
  4521. })
  4522. })
  4523. let chooseAdressArr = [];
  4524. let chooseAdressArr1 = [];
  4525. if (item.nativePlace && item.nativePlaceId) {
  4526. let nativePlaces = item.nativePlace.split('/');
  4527. let nativePlaceId = item.nativePlaceId.split(',');
  4528. chooseAdressArr = nativePlaces.map((item, i) => ({
  4529. CIVILREGIONALISMNAME: item,
  4530. CIVILREGIONALISMID: nativePlaceId[i]
  4531. }));
  4532. if (item.isSameWithAddress == '是') {
  4533. isSameWithAddresss.forEach(item => {
  4534. item.checked = true;
  4535. })
  4536. chooseAdressArr1 = chooseAdressArr;
  4537. }
  4538. }
  4539. let addressExts = '';
  4540. if (item.addressExt) {
  4541. addressExts = item.addressExt
  4542. }
  4543. let nativePlaceExts = '';
  4544. if (item.nativePlaceExt) {
  4545. nativePlaceExts = item.nativePlaceExt
  4546. }
  4547. if (item.address && item.nativePlaceId) {
  4548. let address = item.address.split('/');
  4549. let addressId = item.addressId.split(',');
  4550. chooseAdressArr1 = address.map((item, i) => ({
  4551. CIVILREGIONALISMNAME: item,
  4552. CIVILREGIONALISMID: addressId[i]
  4553. }));
  4554. }
  4555. return {
  4556. ...item,
  4557. oldSex: oldSex.map(items => {
  4558. if (items.name == item.sex) {
  4559. return {
  4560. name: items.name,
  4561. checked: true
  4562. }
  4563. }
  4564. return {
  4565. name: items.name,
  4566. checked: false
  4567. }
  4568. }),
  4569. oldMarry: oldMarry.map(items => {
  4570. if (items.name == item.partnerState) {
  4571. return {
  4572. name: items.name,
  4573. checked: true
  4574. }
  4575. }
  4576. return {
  4577. name: items.name,
  4578. checked: false
  4579. }
  4580. }),
  4581. addressExt: addressExts,
  4582. nativePlaceExt: nativePlaceExts,
  4583. imgPath: imgPath,
  4584. healthAyy: finalarr,
  4585. disabilityAyy: disabilityAyyss,
  4586. moneyFromAyy: moneyFromAyy,
  4587. familyHelpArr: familyHelpArr,
  4588. otherInfo: otherInfo, //赡养人存在么
  4589. mainLookSex: mainLookSex.map(items => {
  4590. if (items.name == item.mainLookSex) {
  4591. return {
  4592. name: items.name,
  4593. checked: true
  4594. }
  4595. }
  4596. return {
  4597. name: items.name,
  4598. checked: false
  4599. }
  4600. }),
  4601. loneArr: loneArr.map(items => {
  4602. if (items.name == item.isLoss) {
  4603. return {
  4604. name: items.name,
  4605. checked: true
  4606. }
  4607. }
  4608. return {
  4609. name: items.name,
  4610. checked: false
  4611. }
  4612. }),
  4613. liveStatus: accompanyArr,
  4614. oftenMan: lookAfterArr,
  4615. loveRequire: loveRequire,
  4616. oldType: oldTypeArr,
  4617. chooseAdressArr: chooseAdressArr,
  4618. isSameWithAddress: isSameWithAddresss,
  4619. chooseAdressArr1: chooseAdressArr1,
  4620. }
  4621. })
  4622. let def = datass.map(item => {
  4623. console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
  4624. let sex = [{
  4625. name: '男',
  4626. checked: false
  4627. },
  4628. {
  4629. name: '女',
  4630. checked: false
  4631. }
  4632. ]
  4633. let otherInfo = '';
  4634. let name = '';
  4635. let phone = ''
  4636. let relation = ''
  4637. let relationExt = ''
  4638. let outgoingCause = ''
  4639. let isHasGoOut = ''
  4640. let outgoingTime = ''
  4641. let isHasPartner = ''
  4642. let outgoingplace = ''
  4643. let phone2 = ''
  4644. let name2 = ''
  4645. let visit = '';
  4646. if (item.otherInfo) {
  4647. let partol = this.removeExcess(item.otherInfo);
  4648. otherInfo = '是'
  4649. if (partol.name) {
  4650. name = partol.name
  4651. }
  4652. if (partol.sex) {
  4653. sex.forEach(items => {
  4654. if (items.name == partol.sex) {
  4655. items.checked = true;
  4656. }
  4657. })
  4658. }
  4659. if (partol.phone) {
  4660. phone = partol.phone
  4661. }
  4662. if (partol.relation) {
  4663. relation = partol.relation
  4664. }
  4665. if (partol.relationExt) {
  4666. relationExt = partol.relationExt
  4667. }
  4668. if (partol.visit) {
  4669. visit = partol.visit;
  4670. }
  4671. if (partol.isHasGoOut) {
  4672. isHasGoOut = partol.isHasGoOut;
  4673. }
  4674. if (partol.outgoingCause) {
  4675. outgoingCause = partol.outgoingCause;
  4676. }
  4677. if (partol.outgoingTime) {
  4678. outgoingTime = partol.outgoingTime;
  4679. }
  4680. if (partol.isHasPartner) {
  4681. isHasPartner = partol.isHasPartner;
  4682. }
  4683. if (partol.outgoingplace) {
  4684. outgoingplace = partol.outgoingplace;
  4685. }
  4686. if (partol.name2) {
  4687. name2 = partol.name2;
  4688. }
  4689. if (partol.phone2) {
  4690. phone2 = partol.phone2;
  4691. }
  4692. } else if (item.otherInfo == '') {
  4693. otherInfo = '否'
  4694. } else {
  4695. otherInfo = ''
  4696. }
  4697. return {
  4698. ...item,
  4699. isHasOther: otherInfo, //赡养人存在
  4700. // name: name,
  4701. // othersyrSexArr: sex,
  4702. // phone: phone,
  4703. // othersyrRelationValue: othersyrRelationValue,
  4704. // relationExt: relationExt,
  4705. // visit: visit,
  4706. Info: {
  4707. name: name,
  4708. phone: phone,
  4709. relation: relation,
  4710. relationExt: relationExt,
  4711. isHasGoOut: isHasGoOut,
  4712. outgoingCause: outgoingCause,
  4713. outgoingTime: outgoingTime,
  4714. isHasPartner: isHasPartner,
  4715. outgoingplace: outgoingplace,
  4716. visit: visit,
  4717. name2: name2,
  4718. phone2: phone2,
  4719. othersyrSexArr: sex
  4720. }
  4721. }
  4722. })
  4723. let ghi = datass.map(item => {
  4724. // console.log(item, "8888888888888888888888888888888888888888888888888888");
  4725. let childrenNum = '';
  4726. if (item.childrenNum) {
  4727. if (item.childrenNum == '4') {
  4728. childrenNum = '3个以上'
  4729. } else {
  4730. childrenNum = item.childrenNum + '个'
  4731. }
  4732. } else {
  4733. childrenNum = ''
  4734. }
  4735. let Info = [];
  4736. if (item.childInfo) {
  4737. let partol = this.removeExcess(item.childInfo);
  4738. Info = partol
  4739. } else {
  4740. if (parseInt(childrenNum) == 5) {
  4741. for (let i = 0; i < parseInt(childrenNum) - 1; i++) {
  4742. let chlidInfos = {
  4743. name: '', // 姓名
  4744. sex: '',
  4745. phone: '', // 常用联系电话,
  4746. isHasGoOut: '', // 子女是否外出
  4747. outgoingplace: '', // 外出地点
  4748. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  4749. name2: '', // 子女配偶姓名
  4750. phone2: '', // 子女配偶电话
  4751. outgoingTime: '', // 最后一次离家时间
  4752. outgoingCause: '', // 外出原因
  4753. visit: '', // 平均一年探望次数
  4754. }
  4755. Info.push(chlidInfos)
  4756. }
  4757. } else {
  4758. for (let i = 0; i < parseInt(childrenNum); i++) {
  4759. let chlidInfos = {
  4760. name: '', // 姓名
  4761. sex: '',
  4762. phone: '', // 常用联系电话,
  4763. isHasGoOut: '', // 子女是否外出
  4764. outgoingplace: '', // 外出地点
  4765. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  4766. name2: '', // 子女配偶姓名
  4767. phone2: '', // 子女配偶电话
  4768. outgoingTime: '', // 最后一次离家时间
  4769. outgoingCause: '', // 外出原因
  4770. visit: '', // 平均一年探望次数
  4771. }
  4772. Info.push(chlidInfos)
  4773. }
  4774. }
  4775. }
  4776. return {
  4777. ...item,
  4778. childrenNum: childrenNum,
  4779. Info: Info
  4780. }
  4781. })
  4782. let zzz = datass.map(item => {
  4783. let visitModeExt = ''
  4784. let visitCountExt = ''
  4785. let visitMode = [{
  4786. name: '电话问候',
  4787. checked: false
  4788. }, {
  4789. name: '上门巡访',
  4790. checked: false
  4791. }, {
  4792. name: '其它',
  4793. checked: false
  4794. }]
  4795. let visitCounts = [{
  4796. name: '每天',
  4797. checked: false
  4798. }, {
  4799. name: '每周',
  4800. checked: false
  4801. }, {
  4802. name: '每月',
  4803. checked: false
  4804. },
  4805. {
  4806. name: '每季',
  4807. checked: false
  4808. },
  4809. {
  4810. name: '其它',
  4811. checked: false
  4812. }
  4813. ];
  4814. if (item.regularsInfo) {
  4815. let partol = this.removeExcess(item.regularsInfo);
  4816. let partols = this.removeExcess(partol.visitMode);
  4817. if (partol.visitMode) {
  4818. visitMode.forEach(items => {
  4819. partols.forEach(itemss => {
  4820. if (items.name == itemss) {
  4821. items.checked = true;
  4822. }
  4823. })
  4824. })
  4825. }
  4826. if (partol.visitCount) {
  4827. visitCounts.forEach(items => {
  4828. if (items.name == partol.visitCount) {
  4829. items.checked = true;
  4830. }
  4831. })
  4832. }
  4833. if (partol.visitCountExt) {
  4834. visitCountExt = partol.visitCountExt;
  4835. }
  4836. if (partol.visitModeExt) {
  4837. visitModeExt = partol.visitModeExt;
  4838. }
  4839. }
  4840. return {
  4841. ...item,
  4842. visitCountExt: visitCountExt,
  4843. visitModeExt: visitModeExt,
  4844. visitMode: visitMode,
  4845. visitCount: visitCounts,
  4846. }
  4847. })
  4848. let mmm = datass.map(item => {
  4849. if (item.regularsInfo) {
  4850. let partol = this.removeExcess(item.regularsInfo);
  4851. let partols = this.removeExcess(partol.visitMode);
  4852. console.log(partol, "111111111111111111111");
  4853. console.log(partols, "99999999999999999999");
  4854. return {
  4855. visitCount: partol.visitCount,
  4856. visitCountExt: partol.visitCountExt,
  4857. visitMode: partols,
  4858. visitModeExt: partol.visitModeExt,
  4859. }
  4860. }
  4861. })
  4862. console.log(mmm,"mmmmmmmmmmmmmm");
  4863. that.setData({
  4864. oldInfo: abc,
  4865. otherInfo: def,
  4866. childInfo: ghi,
  4867. regularsInfos: zzz,
  4868. regularsInfo: mmm
  4869. })
  4870. console.log(that.data.oldInfo, "老人的返现数组")
  4871. console.log(that.data.otherInfo, "其他的返现数组")
  4872. console.log(that.data.childInfo, "孩子的返现数组")
  4873. console.log(that.data.regularsInfos, "q巡访的返现数组")
  4874. }
  4875. })
  4876. } else {
  4877. }
  4878. },
  4879. })