collectInfo.js 150 KB

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