collectInfo.js 130 KB

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