diff --git a/src/views/components/resiForm.vue b/src/views/components/resiForm.vue index fe1922738..3fcc1186a 100644 --- a/src/views/components/resiForm.vue +++ b/src/views/components/resiForm.vue @@ -962,7 +962,7 @@ export default { } ], - + newForm: {}, form:{ agencyName:this.$store.state.user.agencyName, agencyId:this.$store.state.user.agencyId, @@ -1151,10 +1151,13 @@ export default { this.getGridList() this.getAllNation() + + this.setNewForm() }, methods: { submit_from(){ + this.setJSON() var flag = false this.$refs.formId.validate(v=>{ this.validateFlag = v @@ -1162,10 +1165,9 @@ export default { }) if(flag){ - return this.form + return this.newForm } - console.log(this.form); - return this.form + return this.newForm }, async old_from(data) { this.getFormData(data) @@ -1173,7 +1175,8 @@ export default { await this.getBuildList() await this.getUniList() await this.getHouseList() - await this.getClassInfo() + // await this.getClassInfo() + await this.residentEduInfo(this.form.resiId) }, getAllNation(){ // 民族字典 @@ -1547,43 +1550,104 @@ export default { this.form.homeId = '' 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) - // } + async handleClick (tab, event) { + if (event.toElement.innerText == '教育') { + if (!this.form.resiId) { + this.newForm.eduInfoDto = this.form.eduInfoDto + } else { + await this.residentEduInfo(this.form.resiId) + } + } else if (event.toElement.innerText == '兴趣爱好') { + if (!this.form.resiId) { + this.newForm.hobbyInfoDto = this.form.hobbyInfoDto + } else { + await this.residentHobbyInfo(this.form.resiId) + } + } else if (event.toElement.innerText == '宗教信仰') { + if (!this.form.resiId) { + this.newForm.religionDto = this.form.religionDto + } else { + await this.residentReligion(this.form.resiId) + } + } else if (event.toElement.innerText == '健康') { + if (!this.form.resiId) { + this.newForm.healthDto = this.form.healthDto + } else { + await this.getHealthInfoDetailById(this.form.resiId) + } + } else if (event.toElement.innerText == '工作') { + if (!this.form.resiId) { + this.newForm.workInfoDto = this.form.workInfoDto + } else { + await this.residentWorkInfo(this.form.resiId) + } + } else if (event.toElement.innerText == '经济情况') { + if (!this.form.resiId) { + this.newForm.economyDto = this.form.economyDto + } else { + await this.getEconomyDetailById(this.form.resiId) + } + } else if (event.toElement.innerText == '居住') { + if (!this.form.resiId) { + this.newForm.resideInfoDto = this.form.resideInfoDto + } else { + await this.getResideInfoDetailById(this.form.resiId) + } + } else if (event.toElement.innerText == '家庭') { + if (!this.form.resiId) { + this.newForm.familyInfoDto = this.form.familyInfoDto + } else { + await this.getFamilyInfoDetailById(this.form.resiId) + } + } else if (event.toElement.innerText == '党员信息') { + if (!this.form.resiId) { + this.newForm.parymemberInfoDto = this.form.parymemberInfoDto + } else { + await this.residentPartyMemberInfo(this.form.resiId) + } + } else if (event.toElement.innerText == '保障房信息') { + if (!this.form.resiId) { + this.newForm.ensureHouseDto = this.form.ensureHouseDto + } else { + await this.residentEnsureHouse(this.form.resiId) + } + } else if (event.toElement.innerText == '失业') { + if (!this.form.resiId) { + this.newForm.unemployedDto = this.form.unemployedDto + } else { + await this.residentUnemployed(this.form.resiId) + } + } else if (event.toElement.innerText == '退役军人') { + if (!this.form.resiId) { + this.newForm.veteranDto = this.form.veteranDto + } else { + await this.getVeteranDetailById(this.form.resiId) + } + } else if (event.toElement.innerText == '统战') { + if (!this.form.resiId) { + this.newForm.unitedFrontDto = this.form.unitedFrontDto + } else { + await this.residentUnitedFront(this.form.resiId) + } + } else if (event.toElement.innerText == '志愿者信息') { + if (!this.form.resiId) { + this.newForm.volunteerDto = this.form.volunteerDto + } else { + await this.getVolunteerDetailById(this.form.resiId) + } + } else if (event.toElement.innerText == '特殊人群') { + if (!this.form.resiId) { + this.newForm.specialDto = this.form.specialDto + } else { + await this.residentSpecial(this.form.resiId) + } + } else if (event.toElement.innerText == '老年人') { + if (!this.form.resiId) { + this.newForm.oldPeopleDto = this.form.oldPeopleDto + } else { + await this.getOldPeopleDetailById(this.form.resiId) + } + } }, handleForm () { let newForm = [] @@ -1776,24 +1840,48 @@ export default { 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) + let old_Form = { + categoryId: '111222333',// 临时写死 + resiId: data.resiId, + buildId: data.houseInfo.buildId, + gridId: data.houseInfo.gridId, + gridName: data.houseInfo.gridName, + homeId: data.houseInfo.homeId, + homeName: data.houseInfo.homeName, + houseMergeId: data.houseInfo.mergeId, + unitId: data.houseInfo.unitId, + villageId: data.houseInfo.villageId, + birthday: data.birthday, + gender: data.gender, + idNum: data.idNum, + localResidenceFlag: data.localResidenceFlag.toString(), + mobile: data.mobile, + name: data.name, + nation: data.nation ? data.nation : '', + remark: data.remark ? data.remark : '', + partyFlag: data.categoryInfo.partyFlag.toString(), + subsistenceAllowanceFlag: data.categoryInfo.subsistenceAllowanceFlag.toString(), + ensureHouseFlag: data.categoryInfo.ensureHouseFlag.toString(), + unemployedFlag: data.categoryInfo.unemployedFlag.toString(), + fertileWomanFlag: data.categoryInfo.fertileWomanFlag.toString(), + veteranFlag: data.categoryInfo.veteranFlag.toString(), + unitedFrontFlag: data.categoryInfo.unitedFrontFlag.toString(), + petitionOfficerFlag: data.categoryInfo.petitionOfficerFlag.toString(), + volunteerFlag: data.categoryInfo.volunteerFlag.toString(), + oldPeopleFlag: data.categoryInfo.oldPeopleFlag.toString(), + emptyNesterFlag: data.categoryInfo.emptyNesterFlag.toString(), + bereavedPersonFlag: data.categoryInfo.bereavedPersonFlag.toString(), + disabledFlag: data.categoryInfo.disabledFlag.toString(), + dementedFlag: data.categoryInfo.dementedFlag.toString(), + disabilityFlag: data.categoryInfo.disabilityFlag.toString(), + seriousIllnessFlag: data.categoryInfo.seriousIllnessFlag.toString(), + chronicDiseaseFlag: data.categoryInfo.chronicDiseaseFlag.toString(), + specialCrowdFlag: data.categoryInfo.specialCrowdFlag.toString(), + tenantFlag: data.categoryInfo.tenantFlag.toString(), + floatingFlag: data.categoryInfo.floatingFlag.toString(), + liveAloneFlag: data.categoryInfo.liveAloneFlag.toString(), + } + this.newForm = old_Form }, // 教育信息详情 residentEduInfo(id) { @@ -1805,6 +1893,7 @@ export default { cultureLevel:'', eduRemark:'' } + this.newForm.eduInfoDto = this.form.eduInfoDto } }) }, @@ -1819,6 +1908,7 @@ export default { interestDesc:'',//兴趣 hobbyRemark:''//备注 } + this.newForm.hobbyInfoDto = this.form.hobbyInfoDto } }) }, @@ -1832,6 +1922,7 @@ export default { religion:'', religionRemark:'' } + this.newForm.religionDto = this.form.religionDto } }) }, @@ -1861,6 +1952,7 @@ export default { deliveranceNum:'',//享受救助明细序号 healthRemark:''//备注 } + this.newForm.healthDto = this.form.healthDto } }) }, @@ -1876,6 +1968,7 @@ export default { retireTime:'',//离退休时间 workRemark:'',//备注 } + this.newForm.workInfoDto = this.form.workInfoDto } }) }, @@ -1889,6 +1982,7 @@ export default { retirementAmount:'',//退休金额 monthIncome:'',//月收入 } + this.newForm.economyDto = this.form.economyDto } }) }, @@ -1905,6 +1999,7 @@ export default { householdSituation:'',//人户情况,字典code resiRemark:'',//备注 } + this.newForm.resideInfoDto = this.form.resideInfoDto } }) }, @@ -1924,6 +2019,7 @@ export default { dependantMobile:'',//赡养人联系电话 familyInfoRemark:'',//备注 } + this.newForm.familyInfoDto = this.form.familyInfoDto } }) }, @@ -1946,6 +2042,7 @@ export default { joinCommunityTime:'',//组织关系转入社区时间yyyy-MM-dd longHolidayFlag:null,//是否请长假:1是,0否 } + this.newForm.parymemberInfoDto = this.form.parymemberInfoDto } }) }, @@ -1962,6 +2059,7 @@ export default { subsidyNum:'',//补贴编号 subsidyAmount:'',//补贴金额 } + this.newForm.ensureHouseDto = this.form.ensureHouseDto } }) }, @@ -1981,6 +2079,7 @@ export default { employmentHardFlag:null,//是否就业困难对象;1是0不是 employmentWish:'',//劳动能力就业愿望 } + this.newForm.unemployedDto = this.form.unemployedDto } }) }, @@ -2002,6 +2101,7 @@ export default { joinWarEndTime:'',//参战时间截止日期yyyy-MM-dd pubWelfareJobFlag:null,//是否办理公益性岗位;1是0否 } + this.newForm.veteranDto = this.form.veteranDto } }) }, @@ -2015,6 +2115,7 @@ export default { duty:'',//职务 visitation:'',//探亲情况 } + this.newForm.unitedFrontDto = this.form.unitedFrontDto } }) }, @@ -2028,6 +2129,7 @@ export default { volunteerCategory:[],//志愿者类别 volunteerRemark:''//备注 } + this.newForm.volunteerDto = this.form.volunteerDto } }) }, @@ -2040,6 +2142,7 @@ export default { this.form.oldPeopleDto = res.data ? res.data : { oldSubsidy:''//高龄补助 } + this.newForm.oldPeopleDto = this.form.oldPeopleDto } }) }, @@ -2052,8 +2155,152 @@ export default { this.form.specialDto = res.data ? res.data : {//特殊人群 specialCategoryCode:[]//人群类别【字典表】,可多选,以英文逗号隔开; } + this.newForm.specialDto = this.form.specialDto } }) + }, + setNewForm() { + this.newForm = { + agencyName:this.$store.state.user.agencyName, + agencyId:this.$store.state.user.agencyId, + resiId: '', // 详情拿到 + houseMergeId: '', // 详情拿到 + categoryId: '', // 详情拿到 + gridName:'', + gridId:'', //所属网格id + villageId: '', //小区id + buildId: '', //楼栋id + unitId: '', //单元id + homeId: '', //房屋id + name:'', //姓名 + nation:'', //民族 + remark:'', //备注 + localResidenceFlag:'', //本地户籍 + birthday:'', //生日 + idNum:'', //证件号 + gender:'', // 性别 + mobile:'', //手机 + partyFlag:'0',//党员 + subsistenceAllowanceFlag:'0', //低保 + ensureHouseFlag:'0', //保障房 + unemployedFlag:'0',//失业 + fertileWomanFlag:'0', //育龄妇女 + veteranFlag:'0', //退役军人 + unitedFrontFlag:'0',//统战人员 + petitionOfficerFlag:'0',//信访人员 + volunteerFlag:'0', //志愿者 + bereavedPersonFlag:'0', //失独 + tenantFlag:'0', //租户 + floatingFlag:'0',//流动人口 + specialCrowdFlag:'0',//特殊人群 + oldPeopleFlag:'0', //老年人 + emptyNesterFlag:'0', //空巢 + liveAloneFlag:'0', //独居老人 + disabledFlag:'0', //失能老人 + dementedFlag:'0', //失智老人 + disabilityFlag:'0',//是否残疾 + seriousIllnessFlag:'0', //大病 + chronicDiseaseFlag:'0', //慢病 + } + + this.newForm.eduInfoDto = this.form.eduInfoDto + }, + setJSON() { + this.newForm.agencyName = this.form.agencyName, + this.newForm.agencyId = this.form.agencyId, + this.newForm.resiId = this.form.resiId, + this.newForm.houseMergeId = this.form.houseMergeId, + this.newForm.categoryId = this.form.categoryId, + this.newForm.gridName = this.form.gridName, + this.newForm.gridId = this.form.gridId, + this.newForm.villageId = this.form.villageId, + this.newForm.buildId = this.form.buildId, + this.newForm.unitId = this.form.unitId, + this.newForm.homeId = this.form.homeId, + this.newForm.name = this.form.name, + this.newForm.vnation = this.form.vnation, + this.newForm.remark = this.form.remark, + this.newForm.localResidenceFlag = this.form.localResidenceFlag, + this.newForm.birthday = this.form.birthday, + this.newForm.idNum = this.form.idNum, + this.newForm.gender = this.form.gender, + this.newForm.mobile = this.form.mobile, + this.newForm.partyFlag = this.form.partyFlag, + this.newForm.subsistenceAllowanceFlag = this.form.subsistenceAllowanceFlag, + this.newForm.ensureHouseFlag = this.form.ensureHouseFlag, + this.newForm.unemployedFlag = this.form.unemployedFlag, + this.newForm.fertileWomanFlag = this.form.fertileWomanFlag, + this.newForm.veteranFlag = this.form.veteranFlag, + this.newForm.unitedFrontFlag = this.form.unitedFrontFlag, + this.newForm.petitionOfficerFlag = this.form.petitionOfficerFlag, + this.newForm.volunteerFlag = this.form.volunteerFlag, + this.newForm.bereavedPersonFlag = this.form.bereavedPersonFlag, + this.newForm.tenantFlag = this.form.tenantFlag, + this.newForm.floatingFlag = this.form.floatingFlag, + this.newForm.specialCrowdFlag = this.form.specialCrowdFlag, + this.newForm.oldPeopleFlag = this.form.oldPeopleFlag, + this.newForm.emptyNesterFlag = this.form.emptyNesterFlag, + this.newForm.liveAloneFlag = this.form.liveAloneFlag, + this.newForm.disabledFlag = this.form.disabledFlag, + this.newForm.dementedFlag = this.form.dementedFlag, + this.newForm.disabilityFlag = this.form.disabilityFlag, + this.newForm.seriousIllnessFlag = this.form.seriousIllnessFlag, + this.newForm.chronicDiseaseFlag = this.form.chronicDiseaseFlag + if(this.newForm.eduInfoDto) { + this.newForm.eduInfoDto = this.form.eduInfoDto + } + if(this.newForm.hobbyInfoDto) { + this.newForm.hobbyInfoDto = this.form.hobbyInfoDto + } + if(this.newForm.religionDto) { + this.newForm.religionDto = this.form.religionDto + } + if(this.newForm.healthDto) { + this.newForm.healthDto = this.form.healthDto + } + if(this.newForm.workInfoDto) { + this.newForm.workInfoDto = this.form.workInfoDto + } + if(this.newForm.economyDto) { + this.newForm.economyDto = this.form.economyDto + } + + if(this.newForm.resideInfoDto) { + this.newForm.resideInfoDto = this.form.resideInfoDto + } + if(this.newForm.familyInfoDto) { + this.newForm.familyInfoDto = this.form.familyInfoDto + } + if(this.newForm.parymemberInfoDto) { + this.newForm.parymemberInfoDto = this.form.parymemberInfoDto + } + + if(this.newForm.ensureHouseDto) { + this.newForm.ensureHouseDto = this.form.ensureHouseDto + } + + if(this.newForm.unemployedDto) { + this.newForm.unemployedDto = this.form.unemployedDto + } + + if(this.newForm.veteranDto) { + this.newForm.veteranDto = this.form.veteranDto + } + if(this.newForm.unitedFrontDto) { + this.newForm.unitedFrontDto = this.form.unitedFrontDto + } + + if(this.newForm.volunteerDto) { + this.newForm.volunteerDto = this.form.volunteerDto + } + + if(this.newForm.oldPeopleDto) { + this.newForm.oldPeopleDto = this.form.oldPeopleDto + } + + if(this.newForm.specialDto) { + this.newForm.specialDto = this.form.specialDto + } } } } diff --git a/src/views/modules/base/resi.vue b/src/views/modules/base/resi.vue index 3faf92438..bc68b6318 100644 --- a/src/views/modules/base/resi.vue +++ b/src/views/modules/base/resi.vue @@ -1260,31 +1260,37 @@ export default { (_baseForm.disabilityFlag = parseInt(_baseForm.disabilityFlag)), //是否残疾 (_baseForm.seriousIllnessFlag = parseInt(_baseForm.seriousIllnessFlag)), //大病 (_baseForm.chronicDiseaseFlag = parseInt(_baseForm.chronicDiseaseFlag)); //慢病 - if ((_baseForm.hobbyInfoDto.hobbyCode = [])) { - _baseForm.hobbyInfoDto.hobbyCode = ""; - } else { - _baseForm.hobbyInfoDto.hobbyCode.forEach((element) => { - _baseForm.hobbyInfoDto.hobbyCode = - _baseForm.hobbyInfoDto.hobbyCode ? _baseForm.hobbyInfoDto.hobbyCode + "," + element : _baseForm.hobbyInfoDto.hobbyCode; - }); - } - if ((_baseForm.volunteerDto.volunteerCategory = [])) { - _baseForm.volunteerDto.volunteerCategory = ""; - } else { - _baseForm.volunteerDto.volunteerCategory.forEach((element) => { - _baseForm.volunteerDto.volunteerCategory = - _baseForm.volunteerDto.volunteerCategory ? _baseForm.volunteerDto.volunteerCategory + "," + element : _baseForm.volunteerDto.volunteerCategory; - }); - } - if ((_baseForm.specialDto.specialCategoryCode = [])) { - _baseForm.specialDto.specialCategoryCode = ""; - } else { - _baseForm.specialDto.specialCategoryCode.forEach((element) => { - _baseForm.specialDto.specialCategoryCode = - _baseForm.specialDto.specialCategoryCode ? _baseForm.specialDto.specialCategoryCode + "," + element : _baseForm.specialDto.specialCategoryCode; - }); - } - this.submitAdd(_baseForm); + if (_baseForm.hobbyInfoDto) { + if ((_baseForm.hobbyInfoDto.hobbyCode = [])) { + _baseForm.hobbyInfoDto.hobbyCode = ""; + } else { + _baseForm.hobbyInfoDto.hobbyCode.forEach((element) => { + _baseForm.hobbyInfoDto.hobbyCode = + _baseForm.hobbyInfoDto.hobbyCode ? _baseForm.hobbyInfoDto.hobbyCode + "," + element : _baseForm.hobbyInfoDto.hobbyCode; + }); + } + } + if (_baseForm.volunteerDto) { + if ((_baseForm.volunteerDto.volunteerCategory = [])) { + _baseForm.volunteerDto.volunteerCategory = ""; + } else { + _baseForm.volunteerDto.volunteerCategory.forEach((element) => { + _baseForm.volunteerDto.volunteerCategory = + _baseForm.volunteerDto.volunteerCategory ? _baseForm.volunteerDto.volunteerCategory + "," + element : _baseForm.volunteerDto.volunteerCategory; + }); + } + } + if (_baseForm.specialDto) { + if ((_baseForm.specialDto.specialCategoryCode = [])) { + _baseForm.specialDto.specialCategoryCode = ""; + } else { + _baseForm.specialDto.specialCategoryCode.forEach((element) => { + _baseForm.specialDto.specialCategoryCode = + _baseForm.specialDto.specialCategoryCode ? _baseForm.specialDto.specialCategoryCode + "," + element : _baseForm.specialDto.specialCategoryCode; + }); + } + } + this.submitAdd(_baseForm); }, handleDel(row) { let params = {