collectInfo.js 131 KB

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