collectInfo.js 147 KB

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