|
|
|
@ -1,17 +1,17 @@ |
|
|
|
<template> |
|
|
|
<section> |
|
|
|
<el-popover |
|
|
|
<section> |
|
|
|
<el-popover |
|
|
|
placement="bottom" |
|
|
|
width="400" |
|
|
|
trigger="manual" |
|
|
|
v-model="projectVisible"> |
|
|
|
|
|
|
|
<el-row > |
|
|
|
v-model="projectVisible"> |
|
|
|
|
|
|
|
<el-row > |
|
|
|
<!--列表 XmProject 项目表--> |
|
|
|
<el-table ref="table" :height="maxTableHeight" :data="xmProjects" :row-class-name="tableRowClassName" @sort-change="sortChange" :highlight-current-row="true" current-row-key="id" v-loading="load.list" border @selection-change="selsChange" @row-click="rowClick" style="width: 100%;"> |
|
|
|
<el-table-column prop="name" label="项目名称"> |
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
项目名称 |
|
|
|
<el-table-column prop="name" label="项目名称"> |
|
|
|
<template slot="header" slot-scope="scope"> |
|
|
|
项目名称 |
|
|
|
<span style="float:right;"> |
|
|
|
<el-button type="text" @click="clearSelect">清空</el-button> |
|
|
|
<el-button type="text" @click="close">关闭</el-button> |
|
|
|
@ -21,17 +21,17 @@ |
|
|
|
width="400" |
|
|
|
v-model="moreVisible" |
|
|
|
trigger="manual" > |
|
|
|
<el-row> |
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
<font class="more-label-font">项目编号:</font> |
|
|
|
<el-input v-model="filters.id" style="width:100%;" placeholder="输入项目编号" @keyup.enter.native="searchXmProjects"> |
|
|
|
</el-input> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
<font class="more-label-font">项目编号:</font> |
|
|
|
<el-input v-model="filters.id" style="width:100%;" placeholder="输入项目编号" @keyup.enter.native="searchXmProjects"> |
|
|
|
</el-input> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
|
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
<font class="more-label-font">创建时间:</font> |
|
|
|
<font class="more-label-font">创建时间:</font> |
|
|
|
<el-date-picker |
|
|
|
v-model="dateRanger" |
|
|
|
v-model="dateRanger" |
|
|
|
type="daterange" |
|
|
|
align="right" |
|
|
|
unlink-panels |
|
|
|
@ -41,43 +41,43 @@ |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
:default-time="['00:00:00','23:59:59']" |
|
|
|
:picker-options="pickerOptions" |
|
|
|
></el-date-picker> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
></el-date-picker> |
|
|
|
</el-col> |
|
|
|
|
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
<font class="more-label-font"> |
|
|
|
项目名称: |
|
|
|
</font> |
|
|
|
<el-input v-model="filters.key" style="width:100%;" placeholder="输入项目名字关键字"> |
|
|
|
</el-input> |
|
|
|
</font> |
|
|
|
<el-input v-model="filters.key" style="width:100%;" placeholder="输入项目名字关键字"> |
|
|
|
</el-input> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
<font class="more-label-font"> |
|
|
|
项目经理: |
|
|
|
</font> |
|
|
|
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag> |
|
|
|
</font> |
|
|
|
<el-tag v-if="filters.pmUser" closable @click="selectFiltersPmUser" @close="clearFiltersPmUser()">{{filters.pmUser.username}}</el-tag> |
|
|
|
<el-button v-else @click="selectFiltersPmUser()">选责任人</el-button> |
|
|
|
<el-button @click="setFiltersPmUserAsMySelf()">我的</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24" style="padding-top:5px;"> |
|
|
|
<el-button type="text" @click="moreVisible=false" >关闭</el-button><el-button type="primary" @click="searchXmProjects" >查询</el-button> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
<el-button type="text" slot="reference" @click="moreVisible=!moreVisible" style="float:right;">更多条件</el-button> |
|
|
|
</el-popover> |
|
|
|
</el-popover> |
|
|
|
</span> |
|
|
|
</template> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<font>{{scope.row.name}}</font> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
<el-pagination layout="total, prev, 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-row> |
|
|
|
<el-pagination layout="total, prev, 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-row> |
|
|
|
<span slot="reference" @click="referenceClick"> |
|
|
|
<slot name="reference"><el-link title="项目,点击选择、清除选择" type="warning" icon="el-icon-search"><font style="font-size:14px;"><slot name="title">{{editForm && editForm.id?editForm.name:'选择项目'}}</slot></font></el-link> </slot> |
|
|
|
</span> |
|
|
|
</el-popover> |
|
|
|
</el-popover> |
|
|
|
<el-drawer title="选择员工" :visible.sync="selectFiltersPmUserVisible" size="60%" append-to-body> |
|
|
|
<users-select @confirm="onFiltersPmUserSelected" ref="usersSelect"></users-select> |
|
|
|
</el-drawer> |
|
|
|
@ -88,12 +88,12 @@ |
|
|
|
import util from '@/common/js/util';//全局公共库 |
|
|
|
//import Sticky from '@/components/Sticky' // 粘性header组件 |
|
|
|
//import { initSimpleDicts } from '@/api/mdp/meta/item';//下拉框数据查询 |
|
|
|
import { listXmProject } from '@/api/xm/core/xmProject'; |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|
|
|
import { listXmProject } from '@/api/xm/core/xmProject'; |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import UsersSelect from "@/views/mdp/sys/user/UsersSelect"; |
|
|
|
const map=new Map(); |
|
|
|
|
|
|
|
export default { |
|
|
|
|
|
|
|
export default { |
|
|
|
props:['linkProductId','linkIterationId','autoSelect'], |
|
|
|
computed: { |
|
|
|
...mapGetters([ |
|
|
|
@ -104,7 +104,7 @@ |
|
|
|
linkIterationId(){ |
|
|
|
this.initData(); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
linkProductId(){ |
|
|
|
this.initData(); |
|
|
|
} |
|
|
|
@ -115,9 +115,9 @@ |
|
|
|
beginDate.setTime(beginDate.getTime() - 3600 * 1000 * 24 * 7 * 4 * 12 ); |
|
|
|
return { |
|
|
|
filters: { |
|
|
|
key: '', |
|
|
|
key: '', |
|
|
|
id:'',//项目编号 |
|
|
|
pmUser:null,//项目经理 |
|
|
|
pmUser:null,//项目经理 |
|
|
|
|
|
|
|
}, |
|
|
|
xmProjects: [],//查询结果 |
|
|
|
@ -131,29 +131,29 @@ |
|
|
|
}, |
|
|
|
load:{ list: false, edit: false, del: false, add: false },//查询中... |
|
|
|
sels: [],//列表选中数据 |
|
|
|
dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|
|
|
|
|
|
|
dicts:{},//下拉选择框的所有静态数据 params=[{categoryId:'0001',itemCode:'sex'}] 返回结果 {'sex':[{optionValue:'1',optionName:'男',seqOrder:'1',fp:'',isDefault:'0'},{optionValue:'2',optionName:'女',seqOrder:'2',fp:'',isDefault:'0'}]} |
|
|
|
|
|
|
|
//新增xmProject界面初始化数据 |
|
|
|
addForm: { |
|
|
|
id:'',name:'',branchId:'',remark:'' |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//编辑xmProject界面初始化数据 |
|
|
|
editForm: { |
|
|
|
id:'',name:'',branchId:'',remark:'' |
|
|
|
}, |
|
|
|
}, |
|
|
|
selectFiltersPmUserVisible:false, |
|
|
|
maxTableHeight:300, |
|
|
|
dateRanger: [ ], |
|
|
|
dateRanger: [ ], |
|
|
|
pickerOptions: util.pickerOptions('datarange'), |
|
|
|
projectVisible:false, |
|
|
|
moreVisible:false, |
|
|
|
moreVisible:false, |
|
|
|
hadInit:false, |
|
|
|
} |
|
|
|
},//end data |
|
|
|
methods: { |
|
|
|
handleSizeChange(pageSize) { |
|
|
|
this.pageInfo.pageSize=pageSize; |
|
|
|
methods: { |
|
|
|
handleSizeChange(pageSize) { |
|
|
|
this.pageInfo.pageSize=pageSize; |
|
|
|
this.getXmProjects(); |
|
|
|
}, |
|
|
|
handleCurrentChange(pageNum) { |
|
|
|
@ -175,9 +175,9 @@ |
|
|
|
this.getXmProjects(); |
|
|
|
}, |
|
|
|
searchXmProjects(){ |
|
|
|
this.pageInfo.count=true; |
|
|
|
this.pageInfo.count=true; |
|
|
|
this.getXmProjects(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
//获取列表 XmProject 项目表 |
|
|
|
getXmProjects() { |
|
|
|
let params = { |
|
|
|
@ -188,31 +188,31 @@ |
|
|
|
}; |
|
|
|
if(this.pageInfo.orderFields!=null && this.pageInfo.orderFields.length>0){ |
|
|
|
let orderBys=[]; |
|
|
|
for(var i=0;i<this.pageInfo.orderFields.length;i++){ |
|
|
|
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.linkProductId){ |
|
|
|
params.linkProductId=this.linkProductId |
|
|
|
} |
|
|
|
if(this.linkIterationId){ |
|
|
|
params.linkIterationId=this.linkIterationId |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.filters.id){ |
|
|
|
params.id=this.filters.id |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(this.filters.pmUser){ |
|
|
|
params.pmUserid=this.filters.pmUser.userid |
|
|
|
} |
|
|
|
this.load.list = true; |
|
|
|
listXmProject(params).then((res) => { |
|
|
|
var tips=res.data.tips; |
|
|
|
if(tips.isOk){ |
|
|
|
if(tips.isOk){ |
|
|
|
this.pageInfo.total = res.data.total; |
|
|
|
this.pageInfo.count=false; |
|
|
|
this.xmProjects = res.data.data; |
|
|
|
@ -221,46 +221,46 @@ |
|
|
|
}else if(this.linkProductId){ |
|
|
|
map.set(this.linkProductId,this.xmProjects) |
|
|
|
} |
|
|
|
if(this.autoSelect!==false&&this.xmProjects.length>0 && this.projectVisible==false){ |
|
|
|
var row=this.xmProjects[0]; |
|
|
|
if(this.autoSelect!==false&&this.xmProjects.length>0 && this.projectVisible==false){ |
|
|
|
var row=this.xmProjects[0]; |
|
|
|
this.$refs.table.setCurrentRow(row); |
|
|
|
this.rowClick(row); |
|
|
|
this.rowClick(row); |
|
|
|
} |
|
|
|
}else{ |
|
|
|
this.$notify({showClose: true, message: tips.msg, type: 'error' }); |
|
|
|
} |
|
|
|
} |
|
|
|
this.load.list = false; |
|
|
|
}).catch( err => this.load.list = false ); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//选择行xmProject |
|
|
|
selsChange: function (sels) { |
|
|
|
this.sels = sels; |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
rowClick: function(row, event, column){ |
|
|
|
this.editForm=row |
|
|
|
this.$emit('row-click',row, event, column);// @row-click="rowClick" |
|
|
|
this.selectedProduct(row) |
|
|
|
this.selectedProduct(row) |
|
|
|
this.projectVisible=false; |
|
|
|
this.moreVisible=false; |
|
|
|
}, |
|
|
|
selectedProduct:function(row){ |
|
|
|
this.editForm=row |
|
|
|
this.$emit('selected',row); |
|
|
|
this.$emit('selected',row); |
|
|
|
this.projectVisible=false; |
|
|
|
this.moreVisible=false; |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/**begin 自定义函数请在下面加**/ |
|
|
|
clearFiltersPmUser:function(){ |
|
|
|
this.filters.pmUser=null; |
|
|
|
this.searchXmProjects(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
selectFiltersPmUser(){ |
|
|
|
this.selectFiltersPmUserVisible=true; |
|
|
|
}, |
|
|
|
onFiltersPmUserSelected(users){ |
|
|
|
onFiltersPmUserSelected(users){ |
|
|
|
if(users && users.length>0){ |
|
|
|
this.filters.pmUser=users[0] |
|
|
|
}else{ |
|
|
|
@ -272,10 +272,10 @@ |
|
|
|
setFiltersPmUserAsMySelf(){ |
|
|
|
this.filters.pmUser=this.userInfo; |
|
|
|
this.searchXmProjects(); |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tableRowClassName({row, rowIndex}) { |
|
|
|
if (row.id == this.editForm.id) { |
|
|
|
if (row && this.editForm && row.id == this.editForm.id) { |
|
|
|
return 'success-row'; |
|
|
|
} |
|
|
|
return ''; |
|
|
|
@ -292,18 +292,18 @@ |
|
|
|
this.moreVisible=false; |
|
|
|
this.$emit("close"); |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
initData(){ |
|
|
|
|
|
|
|
|
|
|
|
if(this.linkIterationId){ |
|
|
|
var xmProjects=map.get(this.linkIterationId); |
|
|
|
if(xmProjects){ |
|
|
|
this.xmProjects=xmProjects; |
|
|
|
if(this.projectVisible==false){ |
|
|
|
if(this.autoSelect!==false && this.xmProjects.length>0){ |
|
|
|
var row=this.xmProjects[0]; |
|
|
|
var row=this.xmProjects[0]; |
|
|
|
this.$refs.table.setCurrentRow(row); |
|
|
|
this.rowClick(row); |
|
|
|
this.rowClick(row); |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
@ -312,12 +312,12 @@ |
|
|
|
}else if(this.linkProductId){ |
|
|
|
var xmProjects=map.get(this.linkProductId); |
|
|
|
if(xmProjects){ |
|
|
|
this.xmProjects=xmProjects; |
|
|
|
this.xmProjects=xmProjects; |
|
|
|
if(this.projectVisible==false){ |
|
|
|
if(this.autoSelect!==false && this.xmProjects.length>0){ |
|
|
|
var row=this.xmProjects[0]; |
|
|
|
var row=this.xmProjects[0]; |
|
|
|
this.$refs.table.setCurrentRow(row); |
|
|
|
this.rowClick(row); |
|
|
|
this.rowClick(row); |
|
|
|
} |
|
|
|
} |
|
|
|
}else{ |
|
|
|
@ -327,7 +327,7 @@ |
|
|
|
this.searchXmProjects(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
referenceClick(){ |
|
|
|
if(!this.hadInit){ |
|
|
|
this.initData(); |
|
|
|
@ -336,22 +336,22 @@ |
|
|
|
this.projectVisible=!this.projectVisible; |
|
|
|
} |
|
|
|
},//end methods |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
UsersSelect, |
|
|
|
//在下面添加其它组件 |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|
|
|
mounted() { |
|
|
|
this.$nextTick(() => { |
|
|
|
this.maxTableHeight = util.calcTableMaxHeight(this.$refs.table.$el); |
|
|
|
if(this.autoSelect!==false){ |
|
|
|
this.initData(); |
|
|
|
this.hadInit=true; |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
|
|
|
|
|
|
|
|
@ -361,6 +361,6 @@ |
|
|
|
padding-top:5px; |
|
|
|
} |
|
|
|
.align-right{ |
|
|
|
float: right; |
|
|
|
float: right; |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |