collectInfo.js 147 KB

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