123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149 |
- const util = require('../../utils/util.js');
- var QQMapWX = require('../../libs/qqmap-wx-jssdk.min.js');
- var isonShow;
- var isTwoOnshow;
- Page({
- data: {
- value: [0, 0, 0, 0, 0],
- focus: true,
- shiBaiShow: false,
- showAdressBox: false,
- showAdressBox1: false,
- provinceArr: [],
- cityArr: [],
- areaArr: [],
- townArr: [],
- villageArr: [],
- codeArr: [], //传地址时带的code数组
- province: '',
- city: '',
- area: '',
- town: '',
- village: '',
- codeArr: [], //传地址时带的code数组
- nowAdress: false, //现居地址可点不可点
- adressChangeStatus: false,
- color: '#898989',
- activeIndex: 0,
- addOldname: '',
- addOldname1: '',
- currentIndex: 0,
- showBj: false,
- showBj1: false,
- src1: '../../images/mz/5.png',
- src2: '../../images/mz/1.png',
- src3: '../../images/mz/6.png',
- src4: '../../images/mz/2.png',
- src5: '../../images/mz/7.png',
- src6: '../../images/mz/3.png',
- src7: '../../images/mz/8.png',
- src8: '../../images/mz/4.png',
- sexArr: [{
- value: '男',
- name: '男'
- },
- {
- value: '女',
- name: '女',
- }
- ],
- nameArr: [],
- // tab1老人信息
- oldInfo: [],
- villageOldChecked: false,
- mzArr: ["汉族", "壮族", "满族", "回族", "苗族", "维吾尔族", "土家族", "彝族", "蒙古族", "藏族", "布依族", "侗族", "瑶族", "朝鲜族", "白族", "哈尼族",
- "哈萨克族", "黎族", "傣族", "畲族", "傈僳族", "仡佬族", "东乡族", "高山族", "拉祜族", "水族", "佤族", "纳西族", "羌族", "土族", "仫佬族", "锡伯族",
- "柯尔克孜族", "达斡尔族", "景颇族", "毛南族", "撒拉族", "布朗族", "塔吉克族", "阿昌族", "普米族", "鄂温克族", "怒族", "京族", "基诺族", "德昂族", "保安族",
- "俄罗斯族", "裕固族", "乌孜别克族", "门巴族", "鄂伦春族", "独龙族", "塔塔尔族", "赫哲族", "珞巴族"
- ],
- ableStatus: ["完全自理", "半失能(部分自理)", "完全失能"], //老年人能力情况
- chooseAdressArr: [],
- disableLeval: ["一级", "二级", "三级", "四级"],
- moneyStatus: ["建档立卡贫困户", "一般家庭", "低保", "特困供养人员"],
- payMoney: ["5000元以下", "5000-10000元", "10000元以上"],
- loveRequire: [{
- name: "生活照料"
- },
- {
- name: "生产帮助"
- },
- {
- name: "精神慰藉"
- },
- {
- name: "医疗保健"
- },
- {
- name: "权益维护"
- },
- {
- name: "安全监护"
- },
- {
- name: "文化娱乐"
- },
- {
- name: "紧急救助"
- },
- {
- name: "其它"
- },
- ],
- isHavePhoto: false,
- // tab2
- childInfo: [],
- childNumArr: [
- '0个', '1个', '2个', '3个', '3个以上'
- ],
- childSexArr: ['男', '女'],
- childIsout: ['是', '否'],
- childIsMArry: ['是', '否'],
- childTfTimes: ['0次', '1次', '2次及以上'],
- otherInfo: [],
- childNameNull: [false, false, false],
- childPhoneNull: [false, false, false],
- ischildOutReason: [false, false, false],
- ischildMarryName: [false, false, false],
- ischildMarryPhone: [false, false, false],
- // tab3
- othersyrArr: ['是', '否'],
- othersyrSexArr: ['男', '女'],
- othersyrRelation: [
- "近亲属", "孙子女", "兄弟姐妹", "其他"
- ],
- othersyrIsout: ['是', '否'],
- region: ['', '', ''],
- othersyrIsMarry: ['是', '否'],
- othersyrTfTimes: [
- '0次', '1次', '2次及以上'
- ],
- // tab4
- regularsInfos: [],
- regularsInfo: [{
- visitMode: '',
- visitModeExt: '', //巡访其他
- visitCount: '',
- visitCountExt: '', // 频次的其他
- }],
- multiIndex: [0, 0, 0, 0, 0]
- },
- // 左侧点击
- turn(e) {
- let index = e.currentTarget.dataset.index
- this.setData({
- currentIndex: index
- })
- },
- addOldName(e) {
- this.setData({
- addOldname: e.detail.value
- })
- },
- addOldName1(e) {
- this.setData({
- addOldname1: e.detail.value
- })
- },
- qx() {
- wx.switchTab({
- url: '/pages/index/index',
- })
- },
- qx1() {
- this.setData({
- showBj1: false
- })
- },
- switchNameTab(e) {
- this.setData({
- activeIndex: e.currentTarget.dataset.index,
- currentIndex: 0,
- })
- this.AllFalse();
- // this.formCheckCard();
- // this.formCheckPhone();
- // this.formCheckPartnerName();
- // this.formCheckHealthNull();
- // this.formCheckabilityNull();
- // this.formChecksickTypeNull();
- // this.formCheckmoneyNull();
- // this.formCheckhelpNull();
- // this.formCheckliveNull();
- // this.formCheckoftenNull();
- // this.formCheckloveNull();
- // this.formCheckoldtypeNull();
- // this.formCheckPartnerId();
- // this.formCheckmoneyQtNull();
- // this.formCheckhelpQtNull();
- // this.formCheckliveqtNull();
- // this.formCheckoftenQtNull();
- // this.formCheckoftenNameNull();
- // this.formCheckoftenPhoneNull();
- // this.formCheckloveQtNull();
- },
- goShibai() {
- this.setData({
- shiBaiShow: true
- })
- },
- shiBaiClose() {
- this.setData({
- shiBaiShow: false
- })
- },
- sure() {
- let han = /^[\u4e00-\u9fa5]+$/;
- if (this.data.addOldname == '' || this.data.addOldname == null) {
- wx.showModal({
- showCancel: false,
- content: '老人姓名不可以为空哦'
- })
- return false
- }
- if (!han.test(this.data.addOldname)) {
- wx.showModal({
- showCancel: false,
- content: '您输入的内容不是汉字哦'
- })
- return false;
- };
- if (this.data.addOldname.length < 2) {
- wx.showModal({
- showCancel: false,
- content: '老人姓名不可以少于两个字哦'
- })
- return false
- }
- wx.showLoading();
- this.setData({
- showBj: false,
- activeIndex: 0
- })
- wx.request({
- url: util.globalData.publicUrl + '/wxinfo/add',
- method: "post",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- data: {
- name: this.data.addOldname
- },
- success: (res) => {
- if (res.data.code == 0) {
- let name = 'oldInfo[' + this.data.activeIndex + '].name'
- this.setData({
- nameArr: this.data.nameArr.concat(res.data.data),
- familyFid: res.data.data.fid,
- [name]: this.data.addOldname,
- oldInfo: this.data.oldInfo
- })
- // this.getSelfLocation();
- wx.hideLoading();
- }
- }
- })
- },
- AllFalse() {
- this.setData({
- oldCardNull: false,
- oldCardWrong: false,
- oldCard60: false,
- oldPhoneNull: false,
- oldisMarryName: false,
- oldisMarryPhone: false,
- oldisMarryPhoneGs: false,
- oldHealth: false,
- oldDisableType: false,
- issickTypeNull: false,
- moneyFromOther: false,
- moneyOtherQtnull: false,
- familyHelp: false,
- isliveNull: false,
- isoftenManNull: false,
- isloveNull: false,
- isoldtypeNull: false,
- oldisMarryPhone: false,
- oldisMarryPhoneGs: false,
- moneyOtherQtnull: false,
- otherhelpQtnull: false,
- isliveQtNull: false,
- isoftenReaNull: false,
- lookAfterName: false,
- islookPhoneNull: false,
- isloveQtNull: false,
- childNameNull: [false, false, false],
- childPhoneNull: [false, false, false],
- ischildOutReason: [false, false, false],
- ischildMarryName: [false, false, false],
- ischildMarryPhone: [false, false, false],
- isothersyrName: false,
- isothersyrPhone: false,
- isothersyRelation: false,
- isOutReason: false,
- isMarryName: false,
- isMarryPhone: false,
- visitWaysFromOther: false,
- isVisittimesnull: false,
- isVisittimesQtnull: false
- })
- },
- sure1() {
- let han = /^[\u4e00-\u9fa5]+$/;
- if (this.data.addOldname1 == '' || this.data.addOldname1 == null) {
- wx.showModal({
- showCancel: false,
- content: '老人姓名不可以为空哦'
- })
- return false
- }
- if (!han.test(this.data.addOldname1)) {
- wx.showModal({
- showCancel: false,
- content: '您输入的内容不是汉字哦'
- })
- return false;
- };
- if (this.data.addOldname1.length < 2) {
- wx.showModal({
- showCancel: false,
- content: '老人姓名不可以少于两个字哦'
- })
- return false
- }
- this.AllFalse();
- wx.showLoading();
- this.setData({
- showBj1: false,
- currentIndex: 0
- })
- wx.request({
- url: util.globalData.publicUrl + '/wxinfo/add',
- method: "post",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- data: {
- name: this.data.addOldname1,
- fid: this.data.familyFid
- },
- success: (res) => {
- if (res.data.code == 0) {
- this.data.oldInfo.push({
- name: this.data.addOldname1,
- oldSex: [{
- name: '男'
- }, {
- name: '女'
- }],
- oldSexValue: '',
- isSameWithAddress: [{
- name: '现居地址与户籍地址一致'
- }],
- addressExt: '',
- nativePlaceExt: '',
- nation: '', //民族
- idNumber: '', //身份证号
- phone: '',
- chooseAdressArr: [],
- chooseAdressArr1: [],
- oldMarry: [{
- name: "未婚"
- }, {
- name: "已婚"
- }, {
- name: "离异"
- }, {
- name: "丧偶"
- }],
- oldMarryValue: '',
- partnerName: '',
- partnerIdNumber: '',
- healthAyy: [{
- name: "健康",
- disabled: false
- }, {
- name: "残疾",
- disabled: false
- }, {
- name: "患重特大疾病",
- disabled: false
- }, {
- name: "老年人慢性病",
- disabled: false
- }],
- healthAyyValue: [],
- disabilityAyy: [{
- name: "视力残疾"
- }, {
- name: "听力残疾"
- }, {
- name: "言语残疾"
- }, {
- name: "肢体残疾"
- }, {
- name: "智力残疾"
- }, {
- name: "精神残疾"
- }, {
- name: "多重残疾"
- }],
- disabilityAyyValue: [],
- disabilityLevel: '', //残疾人类别
- sickType: [{
- name: "重大器官类疾病"
- }, {
- name: "心脑血管类疾病"
- }, {
- name: "神经与代谢类疾病"
- }, {
- name: "肢体与病毒类疾病"
- }, {
- name: "恶性肿瘤"
- }],
- sickTypeValue: [],
- ability: '', //老年人能力情况
- livingCondition: '', //生活经济情况
- moneyFromAyy: [{
- name: "家庭经营性收入"
- }, {
- name: "工资性收入"
- }, {
- name: "转移性收入"
- }, {
- name: "财产性收入"
- }, {
- name: "其它"
- }],
- moneyFromAyyValue: [],
- income: '',
- sourceOfIncomeExt: '', //其他收入情况
- familyHelpArr: [{
- name: "低保"
- }, {
- name: "建档立卡贫困户"
- }, {
- name: "医疗救助"
- }, {
- name: "临时救助"
- }, {
- name: "老年人福利津贴"
- }, {
- name: "残疾人两项补贴(或一项补贴)"
- }, {
- name: "其他救助"
- }],
- familyHelpArrValue: [],
- rescueStateExt: '', //其他救助
- loneArr: [{
- name: "是"
- }, {
- name: "否"
- }],
- loneArrValue: '',
- liveStatus: [{
- name: "无人陪伴居住",
- disabled: false
- }, {
- name: "配偶",
- disabled: false
- }, {
- name: "近亲属",
- disabled: false
- }, {
- name: "未成年孙子女",
- disabled: false
- }, {
- name: "其他情形",
- disabled: false
- }],
- liveStatusValue: [],
- accompanyExt: '', //陪伴居住其他
- oftenMan: [{
- name: "无人照料",
- disabled: false
- }, {
- name: "近亲属",
- disabled: false
- }, {
- name: "配偶",
- disabled: false
- }, {
- name: "邻里互助",
- disabled: false
- }, {
- name: "购买养老服务",
- disabled: false
- }, {
- name: "其他人员",
- disabled: false
- }],
- oftenManValue: [],
- lookAfterExt: '', //其他日常生活照料人关系
- mainLookName: '', //日常生活照料人姓名
- mainLookSex: [{
- name: "男"
- }, {
- name: "女"
- }],
- mainLookSexValue: '',
- mainLookPhone: '', //
- loveRequire: [{
- name: "生活照料"
- },
- {
- name: "生产帮助"
- },
- {
- name: "精神慰藉"
- },
- {
- name: "医疗保健"
- },
- {
- name: "权益维护"
- },
- {
- name: "安全监护"
- },
- {
- name: "文化娱乐"
- },
- {
- name: "紧急救助"
- },
- {
- name: "其它"
- },
- ],
- loveRequireValue: [],
- oldType: [{
- name: "农村留守老年人",
- disable: false,
- checked: false
- }, {
- name: "分散供养特困老年人",
- disable: false,
- checked: false
- }, {
- name: "计划生育特殊家庭老人",
- disable: false,
- checked: false
- }, {
- name: "空巢老年人",
- disable: false,
- checked: false
- }, {
- name: "独居老年人",
- disable: false,
- checked: false
- }, {
- name: "重残老年人",
- disable: false,
- checked: false
- }, {
- name: "高龄老年人",
- disable: false,
- checked: false
- }, {
- name: "居家老年人",
- disable: false,
- checked: false
- }],
- oldTypeValue: [],
- isHavePhoto: false,
- imgPath: '',
- photoAndLocation: '',
- })
- this.data.childInfo.push({
- childrenNum: '',
- Info: []
- })
- this.data.otherInfo.push({
- isHasOther: '',
- Info: {
- name: '', // 其他赡养人姓名,
- sex: '', //其他赡养人性别
- phone: '', //其他赡养人电话,
- relation: '', //与被赡养人关系 如果选了其他也是必填 单选
- relationExt: '', //与被赡养人关系--其他
- isHasGoOut: '', //是否外出
- outgoingCause: '', //外出原因
- outgoingplace: '', // 外出地点
- outgoingTime: '', // 最后一次离家时间
- isHasPartner: '', //是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0:是 1:否
- name2: '',
- phone2: '',
- visit: '', //平均一年探望次数
- othersyrSexArr: [{
- name: '男',
- checked: false
- },
- {
- name: '女',
- checked: false
- },
- ]
- }
- })
- this.data.regularsInfos.push({
- visitMode: [{
- name: '电话问候',
- checked: false
- }, {
- name: '上门巡访',
- checked: false
- }, {
- name: '其它',
- checked: false
- }],
- visitModeExt: '', //巡访其他
- visitCount: [{
- name: '每天',
- checked: false
- }, {
- name: '每周',
- checked: false
- }, {
- name: '每月',
- checked: false
- }, {
- name: '每季',
- checked: false
- }, {
- name: '其它',
- checked: false
- }],
- visitCountExt: '', // 频次的其他
- })
- this.data.regularsInfo.push({
- visitMode: '',
- visitModeExt: '', //巡访其他
- visitCount: '',
- visitCountExt: '', // 频次的其他
- })
- this.setData({
- activeIndex: this.data.nameArr.concat(res.data.data).length - 1,
- nameArr: this.data.nameArr.concat(res.data.data),
- oldInfo: this.data.oldInfo,
- childInfo: this.data.childInfo,
- otherInfo: this.data.otherInfo,
- regularsInfos: this.data.regularsInfos,
- regularsInfo: this.data.regularsInfo
- })
- this.getSelfLocation();
- }
- wx.hideLoading();
- }
- })
- },
- // 删除上方名字
- deleteName(e) {
- let index = e.currentTarget.dataset.index
- console.log(index);
- wx.showModal({
- showCancel: true,
- content: '确认删除该条记录吗',
- success: (res) => {
- if (res.cancel) {
- //点击取消,默认隐藏弹框
- } else {
- wx.request({
- url: util.globalData.publicUrl + '/wxinfo/delete',
- method: "get",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- data: {
- id: e.currentTarget.dataset.item._id
- },
- success: (res) => {
- console.log(res)
- if (res.data.code == 0) {
- this.data.nameArr.splice(index, 1)
- this.data.oldInfo.splice(index, 1)
- this.data.otherInfo.splice(index, 1)
- this.data.childInfo.splice(index, 1)
- this.data.regularsInfo.splice(index, 1)
- this.data.regularsInfos.splice(index, 1)
- this.setData({
- oldInfo: this.data.oldInfo,
- nameArr: this.data.nameArr,
- otherInfo: this.data.otherInfo,
- childInfo: this.data.childInfo,
- regularsInfo: this.data.regularsInfo,
- regularsInfos: this.data.regularsInfos,
- })
- if ((this.data.activeIndex == index && this.data.activeIndex > 0) || (this.data.activeIndex > index && this.data.activeIndex > 0)) {
- this.setData({
- activeIndex: this.data.activeIndex - 1
- })
- }
- if (this.data.nameArr.length == 0) {
- wx.switchTab({
- url: '/pages/index/index',
- })
- }
- }
- }
- })
- }
- }
- })
- },
- // 添加带fid的老人
- addFamilyOldman() {
- this.setData({
- showBj1: true,
- addOldname1: ''
- })
- },
- goOcr() {
- console.log(this.data.nameArr)
- isonShow = true;
- wx.showLoading({
- title: '加载中',
- })
- let _this = this
- wx.request({
- url: util.globalData.publicUrl + '/applet/getToken',
- method: "GET",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- success: (res) => {
- console.log(res.data, "0000");
- if (res.data.data.status == 200) {
- let token = res.data.data.token;
- if (token) {
- wx.chooseImage({
- count: 1, // 默认9
- sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有
- sourceType: ['camera'], // 可以指定来源是相册还是相机,默认二者都有
- success: function (res) {
- // 拿文件转换base64
- const app = getApp()
- app.globalData.id = '-1'
- wx.getFileSystemManager().readFile({
- filePath: res.tempFilePaths[0],
- encoding: 'base64',
- success: res1 => {
- let img = 'data:image/png;base64,' + res1.data
- wx.request({
- url: 'https://aip.baidubce.com/rest/2.0/ocr/v1/idcard?access_token=' + token,
- method: 'POST',
- header: {
- 'content-type': 'application/x-www-form-urlencoded'
- },
- data: {
- id_card_side: 'front',
- image: img
- },
- dataType: 'json',
- success: (e) => {
- console.log(e, "看看那ocr返回了么数据呢");
- // 扫描后赋值
- _this.setData({
- showBj: false,
- fid: _this.data.familyFid
- })
- if (e.data.idcard_number_type == 1) {
- console.log(e.data.words_result, '我是ocr识别出来的内容')
- if (_this.data.oldInfo[_this.data.activeIndex].name == e.data.words_result['姓名'].words) {
- var myDate = new Date();
- var month = myDate.getMonth() + 1;
- var day = myDate.getDate();
- var age = myDate.getFullYear() - e.data.words_result['公民身份号码'].words.substring(6, 10) - 1;
- 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) {
- age++;
- }
- if (age >= 60) {
- let idNumber = 'oldInfo[' + _this.data.activeIndex + '].idNumber'
- let name = 'oldInfo[' + _this.data.activeIndex + '].name'
- let nation = 'oldInfo[' + _this.data.activeIndex + '].nation'
- let data = _this.data.oldInfo[_this.data.activeIndex].oldSex.map(v => {
- if (v.name == e.data.words_result['性别'].words) {
- return {
- name: v.name,
- checked: true
- }
- }
- return {
- name: v.name,
- checked: false
- }
- })
- let oldSex = 'oldInfo[' + _this.data.activeIndex + '].oldSex'
- _this.setData({
- [idNumber]: e.data.words_result['公民身份号码'].words,
- [name]: e.data.words_result['姓名'].words,
- [nation]: e.data.words_result['民族'].words + '族',
- [oldSex]: data
- })
- _this.SubmitOldmanInfo({
- id: _this.data.nameArr[_this.data.activeIndex]._id,
- idNumber: e.data.words_result['公民身份号码'].words
- })
- _this.SubmitOldmanInfo({
- id: _this.data.nameArr[_this.data.activeIndex]._id,
- name: e.data.words_result['姓名'].words
- })
- _this.SubmitOldmanInfo({
- id: _this.data.nameArr[_this.data.activeIndex]._id,
- nation: e.data.words_result['民族'].words + '族'
- })
- _this.SubmitOldmanInfo({
- id: _this.data.nameArr[_this.data.activeIndex]._id,
- sex: e.data.words_result['性别'].words
- })
- } else {
- wx.showModal({
- showCancel: false,
- content: '当前老人不满60周岁'
- })
- }
- } else {
- wx.showModal({
- showCancel: false,
- content: '添加当前老人名字和扫描身份证名字不一致,请重新扫描'
- })
- }
- } else {
- wx.showModal({
- showCancel: false,
- content: '身份证OCR识别失败'
- })
- }
- },
- complete: (e) => {
- wx.hideLoading();
- }
- })
- },
- // 错误信息
- fail: console.error
- })
- },
- fail: function () {
- wx.hideLoading();
- },
- complete: function () {
- _this.setData({
- showBj: false,
- })
- }
- })
- } else {
- wx.showToast({
- title: '身份证识别失败,token失效',
- icon: 'none',
- duration: 2000,
- })
- }
- }
- },
- })
- },
- // 性别单选
- tab1Change2(e) {
- let data = this.data.oldInfo[this.data.activeIndex].oldSex.map(v => {
- if (v.name == e.detail.value) {
- return {
- name: v.name,
- checked: true
- }
- }
- return {
- name: v.name,
- checked: false
- }
- })
- let oldSex = 'oldInfo[' + this.data.activeIndex + '].oldSex'
- let oldSex1 = 'oldInfo[' + this.data.activeIndex + '].oldSexValue'
- this.setData({
- [oldSex]: data,
- [oldSex1]: e.detail.value
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- sex: e.detail.value
- })
- },
- // 民族选择
- tab1Change3: function (e) {
- let nation = 'oldInfo[' + this.data.activeIndex + '].nation'
- this.setData({
- [nation]: this.data.mzArr[e.detail.value]
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- nation: this.data.mzArr[e.detail.value]
- })
- },
- // 身份证号
- tab1Change4: function (e) {
- let idNumber = 'oldInfo[' + this.data.activeIndex + '].idNumber'
- this.setData({
- [idNumber]: e.detail.value
- })
- this.formCheckCard();
- if (!this.data.oldCardNull && !this.data.oldCard60 && !this.data.oldCardWrong) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- idNumber: e.detail.value
- })
- }
- },
- // 联系电话
- tab1Change5: function (e) {
- let phone = 'oldInfo[' + this.data.activeIndex + '].phone'
- this.setData({
- [phone]: e.detail.value
- })
- this.formCheckPhone();
- if (!this.data.oldPhoneNull) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- phone: e.detail.value
- })
- }
- },
- showAdressShow() {
- this.chooseAdress();
- this.setData({
- multiIndex: [0, 0, 0, 0, 0],
- value: [0, 0, 0, 0, 0],
- showAdressBox: true
- })
- },
- showAdressShow1() {
- if (!this.data.oldInfo[this.data.activeIndex].isSameWithAddress[0].checked) {
- this.chooseAdress();
- this.setData({
- multiIndex: [0, 0, 0, 0, 0],
- value: [0, 0, 0, 0, 0],
- showAdressBox1: true
- })
- }
- },
- chooseAdress() {
- wx.request({
- url: util.globalData.publicUrl + '/civilregionalism/deptList',
- method: "get",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- success: (res) => {
- let newdata = [];
- let j;
- res.data.data.forEach(item => {
- newdata.push(item);
- });
- for (var i = 0; i < newdata.length; i++) {
- if (newdata[i].CIVILREGIONALISMNAME == '吉林省') {
- j = i;
- }
- }
- newdata.unshift(newdata[j])
- newdata.splice(j + 1, 1);
- this.setData({
- provinceArr: newdata,
- })
- // if(!this.data.adressChangeStatus){
- this.chooseAdress2();
- // }
- },
- })
- },
- chooseAdress2(fid) {
- wx.showLoading({
- title: '加载中',
- mask: true
- })
- let mid;
- if (fid) {
- mid = fid
- } else {
- console.log(this.data.provinceArr[this.data.multiIndex[1]])
- if(!this.data.provinceArr[this.data.multiIndex[1]]){
- wx.hideLoading()
- }else{
- mid = this.data.provinceArr[this.data.multiIndex[1]].CIVILREGIONALISMID
- }
- }
- let newdata = [];
- wx.request({
- url: util.globalData.publicUrl + '/civilregionalism/deptList',
- method: "get",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- data: {
- fid: mid
- },
- success: (res) => {
- res.data.data.forEach(item => {
- newdata.push(item)
- });
- this.setData({
- cityArr: newdata
- })
- // if(!this.data.adressChangeStatus){
- this.chooseAdress3();
- // }
- }
- })
- },
- // 查县区的信息
- chooseAdress3(fid) {
- wx.showLoading({
- title: '加载中',
- mask: true
- })
- let mid;
- if (fid) {
- mid = fid
- } else {
- if(!this.data.cityArr[this.data.multiIndex[2]]){
- wx.hideLoading()
- }else{
- mid = this.data.cityArr[this.data.multiIndex[2]].CIVILREGIONALISMID
- }
- }
- let newdata = [];
- wx.request({
- url: util.globalData.publicUrl + '/civilregionalism/deptList',
- method: "get",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- data: {
- fid: mid
- },
- success: (res) => {
- res.data.data.forEach(item => {
- newdata.push(item)
- });
- this.setData({
- areaArr: newdata
- })
- if (newdata.length == 0) {
- wx.hideLoading()
- this.setData({
- province: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMNAME,
- city: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMNAME,
- area: '',
- town: '',
- village: '',
- provinceCode: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMCODE,
- cityCode: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMCODE,
- areaCode: '',
- townCode: '',
- villageCode: '',
- areaArr: [],
- townArr: [],
- villageArr: [],
- })
- } else {
- // if(!this.data.adressChangeStatus){
- this.chooseAdress4();
- // }
- }
- }
- })
- },
- // 查镇的信息
- chooseAdress4(fid) {
- wx.showLoading({
- title: '加载中',
- mask: true
- })
- let mid;
- if (fid) {
- mid = fid
- } else {
- console.log(this.data.areaArr[this.data.multiIndex[3]])
- if(!this.data.areaArr[this.data.multiIndex[3]]){
- wx.hideLoading();
- }else{
- mid = this.data.areaArr[this.data.multiIndex[3]].CIVILREGIONALISMID
- }
- }
- let newdata = [];
- wx.request({
- url: util.globalData.publicUrl + '/civilregionalism/deptList',
- method: "get",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- data: {
- fid: mid
- },
- success: (res) => {
- res.data.data.forEach(item => {
- newdata.push(item)
- });
- this.setData({
- townArr: newdata
- })
- if (newdata.length == 0) {
- wx.hideLoading();
- this.setData({
- province: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMNAME,
- city: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMNAME,
- area: this.data.areaArr[this.data.multiIndex[2]].CIVILREGIONALISMNAME,
- town: '',
- village: '',
- townArr: [],
- villageArr: [],
- provinceCode: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMCODE,
- cityCode: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMCODE,
- areaCode: this.data.areaArr[this.data.multiIndex[2]].CIVILREGIONALISMCODE,
- townCode: '',
- villageCode: ''
- })
- } else {
- // if(!this.data.adressChangeStatus){
- this.chooseAdress5();
- // }
- }
- }
- })
- },
- chooseAdress5(fid) {
- wx.showLoading({
- title: '加载中',
- mask: true
- })
- let mid;
- if (fid) {
- mid = fid
- } else {
- console.log(this.data.townArr[this.data.multiIndex[4]])
- if(!this.data.townArr[this.data.multiIndex[4]]){
- wx.hideLoading()
- }else{
- mid = this.data.townArr[this.data.multiIndex[4]].CIVILREGIONALISMID
- }
- }
- let newdata = [];
- wx.request({
- url: util.globalData.publicUrl + '/civilregionalism/deptList',
- method: "get",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- data: {
- fid: mid
- },
- success: (res) => {
- res.data.data.forEach(item => {
- newdata.push(item)
- });
- this.setData({
- villageArr: newdata
- })
- if (newdata.length == 0) {
- wx.hideLoading()
- this.setData({
- villageArr: [],
- province: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMNAME,
- city: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMNAME,
- area: this.data.areaArr[this.data.multiIndex[2]].CIVILREGIONALISMNAME,
- town: this.data.townArr[this.data.multiIndex[3]].CIVILREGIONALISMNAME,
- village: '',
- provinceCode: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMCODE,
- cityCode: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMCODE,
- areaCode: this.data.areaArr[this.data.multiIndex[2]].CIVILREGIONALISMCODE,
- townCode: this.data.townArr[this.data.multiIndex[3]].CIVILREGIONALISMCODE,
- villageCode: ''
- })
- } else {
- wx.hideLoading()
- this.setData({
- province: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMNAME,
- city: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMNAME,
- area: this.data.areaArr[this.data.multiIndex[2]].CIVILREGIONALISMNAME,
- town: this.data.townArr[this.data.multiIndex[3]].CIVILREGIONALISMNAME,
- village: this.data.villageArr[this.data.multiIndex[4]].CIVILREGIONALISMNAME,
- provinceCode: this.data.provinceArr[this.data.multiIndex[0]].CIVILREGIONALISMCODE,
- cityCode: this.data.cityArr[this.data.multiIndex[1]].CIVILREGIONALISMCODE,
- areaCode: this.data.areaArr[this.data.multiIndex[2]].CIVILREGIONALISMCODE,
- townCode: this.data.townArr[this.data.multiIndex[3]].CIVILREGIONALISMCODE,
- villageCode: this.data.villageArr[this.data.multiIndex[4]].CIVILREGIONALISMCODE,
- })
- }
- },
- })
- },
- bindChange(e) {
- console.log(e.detail.value, '我改变开始了')
- console.log('我改变开始了multiIndex值是', this.data.multiIndex)
- if (e.detail.value[0] != this.data.multiIndex[0]) {
- this.chooseAdress2(this.data.provinceArr[e.detail.value[0]].CIVILREGIONALISMID);
- let multiIndex = [];
- multiIndex.push(e.detail.value[0], 0, 0, 0, 0)
- this.setData({
- value: multiIndex
- })
- } else if (e.detail.value[1] != this.data.multiIndex[1]) {
- this.chooseAdress3(this.data.cityArr[e.detail.value[1]].CIVILREGIONALISMID);
- let multiIndex = [];
- multiIndex.push(e.detail.value[0], e.detail.value[1], 0, 0, 0)
- this.setData({
- value: multiIndex
- })
- } else if (e.detail.value[2] != this.data.multiIndex[2]) {
- this.chooseAdress4(this.data.areaArr[e.detail.value[2]].CIVILREGIONALISMID);
- let multiIndex = [];
- multiIndex.push(e.detail.value[0], e.detail.value[1], e.detail.value[2], 0, 0)
- this.setData({
- value: multiIndex
- })
- } else if (e.detail.value[3] != this.data.multiIndex[3]) {
- this.chooseAdress5(this.data.townArr[e.detail.value[3]].CIVILREGIONALISMID);
- let multiIndex = [];
- multiIndex.push(e.detail.value[0], e.detail.value[1], e.detail.value[2], e.detail.value[3], 0)
- this.setData({
- value: multiIndex
- })
- } else if (e.detail.value[4] != this.data.multiIndex[4]) {
- this.setData({
- value: e.detail.value,
- village: this.data.villageArr[e.detail.value[4]].CIVILREGIONALISMNAME,
- villageCode: this.data.villageArr[e.detail.value[4]].CIVILREGIONALISMCODE
- })
- }
- this.setData({
- multiIndex: e.detail.value
- })
- console.log('我改变结束了multiIndex值是', this.data.multiIndex)
- },
- pickSure() {
- let arr = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr';
- let codeArr = [];
- this.setData({
- [arr]: []
- })
- codeArr.push(this.data.provinceCode, this.data.cityCode, this.data.areaCode, this.data.townCode, this.data.villageCode)
- this.data.oldInfo[this.data.activeIndex].chooseAdressArr.push(this.data.province, this.data.city, this.data.area, this.data.town, this.data.village)
- let a = this.data.oldInfo[this.data.activeIndex].chooseAdressArr.join("/");
- let b = codeArr.join(",")
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- nativePlace: a,
- nativePlaceId: b
- })
- this.setData({
- showAdressBox: false,
- oldInfo: this.data.oldInfo,
- })
- if (this.data.oldInfo[this.data.activeIndex].isSameWithAddress[0].checked) {
- let Infos = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
- this.setData({
- [Infos]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- address: a,
- addressId: b
- })
- }
- },
- pickEsc() {
- this.setData({
- showAdressBox: false
- })
- },
- pickSure1() {
- let arr = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1';
- let codeArr = [];
- this.setData({
- [arr]: []
- })
- codeArr.push(this.data.provinceCode, this.data.cityCode, this.data.areaCode, this.data.townCode, this.data.villageCode)
- this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.push(this.data.province, this.data.city, this.data.area, this.data.town, this.data.village)
- let a = this.data.oldInfo[this.data.activeIndex].chooseAdressArr1.join("/");
- let b = codeArr.join(",")
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- address: a,
- addressId: b
- })
- this.setData({
- showAdressBox1: false,
- oldInfo: this.data.oldInfo
- })
- },
- pickEsc1() {
- this.setData({
- showAdressBox1: false
- })
- },
- bindpickstart(e) {
- console.log(e, '滚动开始了')
- wx.showLoading({
- title: '加载中',
- mask: true
- })
- setTimeout(function(){
- wx.hideLoading()
- },5000)
- },
- bindpickend(e) {
- // console.log(e, '滚动结束了')
- wx.hideLoading()
- },
- // 补充户籍地址
- tab1Change6(e) {
- let Info = 'oldInfo[' + this.data.activeIndex + '].nativePlaceExt'
- this.setData({
- [Info]: e.detail.value,
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- nativePlaceExt: e.detail.value
- })
- if (this.data.oldInfo[this.data.activeIndex].isSameWithAddress[0].checked) {
- let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
- this.setData({
- [Infos]: e.detail.value
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- addressExt: e.detail.value
- })
- }
- },
- // 现居地址与户籍地址一致
- tab1change6_1(e) {
- const items = this.data.oldInfo[this.data.activeIndex].isSameWithAddress
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let isSameWithAddress = 'oldInfo[' + this.data.activeIndex + '].isSameWithAddress'
- this.setData({
- [isSameWithAddress]: items
- })
- let codeArr = [];
- codeArr.push(this.data.provinceCode, this.data.cityCode, this.data.areaCode, this.data.townCode, this.data.villageCode)
- let Info = 'oldInfo[' + this.data.activeIndex + '].chooseAdressArr1'
- let Infos = 'oldInfo[' + this.data.activeIndex + '].addressExt'
- if (e.detail.value[0] == '现居地址与户籍地址一致') {
- this.setData({
- nowAdress: true,
- [Info]: this.data.oldInfo[this.data.activeIndex].chooseAdressArr,
- [Infos]: this.data.oldInfo[this.data.activeIndex].nativePlaceExt
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- isSameWithAddress: '是'
- })
- let a = this.data.oldInfo[this.data.activeIndex].chooseAdressArr.join("/");
- let b = codeArr.join(",")
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- address: a,
- addressId: b
- })
- } else {
- this.setData({
- nowAdress: false,
- [Info]: [],
- [Infos]: []
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- isSameWithAddress: '否'
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- address: null,
- addressId: null
- })
- }
- },
- // 补充现居住地址
- tab1Change7(e) {
- let Info = 'oldInfo[' + this.data.activeIndex + '].addressExt'
- this.setData({
- [Info]: e.detail.value
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- addressExt: e.detail.value
- })
- },
- // 婚姻以及配偶情况
- tab1Change8: function (e) {
- let data = this.data.oldInfo[this.data.activeIndex].oldMarry.map(v => {
- if (v.name == e.detail.value) {
- return {
- name: v.name,
- checked: true
- }
- }
- return {
- name: v.name,
- checked: false
- }
- })
- let oldMarry = 'oldInfo[' + this.data.activeIndex + '].oldMarry'
- let oldMarryValue = 'oldInfo[' + this.data.activeIndex + '].oldMarryValue'
- this.setData({
- [oldMarry]: data,
- [oldMarryValue]: e.detail.value
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- partnerState: e.detail.value
- })
- if (!this.data.oldInfo[this.data.activeIndex].oldMarry[1].checked) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- partnerName: ''
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- partnerIdNumber: ''
- })
- }
- },
- //配偶的姓名
- tab1Change8_1(e) {
- let partnerName = 'oldInfo[' + this.data.activeIndex + '].partnerName'
- this.setData({
- [partnerName]: e.detail.value
- })
- this.formCheckPartnerName();
- if (!this.data.oldisMarryName) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- partnerName: e.detail.value
- })
- }
- },
- //配偶身份证号
- tab1Change8_2(e) {
- let partnerIdNumber = 'oldInfo[' + this.data.activeIndex + '].partnerIdNumber'
- this.setData({
- [partnerIdNumber]: e.detail.value
- })
- this.formCheckPartnerId();
- if (!this.data.oldisMarryPhone && !this.data.oldisMarryPhoneGs) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- partnerIdNumber: e.detail.value
- })
- }
- },
- //健康状况
- tab1Change9: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].healthAyy
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = e.detail.value.length; j < lenJ; ++j) {
- if (items[i].name === e.detail.value[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let healthAyy = 'oldInfo[' + this.data.activeIndex + '].healthAyy'
- let healthAyyValue = 'oldInfo[' + this.data.activeIndex + '].healthAyyValue'
- this.setData({
- [healthAyy]: items,
- [healthAyyValue]: e.detail.value
- })
- this.formCheckHealthNull();
- let revise1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].disabled'
- let revise2 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[2].disabled'
- let revise3 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[3].disabled'
- let rev1 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[1].checked'
- let rev2 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[2].checked'
- let rev3 = 'oldInfo[' + this.data.activeIndex + '].healthAyy[3].checked'
- let index = e.detail.value.indexOf('健康');
- if (index >= 0) {
- this.setData({
- [revise1]: true,
- [revise2]: true,
- [revise3]: true,
- [rev1]: false,
- [rev2]: false,
- [rev3]: false
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- health: JSON.stringify(['健康'])
- })
- } else {
- this.setData({
- [revise1]: false,
- [revise2]: false,
- [revise3]: false,
- })
- }
- if (index < 0 && e.detail.value.length != 0) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- health: JSON.stringify(e.detail.value)
- })
- }
- },
- // 残疾类别
- tab1Change10: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].disabilityAyy
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let disabilityAyy = 'oldInfo[' + this.data.activeIndex + '].disabilityAyy'
- let disabilityAyyValue = 'oldInfo[' + this.data.activeIndex + '].disabilityAyyValue'
- this.setData({
- [disabilityAyy]: items,
- [disabilityAyyValue]: e.detail.value
- })
- this.formCheckabilityNull();
- if (this.data.oldInfo[this.data.activeIndex].disabilityAyyValue.length != 0) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- disabilityCategory: JSON.stringify(e.detail.value)
- })
- }
- },
- // 重特大疾病类别
- tab1Change10_1: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].sickType
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let sickType = 'oldInfo[' + this.data.activeIndex + '].sickType'
- let sickTypeValue = 'oldInfo[' + this.data.activeIndex + '].sickTypeValue'
- this.setData({
- [sickType]: items,
- [sickTypeValue]: e.detail.value
- })
- this.formChecksickTypeNull();
- if (this.data.oldInfo[this.data.activeIndex].sickTypeValue.length != 0) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- majorDiseases: e.detail.value
- })
- }
- },
- // 残疾人等级
- tab1Change11: function (e) {
- let disabilityLevel = 'oldInfo[' + this.data.activeIndex + '].disabilityLevel'
- this.setData({
- [disabilityLevel]: this.data.disableLeval[e.detail.value]
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- disabilityLevel: this.data.oldInfo[this.data.activeIndex].disabilityLevel
- })
- },
- // 老年人能力情况
- tab1Change12: function (e) {
- let ability = 'oldInfo[' + this.data.activeIndex + '].ability'
- let Info = 'oldInfo[' + this.data.activeIndex + '].oldType'
- this.setData({
- [ability]: this.data.ableStatus[e.detail.value]
- })
- if (e.detail.value == 2) {
- this.setData({
- [Info]: this.data.oldInfo[this.data.activeIndex].oldType.concat({
- name: "失能老人",
- disable: true,
- checked: true
- })
- })
- } else {
- for (var i = 0; i < this.data.oldInfo[this.data.activeIndex].oldType.length; i++) {
- if (this.data.oldInfo[this.data.activeIndex].oldType[i].name == '失能老人') {
- this.data.oldInfo[this.data.activeIndex].oldType.splice(i, 1);
- }
- this.setData({
- [Info]: this.data.oldInfo[this.data.activeIndex].oldType
- })
- }
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- ability: this.data.ableStatus[e.detail.value]
- })
- },
- // 生活经济情况
- tab1Change13: function (e) {
- let livingCondition = 'oldInfo[' + this.data.activeIndex + '].livingCondition'
- this.setData({
- [livingCondition]: this.data.moneyStatus[e.detail.value]
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- livingCondition: this.data.moneyStatus[e.detail.value]
- })
- },
- // 收入来源
- tab1Change14: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].moneyFromAyy
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let moneyFromAyy = 'oldInfo[' + this.data.activeIndex + '].moneyFromAyy'
- let moneyFromAyyValue = 'oldInfo[' + this.data.activeIndex + '].moneyFromAyyValue'
- this.setData({
- [moneyFromAyy]: items,
- [moneyFromAyyValue]: e.detail.value
- })
- this.formCheckmoneyNull();
- if (this.data.oldInfo[this.data.activeIndex].moneyFromAyyValue.length != 0) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- sourceOfIncome: JSON.stringify(e.detail.value)
- })
- }
- },
- // 其他收入来源sourceOfIncomeExt
- tab1Change14_1: function (e) {
- let sourceOfIncomeExt = 'oldInfo[' + this.data.activeIndex + '].sourceOfIncomeExt'
- this.setData({
- [sourceOfIncomeExt]: e.detail.value
- })
- this.formCheckmoneyQtNull()
- if (e.detail.value != '' && e.detail.value != null) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- sourceOfIncomeExt: e.detail.value
- })
- }
- },
- // 本人上年度可支配收入
- tab1Change15: function (e) {
- let income = 'oldInfo[' + this.data.activeIndex + '].income'
- this.setData({
- [income]: this.data.payMoney[e.detail.value]
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- income: this.data.payMoney[e.detail.value]
- })
- },
- // 家庭救助帮扶情况
- tab1Change16: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].familyHelpArr
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let familyHelpArr = 'oldInfo[' + this.data.activeIndex + '].familyHelpArr'
- let familyHelpArrValue = 'oldInfo[' + this.data.activeIndex + '].familyHelpArrValue'
- this.setData({
- [familyHelpArr]: items,
- [familyHelpArrValue]: e.detail.value
- })
- this.formCheckhelpNull();
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- rescueState: JSON.stringify(e.detail.value)
- })
- },
- // 其他救助帮扶情况
- tab1Change16_1: function (e) {
- let rescueStateExt = 'oldInfo[' + this.data.activeIndex + '].rescueStateExt'
- this.setData({
- [rescueStateExt]: e.detail.value
- })
- this.formCheckhelpQtNull();
- if (e.detail.value != null && e.detail.value != '') {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- rescueStateExt: e.detail.value
- })
- }
- },
- // 是否为失独家庭
- tab1Change17: function (e) {
- let data = this.data.oldInfo[this.data.activeIndex].loneArr.map(v => {
- if (v.name == e.detail.value) {
- return {
- name: v.name,
- checked: true
- }
- }
- return {
- name: v.name,
- checked: false
- }
- })
- let loneArr = 'oldInfo[' + this.data.activeIndex + '].loneArr'
- let loneArrValue = 'oldInfo[' + this.data.activeIndex + '].loneArrValue'
- this.setData({
- [loneArr]: data,
- [loneArrValue]: e.detail.value
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- isLoss: e.detail.value
- })
- },
- // 陪伴居住情况
- tab1Change18: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].liveStatus
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let liveStatus = 'oldInfo[' + this.data.activeIndex + '].liveStatus'
- let liveStatusValue = 'oldInfo[' + this.data.activeIndex + '].liveStatusValue'
- this.setData({
- [liveStatus]: items,
- [liveStatusValue]: e.detail.value
- })
- this.formCheckliveNull();
- let revise1 = "oldInfo[" + this.data.activeIndex + "].liveStatus[1].disabled";
- let revise2 = "oldInfo[" + this.data.activeIndex + "].liveStatus[2].disabled";
- let revise3 = "oldInfo[" + this.data.activeIndex + "].liveStatus[3].disabled";
- let revise4 = "oldInfo[" + this.data.activeIndex + "].liveStatus[4].disabled";
- let rev1 = "oldInfo[" + this.data.activeIndex + "].liveStatus[1].checked";
- let rev2 = "oldInfo[" + this.data.activeIndex + "].liveStatus[2].checked";
- let rev3 = "oldInfo[" + this.data.activeIndex + "].liveStatus[3].checked";
- let rev4 = "oldInfo[" + this.data.activeIndex + "].liveStatus[4].checked";
- let index = e.detail.value.indexOf('无人陪伴居住');
- if (index >= 0) {
- this.setData({
- [revise1]: true,
- [revise2]: true,
- [revise3]: true,
- [revise4]: true,
- [rev1]: false,
- [rev2]: false,
- [rev3]: false,
- [rev4]: false,
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- accompany: JSON.stringify(['无人陪伴居住'])
- })
- } else {
- this.setData({
- [revise1]: false,
- [revise2]: false,
- [revise3]: false,
- [revise4]: false
- })
- }
- if (index < 0 && e.detail.value.length != 0) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- accompany: JSON.stringify(e.detail.value)
- })
- }
- },
- // 其他陪伴居住情况
- tab1Change18_1: function (e) {
- let accompanyExt = 'oldInfo[' + this.data.activeIndex + '].accompanyExt'
- this.setData({
- [accompanyExt]: e.detail.value
- })
- this.formCheckliveqtNull();
- if (e.detail.value != null && e.detail.value != '') {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- accompanyExt: e.detail.value
- })
- }
- },
- // 日常生活照料人
- tab1Change19: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].oftenMan
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let oftenMan = 'oldInfo[' + this.data.activeIndex + '].oftenMan'
- let oftenManValue = 'oldInfo[' + this.data.activeIndex + '].oftenManValue'
- this.setData({
- [oftenMan]: items,
- [oftenManValue]: e.detail.value
- })
- let revise1 = "oldInfo[" + this.data.activeIndex + "].oftenMan[1].disabled";
- let revise2 = "oldInfo[" + this.data.activeIndex + "].oftenMan[2].disabled";
- let revise3 = "oldInfo[" + this.data.activeIndex + "].oftenMan[3].disabled";
- let revise4 = "oldInfo[" + this.data.activeIndex + "].oftenMan[4].disabled";
- let revise5 = "oldInfo[" + this.data.activeIndex + "].oftenMan[5].disabled";
- let rev1 = "oldInfo[" + this.data.activeIndex + "].oftenMan[1].checked";
- let rev2 = "oldInfo[" + this.data.activeIndex + "].oftenMan[2].checked";
- let rev3 = "oldInfo[" + this.data.activeIndex + "].oftenMan[3].checked";
- let rev4 = "oldInfo[" + this.data.activeIndex + "].oftenMan[4].checked";
- let rev5 = "oldInfo[" + this.data.activeIndex + "].oftenMan[5].checked";
- this.formCheckoftenNull();
- let index = e.detail.value.indexOf('无人照料');
- if (index >= 0) {
- this.setData({
- [revise1]: true,
- [revise2]: true,
- [revise3]: true,
- [revise4]: true,
- [revise5]: true,
- [rev1]: false,
- [rev2]: false,
- [rev3]: false,
- [rev4]: false,
- [rev5]: false,
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- lookAfter: JSON.stringify(['无人照料'])
- })
- } else {
- this.setData({
- [revise1]: false,
- [revise2]: false,
- [revise3]: false,
- [revise4]: false,
- [revise5]: false
- })
- }
- if (index < 0 && e.detail.value.length != 0) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- lookAfter: JSON.stringify(e.detail.value)
- })
- }
- },
- // 其他人员关系
- tab1Change20: function (e) {
- let lookAfterExt = 'oldInfo[' + this.data.activeIndex + '].lookAfterExt'
- this.setData({
- [lookAfterExt]: e.detail.value
- })
- this.formCheckoftenQtNull();
- if (e.detail.value != null && e.detail.value != '') {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- lookAfterExt: e.detail.value
- })
- }
- },
- // 主要照料人姓名
- tab1Change21: function (e) {
- let mainLookName = 'oldInfo[' + this.data.activeIndex + '].mainLookName'
- this.setData({
- [mainLookName]: e.detail.value
- })
- this.formCheckoftenNameNull();
- if (e.detail.value != null && e.detail.value != '') {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- mainLookName: e.detail.value
- })
- }
- },
- // 主要照料人性别
- tab1Change22: function (e) {
- let data = this.data.oldInfo[this.data.activeIndex].mainLookSex.map(v => {
- if (v.name == e.detail.value) {
- return {
- name: v.name,
- checked: true
- }
- }
- return {
- name: v.name,
- checked: false
- }
- })
- let mainLookSex = 'oldInfo[' + this.data.activeIndex + '].mainLookSex'
- let mainLookSexValue = 'oldInfo[' + this.data.activeIndex + '].mainLookSexValue'
- this.setData({
- [mainLookSex]: data,
- [mainLookSexValue]: e.detail.value
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- mainLookSex: e.detail.value
- })
- },
- // 主要照料人电话
- tab1Change23: function (e) {
- let mainLookPhone = 'oldInfo[' + this.data.activeIndex + '].mainLookPhone'
- this.setData({
- [mainLookPhone]: e.detail.value
- })
- this.formCheckoftenPhoneNull();
- if (e.detail.value != '' && e.detail.value != null) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- mainLookPhone: e.detail.value
- })
- }
- },
- // 关爱服务需求
- tab1Change24: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].loveRequire
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let loveRequire = 'oldInfo[' + this.data.activeIndex + '].loveRequire'
- let loveRequireValue = 'oldInfo[' + this.data.activeIndex + '].loveRequireValue'
- this.setData({
- [loveRequire]: items,
- [loveRequireValue]: e.detail.value
- })
- this.formCheckloveNull();
- if (e.detail.value.length > 0) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- demand: JSON.stringify(e.detail.value)
- })
- }
- },
- // 其他关爱需求
- tab1Change25: function (e) {
- console.log(e)
- let Info = 'oldInfo[' + this.data.activeIndex + '].demandExt'
- this.setData({
- [Info]: e.detail.value
- })
- this.formCheckloveQtNull();
- if (e.detail.value != null && e.detail.value != '') {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- demandExt: e.detail.value
- })
- }
- },
- //老年人类别
- tab1Change26: function (e) {
- const items = this.data.oldInfo[this.data.activeIndex].oldType
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let oldType = 'oldInfo[' + this.data.activeIndex + '].oldType'
- let oldTypeValue = 'oldInfo[' + this.data.activeIndex + '].oldTypeValue'
- this.setData({
- [oldType]: items,
- [oldTypeValue]: e.detail.value
- })
- let index1 = e.detail.value.indexOf('农村留守老年人')
- let index2 = e.detail.value.indexOf('分散供养特困老年人')
- let index3 = e.detail.value.indexOf('计划生育特殊家庭老人')
- let index4 = e.detail.value.indexOf('空巢老年人')
- let revise = this.data.oldInfo[this.data.activeIndex].oldType[0].checked;
- let revise1 = "oldInfo[" + this.data.activeIndex + "].oldType[0].disable";
- let revise2 = "oldInfo[" + this.data.activeIndex + "].oldType[1].disable";
- let revise3 = "oldInfo[" + this.data.activeIndex + "].oldType[2].disable";
- let revise4 = "oldInfo[" + this.data.activeIndex + "].oldType[3].disable";
- let revise5 = "oldInfo[" + this.data.activeIndex + "].oldType[3].checked";
- if (index1 >= 0) {
- this.setData({
- [revise2]: true,
- [revise3]: true,
- [revise4]: true,
- [revise5]: true
- })
- } else {
- this.setData({
- [revise2]: false,
- [revise3]: false,
- [revise4]: false,
- })
- if (revise != this.data.villageOldChecked) {
- this.setData({
- [revise5]: false
- })
- } else {
- if (index4 >= 0) {
- this.setData({
- [revise1]: true,
- [revise2]: true,
- [revise3]: true,
- })
- }
- }
- }
- if (index2 >= 0) {
- this.setData({
- [revise1]: true,
- [revise3]: true,
- [revise4]: true
- })
- }
- if (index2 < 0 && index1 < 0 && index3 < 0 && index4 < 0) {
- this.setData({
- [revise1]: false,
- [revise2]: false,
- [revise3]: false,
- [revise4]: false
- })
- }
- if (index3 >= 0) {
- this.setData({
- [revise1]: true,
- [revise2]: true,
- [revise4]: true
- })
- }
- this.setData({
- villageOldChecked: revise
- })
- let newArray = []; //新数组
- let j = 0;
- for (let i in this.data.oldInfo[this.data.activeIndex].oldType) {
- if (this.data.oldInfo[this.data.activeIndex].oldType[i].checked) {
- newArray[j++] = this.data.oldInfo[this.data.activeIndex].oldType[i].name
- }
- }
- this.formCheckoldtypeNull();
- if (newArray.length > 0) {
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- oldType: JSON.stringify(newArray)
- })
- }
- },
- goPhoto() {
- let that = this;
- isTwoOnshow = true;
- wx.setStorageSync('isTwoOnshow', true)
- wx.showLoading({
- title: '加载中',
- })
- wx.chooseImage({
- count: 1,
- sizeType: ['compressed'],
- sourceType: ['camera'],
- success: function (res) {
- const app = getApp()
- app.globalData.id = '-1'
- let tempFilePaths = res.tempFilePaths
- wx.uploadFile({
- url: util.globalData.publicUrl + '/sys/user/upload',
- filePath: tempFilePaths[0],
- name: 'uploadFile',
- formData: {
- "user": "test",
- },
- header: {
- appletsId: wx.getStorageSync('openId'),
- },
- success: function (res) {
- const app = getApp()
- app.globalData.id = '-2'
- let datas = JSON.parse(res.data)
- let imgPath = 'oldInfo[' + that.data.activeIndex + '].imgPath'
- let isHavePhoto = 'oldInfo[' + that.data.activeIndex + '].isHavePhoto'
- that.setData({
- [imgPath]: datas.data,
- [isHavePhoto]: true,
- })
- that.getSelfLocation();
- that.SubmitOldmanInfo({
- id: that.data.nameArr[that.data.activeIndex]._id,
- photo: datas.data,
- })
- }
- })
- },
- complete: (e) => {
- wx.hideLoading();
- }
- })
- },
- closeImage(e) {
- let imgPath = 'oldInfo[' + e.currentTarget.dataset.activeindex + '].imgPath'
- this.setData({
- [imgPath]: '',
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- photo: '',
- })
- },
- // 子女个数
- tab2Change1: function (e) {
- let childrenNum = 'childInfo[' + this.data.activeIndex + '].childrenNum'
- let Info = 'childInfo[' + this.data.activeIndex + '].Info'
- this.setData({
- [childrenNum]: this.data.childNumArr[e.detail.value],
- })
- if (e.detail.value == 0) {
- this.setData({
- [Info]: []
- })
- } else if (e.detail.value == 1) {
- this.setData({
- [Info]: [{
- name: '', // 姓名
- sex: '',
- phone: '', // 常用联系电话,
- isHasGoOut: '', // 子女是否外出
- outgoingplace: '', // 外出地点
- isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
- name2: '', // 子女配偶姓名
- phone2: '', // 子女配偶电话
- outgoingTime: '', // 最后一次离家时间
- outgoingCause: '', // 外出原因
- visit: '', // 平均一年探望次数
- }]
- })
- } else if (e.detail.value == 2) {
- this.setData({
- [Info]: [{
- name: '', // 姓名
- sex: '',
- phone: '', // 常用联系电话,
- isHasGoOut: '', // 子女是否外出
- outgoingplace: '', // 外出地点
- isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
- name2: '', // 子女配偶姓名
- phone2: '', // 子女配偶电话
- outgoingTime: '', // 最后一次离家时间
- outgoingCause: '', // 外出原因
- visit: '', // 平均一年探望次数
- }, {
- name: '', // 姓名
- sex: '',
- phone: '', // 常用联系电话,
- isHasGoOut: '', // 子女是否外出
- outgoingplace: '', // 外出地点
- isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
- name2: '', // 子女配偶姓名
- phone2: '', // 子女配偶电话
- outgoingTime: '', // 最后一次离家时间
- outgoingCause: '', // 外出原因
- visit: '', // 平均一年探望次数
- }]
- })
- } else {
- this.setData({
- [Info]: [{
- name: '', // 姓名
- sex: '',
- phone: '', // 常用联系电话,
- isHasGoOut: '', // 子女是否外出
- outgoingplace: '', // 外出地点
- isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
- name2: '', // 子女配偶姓名
- phone2: '', // 子女配偶电话
- outgoingTime: '', // 最后一次离家时间
- outgoingCause: '', // 外出原因
- visit: '', // 平均一年探望次数
- }, {
- name: '', // 姓名
- sex: '',
- phone: '', // 常用联系电话,
- isHasGoOut: '', // 子女是否外出
- outgoingplace: '', // 外出地点
- isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
- name2: '', // 子女配偶姓名
- phone2: '', // 子女配偶电话
- outgoingTime: '', // 最后一次离家时间
- outgoingCause: '', // 外出原因
- visit: '', // 平均一年探望次数
- }, {
- name: '', // 姓名
- sex: '',
- phone: '', // 常用联系电话,
- isHasGoOut: '', // 子女是否外出
- outgoingplace: '', // 外出地点
- isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
- name2: '', // 子女配偶姓名
- phone2: '', // 子女配偶电话
- outgoingTime: '', // 最后一次离家时间
- outgoingCause: '', // 外出原因
- visit: '', // 平均一年探望次数
- }]
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childrenNum: e.detail.value,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 子女姓名
- tab2Change2: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name';
- this.setData({
- [child]: e.detail.value
- })
- if (!e.detail.value) {
- this.setData({
- ['childNameNull[' + e.currentTarget.dataset.index + ']']: true
- })
- return false;
- } else {
- this.setData({
- ['childNameNull[' + e.currentTarget.dataset.index + ']']: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 子女性别
- tab2Change3: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].sex';
- this.setData({
- [child]: this.data.childSexArr[e.detail.value]
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 子女联系电话
- tab2Change4: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].phone';
- this.setData({
- [child]: e.detail.value
- })
- if (!e.detail.value) {
- this.setData({
- ['childPhoneNull[' + e.currentTarget.dataset.index + ']']: true
- })
- return false;
- } else {
- this.setData({
- ['childPhoneNull[' + e.currentTarget.dataset.index + ']']: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 子女是否外出
- tab2Change5: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].isHasGoOut';
- this.setData({
- [child]: this.data.childIsout[e.detail.value]
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- //外出原因
- tab2Change6: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingCause';
- this.setData({
- [child]: e.detail.value
- })
- // if (!e.detail.value) {
- // let flag = 'ischildOutReason[' + e.currentTarget.dataset.index + '] ';
- // this.setData({
- // [flag]: true
- // })
- // return false;
- // }
- if (!e.detail.value) {
- this.setData({
- ['ischildOutReason[' + e.currentTarget.dataset.index + ']']: true
- })
- return false;
- } else {
- this.setData({
- ['ischildOutReason[' + e.currentTarget.dataset.index + ']']: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 外出地点
- tab2Change7: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingplace';
- let a = e.detail.value.join("/");
- this.setData({
- [child]: a
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 最后一次离家时间
- tab2Change8: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].outgoingTime';
- this.setData({
- [child]: e.detail.value
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 是否有配偶
- tab2Change9: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].isHasPartner';
- this.setData({
- [child]: this.data.childIsMArry[e.detail.value]
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 配偶姓名
- tab2Change10: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].name2';
- this.setData({
- [child]: e.detail.value
- })
- if (!e.detail.value) {
- this.setData({
- ['ischildMarryName[' + e.currentTarget.dataset.index + ']']: true
- })
- return false;
- } else {
- this.setData({
- ['ischildMarryName[' + e.currentTarget.dataset.index + ']']: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 配偶联系电话
- tab2Change11: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].phone2';
- this.setData({
- [child]: e.detail.value
- })
- if (!e.detail.value) {
- this.setData({
- ['ischildMarryPhone[' + e.currentTarget.dataset.index + ']']: true
- })
- return false;
- } else {
- this.setData({
- ['ischildMarryPhone[' + e.currentTarget.dataset.index + ']']: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // 一年探望次数
- tab2Change12: function (e) {
- let child = 'childInfo[' + this.data.activeIndex + '].Info[' + e.currentTarget.dataset.index + '].visit';
- this.setData({
- [child]: this.data.childTfTimes[e.detail.value]
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- childInfo: JSON.stringify(this.data.childInfo[this.data.activeIndex].Info)
- })
- },
- // tab3是否有赡养人状态改变
- tab3Change1: function (e) {
- let isHasOther = 'otherInfo[' + this.data.activeIndex + '].isHasOther'
- if (e.detail.value == '0') {
- this.setData({
- [isHasOther]: this.data.othersyrArr[e.detail.value],
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- } else {
- this.setData({
- [isHasOther]: this.data.othersyrArr[e.detail.value],
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: ''
- })
- }
- this.setData({
- [isHasOther]: this.data.othersyrArr[e.detail.value],
- })
- },
- // 其他赡养人姓名
- tab3Change2: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name'
- this.setData({
- [Info]: e.detail.value,
- })
- if (!e.detail.value) {
- this.setData({
- isothersyrName: true
- })
- return false;
- } else {
- this.setData({
- isothersyrName: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 其他赡养人性别
- tab3Change3: function (e) {
- let data = this.data.otherInfo[this.data.activeIndex].Info.othersyrSexArr.map(v => {
- if (v.name == e.detail.value) {
- return {
- name: v.name,
- checked: true
- }
- }
- return {
- name: v.name,
- checked: false
- }
- })
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.sex'
- this.setData({
- [Info]: e.detail.value
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 其他赡养人电话
- tab3Change4: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.phone'
- this.setData({
- [Info]: e.detail.value,
- })
- if (!e.detail.value) {
- this.setData({
- isothersyrPhone: true
- })
- return false;
- } else {
- this.setData({
- isothersyrPhone: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 与被赡养人关系状态改变
- tab3Change5: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.relation'
- this.setData({
- [Info]: this.data.othersyrRelation[e.detail.value],
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 输选择其他时入与被赡养人其他关系
- tab3Change6: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.relationExt'
- this.setData({
- [Info]: e.detail.value,
- })
- if (!e.detail.value) {
- this.setData({
- isothersyRelation: true
- })
- return false;
- } else {
- this.setData({
- isothersyRelation: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 是否外出
- tab3Change7: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.isHasGoOut'
- this.setData({
- [Info]: this.data.othersyrIsout[e.detail.value],
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 外出原因
- tab3Change8: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingCause'
- this.setData({
- [Info]: e.detail.value,
- })
- if (!e.detail.value) {
- this.setData({
- isOutReason: true
- })
- return false;
- } else {
- this.setData({
- isOutReason: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 外出地点改变
- tab3Change9: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingplace'
- let a = e.detail.value.join("/");
- this.setData({
- [Info]: a
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- //最后一次离家时间
- tab3Change10: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.outgoingTime'
- this.setData({
- [Info]: e.detail.value,
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- //是否有配偶
- tab3Change11: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.isHasPartner'
- this.setData({
- [Info]: this.data.othersyrIsMarry[e.detail.value],
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 配偶姓名
- tab3Change12: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.name2'
- this.setData({
- [Info]: e.detail.value,
- })
- if (!e.detail.value) {
- this.setData({
- isMarryName: true
- })
- return false;
- } else {
- this.setData({
- isMarryName: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- // 配偶电话
- tab3Change13: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.phone2'
- this.setData({
- [Info]: e.detail.value,
- })
- if (!e.detail.value) {
- this.setData({
- isMarryPhone: true
- })
- return false;
- } else {
- this.setData({
- isMarryPhone: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- //平均一年探望次数
- tab3Change14: function (e) {
- let Info = 'otherInfo[' + this.data.activeIndex + '].Info.visit'
- this.setData({
- [Info]: this.data.othersyrTfTimes[e.detail.value],
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- otherInfo: JSON.stringify(this.data.otherInfo[this.data.activeIndex].Info)
- })
- },
- //tab4巡访方式
- tab4Change1: function (e) {
- const items = this.data.regularsInfos[this.data.activeIndex].visitMode
- const values = e.detail.value
- for (let i = 0, lenI = items.length; i < lenI; ++i) {
- items[i].checked = false
- for (let j = 0, lenJ = values.length; j < lenJ; ++j) {
- if (items[i].name === values[j]) {
- items[i].checked = true
- break
- }
- }
- }
- let visitMode = 'regularsInfos[' + this.data.activeIndex + '].visitMode'
- let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
- this.setData({
- [visitMode]: items,
- [visitMode1]: JSON.stringify(e.detail.value)
- })
- if (e.detail.value.length == 0) {
- this.setData({
- visitWaysFromOther: true
- })
- return false
- } else {
- this.setData({
- visitWaysFromOther: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
- })
- },
- // 巡防方式其他内容
- tab4Change2: function (e) {
- let Info = 'regularsInfos[' + this.data.activeIndex + '].visitModeExt'
- let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitModeExt'
- let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
- let arrs = [];
- this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
- if (item.checked) {
- arrs.push(item.name)
- }
- })
- this.setData({
- [Info]: e.detail.value,
- [Info1]: e.detail.value,
- [visitMode1]: JSON.stringify(arrs),
- })
- if (!e.detail.value) {
- this.setData({
- isVisittimesnull: true
- })
- return false
- } else {
- this.setData({
- isVisittimesnull: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
- })
- },
- // 巡访频次
- tab4Change3: function (e) {
- let data = this.data.regularsInfos[this.data.activeIndex].visitCount.map(v => {
- if (v.name == e.detail.value) {
- return {
- name: v.name,
- checked: true
- }
- }
- return {
- name: v.name,
- checked: false
- }
- })
- let visitCount = 'regularsInfos[' + this.data.activeIndex + '].visitCount'
- let visitCount1 = 'regularsInfo[' + this.data.activeIndex + '].visitCount'
- let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
- let arrs = [];
- this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
- if (item.checked) {
- arrs.push(item.name)
- }
- })
- this.setData({
- [visitCount]: data,
- [visitCount1]: e.detail.value,
- [visitMode1]: JSON.stringify(arrs),
- })
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
- })
- },
- // 巡防方式其他内容
- tab4change4: function (e) {
- let Info = 'regularsInfos[' + this.data.activeIndex + '].visitCountExt'
- let Info1 = 'regularsInfo[' + this.data.activeIndex + '].visitCountExt'
- let visitMode1 = 'regularsInfo[' + this.data.activeIndex + '].visitMode'
- let arrs = [];
- this.data.regularsInfos[this.data.activeIndex].visitMode.forEach(item => {
- if (item.checked) {
- arrs.push(item.name)
- }
- })
- this.setData({
- [Info]: e.detail.value,
- [Info1]: e.detail.value,
- [visitMode1]: JSON.stringify(arrs),
- })
- if (!e.detail.value) {
- this.setData({
- isVisittimesQtnull: true
- })
- return false
- } else {
- this.setData({
- isVisittimesQtnull: false
- })
- }
- this.SubmitOldmanInfo({
- id: this.data.nameArr[this.data.activeIndex]._id,
- regularsInfo: JSON.stringify(this.data.regularsInfo[this.data.activeIndex])
- })
- },
- removeExcess(data) {
- if (data) {
- data = JSON.parse(data);
- }
- return data;
- },
- huixian(id, name) {
- if (!id) {
- let showbj = true;
- let oldInfo = [{
- name: '',
- oldSex: [{
- name: '男'
- }, {
- name: '女'
- }],
- oldSexValue: '',
- isSameWithAddress: [{
- name: '现居地址与户籍地址一致'
- }],
- addressExt: '',
- nativePlaceExt: '',
- nation: '', //民族
- idNumber: '', //身份证号
- phone: '',
- chooseAdressArr: [],
- chooseAdressArr1: [],
- oldMarry: [{
- name: "未婚"
- }, {
- name: "已婚"
- }, {
- name: "离异"
- }, {
- name: "丧偶"
- }],
- oldMarryValue: '',
- partnerName: '',
- partnerIdNumber: '',
- healthAyy: [{
- name: "健康",
- disabled: false
- }, {
- name: "残疾",
- disabled: false
- }, {
- name: "患重特大疾病",
- disabled: false
- }, {
- name: "老年人慢性病",
- disabled: false
- }],
- healthAyyValue: [],
- disabilityAyy: [{
- name: "视力残疾"
- }, {
- name: "听力残疾"
- }, {
- name: "言语残疾"
- }, {
- name: "肢体残疾"
- }, {
- name: "智力残疾"
- }, {
- name: "精神残疾"
- }, {
- name: "多重残疾"
- }],
- disabilityAyyValue: [],
- disabilityLevel: '', //残疾人类别
- sickType: [{
- name: "重大器官类疾病"
- }, {
- name: "心脑血管类疾病"
- }, {
- name: "神经与代谢类疾病"
- }, {
- name: "肢体与病毒类疾病"
- }, {
- name: "恶性肿瘤"
- }],
- sickTypeValue: [],
- ability: '', //老年人能力情况
- livingCondition: '', //生活经济情况
- moneyFromAyy: [{
- name: "家庭经营性收入"
- }, {
- name: "工资性收入"
- }, {
- name: "转移性收入"
- }, {
- name: "财产性收入"
- }, {
- name: "其它"
- }],
- moneyFromAyyValue: [],
- income: '',
- sourceOfIncomeExt: '', //其他收入情况
- familyHelpArr: [{
- name: "低保"
- }, {
- name: "建档立卡贫困户"
- }, {
- name: "医疗救助"
- }, {
- name: "临时救助"
- }, {
- name: "老年人福利津贴"
- }, {
- name: "残疾人两项补贴(或一项补贴)"
- }, {
- name: "其他救助"
- }],
- familyHelpArrValue: [],
- rescueStateExt: '', //其他救助
- loneArr: [{
- name: "是"
- }, {
- name: "否"
- }],
- loneArrValue: '',
- liveStatus: [{
- name: "无人陪伴居住",
- disabled: false
- }, {
- name: "配偶",
- disabled: false
- }, {
- name: "近亲属",
- disabled: false
- }, {
- name: "未成年孙子女",
- disabled: false
- }, {
- name: "其他情形",
- disabled: false
- }],
- liveStatusValue: [],
- accompanyExt: '', //陪伴居住其他
- oftenMan: [{
- name: "无人照料",
- disabled: false
- }, {
- name: "近亲属",
- disabled: false
- }, {
- name: "配偶",
- disabled: false
- }, {
- name: "邻里互助",
- disabled: false
- }, {
- name: "购买养老服务",
- disabled: false
- }, {
- name: "其他人员",
- disabled: false
- }],
- oftenManValue: [],
- lookAfterExt: '', //其他日常生活照料人关系
- mainLookName: '', //日常生活照料人姓名
- mainLookSex: [{
- name: "男"
- }, {
- name: "女"
- }],
- mainLookSexValue: '',
- mainLookPhone: '', //
- loveRequire: [{
- name: "生活照料"
- },
- {
- name: "生产帮助"
- },
- {
- name: "精神慰藉"
- },
- {
- name: "医疗保健"
- },
- {
- name: "权益维护"
- },
- {
- name: "安全监护"
- },
- {
- name: "文化娱乐"
- },
- {
- name: "紧急救助"
- },
- {
- name: "其它"
- },
- ],
- loveRequireValue: [],
- oldType: [{
- name: "农村留守老年人",
- disable: false,
- checked: false
- }, {
- name: "分散供养特困老年人",
- disable: false,
- checked: false
- }, {
- name: "计划生育特殊家庭老人",
- disable: false,
- checked: false
- }, {
- name: "空巢老年人",
- disable: false,
- checked: false
- }, {
- name: "独居老年人",
- disable: false,
- checked: false
- }, {
- name: "重残老年人",
- disable: false,
- checked: false
- }, {
- name: "高龄老年人",
- disable: false,
- checked: false
- }, {
- name: "居家老年人",
- disable: false,
- checked: false
- }],
- oldTypeValue: [],
- isHavePhoto: false,
- imgPath: '',
- photoAndLocation: '',
- }];
- let regularsInfos = [{
- visitMode: [{
- name: '电话问候',
- checked: false
- }, {
- name: '上门巡访',
- checked: false
- }, {
- name: '其它',
- checked: false
- }],
- visitModeExt: '', //巡访其他
- visitCount: [{
- name: '每天',
- checked: false
- }, {
- name: '每周',
- checked: false
- }, {
- name: '每月',
- checked: false
- }, {
- name: '每季',
- checked: false
- }, {
- name: '其它',
- checked: false
- }],
- visitCountExt: '', // 频次的其他
- }];
- let otherInfo = [{
- isHasOther: '',
- Info: {
- name: '', // 其他赡养人姓名,
- sex: '', //其他赡养人性别
- phone: '', //其他赡养人电话,
- relation: '', //与被赡养人关系 如果选了其他也是必填 单选
- relationExt: '', //与被赡养人关系--其他
- isHasGoOut: '', //是否外出
- outgoingCause: '', //外出原因
- outgoingplace: '', // 外出地点
- outgoingTime: '', // 最后一次离家时间
- isHasPartner: '', //是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0:是 1:否
- name2: '',
- phone2: '',
- visit: '', //平均一年探望次数
- othersyrSexArr: [{
- name: '男',
- checked: false
- },
- {
- name: '女',
- checked: false
- },
- ]
- }
- }];
- let childInfo = [{
- childrenNum: ''
- }]
- this.setData({
- showBj: showbj,
- nameArr: [],
- oldInfo: oldInfo,
- childInfo: childInfo,
- otherInfo: otherInfo,
- regularsInfos: regularsInfos,
- })
- } else if (id == '-1') {
- console.log('手机回显显示照片')
- } else if (id) {
- wx.showLoading({
- title: '加载中',
- })
- this.setData({
- showBj: false,
- showBj1: false,
- showAdress: false,
- showAdress1: false,
- nameArr: [],
- activeIndex: 0,
- familyFid: id,
- color: 'transparent',
- })
- var that = this;
- wx.request({
- url: util.globalData.publicUrl + '/wxinfo/listByFid',
- method: "GET",
- data: {
- fid: id,
- },
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- success: (res) => {
- wx.hideLoading()
- console.log(res.data.data, "单查赋值锕")
- that.setData({
- oldInfo: res.data.data
- })
- let datass = res.data.data;
- let fristIndex = datass.findIndex((item) => {
- return name == item.name;
- });
- let fristArray = datass.filter((item) => {
- return name == item.name;
- });
- datass.splice(fristIndex, 1);
- datass.unshift(fristArray[0]);
- that.setData({
- nameArr: datass
- })
- console.log(that.data.regularsInfo, "赋值是么");
- let oldSex = [{
- name: '男',
- checked: false
- },
- {
- name: '女',
- checked: false
- }
- ]
- let oldMarry = [{
- name: "未婚"
- }, {
- name: "已婚"
- }, {
- name: "离异"
- }, {
- name: "丧偶"
- }];
- let loneArr = [{
- name: "是"
- }, {
- name: "否"
- }];
- let mainLookSex = [{
- name: "男"
- }, {
- name: "女"
- }];
- let abc = datass.map(item => {
- let otherInfo = ''
- let imgPath = ''
- if (item.photo) {
- imgPath = item.photo;
- } else {
- imgPath = ''
- }
- let disabilityAyyss = [{
- name: "视力残疾"
- }, {
- name: "听力残疾"
- }, {
- name: "言语残疾"
- }, {
- name: "肢体残疾"
- }, {
- name: "智力残疾"
- }, {
- name: "精神残疾"
- }, {
- name: "多重残疾"
- }];
- let sickType = [{
- name: "重大器官类疾病"
- }, {
- name: "心脑血管类疾病"
- }, {
- name: "神经与代谢类疾病"
- }, {
- name: "肢体与病毒类疾病"
- }, {
- name: "恶性肿瘤"
- }];
- let moneyFromAyy = [{
- name: "家庭经营性收入"
- }, {
- name: "工资性收入"
- }, {
- name: "转移性收入"
- }, {
- name: "财产性收入"
- }, {
- name: "其它"
- }];
- let familyHelpArr = [{
- name: "低保"
- }, {
- name: "建档立卡贫困户"
- }, {
- name: "医疗救助"
- }, {
- name: "临时救助"
- }, {
- name: "老年人福利津贴"
- }, {
- name: "残疾人两项补贴(或一项补贴)"
- }, {
- name: "其他救助"
- }];
- let loveRequire = [{
- name: "生活照料"
- },
- {
- name: "生产帮助"
- },
- {
- name: "精神慰藉"
- },
- {
- name: "医疗保健"
- },
- {
- name: "权益维护"
- },
- {
- name: "安全监护"
- },
- {
- name: "文化娱乐"
- },
- {
- name: "紧急救助"
- },
- {
- name: "其它"
- },
- ];
- let isSameWithAddresss = [{
- name: '现居地址与户籍地址一致'
- }]
- let finalarr = [];
- if (item.health.includes("健康")) {
- for (let i = 0; i < 4; i++) {
- let obj = new Object();
- obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
- obj.checked = (i == 0 ? true : false);
- obj.disabled = (i == 0 ? false : true);
- finalarr.push(obj)
- }
- } else {
- for (let i = 0; i < 4; i++) {
- let obj = new Object();
- obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
- obj.checked = (i == 0 ? false : false);
- obj.disabled = (i == 0 ? false : false);
- finalarr.push(obj)
- }
- if (item.health.includes("残疾")) {
- finalarr[1].checked = true;
- }
- if (item.health.includes("患重特大疾病")) {
- finalarr[2].checked = true;
- }
- if (item.health.includes("老年人慢性病")) {
- finalarr[3].checked = true;
- }
- }
- let accompanyArr = [];
- if (item.accompany.includes("无人陪伴居住")) {
- for (let i = 0; i < 5; i++) {
- let obj = new Object();
- obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
- obj.checked = (i == 0 ? true : false);
- obj.disabled = (i == 0 ? false : true);
- accompanyArr.push(obj)
- }
- } else {
- for (let i = 0; i < 5; i++) {
- let obj = new Object();
- obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
- obj.checked = (i == 0 ? false : false);
- obj.disabled = (i == 0 ? false : false);
- accompanyArr.push(obj)
- }
- if (item.accompany.includes("配偶")) {
- accompanyArr[1].checked = true;
- }
- if (item.accompany.includes("近亲属")) {
- accompanyArr[2].checked = true;
- }
- if (item.accompany.includes("未成年孙子女")) {
- accompanyArr[3].checked = true;
- }
- if (item.accompany.includes("其他情形")) {
- accompanyArr[4].checked = true;
- }
- }
- let lookAfterArr = [];
- if (item.lookAfter.includes("无人照料")) {
- for (let i = 0; i < 6; i++) {
- let obj = new Object();
- obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
- obj.checked = (i == 0 ? true : false);
- obj.disabled = (i == 0 ? false : true);
- lookAfterArr.push(obj)
- }
- } else {
- for (let i = 0; i < 6; i++) {
- let obj = new Object();
- obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
- obj.checked = (i == 0 ? false : false);
- obj.disabled = (i == 0 ? false : false);
- lookAfterArr.push(obj)
- }
- if (item.lookAfter.includes("近亲属")) {
- lookAfterArr[1].checked = true;
- }
- if (item.lookAfter.includes("配偶")) {
- lookAfterArr[2].checked = true;
- }
- if (item.lookAfter.includes("邻里互助")) {
- lookAfterArr[3].checked = true;
- }
- if (item.lookAfter.includes("购买养老服务")) {
- lookAfterArr[4].checked = true;
- }
- if (item.lookAfter.includes("其他人员")) {
- lookAfterArr[5].checked = true;
- }
- }
- let oldTypeArr = [];
- for (let i = 0; i < 9; i++) {
- let obj = new Object();
- obj.name = (i == 0 ? "农村留守老年人" : i == 1 ? "分散供养特困老年人" : i == 2 ? "计划生育特殊家庭老人" : i == 3 ? "空巢老年人" : i == 4 ? "独居老年人" : i == 5 ? "重残老年人" : i == 6 ? "高龄老年人" : i == 7 ? "失能老人" : "居家老年人");
- obj.checked = (i == 0 ? false : false);
- obj.disable = (i == 0 ? false : false);
- oldTypeArr.push(obj)
- }
- if (item.oldType.includes("农村留守老年人")) {
- oldTypeArr[0].checked = true;
- oldTypeArr[1].disable = true;
- oldTypeArr[2].disable = true;
- oldTypeArr[3].checked = true;
- oldTypeArr[3].disable = true;
- }
- if (item.oldType.includes("分散供养特困老年人")) {
- oldTypeArr[1].checked = true;
- oldTypeArr[0].disable = true;
- oldTypeArr[2].disable = true;
- oldTypeArr[3].disable = true;
- }
- if (item.oldType.includes("计划生育特殊家庭老人")) {
- oldTypeArr[2].checked = true;
- oldTypeArr[0].disable = true;
- oldTypeArr[1].disable = true;
- oldTypeArr[3].disable = true;
- }
- if (item.oldType.includes("空巢老年人") && item.oldType.includes("农村留守老年人")) {
- oldTypeArr[3].checked = true;
- oldTypeArr[1].disable = true;
- oldTypeArr[2].disable = true;
- }
- if (item.oldType.includes("空巢老年人") && !item.oldType.includes("农村留守老年人")) {
- oldTypeArr[3].checked = true;
- oldTypeArr[1].disable = true;
- oldTypeArr[2].disable = true;
- oldTypeArr[0].disable = true;
- }
- if (item.oldType.includes("独居老年人")) {
- oldTypeArr[4].checked = true;
- }
- if (item.oldType.includes("重残老年人")) {
- oldTypeArr[5].checked = true;
- }
- if (item.oldType.includes("高龄老年人")) {
- oldTypeArr[6].checked = true;
- }
- if (item.oldType.includes("失能老人")) {
- oldTypeArr[7].checked = true;
- }
- if (item.oldType.includes("居家老年人")) {
- oldTypeArr[8].checked = true;
- }
- disabilityAyyss.forEach(itemss => {
- item.disabilityCategory.forEach(item => {
- if (itemss.name == item) {
- itemss.checked = true;
- }
- })
- })
- familyHelpArr.forEach(itemss => {
- item.rescueState.forEach(item => {
- if (itemss.name == item) {
- itemss.checked = true;
- }
- })
- })
- moneyFromAyy.forEach(itemss => {
- item.sourceOfIncome.forEach(item => {
- if (itemss.name == item) {
- itemss.checked = true;
- }
- })
- })
- if (item.majorDiseases) {
- sickType.forEach(items => {
- item.majorDiseases.forEach(itemss => {
- if (items.name == itemss) {
- items.checked = true;
- }
- })
- })
- }
- loveRequire.forEach(itemss => {
- item.demand.forEach(item => {
- if (itemss.name == item) {
- itemss.checked = true;
- }
- })
- })
- let chooseAdressArr = [];
- let chooseAdressArr1 = [];
- if (item.nativePlace) {
- let nativePlaces = item.nativePlace.split('/');
- chooseAdressArr = nativePlaces;
- if (item.isSameWithAddress == '是') {
- isSameWithAddresss.forEach(item => {
- item.checked = true;
- })
- chooseAdressArr1 = chooseAdressArr;
- } else {
- chooseAdressArr1 = [];
- }
- }
- let addressExts = '';
- if (item.addressExt) {
- addressExts = item.addressExt
- }
- let nativePlaceExts = '';
- if (item.nativePlaceExt) {
- nativePlaceExts = item.nativePlaceExt
- }
- if (item.address) {
- let address = item.address.split('/')
- chooseAdressArr1 = address;
- }
- let oldSexValue = '';
- if (item.sex) {
- oldSexValue = item.sex
- }
- return {
- ...item,
- sickType: sickType,
- oldSex: oldSex.map(items => {
- if (items.name == item.sex) {
- return {
- name: items.name,
- checked: true
- }
- }
- return {
- name: items.name,
- checked: false
- }
- }),
- oldMarryValue: item.partnerState,
- loneArrValue: item.isLoss,
- mainLookSexValue: item.mainLookSex,
- healthAyyValue: item.health,
- disabilityAyyValue: item.disabilityCategory,
- sickTypeValue: item.majorDiseases,
- oftenManValue: item.lookAfter,
- liveStatusValue: item.accompany,
- moneyFromAyyValue: item.sourceOfIncome,
- familyHelpArrValue: item.rescueState,
- loveRequireValue: item.demand,
- oldTypeValue: item.oldType,
- oldMarry: oldMarry.map(items => {
- if (items.name == item.partnerState) {
- return {
- name: items.name,
- checked: true
- }
- }
- return {
- name: items.name,
- checked: false
- }
- }),
- oldSexValue: oldSexValue,
- addressExt: addressExts,
- nativePlaceExt: nativePlaceExts,
- imgPath: imgPath,
- healthAyy: finalarr,
- disabilityAyy: disabilityAyyss,
- moneyFromAyy: moneyFromAyy,
- familyHelpArr: familyHelpArr,
- otherInfo: otherInfo, //赡养人存在么
- mainLookSex: mainLookSex.map(items => {
- if (items.name == item.mainLookSex) {
- return {
- name: items.name,
- checked: true
- }
- }
- return {
- name: items.name,
- checked: false
- }
- }),
- loneArr: loneArr.map(items => {
- if (items.name == item.isLoss) {
- return {
- name: items.name,
- checked: true
- }
- }
- return {
- name: items.name,
- checked: false
- }
- }),
- liveStatus: accompanyArr,
- oftenMan: lookAfterArr,
- loveRequire: loveRequire,
- oldType: oldTypeArr,
- chooseAdressArr: chooseAdressArr,
- isSameWithAddress: isSameWithAddresss,
- chooseAdressArr1: chooseAdressArr1,
- }
- })
- //赡养人信息
- let def = datass.map(item => {
- let sexs = [{
- name: '男',
- checked: false
- },
- {
- name: '女',
- checked: false
- }
- ]
- let otherInfo = '';
- let name = '';
- let phone = ''
- let relation = ''
- let relationExt = ''
- let outgoingCause = ''
- let isHasGoOut = ''
- let outgoingTime = ''
- let isHasPartner = ''
- let outgoingplace = ''
- let phone2 = ''
- let name2 = ''
- let sex = '';
- let visit = '';
- if (item.otherInfo) {
- let partol = this.removeExcess(item.otherInfo);
- otherInfo = '是'
- if (partol.name) {
- name = partol.name
- }
- if (partol.sex) {
- sexs.forEach(items => {
- if (items.name == partol.sex) {
- items.checked = true;
- sex = partol.sex;
- }
- })
- }
- if (partol.phone) {
- phone = partol.phone
- }
- if (partol.relation) {
- relation = partol.relation
- }
- if (partol.relationExt) {
- relationExt = partol.relationExt
- }
- if (partol.visit) {
- visit = partol.visit;
- }
- if (partol.isHasGoOut) {
- isHasGoOut = partol.isHasGoOut;
- }
- if (partol.outgoingCause) {
- outgoingCause = partol.outgoingCause;
- }
- if (partol.outgoingTime) {
- outgoingTime = partol.outgoingTime;
- }
- if (partol.isHasPartner) {
- isHasPartner = partol.isHasPartner;
- }
- if (partol.outgoingplace) {
- outgoingplace = partol.outgoingplace;
- }
- if (partol.name2) {
- name2 = partol.name2;
- }
- if (partol.phone2) {
- phone2 = partol.phone2;
- }
- } else if (item.otherInfo == '') {
- otherInfo = '否'
- } else {
- otherInfo = ''
- }
- return {
- ...item,
- isHasOther: otherInfo, //赡养人存在
- Info: {
- name: name,
- phone: phone,
- relation: relation,
- relationExt: relationExt,
- isHasGoOut: isHasGoOut,
- outgoingCause: outgoingCause,
- outgoingTime: outgoingTime,
- isHasPartner: isHasPartner,
- outgoingplace: outgoingplace,
- visit: visit,
- name2: name2,
- phone2: phone2,
- othersyrSexArr: sexs,
- sex: sex,
- }
- }
- })
- // 子女信息
- let ghi = datass.map(item => {
- let childrenNum = '';
- if (item.childrenNum) {
- if (item.childrenNum == '4') {
- childrenNum = '3个以上'
- } else {
- childrenNum = item.childrenNum + '个'
- }
- } else {
- childrenNum = ''
- }
- let Info = [];
- if (item.childInfo) {
- let partol = this.removeExcess(item.childInfo);
- Info = partol
- } else {
- if (parseInt(childrenNum) == 5) {
- for (let i = 0; i < parseInt(childrenNum) - 1; i++) {
- let chlidInfos = {
- name: '', // 姓名
- sex: '',
- phone: '', // 常用联系电话,
- isHasGoOut: '', // 子女是否外出
- outgoingplace: '', // 外出地点
- isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
- name2: '', // 子女配偶姓名
- phone2: '', // 子女配偶电话
- outgoingTime: '', // 最后一次离家时间
- outgoingCause: '', // 外出原因
- visit: '', // 平均一年探望次数
- }
- Info.push(chlidInfos)
- }
- } else {
- for (let i = 0; i < parseInt(childrenNum); i++) {
- let chlidInfos = {
- name: '', // 姓名
- sex: '',
- phone: '', // 常用联系电话,
- isHasGoOut: '', // 子女是否外出
- outgoingplace: '', // 外出地点
- isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
- name2: '', // 子女配偶姓名
- phone2: '', // 子女配偶电话
- outgoingTime: '', // 最后一次离家时间
- outgoingCause: '', // 外出原因
- visit: '', // 平均一年探望次数
- }
- Info.push(chlidInfos)
- }
- }
- }
- return {
- ...item,
- childrenNum: childrenNum,
- Info: Info
- }
- })
- // 寻访人信息为了显示
- let zzz = datass.map(item => {
- let visitModeExt = ''
- let visitCountExt = ''
- let visitMode = [{
- name: '电话问候',
- checked: false
- }, {
- name: '上门巡访',
- checked: false
- }, {
- name: '其它',
- checked: false
- }]
- let visitCounts = [{
- name: '每天',
- checked: false
- }, {
- name: '每周',
- checked: false
- }, {
- name: '每月',
- checked: false
- },
- {
- name: '每季',
- checked: false
- },
- {
- name: '其它',
- checked: false
- }
- ];
- if (item.regularsInfo) {
- let partol = this.removeExcess(item.regularsInfo);
- let partols = this.removeExcess(partol.visitMode);
- if (partol.visitMode) {
- visitMode.forEach(items => {
- partols.forEach(itemss => {
- if (items.name == itemss) {
- items.checked = true;
- }
- })
- })
- }
- if (partol.visitCount) {
- visitCounts.forEach(items => {
- if (items.name == partol.visitCount) {
- items.checked = true;
- }
- })
- }
- if (partol.visitCountExt) {
- visitCountExt = partol.visitCountExt;
- }
- if (partol.visitModeExt) {
- visitModeExt = partol.visitModeExt;
- }
- }
- return {
- ...item,
- visitCountExt: visitCountExt,
- visitModeExt: visitModeExt,
- visitMode: visitMode,
- visitCount: visitCounts,
- }
- })
- // 寻访人信息
- let mmm = datass.map(item => {
- if (item.regularsInfo) {
- let partol = this.removeExcess(item.regularsInfo);
- let partols = this.removeExcess(partol.visitMode);
- return {
- visitCount: partol.visitCount,
- visitCountExt: partol.visitCountExt,
- visitMode: partols,
- visitModeExt: partol.visitModeExt,
- }
- }
- })
- that.setData({
- oldInfo: abc,
- otherInfo: def,
- childInfo: ghi,
- regularsInfos: zzz,
- regularsInfo: mmm,
- })
- console.log(that.data.oldInfo, "老人的返现数组")
- console.log(that.data.otherInfo, "其他的返现数组")
- console.log(that.data.childInfo, "孩子的返现数组")
- console.log(that.data.regularsInfos, "q巡访的返现数组")
- console.log(that.data.regularsInfo, "巡访传值的返回")
- }
- })
- }
- },
- // 提交老人采集信息
- SubmitOldmanInfo(data) {
- console.log(data, ' 提交老人信息带过来的数据')
- wx.request({
- url: util.globalData.publicUrl + '/wxinfo/update',
- method: "post",
- header: {
- appletsId: wx.getStorageSync('openId')
- },
- data,
- success: (res) => {
- console.log(res)
- }
- })
- },
- onReady() {
- isTwoOnshow = false;
- isonShow = false;
- },
- onShow() {
- if (wx.getStorageSync('user') == '') {
- wx.redirectTo({
- url: '/pages/login/login',
- })
- } else {
- const app = getApp();
- if (isTwoOnshow) {
- isTwoOnshow = false;
- return;
- };
- if (isonShow) {
- isonShow = false;
- return;
- };
- this.setData({
- addOldname: '',
- currentIndex: 0
- })
- this.huixian(app.globalData.id, app.globalData.name);
- }
- },
- onHide() {
- const app = getApp()
- if (app.globalData.id != -1) {
- app.globalData.id = ''
- }
- app.globalData.name = ''
- this.setData({
- shiBaiShow: false,
- showAdressBox: false,
- showAdressBox1: false
- })
- },
- //获取位置
- getSelfLocation: function () {
- var qqmapsdk = new QQMapWX({
- key: 'B5DBZ-NGIHP-SQMD4-LHMG3-NJ72Z-7KFOV' //申请的开发者秘钥key
- });
- var that = this; //用户授权过可以直接获取位置
- wx.getLocation({
- //type: 'wgs84',
- type: 'gcj02',
- success: function (res) {
- console.log(res, "0000000");
- // 返回当前定位的经纬度
- var latitude = parseFloat(res.latitude).toFixed(5);
- var longitude = parseFloat(res.longitude).toFixed(5);
- qqmapsdk.reverseGeocoder({
- location: {
- latitude: res.latitude,
- longitude: res.longitude
- },
- success: function (res) {
- let photoAndLocation = 'oldInfo[' + that.data.activeIndex + '].photoAndLocation'
- let gps = longitude + '/' + latitude + '/' + res.result.address
- that.setData({
- [photoAndLocation]: gps
- })
- console.log(that.data.nameArr[that.data.activeIndex], "定位的问题");
- that.SubmitOldmanInfo({
- id: that.data.nameArr[that.data.activeIndex]._id,
- photoAndLocation: gps
- })
- },
- fail: function (res) {
- console.log('获取当前地址失败');
- }
- });
- },
- fail: function () {}
- });
- },
- onLoad() {
- console.log(wx.getStorageSync('user'), '000000')
- if (wx.getStorageSync('user') == '') {
- wx.redirectTo({
- url: '/pages/login/login',
- })
- }
- },
- // 表单校验老人身份证号
- formCheckCard() {
- this.setData({
- oldCardNull: false,
- oldCardWrong: false,
- oldCard60: false,
- })
- // 身份证号
- let idNumber = this.data.oldInfo[this.data.activeIndex].idNumber
- if (idNumber == null || idNumber == '') {
- this.setData({
- oldCardNull: true
- })
- } else {
- this.setData({
- oldCardNull: false
- })
- if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(idNumber)) && idNumber.length != 18) {
- this.setData({
- oldCardWrong: true
- })
- } else {
- this.setData({
- oldCardWrong: false
- })
- var myDate = new Date();
- var month = myDate.getMonth() + 1;
- var day = myDate.getDate();
- var age = myDate.getFullYear() - idNumber.substring(6, 10) - 1;
- if (idNumber.substring(10, 12) < month || idNumber.substring(10, 12) == month && idNumber.substring(12, 14) <= day) {
- age++;
- }
- console.log(age, '我是身份证的年龄')
- if (age < 60) {
- this.setData({
- oldCard60: true
- })
- } else {
- this.setData({
- oldCard60: false
- })
- }
- }
- }
- },
- // 表单校验老人联系电话
- formCheckPhone() {
- this.setData({
- oldPhoneNull: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].phone) {
- this.setData({
- oldPhoneNull: true
- })
- }
- },
- // 表单校验配偶姓名
- formCheckPartnerName() {
- this.setData({
- oldisMarryName: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].partnerName) {
- this.setData({
- oldisMarryName: true
- })
- }
- },
- //表单校验配偶身份证号
- formCheckPartnerId() {
- this.setData({
- oldisMarryPhone: false,
- oldisMarryPhoneGs: false
- })
- // 身份证号
- let idNumber = this.data.oldInfo[this.data.activeIndex].partnerIdNumber
- if (!idNumber) {
- this.setData({
- oldisMarryPhone: true
- })
- } else {
- if (!(/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(idNumber)) && idNumber.length != 18) {
- this.setData({
- oldisMarryPhoneGs: true
- })
- }
- }
- },
- // 表单校验健康状况
- formCheckHealthNull() {
- this.setData({
- oldHealth: false
- })
- let healthAyy = this.data.oldInfo[this.data.activeIndex].healthAyy
- if (!healthAyy[0].checked && !healthAyy[1].checked && !healthAyy[2].checked && !healthAyy[3].checked) {
- this.setData({
- oldHealth: true
- })
- }
- },
- // 表单校验残疾类别
- formCheckabilityNull() {
- this.setData({
- oldDisableType: false
- })
- if (this.data.oldInfo[this.data.activeIndex].disabilityAyyValue.length == 0) {
- this.setData({
- oldDisableType: true
- })
- }
- },
- //表单校验重特大疾病类别
- formChecksickTypeNull() {
- this.setData({
- issickTypeNull: false
- })
- if (this.data.oldInfo[this.data.activeIndex].sickTypeValue.length == 0) {
- this.setData({
- issickTypeNull: true
- })
- }
- },
- //收入来源为空校验
- formCheckmoneyNull() {
- this.setData({
- moneyFromOther: false
- })
- if (this.data.oldInfo[this.data.activeIndex].moneyFromAyyValue.length == 0) {
- this.setData({
- moneyFromOther: true
- })
- }
- },
- // 其他收入来源
- formCheckmoneyQtNull() {
- this.setData({
- moneyOtherQtnull: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].sourceOfIncomeExt) {
- this.setData({
- moneyOtherQtnull: true
- })
- }
- },
- //家庭救助帮扶情况
- formCheckhelpNull() {
- this.setData({
- familyHelp: false
- })
- if (this.data.oldInfo[this.data.activeIndex].familyHelpArrValue.length == 0) {
- this.setData({
- familyHelp: true
- })
- }
- },
- // 其他救助帮扶情况
- formCheckhelpQtNull() {
- this.setData({
- otherhelpQtnull: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].rescueStateExt) {
- this.setData({
- otherhelpQtnull: true
- })
- }
- },
- // 陪伴居住情况
- formCheckliveNull() {
- this.setData({
- isliveNull: false
- })
- if (this.data.oldInfo[this.data.activeIndex].liveStatusValue.length == 0) {
- this.setData({
- isliveNull: true
- })
- }
- },
- //其他陪伴居住情况
- formCheckliveqtNull() {
- this.setData({
- isliveQtNull: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].accompanyExt) {
- this.setData({
- isliveQtNull: true
- })
- }
- },
- // 日常生活照料人
- formCheckoftenNull() {
- this.setData({
- isoftenManNull: false
- })
- if (this.data.oldInfo[this.data.activeIndex].oftenManValue.length == 0) {
- this.setData({
- isoftenManNull: true
- })
- }
- },
- //其他日常生活照料人
- formCheckoftenQtNull() {
- this.setData({
- isoftenReaNull: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].lookAfterExt) {
- this.setData({
- isoftenReaNull: true
- })
- }
- },
- //日常生活照料人姓名
- formCheckoftenNameNull() {
- this.setData({
- lookAfterName: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].mainLookName) {
- this.setData({
- lookAfterName: true
- })
- }
- },
- //日常生活照料人电话
- formCheckoftenPhoneNull() {
- this.setData({
- islookPhoneNull: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].mainLookPhone) {
- this.setData({
- islookPhoneNull: true
- })
- }
- },
- // 关爱服务需求
- formCheckloveNull() {
- this.setData({
- isloveNull: false
- })
- if (this.data.oldInfo[this.data.activeIndex].loveRequireValue.length == 0) {
- this.setData({
- isloveNull: true
- })
- }
- },
- formCheckloveQtNull() {
- this.setData({
- isloveQtNull: false
- })
- if (!this.data.oldInfo[this.data.activeIndex].demandExt) {
- this.setData({
- isloveQtNull: true
- })
- }
- },
- // 老年人类别
- formCheckoldtypeNull() {
- this.setData({
- isoldtypeNull: false
- })
- if (this.data.oldInfo[this.data.activeIndex].oldTypeValue.length == 0) {
- this.setData({
- isoldtypeNull: true
- })
- }
- }
- })
|