From 3cee5037f0f0d595a9171c9855544a24f9e396e2 Mon Sep 17 00:00:00 2001 From: HAHA Date: Tue, 19 Apr 2022 19:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=9A=E5=B0=8F=E7=BB=84=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/plugins/power/poweraxis.vue | 117 +++++++++++++++--- 1 file changed, 103 insertions(+), 14 deletions(-) diff --git a/src/views/modules/plugins/power/poweraxis.vue b/src/views/modules/plugins/power/poweraxis.vue index 2c37816a..2e94bc62 100644 --- a/src/views/modules/plugins/power/poweraxis.vue +++ b/src/views/modules/plugins/power/poweraxis.vue @@ -81,13 +81,25 @@ - - + + + :key="item.id" + :label="item.name" + :value="item.id"> + + + + + + + + @@ -161,6 +173,8 @@ export default { agencytree:[], // 上级网格党支部列表 GridPartyBranchList:[], + // 党委列表 + PartyCommList:[], // 重新渲染表格状态 refreshTable: true, // 是否展开,默认全部展开 @@ -169,8 +183,13 @@ export default { addDialogBox:false, // 组织列表开关 orgListSwitch:false, + // 上级网格党支部列表 + GridPartyBranchSwitch:false, + // 党委下拉框列表开关 + partyCommSwitch:false, // 确认删除弹窗 delWindow:false, + } }, created(){ @@ -194,7 +213,8 @@ export default { agencyId:this.addOrgForm.agencyId, agencyName:this.addOrgForm.agencyName, agencyType:this.addOrgForm.agencyType, - categoryCode:this.addOrgForm.categoryCode + categoryCode:this.addOrgForm.categoryCode, + pid:this.addOrgForm.pid } const { data, code, msg } = await requestPost(url,params) @@ -202,6 +222,9 @@ export default { if (code === 0) { this.$message.success("新增成功") this.addDialogBox = false + this.orgListSwitch = false + this.GridPartyBranchSwitch = false + this.initTreeData() this.addOrgFormRest() } else { this.$message.error(msg) @@ -233,7 +256,9 @@ export default { const { data, code, msg } = await requestPost(url,params) if (code === 0) { + console.log(data) this.agencytree = data[0].subOrgList + } else { this.$message.error(msg) } @@ -258,10 +283,54 @@ export default { } }, + // 获取上级网格党支部 + async getGridPartyBranchList(){ + const url = '/pli/power/axisStruct/GridPartyBranchList' + + let params = {} + + const { data, code, msg } = await requestPost(url,params) + + if (code === 0) { + console.log(data) + this.GridPartyBranchList = data + } else { + this.$message.error(msg) + } + }, + // 获取上级组织党委 + async getPartyCommList(){ + const url = '/pli/power/axisStruct/getPartyCommList' + + let params = {} + + const { data, code, msg } = await requestPost(url,params) + + if (code === 0) { + this.PartyCommList = data + } else { + this.$message.error(msg) + } + }, + // 查父id + // async getPid(){ + // const url = '/pli/power/axisStruct/getPid' + + // let params = {} + + // const { data, code, msg } = await requestPost(url,params) + + // if (code === 0) { + // this.addOrgForm.pid = data + // } else { + // this.$message.error(msg) + // } + // }, // 新增按钮 addNewOrg(){ this.addDialogBox = true + this.addOrgForm.pid = '' this.getListSimple() this.getAgencyTree() }, @@ -272,18 +341,20 @@ export default { this.initTreeData() }, /** 展开/折叠操作 */ - toggleExpandAll() { - this.refreshTable = false; - this.isExpandAll = !this.isExpandAll; - this.$nextTick(() => { - this.refreshTable = true; - }); - }, + // toggleExpandAll() { + // this.refreshTable = false; + // this.isExpandAll = !this.isExpandAll; + // this.$nextTick(() => { + // this.refreshTable = true; + // }); + // }, // 关闭对话框 handleClose(done) { this.$confirm('确认关闭?') .then(_ => { this.addOrgFormRest() + this.orgListSwitch = false + this.GridPartyBranchSwitch = false done(); }) .catch(_ => {}); @@ -291,6 +362,8 @@ export default { // 取消新增按钮 cancelAdd(){ this.addDialogBox = false + this.orgListSwitch = false + this.GridPartyBranchSwitch = false this.addOrgFormRest() }, // 清空新增表单 @@ -309,9 +382,22 @@ export default { this.addOrgForm.categoryCode = val if (val === 'community_party') { this.orgListSwitch = true + this.GridPartyBranchSwitch = false + this.partyCommSwitch = false + this.addOrgForm.pid = 0 } if(val === 'grid_party') { this.orgListSwitch = false + this.GridPartyBranchSwitch = false + this.partyCommSwitch = true + this.getPartyCommList() + this.addOrgForm.pid = '' + } + if(val === 'group_party') { + this.GridPartyBranchSwitch = true + this.partyCommSwitch = false + this.addOrgForm.pid = '' + this.getGridPartyBranchList() } }, handelAgencyTree(val){ @@ -337,6 +423,7 @@ export default { if (code === 0) { this.$message.success("删除成功") + this.initTreeData() this.delWindow = false } else { this.$message.error(msg) @@ -346,7 +433,9 @@ export default { canceldelWindow(){ this.delWindow = false }, - + handelGridParty(val){ + console.log(val) + } }