collectInfo.js 149 KB

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