collectInfo.js 129 KB

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