From 0591952ac68e99d88bc73d96e0869bf8ee216e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Wed, 2 Mar 2022 08:33:11 +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 --- .../xmProjectGroup/XmProjectGroupSelect.vue | 77 +++++++++++++------ .../xm/core/xmQuestion/XmQuestionAdd.vue | 2 +- 2 files changed, 55 insertions(+), 24 deletions(-) diff --git a/src/views/xm/core/xmProjectGroup/XmProjectGroupSelect.vue b/src/views/xm/core/xmProjectGroup/XmProjectGroupSelect.vue index a2dda7ac..24e9a0b9 100644 --- a/src/views/xm/core/xmProjectGroup/XmProjectGroupSelect.vue +++ b/src/views/xm/core/xmProjectGroup/XmProjectGroupSelect.vue @@ -1,22 +1,27 @@ @@ -39,6 +49,7 @@ import XmProjectList from '../xmProject/XmProjectList'; import {mapGetters} from 'vuex' +import XmProductSelect from '../xmProduct/XmProductSelect.vue'; export default { computed: { @@ -47,7 +58,7 @@ ]) }, // - props: ['visible','selProject','isSelectSingleUser','isSelectMultiUser'], + props: ['visible','selProject','isSelectSingleUser','isSelectMultiUser','xmProduct'], watch: { "selGroups": function(selGroups) { if(this.selGroups){ @@ -69,6 +80,9 @@ }, selProject(selProject){ this.filters.selProject=selProject + }, + xmProduct(xmProduct){ + this.filters.xmProduct=this.xmProduct } }, @@ -78,6 +92,7 @@ filters: { key: '', selProject:null, + xmProduct:null, }, selGroups:[], load: {list: false,edit: false,del: false,add: false}, //查询中... @@ -89,6 +104,7 @@ /**begin 自定义属性请在下面加 请加备注**/ xmProjectGroupFormworkSels: [], selectProjectVisible:false, + selectProductVisible:false, /**end 自定义属性请在上面加 请加备注**/ } }, //end data @@ -135,14 +151,19 @@ var params={}; if(this.filters.selProject){ params.projectId=this.filters.selProject.id - }else{ - this.selectProjectVisible=true; - this.$notify({showClose: true, - message: '请选中项目', - type: 'success' - }); + } + if(this.filters.xmProduct && this.filters.xmProduct.id){ + params.productId=this.filters.xmProduct.id + } + if(!params.projectId && !params.productId){ + this.$notify({showClose:true,message:'产品团队或者项目团队最少选中一个',type:'error'}) return; } + + if(params.projectId && params.productId){ + params.productId=null + this.$notify({showClose:true,message:'产品团队或者项目团队只能选中一个,两个都选以项目团队为准',type:'warning'}) + } getGroups(params).then(res=>{ var tips = res.data.tips; if(tips.isOk){ @@ -155,16 +176,24 @@ onPorjectConfirm:function(project){ this.filters.selProject=project + this.filters.xmProduct=null; this.selectProjectVisible=false; this.getGroups(); }, + + onProductConfirm:function(product){ + this.filters.xmProduct=product + this.filters.selProject=null + this.selectProductVisible=false; + this.getGroups(); + }, /**end 自定义函数请在上面加**/ }, //end methods components: { - XmProjectList + XmProjectList,XmProductSelect }, mounted() { this.$nextTick(() => { @@ -179,18 +208,20 @@ if(this.selProject){ this.filters.selProject=this.selProject } - this.getGroups(); - listOption([{categoryId:'all',itemCode:'projectGroupType'}] ).then(res=>{ - if(res.data.tips.isOk){ - this.options['projectGroupType']=res.data.data.projectGroupType - } - }); + + if(this.xmProduct){ + this.filters.xmProduct=this.xmProduct + } + this.getGroups(); }); } }