From 376696f0c1f4551de4a016cdb3be42e87dc665cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Fri, 11 Mar 2022 20:38:14 +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 --- .../xm/core/xmIteration/XmIterationAdd.vue | 58 ++++++------------- 1 file changed, 18 insertions(+), 40 deletions(-) diff --git a/src/views/xm/core/xmIteration/XmIterationAdd.vue b/src/views/xm/core/xmIteration/XmIterationAdd.vue index eaad32e3..f735cd49 100644 --- a/src/views/xm/core/xmIteration/XmIterationAdd.vue +++ b/src/views/xm/core/xmIteration/XmIterationAdd.vue @@ -4,7 +4,8 @@ - + + 格式如下: 上线日期+主题+V版本号 例如: 2021.6.15购书商城V1.0.9 @@ -56,23 +57,11 @@ this.addForm = xmIteration; }, 'visible':function(visible) { - if(visible==true){ - if(this.parentIteration){ - this.addForm=Object.assign(this.addForm, this.parentIteration); - this.addForm.id=""; - this.addForm.pid=this.parentIteration.id - this.addForm.branchId=this.userInfo.branchId - this.cuserid=this.userInfo.userid - this.cusername=this.userInfo.username - if(this.parentIteration){ - if(this.parentIteration.children){ - this.addForm.seqNo=this.parentIteration.seqNo+"."+(this.parentIteration.children.length+1) - }else{ - this.addForm.seqNo=this.parentIteration.seqNo+"."+1 - } - - } - } + if(visible==true){ + this.addForm.cuserid=this.userInfo.userid + this.addForm.cusername=this.userInfo.username + this.addForm.adminUserid=this.userInfo.userid + this.addForm.adminUsername=this.userInfo.username; } } }, @@ -82,10 +71,11 @@ load:{ list: false, edit: false, del: false, add: false },//查询中... addFormRules: { iterationName: [ - { required: true, message: '迭代名称不能为空', trigger: 'blur' } + { required: true, message: '迭代名称不能为空', trigger: 'change' }, + { min:10, message: '名称长度必须大于10个字符', trigger: 'change' } ], seqNo: [ - { required: true, message: '序号不能为空', trigger: 'blur' } + { required: true, message: '序号不能为空', trigger: 'change' } ] }, //新增界面数据 迭代定义 @@ -103,7 +93,7 @@ this.$emit('cancel'); }, //新增提交XmIteration 迭代定义 父组件监听@submit="afterAddSubmit" - addSubmit: function () { + addSubmit: function () { this.$refs.addForm.validate((valid) => { if (valid) { var links=[]; @@ -127,6 +117,8 @@ this.$notify({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); }).catch( err => this.load.add=false); }); + }else{ + this.$notify({showClose: true, message: "表单验证不通过", type: 'error' }); } }); }, @@ -151,25 +143,11 @@ }, mounted() { - this.addForm=Object.assign(this.addForm, this.xmIteration); - if(this.parentIteration){ - this.addForm=Object.assign(this.addForm, this.parentIteration); - this.addForm.id=""; - this.addForm.pid=this.parentIteration.id - this.addForm.branchId=this.userInfo.branchId - this.cuserid=this.userInfo.userid - this.cusername=this.userInfo.username - - - if(this.parentIteration){ - if(this.parentIteration.children){ - this.addForm.seqNo=this.parentIteration.seqNo+"."+(this.parentIteration.children.length+1) - }else{ - this.addForm.seqNo=this.parentIteration.seqNo+"."+1 - } - - } - } + this.addForm=Object.assign(this.addForm, this.xmIteration); + this.addForm.cuserid=this.userInfo.userid + this.addForm.cusername=this.userInfo.username + this.addForm.adminUserid=this.userInfo.userid + this.addForm.adminUsername=this.userInfo.username; /**在下面写其它函数***/ }//end mounted