collectInfo.js 119 KB

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