collectInfo.js 128 KB

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