collectInfo.js 158 KB

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