collectInfo.js 153 KB

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