index.vue
4.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<template>
<div class="square-main" v-loading="loading">
<GLDialog title="发送人筛选" :visible.sync="dialogVisible">
<el-form :inline="true" :model="tableSearchForm">
<el-form-item size="small" label="员工姓名">
<el-input v-model="tableSearchForm.staffName" placeholder="输入关键字搜索"></el-input>
</el-form-item>
<el-form-item size="small">
<el-button type="primary" @click="handleSearch">查询</el-button>
</el-form-item>
</el-form>
<GLTable :hasNum="true" v-if="dialogVisible" @refreshTable="handleSearch" ref="table" :layout="layout"
:tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams">
<div fixed="left" slot="options" slot-scope="scope">
<el-radio :label="scope.scope.idBefEncryption" v-model="selectId"></el-radio>
</div>
</GLTable>
<span slot="footer" class="dialog-footer">
<el-button plain size="small" @click="handleCancel">取 消</el-button>
<el-button size="small" type="primary" @click.native="handleSelect">确 定</el-button>
</span>
</GLDialog>
</div>
</template>
<script>
import {utils} from 'glsx-common'
import util from '@/utils/util'
export default {
name: 'SelectEmployees ',
data() {
return {
selectId: null,
// loading: false,
dialogVisible: false,
tableSearchForm: {},
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
tableParams: {
listName: 'data',
tableOption: false,
// 行数据的key
mutiSelectUniqueKey: 'id',
tableColumns: [
{
label: '',
prop: '',
fixed: 'left',
width:'80',
addHtml: 'options'
},
{
label: '员工姓名',
prop: 'staffName',
width:'220',
},
{
label: '企业微信',
prop: 'entmicroName'
}
]
},
layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [],
tableTotal: 0,
selectEmp: [],
typeselect: '',
selectUuid: ''
}
},
methods: {
selectableStaff() {
let params = {
...JSON.parse(JSON.stringify(this.tableSearchForm)),
pageSize: this.$refs.table.page.pageSize,
pageNum: this.$refs.table.page.pageNum,
loginStatus: 1
}
this.$apis.collocation.wechatDepositNotAccessList(params).then(res => {
this.tableData = res.data ? res.data : []
this.tableTotal = res.count
})
},
init() {
this.tableSearchForm = {}
this.dialogVisible = true
this.$nextTick(() => {
this.$refs.table.page.pageNum = 1
this.selectableStaff()
})
},
handleSearch() {
this.selectableStaff()
},
handleClose() {
this.handleCancel()
},
handleCancel: utils.debounce(function () {
this.dialogVisible = false
}, 300),
handleSelect: utils.debounce(function () {
if (!this.selectId) {
this.$message.error('请选择发送人')
return
}
let list = this.tableData.filter(item => {
return item['idBefEncryption'] == this.selectId
})
let selectEmp = {
staffName: list[0].staffName,
staffCloudIdList: list[0].idBefEncryption,
staffId: list[0].id
}
this.dialogVisible = false
this.$emit('selectSender', selectEmp)
}, 300)
}
}
</script>
<style lang="scss" scoped>
/deep/ .glsx-table .emptyBg .noDataImg {
margin-top: 150px !important;
}
/deep/ .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled) .el-radio__inner {
box-shadow: none;
}
/deep/ .el-radio__label {
display: none;
}
.dialog-jump {
color: #5850ff;
float: left;
line-height: 24px;
text-decoration: underline;
cursor: pointer;
}
.square-main {
/deep/ {
.el-table {
height: 40vh;
overflow-y: auto;
}
.el-table::before {
left: 0;
bottom: 0;
width: 100%;
height: 0px;
}
}
}
</style>