考核组筛选

This commit is contained in:
leave 2020-10-28 20:35:53 +08:00
parent a60081173e
commit 2961552a07
2 changed files with 272 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 考核任务列表
export function apiGetEvaluationTeamList (query) {
return request({
url: '/lz_management/evaluationGroup/getGroups',
method: 'post',
data: query
})
}

View File

@ -0,0 +1,262 @@
//
<template>
<div class="team-filter commonFont">
<el-dialog
title="考评组筛选"
:visible.sync="dialogVisible"
:before-close="handleCancel"
width="920"
>
<div class="team-filter-content">
<el-col
:span="12"
class="team-filter-content-left"
>
<el-input
prefix-icon="el-icon-search"
v-model="searchName"
@change="handleSearchChange"
placeholder="搜索考评组"
size="small"
></el-input>
<el-table
:data="tableList"
ref="refChooseTable"
max-height="394"
@selection-change="handleSelectionChange"
v-if="tableList.length"
>
<el-table-column
type="selection"
width="40"
></el-table-column>
<el-table-column
prop="name"
label="全选"
></el-table-column>
<el-table-column
prop="counts"
align="right"
width="100"
></el-table-column>
</el-table>
<el-pagination
:hide-on-single-page="true"
:current-page.sync="pageInfo.currPage"
:page-size="pageInfo.pageSize"
:total="pageInfo.totalCount"
:page-count="pageInfo.totalPage"
@current-change="handleCurrentChange"
layout="total, prev, pager, next, jumper"
></el-pagination>
</el-col>
<el-col
:span="12"
class="team-filter-content-right"
>
<div class="team-filter-content-right-header">
<div>已选择{{seleactedList.length}}</div>
<el-button
type="text"
@click="handleClear"
style=""
>清空选择</el-button>
</div>
<el-table
:data="seleactedList"
:show-header="false"
max-height="394"
:row-key="handleGetRowKeys"
v-if="seleactedList.length>0"
>
<el-table-column
type="selection"
width="40"
:reserve-selection="true"
>
<template slot-scope="scope">
<i
class="el-icon-circle-close team-filter-content-right-clear"
@click="handleDelete( scope.row,scope.$index)"
></i>
</template>
</el-table-column>
<el-table-column prop="name"></el-table-column>
<el-table-column
prop="counts"
width="100"
align="right"
></el-table-column>
</el-table>
</el-col>
</div>
<div slot="footer">
<el-button
@click="handleCancel"
size="small"
> </el-button>
<el-button
type="primary"
size="small"
@click="handleSubmit"
>筛选</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { apiGetEvaluationTeamList } from '@/api/dialogEvaluationTeam'
export default {
props: {
dialogVisible: {
type: Boolean,
default: false
},
filtersDic: {
type: Object,
default: () => {
return {}
}
}
},
data () {
return {
searchName: '',
tableList: [{
copyId: 0,
counts: 53,
depIds: '154322459',
gmtCreate: '2020-10-26 11:22:01',
gmtModified: '2020-10-27 14:30:47',
id: 57,
isDelete: 0,
managerIds: '380',
name: '1231',
outIds: '322,379,380,387,388,389,391,410,825',
score: 0,
staffIds: ''
}],
seleactedList: [],
pageInfo: {
currPage: 1,
pageSize: 20,
totalCount: 1,
totalPage: 1
}
}
},
created () {
},
mounted () {
},
watch: {
dialogVisible (newVal, oldVal) {
if (newVal) {
if (this.filtersDic.currPage === undefined || !this.filtersDic.currPage) {
this.filtersDic['currPage'] = this.pageInfo.currPage
}
if (this.filtersDic.pageSize === undefined || !this.filtersDic.pageSize) {
this.filtersDic['pageSize'] = this.pageInfo.pageSize
}
this.handleDataList()
}
}
},
methods: {
handleDataList () {
apiGetEvaluationTeamList(this.filtersDic).then(res => {
this.pageInfo.currPage = res.data.currPage
this.pageInfo.totalCount = res.data.totalCount
this.pageInfo.totalPage = res.data.totalPage
this.tableList = res.data.list
})
// for (let index = 0; index < 100; index++) {
// let dic = { id: index.toString(), name: '12' + index.toString(), count: '12' }
// this.tableList.push(dic)
// }
},
// handleGetRowStyle () {
// return { 'height': '44px' }
// },
handleSearchChange () {
//
this.filtersDic['name'] = this.searchName
this.handleDataList()
},
handleGetRowKeys (row) {
return row.id
},
handleCancel () {
this.handleClear()
this.$emit('close')
},
handleSubmit () {
this.$emit('submitClick', this.seleactedList)
},
handleSelectionChange (val) {
this.seleactedList = val
},
handleCurrentChange (val) {
this.pageInfo.currPage = val
this.filtersDic['currPage'] = this.pageInfo.currPage
this.handleDataList()
},
handleClear () {
this.seleactedList = []
this.$refs.refChooseTable.clearSelection()
},
handleDelete (item, index) {
this.seleactedList.splice(index, 1)
this.$refs.refChooseTable.toggleRowSelection(item, false)
}
}
}
</script>
<style lang="less">
.team-filter {
.el-dialog__body {
padding: 0px 20px 0px 20px !important;
}
.el-dialog__footer {
border-top: 1px solid @borderColor !important;
}
}
</style>
<style lang="less" scoped>
.team-filter {
&-content {
width: 100%;
height: 425px;
border-bottom: 1 solid @borderColor;
&-left {
height: 100%;
border-right: 1px solid @borderColor;
padding-right: 20px;
}
&-right {
height: 100%;
padding-left: 20px;
&-header {
width: 100%;
height: 32px;
display: flex;
border-bottom: 1px solid @borderColor;
justify-content: space-between;
.el-button {
padding-top: 0px;
}
}
&-clear {
width: 40px;
height: 23px;
line-height: 23px;
}
}
}
// .el-dialog__footer {
// border-top: 1 solid @borderColor !important;
// }
}
</style>