collectInfo.js 132 KB

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