collectInfo.js 151 KB

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