collectInfo.js 119 KB

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