collectInfo.js 150 KB

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