Browse Source

优化产品试图、迭代试图

master
陈裕财 5 years ago
parent
commit
531eda898d
  1. 30
      src/api/xm/core/xmIterationProductLink.js
  2. 30
      src/api/xm/core/xmProductProjectLink.js
  3. 2
      src/views/xm/core/xmIteration/XmIterationAdd.vue
  4. 79
      src/views/xm/core/xmIteration/XmIterationMng.vue
  5. 3
      src/views/xm/core/xmIteration/XmIterationSelect.vue
  6. 123
      src/views/xm/core/xmIterationProductLink/XmIterationProductLinkAdd.vue
  7. 118
      src/views/xm/core/xmIterationProductLink/XmIterationProductLinkEdit.vue
  8. 252
      src/views/xm/core/xmIterationProductLink/XmIterationProductLinkMng.vue
  9. 2
      src/views/xm/core/xmProduct/XmProductAdd.vue
  10. 6
      src/views/xm/core/xmProduct/XmProductComplex.vue
  11. 93
      src/views/xm/core/xmProduct/XmProductMng.vue
  12. 5
      src/views/xm/core/xmProduct/XmProductSelect.vue
  13. 123
      src/views/xm/core/xmProductProjectLink/XmProductProjectLinkAdd.vue
  14. 118
      src/views/xm/core/xmProductProjectLink/XmProductProjectLinkEdit.vue
  15. 252
      src/views/xm/core/xmProductProjectLink/XmProductProjectLinkMng.vue

30
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); };

30
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); };

2
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);

79
src/views/xm/core/xmIteration/XmIterationMng.vue

