From 41d4e542535e8ee94190f3b38d92c8b32523913a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Wed, 2 Mar 2022 06:40:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/xm/core/xmMenu/XmMenuMng.vue | 2 +- .../xmProjectGroup/XmProjectGroupEdit.vue | 1 - .../core/xmProjectGroup/XmProjectGroupMng.vue | 27 ++++++++++++------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/views/xm/core/xmMenu/XmMenuMng.vue b/src/views/xm/core/xmMenu/XmMenuMng.vue index f555298d..d8e28c62 100644 --- a/src/views/xm/core/xmMenu/XmMenuMng.vue +++ b/src/views/xm/core/xmMenu/XmMenuMng.vue @@ -464,7 +464,7 @@ if( this.filters.product && this.filters.product.id){ params.productId=this.filters.product.id }else { - this.$notify({showClose: true, message: "请先选择产品", type: 'warning',position:'top-left' }); + this.$notify({showClose: true, message: "请先选择产品", type: 'warning'}); return; } diff --git a/src/views/xm/core/xmProjectGroup/XmProjectGroupEdit.vue b/src/views/xm/core/xmProjectGroup/XmProjectGroupEdit.vue index d25fefed..c1a644ef 100644 --- a/src/views/xm/core/xmProjectGroup/XmProjectGroupEdit.vue +++ b/src/views/xm/core/xmProjectGroup/XmProjectGroupEdit.vue @@ -121,7 +121,6 @@ var tips=res.data.tips; if(tips.isOk){ this.editForm=res.data.data - this.initData() this.currOpType="edit"; this.$emit('submit',this.editForm);// @submit="afterAddSubmit" } diff --git a/src/views/xm/core/xmProjectGroup/XmProjectGroupMng.vue b/src/views/xm/core/xmProjectGroup/XmProjectGroupMng.vue index 708fbbfd..dc170224 100644 --- a/src/views/xm/core/xmProjectGroup/XmProjectGroupMng.vue +++ b/src/views/xm/core/xmProjectGroup/XmProjectGroupMng.vue @@ -41,7 +41,6 @@ 加载下一级小组 新增下一级小组 - 新增下一级小组 @@ -178,7 +177,6 @@ - @@ -230,8 +228,11 @@ XmProductSelect, return expandedKeys; }, okrTreeData(){ - var groups=this.xmProjectGroups; + var groups=JSON.parse(JSON.stringify(this.xmProjectGroups)); groups.forEach(i=>{ + if(i.pgroupId==''){ + i.pgroupId=null; + } i.currNodeType='group' i.label=i.groupName if(i.groupUsers){ @@ -244,9 +245,9 @@ XmProductSelect, } }) var groupsTree=treeTool.translateDataToTree(groups,'pgroupId','id') - var topLabel="组织架构" + var topLabel=this.userInfo.branchName+"-组织架构" var currNodeType='branch' - var topdata={} + var topdata={id:this.userInfo.branchId,branchName:this.userInfo.branchName,branchId:this.userInfo.branchId} if(this.xmProduct&&this.xmProduct.id){ topLabel=this.xmProduct.productName+"-产品组织架构" currNodeType='product' @@ -323,6 +324,9 @@ XmProductSelect, id:'',groupName:'',projectId:'',pgTypeId:'',pgTypeName:'',leaderUserid:'',leaderUsername:'',ctime:'',ltime:'',productId:'',branchId:'',pgClass:'',pgroupId:'',lvl:'',pidPaths:'',isTpl:'',assUserid:'',assUsername:'',childrenCnt:'',userCnt:'',qxCode:'',calcWorkload:'',ntype:'',crowBranchId:'',crowBranchName:'',isCrow:'' }, + addFormInit: { + id:'',groupName:'',projectId:'',pgTypeId:'',pgTypeName:'',leaderUserid:'',leaderUsername:'',ctime:'',ltime:'',productId:'',branchId:'',pgClass:'',pgroupId:'',lvl:'',pidPaths:'',isTpl:'',assUserid:'',assUsername:'',childrenCnt:'',userCnt:'',qxCode:'',calcWorkload:'',ntype:'',crowBranchId:'',crowBranchName:'',isCrow:'' + }, editFormVisible: false,//编辑界面是否显示 editForm: { id:'',groupName:'',projectId:'',pgTypeId:'',pgTypeName:'',leaderUserid:'',leaderUsername:'',ctime:'',ltime:'',productId:'',branchId:'',pgClass:'',pgroupId:'',lvl:'',pidPaths:'',isTpl:'',assUserid:'',assUsername:'',childrenCnt:'',userCnt:'',qxCode:'',calcWorkload:'',ntype:'',crowBranchId:'',crowBranchName:'',isCrow:'' @@ -380,7 +384,7 @@ XmProductSelect, if(this.currNodeType=='branch'||this.currNodeType=='iteration'){ params.branchId=this.editForm.branchId params.lvl=1 - }else if(this.currNodeType=='product'){ + }else if(this.currNodeType=='project'){ params.projectId=this.editForm.id params.lvl=1 }else if(this.currNodeType=='product'){ @@ -459,7 +463,8 @@ XmProductSelect, }, //显示新增界面 XmProjectGroup xm_project_group showAdd: function () { - if(this.xmProduct && this.xmProduct.id){ + this.addForm={...this.addFormInit} + if(this.currNodeType=='product'){ this.addForm.pgroupId=null this.addForm.pgroupName=null this.addForm.productId=this.xmProduct.id @@ -467,7 +472,7 @@ XmProductSelect, this.addForm.projectId=null this.addForm.groupName=this.xmProduct.productName+"-产品管理组" this.addFormVisible = true; - }else if(this.selProject && this.selProject.id){ + }else if(this.currNodeType=='project'){ this.addForm.pgroupId=null this.addForm.pgroupName=null this.addForm.productId=null @@ -482,10 +487,12 @@ XmProductSelect, //this.addForm=Object.assign({}, this.editForm); }, //显示新增界面 XmProjectGroup xm_project_group - showAddSub: function (row) { + showAddSub: function (row) { + if(!row){ return; } + this.addForm={...row} if("1"==row.pgClass){ this.addForm.productId=row.productId this.addForm.pgClass="1" @@ -710,6 +717,7 @@ XmProductSelect, }); }, onPorjectConfirm(project){ + this.addForm={...this.addFormInit} this.addForm.projectId=project.id this.addForm.groupName=project.name+"-管理小组" this.addForm.projectName=project.name @@ -718,6 +726,7 @@ XmProductSelect, this.selectProjectVisible=false; }, onProductConfirm(product){ + this.addForm={...this.addFormInit} this.addForm.productId=product.id this.addForm.groupName=product.productName+"-管理小组" this.addForm.projectName=product.productName