collectInfo.js 119 KB

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