collectInfo.js 129 KB

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