collectInfo.js 128 KB

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