collectInfo.js 111 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743
  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. console.log(id);
  2567. console.log(name);
  2568. if (id) {
  2569. this.setData({
  2570. showBj: false,
  2571. showBj1: false,
  2572. nameArr: [],
  2573. activeIndex: 0,
  2574. familyFid: id,
  2575. color: 'transparent',
  2576. })
  2577. var that = this;
  2578. wx.request({
  2579. url: util.globalData.publicUrl + '/wxinfo/listByFid',
  2580. method: "GET",
  2581. data: {
  2582. fid: id,
  2583. },
  2584. header: {
  2585. appletsId: wx.getStorageSync('openId')
  2586. },
  2587. success: (res) => {
  2588. console.log(res.data.data, "单查赋值锕")
  2589. that.setData({
  2590. oldInfo: res.data.data
  2591. })
  2592. let data = res.data.data;
  2593. let fristIndex = data.findIndex((item) => {
  2594. return name == item.name;
  2595. });
  2596. let fristArray = data.filter((item) => {
  2597. return name == item.name;
  2598. });
  2599. data.splice(fristIndex, 1);
  2600. data.unshift(fristArray[0]);
  2601. that.setData({
  2602. nameArr: data,
  2603. })
  2604. console.log(data, "dadadsadasdasdsadsadsadsa");
  2605. let oldSex = [{
  2606. name: '男',
  2607. checked: false
  2608. },
  2609. {
  2610. name: '女',
  2611. checked: false
  2612. }
  2613. ]
  2614. let oldMarry = [{
  2615. name: "未婚"
  2616. }, {
  2617. name: "已婚"
  2618. }, {
  2619. name: "离异"
  2620. }, {
  2621. name: "丧偶"
  2622. }];
  2623. let loneArr = [{
  2624. name: "是"
  2625. }, {
  2626. name: "否"
  2627. }];
  2628. let mainLookSex = [{
  2629. name: "男"
  2630. }, {
  2631. name: "女"
  2632. }];
  2633. let abc = data.map(item => {
  2634. let visitWays = [{
  2635. name: '电话问候'
  2636. }, {
  2637. name: '上门巡访'
  2638. }, {
  2639. name: '其它'
  2640. }];
  2641. let visitTimes = [{
  2642. name: '每天'
  2643. }, {
  2644. name: '每周'
  2645. }, {
  2646. name: '每月'
  2647. }, {
  2648. name: '每季'
  2649. }, {
  2650. name: '其它'
  2651. }];
  2652. let otherInfo = ''
  2653. let imgPath = ''
  2654. if (item.photo) {
  2655. imgPath = item.photo;
  2656. } else {
  2657. imgPath = ''
  2658. }
  2659. let disabilityAyyss = [{
  2660. name: "视力残疾"
  2661. }, {
  2662. name: "听力残疾"
  2663. }, {
  2664. name: "言语残疾"
  2665. }, {
  2666. name: "肢体残疾"
  2667. }, {
  2668. name: "智力残疾"
  2669. }, {
  2670. name: "精神残疾"
  2671. }, {
  2672. name: "多重残疾"
  2673. }];
  2674. let moneyFromAyy = [{
  2675. name: "家庭经营性收入"
  2676. }, {
  2677. name: "工资性收入"
  2678. }, {
  2679. name: "转移性收入"
  2680. }, {
  2681. name: "财产性收入"
  2682. }, {
  2683. name: "其它"
  2684. }];
  2685. let familyHelpArr = [{
  2686. name: "低保"
  2687. }, {
  2688. name: "建档立卡贫困户"
  2689. }, {
  2690. name: "医疗救助"
  2691. }, {
  2692. name: "临时救助"
  2693. }, {
  2694. name: "老年人福利津贴"
  2695. }, {
  2696. name: "残疾人两项补贴(或一项补贴)"
  2697. }, {
  2698. name: "其他救助"
  2699. }];
  2700. let loveRequire = [{
  2701. name: "生活照料"
  2702. },
  2703. {
  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. let finalarr = [];
  2729. if (item.health.includes("健康")) {
  2730. for (let i = 0; i < 4; i++) {
  2731. let obj = new Object();
  2732. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  2733. obj.checked = (i == 0 ? true : false);
  2734. obj.disabled = (i == 0 ? false : true);
  2735. finalarr.push(obj)
  2736. }
  2737. } else {
  2738. for (let i = 0; i < 4; i++) {
  2739. let obj = new Object();
  2740. obj.name = (i == 0 ? "健康" : i == 1 ? "残疾" : i == 2 ? "患重特大疾病" : i == 3 ? "老年人慢性病" : "");
  2741. obj.checked = (i == 0 ? false : false);
  2742. obj.disabled = (i == 0 ? false : false);
  2743. finalarr.push(obj)
  2744. }
  2745. if (item.health.includes("残疾")) {
  2746. finalarr[1].checked = true;
  2747. }
  2748. if (item.health.includes("患重特大疾病")) {
  2749. finalarr[2].checked = true;
  2750. }
  2751. if (item.health.includes("老年人慢性病")) {
  2752. finalarr[3].checked = true;
  2753. }
  2754. }
  2755. let accompanyArr = [];
  2756. if (item.accompany.includes("无人陪伴居住")) {
  2757. for (let i = 0; i < 5; i++) {
  2758. let obj = new Object();
  2759. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  2760. obj.checked = (i == 0 ? true : false);
  2761. obj.disabled = (i == 0 ? false : true);
  2762. accompanyArr.push(obj)
  2763. }
  2764. } else {
  2765. for (let i = 0; i < 5; i++) {
  2766. let obj = new Object();
  2767. obj.name = (i == 0 ? "无人陪伴居住" : i == 1 ? "配偶" : i == 2 ? "近亲属" : i == 3 ? "未成年孙子女" : "其他情形");
  2768. obj.checked = (i == 0 ? false : false);
  2769. obj.disabled = (i == 0 ? false : false);
  2770. accompanyArr.push(obj)
  2771. }
  2772. if (item.accompany.includes("配偶")) {
  2773. accompanyArr[1].checked = true;
  2774. }
  2775. if (item.accompany.includes("近亲属")) {
  2776. accompanyArr[2].checked = true;
  2777. }
  2778. if (item.accompany.includes("未成年孙子女")) {
  2779. accompanyArr[3].checked = true;
  2780. }
  2781. if (item.accompany.includes("其他情形")) {
  2782. accompanyArr[4].checked = true;
  2783. }
  2784. }
  2785. let lookAfterArr = [];
  2786. if (item.lookAfter.includes("无人照料")) {
  2787. for (let i = 0; i < 6; i++) {
  2788. let obj = new Object();
  2789. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  2790. obj.checked = (i == 0 ? true : false);
  2791. obj.disabled = (i == 0 ? false : true);
  2792. lookAfterArr.push(obj)
  2793. }
  2794. } else {
  2795. for (let i = 0; i < 6; i++) {
  2796. let obj = new Object();
  2797. obj.name = (i == 0 ? "无人照料" : i == 1 ? "近亲属" : i == 2 ? "配偶" : i == 3 ? "邻里互助" : i == 4 ? "购买养老服务" : '其他人员');
  2798. obj.checked = (i == 0 ? false : false);
  2799. obj.disabled = (i == 0 ? false : false);
  2800. lookAfterArr.push(obj)
  2801. }
  2802. if (item.lookAfter.includes("近亲属")) {
  2803. lookAfterArr[1].checked = true;
  2804. }
  2805. if (item.lookAfter.includes("配偶")) {
  2806. lookAfterArr[2].checked = true;
  2807. }
  2808. if (item.lookAfter.includes("邻里互助")) {
  2809. lookAfterArr[3].checked = true;
  2810. }
  2811. if (item.lookAfter.includes("购买养老服务")) {
  2812. lookAfterArr[4].checked = true;
  2813. }
  2814. if (item.lookAfter.includes("其他人员")) {
  2815. lookAfterArr[5].checked = true;
  2816. }
  2817. }
  2818. let oldTypeArr = [];
  2819. for (let i = 0; i < 8; i++) {
  2820. let obj = new Object();
  2821. obj.name = (i == 0 ? "农村留守老年人" : i == 1 ? "分散供养特困老年人" : i == 2 ? "计划生育特殊家庭老人" : i == 3 ? "空巢老年人" : i == 4 ? "独居老年人" : i == 5 ? "重残老人" : i == 6 ? "高龄老人" : "失能老人");
  2822. obj.checked = (i == 0 ? false : false);
  2823. obj.disable = (i == 0 ? false : false);
  2824. oldTypeArr.push(obj)
  2825. }
  2826. if (item.oldType.includes("农村留守老年人")) {
  2827. oldTypeArr[0].checked = true;
  2828. oldTypeArr[1].disable = true;
  2829. oldTypeArr[2].disable = true;
  2830. oldTypeArr[3].checked = true;
  2831. oldTypeArr[3].disable = true;
  2832. }
  2833. if (item.oldType.includes("分散供养特困老年人")) {
  2834. oldTypeArr[1].checked = true;
  2835. oldTypeArr[0].disable = true;
  2836. oldTypeArr[2].disable = true;
  2837. oldTypeArr[3].disable = true;
  2838. }
  2839. if (item.oldType.includes("计划生育特殊家庭老人")) {
  2840. oldTypeArr[2].checked = true;
  2841. oldTypeArr[0].disable = true;
  2842. oldTypeArr[1].disable = true;
  2843. oldTypeArr[3].disable = true;
  2844. }
  2845. if (item.oldType.includes("空巢老年人") && item.oldType.includes("农村留守老年人")) {
  2846. oldTypeArr[3].checked = true;
  2847. oldTypeArr[1].disable = true;
  2848. oldTypeArr[2].disable = true;
  2849. }
  2850. if (item.oldType.includes("空巢老年人") && !item.oldType.includes("农村留守老年人")) {
  2851. oldTypeArr[3].checked = true;
  2852. oldTypeArr[1].disable = true;
  2853. oldTypeArr[2].disable = true;
  2854. oldTypeArr[0].disable = true;
  2855. }
  2856. if (item.oldType.includes("独居老年人")) {
  2857. oldTypeArr[4].checked = true;
  2858. }
  2859. if (item.oldType.includes("重残老人")) {
  2860. oldTypeArr[5].checked = true;
  2861. }
  2862. if (item.oldType.includes("高龄老人")) {
  2863. oldTypeArr[6].checked = true;
  2864. }
  2865. if (item.oldType.includes("失能老人")) {
  2866. oldTypeArr[7].checked = true;
  2867. }
  2868. disabilityAyyss.forEach(itemss => {
  2869. item.disabilityCategory.forEach(item => {
  2870. if (itemss.name == item) {
  2871. itemss.checked = true;
  2872. }
  2873. })
  2874. })
  2875. familyHelpArr.forEach(itemss => {
  2876. item.rescueState.forEach(item => {
  2877. if (itemss.name == item) {
  2878. itemss.checked = true;
  2879. }
  2880. })
  2881. })
  2882. moneyFromAyy.forEach(itemss => {
  2883. item.sourceOfIncome.forEach(item => {
  2884. if (itemss.name == item) {
  2885. itemss.checked = true;
  2886. }
  2887. })
  2888. })
  2889. loveRequire.forEach(itemss => {
  2890. item.demand.forEach(item => {
  2891. if (itemss.name == item) {
  2892. itemss.checked = true;
  2893. }
  2894. })
  2895. })
  2896. return {
  2897. ...item,
  2898. oldSex: oldSex.map(items => {
  2899. if (items.name == item.sex) {
  2900. return {
  2901. name: items.name,
  2902. checked: true
  2903. }
  2904. }
  2905. return {
  2906. name: items.name,
  2907. checked: false
  2908. }
  2909. }),
  2910. oldMarry: oldMarry.map(items => {
  2911. if (items.name == item.partnerState) {
  2912. return {
  2913. name: items.name,
  2914. checked: true
  2915. }
  2916. }
  2917. return {
  2918. name: items.name,
  2919. checked: false
  2920. }
  2921. }),
  2922. imgPath: imgPath,
  2923. healthAyy: finalarr,
  2924. disabilityAyy: disabilityAyyss,
  2925. moneyFromAyy: moneyFromAyy,
  2926. familyHelpArr: familyHelpArr,
  2927. otherInfo: otherInfo, //赡养人存在么
  2928. mainLookSex: mainLookSex.map(items => {
  2929. if (items.name == item.mainLookSex) {
  2930. return {
  2931. name: items.name,
  2932. checked: true
  2933. }
  2934. }
  2935. return {
  2936. name: items.name,
  2937. checked: false
  2938. }
  2939. }),
  2940. loneArr: loneArr.map(items => {
  2941. if (items.name == item.isLoss) {
  2942. return {
  2943. name: items.name,
  2944. checked: true
  2945. }
  2946. }
  2947. return {
  2948. name: items.name,
  2949. checked: false
  2950. }
  2951. }),
  2952. liveStatus: accompanyArr,
  2953. oftenMan: lookAfterArr,
  2954. loveRequire: loveRequire,
  2955. oldType: oldTypeArr
  2956. }
  2957. })
  2958. let def = data.map(item => {
  2959. console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
  2960. let sex = [{
  2961. name: '男',
  2962. checked: false
  2963. },
  2964. {
  2965. name: '女',
  2966. checked: false
  2967. }
  2968. ]
  2969. let otherInfo = '';
  2970. let name = '';
  2971. let phone = ''
  2972. let relation = ''
  2973. let relationExt = ''
  2974. let outgoingCause = ''
  2975. let isHasGoOut = ''
  2976. let outgoingTime = ''
  2977. let isHasPartner = ''
  2978. let outgoingplace = ''
  2979. let phone2 = ''
  2980. let name2 = ''
  2981. let visit = '';
  2982. if (item.otherInfo) {
  2983. let partol = this.removeExcess(item.otherInfo);
  2984. otherInfo = '是'
  2985. if (partol.name) {
  2986. name = partol.name
  2987. }
  2988. if (partol.sex) {
  2989. sex.forEach(items => {
  2990. if (items.name == partol.sex) {
  2991. items.checked = true;
  2992. }
  2993. })
  2994. }
  2995. if (partol.phone) {
  2996. phone = partol.phone
  2997. }
  2998. if (partol.relation) {
  2999. relation = partol.relation
  3000. }
  3001. if (partol.relationExt) {
  3002. relationExt = partol.relationExt
  3003. }
  3004. if (partol.visit) {
  3005. visit = partol.visit;
  3006. }
  3007. if (partol.isHasGoOut) {
  3008. isHasGoOut = partol.isHasGoOut;
  3009. }
  3010. if (partol.outgoingCause) {
  3011. outgoingCause = partol.outgoingCause;
  3012. }
  3013. if (partol.outgoingTime) {
  3014. outgoingTime = partol.outgoingTime;
  3015. }
  3016. if (partol.isHasPartner) {
  3017. isHasPartner = partol.isHasPartner;
  3018. }
  3019. if (partol.outgoingplace) {
  3020. outgoingplace = partol.outgoingplace;
  3021. }
  3022. if (partol.name2) {
  3023. name2 = partol.name2;
  3024. }
  3025. if (partol.phone2) {
  3026. phone2 = partol.phone2;
  3027. }
  3028. } else if (item.otherInfo == '') {
  3029. otherInfo = '否'
  3030. } else {
  3031. otherInfo = ''
  3032. }
  3033. return {
  3034. ...item,
  3035. isHasOther: otherInfo, //赡养人存在
  3036. // name: name,
  3037. // othersyrSexArr: sex,
  3038. // phone: phone,
  3039. // othersyrRelationValue: othersyrRelationValue,
  3040. // relationExt: relationExt,
  3041. // visit: visit,
  3042. Info: {
  3043. name: name,
  3044. phone: phone,
  3045. relation: relation,
  3046. relationExt: relationExt,
  3047. isHasGoOut: isHasGoOut,
  3048. outgoingCause: outgoingCause,
  3049. outgoingTime: outgoingTime,
  3050. isHasPartner: isHasPartner,
  3051. outgoingplace: outgoingplace,
  3052. visit: visit,
  3053. name2: name2,
  3054. phone2: phone2,
  3055. othersyrSexArr: sex
  3056. }
  3057. }
  3058. })
  3059. let ghi = data.map(item => {
  3060. // console.log(item, "8888888888888888888888888888888888888888888888888888");
  3061. let childrenNum = '';
  3062. if (item.childrenNum) {
  3063. if (item.childrenNum == '4') {
  3064. childrenNum = '3个以上'
  3065. } else {
  3066. childrenNum = item.childrenNum + '个'
  3067. }
  3068. } else {
  3069. childrenNum = ''
  3070. }
  3071. let Info = [];
  3072. if (item.childInfo) {
  3073. let partol = this.removeExcess(item.childInfo);
  3074. Info = partol
  3075. } else {
  3076. if (parseInt(childrenNum) == 5) {
  3077. for (let i = 0; i < parseInt(childrenNum) - 1; i++) {
  3078. let chlidInfos = {
  3079. name: '', // 姓名
  3080. sex: '',
  3081. phone: '', // 常用联系电话,
  3082. isHasGoOut: '', // 子女是否外出
  3083. outgoingplace: '', // 外出地点
  3084. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  3085. name2: '', // 子女配偶姓名
  3086. phone2: '', // 子女配偶电话
  3087. outgoingTime: '', // 最后一次离家时间
  3088. outgoingCause: '', // 外出原因
  3089. visit: '', // 平均一年探望次数
  3090. }
  3091. Info.push(chlidInfos)
  3092. }
  3093. } else {
  3094. for (let i = 0; i < parseInt(childrenNum); i++) {
  3095. let chlidInfos = {
  3096. name: '', // 姓名
  3097. sex: '',
  3098. phone: '', // 常用联系电话,
  3099. isHasGoOut: '', // 子女是否外出
  3100. outgoingplace: '', // 外出地点
  3101. isHasPartner: '', // 是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0: 是 1: 否
  3102. name2: '', // 子女配偶姓名
  3103. phone2: '', // 子女配偶电话
  3104. outgoingTime: '', // 最后一次离家时间
  3105. outgoingCause: '', // 外出原因
  3106. visit: '', // 平均一年探望次数
  3107. }
  3108. Info.push(chlidInfos)
  3109. }
  3110. }
  3111. }
  3112. return {
  3113. ...item,
  3114. childrenNum: childrenNum,
  3115. Info: Info
  3116. }
  3117. })
  3118. let zzz = data.map(item => {
  3119. let visitModeExt = ''
  3120. let visitCountExt = ''
  3121. let visitMode = [{
  3122. name: '电话问候',
  3123. checked: false
  3124. }, {
  3125. name: '上门巡访',
  3126. checked: false
  3127. }, {
  3128. name: '其它',
  3129. checked: false
  3130. }]
  3131. let visitCounts = [{
  3132. name: '每天',
  3133. checked: false
  3134. }, {
  3135. name: '每周',
  3136. checked: false
  3137. }, {
  3138. name: '每月',
  3139. checked: false
  3140. },
  3141. {
  3142. name: '每季',
  3143. checked: false
  3144. },
  3145. {
  3146. name: '其它',
  3147. checked: false
  3148. }
  3149. ];
  3150. if (item.regularsInfo) {
  3151. let partol = this.removeExcess(item.regularsInfo);
  3152. console.log(partol, "777777777777777777777");
  3153. if (partol.visitMode) {
  3154. visitMode.forEach(items => {
  3155. partol.visitMode.forEach(itemss => {
  3156. if (items.name == itemss) {
  3157. items.checked = true;
  3158. }
  3159. })
  3160. })
  3161. }
  3162. if (partol.visitCount) {
  3163. visitCounts.forEach(items => {
  3164. if (items.name == partol.visitCount) {
  3165. items.checked = true;
  3166. }
  3167. })
  3168. }
  3169. if (partol.visitCountExt) {
  3170. visitCountExt = partol.visitCountExt;
  3171. }
  3172. if (partol.visitModeExt) {
  3173. visitModeExt = partol.visitModeExt;
  3174. }
  3175. }
  3176. return {
  3177. ...item,
  3178. visitCountExt: visitCountExt,
  3179. visitModeExt: visitModeExt,
  3180. visitMode: visitMode,
  3181. visitCount: visitCounts,
  3182. }
  3183. })
  3184. that.setData({
  3185. oldInfo: abc,
  3186. otherInfo: def,
  3187. childInfo: ghi,
  3188. regularsInfos: zzz,
  3189. })
  3190. console.log(that.data.oldInfo, "老人的返现数组")
  3191. console.log(that.data.otherInfo, "其他的返现数组")
  3192. console.log(that.data.childInfo, "孩子的返现数组")
  3193. console.log(that.data.regularsInfos, "q巡访的返现数组")
  3194. // let ghi = res.data.data.map(item => {
  3195. // console.log(item.otherInfo, ";;;;;;;;;;;;;;;;;;;;;;;;;;");
  3196. // let sex = [{
  3197. // name: '男',
  3198. // checked: false
  3199. // },
  3200. // {
  3201. // name: '女',
  3202. // checked: false
  3203. // }
  3204. // ]
  3205. // let otherInfo = '';
  3206. // let name = '';
  3207. // let phone = ''
  3208. // let othersyrRelationValue = ''
  3209. // let relationExt = ''
  3210. // let visit = ''
  3211. // if (item.otherInfo) {
  3212. // let partol = this.removeExcess(item.otherInfo);
  3213. // otherInfo = '是'
  3214. // if (partol.name) {
  3215. // name = partol.name
  3216. // }
  3217. // if (partol.sex) {
  3218. // sex.forEach(items => {
  3219. // if (items.name == partol.sex) {
  3220. // items.checked = true;
  3221. // }
  3222. // })
  3223. // }
  3224. // if (partol.phone) {
  3225. // phone = partol.phone
  3226. // }
  3227. // if (partol.relation) {
  3228. // othersyrRelationValue = partol.relation
  3229. // }
  3230. // if (partol.relationExt) {
  3231. // relationExt = partol.relationExt
  3232. // }
  3233. // if (partol.visit) {
  3234. // visit = partol.visit;
  3235. // }
  3236. // } else {
  3237. // otherInfo = ''
  3238. // }
  3239. // return {
  3240. // ...item,
  3241. // otherInfo: otherInfo, //赡养人存在
  3242. // name: name,
  3243. // othersyrSexArr: sex,
  3244. // phone: phone,
  3245. // othersyrRelationValue: othersyrRelationValue,
  3246. // relationExt: relationExt,
  3247. // visit: visit,
  3248. // }
  3249. // })
  3250. // that.setData({
  3251. // oldInfo: abc,
  3252. // otherInfo: def,
  3253. // childInfo: ghi
  3254. // })
  3255. }
  3256. })
  3257. } else {
  3258. let oldInfo = [{
  3259. name: '',
  3260. oldSex: [{
  3261. name: '男'
  3262. }, {
  3263. name: '女'
  3264. }],
  3265. nation: '', //民族
  3266. idNumber: '', //身份证号
  3267. phone: '',
  3268. oldMarry: [{
  3269. name: "未婚"
  3270. }, {
  3271. name: "已婚"
  3272. }, {
  3273. name: "离异"
  3274. }, {
  3275. name: "丧偶"
  3276. }],
  3277. partnerName: '',
  3278. partnerIdNumber: '',
  3279. healthAyy: [{
  3280. name: "健康",
  3281. disabled: false
  3282. }, {
  3283. name: "残疾",
  3284. disabled: false
  3285. }, {
  3286. name: "患重特大疾病",
  3287. disabled: false
  3288. }, {
  3289. name: "老年人慢性病",
  3290. disabled: false
  3291. }],
  3292. disabilityAyy: [{
  3293. name: "视力残疾"
  3294. }, {
  3295. name: "听力残疾"
  3296. }, {
  3297. name: "言语残疾"
  3298. }, {
  3299. name: "肢体残疾"
  3300. }, {
  3301. name: "智力残疾"
  3302. }, {
  3303. name: "精神残疾"
  3304. }, {
  3305. name: "多重残疾"
  3306. }],
  3307. disabilityLevel: '', //残疾人类别
  3308. sickType: [{
  3309. name: "重大器官类疾病"
  3310. }, {
  3311. name: "心脑血管类疾病"
  3312. }, {
  3313. name: "神经与代谢类疾病"
  3314. }, {
  3315. name: "肢体与病毒类疾病"
  3316. }, {
  3317. name: "恶性肿瘤"
  3318. }],
  3319. ability: '', //老年人能力情况
  3320. livingCondition: '', //生活经济情况
  3321. moneyFromAyy: [{
  3322. name: "家庭经营性收入"
  3323. }, {
  3324. name: "工资性收入"
  3325. }, {
  3326. name: "转移性收入"
  3327. }, {
  3328. name: "财产性收入"
  3329. }, {
  3330. name: "其它"
  3331. }],
  3332. income: '',
  3333. sourceOfIncomeExt: '', //其他收入情况
  3334. familyHelpArr: [{
  3335. name: "低保"
  3336. }, {
  3337. name: "建档立卡贫困户"
  3338. }, {
  3339. name: "医疗救助"
  3340. }, {
  3341. name: "临时救助"
  3342. }, {
  3343. name: "老年人福利津贴"
  3344. }, {
  3345. name: "残疾人两项补贴(或一项补贴)"
  3346. }, {
  3347. name: "其他救助"
  3348. }],
  3349. rescueStateExt: '', //其他救助
  3350. loneArr: [{
  3351. name: "是"
  3352. }, {
  3353. name: "否"
  3354. }],
  3355. liveStatus: [{
  3356. name: "无人陪伴居住",
  3357. disabled: false
  3358. }, {
  3359. name: "配偶",
  3360. disabled: false
  3361. }, {
  3362. name: "近亲属",
  3363. disabled: false
  3364. }, {
  3365. name: "未成年孙子女",
  3366. disabled: false
  3367. }, {
  3368. name: "其他情形",
  3369. disabled: false
  3370. }],
  3371. accompanyExt: '', //陪伴居住其他
  3372. oftenMan: [{
  3373. name: "无人照料",
  3374. disabled: false
  3375. }, {
  3376. name: "近亲属",
  3377. disabled: false
  3378. }, {
  3379. name: "配偶",
  3380. disabled: false
  3381. }, {
  3382. name: "邻里互助",
  3383. disabled: false
  3384. }, {
  3385. name: "购买养老服务",
  3386. disabled: false
  3387. }, {
  3388. name: "其他人员",
  3389. disabled: false
  3390. }],
  3391. lookAfterExt: '', //其他日常生活照料人关系
  3392. mainLookName: '', //日常生活照料人姓名
  3393. mainLookSex: [{
  3394. name: "男"
  3395. }, {
  3396. name: "女"
  3397. }],
  3398. mainLookPhone: '', //
  3399. loveRequire: [{
  3400. name: "生活照料"
  3401. },
  3402. {
  3403. name: "生产帮助"
  3404. },
  3405. {
  3406. name: "精神慰藉"
  3407. },
  3408. {
  3409. name: "医疗保健"
  3410. },
  3411. {
  3412. name: "权益维护"
  3413. },
  3414. {
  3415. name: "安全监护"
  3416. },
  3417. {
  3418. name: "文化娱乐"
  3419. },
  3420. {
  3421. name: "紧急救助"
  3422. },
  3423. {
  3424. name: "其它"
  3425. },
  3426. ],
  3427. oldType: [{
  3428. name: "农村留守老年人",
  3429. disable: false,
  3430. checked: false
  3431. }, {
  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. isHavePhoto: false,
  3457. imgPath: '',
  3458. photoAndLocation: '',
  3459. }];
  3460. let regularsInfos = [{
  3461. visitMode: [{
  3462. name: '电话问候',
  3463. checked: false
  3464. }, {
  3465. name: '上门巡访',
  3466. checked: false
  3467. }, {
  3468. name: '其它',
  3469. checked: false
  3470. }],
  3471. visitModeExt: '', //巡访其他
  3472. visitCount: [{
  3473. name: '每天',
  3474. checked: false
  3475. }, {
  3476. name: '每周',
  3477. checked: false
  3478. }, {
  3479. name: '每月',
  3480. checked: false
  3481. }, {
  3482. name: '每季',
  3483. checked: false
  3484. }, {
  3485. name: '其它',
  3486. checked: false
  3487. }],
  3488. visitCountExt: '', // 频次的其他
  3489. }];
  3490. let otherInfo = [{
  3491. isHasOther: '',
  3492. Info: {
  3493. name: '', // 其他赡养人姓名,
  3494. sex: '', //其他赡养人性别
  3495. phone: '', //其他赡养人电话,
  3496. relation: '', //与被赡养人关系 如果选了其他也是必填 单选
  3497. relationExt: '', //与被赡养人关系--其他
  3498. isHasGoOut: '', //是否外出
  3499. outgoingCause: '', //外出原因
  3500. outgoingplace: '', // 外出地点
  3501. outgoingTime: '', // 最后一次离家时间
  3502. isHasPartner: '', //是否有配偶 当是的时候 子女配偶姓名 子女配偶电话 必填 0:是 1:否
  3503. name2: '',
  3504. phone2: '',
  3505. visit: '', //平均一年探望次数
  3506. othersyrSexArr: [{
  3507. name: '男',
  3508. checked: false
  3509. },
  3510. {
  3511. name: '女',
  3512. checked: false
  3513. },
  3514. ]
  3515. }
  3516. }];
  3517. let childInfo = [{
  3518. childrenNum: ''
  3519. }]
  3520. this.setData({
  3521. showBj: true,
  3522. nameArr: [],
  3523. oldInfo: oldInfo,
  3524. childInfo: childInfo,
  3525. otherInfo: otherInfo,
  3526. regularsInfos: regularsInfos,
  3527. })
  3528. console.log(this.data.regularsInfos);
  3529. }
  3530. },
  3531. chooseAdress() {
  3532. wx.request({
  3533. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3534. method: "get",
  3535. header: {
  3536. appletsId: wx.getStorageSync('openId')
  3537. },
  3538. success: (res) => {
  3539. console.log(res.data.data)
  3540. this.setData({
  3541. showAdress: true,
  3542. provinceArr: res.data.data
  3543. })
  3544. }
  3545. })
  3546. },
  3547. provinceClick(e) {
  3548. console.log(e.currentTarget.dataset.item)
  3549. this.data.chooseAdressArr.push(e.currentTarget.dataset.item)
  3550. console.log(this.data.chooseAdressArr)
  3551. wx.request({
  3552. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3553. method: "get",
  3554. header: {
  3555. appletsId: wx.getStorageSync('openId')
  3556. },
  3557. data: {
  3558. fid: e.currentTarget.dataset.item.CIVILREGIONALISMID
  3559. },
  3560. success: (res) => {
  3561. this.setData({
  3562. provinceArr: res.data.data,
  3563. isAdress: true,
  3564. chooseAdressArr: this.data.chooseAdressArr
  3565. })
  3566. if (res.data.data.length == 0) {
  3567. this.setData({
  3568. pleaseChoose: false
  3569. })
  3570. }
  3571. }
  3572. })
  3573. },
  3574. closeAdress() {
  3575. this.setData({
  3576. showAdress: false
  3577. })
  3578. },
  3579. reSelect(e) {
  3580. this.setData({
  3581. chooseAdressArr: this.data.chooseAdressArr.slice(0, e.currentTarget.dataset.index)
  3582. })
  3583. let fid;
  3584. if (this.data.chooseAdressArr.length != 0) {
  3585. fid = this.data.chooseAdressArr[this.data.chooseAdressArr.length - 1].CIVILREGIONALISMID;
  3586. } else {
  3587. fid = ''
  3588. }
  3589. wx.request({
  3590. url: util.globalData.publicUrl + '/civilregionalism/deptList',
  3591. method: "get",
  3592. header: {
  3593. appletsId: wx.getStorageSync('openId')
  3594. },
  3595. data: {
  3596. fid
  3597. },
  3598. success: (res) => {
  3599. this.setData({
  3600. provinceArr: res.data.data,
  3601. isAdress: true,
  3602. chooseAdressArr: this.data.chooseAdressArr
  3603. })
  3604. if (res.data.data.length == 0) {
  3605. this.setData({
  3606. pleaseChoose: false
  3607. })
  3608. }
  3609. }
  3610. })
  3611. },
  3612. // 提交老人采集信息
  3613. SubmitOldmanInfo(data) {
  3614. console.log(data, ' 提交老人信息带过来的数据')
  3615. console.log(this.data.nameArr[this.data.activeIndex])
  3616. wx.request({
  3617. url: util.globalData.publicUrl + '/wxinfo/update',
  3618. method: "post",
  3619. header: {
  3620. appletsId: wx.getStorageSync('openId')
  3621. },
  3622. data,
  3623. success: (res) => {
  3624. console.log(res)
  3625. }
  3626. })
  3627. },
  3628. onShow() {
  3629. console.log("11111111111111111111111111111111111");
  3630. if (isTwoOnshow) {
  3631. isTwoOnshow = false;
  3632. return;
  3633. };
  3634. if (isonShow) {
  3635. isonShow = false;
  3636. return;
  3637. };
  3638. this.setData({
  3639. showBj: true,
  3640. addOldname: '',
  3641. currentIndex: 0
  3642. })
  3643. const app = getApp()
  3644. console.log(app.globalData.id, "传参的一户的值");
  3645. this.huixian(app.globalData.id, app.globalData.name);
  3646. },
  3647. onHide() {
  3648. const app = getApp()
  3649. app.globalData.id = ''
  3650. app.globalData.name = ''
  3651. },
  3652. //获取位置
  3653. getSelfLocation: function (varSendOrgId) {
  3654. // 实例化API核心类
  3655. var qqmapsdk = new QQMapWX({
  3656. key: 'B5DBZ-NGIHP-SQMD4-LHMG3-NJ72Z-7KFOV' //申请的开发者秘钥key
  3657. });
  3658. var that = this; //用户授权过可以直接获取位置
  3659. wx.getLocation({
  3660. //type: 'wgs84',
  3661. type: 'gcj02',
  3662. success: function (res) {
  3663. console.log(res, "0000000");
  3664. // 返回当前定位的经纬度
  3665. var latitude = parseFloat(res.latitude).toFixed(5);
  3666. var longitude = parseFloat(res.longitude).toFixed(5);
  3667. qqmapsdk.reverseGeocoder({
  3668. location: {
  3669. latitude: res.latitude,
  3670. longitude: res.longitude
  3671. },
  3672. success: function (res) {
  3673. //获取当前地址成功
  3674. // that.setData({
  3675. // visitLocation: res.result.address
  3676. // })
  3677. let photoAndLocation = 'oldInfo[' + that.data.activeIndex + '].photoAndLocation'
  3678. let gps = longitude + '/' + latitude + '/' + res.result.address
  3679. that.setData({
  3680. [photoAndLocation]: gps
  3681. })
  3682. console.log(that.data.nameArr[that.data.activeIndex], "定位的问题");
  3683. that.SubmitOldmanInfo({
  3684. id: that.data.nameArr[that.data.activeIndex]._id,
  3685. photoAndLocation: gps
  3686. })
  3687. },
  3688. fail: function (res) {
  3689. console.log('获取当前地址失败');
  3690. }
  3691. });
  3692. },
  3693. fail: function (res) {}
  3694. });
  3695. },
  3696. onLoad() {
  3697. // this.getSelfLocation();
  3698. },
  3699. })