diff --git a/src/views/xm/core/xmProduct/XmProductEdit.vue b/src/views/xm/core/xmProduct/XmProductEdit.vue index 388adef8..90251dbd 100644 --- a/src/views/xm/core/xmProduct/XmProductEdit.vue +++ b/src/views/xm/core/xmProduct/XmProductEdit.vue @@ -25,14 +25,26 @@ - - + + + + + - - {{editForm.pmUsername}} - 未配置 - 选产品经理 + + + + + + + + + + + + + @@ -45,7 +57,6 @@ - 取消 提交 @@ -101,10 +112,18 @@ productName: [ { required: true, message: '产品名称不能为空', trigger: 'blur' } + ], + + code: [ + { required: true, message: '产品代号不能为空', trigger: 'change' } ], pmUserid: [ - { required: true, message: '产品经理不能为空', trigger: 'blur' } + { required: true, message: '产品经理不能为空', trigger: 'change' } + ], + + admUserid: [ + { required: true, message: '产品总监不能为空', trigger: 'change' } ] }, //新增界面数据 产品表 @@ -124,11 +143,7 @@ this.$emit('cancel'); }, //新增提交XmProduct 产品表 父组件监听@submit="afterAddSubmit" - editSubmit: function () { - if(this.userInfo.userid!=this.editForm.pmUserid){ - this.$notify({showClose: true, message: "你不是该产品负责人,不能修改产品信息", type: 'error' }); - return; - } + editSubmit: function () { this.$refs.editForm.validate((valid) => { if (valid) { @@ -149,30 +164,31 @@ } }); }, - selectUser(){ - if(!this.roles.some(i=>i.roleid=='productAdmin')){ - this.$notify({showClose: true, message: "你不是产品经理,不能修改产品负责人", type: 'error' }); - return; - } + showUserVisible(userType){ + this.currUserType=userType this.userSelectVisible=true; }, - onUserSelected(users){ + //选择人员 + onUserSelected: function(users) { + this.userSelectVisible = false; + var user={userid:'',username:''}; if(users && users.length>0){ - this.editForm.pmUserid=users[0].userid - this.editForm.pmUsername=users[0].username + user=users[0] } - this.userSelectVisible=false - }, - clearPmUser:function(){ - if(!this.roles.some(i=>i.roleid=='productAdmin')){ - this.$notify({showClose: true, message: "你不是产品经理,不能修改产品负责人", type: 'error' }); - return; + + if(this.currUserType=='admUserid'){ + this.addForm.admUserid=user.userid + this.addForm.admUsername=user.username + }else if(this.currUserType=='assUserid'){ + this.addForm.assUserid=user.userid + this.addForm.assUsername=user.username + }else if(this.currUserType=='pmUserid'){ + this.addForm.pmUserid=user.userid + this.addForm.pmUsername=user.username } - this.editForm.pmUserid='' - this.editForm.pmUsername='' - } - /**begin 在下面加自定义方法,记得补上面的一个逗号**/ + this.currUserType=""; + }, /**end 在上面加自定义方法**/ },//end method