collectInfo.js 111 KB

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