collectInfo.js 146 KB

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