collectInfo.js 149 KB

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