collectInfo.js 129 KB

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