@ -26,7 +26,9 @@
title=""
width="400"
trigger="click" >
<el-divider content-position="left"><strong>查询条件</strong></el-divider>
<el-row>
<el-col :span="24" style="padding-top:5px;">
<font class="more-label-font">
迭代查询范围
@ -68,6 +70,12 @@
<el-checkbox v-model="gstcVisible">甘特图</el-checkbox>
</el-col>
</el-row>
<el-divider content-position="left"><strong>更多操作</strong></el-divider>
<el-row>
<el-col :span="24" style="padding-top:5px;">
<el-button v-if="xmProduct" size="mini" icon="el-icon-plus" @click="iterationSelectVisible=true">将更多迭代加入产品<strong>{{xmProduct.productName}}</strong></el-button>
</el-col>
</el-row>
<el-button slot="reference" icon="el-icon-more" circle></el-button>
</el-popover>
</el-row>
@ -93,13 +101,8 @@
<el-table-column prop="actWorkload" label="实际工作量" min-width="80" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="400" fixed="right">
<template slot-scope="scope">
<el-button type="primary" @click="showSubAdd( scope.row,scope.$index)" icon="el-icon-plus"></el-button>
<el-button type="warning" @click="loadTasksToXmIterationState( scope.row)" icon="el-icon-s-data">刷新</el-button>
<el-button type="success" @click="showIterationState( scope.row)" icon="el-icon-s-data">报告</el-button>
<el-tooltip v-if="xmProduct" :content="'将迭代与'+ xmProduct.productName + '脱钩'"><el-button @click="doDelXmIterationProductLink( scope.row,scope.$index)" icon="el-icon-remove-outline">与产品脱钩</el-button></el-tooltip>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete"></el-button>
</template>
</el-table-column>
</el-table>
@ -120,6 +123,10 @@
<el-drawer title="迭代报告" :visible.sync="iterationStateVisible" fullscreen append-to-body :close-on-click-modal="false">
<xm-iteration-state-mng :xm-iteration="editForm" :visible="iterationStateVisible" @cancel="iterationStateVisible=false"></xm-iteration-state-mng>
</el-drawer>
<el-drawer title="迭代报告" :visible.sync="iterationSelectVisible" fullscreen append-to-body :close-on-click-modal="false">
<xm-iteration-select @row-click="onXmIterationSelect"></xm-iteration-select>
</el-drawer>
</el-row>
</section>
</template>
@ -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() {
@ -208,6 +224,7 @@
valueChangeRows:[],
parentIteration:null,
iterationStateVisible:false,
iterationSelectVisible:false,
gstcVisible:false,
tableHeight:300,
ganrrColumns: {
@ -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;
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() {

3
src/views/xm/core/xmIteration/XmIterationSelect.vue

@ -98,6 +98,9 @@
this.clearSelectIteration();
this.getXmIterations();
}
},
productId:function(){
this.getXmIterations();
}
},
data() {

123
src/views/xm/core/xmIterationProductLink/XmIterationProductLinkAdd.vue

@ -0,0 +1,123 @@
<template>
<section>
<el-row>
<!--新增界面 XmIterationProductLink 迭代表与产品表的关联关系一般由迭代管理员将迭代挂接到产品表-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="迭代表主键" prop="iterationId">
<el-input v-model="addForm.iterationId" placeholder="迭代表主键" ></el-input>
</el-form-item>
<el-form-item label="产品表主键" prop="productId">
<el-input v-model="addForm.productId" placeholder="产品表主键" ></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="ctime">
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="创建人编号" prop="cuserid">
<el-input v-model="addForm.cuserid" placeholder="创建人编号" ></el-input>
</el-form-item>
<el-form-item label="创建人姓名" prop="cusername">
<el-input v-model="addForm.cusername" placeholder="创建人姓名" ></el-input>
</el-form-item>
<el-form-item label="关联状态1关联0取消关联" prop="linkStatus">
<el-input v-model="addForm.linkStatus" placeholder="关联状态1关联0取消关联" ></el-input>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { addXmIterationProductLink } from '@/api/xm/core/xmIterationProductLink';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo'
])
},
props:['xmIterationProductLink','visible'],
watch: {
'xmIterationProductLink':function( xmIterationProductLink ) {
this.addForm = xmIterationProductLink;
},
'visible':function(visible) {
if(visible==true){
//
}
}
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
addFormRules: {
iterationId: [
//{ required: true, message: '', trigger: 'blur' }
]
},
//
addForm: {
iterationId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="addFormVisible=false"
handleCancel:function(){
this.$refs['addForm'].resetFields();
this.$emit('cancel');
},
//XmIterationProductLink @submit="afterAddSubmit"
addSubmit: function () {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
addXmIterationProductLink(params).then((res) => {
this.load.add=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['addForm'].resetFields();
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false);
});
}
});
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-iteration-product-link-edit':XmIterationProductLinkEdit
},
mounted() {
this.addForm=Object.assign(this.addForm, this.xmIterationProductLink);
/**在下面写其它函数***/
}//end mounted
}
</script>
<style scoped>
</style>

118
src/views/xm/core/xmIterationProductLink/XmIterationProductLinkEdit.vue

@ -0,0 +1,118 @@
<template>
<section>
<el-row>
<!--编辑界面 XmIterationProductLink 迭代表与产品表的关联关系一般由迭代管理员将迭代挂接到产品表-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="迭代表主键" prop="iterationId">
<el-input v-model="editForm.iterationId" placeholder="迭代表主键"></el-input>
</el-form-item>
<el-form-item label="产品表主键" prop="productId">
<el-input v-model="editForm.productId" placeholder="产品表主键"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="ctime">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="创建人编号" prop="cuserid">
<el-input v-model="editForm.cuserid" placeholder="创建人编号"></el-input>
</el-form-item>
<el-form-item label="创建人姓名" prop="cusername">
<el-input v-model="editForm.cusername" placeholder="创建人姓名"></el-input>
</el-form-item>
<el-form-item label="关联状态1关联0取消关联" prop="linkStatus">
<el-input v-model="editForm.linkStatus" placeholder="关联状态1关联0取消关联"></el-input>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { editXmIterationProductLink } from '@/api/xm/core/xmIterationProductLink';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo'
])
},
props:['xmIterationProductLink','visible'],
watch: {
'xmIterationProductLink':function( xmIterationProductLink ) {
this.editForm = xmIterationProductLink;
},
'visible':function(visible) {
if(visible==true){
//
}
}
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
editFormRules: {
iterationId: [
//{ required: true, message: '', trigger: 'blur' }
]
},
// XmIterationProductLink
editForm: {
iterationId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="editFormVisible=false"
handleCancel:function(){
this.$refs['editForm'].resetFields();
this.$emit('cancel');
},
//XmIterationProductLink @submit="afterEditSubmit"
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
editXmIterationProductLink(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}
});
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-iteration-product-link-edit':XmIterationProductLinkEdit
},
mounted() {
this.editForm=Object.assign(this.editForm, this.xmIterationProductLink);
}
}
</script>
<style scoped>
</style>

