From d6de00e36a058034d0e0c01c5a23377efa8aa317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Tue, 17 Jan 2023 17:28:59 +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 --- .../XmIterationOverviewComplex.vue | 43 ++++++++++++++++++- src/views/xm/core/xmIteration/top-nav.vue | 2 + .../xmProduct/XmProductOverviewComplex.vue | 40 ++++------------- .../xmProject/XmProjectOverviewComplex.vue | 20 ++++++++- 4 files changed, 70 insertions(+), 35 deletions(-) diff --git a/src/views/xm/core/xmIteration/XmIterationOverviewComplex.vue b/src/views/xm/core/xmIteration/XmIterationOverviewComplex.vue index 7650f13b..6d3312b6 100644 --- a/src/views/xm/core/xmIteration/XmIterationOverviewComplex.vue +++ b/src/views/xm/core/xmIteration/XmIterationOverviewComplex.vue @@ -317,7 +317,8 @@ import XmIterationEdit from './XmIterationEdit.vue'; import XmIterationMenuMng from '../xmIterationMenu/XmIterationMenuMng.vue'; import { loadTasksToXmIterationState } from '@/api/xm/core/xmIterationState'; import { listXmIterationWithState } from "@/api/xm/core/xmIteration"; -import {initDicts, } from '@/api/xm/core/xmIteration'; +import {initDicts,editSomeFieldsXmIteration } from '@/api/xm/core/xmIteration'; +import store from '@/store' export default { components: {XmIterationOverview,XmIterationEdit, XmIterationMenuMng }, @@ -350,6 +351,14 @@ export default { }, methods:{ + jumpTo(name){ + this.$router.push({ + name:name, + query:{ + iterationId:this.xmIteration.id + } + }) + }, loadTasksToXmIterationState(){ this.load.edit=true; loadTasksToXmIterationState({id:this.xmIteration.id}).then(res=>{ @@ -374,7 +383,23 @@ export default { onEditFields(row){ Object.assign(this.xmIteration,row) this.$emit('edit-fields',row) - } + }, + editSomeFields(row,fieldName,$event){ + let params={}; + params['ids']=[row].map(i=>i.id) + params[fieldName]=$event + var func = editSomeFieldsXmIteration + func(params).then(res=>{ + let tips = res.data.tips; + if(tips.isOk){ + Object.assign(row,params) + store.dispatch("setXmIteration",row) + this.$emit('edit-fields',params) + }else{ + this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) + } + }).catch((e)=>Object.assign(this.editForm,this.editFormBak)) + }, }, mounted() { @@ -387,5 +412,19 @@ export default { diff --git a/src/views/xm/core/xmIteration/top-nav.vue b/src/views/xm/core/xmIteration/top-nav.vue index 7ab31425..61a58a44 100644 --- a/src/views/xm/core/xmIteration/top-nav.vue +++ b/src/views/xm/core/xmIteration/top-nav.vue @@ -45,9 +45,11 @@ > + 需求 diff --git a/src/views/xm/core/xmProduct/XmProductOverviewComplex.vue b/src/views/xm/core/xmProduct/XmProductOverviewComplex.vue index 9a348621..38efc811 100644 --- a/src/views/xm/core/xmProduct/XmProductOverviewComplex.vue +++ b/src/views/xm/core/xmProduct/XmProductOverviewComplex.vue @@ -254,6 +254,7 @@ import TaskMng from '@/views/mdp/workflow/ru/task/TaskMng'; import ProcinstMng from '@/views//mdp/workflow/hi/procinst/ProcinstMng'; import { initDicts,editXmProductSomeFields } from "@/api/xm/core/xmProduct"; +import store from '@/store' export default { components: { XmProductOverview, XmProductEdit, XmProductProjectLinkMng,TaskMng,ProcinstMng,}, @@ -372,47 +373,22 @@ export default { }, - editXmProductSomeFields(row,fieldName,$event){ - var that=this; + editXmProductSomeFields(row,fieldName,$event){ var func=(params)=>{ editXmProductSomeFields(params).then(res=>{ var tips = res.data.tips; if(tips.isOk){ this.$emit('edit-fields',params) - Object.assign(row,params) - this.xmProductBak=Object.assign({},row) - }else{ - Object.assign(this.xmProduct,this.xmProductBak) + Object.assign(row,params) + store.dispatch("setXmProduct",row) + }else{ this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) } }) } - var params={ids:[row.id]}; - - params[fieldName]=$event - - - if(fieldName=='description'){ - this.$refs.xmProduct.validateField('description',err=>{ - if(err){ - this.$notify({position:'bottom-left',showClose:true,message: err,type: 'error'}) - return; - }else{ - func(params) - } - }) - }else if(fieldName=='name'){ - this.$refs.xmProduct.validateField('name',err=>{ - if(err){ - this.$notify({position:'bottom-left',showClose:true,message: err,type: 'error'}) - return; - }else{ - func(params) - } - }) - }else{ - func(params) - } + var params={ids:[row.id]}; + params[fieldName]=$event + func(params) }, }, diff --git a/src/views/xm/core/xmProject/XmProjectOverviewComplex.vue b/src/views/xm/core/xmProject/XmProjectOverviewComplex.vue index 2e5512a1..4c8b4d46 100644 --- a/src/views/xm/core/xmProject/XmProjectOverviewComplex.vue +++ b/src/views/xm/core/xmProject/XmProjectOverviewComplex.vue @@ -306,7 +306,25 @@ export default { this.$nextTick(()=>{ this.$refs['xmProductComplex'].addProductVisible=true }) - } + }, + editXmProjectSomeFields(row,fieldName,$event){ + var that=this; + var func=(params)=>{ + editXmProjectSomeFields(params).then(res=>{ + var tips = res.data.tips; + if(tips.isOk){ + this.$emit('edit-fields',params) + Object.assign(row,params) + store.dispathc("setProjectInfo",row) + }else{ + this.$notify({position:'bottom-left',showClose:true,message:tips.msg,type:tips.isOk?'success':'error'}) + } + }) + } + var params={ids:[row.id]}; + params[fieldName]=$event + func(params) + }, }, mounted() {