Browse Source

优化

master
陈裕财 4 years ago
parent
commit
97ebf09fee
  1. 7
      src/api/xm/core/xmIterationLink.js
  2. 8
      src/views/xm/core/xmIteration/XmIterationOverviewComplex.vue
  3. 18
      src/views/xm/core/xmIterationLink/XmIterationLinkForProduct.vue
  4. 295
      src/views/xm/core/xmIterationLink/XmIterationLinkForProject.vue
  5. 43
      src/views/xm/core/xmProduct/XmProductOverviewComplex.vue
  6. 84
      src/views/xm/core/xmProject/XmProjectOverviewComplex.vue

7
src/api/xm/core/xmIterationLink.js

@ -27,4 +27,9 @@ export const batchDelXmIterationLink = params => { return axios.post(`${base}/xm
export const editXmIterationLink = params => { return axios.post(`${base}/xm/core/xmIterationLink/edit`, params); }; export const editXmIterationLink = params => { return axios.post(`${base}/xm/core/xmIterationLink/edit`, params); };
//新增一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表 //新增一条迭代表与产品表的关联关系,一般由迭代管理员将迭代挂接到产品表
export const addXmIterationLink = params => { return axios.post(`${base}/xm/core/xmIterationLink/add`, params); };
export const addXmIterationLink = params => { return axios.post(`${base}/xm/core/xmIterationLink/add`, params); };
//普通查询 条件之间and关系
export const listXmIterationLinkWithProductInfo = params => { return axios.get(`${base}/xm/core/xmIterationLink/listWithProductInfo`, { params: params }); };
export const listXmIterationLinkWithProjectInfo = params => { return axios.get(`${base}/xm/core/xmIterationLink/listWithProjectInfo`, { params: params }); };

8
src/views/xm/core/xmIteration/XmIterationOverviewComplex.vue

@ -19,7 +19,8 @@
</el-menu> </el-menu>
<xm-iteration-overview v-if="showPanelName=='overview'" :xm-iteration="xmIteration"></xm-iteration-overview> <xm-iteration-overview v-if="showPanelName=='overview'" :xm-iteration="xmIteration"></xm-iteration-overview>
<xm-iteration-edit v-if="showPanelName=='detail'" :xm-iteration="xmIteration"></xm-iteration-edit> <xm-iteration-edit v-if="showPanelName=='detail'" :xm-iteration="xmIteration"></xm-iteration-edit>
<xm-iteration-link-mng v-if="showPanelName=='iterationProductLink'" :xm-iteration="xmIteration"></xm-iteration-link-mng>
<xm-iteration-link-for-product v-if="showPanelName=='iterationProductLink'" :xm-iteration="xmIteration"></xm-iteration-link-for-product>
<xm-iteration-link-for-project v-if="showPanelName=='iterationProjectLink'" :xm-iteration="xmIteration"></xm-iteration-link-for-project>
<xm-iteration-menu-mng v-if="showPanelName=='iterationMenuMng'" :xm-iteration="xmIteration"></xm-iteration-menu-mng> <xm-iteration-menu-mng v-if="showPanelName=='iterationMenuMng'" :xm-iteration="xmIteration"></xm-iteration-menu-mng>
</section> </section>
</template> </template>
@ -30,12 +31,13 @@ import util from "@/common/js/util"; // 全局公共库
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import XmIterationOverview from './XmIterationOverview.vue'; import XmIterationOverview from './XmIterationOverview.vue';
import XmIterationEdit from './XmIterationEdit.vue'; import XmIterationEdit from './XmIterationEdit.vue';
import XmIterationLinkMng from '../xmIterationLink/XmIterationLinkMng.vue';
import XmIterationLinkForProduct from '../xmIterationLink/XmIterationLinkForProduct.vue';
import XmIterationLinkForProject from '../xmIterationLink/XmIterationLinkForProject.vue';
import XmIterationMenuMng from '../xmIterationMenu/XmIterationMenuMng.vue'; import XmIterationMenuMng from '../xmIterationMenu/XmIterationMenuMng.vue';
export default { export default {
components: {XmIterationOverview,XmIterationEdit, XmIterationLinkMng, XmIterationMenuMng },
components: {XmIterationOverview,XmIterationEdit, XmIterationLinkForProduct,XmIterationLinkForProject, XmIterationMenuMng },
computed: { computed: {
...mapGetters(["userInfo"]), ...mapGetters(["userInfo"]),
}, },

src/views/xm/core/xmIterationLink/XmIterationLinkMng.vue → src/views/xm/core/xmIterationLink/XmIterationLinkForProduct.vue

295
src/views/xm/core/xmIterationLink/XmIterationLinkForProject.vue

@ -0,0 +1,295 @@
<template>
<section class="app-container">
<el-row>
<el-button type="primary" v-if="xmIteration" @click="projectVisible=true" icon="el-icon-plus" > 选择更多项目加入迭代 </el-button>
<el-button type="primary" v-if="selProject" @click="iterationVisible=true" icon="el-icon-plus" > 选择更多迭代加入项目 </el-button>
</el-row>
<el-row style="padding-top:10px;">
<!--列表 XmIterationLink 迭代表与项目表的关联关系一般由迭代管理员将迭代挂接到项目表-->
<el-table ref="xmIterationLink" :data="xmIterationLinks" :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 prop="iterationName" v-if="!xmIteration" label="包含的迭代名称" min-width="150" ></el-table-column>
<el-table-column prop="projectName" v-if="!selProject" label="包含的项目名称" min-width="150" ></el-table-column>
<el-table-column prop="ctime" label="加入时间" min-width="80" ></el-table-column>
<el-table-column prop="cusername" label="操作者" min-width="80" ></el-table-column>
<el-table-column label="操作" width="120" fixed="right">
<template scope="scope">
<el-button type="danger" @click="handleDel(scope.row,scope.$index)" icon="el-icon-delete" >移出</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>
<el-drawer title="选择项目" :visible.sync="projectVisible" size="50%" append-to-body :close-on-click-modal="false">
<xm-project-select @row-click="onProjectSelect"></xm-project-select>
</el-drawer>
<el-drawer title="选择迭代" :visible.sync="iterationVisible" size="50%" append-to-body :close-on-click-modal="false">
<xm-iteration-select @row-click="onIterationSelect"></xm-iteration-select>
</el-drawer>
</el-row>
</section>
</template>
<script>
import util from '@/common/js/util';//
import config from '@/common/config';//
import { listOption } from '@/api/mdp/meta/itemOption';//
import { listXmIterationLinkWithProjectInfo,addXmIterationLink, delXmIterationLink, batchDelXmIterationLink } from '@/api/xm/core/xmIterationLink';
import XmIterationLinkAdd from './XmIterationLinkAdd';//
import XmIterationLinkEdit from './XmIterationLinkEdit';//
import { mapGetters } from 'vuex'
import XmProjectSelect from '../xmProject/XmProjectSelect.vue';
import XmIterationSelect from '../xmIteration/XmIterationSelect.vue';
export default {
props:['xmIteration','selProject'],
watch:{
xmIteration(){
this.getXmIterationLinks();
},
selProject(){
this.getXmIterationLinks();
}
},
computed: {
...mapGetters([
'userInfo','workSpace'
])
},
data() {
return {
filters: {
key: ''
},
xmIterationLinks: [],//
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,//xmIterationLink
//xmIterationLink
addForm: {
iterationId:'',proId:'',ctime:'',cuserid:'',cusername:'',linkStatus:''
},
editFormVisible: false,//
//xmIterationLink
editForm: {
iterationId:'',proId:'',ctime:'',cuserid:'',cusername:'',linkStatus:'',ltype:'0'
},
maxTableHeight:300,
projectVisible:false,
iterationVisible:false,
}
},//end data
methods: {
handleSizeChange(pageSize) {
this.pageInfo.pageSize=pageSize;
this.getXmIterationLinks();
},
handleCurrentChange(pageNum) {
this.pageInfo.pageNum = pageNum;
this.getXmIterationLinks();
},
// 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.getXmIterationLinks();
},
searchXmIterationLinks(){
this.pageInfo.count=true;
this.getXmIterationLinks();
},
// XmIterationLink
getXmIterationLinks() {
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+"%"
}
if(this.xmIteration){
params.iterationId=this.xmIteration.id
}
if(this.selProject){
params.proId=this.selProject.id
}
this.load.list = true;
listXmIterationLinkWithProjectInfo(params).then((res) => {
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.total = res.data.total;
this.pageInfo.count=false;
this.xmIterationLinks = res.data.data;
}else{
this.$notify({ message: tips.msg, type: 'error' });
}
this.load.list = false;
}).catch( err => this.load.list = false );
},
// XmIterationLink
showEdit: function ( row,index ) {
this.editFormVisible = true;
this.editForm = Object.assign({}, row);
},
// XmIterationLink
showAdd: function () {
this.addFormVisible = true;
//this.addForm=Object.assign({}, this.editForm);
},
afterAddSubmit(){
this.addFormVisible=false;
this.pageInfo.count=true;
this.getXmIterationLinks();
},
afterEditSubmit(){
this.editFormVisible=false;
},
//xmIterationLink
selsChange: function (sels) {
this.sels = sels;
},
//xmIterationLink
handleDel: function (row,index) {
this.$confirm('确认删除该记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
let params = row;
delXmIterationLink(params).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if(tips.isOk){
this.pageInfo.count=true;
this.getXmIterationLinks();
}
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error' });
}).catch( err => this.load.del=false );
});
},
//xmIterationLink
batchDel: function () {
this.$confirm('确认删除选中记录吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.del=true;
batchDelXmIterationLink(this.sels).then((res) => {
this.load.del=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmIterationLinks();
}
this.$notify({ 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 自定义函数请在下面加**/
onProjectSelect(project){
this.$confirm('确认建立与项目【'+project.projectName+'】的关联关系吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.add=true;
this.addForm.iterationId=this.xmIteration.id;
this.addForm.proId= project.id;
this.addForm.ltype="0"
addXmIterationLink(this.addForm).then((res) => {
this.load.add=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmIterationLinks();
}
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
},
onIterationSelect(iteration){
this.$confirm('确认建立与迭代【'+iteration.iterationName+'】的关联关系吗?', '提示', {
type: 'warning'
}).then(() => {
this.load.add=true;
this.addForm.iterationId=iteration.id;
this.addForm.proId=this.selProject.id;
this.addForm.ltype="0";
addXmIterationLink(this.addForm).then((res) => {
this.load.add=false;
var tips=res.data.tips;
if( tips.isOk ){
this.pageInfo.count=true;
this.getXmIterationLinks();
}
this.$notify({ message: tips.msg, type: tips.isOk?'success':'error'});
}).catch( err => this.load.del=false );
});
}
/**end 自定义函数请在上面加**/
},//end methods
components: {
'xm-iteration-link-add':XmIterationLinkAdd,
'xm-iteration-link-edit':XmIterationLinkEdit,
XmProjectSelect,
XmIterationSelect,
},
mounted() {
this.$nextTick(() => {
this.getXmIterationLinks();
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.xmIterationLink.$el)
});
/**
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>

43
src/views/xm/core/xmProduct/XmProductOverviewComplex.vue

@ -12,46 +12,11 @@
</el-menu-item> </el-menu-item>
<el-menu-item index="productProjectLink"> <el-menu-item index="productProjectLink">
<span slot="title">配置可见项目</span> <span slot="title">配置可见项目</span>
</el-menu-item>
<el-submenu index="menu-change">
<template slot="title">
<span slot="title">需求变更</span>
</template>
<el-menu-item index="menu-change-review">
<span slot="title">需求评审</span>
</el-menu-item>
<el-menu-item index="menu-change-border-review">
<span slot="title">需求边界异动</span>
</el-menu-item>
</el-submenu>
<el-submenu index="iteration-change">
<template slot="title">
<span slot="title">迭代变更</span>
</template>
<el-menu-item index="iteration-change-review">
<span slot="title">迭代计划评审</span>
</el-menu-item>
<el-menu-item index="iteration-change-border-review">
<span slot="title">迭代上线申请</span>
</el-menu-item>
</el-submenu>
<el-submenu index="phase-change">
<template slot="title">
<span slot="title">计划变更</span>
</template>
<el-menu-item index="phase-change-review">
<span slot="title">计划评审</span>
</el-menu-item>
<el-menu-item index="phase-change-border-review">
<span slot="title">预算变更</span>
</el-menu-item>
</el-submenu>
</el-menu-item>
</el-menu> </el-menu>
<xm-product-overview v-if="showPanelName=='overview'" :xm-product="xmProduct"></xm-product-overview> <xm-product-overview v-if="showPanelName=='overview'" :xm-product="xmProduct"></xm-product-overview>
<xm-product-edit v-if="showPanelName=='detail'" :xm-product="xmProduct"></xm-product-edit> <xm-product-edit v-if="showPanelName=='detail'" :xm-product="xmProduct"></xm-product-edit>
<xm-iteration-link-mng v-if="showPanelName=='iterationProductLink'" :xm-product="xmProduct"></xm-iteration-link-mng>
<xm-iteration-link-for-product v-if="showPanelName=='iterationProductLink'" :xm-product="xmProduct"></xm-iteration-link-for-product>
<xm-product-project-link-mng v-if="showPanelName=='productProjectLink'" :xm-product="xmProduct"></xm-product-project-link-mng> <xm-product-project-link-mng v-if="showPanelName=='productProjectLink'" :xm-product="xmProduct"></xm-product-project-link-mng>
</section> </section>
</template> </template>
@ -62,12 +27,12 @@ import util from "@/common/js/util"; // 全局公共库
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import XmProductOverview from './XmProductOverview.vue'; import XmProductOverview from './XmProductOverview.vue';
import XmProductEdit from './XmProductEdit.vue'; import XmProductEdit from './XmProductEdit.vue';
import XmIterationLinkMng from '../xmIterationLink/XmIterationLinkMng.vue';
import XmIterationLinkForProduct from '../xmIterationLink/XmIterationLinkForProduct.vue';
import XmProductProjectLinkMng from '../xmProductProjectLink/XmProductProjectLinkMng.vue'; import XmProductProjectLinkMng from '../xmProductProjectLink/XmProductProjectLinkMng.vue';
export default { export default {
components: { XmProductOverview, XmProductEdit, XmIterationLinkMng, XmProductProjectLinkMng },
components: { XmProductOverview, XmProductEdit, XmIterationLinkForProduct, XmProductProjectLinkMng },
computed: { computed: {
...mapGetters(["userInfo"]), ...mapGetters(["userInfo"]),
}, },

84
src/views/xm/core/xmProject/XmProjectOverviewComplex.vue

@ -8,85 +8,16 @@
<span slot="title">项目详情</span> <span slot="title">项目详情</span>
</el-menu-item> </el-menu-item>
<el-menu-item index="productProjectLink"> <el-menu-item index="productProjectLink">
<span slot="title">配置可见产品</span>
</el-menu-item>
<el-submenu index="project-change">
<template slot="title">
<span slot="title">项目变更</span>
</template>
<el-menu-item index="project-change-base-info">
<span slot="title">基础信息修改</span>
</el-menu-item>
<el-menu-item index="project-change-start">
<span slot="title">立项申请</span>
</el-menu-item>
<el-menu-item index="project-change-budget">
<span slot="title">预算+-</span>
</el-menu-item>
<el-menu-item index="project-change-cost">
<span slot="title">成本+-</span>
</el-menu-item>
<el-menu-item index="project-change-collection">
<span slot="title">收款</span>
</el-menu-item>
<el-menu-item index="project-change-conclusion">
<span slot="title">结项申请</span>
</el-menu-item>
<el-menu-item index="project-change-suspend">
<span slot="title">暂停申请</span>
</el-menu-item>
<el-menu-item index="project-change-activation">
<span slot="title">激活申请</span>
</el-menu-item>
<el-menu-item index="project-change-to-after-sales">
<span slot="title">转售后申请</span>
</el-menu-item>
<el-menu-item index="project-change-new-pm">
<span slot="title">项目经理变更申请</span>
</el-menu-item>
<el-menu-item index="project-change-new-leader">
<span slot="title">组长变更申请</span>
</el-menu-item>
</el-submenu>
<el-submenu index="menu-change">
<template slot="title">
<span slot="title">需求变更</span>
</template>
<el-menu-item index="menu-change-review">
<span slot="title">需求评审</span>
</el-menu-item>
<el-menu-item index="menu-change-border-review">
<span slot="title">需求边界异动</span>
</el-menu-item>
</el-submenu>
<el-submenu index="iteration-change">
<template slot="title">
<span slot="title">迭代变更</span>
</template>
<el-menu-item index="iteration-change-review">
<span slot="title">迭代计划评审</span>
</el-menu-item>
<el-menu-item index="iteration-change-border-review">
<span slot="title">迭代上线申请</span>
</el-menu-item>
</el-submenu>
<el-submenu index="phase-change">
<template slot="title">
<span slot="title">计划变更</span>
</template>
<el-menu-item index="phase-change-review">
<span slot="title">计划评审</span>
</el-menu-item>
<el-menu-item index="phase-change-border-review">
<span slot="title">预算变更</span>
</el-menu-item>
</el-submenu>
<span slot="title">关联产品</span>
</el-menu-item>
<el-menu-item index="iterationProjectLink">
<span slot="title">关联迭代</span>
</el-menu-item>
</el-menu> </el-menu>
<xm-project-overview v-if="showPanelName=='overview'" :sel-project="selProject"></xm-project-overview> <xm-project-overview v-if="showPanelName=='overview'" :sel-project="selProject"></xm-project-overview>
<xm-project-detail v-if="showPanelName=='detail'" :sel-project="selProject" @submit="afterEditSubmit"></xm-project-detail> <xm-project-detail v-if="showPanelName=='detail'" :sel-project="selProject" @submit="afterEditSubmit"></xm-project-detail>
<xm-product-project-link-mng v-if="showPanelName=='productProjectLink'" :sel-project="selProject"></xm-product-project-link-mng> <xm-product-project-link-mng v-if="showPanelName=='productProjectLink'" :sel-project="selProject"></xm-product-project-link-mng>
<xm-iteration-link-for-project v-if="showPanelName=='iterationProjectLink'" :sel-project="selProject"></xm-iteration-link-for-project>
</section> </section>
</template> </template>
@ -98,10 +29,11 @@ import { listXmProjectState } from '@/api/xm/core/xmProjectState';
import XmProjectOverview from './XmProjectOverview.vue'; import XmProjectOverview from './XmProjectOverview.vue';
import XmProjectDetail from './XmProjectDetail.vue'; import XmProjectDetail from './XmProjectDetail.vue';
import XmProductProjectLinkMng from '../xmProductProjectLink/XmProductProjectLinkMng.vue'; import XmProductProjectLinkMng from '../xmProductProjectLink/XmProductProjectLinkMng.vue';
import XmIterationLinkForProject from '../xmIterationLink/XmIterationLinkForProject.vue';
export default { export default {
components: { XmProjectOverview, XmProjectDetail, XmProductProjectLinkMng },
components: { XmProjectOverview, XmProjectDetail, XmProductProjectLinkMng ,XmIterationLinkForProject},
computed: { computed: {
...mapGetters(["userInfo"]), ...mapGetters(["userInfo"]),
}, },

Loading…
Cancel
Save