252
src/views/xm/core/xmIterationProductLink/XmIterationProductLinkMng.vue

@ -0,0 +1,252 @@
<template>
<section class="app-container">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询">
<template slot="append">
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmIterationProductLinks" icon="el-icon-search">查询</el-button>
</template>
</el-input>
<el-button type="primary" @click="showAdd" icon="el-icon-plus" circle> </el-button>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" circle></el-button>
</el-row>
<el-row style="padding-top:10px;">
<!--列表 XmIterationProductLink 迭代表与产品表的关联关系一般由迭代管理员将迭代挂接到产品表-->
<el-table ref="xmIterationProductLink" :data="xmIterationProductLinks" :max-height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column sortable type="index" width="55"></el-table-column>
<el-table-column prop="iterationId" label="迭代表主键" min-width="80" ></el-table-column>
<el-table-column prop="productId" label="产品表主键" min-width="80" ></el-table-column>
<el-table-column prop="ctime" label="创建时间" min-width="80" ></el-table-column>
<el-table-column prop="cuserid" label="创建人编号" min-width="80" ></el-table-column>
<el-table-column prop="cusername" label="创建人姓名" min-width="80" ></el-table-column>
<el-table-column prop="linkStatus" label="关联状态1关联0取消关联" min-width="80" ></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot="header">
<el-button @click="showAdd" icon="el-icon-plus" circle> </el-button>
</template>
<template scope="scope">
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" circle></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" circle></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
<!--编辑 XmIterationProductLink 迭代表与产品表的关联关系一般由迭代管理员将迭代挂接到产品表界面-->
<el-dialog title="编辑迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表" :visible.sync="editFormVisible" width="50%" append-to-body :close-on-click-modal="false">
<xm-iteration-product-link-edit :xm-iteration-product-link="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-iteration-product-link-edit>
</el-dialog>
<!--新增 XmIterationProductLink 迭代表与产品表的关联关系一般由迭代管理员将迭代挂接到产品表界面-->
<el-dialog title="新增迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表" :visible.sync="addFormVisible" width="50%" append-to-body :close-on-click-modal="false">
<xm-iteration-product-link-add :xm-iteration-product-link="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-iteration-product-link-add>
</el-dialog>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from '@/common/config';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { listXmIterationProductLink, delXmIterationProductLink, batchDelXmIterationProductLink } from '@/api/xm/core/xmIterationProductLink';
import XmIterationProductLinkAdd from './XmIterationProductLinkAdd';//
import XmIterationProductLinkEdit from './XmIterationProductLinkEdit';//
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','workSpace'
])
},
data() {
return {
filters: {
key: ''
},
xmIterationProductLinks: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
options:{
//sex:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//xmIterationProductLink
//xmIterationProductLink
addForm: {
iterationId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
},
editFormVisible: false,//
//xmIterationProductLink
editForm: {
iterationId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
},
maxTableHeight:300,
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmIterationProductLinks();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmIterationProductLinks();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
if(obj.order==null){
this.pageInfo.orderFields=[];
this.pageInfo.orderDirs=[];
}else{
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
this.pageInfo.orderFields=[util.toLine(obj.prop)];
this.pageInfo.orderDirs=[dir];
}
this.getXmIterationProductLinks();
},
searchXmIterationProductLinks(){
this.pageInfo.count=true;
this.getXmIterationProductLinks();
},
// XmIterationProductLink
getXmIterationProductLinks() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key){
params.key="%"+this.filters.key+"%"
}
this.load.list = true;
listXmIterationProductLink(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmIterationProductLinks = res.data.data;
}else{
this.$message({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmIterationProductLink
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmIterationProductLink
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmIterationProductLinks();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmIterationProductLink
selsChange: function (sels) {
this.sels = sels;
},
//xmIterationProductLink
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { iterationId: row.iterationId };
delXmIterationProductLink(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmIterationProductLinks();
}
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmIterationProductLink
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelXmIterationProductLink(this.sels).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmIterationProductLinks();
}
this.$message({ message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
/**begin 自定义函数请在下面加**/
/**end 自定义函数请在上面加**/
},//end methods
components: {
'xm-iteration-product-link-add':XmIterationProductLinkAdd,
'xm-iteration-product-link-edit':XmIterationProductLinkEdit,
},
mounted() {
this.$nextTick(() => {
this.getXmIterationProductLinks();
var clientRect=this.$refs.xmIterationProductLink.$el.getBoundingClientRect();
var subHeight=65/1000 * window.innerHeight;
this.maxTableHeight = window.innerHeight -clientRect.y - this.$refs.xmIterationProductLink.$el.offsetTop-subHeight;
});
/**
listOption([{categoryId:'all',itemCode:'sex'},{categoryId:'all',itemCode:'grade'}] ).then(res=>{
if(res.data.tips.isOk){
this.options=res.data.data
}
});
**/
}
}
</script>
<style scoped>
</style>

2
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);

6
src/views/xm/core/xmProduct/XmProductComplex.vue

@ -12,7 +12,7 @@
</el-tab-pane>
<el-tab-pane label="迭代" name="iterations">
<xm-iteration-select v-show=" showPanel=='iterations'" :xm-product="xmProduct" :sel-project="selProject"></xm-iteration-select>
<xm-iteration-mng v-show=" xmProduct && showPanel=='iterations'" :xm-product="xmProduct" :sel-project="selProject"></xm-iteration-mng>
</el-tab-pane>
<el-tab-pane label="项目" lazy name="projects" v-if="!selProject">
<xm-project-list v-show="xmProduct && showPanel=='projects'" :xm-product="xmProduct"></xm-project-list>
@ -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,

93
src/views/xm/core/xmProduct/XmProductMng.vue

@ -27,28 +27,16 @@
<el-button v-loading="load.list" :disabled="load.list==true" v-on:click="searchXmProducts" icon="el-icon-search"></el-button>
</template>
</el-input>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete"></el-button>
<el-popover
placement="top-start"
title=""
width="400"
trigger="hover" >
<el-row>
<el-button type="primary" @click="showAdd" icon="el-icon-plus">产品</el-button>
<el-tooltip content="项目与产品关联后,从项目视图可以查找到产品信息"><el-button type="primary" @click="showAdd" icon="el-icon-plus">将项目与产品关联</el-button> </el-tooltip>
<el-tooltip content="迭代与产品关联后,从迭代视图可以查找到产品信息,可以将故事加入到迭代中去"><el-button type="primary" @click="showAdd" icon="el-icon-plus">将迭代与产品关联</el-button> </el-tooltip>
</el-row>
<el-button slot="reference" icon="el-icon-plus" circle></el-button>
</el-popover>
<el-popover
placement="top-start"
title=""
width="400"
trigger="click" >
<el-divider content-position="left"><strong>查询条件</strong></el-divider>
<el-row>
<el-col :span="24" style="padding-top:5px;">
<el-divider content-position="left"><strong>查询条件</strong></el-divider>
<font class="more-label-font">
产品查询范围
</font>
@ -107,6 +95,12 @@
<el-button type="primary" size="mini" @click="searchXmProducts" >查询</el-button>
</el-col>
</el-row>
<el-divider content-position="left"><strong>更多操作</strong></el-divider>
<el-row>
<el-col :span="24" style="padding-top:5px;">
<el-button v-if="xmIteration" size="mini" icon="el-icon-plus" @click="productSelectVisible=true">将更多产品加入迭代<strong>{{xmIteration.iterationName}}</strong></el-button>
</el-col>
</el-row>
<el-button slot="reference" icon="el-icon-more" circle></el-button>
</el-popover>
</el-row>
@ -129,7 +123,7 @@
<el-table-column prop="actWorkload" label="实际工作量.人时" width="150" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="200" fixed="right">
<template slot-scope="scope">
<el-button type="primary" @click="toIterationList(scope.row)" icon="el-icon-document">迭代计划</el-button>
<el-tooltip v-if="xmIteration" :content="'将产品与迭代【'+ xmIteration.iterationName + '】脱钩'"><el-button @click="doDelXmIterationProductLink( scope.row,scope.$index)" icon="el-icon-remove-outline">与迭代脱钩</el-button></el-tooltip>
<el-popover
placement="top-start"
title=""
@ -137,20 +131,23 @@
trigger="click" >
<el-row>
<el-col :span="24" style="padding-top:12px;">
<el-button type="warning" @click="loadTasksToXmProductState(scope.row)" icon="el-icon-s-data">执行统计任务</el-button>
<el-button type="warning" @click="loadTasksToXmProductState(scope.row)" icon="el-icon-s-data">从任务汇总统计进度</el-button>
</el-col>
<el-col :span="24" style="padding-top:12px;">
<el-button type="warning" @click="showProductState(scope.row)" icon="el-icon-s-data">产品报告</el-button>
</el-col>
<el-col :span="24" class="hidden-lg-and-up" style="padding-top:12px;">
<el-button type="success" @click="toProjectList(scope.row)" icon="el-icon-document">关联项目查询</el-button>
<el-col :span="24" style="padding-top:12px;">
<el-button type="primary" @click="toIterationList(scope.row)" icon="el-icon-document">关联迭代计划查询</el-button>
</el-col>
<el-col :span="24" class="hidden-lg-and-up" style="padding-top:12px;">
<el-button type="success" @click="toIterationList(scope.row)" icon="el-icon-document">迭代计划管理</el-button>
<el-col :span="24" style="padding-top:12px;">
<el-button type="success" @click="toProjectList(scope.row)" icon="el-icon-document">关联项目查询</el-button>
</el-col>
<el-col :span="24" style="padding-top:12px;">
<el-button type="success" @click="toTaskList(scope.row)" icon="el-icon-tickets">关联任务查询</el-button>
</el-col>
<el-col :span="24" style="padding-top:12px;">
<el-button type="danger" v-loading="load.del" @click="handleDel(scope.row)" :disabled="load.del==true" icon="el-icon-delete">删除</el-button>
</el-col>
</el-row>
<el-button slot="reference" icon="el-icon-more" circle></el-button>
</el-popover>
@ -187,6 +184,12 @@
<xm-project-list @select="onProjectSelected"></xm-project-list>
</el-drawer>
<el-drawer title="选择产品" :visible.sync="productSelectVisible" size="60%" append-to-body>
<xm-product-select @row-click="onXmProductSelect"></xm-product-select>
</el-drawer>
<el-drawer title="迭代报告" :visible.sync="iterationSelectVisible" fullscreen append-to-body :close-on-click-modal="false">
<xm-iteration-select @row-click="onXmIterationSelect"></xm-iteration-select>
</el-drawer>
</section>
</template>
@ -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,7 +207,9 @@
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'],
@ -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;
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() {

5
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){

123
src/views/xm/core/xmProductProjectLink/XmProductProjectLinkAdd.vue

@ -0,0 +1,123 @@
<template>
<section>
<el-row>
<!--新增界面 XmProductProjectLink 产品与项目的关联关系表一般由产品经理挂接项目到产品上-->
<el-form :model="addForm" label-width="120px" :rules="addFormRules" ref="addForm">
<el-form-item label="项目表中的主键" prop="projectId">
<el-input v-model="addForm.projectId" placeholder="项目表中的主键" ></el-input>
</el-form-item>
<el-form-item label="产品表中的主键" prop="productId">
<el-input v-model="addForm.productId" placeholder="产品表中的主键" ></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="ctime">
<el-date-picker type="date" placeholder="选择日期" v-model="addForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="创建人编号" prop="cuserid">
<el-input v-model="addForm.cuserid" placeholder="创建人编号" ></el-input>
</el-form-item>
<el-form-item label="创建人姓名" prop="cusername">
<el-input v-model="addForm.cusername" placeholder="创建人姓名" ></el-input>
</el-form-item>
<el-form-item label="关联状态1关联0取消关联" prop="linkStatus">
<el-input v-model="addForm.linkStatus" placeholder="关联状态1关联0取消关联" ></el-input>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.add" type="primary" @click.native="addSubmit" :disabled="load.add==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { addXmProductProjectLink } from '@/api/xm/core/xmProductProjectLink';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo'
])
},
props:['xmProductProjectLink','visible'],
watch: {
'xmProductProjectLink':function( xmProductProjectLink ) {
this.addForm = xmProductProjectLink;
},
'visible':function(visible) {
if(visible==true){
//
}
}
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
addFormRules: {
projectId: [
//{ required: true, message: '', trigger: 'blur' }
]
},
//
addForm: {
projectId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="addFormVisible=false"
handleCancel:function(){
this.$refs['addForm'].resetFields();
this.$emit('cancel');
},
//XmProductProjectLink @submit="afterAddSubmit"
addSubmit: function () {
this.$refs.addForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.add=true
let params = Object.assign({}, this.addForm);
addXmProductProjectLink(params).then((res) => {
this.load.add=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['addForm'].resetFields();
this.$emit('submit');// @submit="afterAddSubmit"
}
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.add=false);
});
}
});
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-product-project-link-edit':XmProductProjectLinkEdit
},
mounted() {
this.addForm=Object.assign(this.addForm, this.xmProductProjectLink);
/**在下面写其它函数***/
}//end mounted
}
</script>
<style scoped>
</style>

