From 531eda898dc5cf69a4048069b3045dcbf3362987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=A3=95=E8=B4=A2?= Date: Sun, 18 Jul 2021 18:36:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=A7=E5=93=81=E8=AF=95?= =?UTF-8?q?=E5=9B=BE=E3=80=81=E8=BF=AD=E4=BB=A3=E8=AF=95=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/xm/core/xmIterationProductLink.js | 30 +++ src/api/xm/core/xmProductProjectLink.js | 30 +++ .../xm/core/xmIteration/XmIterationAdd.vue | 2 +- .../xm/core/xmIteration/XmIterationMng.vue | 105 ++++++-- .../xm/core/xmIteration/XmIterationSelect.vue | 3 + .../XmIterationProductLinkAdd.vue | 123 +++++++++ .../XmIterationProductLinkEdit.vue | 118 ++++++++ .../XmIterationProductLinkMng.vue | 252 ++++++++++++++++++ src/views/xm/core/xmProduct/XmProductAdd.vue | 2 +- .../xm/core/xmProduct/XmProductComplex.vue | 6 +- src/views/xm/core/xmProduct/XmProductMng.vue | 103 +++++-- .../xm/core/xmProduct/XmProductSelect.vue | 5 + .../XmProductProjectLinkAdd.vue | 123 +++++++++ .../XmProductProjectLinkEdit.vue | 118 ++++++++ .../XmProductProjectLinkMng.vue | 252 ++++++++++++++++++ 15 files changed, 1213 insertions(+), 59 deletions(-) create mode 100644 src/api/xm/core/xmIterationProductLink.js create mode 100644 src/api/xm/core/xmProductProjectLink.js create mode 100644 src/views/xm/core/xmIterationProductLink/XmIterationProductLinkAdd.vue create mode 100644 src/views/xm/core/xmIterationProductLink/XmIterationProductLinkEdit.vue create mode 100644 src/views/xm/core/xmIterationProductLink/XmIterationProductLinkMng.vue create mode 100644 src/views/xm/core/xmProductProjectLink/XmProductProjectLinkAdd.vue create mode 100644 src/views/xm/core/xmProductProjectLink/XmProductProjectLinkEdit.vue create mode 100644 src/views/xm/core/xmProductProjectLink/XmProductProjectLinkMng.vue diff --git a/src/api/xm/core/xmIterationProductLink.js b/src/api/xm/core/xmIterationProductLink.js new file mode 100644 index 00000000..bfbd5166 --- /dev/null +++ b/src/api/xm/core/xmIterationProductLink.js @@ -0,0 +1,30 @@ +import axios from '@/utils/request' + +import config from '@/common/config' + +let base = config.getCoreBasePath(); + + +/** + * 迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 + *1 默认只开放普通查询,所有查询,只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, + *2 查询、新增、修改的参数格式 params={iterationId:'迭代表主键 主键',productId:'产品表主键 主键',ctime:'创建时间',cuserid:'创建人编号',cusername:'创建人姓名',linkStatus:'关联状态1关联0取消关联'} + **/ + +//普通查询 条件之间and关系 +export const listXmIterationProductLink = params => { return axios.get(`${base}/xm/core/xmIterationProductLink/list`, { params: params }); }; + +//模糊查询迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 条件之间or关系 +//export const listXmIterationProductLinkKey = params => { return axios.get(`${base}/xm/core/xmIterationProductLink/listKey`, { params: params }); }; + +//删除一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 params={iterationId:'迭代表主键 主键',productId:'产品表主键 主键'} +export const delXmIterationProductLink = params => { return axios.post(`${base}/xm/core/xmIterationProductLink/del`,params); }; + +//批量删除迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 params=[{iterationId:'迭代表主键 主键',productId:'产品表主键 主键'}] +export const batchDelXmIterationProductLink = params => { return axios.post(`${base}/xm/core/xmIterationProductLink/batchDel`, params); }; + +//修改一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表记录 +export const editXmIterationProductLink = params => { return axios.post(`${base}/xm/core/xmIterationProductLink/edit`, params); }; + +//新增一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 +export const addXmIterationProductLink = params => { return axios.post(`${base}/xm/core/xmIterationProductLink/add`, params); }; \ No newline at end of file diff --git a/src/api/xm/core/xmProductProjectLink.js b/src/api/xm/core/xmProductProjectLink.js new file mode 100644 index 00000000..8528b1c2 --- /dev/null +++ b/src/api/xm/core/xmProductProjectLink.js @@ -0,0 +1,30 @@ +import axios from '@/utils/request' + +import config from '@/common/config' + +let base = config.getCoreBasePath(); + + +/** + * 产品与项目的关联关系表,一般由产品经理挂接项目到产品上 + *1 默认只开放普通查询,所有查询,只要上传 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】},后台都会自动按分页查询 其它 api用到再打开,没用到的api请注释掉, + *2 查询、新增、修改的参数格式 params={projectId:'项目表中的主键 主键',productId:'产品表中的主键 主键',ctime:'创建时间',cuserid:'创建人编号',cusername:'创建人姓名',linkStatus:'关联状态1关联0取消关联'} + **/ + +//普通查询 条件之间and关系 +export const listXmProductProjectLink = params => { return axios.get(`${base}/xm/core/xmProductProjectLink/list`, { params: params }); }; + +//模糊查询产品与项目的关联关系表,一般由产品经理挂接项目到产品上 条件之间or关系 +//export const listXmProductProjectLinkKey = params => { return axios.get(`${base}/xm/core/xmProductProjectLink/listKey`, { params: params }); }; + +//删除一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上 params={projectId:'项目表中的主键 主键',productId:'产品表中的主键 主键'} +export const delXmProductProjectLink = params => { return axios.post(`${base}/xm/core/xmProductProjectLink/del`,params); }; + +//批量删除产品与项目的关联关系表,一般由产品经理挂接项目到产品上 params=[{projectId:'项目表中的主键 主键',productId:'产品表中的主键 主键'}] +export const batchDelXmProductProjectLink = params => { return axios.post(`${base}/xm/core/xmProductProjectLink/batchDel`, params); }; + +//修改一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上记录 +export const editXmProductProjectLink = params => { return axios.post(`${base}/xm/core/xmProductProjectLink/edit`, params); }; + +//新增一条产品与项目的关联关系表,一般由产品经理挂接项目到产品上 +export const addXmProductProjectLink = params => { return axios.post(`${base}/xm/core/xmProductProjectLink/add`, params); }; \ No newline at end of file diff --git a/src/views/xm/core/xmIteration/XmIterationAdd.vue b/src/views/xm/core/xmIteration/XmIterationAdd.vue index e3c81d30..a8db034e 100644 --- a/src/views/xm/core/xmIteration/XmIterationAdd.vue +++ b/src/views/xm/core/xmIteration/XmIterationAdd.vue @@ -128,7 +128,7 @@ var tips=res.data.tips; if(tips.isOk){ this.$refs['addForm'].resetFields(); - this.$emit('submit');// @submit="afterAddSubmit" + this.$emit('submit',res.data.data);// @submit="afterAddSubmit" } this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); }).catch( err => this.load.add=false); diff --git a/src/views/xm/core/xmIteration/XmIterationMng.vue b/src/views/xm/core/xmIteration/XmIterationMng.vue index c1114d8e..2342fdb1 100644 --- a/src/views/xm/core/xmIteration/XmIterationMng.vue +++ b/src/views/xm/core/xmIteration/XmIterationMng.vue @@ -26,7 +26,9 @@ title="" width="400" trigger="click" > + 查询条件 + 迭代查询范围: @@ -68,6 +70,12 @@ 甘特图 + 更多操作 + + + 将更多迭代加入产品{{xmProduct.productName}} + + @@ -93,13 +101,8 @@ @@ -120,6 +123,10 @@ + + + + @@ -129,12 +136,15 @@ import config from '@/common/config';//全局公共库 import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 import { listXmIteration,listXmIterationWithState, delXmIteration, batchDelXmIteration,loadTasksToXmIterationState } from '@/api/xm/core/xmIteration'; + import { addXmIterationProductLink,delXmIterationProductLink } from '@/api/xm/core/xmIterationProductLink'; + import XmIterationAdd from './XmIterationAdd';//新增界面 import XmIterationEdit from './XmIterationEdit';//修改界面 import XmIterationStateMng from '../xmIterationState/XmIterationStateMng';//修改界面 import XmGantt from '../components/xm-gantt'; import { mapGetters } from 'vuex' +import XmIterationSelect from './XmIterationSelect.vue'; export default { computed: { @@ -146,12 +156,18 @@ return this.translateDataToTree(this.xmIterations); }, }, - props:['productId','menuId','visible'], + props:['xmProduct','selProject','menuId','visible'], watch:{ visible:function(visible){ if(visible==true){ this.getXmIterations(); } + }, + xmProduct:function(){ + this.getXmIterations(); + }, + selProject:function(){ + this.getXmIterations(); } }, data() { @@ -207,17 +223,18 @@ /**begin 自定义属性请在下面加 请加备注**/ valueChangeRows:[], parentIteration:null, - iterationStateVisible:false, - gstcVisible:false, - tableHeight:300, - ganrrColumns: { - children: 'children', - name: 'iterationName', - id: 'id', - pid: 'pid', - startDate: 'startTime', - endDate: 'endTime', - } + iterationStateVisible:false, + iterationSelectVisible:false, + gstcVisible:false, + tableHeight:300, + ganrrColumns: { + children: 'children', + name: 'iterationName', + id: 'id', + pid: 'pid', + startDate: 'startTime', + endDate: 'endTime', + } /**end 自定义属性请在上面加 请加备注**/ } },//end data @@ -270,13 +287,16 @@ if(this.filters.key){ params.key= "%"+this.filters.key+"%" } - if(this.productId){ - params.productId=this.productId + if(this.xmProduct){ + params.productId=this.xmProduct.id + } + if(this.selProject){ + params.projectId=this.selProject.id } if(this.menuId){ params.menuId=this.menuId } - if( !this.menuId && !this.productId ){ + if( !this.menuId && !this.xmProduct && !this.selProject){ params.queryScope=this.filters.queryScope if(this.filters.queryScope=='iterationId'){ if(!this.filters.id){ @@ -329,10 +349,14 @@ this.addFormVisible = true; //this.addForm=Object.assign({}, this.editForm); }, - afterAddSubmit(){ + afterAddSubmit(xmIteration){ this.addFormVisible=false; this.pageInfo.count=true; - this.getXmIterations(); + if(this.xmProduct){//如果是产品试图界面添加的迭代,直接添加产品与迭代的关联关系 + this.onXmIterationSelect(xmIteration); + }else{ + this.getXmIterations(); + } }, afterEditSubmit(){ this.editFormVisible=false; @@ -467,13 +491,42 @@ return cellValue; } }, - /**end 自定义函数请在上面加**/ - + onXmIterationSelect:function(row){ + var xmIteration=row; + var xmProduct=this.xmProduct; + this.$confirm('确认将产品【'+xmProduct.productName+'】加入迭代计划【'+xmIteration.iterationName+'】吗?', '提示', { + type: 'warning' + }).then(()=>{ + addXmIterationProductLink({iterationId:xmIteration.id,productId:xmProduct.id}).then(res=>{ + var tips =res.data.tips; + if(tips.isOk){ + this.getXmIterations(); + } + this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'}); + }) + }) + }, + doDelXmIterationProductLink(row){ + var xmIteration=row; + var xmProduct=this.xmProduct; + this.$confirm('确认将产品【'+xmProduct.productName+'】与迭代【'+xmIteration.iterationName+'】进行脱钩吗?脱钩后,产品与迭代互相查看不到对方信息。', '提示', { + type: 'warning' + }).then(()=>{ + delXmIterationProductLink({iterationId:xmIteration.id,productId:xmProduct.id}).then(res=>{ + var tips =res.data.tips; + if(tips.isOk){ + this.getXmIterations(); + } + this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'}); + }) + }) + } },//end methods components: { 'xm-iteration-add':XmIterationAdd, 'xm-iteration-edit':XmIterationEdit, XmIterationStateMng,XmGantt, + XmIterationSelect, //在下面添加其它组件 }, mounted() { diff --git a/src/views/xm/core/xmIteration/XmIterationSelect.vue b/src/views/xm/core/xmIteration/XmIterationSelect.vue index d3f98edb..aa8c2ab1 100644 --- a/src/views/xm/core/xmIteration/XmIterationSelect.vue +++ b/src/views/xm/core/xmIteration/XmIterationSelect.vue @@ -98,6 +98,9 @@ this.clearSelectIteration(); this.getXmIterations(); } + }, + productId:function(){ + this.getXmIterations(); } }, data() { diff --git a/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkAdd.vue b/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkAdd.vue new file mode 100644 index 00000000..083de18a --- /dev/null +++ b/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkAdd.vue @@ -0,0 +1,123 @@ + + + + + \ No newline at end of file diff --git a/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkEdit.vue b/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkEdit.vue new file mode 100644 index 00000000..a9d9bb73 --- /dev/null +++ b/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkEdit.vue @@ -0,0 +1,118 @@ + + + + + \ No newline at end of file diff --git a/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkMng.vue b/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkMng.vue new file mode 100644 index 00000000..7ae1116e --- /dev/null +++ b/src/views/xm/core/xmIterationProductLink/XmIterationProductLinkMng.vue @@ -0,0 +1,252 @@ + + + + + \ No newline at end of file diff --git a/src/views/xm/core/xmProduct/XmProductAdd.vue b/src/views/xm/core/xmProduct/XmProductAdd.vue index d054210d..acc48624 100644 --- a/src/views/xm/core/xmProduct/XmProductAdd.vue +++ b/src/views/xm/core/xmProduct/XmProductAdd.vue @@ -108,7 +108,7 @@ var tips=res.data.tips; if(tips.isOk){ //this.$refs['addForm'].resetFields(); - this.$emit('submit');// @submit="afterAddSubmit" + this.$emit('submit',res.data.data);// @submit="afterAddSubmit" } this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error' }); }).catch( err => this.load.add=false); diff --git a/src/views/xm/core/xmProduct/XmProductComplex.vue b/src/views/xm/core/xmProduct/XmProductComplex.vue index e10121af..20035878 100644 --- a/src/views/xm/core/xmProduct/XmProductComplex.vue +++ b/src/views/xm/core/xmProduct/XmProductComplex.vue @@ -12,7 +12,7 @@ - + @@ -41,7 +41,7 @@ import util from '@/common/js/util';//全局公共库 import config from '@/common/config';//全局公共库 import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 - import XmIterationSelect from '../xmIteration/XmIterationSelect.vue' + import XmIterationMng from '../xmIteration/XmIterationMng.vue' import XmMenuMng from '../xmMenu/XmMenuMng.vue' import XmIterationStateShow from '../xmIterationState/XmIterationStateShow.vue' import { mapGetters } from 'vuex' @@ -142,7 +142,7 @@ import XmProductSelect from './XmProductSelect.vue'; },//end methods components: { //在下面添加其它组件 - XmIterationSelect, + XmIterationMng, XmMenuMng, XmIterationStateShow, XmProductMng, diff --git a/src/views/xm/core/xmProduct/XmProductMng.vue b/src/views/xm/core/xmProduct/XmProductMng.vue index 495ee313..8653e1f6 100644 --- a/src/views/xm/core/xmProduct/XmProductMng.vue +++ b/src/views/xm/core/xmProduct/XmProductMng.vue @@ -27,28 +27,16 @@ - - - - - 产品 - 将项目与产品关联 - 将迭代与产品关联 - - - + 产品 + 查询条件 - 查询条件 + 产品查询范围: @@ -107,6 +95,12 @@ 查询 + 更多操作 + + + 将更多产品加入迭代{{xmIteration.iterationName}} + + @@ -129,7 +123,7 @@ @@ -195,6 +198,7 @@ //import Sticky from '@/components/Sticky' // 粘性header组件 //import { listOption } from '@/api/mdp/meta/itemOption';//下拉框数据查询 import { listXmProduct,listXmProductWithState, delXmProduct, batchDelXmProduct } from '@/api/xm/core/xmProduct'; + import { addXmIterationProductLink,delXmIterationProductLink } from '@/api/xm/core/xmIterationProductLink'; import { loadTasksToXmProductState } from '@/api/xm/core/xmProductState'; import XmProductAdd from './XmProductAdd';//新增界面 import XmProductEdit from './XmProductEdit';//修改界面 @@ -203,8 +207,10 @@ import XmProductStateMng from '../xmProductState/XmProductStateMng';//修改界面 import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; -import XmProjectList from '../xmProject/XmProjectList.vue'; - + import XmProjectList from '../xmProject/XmProjectList.vue'; + import XmIterationSelect from '../xmIteration/XmIterationSelect.vue'; +import XmProductSelect from './XmProductSelect.vue'; + export default { props:['selProject','xmIteration'], computed: { @@ -213,7 +219,9 @@ import XmProjectList from '../xmProject/XmProjectList.vue'; ]) }, watch:{ - + selProject:function(){ + this.getXmProducts(); + }, xmIteration:function(){ this.getXmProducts(); } @@ -254,6 +262,7 @@ import XmProjectList from '../xmProject/XmProjectList.vue'; id:'',productName:'',branchId:'',remark:'' }, iterationVisible:false, + iterationSelectVisible:false, productStateVisible:false, selectFiltersPmUserVisible:false, tableHeight:300, @@ -263,6 +272,7 @@ import XmProjectList from '../xmProject/XmProjectList.vue'; ], pickerOptions: util.pickerOptions('datarange'), projectVisible:false, + productSelectVisible:false, /**begin 自定义属性请在下面加 请加备注**/ /**end 自定义属性请在上面加 请加备注**/ @@ -388,10 +398,14 @@ import XmProjectList from '../xmProject/XmProjectList.vue'; this.addFormVisible = true; //this.addForm=Object.assign({}, this.editForm); }, - afterAddSubmit(){ + afterAddSubmit(xmProduct){ this.addFormVisible=false; this.pageInfo.count=true; - this.getXmProducts(); + if(this.xmIteration){//如果是迭代试图进入的迭代界面,创建了产品直接添加产品与迭代的关系 + this.onXmProductSelect(xmProduct); + }else{ + this.getXmProducts(); + } }, afterEditSubmit(){ this.editFormVisible=false; @@ -490,6 +504,37 @@ import XmProjectList from '../xmProject/XmProjectList.vue'; }, onProjectSelected(projects){ + }, + /**end 自定义函数请在上面加**/ + onXmProductSelect:function(row){ + var xmIteration=this.xmIteration; + var xmProduct=row; + this.$confirm('确认将产品【'+xmProduct.productName+'】加入迭代计划【'+xmIteration.iterationName+'】吗?', '提示', { + type: 'warning' + }).then(()=>{ + addXmIterationProductLink({iterationId:xmIteration.id,productId:xmProduct.id}).then(res=>{ + var tips =res.data.tips; + if(tips.isOk){ + this.getXmProducts(); + } + this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'}); + }) + }) + }, + doDelXmIterationProductLink(row){ + var xmIteration=this.xmIteration; + var xmProduct=row; + this.$confirm('确认将产品【'+xmProduct.productName+'】与迭代【'+xmIteration.iterationName+'】进行脱钩吗?脱钩后,产品下的所有故事将从本迭代计划一并移出。', '提示', { + type: 'warning' + }).then(()=>{ + delXmIterationProductLink({iterationId:xmIteration.id,productId:xmProduct.id}).then(res=>{ + var tips =res.data.tips; + if(tips.isOk){ + this.getXmProducts(); + } + this.$message({showClose: true, message: tips.msg, type: tips.isOk?'success':'error'}); + }) + }) } /**end 自定义函数请在上面加**/ @@ -501,6 +546,8 @@ import XmProjectList from '../xmProject/XmProjectList.vue'; XmProductStateMng, UsersSelect, XmProjectList, + XmIterationSelect, +XmProductSelect, //在下面添加其它组件 }, mounted() { diff --git a/src/views/xm/core/xmProduct/XmProductSelect.vue b/src/views/xm/core/xmProduct/XmProductSelect.vue index e369c2f5..d8e195f4 100644 --- a/src/views/xm/core/xmProduct/XmProductSelect.vue +++ b/src/views/xm/core/xmProduct/XmProductSelect.vue @@ -111,6 +111,10 @@ watch:{ xmIteration(){ this.getXmProducts(); + }, + + selProject(){ + this.getXmProducts(); } }, data() { @@ -217,6 +221,7 @@ if(this.xmIteration){ params.iterationId=this.xmIteration.id } + params.queryScope=this.filters.queryScope if(this.filters.queryScope=='productId'){ if(!this.filters.id){ diff --git a/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkAdd.vue b/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkAdd.vue new file mode 100644 index 00000000..caeb1003 --- /dev/null +++ b/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkAdd.vue @@ -0,0 +1,123 @@ + + + + + \ No newline at end of file diff --git a/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkEdit.vue b/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkEdit.vue new file mode 100644 index 00000000..d0951ebf --- /dev/null +++ b/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkEdit.vue @@ -0,0 +1,118 @@ + + + + + \ No newline at end of file diff --git a/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkMng.vue b/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkMng.vue new file mode 100644 index 00000000..da8b07a5 --- /dev/null +++ b/src/views/xm/core/xmProductProjectLink/XmProductProjectLinkMng.vue @@ -0,0 +1,252 @@ + + + + + \ No newline at end of file