collectInfo.js 152 KB

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