collectInfo.js 145 KB

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