collectInfo.js 127 KB

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