collectInfo.js 152 KB

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