From b23130d5cb2241722ae2eb2d71dbc10959aefec0 Mon Sep 17 00:00:00 2001 From: zhaoyongnian <541231643@qq.com> Date: Mon, 13 Jun 2022 16:47:17 +0800 Subject: [PATCH] bug --- .../partymember/icpartyorg-add-or-update.vue | 100 +++++++++++------- .../modules/partymember/icpartyorgtree.vue | 10 +- 2 files changed, 66 insertions(+), 44 deletions(-) diff --git a/src/views/modules/partymember/icpartyorg-add-or-update.vue b/src/views/modules/partymember/icpartyorg-add-or-update.vue index 1a2676e7..7453fdaa 100644 --- a/src/views/modules/partymember/icpartyorg-add-or-update.vue +++ b/src/views/modules/partymember/icpartyorg-add-or-update.vue @@ -8,7 +8,7 @@ @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '100px'"> - + - + + + + @@ -129,7 +133,8 @@ staffId:'', orgPidName: '', agencyName:'', - pid: '' + pid: '', + sjdzzName: '' // 新增下级上级党组织名字 }, orgListVisible: false, agencyListVisible:false, @@ -151,27 +156,40 @@ this.agencyId = localStorage.getItem('agencyId') this.dataForm.customerId = localStorage.getItem('customerId') this.dataForm.staffId = localStorage.getItem('staffId') + //设置党组织类型 + this.$nextTick(() => { this.$refs['dataForm'].resetFields() this.dataForm.latitude = '' - //设置党组织类型 - this.setPartyOrgType() - this.getOrgList().then(() => { - if (this.dataForm.id) { - this.getInfo() - } else { - this.initMap() - if(this.dataForm.orgId) { - this.dataForm.mySelectOrg = this.dataForm.orgId - this.dataForm.orgPid = this.dataForm.orgId - this.dataForm.orgPids = this.dataForm.orgPids ? this.dataForm.orgPids + ':' + this.dataForm.orgId : this.dataForm.orgId - console.log(this.dataForm.orgPid) - console.log(this.dataForm.orgPids) - } else { - this.dataForm.mySelectOrg = '' + if (this.dataForm.id) { + this.getInfo() + } else { + this.initMap() + if(this.dataForm.orgId) { + this.dataForm.mySelectOrg = this.dataForm.orgId + this.dataForm.orgPid = this.dataForm.orgId + this.dataForm.orgPids = this.dataForm.orgPids ? this.dataForm.orgPids + ':' + this.dataForm.orgId : this.dataForm.orgId + this.dataForm.partyOrgType = this.dataForm._partyOrgType + if (this.dataForm.partyOrgType === '0') { // 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部 + this.dataForm.partyOrgType = '1' + } else if (this.dataForm.partyOrgType === '1') { + this.dataForm.partyOrgType = '2' + } else if (this.dataForm.partyOrgType === '2') { + this.dataForm.partyOrgType = '3' + } else if (this.dataForm.partyOrgType === '3') { + this.dataForm.partyOrgType = '4' + } else if (this.dataForm.partyOrgType === '4') { + this.dataForm.partyOrgType = '5' } + console.log(this.dataForm.orgPid) + console.log(this.dataForm.orgPids) + // this.getOrgList() + } else { + this.dataForm.mySelectOrg = '' } - }) + } + + this.setPartyOrgType() }) }, //设置组织类型 @@ -216,30 +234,37 @@ ] } }, + // 选中行政组织 + changeAgencyOrg () { + console.log(this.dataForm.agencyId) + this.getOrgList() + }, // 选中组织类型 组织类型为支部时不需要选择行政组织 changePartyOrgType(value){ if(value != '5'){ // 支部 this.dataForm.agencyId = '' this.dataForm.agencyPids = '' } - this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', {params: {agencyId: this.agencyId, orgType:value}}).then(({data: res}) => { - if (res.code !== 0) { - return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') - } - this.agencyOrgList = this.removeEmptyChildren(res.data) - }).catch(() => {}) + //根据组织类型获取行政组织 + this.getInfoAgencyLisy() + // this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', {params: {agencyId: this.agencyId, orgType:value}}).then(({data: res}) => { + // if (res.code !== 0) { + // return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') + // } + // this.agencyOrgList = this.removeEmptyChildren(res.data) + // }).catch(() => {}) }, // 获取党组织列表 getOrgList() { - return this.$http.get('/resi/partymember/icPartyOrg/getTreelist', {params: {agencyId: this.agencyId, orgPid: this.dataForm.id ? this.dataForm.pid : ''}}).then(({data: res}) => { + this.$http.get('/resi/partymember/icPartyOrg/getParentOrgList', {params: {agencyId: this.dataForm.agencyId, partyOrgType: this.dataForm.partyOrgType}}).then(({data: res}) => { if (res.code !== 0) { return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') } this.orgList = this.removeEmptyChildren(res.data) - this.orgList.unshift({ - partyOrgName: '一级组织', - id: '0' - }); + // this.orgList.unshift({ + // partyOrgName: '一级组织', + // id: '0' + // }); }).catch(() => { }) }, @@ -282,23 +307,20 @@ this.dataForm.mySelectOrg = this.dataForm.orgPid // 行政组织 this.dataForm.agencyId = this.dataForm.agencyId + //根据组织类型获取行政组织 + this.getInfoAgencyLisy() + this.getOrgList() + console.log(':::::', JSON.stringify(this.dataForm)) this.initMap() }).catch(() => { }) - - //根据组织类型获取行政组织 - this.getInfoAgencyLisy() }, getInfoAgencyLisy(){ - this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', - {params: - {agencyId: this.agencyId, - orgType:this.dataForm.partyOrgType} - }).then(({data: res}) => { + this.$http.get('/gov/org/customeragency/getOrgTreeByUserAndType', {params: {agencyId: this.agencyId, orgType: this.dataForm.partyOrgType}}).then(({data: res}) => { if (res.code !== 0) { return this.$message.error(res.internalMsg ? res.internalMsg : res.msg ? res.msg : '查询失败') } - this.agencyOrgList = res.data + this.agencyOrgList = this.removeEmptyChildren(res.data) }).catch(() => { }) }, diff --git a/src/views/modules/partymember/icpartyorgtree.vue b/src/views/modules/partymember/icpartyorgtree.vue index ff1acebd..6c8db18d 100644 --- a/src/views/modules/partymember/icpartyorgtree.vue +++ b/src/views/modules/partymember/icpartyorgtree.vue @@ -24,12 +24,12 @@ size="small" class="div-table-button--detail">{{'查看党员'}} 新增下级 修改 @@ -106,8 +106,7 @@ this.tableLoading = false }, // 新增 / 修改 - addOrUpdateHandle (id, orgId, orgPids, pid) { - console.log('pid:::::', pid) + addOrUpdateHandle (id, orgId, orgPids, pid, partyOrgType, partyOrgName) { this.addOrUpdateVisible = true this.$nextTick(() => { this.$refs.addOrUpdate.dataForm.id = id @@ -115,7 +114,8 @@ this.$refs.addOrUpdate.dataForm.orgId = orgId // 党组织 this.$refs.addOrUpdate.dataForm.orgPids = orgPids this.$refs.addOrUpdate.dataForm.pid = pid - + this.$refs.addOrUpdate.dataForm._partyOrgType = partyOrgType + this.$refs.addOrUpdate.dataForm.sjdzzName = partyOrgName this.$refs.addOrUpdate.init() }) },