collectInfo.js 138 KB

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