collectInfo.js 116 KB

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