collectInfo.js 151 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935
  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. let address = 'oldInfo[' + this.data.activeIndex + '].address'
  1271. console.log(this.data.oldInfo[this.data.activeIndex].nativePlaceExt, "打印下这个");
  1272. if (e.detail.value[0] == '现居地址与户籍地址一致') {
  1273. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 5) {
  1274. let nativePlaceId = '';
  1275. let nativePlace = '';
  1276. for (let value of this.data.oldInfo[this.data.activeIndex].chooseAdressArr) {
  1277. nativePlace += value.CIVILREGIONALISMNAME + '/'
  1278. nativePlaceId += value.CIVILREGIONALISMID + ','
  1279. console.log(value, "打印下");
  1280. }
  1281. this.SubmitOldmanInfo({
  1282. id: this.data.nameArr[this.data.activeIndex]._id,
  1283. address: nativePlace.substring(0, nativePlace.length - 1),
  1284. addressId: nativePlaceId.substring(0, nativePlaceId.length - 1),
  1285. })
  1286. }
  1287. this.SubmitOldmanInfo({
  1288. id: this.data.nameArr[this.data.activeIndex]._id,
  1289. isSameWithAddress: '是',
  1290. addressExt: this.data.oldInfo[this.data.activeIndex].nativePlaceExt,
  1291. })
  1292. this.setData({
  1293. [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr,
  1294. [Infos]: this.data.oldInfo[this.data.activeIndex].nativePlaceExt,
  1295. })
  1296. } else {
  1297. this.SubmitOldmanInfo({
  1298. id: this.data.nameArr[this.data.activeIndex]._id,
  1299. isSameWithAddress: '否',
  1300. addressExt: '',
  1301. })
  1302. this.setData({
  1303. [Info]: null,
  1304. [Infos]: '',
  1305. })
  1306. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1)
  1307. }
  1308. },
  1309. // 补充现居住地址
  1310. tab1Change7(e) {
  1311. console.log(e.detail.value)
  1312. let Info = 'oldInfo[' + this.data.activeIndex + '].addressExt'
  1313. this.setData({
  1314. [Info]: e.detail.value
  1315. })
  1316. this.SubmitOldmanInfo({
  1317. id: this.data.nameArr[this.data.activeIndex]._id,
  1318. addressExt: e.detail.value
  1319. })
  1320. },
  1321. // 婚姻以及配偶情况
  1322. tab1Change8: function (e) {
  1323. console.log(e.detail.value)
  1324. if (e.detail.value == '已婚') {
  1325. this.setData({
  1326. oldisMarry: true
  1327. })
  1328. } else {
  1329. this.setData({
  1330. oldisMarry: false,
  1331. oldisMarryName: false,
  1332. oldisMarryPhone: false
  1333. })
  1334. }
  1335. let data = this.data.oldInfo[this.data.activeIndex].oldMarry.map(v => {
  1336. if (v.name == e.detail.value) {
  1337. console.log("我选了")
  1338. return {
  1339. name: v.name,
  1340. checked: true
  1341. }
  1342. }
  1343. return {
  1344. name: v.name,
  1345. checked: false
  1346. }
  1347. })
  1348. console.log(data)
  1349. let oldMarry = 'oldInfo[' + this.data.activeIndex + '].oldMarry'
  1350. this.setData({
  1351. [oldMarry]: data
  1352. })
  1353. console.log(this.data.oldInfo)
  1354. this.SubmitOldmanInfo({
  1355. id: this.data.nameArr[this.data.activeIndex]._id,
  1356. partnerState: e.detail.value
  1357. })
  1358. },
  1359. //配偶的姓名
  1360. tab1Change8_1(e) {
  1361. if (e.detail.value == '' || e.detail.value == null) {
  1362. this.setData({
  1363. oldisMarryName: true
  1364. })
  1365. return
  1366. } else {
  1367. this.setData({
  1368. oldisMarryName: false
  1369. })
  1370. }
  1371. let partnerName = 'oldInfo[' + this.data.activeIndex + '].partnerName'
  1372. this.setData({
  1373. [partnerName]: e.detail.value
  1374. })
  1375. this.SubmitOldmanInfo({
  1376. id: this.data.nameArr[this.data.activeIndex]._id,
  1377. partnerName: e.detail.value
  1378. })
  1379. },
  1380. //配偶身份证号
  1381. tab1Change8_2(e) {
  1382. if (e.detail.value == '' || e.detail.value == null) {
  1383. this.setData({
  1384. oldisMarryPhone: true
  1385. })
  1386. return
  1387. } else {
  1388. this.setData({
  1389. oldisMarryPhone: false
  1390. })
  1391. }
  1392. if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(e.detail.value)) && e.detail.value.length != 18) {
  1393. this.setData({
  1394. oldisMarryPhoneGs: true
  1395. })
  1396. return
  1397. } else {
  1398. let partnerIdNumber = 'oldInfo[' + this.data.activeIndex + '].partnerIdNumber'
  1399. this.setData({
  1400. oldisMarryPhoneGs: false,
  1401. [partnerIdNumber]: e.detail.value
  1402. })
  1403. this.SubmitOldmanInfo({
  1404. id: this.data.nameArr[this.data.activeIndex]._id,
  1405. partnerIdNumber: e.detail.value
  1406. })
  1407. }
  1408. },
  1409. //老人健康状况
  1410. tab1Change9: function (e) {
  1411. console.log(e.detail.value)
  1412. const items = this.data.oldInfo[this.data.activeIndex].healthAyy
  1413. const values = e.detail.value
  1414. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1415. items[i].checked = false
  1416. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1417. if (items[i].name === values[j]) {
  1418. items[i].checked = true
  1419. break
  1420. }
  1421. }
  1422. }
  1423. let healthAyy = 'oldInfo[' + this.data.activeIndex + '].healthAyy'
  1424. this.setData({
  1425. [healthAyy]: items
  1426. })
  1427. console.log(this.data.oldInfo)
  1428. let revise1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].disabled'
  1429. let revise2 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[2].disabled'
  1430. let revise3 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[3].disabled'
  1431. let rev1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].checked'
  1432. let rev2 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[2].checked'
  1433. let rev3 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[3].checked'
  1434. if (e.detail.value.length == 0) {
  1435. this.setData({
  1436. oldHealth1: true,
  1437. [revise1]: false,
  1438. [revise2]: false,
  1439. [revise3]: false,
  1440. })
  1441. return
  1442. } else {
  1443. this.setData({
  1444. oldHealth1: false
  1445. })
  1446. }
  1447. let index = e.detail.value.indexOf('健康');
  1448. let index1 = e.detail.value.indexOf('残疾');
  1449. let index2 = e.detail.value.indexOf('患重特大疾病');
  1450. if (index >= 0) {
  1451. this.setData({
  1452. [revise1]: true,
  1453. [revise2]: true,
  1454. [revise3]: true,
  1455. [rev1]: false,
  1456. [rev2]: false,
  1457. [rev3]: false
  1458. })
  1459. this.SubmitOldmanInfo({
  1460. id: this.data.nameArr[this.data.activeIndex]._id,
  1461. health: JSON.stringify(['健康'])
  1462. })
  1463. } else {
  1464. this.setData({
  1465. [revise1]: false,
  1466. [revise2]: false,
  1467. [revise3]: false,
  1468. })
  1469. }
  1470. // if (index1 >= 0 && index < 0) {
  1471. // this.setData({
  1472. // oldHealth2: true
  1473. // })
  1474. // } else {
  1475. // this.setData({
  1476. // oldHealth2: false,
  1477. // oldDisableType: false,
  1478. // issickTypeNull: false
  1479. // })
  1480. // }
  1481. if (index2 >= 0 && index < 0) {
  1482. this.setData({
  1483. isSick: true
  1484. })
  1485. } else {
  1486. this.setData({
  1487. isSick: false,
  1488. oldDisableType: false,
  1489. issickTypeNull: false
  1490. })
  1491. }
  1492. if (index < 0 && e.detail.value.length != 0) {
  1493. this.SubmitOldmanInfo({
  1494. id: this.data.nameArr[this.data.activeIndex]._id,
  1495. health: JSON.stringify(e.detail.value)
  1496. })
  1497. }
  1498. },
  1499. // 残疾类别
  1500. tab1Change10: function (e) {
  1501. console.log(e.detail.value)
  1502. const items = this.data.oldInfo[this.data.activeIndex].disabilityAyy
  1503. const values = e.detail.value
  1504. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1505. items[i].checked = false
  1506. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1507. if (items[i].name === values[j]) {
  1508. items[i].checked = true
  1509. break
  1510. }
  1511. }
  1512. }
  1513. let disabilityAyy = 'oldInfo[' + this.data.activeIndex + '].disabilityAyy'
  1514. this.setData({
  1515. [disabilityAyy]: items
  1516. })
  1517. if (e.detail.value == null || e.detail.value == '') {
  1518. this.setData({
  1519. oldDisableType: true
  1520. })
  1521. return
  1522. } else {
  1523. this.setData({
  1524. oldDisableType: false
  1525. })
  1526. }
  1527. this.SubmitOldmanInfo({
  1528. id: this.data.nameArr[this.data.activeIndex]._id,
  1529. disabilityCategory: JSON.stringify(e.detail.value)
  1530. })
  1531. },
  1532. // 重特大疾病类别
  1533. tab1Change10_1: function (e) {
  1534. console.log(e.detail.value)
  1535. const items = this.data.oldInfo[this.data.activeIndex].sickType
  1536. const values = e.detail.value
  1537. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1538. items[i].checked = false
  1539. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1540. if (items[i].name === values[j]) {
  1541. items[i].checked = true
  1542. break
  1543. }
  1544. }
  1545. }
  1546. let sickType = 'oldInfo[' + this.data.activeIndex + '].sickType'
  1547. this.setData({
  1548. [sickType]: items
  1549. })
  1550. console.log(this.data.sickType)
  1551. if (e.detail.value.length == 0) {
  1552. this.setData({
  1553. issickTypeNull: true
  1554. })
  1555. return
  1556. } else {
  1557. this.setData({
  1558. issickTypeNull: false
  1559. })
  1560. }
  1561. this.SubmitOldmanInfo({
  1562. id: this.data.nameArr[this.data.activeIndex]._id,
  1563. majorDiseases: JSON.stringify(e.detail.value)
  1564. })
  1565. },
  1566. // 残疾人等级
  1567. tab1Change11: function (e) {
  1568. // this.setData({
  1569. // levalIndex: e.detail.value
  1570. // })
  1571. let disabilityLevel = 'oldInfo[' + this.data.activeIndex + '].disabilityLevel'
  1572. this.setData({
  1573. [disabilityLevel]: this.data.disableLeval[e.detail.value]
  1574. })
  1575. this.SubmitOldmanInfo({
  1576. id: this.data.nameArr[this.data.activeIndex]._id,
  1577. disabilityLevel: this.data.oldInfo[this.data.activeIndex].disabilityLevel
  1578. })
  1579. },
  1580. // 老年人能力情况
  1581. tab1Change12: function (e) {
  1582. let ability = 'oldInfo[' + this.data.activeIndex + '].ability'
  1583. let Info = 'oldInfo[' + this.data.activeIndex + '].oldType'
  1584. this.setData({
  1585. [ability]: this.data.ableStatus[e.detail.value]
  1586. })
  1587. if (e.detail.value == 2) {
  1588. this.setData({
  1589. [Info]: this.data.oldInfo[this.data.activeIndex].oldType.concat({
  1590. name: "失能老人",
  1591. disable: true,
  1592. checked: true
  1593. })
  1594. })
  1595. }
  1596. this.SubmitOldmanInfo({
  1597. id: this.data.nameArr[this.data.activeIndex]._id,
  1598. ability: this.data.disableLeval[e.detail.value]
  1599. })
  1600. },
  1601. // 生活经济情况
  1602. tab1Change13: function (e) {
  1603. let livingCondition = 'oldInfo[' + this.data.activeIndex + '].livingCondition'
  1604. this.setData({
  1605. [livingCondition]: this.data.moneyStatus[e.detail.value]
  1606. })
  1607. this.SubmitOldmanInfo({
  1608. id: this.data.nameArr[this.data.activeIndex]._id,
  1609. livingCondition: this.data.moneyStatus[e.detail.value]
  1610. })
  1611. },
  1612. // 收入来源
  1613. tab1Change14: function (e) {
  1614. console.log(e.detail.value)
  1615. const items = this.data.oldInfo[this.data.activeIndex].moneyFromAyy
  1616. const values = e.detail.value
  1617. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1618. items[i].checked = false
  1619. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1620. if (items[i].name === values[j]) {
  1621. items[i].checked = true
  1622. break
  1623. }
  1624. }
  1625. }
  1626. let moneyFromAyy = 'oldInfo[' + this.data.activeIndex + '].moneyFromAyy'
  1627. this.setData({
  1628. [moneyFromAyy]: items
  1629. })
  1630. if (e.detail.value.length == 0) {
  1631. this.setData({
  1632. moneyFromOther: true
  1633. })
  1634. return
  1635. } else {
  1636. this.setData({
  1637. moneyFromOther: false
  1638. })
  1639. }
  1640. this.SubmitOldmanInfo({
  1641. id: this.data.nameArr[this.data.activeIndex]._id,
  1642. sourceOfIncome: JSON.stringify(e.detail.value)
  1643. })
  1644. },
  1645. // 其他收入来源sourceOfIncomeExt
  1646. tab1Change14_1: function (e) {
  1647. if (e.detail.value == null || e.detail.value == '') {
  1648. this.setData({
  1649. moneyOtherQtnull: true
  1650. })
  1651. } else {
  1652. this.setData({
  1653. moneyOtherQtnull: false
  1654. })
  1655. this.SubmitOldmanInfo({
  1656. id: this.data.nameArr[this.data.activeIndex]._id,
  1657. sourceOfIncomeExt: e.detail.value
  1658. })
  1659. }
  1660. },
  1661. // 本人上年度可支配收入
  1662. tab1Change15: function (e) {
  1663. let income = 'oldInfo[' + this.data.activeIndex + '].income'
  1664. this.setData({
  1665. [income]: this.data.payMoney[e.detail.value]
  1666. })
  1667. this.SubmitOldmanInfo({
  1668. id: this.data.nameArr[this.data.activeIndex]._id,
  1669. income: this.data.payMoney[e.detail.value]
  1670. })
  1671. },
  1672. // 家庭救助帮扶情况
  1673. tab1Change16: function (e) {
  1674. console.log(e.detail.value)
  1675. const items = this.data.oldInfo[this.data.activeIndex].familyHelpArr
  1676. const values = e.detail.value
  1677. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1678. items[i].checked = false
  1679. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1680. if (items[i].name === values[j]) {
  1681. items[i].checked = true
  1682. break
  1683. }
  1684. }
  1685. }
  1686. let familyHelpArr = 'oldInfo[' + this.data.activeIndex + '].familyHelpArr'
  1687. this.setData({
  1688. [familyHelpArr]: items
  1689. })
  1690. if (e.detail.value.length == 0) {
  1691. this.setData({
  1692. familyHelp: true
  1693. })
  1694. return
  1695. } else {
  1696. this.setData({
  1697. familyHelp: false
  1698. })
  1699. }
  1700. this.SubmitOldmanInfo({
  1701. id: this.data.nameArr[this.data.activeIndex]._id,
  1702. rescueState: JSON.stringify(e.detail.value)
  1703. })
  1704. },
  1705. // 其他救助帮扶情况
  1706. tab1Change16_1: function (e) {
  1707. if (e.detail.value == null || e.detail.value == '') {
  1708. this.setData({
  1709. otherhelpQtnull: true
  1710. })
  1711. } else {
  1712. this.setData({
  1713. otherhelpQtnull: false
  1714. })
  1715. let rescueStateExt = 'oldInfo[' + this.data.activeIndex + '].rescueStateExt'
  1716. this.setData({
  1717. [rescueStateExt]: e.detail.value
  1718. })
  1719. this.SubmitOldmanInfo({
  1720. id: this.data.nameArr[this.data.activeIndex]._id,
  1721. rescueStateExt: e.detail.value
  1722. })
  1723. }
  1724. },
  1725. // 是否为失独家庭
  1726. tab1Change17: function (e) {
  1727. console.log(e.detail.value)
  1728. let data = this.data.oldInfo[this.data.activeIndex].loneArr.map(v => {
  1729. if (v.name == e.detail.value) {
  1730. return {
  1731. name: v.name,
  1732. checked: true
  1733. }
  1734. }
  1735. return {
  1736. name: v.name,
  1737. checked: false
  1738. }
  1739. })
  1740. let loneArr = 'oldInfo[' + this.data.activeIndex + '].loneArr'
  1741. this.setData({
  1742. [loneArr]: data
  1743. })
  1744. this.SubmitOldmanInfo({
  1745. id: this.data.nameArr[this.data.activeIndex]._id,
  1746. isLoss: e.detail.value
  1747. })
  1748. },
  1749. // 陪伴居住情况
  1750. tab1Change18: function (e) {
  1751. console.log(e.detail.value)
  1752. const items = this.data.oldInfo[this.data.activeIndex].liveStatus
  1753. const values = e.detail.value
  1754. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1755. items[i].checked = false
  1756. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1757. if (items[i].name === values[j]) {
  1758. items[i].checked = true
  1759. break
  1760. }
  1761. }
  1762. }
  1763. let liveStatus = 'oldInfo[' + this.data.activeIndex + '].liveStatus'
  1764. this.setData({
  1765. [liveStatus]: items
  1766. })
  1767. let revise1 = "oldInfo[" + this.data.activeIndex + "].liveStatus[1].disabled";
  1768. let revise2 = "oldInfo[" + this.data.activeIndex + "].liveStatus[2].disabled";
  1769. let revise3 = "oldInfo[" + this.data.activeIndex + "].liveStatus[3].disabled";
  1770. let revise4 = "oldInfo[" + this.data.activeIndex + "].liveStatus[4].disabled";
  1771. let rev1 = "oldInfo[" + this.data.activeIndex + "].liveStatus[1].checked";
  1772. let rev2 = "oldInfo[" + this.data.activeIndex + "].liveStatus[2].checked";
  1773. let rev3 = "oldInfo[" + this.data.activeIndex + "].liveStatus[3].checked";
  1774. let rev4 = "oldInfo[" + this.data.activeIndex + "].liveStatus[4].checked";
  1775. if (e.detail.value.length == 0) {
  1776. this.setData({
  1777. isliveNull: true
  1778. })
  1779. } else {
  1780. this.setData({
  1781. isliveNull: false
  1782. })
  1783. }
  1784. let index = e.detail.value.indexOf('无人陪伴居住');
  1785. if (index >= 0) {
  1786. console.log('有无人陪伴居住')
  1787. this.setData({
  1788. [revise1]: true,
  1789. [revise2]: true,
  1790. [revise3]: true,
  1791. [revise4]: true,
  1792. [rev1]: false,
  1793. [rev2]: false,
  1794. [rev3]: false,
  1795. [rev4]: false,
  1796. })
  1797. this.SubmitOldmanInfo({
  1798. id: this.data.nameArr[this.data.activeIndex]._id,
  1799. accompany: JSON.stringify(['无人陪伴居住'])
  1800. })
  1801. console.log(this.data.oldInfo[this.data.activeIndex].liveStatus)
  1802. } else {
  1803. this.setData({
  1804. [revise1]: false,
  1805. [revise2]: false,
  1806. [revise3]: false,
  1807. [revise4]: false
  1808. })
  1809. }
  1810. if (index < 0 && e.detail.value.length != 0) {
  1811. this.SubmitOldmanInfo({
  1812. id: this.data.nameArr[this.data.activeIndex]._id,
  1813. accompany: JSON.stringify(e.detail.value)
  1814. })
  1815. }
  1816. },
  1817. // 其他陪伴居住情况
  1818. tab1Change18_1: function (e) {
  1819. if (e.detail.value == null || e.detail.value == '') {
  1820. this.setData({
  1821. isliveQtNull: true
  1822. })
  1823. } else {
  1824. this.setData({
  1825. isliveQtNull: false
  1826. })
  1827. let accompanyExt = 'oldInfo[' + this.data.activeIndex + '].accompanyExt'
  1828. this.setData({
  1829. [accompanyExt]: e.detail.value
  1830. })
  1831. this.SubmitOldmanInfo({
  1832. id: this.data.nameArr[this.data.activeIndex]._id,
  1833. accompanyExt: e.detail.value
  1834. })
  1835. }
  1836. },
  1837. // 日常生活照料人
  1838. tab1Change19: function (e) {
  1839. console.log(e.detail.value)
  1840. const items = this.data.oldInfo[this.data.activeIndex].oftenMan
  1841. const values = e.detail.value
  1842. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1843. items[i].checked = false
  1844. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1845. if (items[i].name === values[j]) {
  1846. items[i].checked = true
  1847. break
  1848. }
  1849. }
  1850. }
  1851. let oftenMan = 'oldInfo[' + this.data.activeIndex + '].oftenMan'
  1852. this.setData({
  1853. [oftenMan]: items
  1854. })
  1855. let revise1 = "oldInfo[" + this.data.activeIndex + "].oftenMan[1].disabled";
  1856. let revise2 = "oldInfo[" + this.data.activeIndex + "].oftenMan[2].disabled";
  1857. let revise3 = "oldInfo[" + this.data.activeIndex + "].oftenMan[3].disabled";
  1858. let revise4 = "oldInfo[" + this.data.activeIndex + "].oftenMan[4].disabled";
  1859. let revise5 = "oldInfo[" + this.data.activeIndex + "].oftenMan[5].disabled";
  1860. let rev1 = "oldInfo[" + this.data.activeIndex + "].oftenMan[1].checked";
  1861. let rev2 = "oldInfo[" + this.data.activeIndex + "].oftenMan[2].checked";
  1862. let rev3 = "oldInfo[" + this.data.activeIndex + "].oftenMan[3].checked";
  1863. let rev4 = "oldInfo[" + this.data.activeIndex + "].oftenMan[4].checked";
  1864. let rev5 = "oldInfo[" + this.data.activeIndex + "].oftenMan[5].checked";
  1865. if (e.detail.value.length == 0) {
  1866. this.setData({
  1867. isoftenManNull: true
  1868. })
  1869. } else {
  1870. this.setData({
  1871. isoftenManNull: false
  1872. })
  1873. }
  1874. let index = e.detail.value.indexOf('无人照料');
  1875. if (index >= 0) {
  1876. this.setData({
  1877. [revise1]: true,
  1878. [revise2]: true,
  1879. [revise3]: true,
  1880. [revise4]: true,
  1881. [revise5]: true,
  1882. [rev1]: false,
  1883. [rev2]: false,
  1884. [rev3]: false,
  1885. [rev4]: false,
  1886. [rev5]: false,
  1887. })
  1888. this.SubmitOldmanInfo({
  1889. id: this.data.nameArr[this.data.activeIndex]._id,
  1890. lookAfter: JSON.stringify(['无人照料'])
  1891. })
  1892. } else {
  1893. this.setData({
  1894. [revise1]: false,
  1895. [revise2]: false,
  1896. [revise3]: false,
  1897. [revise4]: false,
  1898. [revise5]: false
  1899. })
  1900. }
  1901. if (index < 0 && e.detail.value.length != 0) {
  1902. // this.setData({
  1903. // ofenmanDetail: true
  1904. // })
  1905. this.SubmitOldmanInfo({
  1906. id: this.data.nameArr[this.data.activeIndex]._id,
  1907. lookAfter: JSON.stringify(e.detail.value)
  1908. })
  1909. }
  1910. // else {
  1911. // this.setData({
  1912. // ofenmanDetail: false
  1913. // })
  1914. // }
  1915. },
  1916. // 其他人员关系
  1917. tab1Change20: function (e) {
  1918. if (e.detail.value == null || e.detail.value == '') {
  1919. this.setData({
  1920. isoftenReaNull: true
  1921. })
  1922. } else {
  1923. this.setData({
  1924. isoftenReaNull: false
  1925. })
  1926. let lookAfterExt = 'oldInfo[' + this.data.activeIndex + '].lookAfterExt'
  1927. this.setData({
  1928. [lookAfterExt]: e.detail.value
  1929. })
  1930. this.SubmitOldmanInfo({
  1931. id: this.data.nameArr[this.data.activeIndex]._id,
  1932. lookAfterExt: e.detail.value
  1933. })
  1934. }
  1935. },
  1936. // 主要照料人姓名
  1937. tab1Change21: function (e) {
  1938. if (e.detail.value == null || e.detail.value == '') {
  1939. this.setData({
  1940. lookAfterName: true
  1941. })
  1942. } else {
  1943. this.setData({
  1944. lookAfterName: false
  1945. })
  1946. let mainLookName = 'oldInfo[' + this.data.activeIndex + '].mainLookName'
  1947. this.setData({
  1948. [mainLookName]: e.detail.value
  1949. })
  1950. this.SubmitOldmanInfo({
  1951. id: this.data.nameArr[this.data.activeIndex]._id,
  1952. mainLookName: e.detail.value
  1953. })
  1954. }
  1955. },
  1956. // 主要照料人性别
  1957. tab1Change22: function (e) {
  1958. console.log(e.detail.value)
  1959. let data = this.data.oldInfo[this.data.activeIndex].mainLookSex.map(v => {
  1960. if (v.name == e.detail.value) {
  1961. return {
  1962. name: v.name,
  1963. checked: true
  1964. }
  1965. }
  1966. return {
  1967. name: v.name,
  1968. checked: false
  1969. }
  1970. })
  1971. let mainLookSex = 'oldInfo[' + this.data.activeIndex + '].mainLookSex'
  1972. this.setData({
  1973. [mainLookSex]: data
  1974. })
  1975. this.SubmitOldmanInfo({
  1976. id: this.data.nameArr[this.data.activeIndex]._id,
  1977. mainLookSex: e.detail.value
  1978. })
  1979. },
  1980. // 主要照料人电话
  1981. tab1Change23: function (e) {
  1982. if (e.detail.value == '' || e.detail.value == null) {
  1983. this.setData({
  1984. islookPhoneNull: true
  1985. })
  1986. } else {
  1987. this.setData({
  1988. islookPhoneNull: false
  1989. })
  1990. let mainLookPhone = 'oldInfo[' + this.data.activeIndex + '].mainLookPhone'
  1991. this.setData({
  1992. [mainLookPhone]: e.detail.value
  1993. })
  1994. this.SubmitOldmanInfo({
  1995. id: this.data.nameArr[this.data.activeIndex]._id,
  1996. mainLookPhone: e.detail.value
  1997. })
  1998. }
  1999. },
  2000. // 关爱服务需求
  2001. tab1Change24: function (e) {
  2002. console.log(e.detail.value)
  2003. const items = this.data.oldInfo[this.data.activeIndex].loveRequire
  2004. const values = e.detail.value
  2005. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  2006. items[i].checked = false
  2007. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  2008. if (items[i].name === values[j]) {
  2009. items[i].checked = true
  2010. break
  2011. }
  2012. }
  2013. }
  2014. let loveRequire = 'oldInfo[' + this.data.activeIndex + '].loveRequire'
  2015. this.setData({
  2016. [loveRequire]: items
  2017. })
  2018. if (e.detail.value == '' || e.detail.value == null) {
  2019. this.setData({
  2020. isloveNull: true
  2021. })
  2022. } else {
  2023. this.setData({
  2024. isloveNull: false
  2025. })
  2026. this.SubmitOldmanInfo({
  2027. id: this.data.nameArr[this.data.activeIndex]._id,
  2028. demand: JSON.stringify(e.detail.value)
  2029. })
  2030. }
  2031. },
  2032. tab1change25: function (e) {
  2033. if (e.detail.value == null || e.detail.value == '') {
  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. demandExt: e.detail.value
  2044. })
  2045. }
  2046. },
  2047. // 老年人类别
  2048. tab1Change26: function (e) {
  2049. console.log(e.detail.value)
  2050. if (e.detail.value == '' || e.detail.value == null) {
  2051. this.setData({
  2052. isoldtypeNull: true
  2053. })
  2054. } else {
  2055. this.setData({
  2056. isoldtypeNull: false,
  2057. })
  2058. }
  2059. let index1 = e.detail.value.indexOf('农村留守老年人')
  2060. let index2 = e.detail.value.indexOf('分散供养特困老年人')
  2061. let index3 = e.detail.value.indexOf('计划生育特殊家庭老人')
  2062. let index4 = e.detail.value.indexOf('空巢老年人')
  2063. // let revise1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].disabled'
  2064. let revise1 = "oldInfo[" + this.data.activeIndex + "].oldType[0].disable";
  2065. let revise2 = "oldInfo[" + this.data.activeIndex + "].oldType[1].disable";
  2066. let revise3 = "oldInfo[" + this.data.activeIndex + "].oldType[2].disable";
  2067. let revise4 = "oldInfo[" + this.data.activeIndex + "].oldType[3].disable";
  2068. let revise5 = "oldInfo[" + this.data.activeIndex + "].oldType[3].checked";
  2069. this.SubmitOldmanInfo({
  2070. id: this.data.nameArr[this.data.activeIndex]._id,
  2071. oldType: JSON.stringify(e.detail.value)
  2072. })
  2073. // if (index1 >= 0) {
  2074. // this.setData({
  2075. // [revise2]: true,
  2076. // [revise3]: true,
  2077. // [revise4]: true,
  2078. // [revise5]: true
  2079. // })
  2080. // return false;
  2081. // } else {
  2082. // console.log("反選的");
  2083. // this.setData({
  2084. // // [revise1]: false,
  2085. // [revise2]: false,
  2086. // [revise3]: false,
  2087. // [revise4]: false,
  2088. // [revise5]: false
  2089. // })
  2090. // index4 = -1;
  2091. // }
  2092. if (index2 >= 0) {
  2093. this.setData({
  2094. [revise1]: true,
  2095. [revise3]: true,
  2096. [revise4]: true
  2097. })
  2098. return false;
  2099. } else {
  2100. this.setData({
  2101. [revise1]: false,
  2102. [revise3]: false,
  2103. [revise4]: false
  2104. })
  2105. }
  2106. if (index3 >= 0) {
  2107. this.setData({
  2108. [revise1]: true,
  2109. [revise2]: true,
  2110. [revise4]: true
  2111. })
  2112. return false;
  2113. } else {
  2114. this.setData({
  2115. [revise1]: false,
  2116. [revise2]: false,
  2117. [revise4]: false
  2118. })
  2119. }
  2120. // if (index4 >= 0) {
  2121. // this.setData({
  2122. // [revise1]: true,
  2123. // [revise2]: true,
  2124. // [revise3]: true
  2125. // })
  2126. // return false;
  2127. // } else {
  2128. // this.setData({
  2129. // [revise1]: false,
  2130. // [revise2]: false,
  2131. // [revise3]: false
  2132. // })
  2133. // }
  2134. if (index1 >= 0) {
  2135. this.setData({
  2136. [revise2]: true,
  2137. [revise3]: true,
  2138. [revise4]: true,
  2139. [revise5]: true
  2140. })
  2141. return false;
  2142. } else if(index4 >= 0){
  2143. this.setData({
  2144. [revise1]: false,
  2145. [revise2]: false,
  2146. [revise3]: false,
  2147. [revise4]: false,
  2148. [revise5]: true
  2149. })
  2150. }else {
  2151. this.setData({
  2152. [revise1]: false,
  2153. [revise2]: false,
  2154. [revise3]: false,
  2155. [revise4]: false,
  2156. })
  2157. }
  2158. },
  2159. goPhoto() {
  2160. let that = this;
  2161. isTwoOnshow = true;
  2162. const app = getApp()
  2163. wx.setStorageSync('isTwoOnshow', true)
  2164. wx.showLoading({
  2165. title: '加载中',
  2166. })
  2167. wx.chooseImage({
  2168. count: 1,
  2169. sizeType: ['compressed'],
  2170. sourceType: ['camera'],
  2171. success: function (res) {
  2172. const app = getApp()
  2173. app.globalData.id = '-1'
  2174. let tempFilePaths = res.tempFilePaths
  2175. wx.uploadFile({
  2176. url: util.globalData.publicUrl + '/sys/user/upload',
  2177. filePath: tempFilePaths[0],
  2178. name: 'uploadFile',
  2179. formData: {
  2180. "user": "test",
  2181. },
  2182. header: {
  2183. appletsId: wx.getStorageSync('openId'),
  2184. },
  2185. success: function (res) {
  2186. const app = getApp()
  2187. app.globalData.id = '-2'
  2188. let datas = JSON.parse(res.data)
  2189. let imgPath = 'oldInfo[' + that.data.activeIndex + '].imgPath'
  2190. let isHavePhoto = 'oldInfo[' + that.data.activeIndex + '].isHavePhoto'
  2191. // if (datas.code == 0) {
  2192. that.setData({
  2193. [imgPath]: datas.data,
  2194. [isHavePhoto]: true,
  2195. })
  2196. that.SubmitOldmanInfo({
  2197. id: that.data.nameArr[that.data.activeIndex]._id,
  2198. photo: datas.data,
  2199. })
  2200. }
  2201. })
  2202. },
  2203. complete: (e) => {
  2204. wx.hideLoading();
  2205. }
  2206. })
  2207. },
  2208. closeImage(e) {
  2209. console.log(e.currentTarget.dataset.activeindex, "121212");
  2210. let imgPath = 'oldInfo[' + e.currentTarget.dataset.activeindex + '].imgPath'
  2211. this.setData({
  2212. [imgPath]: '',
  2213. })
  2214. this.SubmitOldmanInfo({
  2215. id: this.data.nameArr[this.data.activeIndex]._id,
  2216. photo: '',
  2217. })
  2218. },
  2219. // 子女个数
  2220. tab2Change1: function (e) {
  2221. console.log(e.detail.value)
  2222. let childrenNum = 'childInfo[' + this.data.activeIndex + '].childrenNum'
  2223. let Info = 'childInfo[' + this.data.activeIndex + '].Info'
  2224. this.setData({
  2225. [childrenNum]: this.data.childNumArr[e.detail.value],
  2226. })
  2227. if (e.detail.value == 0) {
  2228. this.setData({
  2229. [Info]: []
  2230. })
  2231. this.SubmitOldmanInfo({
  2232. id: this.data.nameArr[this.data.activeIndex]._id,
  2233. childInfo:JSON.stringify([]),
  2234. // childrenNum: this.data.childNums[e.detail.value].substring(0, 1)
  2235. })
  2236. } else if (e.detail.value == 1) {
  2237. this.setData({
  2238. [Info]: [{
  2239. name: '', // 姓名
  2240. sex: '',
  2241. phone: '', // 常用联系电话,
  2242. isHasGoOut: '', // 子女是否外出
  2243. outgoingplace: '', // 外出地点
  2244. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2245. name2: '', // 子女配偶姓名
  2246. phone2: '', // 子女配偶电话
  2247. outgoingTime: '', // 最后一次离家时间
  2248. outgoingCause: '', // 外出原因
  2249. visit: '', // 平均一年探望次数
  2250. }]
  2251. })
  2252. } else if (e.detail.value == 2) {
  2253. this.setData({
  2254. [Info]: [{
  2255. name: '', // 姓名
  2256. sex: '',
  2257. phone: '', // 常用联系电话,
  2258. isHasGoOut: '', // 子女是否外出
  2259. outgoingplace: '', // 外出地点
  2260. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2261. name2: '', // 子女配偶姓名
  2262. phone2: '', // 子女配偶电话
  2263. outgoingTime: '', // 最后一次离家时间
  2264. outgoingCause: '', // 外出原因
  2265. visit: '', // 平均一年探望次数
  2266. }, {
  2267. name: '', // 姓名
  2268. sex: '',
  2269. phone: '', // 常用联系电话,
  2270. isHasGoOut: '', // 子女是否外出
  2271. outgoingplace: '', // 外出地点
  2272. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2273. name2: '', // 子女配偶姓名
  2274. phone2: '', // 子女配偶电话
  2275. outgoingTime: '', // 最后一次离家时间
  2276. outgoingCause: '', // 外出原因
  2277. visit: '', // 平均一年探望次数
  2278. }]
  2279. })
  2280. } else {
  2281. this.setData({
  2282. [Info]: [{
  2283. name: '', // 姓名
  2284. sex: '',
  2285. phone: '', // 常用联系电话,
  2286. isHasGoOut: '', // 子女是否外出
  2287. outgoingplace: '', // 外出地点
  2288. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2289. name2: '', // 子女配偶姓名
  2290. phone2: '', // 子女配偶电话
  2291. outgoingTime: '', // 最后一次离家时间
  2292. outgoingCause: '', // 外出原因
  2293. visit: '', // 平均一年探望次数
  2294. }, {
  2295. name: '', // 姓名
  2296. sex: '',
  2297. phone: '', // 常用联系电话,
  2298. isHasGoOut: '', // 子女是否外出
  2299. outgoingplace: '', // 外出地点
  2300. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2301. name2: '', // 子女配偶姓名
  2302. phone2: '', // 子女配偶电话
  2303. outgoingTime: '', // 最后一次离家时间
  2304. outgoingCause: '', // 外出原因
  2305. visit: '', // 平均一年探望次数
  2306. }, {
  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. })
  2320. }
  2321. this.SubmitOldmanInfo({
  2322. id: this.data.nameArr[this.data.activeIndex]._id,
  2323. childrenNum: e.detail.value
  2324. // childrenNum: this.data.childNums[e.detail.value].substring(0, 1)
  2325. })
  2326. },
  2327. // 子女姓名
  2328. tab2Change2: function (e) {
  2329. let han = /^[\u4e00-\u9fa5]+$/;
  2330. if (!han.test(e.detail.value )) {
  2331. wx.showModal({
  2332. showCancel: false,
  2333. content: '您输入的内容不是汉字哦'
  2334. })
  2335. return false;
  2336. };
  2337. if (e.detail.value .length < 2) {
  2338. wx.showModal({
  2339. showCancel: false,
  2340. content: '赡养人姓名不可以少于两个字哦'
  2341. })
  2342. return false
  2343. }
  2344. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name';
  2345. console.log(this.data.childInfo[this.data.activeIndex].Info, "多个数字的问题");
  2346. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info));
  2347. this.setData({
  2348. [child]: e.detail.value
  2349. })
  2350. this.SubmitOldmanInfo({
  2351. id: this.data.nameArr[this.data.activeIndex]._id,
  2352. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2353. })
  2354. // }
  2355. },
  2356. // 子女性别
  2357. tab2Change3: function (e) {
  2358. console.log(e, '000000000000')
  2359. console.log(e.currentTarget.dataset.index + "@@@@@@@@@@@@@@@@@@@@@@")
  2360. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].sex';
  2361. this.setData({
  2362. [child]: this.data.childSexArr[e.detail.value]
  2363. })
  2364. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info) + "#####################")
  2365. this.SubmitOldmanInfo({
  2366. id: this.data.nameArr[this.data.activeIndex]._id,
  2367. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2368. })
  2369. },
  2370. // 子女联系电话
  2371. tab2Change4: function (e) {
  2372. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].phone';
  2373. this.setData({
  2374. [child]: e.detail.value
  2375. })
  2376. this.SubmitOldmanInfo({
  2377. id: this.data.nameArr[this.data.activeIndex]._id,
  2378. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2379. })
  2380. },
  2381. // 子女是否外出
  2382. tab2Change5: function (e) {
  2383. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].isHasGoOut';
  2384. this.setData({
  2385. [child]: this.data.childIsout[e.detail.value]
  2386. })
  2387. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info) + "#####################")
  2388. this.SubmitOldmanInfo({
  2389. id: this.data.nameArr[this.data.activeIndex]._id,
  2390. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2391. })
  2392. },
  2393. //外出原因
  2394. tab2Change6: function (e) {
  2395. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingCause';
  2396. this.setData({
  2397. [child]: e.detail.value
  2398. })
  2399. this.SubmitOldmanInfo({
  2400. id: this.data.nameArr[this.data.activeIndex]._id,
  2401. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2402. })
  2403. },
  2404. // 外出地点
  2405. tab2Change7: function (e) {
  2406. console.log(e.detail.value)
  2407. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingplace';
  2408. this.setData({
  2409. [child]: e.detail.value
  2410. })
  2411. this.SubmitOldmanInfo({
  2412. id: this.data.nameArr[this.data.activeIndex]._id,
  2413. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2414. })
  2415. },
  2416. // 最后一次离家时间
  2417. tab2Change8: function (e) {
  2418. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingTime';
  2419. this.setData({
  2420. [child]: e.detail.value
  2421. })
  2422. this.SubmitOldmanInfo({
  2423. id: this.data.nameArr[this.data.activeIndex]._id,
  2424. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2425. })
  2426. },
  2427. // 是否有配偶
  2428. tab2Change9: function (e) {
  2429. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].isHasPartner';
  2430. this.setData({
  2431. [child]: this.data.childIsMArry[e.detail.value]
  2432. })
  2433. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info) + "#####################")
  2434. this.SubmitOldmanInfo({
  2435. id: this.data.nameArr[this.data.activeIndex]._id,
  2436. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2437. })
  2438. },
  2439. // 配偶姓名
  2440. tab2Change10: function (e) {
  2441. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name2';
  2442. this.setData({
  2443. [child]: e.detail.value
  2444. })
  2445. this.SubmitOldmanInfo({
  2446. id: this.data.nameArr[this.data.activeIndex]._id,
  2447. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2448. })
  2449. },
  2450. // 配偶联系电话
  2451. tab2Change11: function (e) {
  2452. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].phone2';
  2453. this.setData({
  2454. [child]: e.detail.value
  2455. })
  2456. this.SubmitOldmanInfo({
  2457. id: this.data.nameArr[this.data.activeIndex]._id,
  2458. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2459. })
  2460. },
  2461. // 一年探望次数
  2462. tab2Change12: function (e) {
  2463. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].visit';
  2464. this.setData({
  2465. [child]: this.data.childTfTimes[e.detail.value]
  2466. })
  2467. console.log(JSON.stringify(this.data.childInfo[this.data.activeIndex].Info) + "#####################")
  2468. this.SubmitOldmanInfo({
  2469. id: this.data.nameArr[this.data.activeIndex]._id,
  2470. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2471. })
  2472. },
  2473. // tab3是否有赡养人状态改变
  2474. tab3Change1: function (e) {
  2475. // 否是1
  2476. console.log(e.detail.value, "1111111");
  2477. let isHasOther = 'otherInfo[' + this.data.activeIndex + '].isHasOther'
  2478. if (e.detail.value == '0') {
  2479. this.setData({
  2480. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2481. })
  2482. console.log("1111111");
  2483. this.SubmitOldmanInfo({
  2484. id: this.data.nameArr[this.data.activeIndex]._id,
  2485. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2486. })
  2487. } else {
  2488. this.setData({
  2489. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2490. })
  2491. this.SubmitOldmanInfo({
  2492. id: this.data.nameArr[this.data.activeIndex]._id,
  2493. otherInfo: ''
  2494. })
  2495. }
  2496. this.setData({
  2497. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2498. })
  2499. },
  2500. // 其他赡养人姓名
  2501. tab3Change2: function (e) {
  2502. let han = /^[\u4e00-\u9fa5]+$/;
  2503. if (!han.test(e.detail.value )) {
  2504. wx.showModal({
  2505. showCancel: false,
  2506. content: '您输入的内容不是汉字哦'
  2507. })
  2508. return false;
  2509. };
  2510. if (e.detail.value .length < 2) {
  2511. wx.showModal({
  2512. showCancel: false,
  2513. content: '赡养人姓名不可以少于两个字哦'
  2514. })
  2515. return false
  2516. }
  2517. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name'
  2518. this.setData({
  2519. [Info]: e.detail.value,
  2520. })
  2521. this.SubmitOldmanInfo({
  2522. id: this.data.nameArr[this.data.activeIndex]._id,
  2523. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2524. })
  2525. },
  2526. // 其他赡养人性别
  2527. tab3Change3: function (e) {
  2528. let data = this.data.otherInfo[this.data.activeIndex].Info.othersyrSexArr.map(v => {
  2529. if (v.name == e.detail.value) {
  2530. return {
  2531. name: v.name,
  2532. checked: true
  2533. }
  2534. }
  2535. return {
  2536. name: v.name,
  2537. checked: false
  2538. }
  2539. })
  2540. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.sex'
  2541. let othersyrSexArr = 'otherInfo[' + this.data.activeIndex + '].Info.othersyrSexArr'
  2542. this.setData({
  2543. [Info]: e.detail.value,
  2544. [othersyrSexArr]: data,
  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. tab3Change4: function (e) {
  2553. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.phone'
  2554. this.setData({
  2555. [Info]: e.detail.value,
  2556. })
  2557. this.SubmitOldmanInfo({
  2558. id: this.data.nameArr[this.data.activeIndex]._id,
  2559. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2560. })
  2561. },
  2562. // 与被赡养人关系状态改变
  2563. tab3Change5: function (e) {
  2564. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.relation'
  2565. this.setData({
  2566. [Info]: this.data.othersyrRelation[e.detail.value],
  2567. })
  2568. this.SubmitOldmanInfo({
  2569. id: this.data.nameArr[this.data.activeIndex]._id,
  2570. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2571. })
  2572. },
  2573. // 输选择其他时入与被赡养人其他关系
  2574. tab3Change6: function (e) {
  2575. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.relationExt'
  2576. this.setData({
  2577. [Info]: e.detail.value,
  2578. })
  2579. this.SubmitOldmanInfo({
  2580. id: this.data.nameArr[this.data.activeIndex]._id,
  2581. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2582. })
  2583. },
  2584. // 是否外出
  2585. tab3Change7: function (e) {
  2586. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.isHasGoOut'
  2587. this.setData({
  2588. [Info]: this.data.othersyrIsout[e.detail.value],
  2589. })
  2590. this.SubmitOldmanInfo({
  2591. id: this.data.nameArr[this.data.activeIndex]._id,
  2592. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2593. })
  2594. },
  2595. // 外出原因
  2596. tab3Change8: function (e) {
  2597. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingCause'
  2598. this.setData({
  2599. [Info]: e.detail.value,
  2600. })
  2601. this.SubmitOldmanInfo({
  2602. id: this.data.nameArr[this.data.activeIndex]._id,
  2603. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2604. })
  2605. },
  2606. // 外出地点改变
  2607. tab3Change9: function (e) {
  2608. console.log(e)
  2609. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingplace'
  2610. this.setData({
  2611. [Info]: e.detail.value,
  2612. })
  2613. this.SubmitOldmanInfo({
  2614. id: this.data.nameArr[this.data.activeIndex]._id,
  2615. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2616. })
  2617. },
  2618. //最后一次离家时间
  2619. tab3Change10: function (e) {
  2620. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingTime'
  2621. this.setData({
  2622. [Info]: e.detail.value,
  2623. })
  2624. this.SubmitOldmanInfo({
  2625. id: this.data.nameArr[this.data.activeIndex]._id,
  2626. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2627. })
  2628. },
  2629. //是否有配偶
  2630. tab3Change11: function (e) {
  2631. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.isHasPartner'
  2632. this.setData({
  2633. [Info]: this.data.othersyrIsMarry[e.detail.value],
  2634. })
  2635. this.SubmitOldmanInfo({
  2636. id: this.data.nameArr[this.data.activeIndex]._id,
  2637. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2638. })
  2639. },
  2640. // 配偶姓名
  2641. tab3Change12: function (e) {
  2642. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name2'
  2643. this.setData({
  2644. [Info]: e.detail.value,
  2645. })
  2646. this.SubmitOldmanInfo({
  2647. id: this.data.nameArr[this.data.activeIndex]._id,
  2648. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2649. })
  2650. },
  2651. // 配偶电话
  2652. tab3Change13: function (e) {
  2653. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.phone2'
  2654. this.setData({
  2655. [Info]: e.detail.value,
  2656. })
  2657. this.SubmitOldmanInfo({
  2658. id: this.data.nameArr[this.data.activeIndex]._id,
  2659. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2660. })
  2661. },
  2662. //平均一年探望次数
  2663. tab3Change14: function (e) {
  2664. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.visit'
  2665. this.setData({
  2666. [Info]: this.data.othersyrTfTimes[e.detail.value],
  2667. })
  2668. this.SubmitOldmanInfo({
  2669. id: this.data.nameArr[this.data.activeIndex]._id,
  2670. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2671. })
  2672. },
  2673. //tab4巡访方式
  2674. tab4Change1: function (e) {
  2675. console.log(this.data.regularsInfos, "提交的regularsInfos");
  2676. console.log(this.data.regularsInfo, "提交的regularsInfo000000000000000000000");
  2677. const items = this.data.regularsInfos[this.data.activeIndex].visitMode
  2678. const values = e.detail.value
  2679. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  2680. items[i].checked = false
  2681. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  2682. if (items[i].name === values[j]) {
  2683. items[i].checked = true
  2684. break
  2685. }
  2686. }
  2687. }
  2688. let visitMode = 'regularsInfos[' + this.data.activeIndex + '].visitMode'
  2689. let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
  2690. this.setData({
  2691. [visitMode]: items,
  2692. [visitMode1]:JSON.stringify( e.detail.value)
  2693. })
  2694. console.log(this.data.regularsInfo, "我是?????????????");
  2695. this.SubmitOldmanInfo({
  2696. id: this.data.nameArr[this.data.activeIndex]._id,
  2697. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2698. })
  2699. },
  2700. // 巡防方式其他内容
  2701. tab4Change2: function (e) {
  2702. let Info = 'regularsInfos[' + this.data.activeIndex + '].visitModeExt'
  2703. let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitModeExt'
  2704. this.setData({
  2705. [Info]: e.detail.value,
  2706. [Info1]: e.detail.value
  2707. })
  2708. this.SubmitOldmanInfo({
  2709. id: this.data.nameArr[this.data.activeIndex]._id,
  2710. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2711. })
  2712. },
  2713. // 巡访频次
  2714. tab4Change3: function (e) {
  2715. let data = this.data.regularsInfos[this.data.activeIndex].visitCount.map(v => {
  2716. if (v.name == e.detail.value) {
  2717. return {
  2718. name: v.name,
  2719. checked: true
  2720. }
  2721. }
  2722. return {
  2723. name: v.name,
  2724. checked: false
  2725. }
  2726. })
  2727. let visitCount = 'regularsInfos[' + this.data.activeIndex + '].visitCount'
  2728. let visitCount1 = 'regularsInfo[' + this.data.activeIndex + '].visitCount'
  2729. this.setData({
  2730. [visitCount]: data,
  2731. [visitCount1]: 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. tab4change4: function (e) {
  2740. let Info = 'regularsInfos[' + this.data.activeIndex + '].visitCountExt'
  2741. let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitCountExt'
  2742. this.setData({
  2743. [Info]: e.detail.value,
  2744. [Info1]: e.detail.value
  2745. })
  2746. this.SubmitOldmanInfo({
  2747. id: this.data.nameArr[this.data.activeIndex]._id,
  2748. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2749. })
  2750. },
  2751. formSubmit(e) {
  2752. console.log('form发生了submit事件,携带数据为:', e.detail.value)
  2753. },
  2754. removeExcess(data) {
  2755. if (data) {
  2756. data = JSON.parse(data);
  2757. }
  2758. return data;
  2759. },
  2760. huixian(id, name) {
  2761. if (!id) {
  2762. let showbj = true;
  2763. console.log("我是没有fid的");
  2764. let oldInfo = [{
  2765. name: '',
  2766. oldSex: [{
  2767. name: '男'
  2768. }, {
  2769. name: '女'
  2770. }],
  2771. isSameWithAddress: [{
  2772. name: '现居地址与户籍地址一致'
  2773. }],
  2774. addressExt: '',
  2775. nativePlaceExt: '',
  2776. nation: '', //民族
  2777. idNumber: '', //身份证号
  2778. phone: '',
  2779. chooseAdressArr: [],
  2780. chooseAdressArr1: [],
  2781. oldMarry: [{
  2782. name: "未婚"
  2783. }, {
  2784. name: "已婚"
  2785. }, {
  2786. name: "离异"
  2787. }, {
  2788. name: "丧偶"
  2789. }],
  2790. partnerName: '',
  2791. partnerIdNumber: '',
  2792. healthAyy: [{
  2793. name: "健康",
  2794. disabled: false
  2795. }, {
  2796. name: "残疾",
  2797. disabled: false
  2798. }, {
  2799. name: "患重特大疾病",
  2800. disabled: false
  2801. }, {
  2802. name: "老年人慢性病",
  2803. disabled: false
  2804. }],
  2805. disabilityAyy: [{
  2806. name: "视力残疾"
  2807. }, {
  2808. name: "听力残疾"
  2809. }, {
  2810. name: "言语残疾"
  2811. }, {
  2812. name: "肢体残疾"
  2813. }, {
  2814. name: "智力残疾"
  2815. }, {
  2816. name: "精神残疾"
  2817. }, {
  2818. name: "多重残疾"
  2819. }],
  2820. disabilityLevel: '', //残疾人类别
  2821. sickType: [{
  2822. name: "重大器官类疾病"
  2823. }, {
  2824. name: "心脑血管类疾病"
  2825. }, {
  2826. name: "神经与代谢类疾病"
  2827. }, {
  2828. name: "肢体与病毒类疾病"
  2829. }, {
  2830. name: "恶性肿瘤"
  2831. }],
  2832. ability: '', //老年人能力情况
  2833. livingCondition: '', //生活经济情况
  2834. moneyFromAyy: [{
  2835. name: "家庭经营性收入"
  2836. }, {
  2837. name: "工资性收入"
  2838. }, {
  2839. name: "转移性收入"
  2840. }, {
  2841. name: "财产性收入"
  2842. }, {
  2843. name: "其它"
  2844. }],
  2845. income: '',
  2846. sourceOfIncomeExt: '', //其他收入情况
  2847. familyHelpArr: [{
  2848. name: "低保"
  2849. }, {
  2850. name: "建档立卡贫困户"
  2851. }, {
  2852. name: "医疗救助"
  2853. }, {
  2854. name: "临时救助"
  2855. }, {
  2856. name: "老年人福利津贴"
  2857. }, {
  2858. name: "残疾人两项补贴(或一项补贴)"
  2859. }, {
  2860. name: "其他救助"
  2861. }],
  2862. rescueStateExt: '', //其他救助
  2863. loneArr: [{
  2864. name: "是"
  2865. }, {
  2866. name: "否"
  2867. }],
  2868. liveStatus: [{
  2869. name: "无人陪伴居住",
  2870. disabled: false
  2871. }, {
  2872. name: "配偶",
  2873. disabled: false
  2874. }, {
  2875. name: "近亲属",
  2876. disabled: false
  2877. }, {
  2878. name: "未成年孙子女",
  2879. disabled: false
  2880. }, {
  2881. name: "其他情形",
  2882. disabled: false
  2883. }],
  2884. accompanyExt: '', //陪伴居住其他
  2885. oftenMan: [{
  2886. name: "无人照料",
  2887. disabled: false
  2888. }, {
  2889. name: "近亲属",
  2890. disabled: false
  2891. }, {
  2892. name: "配偶",
  2893. disabled: false
  2894. }, {
  2895. name: "邻里互助",
  2896. disabled: false
  2897. }, {
  2898. name: "购买养老服务",
  2899. disabled: false
  2900. }, {
  2901. name: "其他人员",
  2902. disabled: false
  2903. }],
  2904. lookAfterExt: '', //其他日常生活照料人关系
  2905. mainLookName: '', //日常生活照料人姓名
  2906. mainLookSex: [{
  2907. name: "男"
  2908. }, {
  2909. name: "女"
  2910. }],
  2911. mainLookPhone: '', //
  2912. loveRequire: [{
  2913. name: "生活照料"
  2914. },
  2915. {
  2916. name: "生产帮助"
  2917. },
  2918. {
  2919. name: "精神慰藉"
  2920. },
  2921. {
  2922. name: "医疗保健"
  2923. },
  2924. {
  2925. name: "权益维护"
  2926. },
  2927. {
  2928. name: "安全监护"
  2929. },
  2930. {
  2931. name: "文化娱乐"
  2932. },
  2933. {
  2934. name: "紧急救助"
  2935. },
  2936. {
  2937. name: "其它"
  2938. },
  2939. ],
  2940. oldType: [{
  2941. name: "农村留守老年人",
  2942. disable: false,
  2943. checked: false
  2944. }, {
  2945. name: "分散供养特困老年人",
  2946. disable: false,
  2947. checked: false
  2948. }, {
  2949. name: "计划生育特殊家庭老人",
  2950. disable: false,
  2951. checked: false
  2952. }, {
  2953. name: "空巢老年人",
  2954. disable: false,
  2955. checked: false
  2956. }, {
  2957. name: "独居老年人",
  2958. disable: false,
  2959. checked: false
  2960. }, {
  2961. name: "重残老年人",
  2962. disable: false,
  2963. checked: false
  2964. }, {
  2965. name: "高龄老年人",
  2966. disable: false,
  2967. checked: false
  2968. }],
  2969. isHavePhoto: false,
  2970. imgPath: '',
  2971. photoAndLocation: '',
  2972. }];
  2973. let regularsInfos = [{
  2974. visitMode: [{
  2975. name: '电话问候',
  2976. checked: false
  2977. }, {
  2978. name: '上门巡访',
  2979. checked: false
  2980. }, {
  2981. name: '其它',
  2982. checked: false
  2983. }],
  2984. visitModeExt: '', //巡访其他
  2985. visitCount: [{
  2986. name: '每天',
  2987. checked: false
  2988. }, {
  2989. name: '每周',
  2990. checked: false
  2991. }, {
  2992. name: '每月',
  2993. checked: false
  2994. }, {
  2995. name: '每季',
  2996. checked: false
  2997. }, {
  2998. name: '其它',
  2999. checked: false
  3000. }],
  3001. visitCountExt: '', // 频次的其他
  3002. }];
  3003. let otherInfo = [{
  3004. isHasOther: '',
  3005. Info: {
  3006. name: '', // 其他赡养人姓名,
  3007. sex: '', //其他赡养人性别
  3008. phone: '', //其他赡养人电话,
  3009. relation: '', //与被赡养人关系 如果选了其他也是必填 单选
  3010. relationExt: '', //与被赡养人关系--其他
  3011. isHasGoOut: '', //是否外出
  3012. outgoingCause: '', //外出原因
  3013. outgoingplace: '', // 外出地点
  3014. outgoingTime: '', // 最后一次离家时间
  3015. isHasPartner: '', //是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0:是 1:否
  3016. name2: '',
  3017. phone2: '',
  3018. visit: '', //平均一年探望次数
  3019. othersyrSexArr: [{
  3020. name: '男',
  3021. checked: false
  3022. },
  3023. {
  3024. name: '女',
  3025. checked: false
  3026. },
  3027. ]
  3028. }
  3029. }];
  3030. let childInfo = [{
  3031. childrenNum: ''
  3032. }]
  3033. this.setData({
  3034. showBj: showbj,
  3035. showAdress: false,
  3036. showAdress1: false,
  3037. nameArr: [],
  3038. oldInfo: oldInfo,
  3039. childInfo: childInfo,
  3040. otherInfo: otherInfo,
  3041. regularsInfos: regularsInfos,
  3042. })
  3043. console.log(this.data.regularsInfos);
  3044. console.log(this.data.showBj, "444444444444444444444444444444444444444444444");
  3045. } else if (id == '-1') {
  3046. } else if (id) {
  3047. wx.showLoading({
  3048. title: '加载中',
  3049. })
  3050. this.setData({
  3051. showBj: false,
  3052. showBj1: false,
  3053. showAdress: false,
  3054. showAdress1: false,
  3055. nameArr: [],
  3056. activeIndex: 0,
  3057. familyFid: id,
  3058. color: 'transparent',
  3059. })
  3060. console.log(this.data.showBj, "关闭提示添加");
  3061. var that = this;
  3062. wx.request({
  3063. url: util.globalData.publicUrl + '/wxinfo/listByFid',
  3064. method: "GET",
  3065. data: {
  3066. fid: id,
  3067. },
  3068. header: {
  3069. appletsId: wx.getStorageSync('openId')
  3070. },
  3071. success: (res) => {
  3072. wx.hideLoading()
  3073. console.log(res.data.data, "单查赋值锕")
  3074. that.setData({
  3075. oldInfo: res.data.data
  3076. })
  3077. let datass = res.data.data;
  3078. let fristIndex = datass.findIndex((item) => {
  3079. return name == item.name;
  3080. });
  3081. let fristArray = datass.filter((item) => {
  3082. return name == item.name;
  3083. });
  3084. datass.splice(fristIndex, 1);
  3085. datass.unshift(fristArray[0]);
  3086. //regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  3087. // regularsInfo:data[this.data.activeIndex]
  3088. that.setData({
  3089. nameArr: datass,
  3090. // regularsInfo: datass[that.data.activeIndex].regularsInfo
  3091. })
  3092. console.log(that.data.regularsInfo, "赋值是么");
  3093. let oldSex = [{
  3094. name: '男',
  3095. checked: false
  3096. },
  3097. {
  3098. name: '女',
  3099. checked: false
  3100. }
  3101. ]
  3102. let oldMarry = [{
  3103. name: "未婚"
  3104. }, {
  3105. name: "已婚"
  3106. }, {
  3107. name: "离异"
  3108. }, {
  3109. name: "丧偶"
  3110. }];
  3111. let loneArr = [{
  3112. name: "是"
  3113. }, {
  3114. name: "否"
  3115. }];
  3116. let mainLookSex = [{
  3117. name: "男"
  3118. }, {
  3119. name: "女"
  3120. }];
  3121. let abc = datass.map(item => {
  3122. let otherInfo = ''
  3123. let imgPath = ''
  3124. if (item.photo) {
  3125. imgPath = item.photo;
  3126. } else {
  3127. imgPath = ''
  3128. }
  3129. let disabilityAyyss = [{
  3130. name: "视力残疾"
  3131. }, {
  3132. name: "听力残疾"
  3133. }, {
  3134. name: "言语残疾"
  3135. }, {
  3136. name: "肢体残疾"
  3137. }, {
  3138. name: "智力残疾"
  3139. }, {
  3140. name: "精神残疾"
  3141. }, {
  3142. name: "多重残疾"
  3143. }];
  3144. let sickType = [{
  3145. name: "重大器官类疾病"
  3146. }, {
  3147. name: "心脑血管类疾病"
  3148. }, {
  3149. name: "神经与代谢类疾病"
  3150. }, {
  3151. name: "肢体与病毒类疾病"
  3152. }, {
  3153. name: "恶性肿瘤"
  3154. }];
  3155. let moneyFromAyy = [{
  3156. name: "家庭经营性收入"
  3157. }, {
  3158. name: "工资性收入"
  3159. }, {
  3160. name: "转移性收入"
  3161. }, {
  3162. name: "财产性收入"
  3163. }, {
  3164. name: "其它"
  3165. }];
  3166. let familyHelpArr = [{
  3167. name: "低保"
  3168. }, {
  3169. name: "建档立卡贫困户"
  3170. }, {
  3171. name: "医疗救助"
  3172. }, {
  3173. name: "临时救助"
  3174. }, {
  3175. name: "老年人福利津贴"
  3176. }, {
  3177. name: "残疾人两项补贴(或一项补贴)"
  3178. }, {
  3179. name: "其他救助"
  3180. }];
  3181. let loveRequire = [{
  3182. name: "生活照料"
  3183. },
  3184. {
  3185. name: "生产帮助"
  3186. },
  3187. {
  3188. name: "精神慰藉"
  3189. },
  3190. {
  3191. name: "医疗保健"
  3192. },
  3193. {
  3194. name: "权益维护"
  3195. },
  3196. {
  3197. name: "安全监护"
  3198. },
  3199. {
  3200. name: "文化娱乐"
  3201. },
  3202. {
  3203. name: "紧急救助"
  3204. },
  3205. {
  3206. name: "其它"
  3207. },
  3208. ];
  3209. let isSameWithAddresss = [{
  3210. name: '现居地址与户籍地址一致'
  3211. }]
  3212. let finalarr = [];
  3213. if (item.health.includes("健康")) {
  3214. for (let i = 0; i < 4; i++) {
  3215. let obj = new Object();
  3216. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  3217. obj.checked = (i == 0 ? true : false);
  3218. obj.disabled = (i == 0 ? false : true);
  3219. finalarr.push(obj)
  3220. }
  3221. } else {
  3222. for (let i = 0; i < 4; i++) {
  3223. let obj = new Object();
  3224. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  3225. obj.checked = (i == 0 ? false : false);
  3226. obj.disabled = (i == 0 ? false : false);
  3227. finalarr.push(obj)
  3228. }
  3229. if (item.health.includes("残疾")) {
  3230. finalarr[1].checked = true;
  3231. }
  3232. if (item.health.includes("患重特大疾病")) {
  3233. finalarr[2].checked = true;
  3234. }
  3235. if (item.health.includes("老年人慢性病")) {
  3236. finalarr[3].checked = true;
  3237. }
  3238. }
  3239. let accompanyArr = [];
  3240. if (item.accompany.includes("无人陪伴居住")) {
  3241. for (let i = 0; i < 5; i++) {
  3242. let obj = new Object();
  3243. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  3244. obj.checked = (i == 0 ? true : false);
  3245. obj.disabled = (i == 0 ? false : true);
  3246. accompanyArr.push(obj)
  3247. }
  3248. } else {
  3249. for (let i = 0; i < 5; i++) {
  3250. let obj = new Object();
  3251. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  3252. obj.checked = (i == 0 ? false : false);
  3253. obj.disabled = (i == 0 ? false : false);
  3254. accompanyArr.push(obj)
  3255. }
  3256. if (item.accompany.includes("配偶")) {
  3257. accompanyArr[1].checked = true;
  3258. }
  3259. if (item.accompany.includes("近亲属")) {
  3260. accompanyArr[2].checked = true;
  3261. }
  3262. if (item.accompany.includes("未成年孙子女")) {
  3263. accompanyArr[3].checked = true;
  3264. }
  3265. if (item.accompany.includes("其他情形")) {
  3266. accompanyArr[4].checked = true;
  3267. }
  3268. }
  3269. let lookAfterArr = [];
  3270. if (item.lookAfter.includes("无人照料")) {
  3271. for (let i = 0; i < 6; i++) {
  3272. let obj = new Object();
  3273. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  3274. obj.checked = (i == 0 ? true : false);
  3275. obj.disabled = (i == 0 ? false : true);
  3276. lookAfterArr.push(obj)
  3277. }
  3278. } else {
  3279. for (let i = 0; i < 6; i++) {
  3280. let obj = new Object();
  3281. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  3282. obj.checked = (i == 0 ? false : false);
  3283. obj.disabled = (i == 0 ? false : false);
  3284. lookAfterArr.push(obj)
  3285. }
  3286. if (item.lookAfter.includes("近亲属")) {
  3287. lookAfterArr[1].checked = true;
  3288. }
  3289. if (item.lookAfter.includes("配偶")) {
  3290. lookAfterArr[2].checked = true;
  3291. }
  3292. if (item.lookAfter.includes("邻里互助")) {
  3293. lookAfterArr[3].checked = true;
  3294. }
  3295. if (item.lookAfter.includes("购买养老服务")) {
  3296. lookAfterArr[4].checked = true;
  3297. }
  3298. if (item.lookAfter.includes("其他人员")) {
  3299. lookAfterArr[5].checked = true;
  3300. }
  3301. }
  3302. let oldTypeArr = [];
  3303. for (let i = 0; i < 8; i++) {
  3304. let obj = new Object();
  3305. obj.name = (i == 0 ? "农村留守老年人" : i == 1 ? "分散供养特困老年人" : i == 2 ? "计划生育特殊家庭老人" : i == 3 ? "空巢老年人" : i == 4 ? "独居老年人" : i == 5 ? "重残老人" : i == 6 ? "高龄老人" : "失能老人");
  3306. obj.checked = (i == 0 ? false : false);
  3307. obj.disable = (i == 0 ? false : false);
  3308. oldTypeArr.push(obj)
  3309. }
  3310. if (item.oldType.includes("农村留守老年人")) {
  3311. oldTypeArr[0].checked = true;
  3312. oldTypeArr[1].disable = true;
  3313. oldTypeArr[2].disable = true;
  3314. oldTypeArr[3].checked = true;
  3315. oldTypeArr[3].disable = true;
  3316. }
  3317. if (item.oldType.includes("分散供养特困老年人")) {
  3318. oldTypeArr[1].checked = true;
  3319. oldTypeArr[0].disable = true;
  3320. oldTypeArr[2].disable = true;
  3321. oldTypeArr[3].disable = true;
  3322. }
  3323. if (item.oldType.includes("计划生育特殊家庭老人")) {
  3324. oldTypeArr[2].checked = true;
  3325. oldTypeArr[0].disable = true;
  3326. oldTypeArr[1].disable = true;
  3327. oldTypeArr[3].disable = true;
  3328. }
  3329. if (item.oldType.includes("空巢老年人") && item.oldType.includes("农村留守老年人")) {
  3330. oldTypeArr[3].checked = true;
  3331. oldTypeArr[1].disable = true;
  3332. oldTypeArr[2].disable = true;
  3333. }
  3334. if (item.oldType.includes("空巢老年人") && !item.oldType.includes("农村留守老年人")) {
  3335. oldTypeArr[3].checked = true;
  3336. oldTypeArr[1].disable = true;
  3337. oldTypeArr[2].disable = true;
  3338. oldTypeArr[0].disable = true;
  3339. }
  3340. if (item.oldType.includes("独居老年人")) {
  3341. oldTypeArr[4].checked = true;
  3342. }
  3343. if (item.oldType.includes("重残老人")) {
  3344. oldTypeArr[5].checked = true;
  3345. }
  3346. if (item.oldType.includes("高龄老人")) {
  3347. oldTypeArr[6].checked = true;
  3348. }
  3349. if (item.oldType.includes("失能老人")) {
  3350. oldTypeArr[7].checked = true;
  3351. }
  3352. disabilityAyyss.forEach(itemss => {
  3353. item.disabilityCategory.forEach(item => {
  3354. if (itemss.name == item) {
  3355. itemss.checked = true;
  3356. }
  3357. })
  3358. })
  3359. familyHelpArr.forEach(itemss => {
  3360. item.rescueState.forEach(item => {
  3361. if (itemss.name == item) {
  3362. itemss.checked = true;
  3363. }
  3364. })
  3365. })
  3366. moneyFromAyy.forEach(itemss => {
  3367. item.sourceOfIncome.forEach(item => {
  3368. if (itemss.name == item) {
  3369. itemss.checked = true;
  3370. }
  3371. })
  3372. })
  3373. if(item.majorDiseases[0]){
  3374. let patorl = this.removeExcess(item.majorDiseases[0]);
  3375. sickType.forEach(items => {
  3376. patorl.forEach(itemss => {
  3377. if (items.name == itemss) {
  3378. items.checked = true;
  3379. }
  3380. })
  3381. })
  3382. }
  3383. loveRequire.forEach(itemss => {
  3384. item.demand.forEach(item => {
  3385. if (itemss.name == item) {
  3386. itemss.checked = true;
  3387. }
  3388. })
  3389. })
  3390. let chooseAdressArr = [];
  3391. let chooseAdressArr1 = [];
  3392. if (item.nativePlace && item.nativePlaceId) {
  3393. let nativePlaces = item.nativePlace.split('/');
  3394. let nativePlaceId = item.nativePlaceId.split(',');
  3395. chooseAdressArr = nativePlaces.map((item, i) => ({
  3396. CIVILREGIONALISMNAME: item,
  3397. CIVILREGIONALISMID: nativePlaceId[i]
  3398. }));
  3399. if (item.isSameWithAddress == '是') {
  3400. isSameWithAddresss.forEach(item => {
  3401. item.checked = true;
  3402. })
  3403. chooseAdressArr1 = chooseAdressArr;
  3404. }
  3405. }
  3406. let addressExts = '';
  3407. if (item.addressExt) {
  3408. addressExts = item.addressExt
  3409. }
  3410. let nativePlaceExts = '';
  3411. if (item.nativePlaceExt) {
  3412. nativePlaceExts = item.nativePlaceExt
  3413. }
  3414. if (item.address && item.nativePlaceId) {
  3415. let address = item.address.split('/');
  3416. let addressId = item.addressId.split(',');
  3417. chooseAdressArr1 = address.map((item, i) => ({
  3418. CIVILREGIONALISMNAME: item,
  3419. CIVILREGIONALISMID: addressId[i]
  3420. }));
  3421. }
  3422. return {
  3423. ...item,
  3424. sickType:sickType,
  3425. oldSex: oldSex.map(items => {
  3426. if (items.name == item.sex) {
  3427. return {
  3428. name: items.name,
  3429. checked: true
  3430. }
  3431. }
  3432. return {
  3433. name: items.name,
  3434. checked: false
  3435. }
  3436. }),
  3437. oldMarry: oldMarry.map(items => {
  3438. if (items.name == item.partnerState) {
  3439. return {
  3440. name: items.name,
  3441. checked: true
  3442. }
  3443. }
  3444. return {
  3445. name: items.name,
  3446. checked: false
  3447. }
  3448. }),
  3449. addressExt: addressExts,
  3450. nativePlaceExt: nativePlaceExts,
  3451. imgPath: imgPath,
  3452. healthAyy: finalarr,
  3453. disabilityAyy: disabilityAyyss,
  3454. moneyFromAyy: moneyFromAyy,
  3455. familyHelpArr: familyHelpArr,
  3456. otherInfo: otherInfo, //赡养人存在么
  3457. mainLookSex: mainLookSex.map(items => {
  3458. if (items.name == item.mainLookSex) {
  3459. return {
  3460. name: items.name,
  3461. checked: true
  3462. }
  3463. }
  3464. return {
  3465. name: items.name,
  3466. checked: false
  3467. }
  3468. }),
  3469. loneArr: loneArr.map(items => {
  3470. if (items.name == item.isLoss) {
  3471. return {
  3472. name: items.name,
  3473. checked: true
  3474. }
  3475. }
  3476. return {
  3477. name: items.name,
  3478. checked: false
  3479. }
  3480. }),
  3481. liveStatus: accompanyArr,
  3482. oftenMan: lookAfterArr,
  3483. loveRequire: loveRequire,
  3484. oldType: oldTypeArr,
  3485. chooseAdressArr: chooseAdressArr,
  3486. isSameWithAddress: isSameWithAddresss,
  3487. chooseAdressArr1: chooseAdressArr1,
  3488. }
  3489. })
  3490. let def = datass.map(item => {
  3491. console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
  3492. let sexs = [{
  3493. name: '男',
  3494. checked: false
  3495. },
  3496. {
  3497. name: '女',
  3498. checked: false
  3499. }
  3500. ]
  3501. let otherInfo = '';
  3502. let name = '';
  3503. let phone = ''
  3504. let relation = ''
  3505. let relationExt = ''
  3506. let outgoingCause = ''
  3507. let isHasGoOut = ''
  3508. let outgoingTime = ''
  3509. let isHasPartner = ''
  3510. let outgoingplace = ''
  3511. let phone2 = ''
  3512. let name2 = ''
  3513. let sex = '';
  3514. let visit = '';
  3515. if (item.otherInfo) {
  3516. let partol = this.removeExcess(item.otherInfo);
  3517. otherInfo = '是'
  3518. if (partol.name) {
  3519. name = partol.name
  3520. }
  3521. if (partol.sex) {
  3522. sexs.forEach(items => {
  3523. if (items.name == partol.sex) {
  3524. items.checked = true;
  3525. sex = partol.sex ;
  3526. }
  3527. })
  3528. }
  3529. if (partol.phone) {
  3530. phone = partol.phone
  3531. }
  3532. if (partol.relation) {
  3533. relation = partol.relation
  3534. }
  3535. if (partol.relationExt) {
  3536. relationExt = partol.relationExt
  3537. }
  3538. if (partol.visit) {
  3539. visit = partol.visit;
  3540. }
  3541. if (partol.isHasGoOut) {
  3542. isHasGoOut = partol.isHasGoOut;
  3543. }
  3544. if (partol.outgoingCause) {
  3545. outgoingCause = partol.outgoingCause;
  3546. }
  3547. if (partol.outgoingTime) {
  3548. outgoingTime = partol.outgoingTime;
  3549. }
  3550. if (partol.isHasPartner) {
  3551. isHasPartner = partol.isHasPartner;
  3552. }
  3553. if (partol.outgoingplace) {
  3554. outgoingplace = partol.outgoingplace;
  3555. }
  3556. if (partol.name2) {
  3557. name2 = partol.name2;
  3558. }
  3559. if (partol.phone2) {
  3560. phone2 = partol.phone2;
  3561. }
  3562. } else if (item.otherInfo == '') {
  3563. otherInfo = '否'
  3564. } else {
  3565. otherInfo = ''
  3566. }
  3567. return {
  3568. ...item,
  3569. isHasOther: otherInfo, //赡养人存在
  3570. // name: name,
  3571. // othersyrSexArr: sex,
  3572. // phone: phone,
  3573. // othersyrRelationValue: othersyrRelationValue,
  3574. // relationExt: relationExt,
  3575. // visit: visit,
  3576. Info: {
  3577. name: name,
  3578. phone: phone,
  3579. relation: relation,
  3580. relationExt: relationExt,
  3581. isHasGoOut: isHasGoOut,
  3582. outgoingCause: outgoingCause,
  3583. outgoingTime: outgoingTime,
  3584. isHasPartner: isHasPartner,
  3585. outgoingplace: outgoingplace,
  3586. visit: visit,
  3587. name2: name2,
  3588. phone2: phone2,
  3589. othersyrSexArr: sexs,
  3590. sex :sex ,
  3591. }
  3592. }
  3593. })
  3594. let ghi = datass.map(item => {
  3595. // console.log(item, "8888888888888888888888888888888888888888888888888888");
  3596. let childrenNum = '';
  3597. if (item.childrenNum) {
  3598. if (item.childrenNum == '4') {
  3599. childrenNum = '3个以上'
  3600. } else {
  3601. childrenNum = item.childrenNum + '个'
  3602. }
  3603. } else {
  3604. childrenNum = ''
  3605. }
  3606. let Info = [];
  3607. if (item.childInfo) {
  3608. let partol = this.removeExcess(item.childInfo);
  3609. Info = partol
  3610. } else {
  3611. if (parseInt(childrenNum) == 5) {
  3612. for (let i = 0; i < parseInt(childrenNum) - 1; i++) {
  3613. let chlidInfos = {
  3614. name: '', // 姓名
  3615. sex: '',
  3616. phone: '', // 常用联系电话,
  3617. isHasGoOut: '', // 子女是否外出
  3618. outgoingplace: '', // 外出地点
  3619. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  3620. name2: '', // 子女配偶姓名
  3621. phone2: '', // 子女配偶电话
  3622. outgoingTime: '', // 最后一次离家时间
  3623. outgoingCause: '', // 外出原因
  3624. visit: '', // 平均一年探望次数
  3625. }
  3626. Info.push(chlidInfos)
  3627. }
  3628. } else {
  3629. for (let i = 0; i < parseInt(childrenNum); i++) {
  3630. let chlidInfos = {
  3631. name: '', // 姓名
  3632. sex: '',
  3633. phone: '', // 常用联系电话,
  3634. isHasGoOut: '', // 子女是否外出
  3635. outgoingplace: '', // 外出地点
  3636. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  3637. name2: '', // 子女配偶姓名
  3638. phone2: '', // 子女配偶电话
  3639. outgoingTime: '', // 最后一次离家时间
  3640. outgoingCause: '', // 外出原因
  3641. visit: '', // 平均一年探望次数
  3642. }
  3643. Info.push(chlidInfos)
  3644. }
  3645. }
  3646. }
  3647. return {
  3648. ...item,
  3649. childrenNum: childrenNum,
  3650. Info: Info
  3651. }
  3652. })
  3653. let zzz = datass.map(item => {
  3654. let visitModeExt = ''
  3655. let visitCountExt = ''
  3656. let visitMode = [{
  3657. name: '电话问候',
  3658. checked: false
  3659. }, {
  3660. name: '上门巡访',
  3661. checked: false
  3662. }, {
  3663. name: '其它',
  3664. checked: false
  3665. }]
  3666. let visitCounts = [{
  3667. name: '每天',
  3668. checked: false
  3669. }, {
  3670. name: '每周',
  3671. checked: false
  3672. }, {
  3673. name: '每月',
  3674. checked: false
  3675. },
  3676. {
  3677. name: '每季',
  3678. checked: false
  3679. },
  3680. {
  3681. name: '其它',
  3682. checked: false
  3683. }
  3684. ];
  3685. if (item.regularsInfo) {
  3686. let partol = this.removeExcess(item.regularsInfo);
  3687. let partols = this.removeExcess(partol.visitMode);
  3688. if (partol.visitMode) {
  3689. visitMode.forEach(items => {
  3690. partols.forEach(itemss => {
  3691. if (items.name == itemss) {
  3692. items.checked = true;
  3693. }
  3694. })
  3695. })
  3696. }
  3697. if (partol.visitCount) {
  3698. visitCounts.forEach(items => {
  3699. if (items.name == partol.visitCount) {
  3700. items.checked = true;
  3701. }
  3702. })
  3703. }
  3704. if (partol.visitCountExt) {
  3705. visitCountExt = partol.visitCountExt;
  3706. }
  3707. if (partol.visitModeExt) {
  3708. visitModeExt = partol.visitModeExt;
  3709. }
  3710. }
  3711. return {
  3712. ...item,
  3713. visitCountExt: visitCountExt,
  3714. visitModeExt: visitModeExt,
  3715. visitMode: visitMode,
  3716. visitCount: visitCounts,
  3717. }
  3718. })
  3719. let mmm = datass.map(item => {
  3720. if (item.regularsInfo) {
  3721. let partol = this.removeExcess(item.regularsInfo);
  3722. let partols = this.removeExcess(partol.visitMode);
  3723. console.log(partol, "111111111111111111111");
  3724. console.log(partols, "99999999999999999999");
  3725. return {
  3726. visitCount: partol.visitCount,
  3727. visitCountExt: partol.visitCountExt,
  3728. visitMode: partols,
  3729. visitModeExt: partol.visitModeExt,
  3730. }
  3731. }
  3732. })
  3733. console.log(mmm,"mmmmmmmmmmmmmm");
  3734. // if (datass[that.data.activeIndex].regularsInfo) {
  3735. // let regularsInfo = that.removeExcess(datass[that.data.activeIndex].regularsInfo);
  3736. // console.log(regularsInfo,"解析的regularsInfo");
  3737. // that.setData({
  3738. // regularsInfo: regularsInfo
  3739. // })
  3740. // }
  3741. that.setData({
  3742. oldInfo: abc,
  3743. otherInfo: def,
  3744. childInfo: ghi,
  3745. regularsInfos: zzz,
  3746. regularsInfo: mmm,
  3747. })
  3748. console.log(that.data.oldInfo, "老人的返现数组")
  3749. console.log(that.data.otherInfo, "其他的返现数组")
  3750. console.log(that.data.childInfo, "孩子的返现数组")
  3751. console.log(that.data.regularsInfos, "q巡访的返现数组")
  3752. console.log(that.data.regularsInfo, "巡访传值的返回")
  3753. // let ghi = res.data.data.map(item => {
  3754. // console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
  3755. // let sex = [{
  3756. // name: '男',
  3757. // checked: false
  3758. // },
  3759. // {
  3760. // name: '女',
  3761. // checked: false
  3762. // }
  3763. // ]
  3764. // let otherInfo = '';
  3765. // let name = '';
  3766. // let phone = ''
  3767. // let othersyrRelationValue = ''
  3768. // let relationExt = ''
  3769. // let visit = ''
  3770. // if (item.otherInfo) {
  3771. // let partol = this.removeExcess(item.otherInfo);
  3772. // otherInfo = '是'
  3773. // if (partol.name) {
  3774. // name = partol.name
  3775. // }
  3776. // if (partol.sex) {
  3777. // sex.forEach(items => {
  3778. // if (items.name == partol.sex) {
  3779. // items.checked = true;
  3780. // }
  3781. // })
  3782. // }
  3783. // if (partol.phone) {
  3784. // phone = partol.phone
  3785. // }
  3786. // if (partol.relation) {
  3787. // othersyrRelationValue = partol.relation
  3788. // }
  3789. // if (partol.relationExt) {
  3790. // relationExt = partol.relationExt
  3791. // }
  3792. // if (partol.visit) {
  3793. // visit = partol.visit;
  3794. // }
  3795. // } else {
  3796. // otherInfo = ''
  3797. // }
  3798. // return {
  3799. // ...item,
  3800. // otherInfo: otherInfo, //赡养人存在
  3801. // name: name,
  3802. // othersyrSexArr: sex,
  3803. // phone: phone,
  3804. // othersyrRelationValue: othersyrRelationValue,
  3805. // relationExt: relationExt,
  3806. // visit: visit,
  3807. // }
  3808. // })
  3809. // that.setData({
  3810. // oldInfo: abc,
  3811. // otherInfo: def,
  3812. // childInfo: ghi
  3813. // })
  3814. }
  3815. })
  3816. } else {
  3817. }
  3818. },
  3819. chooseAdress() {
  3820. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr)
  3821. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 0) {
  3822. wx.request({
  3823. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3824. method: "get",
  3825. header: {
  3826. appletsId: wx.getStorageSync('openId')
  3827. },
  3828. success: (res) => {
  3829. this.setData({
  3830. showAdress: true,
  3831. provinceArr: res.data.data
  3832. })
  3833. console.log(this.data.provinceArr)
  3834. }
  3835. })
  3836. }
  3837. this.setData({
  3838. showAdress: true
  3839. })
  3840. },
  3841. // 选择现居地址
  3842. chooseAdress1() {
  3843. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length == 0) {
  3844. wx.request({
  3845. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3846. method: "get",
  3847. header: {
  3848. appletsId: wx.getStorageSync('openId')
  3849. },
  3850. success: (res) => {
  3851. console.log(res.data.data)
  3852. this.setData({
  3853. showAdress1: true,
  3854. provinceArr1: res.data.data
  3855. })
  3856. }
  3857. })
  3858. }
  3859. this.setData({
  3860. showAdress1: true
  3861. })
  3862. },
  3863. provinceClick(e) {
  3864. console.log(e.currentTarget.dataset.item)
  3865. wx.showLoading({
  3866. title: '选择中',
  3867. mask: true
  3868. })
  3869. this.data.oldInfo[this.data.activeIndex].chooseAdressArr.push(e.currentTarget.dataset.item)
  3870. wx.request({
  3871. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3872. method: "get",
  3873. header: {
  3874. appletsId: wx.getStorageSync('openId')
  3875. },
  3876. data: {
  3877. fid: e.currentTarget.dataset.item.CIVILREGIONALISMID
  3878. },
  3879. success: (res) => {
  3880. this.setData({
  3881. provinceArr: res.data.data,
  3882. isAdress: true,
  3883. oldInfo: this.data.oldInfo
  3884. })
  3885. if (res.data.data.length == 0) {
  3886. this.setData({
  3887. pleaseChoose: false
  3888. })
  3889. }
  3890. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length == 5) {
  3891. let nativePlaceId = '';
  3892. let nativePlace = '';
  3893. for (let value of this.data.oldInfo[this.data.activeIndex].chooseAdressArr) {
  3894. nativePlace += value.CIVILREGIONALISMNAME + '/'
  3895. nativePlaceId += value.CIVILREGIONALISMID + ','
  3896. console.log(value, "打印下");
  3897. }
  3898. this.SubmitOldmanInfo({
  3899. id: this.data.nameArr[this.data.activeIndex]._id,
  3900. nativePlace: nativePlace.substring(0, nativePlace.length - 1),
  3901. nativePlaceId: nativePlaceId.substring(0, nativePlaceId.length - 1),
  3902. })
  3903. }
  3904. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr, '我是添加的数组')
  3905. wx.hideLoading()
  3906. }
  3907. })
  3908. // }
  3909. },
  3910. provinceClick1(e) {
  3911. console.log(e.currentTarget.dataset.item)
  3912. wx.showLoading({
  3913. title: '选择中',
  3914. mask: true
  3915. })
  3916. this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.push(e.currentTarget.dataset.item)
  3917. wx.request({
  3918. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3919. method: "get",
  3920. header: {
  3921. appletsId: wx.getStorageSync('openId')
  3922. },
  3923. data: {
  3924. fid: e.currentTarget.dataset.item.CIVILREGIONALISMID
  3925. },
  3926. success: (res) => {
  3927. this.setData({
  3928. provinceArr1: res.data.data,
  3929. isAdress1: true,
  3930. oldInfo: this.data.oldInfo
  3931. })
  3932. if (res.data.data.length == 0) {
  3933. this.setData({
  3934. pleaseChoose1: false
  3935. })
  3936. }
  3937. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length == 5) {
  3938. let addressId = '';
  3939. let address = '';
  3940. for (let value of this.data.oldInfo[this.data.activeIndex].chooseAdressArr1) {
  3941. address += value.CIVILREGIONALISMNAME + '/'
  3942. addressId += value.CIVILREGIONALISMID + ','
  3943. console.log(value, "打印下");
  3944. }
  3945. this.SubmitOldmanInfo({
  3946. id: this.data.nameArr[this.data.activeIndex]._id,
  3947. address: address.substring(0, address.length - 1),
  3948. addressId: addressId.substring(0, addressId.length - 1),
  3949. })
  3950. }
  3951. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1, '我是添加的数组')
  3952. wx.hideLoading()
  3953. }
  3954. })
  3955. // }
  3956. },
  3957. closeAdress() {
  3958. this.setData({
  3959. showAdress: false
  3960. })
  3961. },
  3962. closeAdress1() {
  3963. this.setData({
  3964. showAdress1: false
  3965. })
  3966. },
  3967. reSelect(e) {
  3968. let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr'
  3969. console.log(e.currentTarget.dataset.index)
  3970. this.setData({
  3971. [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr.slice(0, e.currentTarget.dataset.index),
  3972. oldInfo: this.data.oldInfo
  3973. })
  3974. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr)
  3975. let fid;
  3976. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length != 0) {
  3977. fid = this.data.oldInfo[this.data.activeIndex].chooseAdressArr[this.data.oldInfo[this.data.activeIndex].chooseAdressArr.length - 1].CIVILREGIONALISMID;
  3978. } else {
  3979. fid = ''
  3980. }
  3981. wx.request({
  3982. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3983. method: "get",
  3984. header: {
  3985. appletsId: wx.getStorageSync('openId')
  3986. },
  3987. data: {
  3988. fid
  3989. },
  3990. success: (res) => {
  3991. this.setData({
  3992. provinceArr: res.data.data,
  3993. isAdress: true,
  3994. oldInfo: this.data.oldInfo
  3995. })
  3996. if (res.data.data.length == 0) {
  3997. this.setData({
  3998. pleaseChoose: false
  3999. })
  4000. }
  4001. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr, '我是添加的数组')
  4002. wx.hideLoading()
  4003. // this.setData({
  4004. // provinceArr: res.data.data,
  4005. // isAdress: true,
  4006. // [Info]: this.data.oldInfo
  4007. // })
  4008. // if (res.data.data.length == 0) {
  4009. // this.setData({
  4010. // pleaseChoose: false
  4011. // })
  4012. // }
  4013. }
  4014. })
  4015. },
  4016. reSelect1(e) {
  4017. let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
  4018. console.log(e.currentTarget.dataset.index)
  4019. this.setData({
  4020. [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.slice(0, e.currentTarget.dataset.index),
  4021. oldInfo: this.data.oldInfo
  4022. })
  4023. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1)
  4024. let fid;
  4025. if (this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length != 0) {
  4026. fid = this.data.oldInfo[this.data.activeIndex].chooseAdressArr1[this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.length - 1].CIVILREGIONALISMID;
  4027. } else {
  4028. fid = ''
  4029. }
  4030. wx.request({
  4031. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  4032. method: "get",
  4033. header: {
  4034. appletsId: wx.getStorageSync('openId')
  4035. },
  4036. data: {
  4037. fid
  4038. },
  4039. success: (res) => {
  4040. this.setData({
  4041. provinceArr1: res.data.data,
  4042. isAdress1: true,
  4043. oldInfo: this.data.oldInfo
  4044. })
  4045. if (res.data.data.length == 0) {
  4046. this.setData({
  4047. pleaseChoose1: false
  4048. })
  4049. }
  4050. console.log(this.data.oldInfo[this.data.activeIndex].chooseAdressArr1, '我是添加的数组')
  4051. wx.hideLoading()
  4052. }
  4053. })
  4054. },
  4055. // 提交老人采集信息
  4056. SubmitOldmanInfo(data) {
  4057. console.log(data, ' 提交老人信息带过来的数据')
  4058. console.log(this.data.nameArr[this.data.activeIndex])
  4059. wx.request({
  4060. url: util.globalData.publicUrl + '/wxinfo/update',
  4061. method: "post",
  4062. header: {
  4063. appletsId: wx.getStorageSync('openId')
  4064. },
  4065. data,
  4066. success: (res) => {
  4067. console.log(res)
  4068. }
  4069. })
  4070. },
  4071. onReady() {
  4072. console.log("onReadyonReadyonReadyonReadyonReadyonReadyonReadyonReadyonReadyonReady");
  4073. isTwoOnshow = false;
  4074. isonShow = false;
  4075. },
  4076. onShow() {
  4077. console.log("Onshow。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。");
  4078. if (wx.getStorageSync('user') == '') {
  4079. wx.redirectTo({
  4080. url: '/pages/login/login',
  4081. })
  4082. }else {
  4083. const app = getApp();
  4084. if (isTwoOnshow) {
  4085. isTwoOnshow = false;
  4086. return;
  4087. };
  4088. if (isonShow) {
  4089. isonShow = false;
  4090. return;
  4091. };
  4092. this.setData({
  4093. addOldname: '',
  4094. currentIndex: 0
  4095. })
  4096. console.log(app.globalData.id, "传参的一户的值");
  4097. this.huixian(app.globalData.id, app.globalData.name);
  4098. }
  4099. },
  4100. onHide() {
  4101. const app = getApp()
  4102. if (app.globalData.id != -1) {
  4103. app.globalData.id = ''
  4104. }
  4105. app.globalData.name = ''
  4106. this.setData({
  4107. showBj: false,
  4108. })
  4109. // isonShow = false
  4110. // isTwoOnshow = false
  4111. console.log(this.data.showBj, "我关闭页面隐藏属性");
  4112. console.log(app.globalData.id, "清空了么");
  4113. },
  4114. //获取位置
  4115. getSelfLocation: function (varSendOrgId) {
  4116. // 实例化API核心类
  4117. var qqmapsdk = new QQMapWX({
  4118. key: 'B5DBZ-NGIHP-SQMD4-LHMG3-NJ72Z-7KFOV' //申请的开发者秘钥key
  4119. });
  4120. var that = this; //用户授权过可以直接获取位置
  4121. wx.getLocation({
  4122. //type: 'wgs84',
  4123. type: 'gcj02',
  4124. success: function (res) {
  4125. console.log(res, "0000000");
  4126. // 返回当前定位的经纬度
  4127. var latitude = parseFloat(res.latitude).toFixed(5);
  4128. var longitude = parseFloat(res.longitude).toFixed(5);
  4129. qqmapsdk.reverseGeocoder({
  4130. location: {
  4131. latitude: res.latitude,
  4132. longitude: res.longitude
  4133. },
  4134. success: function (res) {
  4135. //获取当前地址成功
  4136. // that.setData({
  4137. // visitLocation: res.result.address
  4138. // })
  4139. let photoAndLocation = 'oldInfo[' + that.data.activeIndex + '].photoAndLocation'
  4140. let gps = longitude + '/' + latitude + '/' + res.result.address
  4141. that.setData({
  4142. [photoAndLocation]: gps
  4143. })
  4144. console.log(that.data.nameArr[that.data.activeIndex], "定位的问题");
  4145. that.SubmitOldmanInfo({
  4146. id: that.data.nameArr[that.data.activeIndex]._id,
  4147. photoAndLocation: gps
  4148. })
  4149. },
  4150. fail: function (res) {
  4151. console.log('获取当前地址失败');
  4152. }
  4153. });
  4154. },
  4155. fail: function (res) {}
  4156. });
  4157. },
  4158. onLoad(value) {
  4159. console.log(wx.getStorageSync('user'), "打印");
  4160. if (wx.getStorageSync('user') == '') {
  4161. wx.redirectTo({
  4162. url: '/pages/login/login',
  4163. })
  4164. }else {
  4165. console.log(value, "onLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoadonLoad");
  4166. this.huixian1(value.id, value.name);
  4167. }
  4168. // this.getSelfLocation();
  4169. },
  4170. huixian1(id, name) {
  4171. if (id) {
  4172. wx.showLoading({
  4173. title: '加载中',
  4174. })
  4175. this.setData({
  4176. showBj: false,
  4177. showBj1: false,
  4178. showAdress: false,
  4179. showAdress1: false,
  4180. nameArr: [],
  4181. activeIndex: 0,
  4182. familyFid: id,
  4183. color: 'transparent',
  4184. })
  4185. console.log(this.data.showBj, "关闭提示添加");
  4186. var that = this;
  4187. wx.request({
  4188. url: util.globalData.publicUrl + '/wxinfo/listByFid',
  4189. method: "GET",
  4190. data: {
  4191. fid: id,
  4192. },
  4193. header: {
  4194. appletsId: wx.getStorageSync('openId')
  4195. },
  4196. success: (res) => {
  4197. wx.hideLoading()
  4198. console.log(res.data.data, "单查赋值锕")
  4199. that.setData({
  4200. oldInfo: res.data.data
  4201. })
  4202. let datass = res.data.data;
  4203. let fristIndex = datass.findIndex((item) => {
  4204. return name == item.name;
  4205. });
  4206. let fristArray = datass.filter((item) => {
  4207. return name == item.name;
  4208. });
  4209. datass.splice(fristIndex, 1);
  4210. datass.unshift(fristArray[0]);
  4211. that.setData({
  4212. nameArr: datass,
  4213. })
  4214. // if (datass[that.data.activeIndex].regularsInfo) {
  4215. // let regularsInfo = that.removeExcess(datass[that.data.activeIndex].regularsInfo);
  4216. // that.setData({
  4217. // regularsInfo: regularsInfo
  4218. // })
  4219. // }
  4220. // console.log(that.data.regularsInfo, "onload赋值是么");
  4221. // console.log(data, "dadadsadasdasdsadsadsadsa");
  4222. let oldSex = [{
  4223. name: '男',
  4224. checked: false
  4225. },
  4226. {
  4227. name: '女',
  4228. checked: false
  4229. }
  4230. ]
  4231. let oldMarry = [{
  4232. name: "未婚"
  4233. }, {
  4234. name: "已婚"
  4235. }, {
  4236. name: "离异"
  4237. }, {
  4238. name: "丧偶"
  4239. }];
  4240. let loneArr = [{
  4241. name: "是"
  4242. }, {
  4243. name: "否"
  4244. }];
  4245. let mainLookSex = [{
  4246. name: "男"
  4247. }, {
  4248. name: "女"
  4249. }];
  4250. let abc = datass.map(item => {
  4251. let otherInfo = ''
  4252. let imgPath = ''
  4253. if (item.photo) {
  4254. imgPath = item.photo;
  4255. } else {
  4256. imgPath = ''
  4257. }
  4258. let disabilityAyyss = [{
  4259. name: "视力残疾"
  4260. }, {
  4261. name: "听力残疾"
  4262. }, {
  4263. name: "言语残疾"
  4264. }, {
  4265. name: "肢体残疾"
  4266. }, {
  4267. name: "智力残疾"
  4268. }, {
  4269. name: "精神残疾"
  4270. }, {
  4271. name: "多重残疾"
  4272. }];
  4273. let moneyFromAyy = [{
  4274. name: "家庭经营性收入"
  4275. }, {
  4276. name: "工资性收入"
  4277. }, {
  4278. name: "转移性收入"
  4279. }, {
  4280. name: "财产性收入"
  4281. }, {
  4282. name: "其它"
  4283. }];
  4284. let familyHelpArr = [{
  4285. name: "低保"
  4286. }, {
  4287. name: "建档立卡贫困户"
  4288. }, {
  4289. name: "医疗救助"
  4290. }, {
  4291. name: "临时救助"
  4292. }, {
  4293. name: "老年人福利津贴"
  4294. }, {
  4295. name: "残疾人两项补贴(或一项补贴)"
  4296. }, {
  4297. name: "其他救助"
  4298. }];
  4299. let loveRequire = [{
  4300. name: "生活照料"
  4301. },
  4302. {
  4303. name: "生产帮助"
  4304. },
  4305. {
  4306. name: "精神慰藉"
  4307. },
  4308. {
  4309. name: "医疗保健"
  4310. },
  4311. {
  4312. name: "权益维护"
  4313. },
  4314. {
  4315. name: "安全监护"
  4316. },
  4317. {
  4318. name: "文化娱乐"
  4319. },
  4320. {
  4321. name: "紧急救助"
  4322. },
  4323. {
  4324. name: "其它"
  4325. },
  4326. ];
  4327. let isSameWithAddresss = [{
  4328. name: '现居地址与户籍地址一致'
  4329. }]
  4330. let finalarr = [];
  4331. if (item.health.includes("健康")) {
  4332. for (let i = 0; i < 4; i++) {
  4333. let obj = new Object();
  4334. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  4335. obj.checked = (i == 0 ? true : false);
  4336. obj.disabled = (i == 0 ? false : true);
  4337. finalarr.push(obj)
  4338. }
  4339. } else {
  4340. for (let i = 0; i < 4; i++) {
  4341. let obj = new Object();
  4342. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  4343. obj.checked = (i == 0 ? false : false);
  4344. obj.disabled = (i == 0 ? false : false);
  4345. finalarr.push(obj)
  4346. }
  4347. if (item.health.includes("残疾")) {
  4348. finalarr[1].checked = true;
  4349. }
  4350. if (item.health.includes("患重特大疾病")) {
  4351. finalarr[2].checked = true;
  4352. }
  4353. if (item.health.includes("老年人慢性病")) {
  4354. finalarr[3].checked = true;
  4355. }
  4356. }
  4357. let accompanyArr = [];
  4358. if (item.accompany.includes("无人陪伴居住")) {
  4359. for (let i = 0; i < 5; i++) {
  4360. let obj = new Object();
  4361. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  4362. obj.checked = (i == 0 ? true : false);
  4363. obj.disabled = (i == 0 ? false : true);
  4364. accompanyArr.push(obj)
  4365. }
  4366. } else {
  4367. for (let i = 0; i < 5; i++) {
  4368. let obj = new Object();
  4369. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  4370. obj.checked = (i == 0 ? false : false);
  4371. obj.disabled = (i == 0 ? false : false);
  4372. accompanyArr.push(obj)
  4373. }
  4374. if (item.accompany.includes("配偶")) {
  4375. accompanyArr[1].checked = true;
  4376. }
  4377. if (item.accompany.includes("近亲属")) {
  4378. accompanyArr[2].checked = true;
  4379. }
  4380. if (item.accompany.includes("未成年孙子女")) {
  4381. accompanyArr[3].checked = true;
  4382. }
  4383. if (item.accompany.includes("其他情形")) {
  4384. accompanyArr[4].checked = true;
  4385. }
  4386. }
  4387. let lookAfterArr = [];
  4388. if (item.lookAfter.includes("无人照料")) {
  4389. for (let i = 0; i < 6; i++) {
  4390. let obj = new Object();
  4391. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  4392. obj.checked = (i == 0 ? true : false);
  4393. obj.disabled = (i == 0 ? false : true);
  4394. lookAfterArr.push(obj)
  4395. }
  4396. } else {
  4397. for (let i = 0; i < 6; i++) {
  4398. let obj = new Object();
  4399. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  4400. obj.checked = (i == 0 ? false : false);
  4401. obj.disabled = (i == 0 ? false : false);
  4402. lookAfterArr.push(obj)
  4403. }
  4404. if (item.lookAfter.includes("近亲属")) {
  4405. lookAfterArr[1].checked = true;
  4406. }
  4407. if (item.lookAfter.includes("配偶")) {
  4408. lookAfterArr[2].checked = true;
  4409. }
  4410. if (item.lookAfter.includes("邻里互助")) {
  4411. lookAfterArr[3].checked = true;
  4412. }
  4413. if (item.lookAfter.includes("购买养老服务")) {
  4414. lookAfterArr[4].checked = true;
  4415. }
  4416. if (item.lookAfter.includes("其他人员")) {
  4417. lookAfterArr[5].checked = true;
  4418. }
  4419. }
  4420. let oldTypeArr = [];
  4421. for (let i = 0; i < 8; i++) {
  4422. let obj = new Object();
  4423. obj.name = (i == 0 ? "农村留守老年人" : i == 1 ? "分散供养特困老年人" : i == 2 ? "计划生育特殊家庭老人" : i == 3 ? "空巢老年人" : i == 4 ? "独居老年人" : i == 5 ? "重残老人" : i == 6 ? "高龄老人" : "失能老人");
  4424. obj.checked = (i == 0 ? false : false);
  4425. obj.disable = (i == 0 ? false : false);
  4426. oldTypeArr.push(obj)
  4427. }
  4428. if (item.oldType.includes("农村留守老年人")) {
  4429. oldTypeArr[0].checked = true;
  4430. oldTypeArr[1].disable = true;
  4431. oldTypeArr[2].disable = true;
  4432. oldTypeArr[3].checked = true;
  4433. oldTypeArr[3].disable = true;
  4434. }
  4435. if (item.oldType.includes("分散供养特困老年人")) {
  4436. oldTypeArr[1].checked = true;
  4437. oldTypeArr[0].disable = true;
  4438. oldTypeArr[2].disable = true;
  4439. oldTypeArr[3].disable = true;
  4440. }
  4441. if (item.oldType.includes("计划生育特殊家庭老人")) {
  4442. oldTypeArr[2].checked = true;
  4443. oldTypeArr[0].disable = true;
  4444. oldTypeArr[1].disable = true;
  4445. oldTypeArr[3].disable = true;
  4446. }
  4447. if (item.oldType.includes("空巢老年人") && item.oldType.includes("农村留守老年人")) {
  4448. oldTypeArr[3].checked = true;
  4449. oldTypeArr[1].disable = true;
  4450. oldTypeArr[2].disable = true;
  4451. }
  4452. if (item.oldType.includes("空巢老年人") && !item.oldType.includes("农村留守老年人")) {
  4453. oldTypeArr[3].checked = true;
  4454. oldTypeArr[1].disable = true;
  4455. oldTypeArr[2].disable = true;
  4456. oldTypeArr[0].disable = true;
  4457. }
  4458. if (item.oldType.includes("独居老年人")) {
  4459. oldTypeArr[4].checked = true;
  4460. }
  4461. if (item.oldType.includes("重残老人")) {
  4462. oldTypeArr[5].checked = true;
  4463. }
  4464. if (item.oldType.includes("高龄老人")) {
  4465. oldTypeArr[6].checked = true;
  4466. }
  4467. if (item.oldType.includes("失能老人")) {
  4468. oldTypeArr[7].checked = true;
  4469. }
  4470. disabilityAyyss.forEach(itemss => {
  4471. item.disabilityCategory.forEach(item => {
  4472. if (itemss.name == item) {
  4473. itemss.checked = true;
  4474. }
  4475. })
  4476. })
  4477. familyHelpArr.forEach(itemss => {
  4478. item.rescueState.forEach(item => {
  4479. if (itemss.name == item) {
  4480. itemss.checked = true;
  4481. }
  4482. })
  4483. })
  4484. moneyFromAyy.forEach(itemss => {
  4485. item.sourceOfIncome.forEach(item => {
  4486. if (itemss.name == item) {
  4487. itemss.checked = true;
  4488. }
  4489. })
  4490. })
  4491. loveRequire.forEach(itemss => {
  4492. item.demand.forEach(item => {
  4493. if (itemss.name == item) {
  4494. itemss.checked = true;
  4495. }
  4496. })
  4497. })
  4498. let chooseAdressArr = [];
  4499. let chooseAdressArr1 = [];
  4500. if (item.nativePlace && item.nativePlaceId) {
  4501. let nativePlaces = item.nativePlace.split('/');
  4502. let nativePlaceId = item.nativePlaceId.split(',');
  4503. chooseAdressArr = nativePlaces.map((item, i) => ({
  4504. CIVILREGIONALISMNAME: item,
  4505. CIVILREGIONALISMID: nativePlaceId[i]
  4506. }));
  4507. if (item.isSameWithAddress == '是') {
  4508. isSameWithAddresss.forEach(item => {
  4509. item.checked = true;
  4510. })
  4511. chooseAdressArr1 = chooseAdressArr;
  4512. }
  4513. }
  4514. let addressExts = '';
  4515. if (item.addressExt) {
  4516. addressExts = item.addressExt
  4517. }
  4518. let nativePlaceExts = '';
  4519. if (item.nativePlaceExt) {
  4520. nativePlaceExts = item.nativePlaceExt
  4521. }
  4522. if (item.address && item.nativePlaceId) {
  4523. let address = item.address.split('/');
  4524. let addressId = item.addressId.split(',');
  4525. chooseAdressArr1 = address.map((item, i) => ({
  4526. CIVILREGIONALISMNAME: item,
  4527. CIVILREGIONALISMID: addressId[i]
  4528. }));
  4529. }
  4530. return {
  4531. ...item,
  4532. oldSex: oldSex.map(items => {
  4533. if (items.name == item.sex) {
  4534. return {
  4535. name: items.name,
  4536. checked: true
  4537. }
  4538. }
  4539. return {
  4540. name: items.name,
  4541. checked: false
  4542. }
  4543. }),
  4544. oldMarry: oldMarry.map(items => {
  4545. if (items.name == item.partnerState) {
  4546. return {
  4547. name: items.name,
  4548. checked: true
  4549. }
  4550. }
  4551. return {
  4552. name: items.name,
  4553. checked: false
  4554. }
  4555. }),
  4556. addressExt: addressExts,
  4557. nativePlaceExt: nativePlaceExts,
  4558. imgPath: imgPath,
  4559. healthAyy: finalarr,
  4560. disabilityAyy: disabilityAyyss,
  4561. moneyFromAyy: moneyFromAyy,
  4562. familyHelpArr: familyHelpArr,
  4563. otherInfo: otherInfo, //赡养人存在么
  4564. mainLookSex: mainLookSex.map(items => {
  4565. if (items.name == item.mainLookSex) {
  4566. return {
  4567. name: items.name,
  4568. checked: true
  4569. }
  4570. }
  4571. return {
  4572. name: items.name,
  4573. checked: false
  4574. }
  4575. }),
  4576. loneArr: loneArr.map(items => {
  4577. if (items.name == item.isLoss) {
  4578. return {
  4579. name: items.name,
  4580. checked: true
  4581. }
  4582. }
  4583. return {
  4584. name: items.name,
  4585. checked: false
  4586. }
  4587. }),
  4588. liveStatus: accompanyArr,
  4589. oftenMan: lookAfterArr,
  4590. loveRequire: loveRequire,
  4591. oldType: oldTypeArr,
  4592. chooseAdressArr: chooseAdressArr,
  4593. isSameWithAddress: isSameWithAddresss,
  4594. chooseAdressArr1: chooseAdressArr1,
  4595. }
  4596. })
  4597. let def = datass.map(item => {
  4598. console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
  4599. let sex = [{
  4600. name: '男',
  4601. checked: false
  4602. },
  4603. {
  4604. name: '女',
  4605. checked: false
  4606. }
  4607. ]
  4608. let otherInfo = '';
  4609. let name = '';
  4610. let phone = ''
  4611. let relation = ''
  4612. let relationExt = ''
  4613. let outgoingCause = ''
  4614. let isHasGoOut = ''
  4615. let outgoingTime = ''
  4616. let isHasPartner = ''
  4617. let outgoingplace = ''
  4618. let phone2 = ''
  4619. let name2 = ''
  4620. let visit = '';
  4621. if (item.otherInfo) {
  4622. let partol = this.removeExcess(item.otherInfo);
  4623. otherInfo = '是'
  4624. if (partol.name) {
  4625. name = partol.name
  4626. }
  4627. if (partol.sex) {
  4628. sex.forEach(items => {
  4629. if (items.name == partol.sex) {
  4630. items.checked = true;
  4631. }
  4632. })
  4633. }
  4634. if (partol.phone) {
  4635. phone = partol.phone
  4636. }
  4637. if (partol.relation) {
  4638. relation = partol.relation
  4639. }
  4640. if (partol.relationExt) {
  4641. relationExt = partol.relationExt
  4642. }
  4643. if (partol.visit) {
  4644. visit = partol.visit;
  4645. }
  4646. if (partol.isHasGoOut) {
  4647. isHasGoOut = partol.isHasGoOut;
  4648. }
  4649. if (partol.outgoingCause) {
  4650. outgoingCause = partol.outgoingCause;
  4651. }
  4652. if (partol.outgoingTime) {
  4653. outgoingTime = partol.outgoingTime;
  4654. }
  4655. if (partol.isHasPartner) {
  4656. isHasPartner = partol.isHasPartner;
  4657. }
  4658. if (partol.outgoingplace) {
  4659. outgoingplace = partol.outgoingplace;
  4660. }
  4661. if (partol.name2) {
  4662. name2 = partol.name2;
  4663. }
  4664. if (partol.phone2) {
  4665. phone2 = partol.phone2;
  4666. }
  4667. } else if (item.otherInfo == '') {
  4668. otherInfo = '否'
  4669. } else {
  4670. otherInfo = ''
  4671. }
  4672. return {
  4673. ...item,
  4674. isHasOther: otherInfo, //赡养人存在
  4675. // name: name,
  4676. // othersyrSexArr: sex,
  4677. // phone: phone,
  4678. // othersyrRelationValue: othersyrRelationValue,
  4679. // relationExt: relationExt,
  4680. // visit: visit,
  4681. Info: {
  4682. name: name,
  4683. phone: phone,
  4684. relation: relation,
  4685. relationExt: relationExt,
  4686. isHasGoOut: isHasGoOut,
  4687. outgoingCause: outgoingCause,
  4688. outgoingTime: outgoingTime,
  4689. isHasPartner: isHasPartner,
  4690. outgoingplace: outgoingplace,
  4691. visit: visit,
  4692. name2: name2,
  4693. phone2: phone2,
  4694. othersyrSexArr: sex
  4695. }
  4696. }
  4697. })
  4698. let ghi = datass.map(item => {
  4699. // console.log(item, "8888888888888888888888888888888888888888888888888888");
  4700. let childrenNum = '';
  4701. if (item.childrenNum) {
  4702. if (item.childrenNum == '4') {
  4703. childrenNum = '3个以上'
  4704. } else {
  4705. childrenNum = item.childrenNum + '个'
  4706. }
  4707. } else {
  4708. childrenNum = ''
  4709. }
  4710. let Info = [];
  4711. if (item.childInfo) {
  4712. let partol = this.removeExcess(item.childInfo);
  4713. Info = partol
  4714. } else {
  4715. if (parseInt(childrenNum) == 5) {
  4716. for (let i = 0; i < parseInt(childrenNum) - 1; i++) {
  4717. let chlidInfos = {
  4718. name: '', // 姓名
  4719. sex: '',
  4720. phone: '', // 常用联系电话,
  4721. isHasGoOut: '', // 子女是否外出
  4722. outgoingplace: '', // 外出地点
  4723. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  4724. name2: '', // 子女配偶姓名
  4725. phone2: '', // 子女配偶电话
  4726. outgoingTime: '', // 最后一次离家时间
  4727. outgoingCause: '', // 外出原因
  4728. visit: '', // 平均一年探望次数
  4729. }
  4730. Info.push(chlidInfos)
  4731. }
  4732. } else {
  4733. for (let i = 0; i < parseInt(childrenNum); i++) {
  4734. let chlidInfos = {
  4735. name: '', // 姓名
  4736. sex: '',
  4737. phone: '', // 常用联系电话,
  4738. isHasGoOut: '', // 子女是否外出
  4739. outgoingplace: '', // 外出地点
  4740. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  4741. name2: '', // 子女配偶姓名
  4742. phone2: '', // 子女配偶电话
  4743. outgoingTime: '', // 最后一次离家时间
  4744. outgoingCause: '', // 外出原因
  4745. visit: '', // 平均一年探望次数
  4746. }
  4747. Info.push(chlidInfos)
  4748. }
  4749. }
  4750. }
  4751. return {
  4752. ...item,
  4753. childrenNum: childrenNum,
  4754. Info: Info
  4755. }
  4756. })
  4757. let zzz = datass.map(item => {
  4758. let visitModeExt = ''
  4759. let visitCountExt = ''
  4760. let visitMode = [{
  4761. name: '电话问候',
  4762. checked: false
  4763. }, {
  4764. name: '上门巡访',
  4765. checked: false
  4766. }, {
  4767. name: '其它',
  4768. checked: false
  4769. }]
  4770. let visitCounts = [{
  4771. name: '每天',
  4772. checked: false
  4773. }, {
  4774. name: '每周',
  4775. checked: false
  4776. }, {
  4777. name: '每月',
  4778. checked: false
  4779. },
  4780. {
  4781. name: '每季',
  4782. checked: false
  4783. },
  4784. {
  4785. name: '其它',
  4786. checked: false
  4787. }
  4788. ];
  4789. if (item.regularsInfo) {
  4790. let partol = this.removeExcess(item.regularsInfo);
  4791. let partols = this.removeExcess(partol.visitMode);
  4792. if (partol.visitMode) {
  4793. visitMode.forEach(items => {
  4794. partols.forEach(itemss => {
  4795. if (items.name == itemss) {
  4796. items.checked = true;
  4797. }
  4798. })
  4799. })
  4800. }
  4801. if (partol.visitCount) {
  4802. visitCounts.forEach(items => {
  4803. if (items.name == partol.visitCount) {
  4804. items.checked = true;
  4805. }
  4806. })
  4807. }
  4808. if (partol.visitCountExt) {
  4809. visitCountExt = partol.visitCountExt;
  4810. }
  4811. if (partol.visitModeExt) {
  4812. visitModeExt = partol.visitModeExt;
  4813. }
  4814. }
  4815. return {
  4816. ...item,
  4817. visitCountExt: visitCountExt,
  4818. visitModeExt: visitModeExt,
  4819. visitMode: visitMode,
  4820. visitCount: visitCounts,
  4821. }
  4822. })
  4823. let mmm = datass.map(item => {
  4824. if (item.regularsInfo) {
  4825. let partol = this.removeExcess(item.regularsInfo);
  4826. let partols = this.removeExcess(partol.visitMode);
  4827. console.log(partol, "111111111111111111111");
  4828. console.log(partols, "99999999999999999999");
  4829. return {
  4830. visitCount: partol.visitCount,
  4831. visitCountExt: partol.visitCountExt,
  4832. visitMode: partols,
  4833. visitModeExt: partol.visitModeExt,
  4834. }
  4835. }
  4836. })
  4837. console.log(mmm,"mmmmmmmmmmmmmm");
  4838. that.setData({
  4839. oldInfo: abc,
  4840. otherInfo: def,
  4841. childInfo: ghi,
  4842. regularsInfos: zzz,
  4843. regularsInfo: mmm
  4844. })
  4845. console.log(that.data.oldInfo, "老人的返现数组")
  4846. console.log(that.data.otherInfo, "其他的返现数组")
  4847. console.log(that.data.childInfo, "孩子的返现数组")
  4848. console.log(that.data.regularsInfos, "q巡访的返现数组")
  4849. }
  4850. })
  4851. } else {
  4852. }
  4853. },
  4854. })