diff --git a/subpages/addResi/pages/addResi/addResi.js b/subpages/addResi/pages/addResi/addResi.js index bb39a5c..35f3b9d 100644 --- a/subpages/addResi/pages/addResi/addResi.js +++ b/subpages/addResi/pages/addResi/addResi.js @@ -697,6 +697,12 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: async function (options) { + if(options.type === 'edit'){ + this.setData({ + resiId:options.resiId + }) + this.userXiangQ(options) + } this.setData({ agencyId: app.globalData.user.agencyId, 'form.resideInfoDtos[0].agencyId': app.globalData.user.agencyId, @@ -1165,7 +1171,7 @@ Page({ const selectedIndex = e.detail.value; const selectedVillage = this.data.dicts.nationalityList[selectedIndex] this.setData({ - nationalityName: selectedVillage.label, + 'form.baseInfoDto.nationalityName': selectedVillage.label, 'form.baseInfoDto.nationality': selectedVillage.value }) }, @@ -1176,7 +1182,7 @@ Page({ }, bindPickerChangeGender(e) { this.setData({ - genderName: this.data.dicts.genderList[e.detail.value].label, + 'form.baseInfoDto.genderName': this.data.dicts.genderList[e.detail.value].label, "form.baseInfoDto.gender": this.data.dicts.genderList[e.detail.value].value }) }, @@ -1449,5 +1455,18 @@ Page({ } }) console.log(this.data.form); + }, + //**编辑回填逻辑 start*/ + userXiangQ(option){ + api.userXiangQ(this.data.resiId).then(res=>{ + this.setData({ + form:res.data, + "form.baseInfoDto.name":option.name, + "form.baseInfoDto.idNum":option.idNum, + "form.baseInfoDto.mobile":option.mobile, + }) + }).catch(err=>{ + console.log(err); + }) } }) \ No newline at end of file diff --git a/subpages/addResi/pages/addResi/addResi.wxml b/subpages/addResi/pages/addResi/addResi.wxml index b968280..e1f5340 100644 --- a/subpages/addResi/pages/addResi/addResi.wxml +++ b/subpages/addResi/pages/addResi/addResi.wxml @@ -208,8 +208,8 @@ - - {{nationalityName ? nationalityName : '请选择'}} + + {{form.baseInfoDto.nationalityName ? form.baseInfoDto.nationalityName : '请选择'}} @@ -223,7 +223,7 @@ 联系电话 - + @@ -235,8 +235,8 @@ - - {{genderName ? genderName : '请选择'}} + + {{form.baseInfoDto.genderName ? form.baseInfoDto.genderName : '请选择'}} diff --git a/subpages/searchResult/pages/punchCard/punchCard.js b/subpages/searchResult/pages/punchCard/punchCard.js index f892dab..63c7537 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.js +++ b/subpages/searchResult/pages/punchCard/punchCard.js @@ -2,6 +2,7 @@ import api from "../../../../utils/api" var http = require('../../../../utils/request.js') const QQMapWX = require('../../../../utils/qqmap-wx-jssdk') +import { $wuxDialog } from '../../../../components/dist/index' const app = getApp() var timerId = null; Page({ @@ -10,6 +11,7 @@ Page({ * 页面的初始数据 */ data: { + checkPassword:true, form: {}, resiId: "", punchFlag: null, @@ -555,20 +557,23 @@ Page({ label:"复婚", value:'fuhun' } - ] + ], + password:'Makui240345' }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { - console.log(options); this.updateTime(); timerId = setInterval(this.updateTime, 1000); - console.log(timerId); if (options.resiId) { this.setData({ - resiId: options.resiId + resiId: options.resiId, + 'form.baseInfoDto.name':options.name, + 'form.baseInfoDto.idNum':options.idNum, + 'form.baseInfoDto.mobile':options.mobile, + }) this.getResiInfo() } @@ -753,8 +758,40 @@ Page({ }) }, toAddResi() { - wx.navigateTo({ - url: `/subpages/addResi/pages/editResi/editResi?type=edit&resiId=${this.data.resiId}`, + this.setData({ + checkPassword:true + }) + }, + bindPassword(e){ + this.setData({ + password:e.detail.value + }) + }, + onClosePassword(){ + this.setData({ + checkPassword:false + }) + }, + onConfirmassword(){ + let parm = { + password:this.data.password + } + api.getResiUserInfo(this.data.resiId,parm).then(res=>{ + if(res.code === 0){ + wx.navigateTo({ + url: `/subpages/addResi/pages/addResi/addResi?type=edit&resiId=${this.data.resiId}&name=${res.data.name}&mobile=${res.data.mobile}&idNum=${res.data.idNum}`, + }) + this.setData({ + password:null + }) + }else{ + this.setData({ + password:null + }) + this.showToast(res.msg) + } + }).catch(err=>{ + console.log(err); }) }, toWebView() { diff --git a/subpages/searchResult/pages/punchCard/punchCard.json b/subpages/searchResult/pages/punchCard/punchCard.json index aa6e978..6a8c2bf 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.json +++ b/subpages/searchResult/pages/punchCard/punchCard.json @@ -1,4 +1,6 @@ { - "usingComponents": {}, + "usingComponents": { + "van-dialog": "@vant/weapp/dialog/index" + }, "navigationBarTitleText": "详情" } \ No newline at end of file diff --git a/subpages/searchResult/pages/punchCard/punchCard.wxml b/subpages/searchResult/pages/punchCard/punchCard.wxml index 8ed2b59..e956373 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.wxml +++ b/subpages/searchResult/pages/punchCard/punchCard.wxml @@ -1,6 +1,6 @@ - + @@ -31,7 +31,7 @@ - {{item.name}} ({{ item.filledQty }}/{{ item.totalQty }}) + {{item.name}} ({{ item.filledQty }}/{{ item.totalQty }}) @@ -59,7 +59,7 @@ 文化程度: {{form.eduInfoDto.cultureLevelName}} - + 性别: {{form.baseInfoDto.genderName}} @@ -75,7 +75,7 @@ 婚姻状况: {{marriageName}} - + 籍贯: @@ -110,7 +110,12 @@ + 满意度调查 - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/subpages/searchResult/pages/punchCard/punchCard.wxss b/subpages/searchResult/pages/punchCard/punchCard.wxss index b266378..efafa91 100644 --- a/subpages/searchResult/pages/punchCard/punchCard.wxss +++ b/subpages/searchResult/pages/punchCard/punchCard.wxss @@ -232,4 +232,8 @@ page { background: #fff; padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom); +} +.dialog{ + padding: 0 20rpx; + box-sizing: border-box; } \ No newline at end of file diff --git a/utils/api.js b/utils/api.js index ef80634..de42fe3 100644 --- a/utils/api.js +++ b/utils/api.js @@ -64,7 +64,8 @@ module.exports = { updateEvent, submitResi, getAllOrgCategoryCount, - getResiInfo + getResiInfo, + userXiangQ } // 获取公钥 @@ -266,12 +267,11 @@ function getCheckLogList(parm) { function getLastLog(parm) { return fly.get(`actual/base/clockRecords/lastLog`, parm) } -// 获取居民敏感信息 -function getResiUserInfo(id) { - return fly.post(`actual/base/residentBaseInfo/getResiUserInfo/${id}`) +// 获取居民脱敏信息 +function getResiUserInfo(id,parm) { + return fly.post(`actual/base/residentBaseInfo/getResiUserInfo/${id}`,parm) } - /// 获取居民档案 function getPersonalFile(parm) { return fly.post(`actual/base/peopleRoomOverview/getPersonalFile?resid=` + parm.resid) @@ -343,3 +343,4 @@ function getAllOrgCategoryCount(parm) { return fly.get(`actual/base/streetOverview/allOrgCategoryCount`,parm) } +