collectInfo.js 128 KB

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