collectInfo.js 131 KB

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