collectInfo.js 125 KB

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