collectInfo.js 129 KB

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