collectInfo.js 129 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183
  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) {
  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. this.setData({
  1253. showAdressBox: false
  1254. })
  1255. },
  1256. pickSure1() {
  1257. let arr = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1';
  1258. let codeArr = [];
  1259. this.setData({
  1260. [arr]: []
  1261. })
  1262. codeArr.push(this.data.provinceCode, this.data.cityCode, this.data.areaCode, this.data.townCode, this.data.villageCode)
  1263. this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.push(this.data.province, this.data.city, this.data.area, this.data.town, this.data.village)
  1264. let a = this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.join("/");
  1265. let b = codeArr.join(",")
  1266. this.SubmitOldmanInfo({
  1267. id: this.data.nameArr[this.data.activeIndex]._id,
  1268. address: a,
  1269. addressId: b
  1270. })
  1271. this.setData({
  1272. showAdressBox1: false,
  1273. oldInfo: this.data.oldInfo
  1274. })
  1275. },
  1276. pickEsc1() {
  1277. this.setData({
  1278. showAdressBox1: false
  1279. })
  1280. },
  1281. bindpickstart(e) {
  1282. console.log(e, '滚动开始了')
  1283. wx.showLoading({
  1284. title: '加载中',
  1285. mask: true
  1286. })
  1287. setTimeout(function () {
  1288. wx.hideLoading()
  1289. }, 5000)
  1290. },
  1291. bindpickend(e) {
  1292. // console.log(e, '滚动结束了')
  1293. wx.hideLoading()
  1294. },
  1295. // 补充户籍地址
  1296. tab1Change6(e) {
  1297. let Info = 'oldInfo[' + this.data.activeIndex + '].nativePlaceExt'
  1298. this.setData({
  1299. [Info]: e.detail.value,
  1300. })
  1301. this.SubmitOldmanInfo({
  1302. id: this.data.nameArr[this.data.activeIndex]._id,
  1303. nativePlaceExt: e.detail.value
  1304. })
  1305. if (this.data.oldInfo[this.data.activeIndex].isSameWithAddress[0].checked) {
  1306. let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
  1307. this.setData({
  1308. [Infos]: e.detail.value
  1309. })
  1310. this.SubmitOldmanInfo({
  1311. id: this.data.nameArr[this.data.activeIndex]._id,
  1312. addressExt: e.detail.value
  1313. })
  1314. }
  1315. },
  1316. // 现居地址与户籍地址一致
  1317. tab1change6_1(e) {
  1318. const items = this.data.oldInfo[this.data.activeIndex].isSameWithAddress
  1319. const values = e.detail.value
  1320. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1321. items[i].checked = false
  1322. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1323. if (items[i].name === values[j]) {
  1324. items[i].checked = true
  1325. break
  1326. }
  1327. }
  1328. }
  1329. let isSameWithAddress = 'oldInfo[' + this.data.activeIndex + '].isSameWithAddress'
  1330. this.setData({
  1331. [isSameWithAddress]: items
  1332. })
  1333. let codeArr = [];
  1334. codeArr.push(this.data.provinceCode, this.data.cityCode, this.data.areaCode, this.data.townCode, this.data.villageCode)
  1335. let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
  1336. let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
  1337. if (e.detail.value[0] == '现居地址与户籍地址一致') {
  1338. this.setData({
  1339. nowAdress: true,
  1340. [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr,
  1341. [Infos]: this.data.oldInfo[this.data.activeIndex].nativePlaceExt
  1342. })
  1343. this.SubmitOldmanInfo({
  1344. id: this.data.nameArr[this.data.activeIndex]._id,
  1345. isSameWithAddress: '是'
  1346. })
  1347. let a = this.data.oldInfo[this.data.activeIndex].chooseAdressArr.join("/");
  1348. let b = codeArr.join(",")
  1349. this.SubmitOldmanInfo({
  1350. id: this.data.nameArr[this.data.activeIndex]._id,
  1351. address: a,
  1352. addressId: b
  1353. })
  1354. } else {
  1355. this.setData({
  1356. nowAdress: false,
  1357. [Info]: [],
  1358. [Infos]: []
  1359. })
  1360. this.SubmitOldmanInfo({
  1361. id: this.data.nameArr[this.data.activeIndex]._id,
  1362. isSameWithAddress: '否'
  1363. })
  1364. this.SubmitOldmanInfo({
  1365. id: this.data.nameArr[this.data.activeIndex]._id,
  1366. address: null,
  1367. addressId: null
  1368. })
  1369. }
  1370. },
  1371. // 补充现居住地址
  1372. tab1Change7(e) {
  1373. let Info = 'oldInfo[' + this.data.activeIndex + '].addressExt'
  1374. this.setData({
  1375. [Info]: e.detail.value
  1376. })
  1377. this.SubmitOldmanInfo({
  1378. id: this.data.nameArr[this.data.activeIndex]._id,
  1379. addressExt: e.detail.value
  1380. })
  1381. },
  1382. // 婚姻以及配偶情况
  1383. tab1Change8: function (e) {
  1384. let data = this.data.oldInfo[this.data.activeIndex].oldMarry.map(v => {
  1385. if (v.name == e.detail.value) {
  1386. return {
  1387. name: v.name,
  1388. checked: true
  1389. }
  1390. }
  1391. return {
  1392. name: v.name,
  1393. checked: false
  1394. }
  1395. })
  1396. let oldMarry = 'oldInfo[' + this.data.activeIndex + '].oldMarry'
  1397. let oldMarryValue = 'oldInfo[' + this.data.activeIndex + '].oldMarryValue'
  1398. this.setData({
  1399. [oldMarry]: data,
  1400. [oldMarryValue]: e.detail.value
  1401. })
  1402. this.SubmitOldmanInfo({
  1403. id: this.data.nameArr[this.data.activeIndex]._id,
  1404. partnerState: e.detail.value
  1405. })
  1406. if (!this.data.oldInfo[this.data.activeIndex].oldMarry[1].checked) {
  1407. this.SubmitOldmanInfo({
  1408. id: this.data.nameArr[this.data.activeIndex]._id,
  1409. partnerName: ''
  1410. })
  1411. this.SubmitOldmanInfo({
  1412. id: this.data.nameArr[this.data.activeIndex]._id,
  1413. partnerIdNumber: ''
  1414. })
  1415. }
  1416. },
  1417. //配偶的姓名
  1418. tab1Change8_1(e) {
  1419. let partnerName = 'oldInfo[' + this.data.activeIndex + '].partnerName'
  1420. this.setData({
  1421. [partnerName]: e.detail.value
  1422. })
  1423. this.formCheckPartnerName();
  1424. if (!this.data.oldisMarryName) {
  1425. this.SubmitOldmanInfo({
  1426. id: this.data.nameArr[this.data.activeIndex]._id,
  1427. partnerName: e.detail.value
  1428. })
  1429. }
  1430. },
  1431. //配偶身份证号
  1432. tab1Change8_2(e) {
  1433. let partnerIdNumber = 'oldInfo[' + this.data.activeIndex + '].partnerIdNumber'
  1434. this.setData({
  1435. [partnerIdNumber]: e.detail.value
  1436. })
  1437. this.formCheckPartnerId();
  1438. if (!this.data.oldisMarryPhone && !this.data.oldisMarryPhoneGs) {
  1439. this.SubmitOldmanInfo({
  1440. id: this.data.nameArr[this.data.activeIndex]._id,
  1441. partnerIdNumber: e.detail.value
  1442. })
  1443. }
  1444. },
  1445. //健康状况
  1446. tab1Change9: function (e) {
  1447. const items = this.data.oldInfo[this.data.activeIndex].healthAyy
  1448. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1449. items[i].checked = false
  1450. for (let j = 0, lenJ = e.detail.value.length; j < lenJ; ++j) {
  1451. if (items[i].name === e.detail.value[j]) {
  1452. items[i].checked = true
  1453. break
  1454. }
  1455. }
  1456. }
  1457. let healthAyy = 'oldInfo[' + this.data.activeIndex + '].healthAyy'
  1458. let healthAyyValue = 'oldInfo[' + this.data.activeIndex + '].healthAyyValue'
  1459. this.setData({
  1460. [healthAyy]: items,
  1461. [healthAyyValue]: e.detail.value
  1462. })
  1463. this.formCheckHealthNull();
  1464. let revise1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].disabled'
  1465. let revise2 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[2].disabled'
  1466. let revise3 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[3].disabled'
  1467. let rev1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].checked'
  1468. let rev2 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[2].checked'
  1469. let rev3 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[3].checked'
  1470. let index = e.detail.value.indexOf('健康');
  1471. if (index >= 0) {
  1472. this.setData({
  1473. [revise1]: true,
  1474. [revise2]: true,
  1475. [revise3]: true,
  1476. [rev1]: false,
  1477. [rev2]: false,
  1478. [rev3]: false
  1479. })
  1480. this.SubmitOldmanInfo({
  1481. id: this.data.nameArr[this.data.activeIndex]._id,
  1482. health: JSON.stringify(['健康'])
  1483. })
  1484. } else {
  1485. this.setData({
  1486. [revise1]: false,
  1487. [revise2]: false,
  1488. [revise3]: false,
  1489. })
  1490. }
  1491. if (index < 0 && e.detail.value.length != 0) {
  1492. this.SubmitOldmanInfo({
  1493. id: this.data.nameArr[this.data.activeIndex]._id,
  1494. health: JSON.stringify(e.detail.value)
  1495. })
  1496. }
  1497. },
  1498. // 残疾类别
  1499. tab1Change10: function (e) {
  1500. const items = this.data.oldInfo[this.data.activeIndex].disabilityAyy
  1501. const values = e.detail.value
  1502. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1503. items[i].checked = false
  1504. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1505. if (items[i].name === values[j]) {
  1506. items[i].checked = true
  1507. break
  1508. }
  1509. }
  1510. }
  1511. let disabilityAyy = 'oldInfo[' + this.data.activeIndex + '].disabilityAyy'
  1512. let disabilityAyyValue = 'oldInfo[' + this.data.activeIndex + '].disabilityAyyValue'
  1513. this.setData({
  1514. [disabilityAyy]: items,
  1515. [disabilityAyyValue]: e.detail.value
  1516. })
  1517. this.formCheckabilityNull();
  1518. if (this.data.oldInfo[this.data.activeIndex].disabilityAyyValue.length != 0) {
  1519. this.SubmitOldmanInfo({
  1520. id: this.data.nameArr[this.data.activeIndex]._id,
  1521. disabilityCategory: JSON.stringify(e.detail.value)
  1522. })
  1523. }
  1524. },
  1525. // 重特大疾病类别
  1526. tab1Change10_1: function (e) {
  1527. const items = this.data.oldInfo[this.data.activeIndex].sickType
  1528. const values = e.detail.value
  1529. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1530. items[i].checked = false
  1531. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1532. if (items[i].name === values[j]) {
  1533. items[i].checked = true
  1534. break
  1535. }
  1536. }
  1537. }
  1538. let sickType = 'oldInfo[' + this.data.activeIndex + '].sickType'
  1539. let sickTypeValue = 'oldInfo[' + this.data.activeIndex + '].sickTypeValue'
  1540. this.setData({
  1541. [sickType]: items,
  1542. [sickTypeValue]: e.detail.value
  1543. })
  1544. this.formChecksickTypeNull();
  1545. if (this.data.oldInfo[this.data.activeIndex].sickTypeValue.length != 0) {
  1546. this.SubmitOldmanInfo({
  1547. id: this.data.nameArr[this.data.activeIndex]._id,
  1548. majorDiseases: JSON.stringify(e.detail.value)
  1549. })
  1550. }
  1551. },
  1552. // 残疾人等级
  1553. tab1Change11: function (e) {
  1554. let disabilityLevel = 'oldInfo[' + this.data.activeIndex + '].disabilityLevel'
  1555. this.setData({
  1556. [disabilityLevel]: this.data.disableLeval[e.detail.value]
  1557. })
  1558. this.SubmitOldmanInfo({
  1559. id: this.data.nameArr[this.data.activeIndex]._id,
  1560. disabilityLevel: this.data.oldInfo[this.data.activeIndex].disabilityLevel
  1561. })
  1562. },
  1563. // 老年人能力情况
  1564. tab1Change12: function (e) {
  1565. let ability = 'oldInfo[' + this.data.activeIndex + '].ability'
  1566. let Info = 'oldInfo[' + this.data.activeIndex + '].oldType'
  1567. this.setData({
  1568. [ability]: this.data.ableStatus[e.detail.value]
  1569. })
  1570. if (e.detail.value == 2) {
  1571. this.setData({
  1572. [Info]: this.data.oldInfo[this.data.activeIndex].oldType.concat({
  1573. name: "失能老人",
  1574. disable: true,
  1575. checked: true
  1576. })
  1577. })
  1578. } else {
  1579. for (var i = 0; i < this.data.oldInfo[this.data.activeIndex].oldType.length; i++) {
  1580. if (this.data.oldInfo[this.data.activeIndex].oldType[i].name == '失能老人') {
  1581. this.data.oldInfo[this.data.activeIndex].oldType.splice(i, 1);
  1582. }
  1583. this.setData({
  1584. [Info]: this.data.oldInfo[this.data.activeIndex].oldType
  1585. })
  1586. }
  1587. }
  1588. this.SubmitOldmanInfo({
  1589. id: this.data.nameArr[this.data.activeIndex]._id,
  1590. ability: this.data.ableStatus[e.detail.value]
  1591. })
  1592. },
  1593. // 生活经济情况
  1594. tab1Change13: function (e) {
  1595. let livingCondition = 'oldInfo[' + this.data.activeIndex + '].livingCondition'
  1596. this.setData({
  1597. [livingCondition]: this.data.moneyStatus[e.detail.value]
  1598. })
  1599. this.SubmitOldmanInfo({
  1600. id: this.data.nameArr[this.data.activeIndex]._id,
  1601. livingCondition: this.data.moneyStatus[e.detail.value]
  1602. })
  1603. },
  1604. // 收入来源
  1605. tab1Change14: function (e) {
  1606. const items = this.data.oldInfo[this.data.activeIndex].moneyFromAyy
  1607. const values = e.detail.value
  1608. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1609. items[i].checked = false
  1610. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1611. if (items[i].name === values[j]) {
  1612. items[i].checked = true
  1613. break
  1614. }
  1615. }
  1616. }
  1617. let moneyFromAyy = 'oldInfo[' + this.data.activeIndex + '].moneyFromAyy'
  1618. let moneyFromAyyValue = 'oldInfo[' + this.data.activeIndex + '].moneyFromAyyValue'
  1619. this.setData({
  1620. [moneyFromAyy]: items,
  1621. [moneyFromAyyValue]: e.detail.value
  1622. })
  1623. this.formCheckmoneyNull();
  1624. if (this.data.oldInfo[this.data.activeIndex].moneyFromAyyValue.length != 0) {
  1625. this.SubmitOldmanInfo({
  1626. id: this.data.nameArr[this.data.activeIndex]._id,
  1627. sourceOfIncome: JSON.stringify(e.detail.value)
  1628. })
  1629. }
  1630. },
  1631. // 其他收入来源sourceOfIncomeExt
  1632. tab1Change14_1: function (e) {
  1633. let sourceOfIncomeExt = 'oldInfo[' + this.data.activeIndex + '].sourceOfIncomeExt'
  1634. this.setData({
  1635. [sourceOfIncomeExt]: e.detail.value
  1636. })
  1637. this.formCheckmoneyQtNull()
  1638. if (e.detail.value != '' && e.detail.value != null) {
  1639. this.SubmitOldmanInfo({
  1640. id: this.data.nameArr[this.data.activeIndex]._id,
  1641. sourceOfIncomeExt: e.detail.value
  1642. })
  1643. }
  1644. },
  1645. // 本人上年度可支配收入
  1646. tab1Change15: function (e) {
  1647. let income = 'oldInfo[' + this.data.activeIndex + '].income'
  1648. this.setData({
  1649. [income]: this.data.payMoney[e.detail.value]
  1650. })
  1651. this.SubmitOldmanInfo({
  1652. id: this.data.nameArr[this.data.activeIndex]._id,
  1653. income: this.data.payMoney[e.detail.value]
  1654. })
  1655. },
  1656. // 家庭救助帮扶情况
  1657. tab1Change16: function (e) {
  1658. const items = this.data.oldInfo[this.data.activeIndex].familyHelpArr
  1659. const values = e.detail.value
  1660. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1661. items[i].checked = false
  1662. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1663. if (items[i].name === values[j]) {
  1664. items[i].checked = true
  1665. break
  1666. }
  1667. }
  1668. }
  1669. let familyHelpArr = 'oldInfo[' + this.data.activeIndex + '].familyHelpArr'
  1670. let familyHelpArrValue = 'oldInfo[' + this.data.activeIndex + '].familyHelpArrValue'
  1671. this.setData({
  1672. [familyHelpArr]: items,
  1673. [familyHelpArrValue]: e.detail.value
  1674. })
  1675. this.formCheckhelpNull();
  1676. this.SubmitOldmanInfo({
  1677. id: this.data.nameArr[this.data.activeIndex]._id,
  1678. rescueState: JSON.stringify(e.detail.value)
  1679. })
  1680. },
  1681. // 其他救助帮扶情况
  1682. tab1Change16_1: function (e) {
  1683. let rescueStateExt = 'oldInfo[' + this.data.activeIndex + '].rescueStateExt'
  1684. this.setData({
  1685. [rescueStateExt]: e.detail.value
  1686. })
  1687. this.formCheckhelpQtNull();
  1688. if (e.detail.value != null && e.detail.value != '') {
  1689. this.SubmitOldmanInfo({
  1690. id: this.data.nameArr[this.data.activeIndex]._id,
  1691. rescueStateExt: e.detail.value
  1692. })
  1693. }
  1694. },
  1695. // 是否为失独家庭
  1696. tab1Change17: function (e) {
  1697. let data = this.data.oldInfo[this.data.activeIndex].loneArr.map(v => {
  1698. if (v.name == e.detail.value) {
  1699. return {
  1700. name: v.name,
  1701. checked: true
  1702. }
  1703. }
  1704. return {
  1705. name: v.name,
  1706. checked: false
  1707. }
  1708. })
  1709. let loneArr = 'oldInfo[' + this.data.activeIndex + '].loneArr'
  1710. let loneArrValue = 'oldInfo[' + this.data.activeIndex + '].loneArrValue'
  1711. this.setData({
  1712. [loneArr]: data,
  1713. [loneArrValue]: e.detail.value
  1714. })
  1715. this.SubmitOldmanInfo({
  1716. id: this.data.nameArr[this.data.activeIndex]._id,
  1717. isLoss: e.detail.value
  1718. })
  1719. },
  1720. // 陪伴居住情况
  1721. tab1Change18: function (e) {
  1722. const items = this.data.oldInfo[this.data.activeIndex].liveStatus
  1723. const values = e.detail.value
  1724. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1725. items[i].checked = false
  1726. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1727. if (items[i].name === values[j]) {
  1728. items[i].checked = true
  1729. break
  1730. }
  1731. }
  1732. }
  1733. let liveStatus = 'oldInfo[' + this.data.activeIndex + '].liveStatus'
  1734. let liveStatusValue = 'oldInfo[' + this.data.activeIndex + '].liveStatusValue'
  1735. this.setData({
  1736. [liveStatus]: items,
  1737. [liveStatusValue]: e.detail.value
  1738. })
  1739. this.formCheckliveNull();
  1740. let revise1 = "oldInfo[" + this.data.activeIndex + "].liveStatus[1].disabled";
  1741. let revise2 = "oldInfo[" + this.data.activeIndex + "].liveStatus[2].disabled";
  1742. let revise3 = "oldInfo[" + this.data.activeIndex + "].liveStatus[3].disabled";
  1743. let revise4 = "oldInfo[" + this.data.activeIndex + "].liveStatus[4].disabled";
  1744. let rev1 = "oldInfo[" + this.data.activeIndex + "].liveStatus[1].checked";
  1745. let rev2 = "oldInfo[" + this.data.activeIndex + "].liveStatus[2].checked";
  1746. let rev3 = "oldInfo[" + this.data.activeIndex + "].liveStatus[3].checked";
  1747. let rev4 = "oldInfo[" + this.data.activeIndex + "].liveStatus[4].checked";
  1748. let index = e.detail.value.indexOf('无人陪伴居住');
  1749. if (index >= 0) {
  1750. this.setData({
  1751. [revise1]: true,
  1752. [revise2]: true,
  1753. [revise3]: true,
  1754. [revise4]: true,
  1755. [rev1]: false,
  1756. [rev2]: false,
  1757. [rev3]: false,
  1758. [rev4]: false,
  1759. })
  1760. this.SubmitOldmanInfo({
  1761. id: this.data.nameArr[this.data.activeIndex]._id,
  1762. accompany: JSON.stringify(['无人陪伴居住'])
  1763. })
  1764. } else {
  1765. this.setData({
  1766. [revise1]: false,
  1767. [revise2]: false,
  1768. [revise3]: false,
  1769. [revise4]: false
  1770. })
  1771. }
  1772. if (index < 0 && e.detail.value.length != 0) {
  1773. this.SubmitOldmanInfo({
  1774. id: this.data.nameArr[this.data.activeIndex]._id,
  1775. accompany: JSON.stringify(e.detail.value)
  1776. })
  1777. }
  1778. },
  1779. // 其他陪伴居住情况
  1780. tab1Change18_1: function (e) {
  1781. let accompanyExt = 'oldInfo[' + this.data.activeIndex + '].accompanyExt'
  1782. this.setData({
  1783. [accompanyExt]: e.detail.value
  1784. })
  1785. this.formCheckliveqtNull();
  1786. if (e.detail.value != null && e.detail.value != '') {
  1787. this.SubmitOldmanInfo({
  1788. id: this.data.nameArr[this.data.activeIndex]._id,
  1789. accompanyExt: e.detail.value
  1790. })
  1791. }
  1792. },
  1793. // 日常生活照料人
  1794. tab1Change19: function (e) {
  1795. const items = this.data.oldInfo[this.data.activeIndex].oftenMan
  1796. const values = e.detail.value
  1797. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1798. items[i].checked = false
  1799. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1800. if (items[i].name === values[j]) {
  1801. items[i].checked = true
  1802. break
  1803. }
  1804. }
  1805. }
  1806. let oftenMan = 'oldInfo[' + this.data.activeIndex + '].oftenMan'
  1807. let oftenManValue = 'oldInfo[' + this.data.activeIndex + '].oftenManValue'
  1808. this.setData({
  1809. [oftenMan]: items,
  1810. [oftenManValue]: e.detail.value
  1811. })
  1812. let revise1 = "oldInfo[" + this.data.activeIndex + "].oftenMan[1].disabled";
  1813. let revise2 = "oldInfo[" + this.data.activeIndex + "].oftenMan[2].disabled";
  1814. let revise3 = "oldInfo[" + this.data.activeIndex + "].oftenMan[3].disabled";
  1815. let revise4 = "oldInfo[" + this.data.activeIndex + "].oftenMan[4].disabled";
  1816. let revise5 = "oldInfo[" + this.data.activeIndex + "].oftenMan[5].disabled";
  1817. let rev1 = "oldInfo[" + this.data.activeIndex + "].oftenMan[1].checked";
  1818. let rev2 = "oldInfo[" + this.data.activeIndex + "].oftenMan[2].checked";
  1819. let rev3 = "oldInfo[" + this.data.activeIndex + "].oftenMan[3].checked";
  1820. let rev4 = "oldInfo[" + this.data.activeIndex + "].oftenMan[4].checked";
  1821. let rev5 = "oldInfo[" + this.data.activeIndex + "].oftenMan[5].checked";
  1822. this.formCheckoftenNull();
  1823. let index = e.detail.value.indexOf('无人照料');
  1824. if (index >= 0) {
  1825. this.setData({
  1826. [revise1]: true,
  1827. [revise2]: true,
  1828. [revise3]: true,
  1829. [revise4]: true,
  1830. [revise5]: true,
  1831. [rev1]: false,
  1832. [rev2]: false,
  1833. [rev3]: false,
  1834. [rev4]: false,
  1835. [rev5]: false,
  1836. })
  1837. this.SubmitOldmanInfo({
  1838. id: this.data.nameArr[this.data.activeIndex]._id,
  1839. lookAfter: JSON.stringify(['无人照料'])
  1840. })
  1841. } else {
  1842. this.setData({
  1843. [revise1]: false,
  1844. [revise2]: false,
  1845. [revise3]: false,
  1846. [revise4]: false,
  1847. [revise5]: false
  1848. })
  1849. }
  1850. if (index < 0 && e.detail.value.length != 0) {
  1851. this.SubmitOldmanInfo({
  1852. id: this.data.nameArr[this.data.activeIndex]._id,
  1853. lookAfter: JSON.stringify(e.detail.value)
  1854. })
  1855. }
  1856. },
  1857. // 其他人员关系
  1858. tab1Change20: function (e) {
  1859. let lookAfterExt = 'oldInfo[' + this.data.activeIndex + '].lookAfterExt'
  1860. this.setData({
  1861. [lookAfterExt]: e.detail.value
  1862. })
  1863. this.formCheckoftenQtNull();
  1864. if (e.detail.value != null && e.detail.value != '') {
  1865. this.SubmitOldmanInfo({
  1866. id: this.data.nameArr[this.data.activeIndex]._id,
  1867. lookAfterExt: e.detail.value
  1868. })
  1869. }
  1870. },
  1871. // 主要照料人姓名
  1872. tab1Change21: function (e) {
  1873. let mainLookName = 'oldInfo[' + this.data.activeIndex + '].mainLookName'
  1874. this.setData({
  1875. [mainLookName]: e.detail.value
  1876. })
  1877. this.formCheckoftenNameNull();
  1878. if (e.detail.value != null && e.detail.value != '') {
  1879. this.SubmitOldmanInfo({
  1880. id: this.data.nameArr[this.data.activeIndex]._id,
  1881. mainLookName: e.detail.value
  1882. })
  1883. }
  1884. },
  1885. // 主要照料人性别
  1886. tab1Change22: function (e) {
  1887. let data = this.data.oldInfo[this.data.activeIndex].mainLookSex.map(v => {
  1888. if (v.name == e.detail.value) {
  1889. return {
  1890. name: v.name,
  1891. checked: true
  1892. }
  1893. }
  1894. return {
  1895. name: v.name,
  1896. checked: false
  1897. }
  1898. })
  1899. let mainLookSex = 'oldInfo[' + this.data.activeIndex + '].mainLookSex'
  1900. let mainLookSexValue = 'oldInfo[' + this.data.activeIndex + '].mainLookSexValue'
  1901. this.setData({
  1902. [mainLookSex]: data,
  1903. [mainLookSexValue]: e.detail.value
  1904. })
  1905. this.SubmitOldmanInfo({
  1906. id: this.data.nameArr[this.data.activeIndex]._id,
  1907. mainLookSex: e.detail.value
  1908. })
  1909. },
  1910. // 主要照料人电话
  1911. tab1Change23: function (e) {
  1912. let mainLookPhone = 'oldInfo[' + this.data.activeIndex + '].mainLookPhone'
  1913. this.setData({
  1914. [mainLookPhone]: e.detail.value
  1915. })
  1916. this.formCheckoftenPhoneNull();
  1917. if (e.detail.value != '' && e.detail.value != null) {
  1918. this.SubmitOldmanInfo({
  1919. id: this.data.nameArr[this.data.activeIndex]._id,
  1920. mainLookPhone: e.detail.value
  1921. })
  1922. }
  1923. },
  1924. // 关爱服务需求
  1925. tab1Change24: function (e) {
  1926. const items = this.data.oldInfo[this.data.activeIndex].loveRequire
  1927. const values = e.detail.value
  1928. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1929. items[i].checked = false
  1930. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1931. if (items[i].name === values[j]) {
  1932. items[i].checked = true
  1933. break
  1934. }
  1935. }
  1936. }
  1937. let loveRequire = 'oldInfo[' + this.data.activeIndex + '].loveRequire'
  1938. let loveRequireValue = 'oldInfo[' + this.data.activeIndex + '].loveRequireValue'
  1939. this.setData({
  1940. [loveRequire]: items,
  1941. [loveRequireValue]: e.detail.value
  1942. })
  1943. this.formCheckloveNull();
  1944. if (e.detail.value.length > 0) {
  1945. this.SubmitOldmanInfo({
  1946. id: this.data.nameArr[this.data.activeIndex]._id,
  1947. demand: JSON.stringify(e.detail.value)
  1948. })
  1949. }
  1950. },
  1951. // 其他关爱需求
  1952. tab1Change25: function (e) {
  1953. console.log(e)
  1954. let Info = 'oldInfo[' + this.data.activeIndex + '].demandExt'
  1955. this.setData({
  1956. [Info]: e.detail.value
  1957. })
  1958. this.formCheckloveQtNull();
  1959. if (e.detail.value != null && e.detail.value != '') {
  1960. this.SubmitOldmanInfo({
  1961. id: this.data.nameArr[this.data.activeIndex]._id,
  1962. demandExt: e.detail.value
  1963. })
  1964. }
  1965. },
  1966. //老年人类别
  1967. tab1Change26: function (e) {
  1968. const items = this.data.oldInfo[this.data.activeIndex].oldType
  1969. const values = e.detail.value
  1970. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  1971. items[i].checked = false
  1972. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  1973. if (items[i].name === values[j]) {
  1974. items[i].checked = true
  1975. break
  1976. }
  1977. }
  1978. }
  1979. let oldType = 'oldInfo[' + this.data.activeIndex + '].oldType'
  1980. let oldTypeValue = 'oldInfo[' + this.data.activeIndex + '].oldTypeValue'
  1981. this.setData({
  1982. [oldType]: items,
  1983. [oldTypeValue]: e.detail.value
  1984. })
  1985. let index1 = e.detail.value.indexOf('农村留守老年人')
  1986. let index2 = e.detail.value.indexOf('分散供养特困老年人')
  1987. let index3 = e.detail.value.indexOf('计划生育特殊家庭老人')
  1988. let index4 = e.detail.value.indexOf('空巢老年人')
  1989. let revise = this.data.oldInfo[this.data.activeIndex].oldType[0].checked;
  1990. let revise1 = "oldInfo[" + this.data.activeIndex + "].oldType[0].disable";
  1991. let revise2 = "oldInfo[" + this.data.activeIndex + "].oldType[1].disable";
  1992. let revise3 = "oldInfo[" + this.data.activeIndex + "].oldType[2].disable";
  1993. let revise4 = "oldInfo[" + this.data.activeIndex + "].oldType[3].disable";
  1994. let revise5 = "oldInfo[" + this.data.activeIndex + "].oldType[3].checked";
  1995. if (index1 >= 0) {
  1996. this.setData({
  1997. [revise2]: true,
  1998. [revise3]: true,
  1999. [revise4]: true,
  2000. [revise5]: true
  2001. })
  2002. } else {
  2003. this.setData({
  2004. [revise2]: false,
  2005. [revise3]: false,
  2006. [revise4]: false,
  2007. })
  2008. if (revise != this.data.villageOldChecked) {
  2009. this.setData({
  2010. [revise5]: false
  2011. })
  2012. } else {
  2013. if (index4 >= 0) {
  2014. this.setData({
  2015. [revise1]: true,
  2016. [revise2]: true,
  2017. [revise3]: true,
  2018. })
  2019. }
  2020. }
  2021. }
  2022. if (index2 >= 0) {
  2023. this.setData({
  2024. [revise1]: true,
  2025. [revise3]: true,
  2026. [revise4]: true
  2027. })
  2028. }
  2029. if (index2 < 0 && index1 < 0 && index3 < 0 && index4 < 0) {
  2030. this.setData({
  2031. [revise1]: false,
  2032. [revise2]: false,
  2033. [revise3]: false,
  2034. [revise4]: false
  2035. })
  2036. }
  2037. if (index3 >= 0) {
  2038. this.setData({
  2039. [revise1]: true,
  2040. [revise2]: true,
  2041. [revise4]: true
  2042. })
  2043. }
  2044. this.setData({
  2045. villageOldChecked: revise
  2046. })
  2047. let newArray = []; //新数组
  2048. let j = 0;
  2049. for (let i in this.data.oldInfo[this.data.activeIndex].oldType) {
  2050. if (this.data.oldInfo[this.data.activeIndex].oldType[i].checked) {
  2051. newArray[j++] = this.data.oldInfo[this.data.activeIndex].oldType[i].name
  2052. }
  2053. }
  2054. this.formCheckoldtypeNull();
  2055. if (newArray.length > 0) {
  2056. this.SubmitOldmanInfo({
  2057. id: this.data.nameArr[this.data.activeIndex]._id,
  2058. oldType: JSON.stringify(newArray)
  2059. })
  2060. }
  2061. },
  2062. goPhoto() {
  2063. let that = this;
  2064. isTwoOnshow = true;
  2065. wx.setStorageSync('isTwoOnshow', true)
  2066. wx.showLoading({
  2067. title: '加载中',
  2068. })
  2069. wx.chooseImage({
  2070. count: 1,
  2071. sizeType: ['compressed'],
  2072. sourceType: ['camera'],
  2073. success: function (res) {
  2074. const app = getApp()
  2075. app.globalData.id = '-1'
  2076. let tempFilePaths = res.tempFilePaths
  2077. wx.uploadFile({
  2078. url: util.globalData.publicUrl + '/sys/user/upload',
  2079. filePath: tempFilePaths[0],
  2080. name: 'uploadFile',
  2081. formData: {
  2082. "user": "test",
  2083. },
  2084. header: {
  2085. appletsId: wx.getStorageSync('openId'),
  2086. },
  2087. success: function (res) {
  2088. const app = getApp()
  2089. app.globalData.id = '-2'
  2090. let datas = JSON.parse(res.data)
  2091. let imgPath = 'oldInfo[' + that.data.activeIndex + '].imgPath'
  2092. let isHavePhoto = 'oldInfo[' + that.data.activeIndex + '].isHavePhoto'
  2093. that.setData({
  2094. [imgPath]: datas.data,
  2095. [isHavePhoto]: true,
  2096. })
  2097. // that.getSelfLocation();
  2098. that.SubmitOldmanInfo({
  2099. id: that.data.nameArr[that.data.activeIndex]._id,
  2100. photo: datas.data,
  2101. })
  2102. }
  2103. })
  2104. },
  2105. complete: (e) => {
  2106. wx.hideLoading();
  2107. }
  2108. })
  2109. },
  2110. closeImage(e) {
  2111. let imgPath = 'oldInfo[' + e.currentTarget.dataset.activeindex + '].imgPath'
  2112. this.setData({
  2113. [imgPath]: '',
  2114. })
  2115. this.SubmitOldmanInfo({
  2116. id: this.data.nameArr[this.data.activeIndex]._id,
  2117. photo: '',
  2118. })
  2119. },
  2120. // 子女个数
  2121. tab2Change1: function (e) {
  2122. let childrenNum = 'childInfo[' + this.data.activeIndex + '].childrenNum'
  2123. let Info = 'childInfo[' + this.data.activeIndex + '].Info'
  2124. this.setData({
  2125. [childrenNum]: this.data.childNumArr[e.detail.value],
  2126. })
  2127. if (e.detail.value == 0) {
  2128. this.setData({
  2129. [Info]: []
  2130. })
  2131. } else if (e.detail.value == 1) {
  2132. this.setData({
  2133. [Info]: [{
  2134. name: '', // 姓名
  2135. sex: '',
  2136. phone: '', // 常用联系电话,
  2137. isHasGoOut: '', // 子女是否外出
  2138. outgoingplace: '', // 外出地点
  2139. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2140. name2: '', // 子女配偶姓名
  2141. phone2: '', // 子女配偶电话
  2142. outgoingTime: '', // 最后一次离家时间
  2143. outgoingCause: '', // 外出原因
  2144. visit: '', // 平均一年探望次数
  2145. }]
  2146. })
  2147. } else if (e.detail.value == 2) {
  2148. this.setData({
  2149. [Info]: [{
  2150. name: '', // 姓名
  2151. sex: '',
  2152. phone: '', // 常用联系电话,
  2153. isHasGoOut: '', // 子女是否外出
  2154. outgoingplace: '', // 外出地点
  2155. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2156. name2: '', // 子女配偶姓名
  2157. phone2: '', // 子女配偶电话
  2158. outgoingTime: '', // 最后一次离家时间
  2159. outgoingCause: '', // 外出原因
  2160. visit: '', // 平均一年探望次数
  2161. }, {
  2162. name: '', // 姓名
  2163. sex: '',
  2164. phone: '', // 常用联系电话,
  2165. isHasGoOut: '', // 子女是否外出
  2166. outgoingplace: '', // 外出地点
  2167. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2168. name2: '', // 子女配偶姓名
  2169. phone2: '', // 子女配偶电话
  2170. outgoingTime: '', // 最后一次离家时间
  2171. outgoingCause: '', // 外出原因
  2172. visit: '', // 平均一年探望次数
  2173. }]
  2174. })
  2175. } else {
  2176. this.setData({
  2177. [Info]: [{
  2178. name: '', // 姓名
  2179. sex: '',
  2180. phone: '', // 常用联系电话,
  2181. isHasGoOut: '', // 子女是否外出
  2182. outgoingplace: '', // 外出地点
  2183. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2184. name2: '', // 子女配偶姓名
  2185. phone2: '', // 子女配偶电话
  2186. outgoingTime: '', // 最后一次离家时间
  2187. outgoingCause: '', // 外出原因
  2188. visit: '', // 平均一年探望次数
  2189. }, {
  2190. name: '', // 姓名
  2191. sex: '',
  2192. phone: '', // 常用联系电话,
  2193. isHasGoOut: '', // 子女是否外出
  2194. outgoingplace: '', // 外出地点
  2195. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2196. name2: '', // 子女配偶姓名
  2197. phone2: '', // 子女配偶电话
  2198. outgoingTime: '', // 最后一次离家时间
  2199. outgoingCause: '', // 外出原因
  2200. visit: '', // 平均一年探望次数
  2201. }, {
  2202. name: '', // 姓名
  2203. sex: '',
  2204. phone: '', // 常用联系电话,
  2205. isHasGoOut: '', // 子女是否外出
  2206. outgoingplace: '', // 外出地点
  2207. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  2208. name2: '', // 子女配偶姓名
  2209. phone2: '', // 子女配偶电话
  2210. outgoingTime: '', // 最后一次离家时间
  2211. outgoingCause: '', // 外出原因
  2212. visit: '', // 平均一年探望次数
  2213. }]
  2214. })
  2215. }
  2216. this.SubmitOldmanInfo({
  2217. id: this.data.nameArr[this.data.activeIndex]._id,
  2218. childrenNum: e.detail.value,
  2219. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2220. })
  2221. },
  2222. // 子女姓名
  2223. tab2Change2: function (e) {
  2224. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name';
  2225. this.setData({
  2226. [child]: e.detail.value
  2227. })
  2228. if (!e.detail.value) {
  2229. this.setData({
  2230. ['childNameNull[' + e.currentTarget.dataset.index + ']']: true
  2231. })
  2232. return false;
  2233. } else {
  2234. this.setData({
  2235. ['childNameNull[' + e.currentTarget.dataset.index + ']']: false
  2236. })
  2237. }
  2238. this.SubmitOldmanInfo({
  2239. id: this.data.nameArr[this.data.activeIndex]._id,
  2240. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2241. })
  2242. },
  2243. // 子女性别
  2244. tab2Change3: function (e) {
  2245. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].sex';
  2246. this.setData({
  2247. [child]: this.data.childSexArr[e.detail.value]
  2248. })
  2249. this.SubmitOldmanInfo({
  2250. id: this.data.nameArr[this.data.activeIndex]._id,
  2251. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2252. })
  2253. },
  2254. // 子女联系电话
  2255. tab2Change4: function (e) {
  2256. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].phone';
  2257. this.setData({
  2258. [child]: e.detail.value
  2259. })
  2260. if (!e.detail.value) {
  2261. this.setData({
  2262. ['childPhoneNull[' + e.currentTarget.dataset.index + ']']: true
  2263. })
  2264. return false;
  2265. } else {
  2266. this.setData({
  2267. ['childPhoneNull[' + e.currentTarget.dataset.index + ']']: false
  2268. })
  2269. }
  2270. this.SubmitOldmanInfo({
  2271. id: this.data.nameArr[this.data.activeIndex]._id,
  2272. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2273. })
  2274. },
  2275. // 子女是否外出
  2276. tab2Change5: function (e) {
  2277. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].isHasGoOut';
  2278. this.setData({
  2279. [child]: this.data.childIsout[e.detail.value]
  2280. })
  2281. this.SubmitOldmanInfo({
  2282. id: this.data.nameArr[this.data.activeIndex]._id,
  2283. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2284. })
  2285. },
  2286. //外出原因
  2287. tab2Change6: function (e) {
  2288. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingCause';
  2289. this.setData({
  2290. [child]: e.detail.value
  2291. })
  2292. // if (!e.detail.value) {
  2293. // let flag = 'ischildOutReason[' + e.currentTarget.dataset.index + '] ';
  2294. // this.setData({
  2295. // [flag]: true
  2296. // })
  2297. // return false;
  2298. // }
  2299. if (!e.detail.value) {
  2300. this.setData({
  2301. ['ischildOutReason[' + e.currentTarget.dataset.index + ']']: true
  2302. })
  2303. return false;
  2304. } else {
  2305. this.setData({
  2306. ['ischildOutReason[' + e.currentTarget.dataset.index + ']']: false
  2307. })
  2308. }
  2309. this.SubmitOldmanInfo({
  2310. id: this.data.nameArr[this.data.activeIndex]._id,
  2311. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2312. })
  2313. },
  2314. // 外出地点
  2315. tab2Change7: function (e) {
  2316. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingplace';
  2317. let a = e.detail.value.join("/");
  2318. this.setData({
  2319. [child]: a
  2320. })
  2321. this.SubmitOldmanInfo({
  2322. id: this.data.nameArr[this.data.activeIndex]._id,
  2323. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2324. })
  2325. },
  2326. // 最后一次离家时间
  2327. tab2Change8: function (e) {
  2328. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingTime';
  2329. this.setData({
  2330. [child]: e.detail.value
  2331. })
  2332. this.SubmitOldmanInfo({
  2333. id: this.data.nameArr[this.data.activeIndex]._id,
  2334. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2335. })
  2336. },
  2337. // 是否有配偶
  2338. tab2Change9: function (e) {
  2339. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].isHasPartner';
  2340. this.setData({
  2341. [child]: this.data.childIsMArry[e.detail.value]
  2342. })
  2343. this.SubmitOldmanInfo({
  2344. id: this.data.nameArr[this.data.activeIndex]._id,
  2345. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2346. })
  2347. },
  2348. // 配偶姓名
  2349. tab2Change10: function (e) {
  2350. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name2';
  2351. this.setData({
  2352. [child]: e.detail.value
  2353. })
  2354. if (!e.detail.value) {
  2355. this.setData({
  2356. ['ischildMarryName[' + e.currentTarget.dataset.index + ']']: true
  2357. })
  2358. return false;
  2359. } else {
  2360. this.setData({
  2361. ['ischildMarryName[' + e.currentTarget.dataset.index + ']']: false
  2362. })
  2363. }
  2364. this.SubmitOldmanInfo({
  2365. id: this.data.nameArr[this.data.activeIndex]._id,
  2366. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2367. })
  2368. },
  2369. // 配偶联系电话
  2370. tab2Change11: function (e) {
  2371. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].phone2';
  2372. this.setData({
  2373. [child]: e.detail.value
  2374. })
  2375. if (!e.detail.value) {
  2376. this.setData({
  2377. ['ischildMarryPhone[' + e.currentTarget.dataset.index + ']']: true
  2378. })
  2379. return false;
  2380. } else {
  2381. this.setData({
  2382. ['ischildMarryPhone[' + e.currentTarget.dataset.index + ']']: false
  2383. })
  2384. }
  2385. this.SubmitOldmanInfo({
  2386. id: this.data.nameArr[this.data.activeIndex]._id,
  2387. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2388. })
  2389. },
  2390. // 一年探望次数
  2391. tab2Change12: function (e) {
  2392. let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].visit';
  2393. this.setData({
  2394. [child]: this.data.childTfTimes[e.detail.value]
  2395. })
  2396. this.SubmitOldmanInfo({
  2397. id: this.data.nameArr[this.data.activeIndex]._id,
  2398. childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
  2399. })
  2400. },
  2401. // tab3是否有赡养人状态改变
  2402. tab3Change1: function (e) {
  2403. let isHasOther = 'otherInfo[' + this.data.activeIndex + '].isHasOther'
  2404. if (e.detail.value == '0') {
  2405. this.setData({
  2406. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2407. })
  2408. this.SubmitOldmanInfo({
  2409. id: this.data.nameArr[this.data.activeIndex]._id,
  2410. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2411. })
  2412. } else {
  2413. this.setData({
  2414. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2415. })
  2416. this.SubmitOldmanInfo({
  2417. id: this.data.nameArr[this.data.activeIndex]._id,
  2418. otherInfo: ''
  2419. })
  2420. }
  2421. this.setData({
  2422. [isHasOther]: this.data.othersyrArr[e.detail.value],
  2423. })
  2424. },
  2425. // 其他赡养人姓名
  2426. tab3Change2: function (e) {
  2427. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name'
  2428. this.setData({
  2429. [Info]: e.detail.value,
  2430. })
  2431. if (!e.detail.value) {
  2432. this.setData({
  2433. isothersyrName: true
  2434. })
  2435. return false;
  2436. } else {
  2437. this.setData({
  2438. isothersyrName: false
  2439. })
  2440. }
  2441. this.SubmitOldmanInfo({
  2442. id: this.data.nameArr[this.data.activeIndex]._id,
  2443. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2444. })
  2445. },
  2446. // 其他赡养人性别
  2447. tab3Change3: function (e) {
  2448. let data = this.data.otherInfo[this.data.activeIndex].Info.othersyrSexArr.map(v => {
  2449. if (v.name == e.detail.value) {
  2450. return {
  2451. name: v.name,
  2452. checked: true
  2453. }
  2454. }
  2455. return {
  2456. name: v.name,
  2457. checked: false
  2458. }
  2459. })
  2460. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.sex'
  2461. this.setData({
  2462. [Info]: e.detail.value
  2463. })
  2464. this.SubmitOldmanInfo({
  2465. id: this.data.nameArr[this.data.activeIndex]._id,
  2466. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2467. })
  2468. },
  2469. // 其他赡养人电话
  2470. tab3Change4: function (e) {
  2471. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.phone'
  2472. this.setData({
  2473. [Info]: e.detail.value,
  2474. })
  2475. if (!e.detail.value) {
  2476. this.setData({
  2477. isothersyrPhone: true
  2478. })
  2479. return false;
  2480. } else {
  2481. this.setData({
  2482. isothersyrPhone: false
  2483. })
  2484. }
  2485. this.SubmitOldmanInfo({
  2486. id: this.data.nameArr[this.data.activeIndex]._id,
  2487. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2488. })
  2489. },
  2490. // 与被赡养人关系状态改变
  2491. tab3Change5: function (e) {
  2492. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.relation'
  2493. this.setData({
  2494. [Info]: this.data.othersyrRelation[e.detail.value],
  2495. })
  2496. this.SubmitOldmanInfo({
  2497. id: this.data.nameArr[this.data.activeIndex]._id,
  2498. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2499. })
  2500. },
  2501. // 输选择其他时入与被赡养人其他关系
  2502. tab3Change6: function (e) {
  2503. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.relationExt'
  2504. this.setData({
  2505. [Info]: e.detail.value,
  2506. })
  2507. if (!e.detail.value) {
  2508. this.setData({
  2509. isothersyRelation: true
  2510. })
  2511. return false;
  2512. } else {
  2513. this.setData({
  2514. isothersyRelation: false
  2515. })
  2516. }
  2517. this.SubmitOldmanInfo({
  2518. id: this.data.nameArr[this.data.activeIndex]._id,
  2519. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2520. })
  2521. },
  2522. // 是否外出
  2523. tab3Change7: function (e) {
  2524. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.isHasGoOut'
  2525. this.setData({
  2526. [Info]: this.data.othersyrIsout[e.detail.value],
  2527. })
  2528. this.SubmitOldmanInfo({
  2529. id: this.data.nameArr[this.data.activeIndex]._id,
  2530. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2531. })
  2532. },
  2533. // 外出原因
  2534. tab3Change8: function (e) {
  2535. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingCause'
  2536. this.setData({
  2537. [Info]: e.detail.value,
  2538. })
  2539. if (!e.detail.value) {
  2540. this.setData({
  2541. isOutReason: true
  2542. })
  2543. return false;
  2544. } else {
  2545. this.setData({
  2546. isOutReason: false
  2547. })
  2548. }
  2549. this.SubmitOldmanInfo({
  2550. id: this.data.nameArr[this.data.activeIndex]._id,
  2551. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2552. })
  2553. },
  2554. // 外出地点改变
  2555. tab3Change9: function (e) {
  2556. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingplace'
  2557. let a = e.detail.value.join("/");
  2558. this.setData({
  2559. [Info]: a
  2560. })
  2561. this.SubmitOldmanInfo({
  2562. id: this.data.nameArr[this.data.activeIndex]._id,
  2563. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2564. })
  2565. },
  2566. //最后一次离家时间
  2567. tab3Change10: function (e) {
  2568. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingTime'
  2569. this.setData({
  2570. [Info]: e.detail.value,
  2571. })
  2572. this.SubmitOldmanInfo({
  2573. id: this.data.nameArr[this.data.activeIndex]._id,
  2574. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2575. })
  2576. },
  2577. //是否有配偶
  2578. tab3Change11: function (e) {
  2579. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.isHasPartner'
  2580. this.setData({
  2581. [Info]: this.data.othersyrIsMarry[e.detail.value],
  2582. })
  2583. this.SubmitOldmanInfo({
  2584. id: this.data.nameArr[this.data.activeIndex]._id,
  2585. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2586. })
  2587. },
  2588. // 配偶姓名
  2589. tab3Change12: function (e) {
  2590. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name2'
  2591. this.setData({
  2592. [Info]: e.detail.value,
  2593. })
  2594. if (!e.detail.value) {
  2595. this.setData({
  2596. isMarryName: true
  2597. })
  2598. return false;
  2599. } else {
  2600. this.setData({
  2601. isMarryName: false
  2602. })
  2603. }
  2604. this.SubmitOldmanInfo({
  2605. id: this.data.nameArr[this.data.activeIndex]._id,
  2606. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2607. })
  2608. },
  2609. // 配偶电话
  2610. tab3Change13: function (e) {
  2611. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.phone2'
  2612. this.setData({
  2613. [Info]: e.detail.value,
  2614. })
  2615. if (!e.detail.value) {
  2616. this.setData({
  2617. isMarryPhone: true
  2618. })
  2619. return false;
  2620. } else {
  2621. this.setData({
  2622. isMarryPhone: false
  2623. })
  2624. }
  2625. this.SubmitOldmanInfo({
  2626. id: this.data.nameArr[this.data.activeIndex]._id,
  2627. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2628. })
  2629. },
  2630. //平均一年探望次数
  2631. tab3Change14: function (e) {
  2632. let Info = 'otherInfo[' + this.data.activeIndex + '].Info.visit'
  2633. this.setData({
  2634. [Info]: this.data.othersyrTfTimes[e.detail.value],
  2635. })
  2636. this.SubmitOldmanInfo({
  2637. id: this.data.nameArr[this.data.activeIndex]._id,
  2638. otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
  2639. })
  2640. },
  2641. //tab4巡访方式
  2642. tab4Change1: function (e) {
  2643. const items = this.data.regularsInfos[this.data.activeIndex].visitMode
  2644. const values = e.detail.value
  2645. for (let i = 0, lenI = items.length; i < lenI; ++i) {
  2646. items[i].checked = false
  2647. for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
  2648. if (items[i].name === values[j]) {
  2649. items[i].checked = true
  2650. break
  2651. }
  2652. }
  2653. }
  2654. let visitMode = 'regularsInfos[' + this.data.activeIndex + '].visitMode'
  2655. let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
  2656. this.setData({
  2657. [visitMode]: items,
  2658. [visitMode1]: JSON.stringify(e.detail.value)
  2659. })
  2660. if (e.detail.value.length == 0) {
  2661. this.setData({
  2662. visitWaysFromOther: true
  2663. })
  2664. return false
  2665. } else {
  2666. this.setData({
  2667. visitWaysFromOther: false
  2668. })
  2669. }
  2670. console.log(this.data.regularsInfo)
  2671. this.SubmitOldmanInfo({
  2672. id: this.data.nameArr[this.data.activeIndex]._id,
  2673. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2674. })
  2675. },
  2676. // 巡防方式其他内容
  2677. tab4Change2: function (e) {
  2678. let Info = 'regularsInfos[' + this.data.activeIndex + '].visitModeExt'
  2679. let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitModeExt'
  2680. // let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
  2681. // let arrs = [];
  2682. // this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
  2683. // if (item.checked) {
  2684. // arrs.push(item.name)
  2685. // }
  2686. // })
  2687. this.setData({
  2688. [Info]: e.detail.value,
  2689. [Info1]: e.detail.value,
  2690. // [visitMode1]: arrs,
  2691. })
  2692. if (!e.detail.value) {
  2693. this.setData({
  2694. isVisittimesnull: true
  2695. })
  2696. return false
  2697. } else {
  2698. this.setData({
  2699. isVisittimesnull: false
  2700. })
  2701. }
  2702. this.SubmitOldmanInfo({
  2703. id: this.data.nameArr[this.data.activeIndex]._id,
  2704. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2705. })
  2706. },
  2707. // 巡访频次
  2708. tab4Change3: function (e) {
  2709. let data = this.data.regularsInfos[this.data.activeIndex].visitCount.map(v => {
  2710. if (v.name == e.detail.value) {
  2711. return {
  2712. name: v.name,
  2713. checked: true
  2714. }
  2715. }
  2716. return {
  2717. name: v.name,
  2718. checked: false
  2719. }
  2720. })
  2721. let visitCount = 'regularsInfos[' + this.data.activeIndex + '].visitCount'
  2722. let visitCount1 = 'regularsInfo[' + this.data.activeIndex + '].visitCount'
  2723. // let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
  2724. // let arrs = [];
  2725. // this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
  2726. // if (item.checked) {
  2727. // arrs.push(item.name)
  2728. // }
  2729. // })
  2730. this.setData({
  2731. [visitCount]: data,
  2732. [visitCount1]: e.detail.value,
  2733. // [visitMode1]: JSON.stringify(arrs),
  2734. })
  2735. this.SubmitOldmanInfo({
  2736. id: this.data.nameArr[this.data.activeIndex]._id,
  2737. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2738. })
  2739. },
  2740. // 巡防方式其他内容
  2741. tab4change4: function (e) {
  2742. let Info = 'regularsInfos[' + this.data.activeIndex + '].visitCountExt'
  2743. let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitCountExt'
  2744. let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
  2745. let arrs = [];
  2746. this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
  2747. if (item.checked) {
  2748. arrs.push(item.name)
  2749. }
  2750. })
  2751. this.setData({
  2752. [Info]: e.detail.value,
  2753. [Info1]: e.detail.value,
  2754. [visitMode1]: JSON.stringify(arrs),
  2755. })
  2756. if (!e.detail.value) {
  2757. this.setData({
  2758. isVisittimesQtnull: true
  2759. })
  2760. return false
  2761. } else {
  2762. this.setData({
  2763. isVisittimesQtnull: false
  2764. })
  2765. }
  2766. this.SubmitOldmanInfo({
  2767. id: this.data.nameArr[this.data.activeIndex]._id,
  2768. regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
  2769. })
  2770. },
  2771. removeExcess(data) {
  2772. if (data) {
  2773. data = JSON.parse(data);
  2774. }
  2775. return data;
  2776. },
  2777. huixian(id, name) {
  2778. if (!id) {
  2779. let showbj = true;
  2780. let oldInfo = [{
  2781. name: '',
  2782. oldSex: [{
  2783. name: '男'
  2784. }, {
  2785. name: '女'
  2786. }],
  2787. oldSexValue: '',
  2788. isSameWithAddress: [{
  2789. name: '现居地址与户籍地址一致'
  2790. }],
  2791. addressExt: '',
  2792. nativePlaceExt: '',
  2793. nation: '', //民族
  2794. idNumber: '', //身份证号
  2795. phone: '',
  2796. chooseAdressArr: [],
  2797. chooseAdressArr1: [],
  2798. oldMarry: [{
  2799. name: "未婚"
  2800. }, {
  2801. name: "已婚"
  2802. }, {
  2803. name: "离异"
  2804. }, {
  2805. name: "丧偶"
  2806. }],
  2807. oldMarryValue: '',
  2808. partnerName: '',
  2809. partnerIdNumber: '',
  2810. healthAyy: [{
  2811. name: "健康",
  2812. disabled: false
  2813. }, {
  2814. name: "残疾",
  2815. disabled: false
  2816. }, {
  2817. name: "患重特大疾病",
  2818. disabled: false
  2819. }, {
  2820. name: "老年人慢性病",
  2821. disabled: false
  2822. }],
  2823. healthAyyValue: [],
  2824. disabilityAyy: [{
  2825. name: "视力残疾"
  2826. }, {
  2827. name: "听力残疾"
  2828. }, {
  2829. name: "言语残疾"
  2830. }, {
  2831. name: "肢体残疾"
  2832. }, {
  2833. name: "智力残疾"
  2834. }, {
  2835. name: "精神残疾"
  2836. }, {
  2837. name: "多重残疾"
  2838. }],
  2839. disabilityAyyValue: [],
  2840. disabilityLevel: '', //残疾人类别
  2841. sickType: [{
  2842. name: "重大器官类疾病"
  2843. }, {
  2844. name: "心脑血管类疾病"
  2845. }, {
  2846. name: "神经与代谢类疾病"
  2847. }, {
  2848. name: "肢体与病毒类疾病"
  2849. }, {
  2850. name: "恶性肿瘤"
  2851. }],
  2852. sickTypeValue: [],
  2853. ability: '', //老年人能力情况
  2854. livingCondition: '', //生活经济情况
  2855. moneyFromAyy: [{
  2856. name: "家庭经营性收入"
  2857. }, {
  2858. name: "工资性收入"
  2859. }, {
  2860. name: "转移性收入"
  2861. }, {
  2862. name: "财产性收入"
  2863. }, {
  2864. name: "其它"
  2865. }],
  2866. moneyFromAyyValue: [],
  2867. income: '',
  2868. sourceOfIncomeExt: '', //其他收入情况
  2869. familyHelpArr: [{
  2870. name: "低保"
  2871. }, {
  2872. name: "建档立卡贫困户"
  2873. }, {
  2874. name: "医疗救助"
  2875. }, {
  2876. name: "临时救助"
  2877. }, {
  2878. name: "老年人福利津贴"
  2879. }, {
  2880. name: "残疾人两项补贴(或一项补贴)"
  2881. }, {
  2882. name: "其他救助"
  2883. }],
  2884. familyHelpArrValue: [],
  2885. rescueStateExt: '', //其他救助
  2886. loneArr: [{
  2887. name: "是"
  2888. }, {
  2889. name: "否"
  2890. }],
  2891. loneArrValue: '',
  2892. liveStatus: [{
  2893. name: "无人陪伴居住",
  2894. disabled: false
  2895. }, {
  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. liveStatusValue: [],
  2909. accompanyExt: '', //陪伴居住其他
  2910. oftenMan: [{
  2911. name: "无人照料",
  2912. disabled: false
  2913. }, {
  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. oftenManValue: [],
  2930. lookAfterExt: '', //其他日常生活照料人关系
  2931. mainLookName: '', //日常生活照料人姓名
  2932. mainLookSex: [{
  2933. name: "男"
  2934. }, {
  2935. name: "女"
  2936. }],
  2937. mainLookSexValue: '',
  2938. mainLookPhone: '', //
  2939. loveRequire: [{
  2940. name: "生活照料"
  2941. },
  2942. {
  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. loveRequireValue: [],
  2968. oldType: [{
  2969. name: "农村留守老年人",
  2970. disable: false,
  2971. checked: false
  2972. }, {
  2973. name: "分散供养特困老年人",
  2974. disable: false,
  2975. checked: false
  2976. }, {
  2977. name: "计划生育特殊家庭老人",
  2978. disable: false,
  2979. checked: false
  2980. }, {
  2981. name: "空巢老年人",
  2982. disable: false,
  2983. checked: false
  2984. }, {
  2985. name: "独居老年人",
  2986. disable: false,
  2987. checked: false
  2988. }, {
  2989. name: "重残老人",
  2990. disable: false,
  2991. checked: false
  2992. }, {
  2993. name: "高龄老人",
  2994. disable: false,
  2995. checked: false
  2996. }, {
  2997. name: "居家老年人",
  2998. disable: false,
  2999. checked: false
  3000. }],
  3001. oldTypeValue: [],
  3002. isHavePhoto: false,
  3003. imgPath: '',
  3004. photoAndLocation: '',
  3005. }];
  3006. let regularsInfos = [{
  3007. visitMode: [{
  3008. name: '电话问候',
  3009. checked: false
  3010. }, {
  3011. name: '上门巡访',
  3012. checked: false
  3013. }, {
  3014. name: '其它',
  3015. checked: false
  3016. }],
  3017. visitModeExt: '', //巡访其他
  3018. visitCount: [{
  3019. name: '每天',
  3020. checked: false
  3021. }, {
  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. visitCountExt: '', // 频次的其他
  3035. }];
  3036. let otherInfo = [{
  3037. isHasOther: '',
  3038. Info: {
  3039. name: '', // 其他赡养人姓名,
  3040. sex: '', //其他赡养人性别
  3041. phone: '', //其他赡养人电话,
  3042. relation: '', //与被赡养人关系 如果选了其他也是必填 单选
  3043. relationExt: '', //与被赡养人关系--其他
  3044. isHasGoOut: '', //是否外出
  3045. outgoingCause: '', //外出原因
  3046. outgoingplace: '', // 外出地点
  3047. outgoingTime: '', // 最后一次离家时间
  3048. isHasPartner: '', //是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0:是 1:否
  3049. name2: '',
  3050. phone2: '',
  3051. visit: '', //平均一年探望次数
  3052. othersyrSexArr: [{
  3053. name: '男',
  3054. checked: false
  3055. },
  3056. {
  3057. name: '女',
  3058. checked: false
  3059. },
  3060. ]
  3061. }
  3062. }];
  3063. let childInfo = [{
  3064. childrenNum: ''
  3065. }]
  3066. this.setData({
  3067. showBj: showbj,
  3068. nameArr: [],
  3069. oldInfo: oldInfo,
  3070. childInfo: childInfo,
  3071. otherInfo: otherInfo,
  3072. regularsInfos: regularsInfos,
  3073. })
  3074. } else if (id == '-1') {
  3075. console.log('手机回显显示照片')
  3076. } else if (id) {
  3077. wx.showLoading({
  3078. title: '加载中',
  3079. })
  3080. this.setData({
  3081. showBj: false,
  3082. showBj1: false,
  3083. showAdress: false,
  3084. showAdress1: false,
  3085. nameArr: [],
  3086. activeIndex: 0,
  3087. familyFid: id,
  3088. color: 'transparent',
  3089. })
  3090. var that = this;
  3091. wx.request({
  3092. url: util.globalData.publicUrl + '/wxinfo/listByFid',
  3093. method: "GET",
  3094. data: {
  3095. fid: id,
  3096. },
  3097. header: {
  3098. appletsId: wx.getStorageSync('openId')
  3099. },
  3100. success: (res) => {
  3101. wx.hideLoading()
  3102. console.log(res.data.data, "单查赋值锕")
  3103. that.setData({
  3104. oldInfo: res.data.data
  3105. })
  3106. let datass = res.data.data;
  3107. let fristIndex = datass.findIndex((item) => {
  3108. return name == item.name;
  3109. });
  3110. let fristArray = datass.filter((item) => {
  3111. return name == item.name;
  3112. });
  3113. datass.splice(fristIndex, 1);
  3114. datass.unshift(fristArray[0]);
  3115. that.setData({
  3116. nameArr: datass
  3117. })
  3118. console.log(that.data.regularsInfo, "赋值是么");
  3119. let oldSex = [{
  3120. name: '男',
  3121. checked: false
  3122. },
  3123. {
  3124. name: '女',
  3125. checked: false
  3126. }
  3127. ]
  3128. let oldMarry = [{
  3129. name: "未婚"
  3130. }, {
  3131. name: "已婚"
  3132. }, {
  3133. name: "离异"
  3134. }, {
  3135. name: "丧偶"
  3136. }];
  3137. let loneArr = [{
  3138. name: "是"
  3139. }, {
  3140. name: "否"
  3141. }];
  3142. let mainLookSex = [{
  3143. name: "男"
  3144. }, {
  3145. name: "女"
  3146. }];
  3147. let abc = datass.map(item => {
  3148. let otherInfo = ''
  3149. let imgPath = ''
  3150. if (item.photo) {
  3151. imgPath = item.photo;
  3152. } else {
  3153. imgPath = ''
  3154. }
  3155. let disabilityAyyss = [{
  3156. name: "视力残疾"
  3157. }, {
  3158. name: "听力残疾"
  3159. }, {
  3160. name: "言语残疾"
  3161. }, {
  3162. name: "肢体残疾"
  3163. }, {
  3164. name: "智力残疾"
  3165. }, {
  3166. name: "精神残疾"
  3167. }, {
  3168. name: "多重残疾"
  3169. }];
  3170. let sickType = [{
  3171. name: "重大器官类疾病"
  3172. }, {
  3173. name: "心脑血管类疾病"
  3174. }, {
  3175. name: "神经与代谢类疾病"
  3176. }, {
  3177. name: "肢体与病毒类疾病"
  3178. }, {
  3179. name: "恶性肿瘤"
  3180. }];
  3181. let moneyFromAyy = [{
  3182. name: "家庭经营性收入"
  3183. }, {
  3184. name: "工资性收入"
  3185. }, {
  3186. name: "转移性收入"
  3187. }, {
  3188. name: "财产性收入"
  3189. }, {
  3190. name: "其它"
  3191. }];
  3192. let familyHelpArr = [{
  3193. name: "低保"
  3194. }, {
  3195. name: "建档立卡贫困户"
  3196. }, {
  3197. name: "医疗救助"
  3198. }, {
  3199. name: "临时救助"
  3200. }, {
  3201. name: "老年人福利津贴"
  3202. }, {
  3203. name: "残疾人两项补贴(或一项补贴)"
  3204. }, {
  3205. name: "其他救助"
  3206. }];
  3207. let loveRequire = [{
  3208. name: "生活照料"
  3209. },
  3210. {
  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. let isSameWithAddresss = [{
  3236. name: '现居地址与户籍地址一致'
  3237. }]
  3238. let finalarr = [];
  3239. if (item.health.includes("健康")) {
  3240. for (let i = 0; i < 4; i++) {
  3241. let obj = new Object();
  3242. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  3243. obj.checked = (i == 0 ? true : false);
  3244. obj.disabled = (i == 0 ? false : true);
  3245. finalarr.push(obj)
  3246. }
  3247. } else {
  3248. for (let i = 0; i < 4; i++) {
  3249. let obj = new Object();
  3250. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  3251. obj.checked = (i == 0 ? false : false);
  3252. obj.disabled = (i == 0 ? false : false);
  3253. finalarr.push(obj)
  3254. }
  3255. if (item.health.includes("残疾")) {
  3256. finalarr[1].checked = true;
  3257. }
  3258. if (item.health.includes("患重特大疾病")) {
  3259. finalarr[2].checked = true;
  3260. }
  3261. if (item.health.includes("老年人慢性病")) {
  3262. finalarr[3].checked = true;
  3263. }
  3264. }
  3265. let accompanyArr = [];
  3266. if (item.accompany.includes("无人陪伴居住")) {
  3267. for (let i = 0; i < 5; i++) {
  3268. let obj = new Object();
  3269. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  3270. obj.checked = (i == 0 ? true : false);
  3271. obj.disabled = (i == 0 ? false : true);
  3272. accompanyArr.push(obj)
  3273. }
  3274. } else {
  3275. for (let i = 0; i < 5; i++) {
  3276. let obj = new Object();
  3277. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  3278. obj.checked = (i == 0 ? false : false);
  3279. obj.disabled = (i == 0 ? false : false);
  3280. accompanyArr.push(obj)
  3281. }
  3282. if (item.accompany.includes("配偶")) {
  3283. accompanyArr[1].checked = true;
  3284. }
  3285. if (item.accompany.includes("近亲属")) {
  3286. accompanyArr[2].checked = true;
  3287. }
  3288. if (item.accompany.includes("未成年孙子女")) {
  3289. accompanyArr[3].checked = true;
  3290. }
  3291. if (item.accompany.includes("其他情形")) {
  3292. accompanyArr[4].checked = true;
  3293. }
  3294. }
  3295. let lookAfterArr = [];
  3296. if (item.lookAfter.includes("无人照料")) {
  3297. for (let i = 0; i < 6; i++) {
  3298. let obj = new Object();
  3299. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  3300. obj.checked = (i == 0 ? true : false);
  3301. obj.disabled = (i == 0 ? false : true);
  3302. lookAfterArr.push(obj)
  3303. }
  3304. } else {
  3305. for (let i = 0; i < 6; i++) {
  3306. let obj = new Object();
  3307. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  3308. obj.checked = (i == 0 ? false : false);
  3309. obj.disabled = (i == 0 ? false : false);
  3310. lookAfterArr.push(obj)
  3311. }
  3312. if (item.lookAfter.includes("近亲属")) {
  3313. lookAfterArr[1].checked = true;
  3314. }
  3315. if (item.lookAfter.includes("配偶")) {
  3316. lookAfterArr[2].checked = true;
  3317. }
  3318. if (item.lookAfter.includes("邻里互助")) {
  3319. lookAfterArr[3].checked = true;
  3320. }
  3321. if (item.lookAfter.includes("购买养老服务")) {
  3322. lookAfterArr[4].checked = true;
  3323. }
  3324. if (item.lookAfter.includes("其他人员")) {
  3325. lookAfterArr[5].checked = true;
  3326. }
  3327. }
  3328. let oldTypeArr = [];
  3329. for (let i = 0; i < 9; i++) {
  3330. let obj = new Object();
  3331. obj.name = (i == 0 ? "农村留守老年人" : i == 1 ? "分散供养特困老年人" : i == 2 ? "计划生育特殊家庭老人" : i == 3 ? "空巢老年人" : i == 4 ? "独居老年人" : i == 5 ? "重残老人" : i == 6 ? "高龄老人" : i == 7 ? "失能老人" : "居家老年人");
  3332. obj.checked = (i == 0 ? false : false);
  3333. obj.disable = (i == 0 ? false : false);
  3334. oldTypeArr.push(obj)
  3335. }
  3336. if (item.oldType.includes("农村留守老年人")) {
  3337. oldTypeArr[0].checked = true;
  3338. oldTypeArr[1].disable = true;
  3339. oldTypeArr[2].disable = true;
  3340. oldTypeArr[3].checked = true;
  3341. oldTypeArr[3].disable = true;
  3342. }
  3343. if (item.oldType.includes("分散供养特困老年人")) {
  3344. oldTypeArr[1].checked = true;
  3345. oldTypeArr[0].disable = true;
  3346. oldTypeArr[2].disable = true;
  3347. oldTypeArr[3].disable = true;
  3348. }
  3349. if (item.oldType.includes("计划生育特殊家庭老人")) {
  3350. oldTypeArr[2].checked = true;
  3351. oldTypeArr[0].disable = true;
  3352. oldTypeArr[1].disable = true;
  3353. oldTypeArr[3].disable = true;
  3354. }
  3355. if (item.oldType.includes("空巢老年人") && item.oldType.includes("农村留守老年人")) {
  3356. oldTypeArr[3].checked = true;
  3357. oldTypeArr[1].disable = true;
  3358. oldTypeArr[2].disable = true;
  3359. }
  3360. if (item.oldType.includes("空巢老年人") && !item.oldType.includes("农村留守老年人")) {
  3361. oldTypeArr[3].checked = true;
  3362. oldTypeArr[1].disable = true;
  3363. oldTypeArr[2].disable = true;
  3364. oldTypeArr[0].disable = true;
  3365. }
  3366. if (item.oldType.includes("独居老年人")) {
  3367. oldTypeArr[4].checked = true;
  3368. }
  3369. if (item.oldType.includes("重残老人")) {
  3370. oldTypeArr[5].checked = true;
  3371. }
  3372. if (item.oldType.includes("高龄老人")) {
  3373. oldTypeArr[6].checked = true;
  3374. }
  3375. if (item.oldType.includes("失能老人")) {
  3376. oldTypeArr[7].checked = true;
  3377. }
  3378. if (item.oldType.includes("居家老年人")) {
  3379. oldTypeArr[8].checked = true;
  3380. }
  3381. disabilityAyyss.forEach(itemss => {
  3382. item.disabilityCategory.forEach(item => {
  3383. if (itemss.name == item) {
  3384. itemss.checked = true;
  3385. }
  3386. })
  3387. })
  3388. familyHelpArr.forEach(itemss => {
  3389. item.rescueState.forEach(item => {
  3390. if (itemss.name == item) {
  3391. itemss.checked = true;
  3392. }
  3393. })
  3394. })
  3395. moneyFromAyy.forEach(itemss => {
  3396. item.sourceOfIncome.forEach(item => {
  3397. if (itemss.name == item) {
  3398. itemss.checked = true;
  3399. }
  3400. })
  3401. })
  3402. if (item.majorDiseases) {
  3403. sickType.forEach(items => {
  3404. item.majorDiseases.forEach(itemss => {
  3405. if (items.name == itemss) {
  3406. items.checked = true;
  3407. }
  3408. })
  3409. })
  3410. }
  3411. loveRequire.forEach(itemss => {
  3412. item.demand.forEach(item => {
  3413. if (itemss.name == item) {
  3414. itemss.checked = true;
  3415. }
  3416. })
  3417. })
  3418. let chooseAdressArr = [];
  3419. let chooseAdressArr1 = [];
  3420. if (item.nativePlace) {
  3421. let nativePlaces = item.nativePlace.split('/');
  3422. chooseAdressArr = nativePlaces;
  3423. if (item.isSameWithAddress == '是') {
  3424. isSameWithAddresss.forEach(item => {
  3425. item.checked = true;
  3426. })
  3427. chooseAdressArr1 = chooseAdressArr;
  3428. } else {
  3429. chooseAdressArr1 = [];
  3430. }
  3431. }
  3432. let addressExts = '';
  3433. if (item.addressExt) {
  3434. addressExts = item.addressExt
  3435. }
  3436. let nativePlaceExts = '';
  3437. if (item.nativePlaceExt) {
  3438. nativePlaceExts = item.nativePlaceExt
  3439. }
  3440. if (item.address) {
  3441. let address = item.address.split('/')
  3442. chooseAdressArr1 = address;
  3443. }
  3444. let oldSexValue = '';
  3445. if (item.sex) {
  3446. oldSexValue = item.sex
  3447. }
  3448. return {
  3449. ...item,
  3450. sickType: sickType,
  3451. oldSex: oldSex.map(items => {
  3452. if (items.name == item.sex) {
  3453. return {
  3454. name: items.name,
  3455. checked: true
  3456. }
  3457. }
  3458. return {
  3459. name: items.name,
  3460. checked: false
  3461. }
  3462. }),
  3463. oldMarryValue: item.partnerState,
  3464. loneArrValue: item.isLoss,
  3465. mainLookSexValue: item.mainLookSex,
  3466. healthAyyValue: item.health,
  3467. disabilityAyyValue: item.disabilityCategory,
  3468. sickTypeValue: item.majorDiseases,
  3469. oftenManValue: item.lookAfter,
  3470. liveStatusValue: item.accompany,
  3471. moneyFromAyyValue: item.sourceOfIncome,
  3472. familyHelpArrValue: item.rescueState,
  3473. loveRequireValue: item.demand,
  3474. oldTypeValue: item.oldType,
  3475. oldMarry: oldMarry.map(items => {
  3476. if (items.name == item.partnerState) {
  3477. return {
  3478. name: items.name,
  3479. checked: true
  3480. }
  3481. }
  3482. return {
  3483. name: items.name,
  3484. checked: false
  3485. }
  3486. }),
  3487. oldSexValue: oldSexValue,
  3488. addressExt: addressExts,
  3489. nativePlaceExt: nativePlaceExts,
  3490. imgPath: imgPath,
  3491. healthAyy: finalarr,
  3492. disabilityAyy: disabilityAyyss,
  3493. moneyFromAyy: moneyFromAyy,
  3494. familyHelpArr: familyHelpArr,
  3495. otherInfo: otherInfo, //赡养人存在么
  3496. mainLookSex: mainLookSex.map(items => {
  3497. if (items.name == item.mainLookSex) {
  3498. return {
  3499. name: items.name,
  3500. checked: true
  3501. }
  3502. }
  3503. return {
  3504. name: items.name,
  3505. checked: false
  3506. }
  3507. }),
  3508. loneArr: loneArr.map(items => {
  3509. if (items.name == item.isLoss) {
  3510. return {
  3511. name: items.name,
  3512. checked: true
  3513. }
  3514. }
  3515. return {
  3516. name: items.name,
  3517. checked: false
  3518. }
  3519. }),
  3520. liveStatus: accompanyArr,
  3521. oftenMan: lookAfterArr,
  3522. loveRequire: loveRequire,
  3523. oldType: oldTypeArr,
  3524. chooseAdressArr: chooseAdressArr,
  3525. isSameWithAddress: isSameWithAddresss,
  3526. chooseAdressArr1: chooseAdressArr1,
  3527. }
  3528. })
  3529. //赡养人信息
  3530. let def = datass.map(item => {
  3531. let sexs = [{
  3532. name: '男',
  3533. checked: false
  3534. },
  3535. {
  3536. name: '女',
  3537. checked: false
  3538. }
  3539. ]
  3540. let otherInfo = '';
  3541. let name = '';
  3542. let phone = ''
  3543. let relation = ''
  3544. let relationExt = ''
  3545. let outgoingCause = ''
  3546. let isHasGoOut = ''
  3547. let outgoingTime = ''
  3548. let isHasPartner = ''
  3549. let outgoingplace = ''
  3550. let phone2 = ''
  3551. let name2 = ''
  3552. let sex = '';
  3553. let visit = '';
  3554. if (item.otherInfo) {
  3555. let partol = this.removeExcess(item.otherInfo);
  3556. otherInfo = '是'
  3557. if (partol.name) {
  3558. name = partol.name
  3559. }
  3560. if (partol.sex) {
  3561. sexs.forEach(items => {
  3562. if (items.name == partol.sex) {
  3563. items.checked = true;
  3564. sex = partol.sex;
  3565. }
  3566. })
  3567. }
  3568. if (partol.phone) {
  3569. phone = partol.phone
  3570. }
  3571. if (partol.relation) {
  3572. relation = partol.relation
  3573. }
  3574. if (partol.relationExt) {
  3575. relationExt = partol.relationExt
  3576. }
  3577. if (partol.visit) {
  3578. visit = partol.visit;
  3579. }
  3580. if (partol.isHasGoOut) {
  3581. isHasGoOut = partol.isHasGoOut;
  3582. }
  3583. if (partol.outgoingCause) {
  3584. outgoingCause = partol.outgoingCause;
  3585. }
  3586. if (partol.outgoingTime) {
  3587. outgoingTime = partol.outgoingTime;
  3588. }
  3589. if (partol.isHasPartner) {
  3590. isHasPartner = partol.isHasPartner;
  3591. }
  3592. if (partol.outgoingplace) {
  3593. outgoingplace = partol.outgoingplace;
  3594. }
  3595. if (partol.name2) {
  3596. name2 = partol.name2;
  3597. }
  3598. if (partol.phone2) {
  3599. phone2 = partol.phone2;
  3600. }
  3601. } else if (item.otherInfo == '') {
  3602. otherInfo = '否'
  3603. } else {
  3604. otherInfo = ''
  3605. }
  3606. return {
  3607. ...item,
  3608. isHasOther: otherInfo, //赡养人存在
  3609. Info: {
  3610. name: name,
  3611. phone: phone,
  3612. relation: relation,
  3613. relationExt: relationExt,
  3614. isHasGoOut: isHasGoOut,
  3615. outgoingCause: outgoingCause,
  3616. outgoingTime: outgoingTime,
  3617. isHasPartner: isHasPartner,
  3618. outgoingplace: outgoingplace,
  3619. visit: visit,
  3620. name2: name2,
  3621. phone2: phone2,
  3622. othersyrSexArr: sexs,
  3623. sex: sex,
  3624. }
  3625. }
  3626. })
  3627. // 子女信息
  3628. let ghi = datass.map(item => {
  3629. let childrenNum = '';
  3630. if (item.childrenNum) {
  3631. if (item.childrenNum == '4') {
  3632. childrenNum = '3个以上'
  3633. } else {
  3634. childrenNum = item.childrenNum + '个'
  3635. }
  3636. } else {
  3637. childrenNum = ''
  3638. }
  3639. let Info = [];
  3640. if (item.childInfo) {
  3641. let partol = this.removeExcess(item.childInfo);
  3642. Info = partol
  3643. } else {
  3644. if (parseInt(childrenNum) == 5) {
  3645. for (let i = 0; i < parseInt(childrenNum) - 1; i++) {
  3646. let chlidInfos = {
  3647. name: '', // 姓名
  3648. sex: '',
  3649. phone: '', // 常用联系电话,
  3650. isHasGoOut: '', // 子女是否外出
  3651. outgoingplace: '', // 外出地点
  3652. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  3653. name2: '', // 子女配偶姓名
  3654. phone2: '', // 子女配偶电话
  3655. outgoingTime: '', // 最后一次离家时间
  3656. outgoingCause: '', // 外出原因
  3657. visit: '', // 平均一年探望次数
  3658. }
  3659. Info.push(chlidInfos)
  3660. }
  3661. } else {
  3662. for (let i = 0; i < parseInt(childrenNum); i++) {
  3663. let chlidInfos = {
  3664. name: '', // 姓名
  3665. sex: '',
  3666. phone: '', // 常用联系电话,
  3667. isHasGoOut: '', // 子女是否外出
  3668. outgoingplace: '', // 外出地点
  3669. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  3670. name2: '', // 子女配偶姓名
  3671. phone2: '', // 子女配偶电话
  3672. outgoingTime: '', // 最后一次离家时间
  3673. outgoingCause: '', // 外出原因
  3674. visit: '', // 平均一年探望次数
  3675. }
  3676. Info.push(chlidInfos)
  3677. }
  3678. }
  3679. }
  3680. return {
  3681. ...item,
  3682. childrenNum: childrenNum,
  3683. Info: Info
  3684. }
  3685. })
  3686. // 寻访人信息为了显示
  3687. let zzz = datass.map(item => {
  3688. let visitModeExt = ''
  3689. let visitCountExt = ''
  3690. let visitMode = [{
  3691. name: '电话问候',
  3692. checked: false
  3693. }, {
  3694. name: '上门巡访',
  3695. checked: false
  3696. }, {
  3697. name: '其它',
  3698. checked: false
  3699. }]
  3700. let visitCounts = [{
  3701. name: '每天',
  3702. checked: false
  3703. }, {
  3704. name: '每周',
  3705. checked: false
  3706. }, {
  3707. name: '每月',
  3708. checked: false
  3709. },
  3710. {
  3711. name: '每季',
  3712. checked: false
  3713. },
  3714. {
  3715. name: '其它',
  3716. checked: false
  3717. }
  3718. ];
  3719. if (item.regularsInfo) {
  3720. let partol = this.removeExcess(item.regularsInfo);
  3721. let partols = this.removeExcess(partol.visitMode);
  3722. if (partol.visitMode) {
  3723. visitMode.forEach(items => {
  3724. partols.forEach(itemss => {
  3725. if (items.name == itemss) {
  3726. items.checked = true;
  3727. }
  3728. })
  3729. })
  3730. }
  3731. if (partol.visitCount) {
  3732. visitCounts.forEach(items => {
  3733. if (items.name == partol.visitCount) {
  3734. items.checked = true;
  3735. }
  3736. })
  3737. }
  3738. if (partol.visitCountExt) {
  3739. visitCountExt = partol.visitCountExt;
  3740. }
  3741. if (partol.visitModeExt) {
  3742. visitModeExt = partol.visitModeExt;
  3743. }
  3744. }
  3745. return {
  3746. ...item,
  3747. visitCountExt: visitCountExt,
  3748. visitModeExt: visitModeExt,
  3749. visitMode: visitMode,
  3750. visitCount: visitCounts,
  3751. }
  3752. })
  3753. // 寻访人信息
  3754. let mmm = datass.map(item => {
  3755. if (item.regularsInfo) {
  3756. let partol = this.removeExcess(item.regularsInfo);
  3757. let partols = this.removeExcess(partol.visitMode);
  3758. return {
  3759. visitCount: partol.visitCount,
  3760. visitCountExt: partol.visitCountExt,
  3761. visitMode: partols,
  3762. visitModeExt: partol.visitModeExt,
  3763. }
  3764. }
  3765. })
  3766. that.setData({
  3767. oldInfo: abc,
  3768. otherInfo: def,
  3769. childInfo: ghi,
  3770. regularsInfos: zzz,
  3771. regularsInfo: mmm,
  3772. })
  3773. console.log(that.data.oldInfo, "老人的返现数组")
  3774. console.log(that.data.otherInfo, "其他的返现数组")
  3775. console.log(that.data.childInfo, "孩子的返现数组")
  3776. console.log(that.data.regularsInfos, "q巡访的返现数组")
  3777. console.log(that.data.regularsInfo, "巡访传值的返回")
  3778. }
  3779. })
  3780. }
  3781. },
  3782. // 提交老人采集信息
  3783. SubmitOldmanInfo(data) {
  3784. console.log(data, ' 提交老人信息带过来的数据')
  3785. wx.request({
  3786. url: util.globalData.publicUrl + '/wxinfo/update',
  3787. method: "post",
  3788. header: {
  3789. appletsId: wx.getStorageSync('openId')
  3790. },
  3791. data,
  3792. success: (res) => {
  3793. console.log(res)
  3794. }
  3795. })
  3796. },
  3797. onReady() {
  3798. isTwoOnshow = false;
  3799. isonShow = false;
  3800. },
  3801. onShow() {
  3802. if (wx.getStorageSync('user') == '') {
  3803. wx.showModal({
  3804. showCancel: false,
  3805. content: '当前您未登录,请登录',
  3806. success(res) {
  3807. if (res.confirm) {
  3808. wx.redirectTo({
  3809. url: '/pages/login/login',
  3810. })
  3811. } else if (res.cancel) {
  3812. console.log('用户点击取消')
  3813. }
  3814. }
  3815. })
  3816. } else {
  3817. const app = getApp();
  3818. if (isTwoOnshow) {
  3819. isTwoOnshow = false;
  3820. return;
  3821. };
  3822. if (isonShow) {
  3823. isonShow = false;
  3824. return;
  3825. };
  3826. this.setData({
  3827. addOldname: '',
  3828. currentIndex: 0
  3829. })
  3830. this.huixian(app.globalData.id, app.globalData.name);
  3831. }
  3832. },
  3833. onHide() {
  3834. const app = getApp()
  3835. console.log("初始",app.globalData.id)
  3836. if (app.globalData.id != -1) {
  3837. app.globalData.id = ''
  3838. console.log("id不等于-1")
  3839. }
  3840. app.globalData.name = ''
  3841. this.setData({
  3842. shiBaiShow: false,
  3843. showAdressBox: false,
  3844. showAdressBox1: false
  3845. })
  3846. console.log("最终隐藏id",app.globalData.id)
  3847. },
  3848. //获取位置
  3849. getSelfLocation: function () {
  3850. console.log("我调用位置接口了");
  3851. var qqmapsdk = new QQMapWX({
  3852. key: 'B5DBZ-NGIHP-SQMD4-LHMG3-NJ72Z-7KFOV' //申请的开发者秘钥key
  3853. });
  3854. var that = this; //用户授权过可以直接获取位置
  3855. wx.getLocation({
  3856. //type: 'wgs84',
  3857. type: 'gcj02',
  3858. success: function (res) {
  3859. console.log(res, "00我调用位置接口成功了");
  3860. // 返回当前定位的经纬度
  3861. var latitude = parseFloat(res.latitude).toFixed(5);
  3862. var longitude = parseFloat(res.longitude).toFixed(5);
  3863. qqmapsdk.reverseGeocoder({
  3864. location: {
  3865. latitude: res.latitude,
  3866. longitude: res.longitude
  3867. },
  3868. success: function (res) {
  3869. let photoAndLocation = 'oldInfo[' + that.data.activeIndex + '].photoAndLocation'
  3870. let gps = longitude + '/' + latitude + '/' + res.result.address
  3871. that.setData({
  3872. [photoAndLocation]: gps
  3873. })
  3874. console.log(that.data.nameArr[that.data.activeIndex], "定位的问题");
  3875. that.SubmitOldmanInfo({
  3876. id: that.data.nameArr[that.data.activeIndex]._id,
  3877. photoAndLocation: gps
  3878. })
  3879. that.goPhoto();
  3880. },
  3881. fail: function (res) {
  3882. console.log('获取当前地址失败');
  3883. }
  3884. });
  3885. },
  3886. fail: function () {
  3887. console.log('获取失败了打开设置')
  3888. wx.showModal({
  3889. showCancel: false,
  3890. title: '定位权限获取失败',
  3891. content: '点击右上方三个点->设置->打开位置权限'
  3892. })
  3893. // wx.openSetting({
  3894. // success: function (osrs) {
  3895. // wx.getUserInfo({
  3896. // success: function (getuserinfo) {
  3897. // console.log(getuserinfo)
  3898. // },
  3899. // fail: function (fres) {
  3900. // console.log(fres)
  3901. // }
  3902. // })
  3903. // }
  3904. // })
  3905. }
  3906. });
  3907. },
  3908. onLoad() {
  3909. // console.log(wx.getStorageSync('user'), '000000')
  3910. // if (wx.getStorageSync('user') == '') {
  3911. // wx.redirectTo({
  3912. // url: '/pages/login/login',
  3913. // })
  3914. // }
  3915. },
  3916. // 表单校验老人身份证号
  3917. formCheckCard() {
  3918. this.setData({
  3919. oldCardNull: false,
  3920. oldCardWrong: false,
  3921. oldCard60: false,
  3922. })
  3923. // 身份证号
  3924. let idNumber = this.data.oldInfo[this.data.activeIndex].idNumber
  3925. if (idNumber == null || idNumber == '') {
  3926. this.setData({
  3927. oldCardNull: true
  3928. })
  3929. } else {
  3930. this.setData({
  3931. oldCardNull: false
  3932. })
  3933. if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(idNumber)) && idNumber.length != 18) {
  3934. this.setData({
  3935. oldCardWrong: true
  3936. })
  3937. } else {
  3938. this.setData({
  3939. oldCardWrong: false
  3940. })
  3941. var myDate = new Date();
  3942. var month = myDate.getMonth() + 1;
  3943. var day = myDate.getDate();
  3944. var age = myDate.getFullYear() - idNumber.substring(6, 10) - 1;
  3945. if (idNumber.substring(10, 12) < month || idNumber.substring(10, 12) == month && idNumber.substring(12, 14) <= day) {
  3946. age++;
  3947. }
  3948. console.log(age, '我是身份证的年龄')
  3949. if (age < 60) {
  3950. this.setData({
  3951. oldCard60: true
  3952. })
  3953. } else {
  3954. this.setData({
  3955. oldCard60: false
  3956. })
  3957. }
  3958. }
  3959. }
  3960. },
  3961. // 表单校验老人联系电话
  3962. formCheckPhone() {
  3963. this.setData({
  3964. oldPhoneNull: false
  3965. })
  3966. if (!this.data.oldInfo[this.data.activeIndex].phone) {
  3967. this.setData({
  3968. oldPhoneNull: true
  3969. })
  3970. }
  3971. },
  3972. // 表单校验配偶姓名
  3973. formCheckPartnerName() {
  3974. this.setData({
  3975. oldisMarryName: false
  3976. })
  3977. if (!this.data.oldInfo[this.data.activeIndex].partnerName) {
  3978. this.setData({
  3979. oldisMarryName: true
  3980. })
  3981. }
  3982. },
  3983. //表单校验配偶身份证号
  3984. formCheckPartnerId() {
  3985. this.setData({
  3986. oldisMarryPhone: false,
  3987. oldisMarryPhoneGs: false
  3988. })
  3989. // 身份证号
  3990. let idNumber = this.data.oldInfo[this.data.activeIndex].partnerIdNumber
  3991. if (!idNumber) {
  3992. this.setData({
  3993. oldisMarryPhone: true
  3994. })
  3995. } else {
  3996. if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(idNumber)) && idNumber.length != 18) {
  3997. this.setData({
  3998. oldisMarryPhoneGs: true
  3999. })
  4000. }
  4001. }
  4002. },
  4003. // 表单校验健康状况
  4004. formCheckHealthNull() {
  4005. this.setData({
  4006. oldHealth: false
  4007. })
  4008. let healthAyy = this.data.oldInfo[this.data.activeIndex].healthAyy
  4009. if (!healthAyy[0].checked && !healthAyy[1].checked && !healthAyy[2].checked && !healthAyy[3].checked) {
  4010. this.setData({
  4011. oldHealth: true
  4012. })
  4013. }
  4014. },
  4015. // 表单校验残疾类别
  4016. formCheckabilityNull() {
  4017. this.setData({
  4018. oldDisableType: false
  4019. })
  4020. if (this.data.oldInfo[this.data.activeIndex].disabilityAyyValue.length == 0) {
  4021. this.setData({
  4022. oldDisableType: true
  4023. })
  4024. }
  4025. },
  4026. //表单校验重特大疾病类别
  4027. formChecksickTypeNull() {
  4028. this.setData({
  4029. issickTypeNull: false
  4030. })
  4031. if (this.data.oldInfo[this.data.activeIndex].sickTypeValue.length == 0) {
  4032. this.setData({
  4033. issickTypeNull: true
  4034. })
  4035. }
  4036. },
  4037. //收入来源为空校验
  4038. formCheckmoneyNull() {
  4039. this.setData({
  4040. moneyFromOther: false
  4041. })
  4042. if (this.data.oldInfo[this.data.activeIndex].moneyFromAyyValue.length == 0) {
  4043. this.setData({
  4044. moneyFromOther: true
  4045. })
  4046. }
  4047. },
  4048. // 其他收入来源
  4049. formCheckmoneyQtNull() {
  4050. this.setData({
  4051. moneyOtherQtnull: false
  4052. })
  4053. if (!this.data.oldInfo[this.data.activeIndex].sourceOfIncomeExt) {
  4054. this.setData({
  4055. moneyOtherQtnull: true
  4056. })
  4057. }
  4058. },
  4059. //家庭救助帮扶情况
  4060. formCheckhelpNull() {
  4061. this.setData({
  4062. familyHelp: false
  4063. })
  4064. if (this.data.oldInfo[this.data.activeIndex].familyHelpArrValue.length == 0) {
  4065. this.setData({
  4066. familyHelp: true
  4067. })
  4068. }
  4069. },
  4070. // 其他救助帮扶情况
  4071. formCheckhelpQtNull() {
  4072. this.setData({
  4073. otherhelpQtnull: false
  4074. })
  4075. if (!this.data.oldInfo[this.data.activeIndex].rescueStateExt) {
  4076. this.setData({
  4077. otherhelpQtnull: true
  4078. })
  4079. }
  4080. },
  4081. // 陪伴居住情况
  4082. formCheckliveNull() {
  4083. this.setData({
  4084. isliveNull: false
  4085. })
  4086. if (this.data.oldInfo[this.data.activeIndex].liveStatusValue.length == 0) {
  4087. this.setData({
  4088. isliveNull: true
  4089. })
  4090. }
  4091. },
  4092. //其他陪伴居住情况
  4093. formCheckliveqtNull() {
  4094. this.setData({
  4095. isliveQtNull: false
  4096. })
  4097. if (!this.data.oldInfo[this.data.activeIndex].accompanyExt) {
  4098. this.setData({
  4099. isliveQtNull: true
  4100. })
  4101. }
  4102. },
  4103. // 日常生活照料人
  4104. formCheckoftenNull() {
  4105. this.setData({
  4106. isoftenManNull: false
  4107. })
  4108. if (this.data.oldInfo[this.data.activeIndex].oftenManValue.length == 0) {
  4109. this.setData({
  4110. isoftenManNull: true
  4111. })
  4112. }
  4113. },
  4114. //其他日常生活照料人
  4115. formCheckoftenQtNull() {
  4116. this.setData({
  4117. isoftenReaNull: false
  4118. })
  4119. if (!this.data.oldInfo[this.data.activeIndex].lookAfterExt) {
  4120. this.setData({
  4121. isoftenReaNull: true
  4122. })
  4123. }
  4124. },
  4125. //日常生活照料人姓名
  4126. formCheckoftenNameNull() {
  4127. this.setData({
  4128. lookAfterName: false
  4129. })
  4130. if (!this.data.oldInfo[this.data.activeIndex].mainLookName) {
  4131. this.setData({
  4132. lookAfterName: true
  4133. })
  4134. }
  4135. },
  4136. //日常生活照料人电话
  4137. formCheckoftenPhoneNull() {
  4138. this.setData({
  4139. islookPhoneNull: false
  4140. })
  4141. if (!this.data.oldInfo[this.data.activeIndex].mainLookPhone) {
  4142. this.setData({
  4143. islookPhoneNull: true
  4144. })
  4145. }
  4146. },
  4147. // 关爱服务需求
  4148. formCheckloveNull() {
  4149. this.setData({
  4150. isloveNull: false
  4151. })
  4152. if (this.data.oldInfo[this.data.activeIndex].loveRequireValue.length == 0) {
  4153. this.setData({
  4154. isloveNull: true
  4155. })
  4156. }
  4157. },
  4158. formCheckloveQtNull() {
  4159. this.setData({
  4160. isloveQtNull: false
  4161. })
  4162. if (!this.data.oldInfo[this.data.activeIndex].demandExt) {
  4163. this.setData({
  4164. isloveQtNull: true
  4165. })
  4166. }
  4167. },
  4168. // 老年人类别
  4169. formCheckoldtypeNull() {
  4170. this.setData({
  4171. isoldtypeNull: false
  4172. })
  4173. if (this.data.oldInfo[this.data.activeIndex].oldTypeValue.length == 0) {
  4174. this.setData({
  4175. isoldtypeNull: true
  4176. })
  4177. }
  4178. }
  4179. })