collectInfo.js 148 KB

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