118
src/views/xm/core/xmProductProjectLink/XmProductProjectLinkEdit.vue

@ -0,0 +1,118 @@
<template>
<section>
<el-row>
<!--编辑界面 XmProductProjectLink 产品与项目的关联关系表一般由产品经理挂接项目到产品上-->
<el-form :model="editForm" label-width="120px" :rules="editFormRules" ref="editForm">
<el-form-item label="项目表中的主键" prop="projectId">
<el-input v-model="editForm.projectId" placeholder="项目表中的主键"></el-input>
</el-form-item>
<el-form-item label="产品表中的主键" prop="productId">
<el-input v-model="editForm.productId" placeholder="产品表中的主键"></el-input>
</el-form-item>
<el-form-item label="创建时间" prop="ctime">
<el-date-picker type="date" placeholder="选择日期" v-model="editForm.ctime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="创建人编号" prop="cuserid">
<el-input v-model="editForm.cuserid" placeholder="创建人编号"></el-input>
</el-form-item>
<el-form-item label="创建人姓名" prop="cusername">
<el-input v-model="editForm.cusername" placeholder="创建人姓名"></el-input>
</el-form-item>
<el-form-item label="关联状态1关联0取消关联" prop="linkStatus">
<el-input v-model="editForm.linkStatus" placeholder="关联状态1关联0取消关联"></el-input>
</el-form-item>
<el-form-item>
<el-col :span="24" :offset="8">
<el-button @click.native="handleCancel">取消</el-button>
<el-button v-loading="load.edit" type="primary" @click.native="editSubmit" :disabled="load.edit==true">提交</el-button>
</el-col>
</el-form-item>
</el-form>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { editXmProductProjectLink } from '@/api/xm/core/xmProductProjectLink';
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo'
])
},
props:['xmProductProjectLink','visible'],
watch: {
'xmProductProjectLink':function( xmProductProjectLink ) {
this.editForm = xmProductProjectLink;
},
'visible':function(visible) {
if(visible==true){
//
}
}
},
data() {
return {
options:{},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
load:{ list: false, edit: false, del: false, add: false },//...
editFormRules: {
projectId: [
//{ required: true, message: '', trigger: 'blur' }
]
},
// XmProductProjectLink
editForm: {
projectId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
}
/**begin 在下面加自定义属性,记得补上面的一个逗号**/
/**end 在上面加自定义属性**/
}//end return
},//end data
methods: {
// @cancel="editFormVisible=false"
handleCancel:function(){
this.$refs['editForm'].resetFields();
this.$emit('cancel');
},
//XmProductProjectLink @submit="afterEditSubmit"
editSubmit: function () {
this.$refs.editForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.load.edit=true
let params = Object.assign({}, this.editForm);
editXmProductProjectLink(params).then((res) => {
this.load.edit=false
var tips=res.data.tips;
if(tips.isOk){
this.$refs['editForm'].resetFields();
this.$emit('submit');// @submit="afterEditSubmit"
}
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err =>this.load.edit=false);
});
}
});
},
/**begin 在下面加自定义方法,记得补上面的一个逗号**/
/**end 在上面加自定义方法**/
},//end method
components: {
// 'xm-product-project-link-edit':XmProductProjectLinkEdit
},
mounted() {
this.editForm=Object.assign(this.editForm, this.xmProductProjectLink);
}
}
</script>
<style scoped>
</style>

