diff --git a/src/views/xm/core/xmProduct/XmProductOverviewComplex.vue b/src/views/xm/core/xmProduct/XmProductOverviewComplex.vue index a7bd13e9..bf624298 100644 --- a/src/views/xm/core/xmProduct/XmProductOverviewComplex.vue +++ b/src/views/xm/core/xmProduct/XmProductOverviewComplex.vue @@ -1,6 +1,195 @@ @@ -61,21 +252,50 @@ import { listXmProductWithState } from '@/api/xm/core/xmProduct'; import { loadTasksToXmMenuState} from '@/api/xm/core/xmMenuState'; 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"; + export default { components: { XmProductOverview, XmProductEdit, XmProductProjectLinkMng,TaskMng,ProcinstMng,}, computed: { ...mapGetters(["userInfo","xmProduct"]), + calcProductPstatusStep() { + if (this.dicts["xmProductPstatus"] && this.xmProduct) { + var index = this.dicts["xmProductPstatus"].findIndex((i) => { + if (i.id == this.xmProduct.pstatus) { + return true; + } else { + return false; + } + }); + return index + 1; + } else { + return 0; + } + }, }, watch:{ }, data() { return { + + dicts:{xmProductPstatus:[]}, + maxTableHeight:500, showPanelName:'overview', load:{calcProduct:false,calcMenu:false} }; }, methods:{ + + jumpTo(name){ + this.$router.push({ + name:name, + query:{ + productId:this.xmProduct.id + } + }) + }, loadTasksToXmProductState: function () { this.load.calcProduct=true; @@ -115,11 +335,92 @@ export default { }, onMenuToolBarSelect(menuIndex){ this.showPanelName=menuIndex; - } + }, + showCurrFlow() { + this.showPanelName = "currFlow"; + }, + showHisFlow() { + this.showPanelName = "hisFlow"; + }, + showDetail() { + this.showPanelName = "detail"; + }, + showProjectGaiSuan() { + this.showPanelName = "detail"; + this.$nextTick(() => { + this.$refs[ + "projectEdit" + ].currTabPane = "4"; + }); + }, + showProjectShouYi() { + this.showPanelName = "detail"; + this.$nextTick(() => { + this.$refs[ + "projectEdit" + ].currTabPane = "5"; + }); + }, + linkProject() { + this.showPanelName = "productProjectLink"; + }, + createProduct() { + this.infotype = "产品"; + this.$nextTick(() => { + this.addProductVisible = true; + }); + }, + + + editXmProductSomeFields(row,fieldName,$event){ + var that=this; + 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) + 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) + } + }, }, mounted() { + initDicts(this) this.$nextTick(() => { + + this.maxTableHeight = util.calcTableMaxHeight(this.$refs.pageBody.$el); }); }, @@ -128,4 +429,21 @@ export default { diff --git a/src/views/xm/core/xmProduct/top-nav.vue b/src/views/xm/core/xmProduct/top-nav.vue index 29c28776..44dfcc73 100644 --- a/src/views/xm/core/xmProduct/top-nav.vue +++ b/src/views/xm/core/xmProduct/top-nav.vue @@ -47,7 +47,7 @@ - 项目 + 项目 需求 @@ -120,139 +120,19 @@ 客服 - + 回到项目列表页回到产品列表页 - + 首页 - - + @@ -298,32 +178,7 @@ export default { methods: { setInfotype(infotype) { this.infotype = infotype; - }, - /** - * 防止禁用弹框 _self模式 - * @param {} url - */ - newWin(url) { - var id='toOpenWindow' - var a = document.createElement('a'); - a.setAttribute('href', url); - a.setAttribute('target', '_self'); - a.setAttribute('id', id); - // 防止反复添加 - if(!document.getElementById(id)) document.body.appendChild(a); - a.click(); - }, - toForum(){ - this.newWin('https://www.maimengcloud.com/#/communityForum'); - }, - goBack() { - this.$router.push({ - path:'/xm/core/xmProduct/XmProductMng' - }) - }, - goHome(){ - this.$router.push({path:'/'}) - }, + }, }, //end methods components: { diff --git a/src/views/xm/core/xmProject/XmProjectOverviewComplex.vue b/src/views/xm/core/xmProject/XmProjectOverviewComplex.vue index 41cab4fd..5db8cf07 100644 --- a/src/views/xm/core/xmProject/XmProjectOverviewComplex.vue +++ b/src/views/xm/core/xmProject/XmProjectOverviewComplex.vue @@ -311,8 +311,9 @@ export default { mounted() { - this.maxTableHeight = util.calcTableMaxHeight(this.$refs.pageBody.$el); + this.$nextTick(() => { + this.maxTableHeight = util.calcTableMaxHeight(this.$refs.pageBody.$el); }); }, diff --git a/src/views/xm/core/xmProject/top-nav.vue b/src/views/xm/core/xmProject/top-nav.vue index 0c52e197..16aaefbe 100644 --- a/src/views/xm/core/xmProject/top-nav.vue +++ b/src/views/xm/core/xmProject/top-nav.vue @@ -117,12 +117,12 @@ 客服 - + 回到项目列表页 - + 首页 @@ -296,32 +296,7 @@ export default { methods: { setInfotype(infotype) { this.infotype = infotype; - }, - /** - * 防止禁用弹框 _self模式 - * @param {} url - */ - newWin(url) { - var id='toOpenWindow' - var a = document.createElement('a'); - a.setAttribute('href', url); - a.setAttribute('target', '_self'); - a.setAttribute('id', id); - // 防止反复添加 - if(!document.getElementById(id)) document.body.appendChild(a); - a.click(); - }, - toForum(){ - this.newWin('https://www.maimengcloud.com/#/communityForum'); - }, - goBack() { - this.$router.push({ - path:'/xm/core/xmProject/XmProjectMng' - }) - }, - goHome(){ - this.$router.push({path:'/'}) - }, + }, }, //end methods components: {