collectInfo.js 158 KB

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