collectInfo.js 127 KB

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