diff --git a/src/views/components/resiForm.vue b/src/views/components/resiForm.vue index 883faf13d..fe1922738 100644 --- a/src/views/components/resiForm.vue +++ b/src/views/components/resiForm.vue @@ -966,6 +966,9 @@ export default { form:{ agencyName:this.$store.state.user.agencyName, agencyId:this.$store.state.user.agencyId, + resiId: '', // 详情拿到 + houseMergeId: '', // 详情拿到 + categoryId: '', // 详情拿到 gridName:'', gridId:'', //所属网格id villageId: '', //小区id @@ -1164,7 +1167,14 @@ export default { console.log(this.form); return this.form }, - + async old_from(data) { + this.getFormData(data) + await this.getValiheList() + await this.getBuildList() + await this.getUniList() + await this.getHouseList() + await this.getClassInfo() + }, getAllNation(){ // 民族字典 this.getDictList() @@ -1538,6 +1548,42 @@ export default { this.getHouseList() }, handleClick (tab, event) { + // if (!this.form.resiId) { + // return false + // } + // if (event.toElement.innerText == '教育') { + // await this.residentEduInfo(this.form.resiId) + // } else if (event.toElement.innerText == '兴趣爱好') { + // await this.residentHobbyInfo(this.form.resiId) + // } else if (event.toElement.innerText == '宗教信仰') { + // await this.residentReligion(this.form.resiId) + // } else if (event.toElement.innerText == '健康') { + // await this.getHealthInfoDetailById(this.form.resiId) + // } else if (event.toElement.innerText == '工作') { + // await this.residentWorkInfo(this.form.resiId) + // } else if (event.toElement.innerText == '经济情况') { + // await this.getEconomyDetailById(this.form.resiId) + // } else if (event.toElement.innerText == '居住') { + // await this.getResideInfoDetailById(this.form.resiId) + // } else if (event.toElement.innerText == '家庭') { + // await this.getFamilyInfoDetailById(this.form.resiId) + // } else if (event.toElement.innerText == '党员信息') { + // await this.residentPartyMemberInfo(this.form.resiId) + // } else if (event.toElement.innerText == '保障房信息') { + // await this.residentEnsureHouse(this.form.resiId) + // } else if (event.toElement.innerText == '失业') { + // await this.residentUnemployed(this.form.resiId) + // } else if (event.toElement.innerText == '退役军人') { + // await this.getVeteranDetailById(this.form.resiId) + // } else if (event.toElement.innerText == '统战') { + // await this.residentUnitedFront(this.form.resiId) + // } else if (event.toElement.innerText == '志愿者信息') { + // await this.getVolunteerDetailById(this.form.resiId) + // } else if (event.toElement.innerText == '特殊人群') { + // await this.residentSpecial(this.form.resiId) + // } else if (event.toElement.innerText == '老年人') { + // await this.getOldPeopleDetailById(this.form.resiId) + // } }, handleForm () { let newForm = [] @@ -1688,6 +1734,327 @@ export default { } }, + getFormData(data) { + this.form.categoryId = '111222333',// 临时写死 + this.form.resiId = data.resiId + this.form.buildId = data.houseInfo.buildId + this.form.gridId = data.houseInfo.gridId + this.form.gridName = data.houseInfo.gridName + this.form.homeId = data.houseInfo.homeId + this.form.homeName = data.houseInfo.homeName + this.form.houseMergeId = data.houseInfo.mergeId + this.form.unitId = data.houseInfo.unitId + this.form.villageId = data.houseInfo.villageId + this.form.birthday = data.birthday + this.form.gender = data.gender + this.form.idNum = data.idNum + this.form.localResidenceFlag = data.localResidenceFlag.toString() + this.form.mobile = data.mobile + this.form.name = data.name + this.form.nation = data.nation ? data.nation : '' + this.form.remark = data.remark ? data.remark : '' + if (data.categoryInfo) { + this.form.partyFlag = data.categoryInfo.partyFlag.toString() + this.form.subsistenceAllowanceFlag = data.categoryInfo.subsistenceAllowanceFlag.toString() + this.form.ensureHouseFlag = data.categoryInfo.ensureHouseFlag.toString() + this.form.unemployedFlag = data.categoryInfo.unemployedFlag.toString() + this.form.fertileWomanFlag = data.categoryInfo.fertileWomanFlag.toString() + this.form.veteranFlag = data.categoryInfo.veteranFlag.toString() + this.form.unitedFrontFlag = data.categoryInfo.unitedFrontFlag.toString() + this.form.petitionOfficerFlag = data.categoryInfo.petitionOfficerFlag.toString() + this.form.volunteerFlag = data.categoryInfo.volunteerFlag.toString() + this.form.oldPeopleFlag = data.categoryInfo.oldPeopleFlag.toString() + this.form.emptyNesterFlag = data.categoryInfo.emptyNesterFlag.toString() + this.form.bereavedPersonFlag = data.categoryInfo.bereavedPersonFlag.toString() + this.form.disabledFlag = data.categoryInfo.disabledFlag.toString() + this.form.dementedFlag = data.categoryInfo.dementedFlag.toString() + this.form.disabilityFlag = data.categoryInfo.disabilityFlag.toString() + this.form.seriousIllnessFlag = data.categoryInfo.seriousIllnessFlag.toString() + this.form.chronicDiseaseFlag = data.categoryInfo.chronicDiseaseFlag.toString() + this.form.specialCrowdFlag = data.categoryInfo.specialCrowdFlag.toString() + this.form.tenantFlag = data.categoryInfo.tenantFlag.toString() + this.form.floatingFlag = data.categoryInfo.floatingFlag.toString() + this.form.liveAloneFlag = data.categoryInfo.liveAloneFlag.toString() + } + }, + async getClassInfo () { + await this.residentEduInfo(this.form.resiId) + await this.residentHobbyInfo(this.form.resiId) + await this.residentReligion(this.form.resiId) + await this.getHealthInfoDetailById(this.form.resiId) + await this.residentWorkInfo(this.form.resiId) + await this.getEconomyDetailById(this.form.resiId) + await this.getResideInfoDetailById(this.form.resiId) + await this.getFamilyInfoDetailById(this.form.resiId) + await this.residentPartyMemberInfo(this.form.resiId) + await this.residentEnsureHouse(this.form.resiId) + await this.residentUnemployed(this.form.resiId) + await this.getVeteranDetailById(this.form.resiId) + await this.residentUnitedFront(this.form.resiId) + await this.getVolunteerDetailById(this.form.resiId) + await this.residentSpecial(this.form.resiId) + await this.getOldPeopleDetailById(this.form.resiId) + }, + // 教育信息详情 + residentEduInfo(id) { + this.$http.get(`/actual/base/residentEduInfo/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.eduInfoDto = res.data ? res.data : { // 教育信息 + cultureLevel:'', + eduRemark:'' + } + } + }) + }, + // 兴趣爱好详情 + residentHobbyInfo(id) { + this.$http.get(`/actual/base/residentHobbyInfo/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.hobbyInfoDto = res.data ? res.data : { //兴趣爱好 + hobbyCode:[],//兴趣特长 + interestDesc:'',//兴趣 + hobbyRemark:''//备注 + } + } + }) + }, + // 宗教信仰详情 + residentReligion(id) { + this.$http.get(`/actual/base/residentReligion/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.religionDto = res.data ? res.data : { + religion:'', + religionRemark:'' + } + } + }) + }, + // 健康信息详情 + getHealthInfoDetailById(id) { + this.$http.post(`/actual/base/residentHealthInfo/getHealthInfoDetailById/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.healthDto = res.data ? res.data : { // 健康 + disabilityCategoryCode:'',//残疾类别 + disabilityLevel:'',//残疾等级 + disabilityNum:'',//残疾证号 + disabilityDesc:'',//残疾说明 + guardianFlag:null,//有无监护人 + specialSkillFlag:null,//有无技能特长【有:1 无:0】 + workCapacityFlag:null,//有无劳动能力【有:1 无:0】 + voluntaryEducationFlag:null,//有无非义务教育阶段助学【有:1 无:0】 + illnessCode:'',//所患大病字典code + illnessTime:'',//大病患病时间yyyy-MM-dd + chronicDiseaseCode:'',//所患慢性病code + chronicDiseaseTime:'',//慢病患病时间 + insuredFlag:'',//是否参保【是:1 否:0】 + selfPayAmount:'',//自付金额 + deliveranceAmount:'',//救助金额 + deliveranceTime:'',//救助时间 + deliveranceNum:'',//享受救助明细序号 + healthRemark:''//备注 + } + } + }) + }, + // 工作信息详情 + residentWorkInfo(id) { + this.$http.get(`/actual/base/residentWorkInfo/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.workInfoDto = res.data ? res.data : { //工作 + workUnit:'',//工作单位 + occupation:'',//职业 + retireTime:'',//离退休时间 + workRemark:'',//备注 + } + } + }) + }, + // 经济状况详情 + getEconomyDetailById(id) { + this.$http.post(`/actual/base/residentEconomy/getEconomyDetailById/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.economyDto = res.data ? res.data : {//经济 + retirementAmount:'',//退休金额 + monthIncome:'',//月收入 + } + } + }) + }, + // 居住信息详情 + getResideInfoDetailById(id) { + this.$http.post(`/actual/base/residentResideInfo/getResideInfoDetailById/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.resideInfoDto = res.data ? res.data : {//居住信息 + nativePlace:'',//籍贯 + placeOfDomicile:'',//户籍所在地 + currentResidence:'',//现居住地 + householdSituation:'',//人户情况,字典code + resiRemark:'',//备注 + } + } + }) + }, + // 家庭信息详情 + getFamilyInfoDetailById(id) { + this.$http.post(`/actual/base/residentFamilyInfo/getFamilyInfoDetailById/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.familyInfoDto = res.data ? res.data : {//家庭 + houseHolderRel:'',//与户主关系 + resideSituation:'',//居住情况 + marriage:'',//婚姻状况 + spouseSituation:'',//配偶情况 + elderlyFlag:null,//有无赡养人【有:1 无:0】 + elderlyRelation:'',//与赡养人关系【字典表】 + dependantMobile:'',//赡养人联系电话 + familyInfoRemark:'',//备注 + } + } + }) + }, + // 党员信息详情 + residentPartyMemberInfo(id) { + this.$http.get(`/actual/base/residentPartyMemberInfo/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.parymemberInfoDto = res.data ? res.data : {//党员信息 + joinTime:'',//入党时间yyyy-MM-dd + positiveTime:'',//转正时间yyyy-MM-dd + branchId:'',//所属支部 + flowFlag:null,//是否流动党员:1是,0否 + flowActNum:'',//流动党员活动证号 + partyJob:'',//职务,字典code + retiredFlag:null,//是否退休:1是,0否 + centerFlag:null,//是否党员中心户:1是,0否 + joinBranchName:'',//入党时所在党支部 + joinCommunityTime:'',//组织关系转入社区时间yyyy-MM-dd + longHolidayFlag:null,//是否请长假:1是,0否 + } + } + }) + }, + // 保障房信息详情 + residentEnsureHouse(id) { + this.$http.get(`/actual/base/residentEnsureHouse/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.ensureHouseDto = res.data ? res.data : {//保障房信息 + housingNature:'',//住房性质,字典code + securityType:'',//保障类型 + certificateDate:'',//发证日期yyyy-MM-dd + subsidyNum:'',//补贴编号 + subsidyAmount:'',//补贴金额 + } + } + }) + }, + // 失业信息详情 + residentUnemployed(id) { + this.$http.get(`/actual/base/residentUnemployed/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.unemployedDto = res.data ? res.data : {//失业信息 + originWorkUnit:'',//原工作单位 + unemploymentTime:'',//失业时间yyyy-MM-dd + unemploymentNum:'',//失业证号 + employmentNum:'',//再就业优惠证号 + specialSkill:'',//技术特长 + unemploymentReason:'',//失业原因【字典表】code + employmentHardFlag:null,//是否就业困难对象;1是0不是 + employmentWish:'',//劳动能力就业愿望 + } + } + }) + }, + // 退役军人信息详情 + getVeteranDetailById(id) { + this.$http.post(`/actual/base/residentVeteran/getVeteranDetailById/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.veteranDto = res.data ? res.data : {//退役军人 + joinArmyTime:'',//入伍时间 + leaveArmyTime:'',//退伍时间 + serviceUnit:'',//服役单位 + receiveUnit:'',//接收单位 + settlementAmount:'',//待安置补助金 + trainDesc:'',//培训状况 + employmentSituation:'',//现就业情况 + joinWarStartTime:'',//参战时间开始日期yyyy-MM-dd + joinWarEndTime:'',//参战时间截止日期yyyy-MM-dd + pubWelfareJobFlag:null,//是否办理公益性岗位;1是0否 + } + } + }) + }, + // 统战人员详情 + residentUnitedFront(id) { + this.$http.get(`/actual/base/residentUnitedFront/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.unitedFrontDto = res.data ? res.data : {//统战人员 + duty:'',//职务 + visitation:'',//探亲情况 + } + } + }) + }, + // 志愿者信息详情 + getVolunteerDetailById(id) { + this.$http.post(`/actual/base/residentVolunteer/getVolunteerDetailById/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.volunteerDto = res.data ? res.data : {//志愿者信息 + volunteerCategory:[],//志愿者类别 + volunteerRemark:''//备注 + } + } + }) + }, + // 老年人信息详情 + getOldPeopleDetailById(id) { + this.$http.post(`/actual/base/residentOldPeople/getOldPeopleDetailById/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.oldPeopleDto = res.data ? res.data : { + oldSubsidy:''//高龄补助 + } + } + }) + }, + // 特殊人群信息 + residentSpecial(id) { + this.$http.get(`/actual/base/residentSpecial/detail/${id}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.form.specialDto = res.data ? res.data : {//特殊人群 + specialCategoryCode:[]//人群类别【字典表】,可多选,以英文逗号隔开; + } + } + }) + } } } diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index b5481b061..3faf92438 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -1112,8 +1112,20 @@ export default { this.editUserId = row.resiId; this.formName = "编辑居民"; this.dialogVisible = true; + await this.residentBaseInfo(); + }, + // 获取详情 + residentBaseInfo () { + this.$http.post(`/actual/base/residentBaseInfo/detail/${this.editUserId}`).then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } else { + this.$refs.baseForm.old_from(res.data); + } + }).catch((err) => { + return this.$message.error("网络错误"); + }); }, - handlerReset() { this.$refs.baseForm.resetForm(); }, @@ -1218,8 +1230,7 @@ export default { return finalArr; }, async handleEditSUbmit() { - const arr = await this.formetForm(); - if (arr) this.submitEdit(arr); + this.handleSUbmit() }, async handleSUbmit() { @@ -1249,12 +1260,12 @@ export default { (_baseForm.disabilityFlag = parseInt(_baseForm.disabilityFlag)), //是否残疾 (_baseForm.seriousIllnessFlag = parseInt(_baseForm.seriousIllnessFlag)), //大病 (_baseForm.chronicDiseaseFlag = parseInt(_baseForm.chronicDiseaseFlag)); //慢病 - if ((_baseForm.hobbyInfoDto.hobbyCode = [])) { + if ((_baseForm.hobbyInfoDto.hobbyCode = [])) { _baseForm.hobbyInfoDto.hobbyCode = ""; } else { _baseForm.hobbyInfoDto.hobbyCode.forEach((element) => { _baseForm.hobbyInfoDto.hobbyCode = - _baseForm.hobbyInfoDto.hobbyCode + "," + element; + _baseForm.hobbyInfoDto.hobbyCode ? _baseForm.hobbyInfoDto.hobbyCode + "," + element : _baseForm.hobbyInfoDto.hobbyCode; }); } if ((_baseForm.volunteerDto.volunteerCategory = [])) { @@ -1262,7 +1273,7 @@ export default { } else { _baseForm.volunteerDto.volunteerCategory.forEach((element) => { _baseForm.volunteerDto.volunteerCategory = - _baseForm.volunteerDto.volunteerCategory + "," + element; + _baseForm.volunteerDto.volunteerCategory ? _baseForm.volunteerDto.volunteerCategory + "," + element : _baseForm.volunteerDto.volunteerCategory; }); } if ((_baseForm.specialDto.specialCategoryCode = [])) { @@ -1270,7 +1281,7 @@ export default { } else { _baseForm.specialDto.specialCategoryCode.forEach((element) => { _baseForm.specialDto.specialCategoryCode = - _baseForm.specialDto.specialCategoryCode + "," + element; + _baseForm.specialDto.specialCategoryCode ? _baseForm.specialDto.specialCategoryCode + "," + element : _baseForm.specialDto.specialCategoryCode; }); } this.submitAdd(_baseForm); @@ -1318,7 +1329,7 @@ export default { async submitAdd(arr) { this.btnLoading = true; await this.$http - .post("/actual/base/residentBaseInfo/save", arr) + .post(arr.resiId ? "actual/base/residentBaseInfo/update" : "/actual/base/residentBaseInfo/save", arr) .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg);