diff --git a/src/views/xm/core/xmMenu/XmMenuAdd.vue b/src/views/xm/core/xmMenu/XmMenuAdd.vue index 6778f6ce..9883d93f 100644 --- a/src/views/xm/core/xmMenu/XmMenuAdd.vue +++ b/src/views/xm/core/xmMenu/XmMenuAdd.vue @@ -149,28 +149,25 @@ 'userInfo','roles' ]) }, - props:['xmMenu','visible','parentMenu','product'], + props:['xmMenu','visible','parentMenu'], watch: { 'xmMenu':function( xmMenu ) { - this.addForm = xmMenu; + this.addForm = {...xmMenu}; this.addForm.mmUserid=this.userInfo.userid this.addForm.mmUsername=this.userInfo.username }, 'visible':function(visible) { if(visible==true){ + debugger; + this.addForm={...this.xmMenu} if(this.parentMenu && this.parentMenu.menuId){ if(this.parentMenu.childrenCnt){ - this.addForm.seqNo=this.parentMenu.seqNo+"."+(this.parentMenu.childrenCnt.length+1) + this.addForm.seqNo=this.parentMenu.seqNo+"."+(this.parentMenu.childrenCnt+1) }else{ this.addForm.seqNo=this.parentMenu.seqNo+"."+1 } } - if(this.product && this.product.id){ - this.addForm.productId=this.product.id - this.addForm.productName=this.product.productName - } - //从新打开页面时某些数据需要重新加载,可以在这里添加 } } }, @@ -211,7 +208,7 @@ }, //新增提交XmMenu 项目需求表 父组件监听@submit="afterAddSubmit" addSubmit: function () { - if(this.parentMenu==null && this.product ==null ){ + if(this.addForm.productId==null){ this.$notify({showClose: true, message: '请选择产品/或者上级需求进行新增', type:'error' }); return; } @@ -228,8 +225,6 @@ if(this.parentMenu!=null){ params.productId=this.parentMenu.productId params.pmenuId=this.parentMenu.menuId - }else if(this.product){ - params.productId=this.product.id } if(params.productId==null|| params.productId==''){ this.$notify({showClose: true, message: '产品编号不能为空', type:'error' }); @@ -301,10 +296,6 @@ this.addForm=Object.assign(this.addForm, this.xmMenu); this.addForm.mmUserid=this.userInfo.userid this.addForm.mmUsername=this.userInfo.username - if(this.product){ - this.addForm.productId=this.product.id - this.addForm.productName=this.product.productName - } this.addForm.remark="作为 ,我需要 ,以便我能够 。" if(this.parentMenu){ if(this.parentMenu.childrenCnt){ diff --git a/src/views/xm/core/xmMenu/XmMenuMng.vue b/src/views/xm/core/xmMenu/XmMenuMng.vue index fee90b8a..a1e5ba16 100644 --- a/src/views/xm/core/xmMenu/XmMenuMng.vue +++ b/src/views/xm/core/xmMenu/XmMenuMng.vue @@ -9,7 +9,7 @@ width="400" trigger="manual" v-model="productVisible"> - + {{filters.product?filters.product.productName:'选择产品'}} @@ -75,7 +75,7 @@ 批量修改 更换上级 - 删除 + 删除 汇总进度 - + @@ -601,13 +601,27 @@ }, //显示新增界面 XmMenu xm_project_menu showAdd: function () { - this.parentMenu=null; - this.addFormVisible = true; + if(this.filters.product && this.filters.product.id){ + this.parentMenu=null; + this.addForm.productId=this.filters.product.id + this.addForm.productName=this.filters.product.productName + this.addFormVisible = true; + }else{ + this.productVisible=true; + this.$notify({showClose: true, message: "请先选择一个产品", type: 'error'}); + } + //this.addForm=Object.assign({}, this.editForm); }, showSubAdd:function(row){ this.editForm=row this.parentMenu=row + this.addForm.productId=row.productId + if(this.filters.product && row.productId==this.filters.product.id){ + this.addForm.productName=this.filters.product.productName + }else{ + this.addForm.productName=null; + } this.addFormVisible=true }, showProdcutAdd:function(){ @@ -676,7 +690,11 @@ }, //批量删除xmMenu batchDel: function () { - this.$confirm('确认删除选中记录吗?', '提示', { + if(this.sels.length==0){ + this.$notify({showClose: true, message: "请先选择要删除的需求或者需求池", type: 'error'}); + return; + } + this.$confirm('确认删除选中的'+this.sels.length+'条数据吗?删除后数据不可恢复', '提示', { type: 'warning' }).then(() => { this.load.del=true; diff --git a/src/views/xm/core/xmProduct/XmProductSelect.vue b/src/views/xm/core/xmProduct/XmProductSelect.vue index c08cf759..a8b06604 100644 --- a/src/views/xm/core/xmProduct/XmProductSelect.vue +++ b/src/views/xm/core/xmProduct/XmProductSelect.vue @@ -8,12 +8,12 @@