252
src/views/xm/core/xmProductProjectLink/XmProductProjectLinkMng.vue

@ -0,0 +1,252 @@
<template>
<section class="app-container">
<el-row>
<el-input v-model="filters.key" style="width: 20%;" placeholder="模糊查询">
<template slot="append">
<el-button v-loading="load.list" :disabled="load.list==true" @click="searchXmProductProjectLinks" icon="el-icon-search">查询</el-button>
</template>
</el-input>
<el-button type="primary" @click="showAdd" icon="el-icon-plus" circle> </el-button>
<el-button type="danger" v-loading="load.del" @click="batchDel" :disabled="this.sels.length===0 || load.del==true" icon="el-icon-delete" circle></el-button>
</el-row>
<el-row style="padding-top:10px;">
<!--列表 XmProductProjectLink 产品与项目的关联关系表一般由产品经理挂接项目到产品上-->
<el-table ref="xmProductProjectLink" :data="xmProductProjectLinks" :max-height="maxTableHeight" @sort-change="sortChange" highlight-current-row v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;">
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column sortable type="index" width="55"></el-table-column>
<el-table-column prop="projectId" label="项目表中的主键" min-width="80" ></el-table-column>
<el-table-column prop="productId" label="产品表中的主键" min-width="80" ></el-table-column>
<el-table-column prop="ctime" label="创建时间" min-width="80" ></el-table-column>
<el-table-column prop="cuserid" label="创建人编号" min-width="80" ></el-table-column>
<el-table-column prop="cusername" label="创建人姓名" min-width="80" ></el-table-column>
<el-table-column prop="linkStatus" label="关联状态1关联0取消关联" min-width="80" ></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template slot="header">
<el-button @click="showAdd" icon="el-icon-plus" circle> </el-button>
</template>
<template scope="scope">
<el-button type="primary" @click="showEdit( scope.row,scope.$index)" icon="el-icon-edit" circle></el-button>
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" circle></el-button>
</template>
</el-table-column>
</el-table>
<el-pagination layout="total, sizes, prev, pager, next" @current-change="handleCurrentChange" @size-change="handleSizeChange" :page-sizes="[10,20, 50, 100, 500]" :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :total="pageInfo.total" style="float:right;"></el-pagination>
<!--编辑 XmProductProjectLink 产品与项目的关联关系表一般由产品经理挂接项目到产品上界面-->
<el-dialog title="编辑产品与项目的关联关系表,一般由产品经理挂接项目到产品上" :visible.sync="editFormVisible" width="50%" append-to-body :close-on-click-modal="false">
<xm-product-project-link-edit :xm-product-project-link="editForm" :visible="editFormVisible" @cancel="editFormVisible=false" @submit="afterEditSubmit"></xm-product-project-link-edit>
</el-dialog>
<!--新增 XmProductProjectLink 产品与项目的关联关系表一般由产品经理挂接项目到产品上界面-->
<el-dialog title="新增产品与项目的关联关系表,一般由产品经理挂接项目到产品上" :visible.sync="addFormVisible" width="50%" append-to-body :close-on-click-modal="false">
<xm-product-project-link-add :xm-product-project-link="addForm" :visible="addFormVisible" @cancel="addFormVisible=false" @submit="afterAddSubmit"></xm-product-project-link-add>
</el-dialog>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from '@/common/config';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { listXmProductProjectLink, delXmProductProjectLink, batchDelXmProductProjectLink } from '@/api/xm/core/xmProductProjectLink';
import XmProductProjectLinkAdd from './XmProductProjectLinkAdd';//
import XmProductProjectLinkEdit from './XmProductProjectLinkEdit';//
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters([
'userInfo','workSpace'
])
},
data() {
return {
filters: {
key: ''
},
xmProductProjectLinks: [],//
pageInfo:{//
total:0,//0>0
pageSize:10,//
count:false,//
pageNum:1,//1
orderFields:[],// ['sex','student_id']
orderDirs:[]// asc,desc ['asc','desc']
},
load:{ list: false, edit: false, del: false, add: false },//...
sels: [],//
options:{
//sex:[],
},// params=[{categoryId:'0001',itemCode:'sex'}] {'sex':[{optionValue:'1',optionName:'',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'',seqOrder:'2',fp:'',isDefault:'0'}]}
addFormVisible: false,//xmProductProjectLink
//xmProductProjectLink
addForm: {
projectId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
},
editFormVisible: false,//
//xmProductProjectLink
editForm: {
projectId:'',productId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
},
maxTableHeight:300,
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmProductProjectLinks();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmProductProjectLinks();
},
// obj.order=ascending/descending, asc/desc ; obj.prop=,
sortChange( obj ){
if(obj.order==null){
this.pageInfo.orderFields=[];
this.pageInfo.orderDirs=[];
}else{
var dir='asc';
if(obj.order=='ascending'){
dir='asc'
}else{
dir='desc';
}
this.pageInfo.orderFields=[util.toLine(obj.prop)];
this.pageInfo.orderDirs=[dir];
}
this.getXmProductProjectLinks();
},
searchXmProductProjectLinks(){
this.pageInfo.count=true;
this.getXmProductProjectLinks();
},
// XmProductProjectLink
getXmProductProjectLinks() {
let params = {
pageSize: this.pageInfo.pageSize,
pageNum: this.pageInfo.pageNum,
total: this.pageInfo.total,
count:this.pageInfo.count
};
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){
let orderBys=[];
for(var i=0;i<this.pageInfo.orderFields.length;i++){
orderBys.push(this.pageInfo.orderFields[i]+" "+this.pageInfo.orderDirs[i])
}
params.orderBy= orderBys.join(",")
}
if(this.filters.key){
params.key="%"+this.filters.key+"%"
}
this.load.list = true;
listXmProductProjectLink(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmProductProjectLinks = res.data.data;
}else{
this.$message({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmProductProjectLink
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmProductProjectLink
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmProductProjectLinks();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmProductProjectLink
selsChange: function (sels) {
this.sels = sels;
},
//xmProductProjectLink
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = { projectId: row.projectId };
delXmProductProjectLink(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmProductProjectLinks();
}
this.$message({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmProductProjectLink
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelXmProductProjectLink(this.sels).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmProductProjectLinks();
}
this.$message({ message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
rowClick: function(row, event, column){
this.$emit('row-click',row, event, column);// @row-click="rowClick"
},
/**begin 自定义函数请在下面加**/
/**end 自定义函数请在上面加**/
},//end methods
components: {
'xm-product-project-link-add':XmProductProjectLinkAdd,
'xm-product-project-link-edit':XmProductProjectLinkEdit,
},
mounted() {
this.$nextTick(() => {
this.getXmProductProjectLinks();
var clientRect=this.$refs.xmProductProjectLink.$el.getBoundingClientRect();
var subHeight=65/1000 * window.innerHeight;
this.maxTableHeight = window.innerHeight -clientRect.y - this.$refs.xmProductProjectLink.$el.offsetTop-subHeight;
});
/**
listOption([{categoryId:'all',itemCode:'sex'},{categoryId:'all',itemCode:'grade'}] ).then(res=>{
if(res.data.tips.isOk){
this.options=res.data.data
}
});
**/
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save