From 2a560d9a00eb053583e5ecc2dce349a25ec03984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Sat, 23 Jul 2022 15:40:02 +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/XmIterationEdit.vue | 51 ++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) diff --git a/src/views/xm/core/xmIteration/XmIterationEdit.vue b/src/views/xm/core/xmIteration/XmIterationEdit.vue index 7cb33da9..b469cf72 100644 --- a/src/views/xm/core/xmIteration/XmIterationEdit.vue +++ b/src/views/xm/core/xmIteration/XmIterationEdit.vue @@ -3,6 +3,7 @@ + 迭代编号:{{editForm.id}}   归属产品:{{editForm.productName?editForm.productName:editForm.productId}} @@ -68,19 +69,43 @@ } } }, - props:['xmIteration','visible','opType'], + props:['xmIteration','visible','opType','xmProduct'], watch: { 'xmIteration':{ handler(){ - this.editForm=Object.assign(this.editForm, this.xmIteration); - this.editFormBak={...this.editForm} + this.initData(); }, deep:true, }, 'visible':function(visible) { if(visible==true){ + this.initData(); } - } + }, + 'editForm.onlineTime':function(val){ + if(!val){ + return; + } + if(this.opType!=='add'){ + return; + } + var date=val.substr(0,10) + date=date.replaceAll('-',''); + this.editForm.iterationName=date+(this.editForm.productName?this.editForm.productName:'-请修改-')+'V1.0.0' + }, + 'editForm.productName':function(val){ + var date=this.editForm.onlineTime + if(!date){ + return; + } + + if(this.opType!=='add'){ + return; + } + date=date.substr(0,10) + date=date.replaceAll('-',''); + this.editForm.iterationName=date+(this.editForm.productName?this.editForm.productName:'-请修改-')+'V1.0.0' + } }, data() { return { @@ -154,6 +179,20 @@ } }).catch((e)=>Object.assign(this.editForm,this.editFormBak)) }, + initData(){ + this.editForm=Object.assign(this.editForm, this.xmIteration); + if(this.opType==='add'){ + this.editForm.cuserid=this.userInfo.userid + this.editForm.cusername=this.userInfo.username + this.editForm.adminUserid=this.userInfo.userid + this.editForm.adminUsername=this.userInfo.username; + if(this.xmProduct && this.xmProduct.id){ + this.editForm.productId=this.xmProduct.id + this.editForm.productName=this.xmProduct.productName; + } + } + this.editFormBak={...this.editForm} + } /**end 在上面加自定义方法**/ },//end method @@ -164,8 +203,8 @@ mounted() { this.$nextTick(()=>{ initDicts(this) - this.editForm=Object.assign(this.editForm, this.xmIteration); - this.editFormBak={...this.editForm} + this.initData() + }) /**在下面写其它函数***/