collectInfo.js 153 KB

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