viewConfig.vue
6.14 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<template>
<div>
<div class="container">
<div class="title">{{ routerInfo.merchantName }}</div>
<GLCombiForm :formObj="searchForm" :rowNumber="1" :formData="searchFormData" @handleOk="getListApi" @handleRest="handleReset"></GLCombiForm>
<div class="tableBox">
<GLTable ref="accountCodeTable" @refreshTable="getListApi" :noDataImg="url" :layout="layout" :tableData="accountTableData" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :tableTotal="tableTotal" @setTableFinishFun="setTableFinishFun">
<!-- 账号许可类型 -->
<div slot="type" slot-scope="scope">
<span v-if="scope.scope.type == 1">基础帐号</span>
<span v-else>互通帐号</span>
</div>
<!-- 账号激活状态 -->
<div slot="status" class="dot" slot-scope="scope">
<div :class="accountStatus[scope.scope.status]"></div>
<span v-if="scope.scope.status == 1">未绑定</span>
<span v-if="scope.scope.status == 2">已绑定</span>
<span v-if="scope.scope.status == 3">已过期</span>
<span v-if="scope.scope.status == 4">待转移</span>
<span v-if="scope.scope.status == 5">已合并</span>
</div>
<template slot="auth-button" slot-scope="scope" :data="scope.scope" v-if="scope.scope.status == 2">
<el-button type="text" @click="handelTransfer(scope.scope)">转移</el-button>
</template>
</GLTable>
</div>
</div>
<TransferDia ref="TransferDia" :dialogTransferVisible="dialogTransferVisible" @transferStaff="getListApi"></TransferDia>
</div>
</template>
<script>
const accountStatus = {
'1': 'dot1',
'2': 'normal',
'3': 'dot3',
'4': 'dot6',
'5': 'normal'
}
import url from '@/assets/empty.png'
import TransferDia from './transferDia'
export default {
name: 'ConfigDetail',
components: {
TransferDia
},
data() {
return {
url,
accountStatus,
searchForm: {
status: '',
staffName: ''
},
transferForm: {
staff: ''
},
routerInfo: '',
dialogTransferVisible: false,
accountTableData: [],
tableTotal: 0,
notActiveStaffList: [],
expireTime: '',
takeoverUserid: '',
handoverUserid: '',
searchFormData: [
{
label: '激活状态',
name: 'status',
type: 'select',
optionList: [
{
label: '全部',
value: ''
},
{
label: '未绑定',
value: 1
},
{
label: '已绑定',
value: 2
},
{
label: '已过期',
value: 3
},
{
label: '待转移',
value: 4
},
{
label: '已合并',
value: 5
}
],
optionId: 'value',
optionLabel: 'label',
isClear: true
},
{
label: '员工姓名',
name: 'staffName',
type: 'input',
isClear: true,
placeholder: '输入关键字搜索'
}
],
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '帐号许可类型',
prop: 'type',
addHtml: 'type'
},
{
label: '激活状态',
prop: 'status',
addHtml: 'status'
},
{
label: '绑定员工',
prop: 'staffName'
},
{
label: '手机号码',
prop: 'staffPhone'
},
{
label: '激活时间',
prop: 'activeTime'
},
{
label: '有效期',
prop: 'expireTime'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
layout: 'sizes, prev, pager, next, jumper, ->, total'
}
},
mounted() {
this.routerInfo = this.$route.query
this.getListApi()
},
methods: {
getListApi() {
const { status, staffName } = this.searchForm
const { merchantId, corpId } = this.routerInfo
let params = {
merchantId,
corpId,
status,
staffName
}
params.pageSize = this.$refs.accountCodeTable.page.pageSize
params.pageNum = this.$refs.accountCodeTable.page.pageNum
this.$apis.accountConfig.listAccountCodeWithPage(params).then(res => {
if (res) {
this.accountTableData = res.list
this.tableTotal = res.total
}
})
},
// 账号许可转移弹窗
handelTransfer(scope) {
this.dialogTransferVisible = true
this.$refs.TransferDia.init(scope, this.routerInfo)
},
// 选择转移员工
selectTransferStaff(id) {
this.takeoverUserid = id
},
// 关闭弹窗
handleClose() {
this.dialogTransferVisible = false
this.transferForm.staff = ''
},
// 搜索框搜索
handleSearch() {
this.$refs.accountCodeTable.refreshTable()
},
// 重置搜索框搜索
handleReset() {
this.searchForm = {
status: '',
staffName: ''
}
this.getListApi()
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.accountCodeTable.data.length ? (this.$refs.accountCodeTable.tableHeightValues = '') : this.$refs.accountCodeTable.setTableHeightFun()
}
}
}
</script>
<style lang="scss" scoped>
.container {
background-color: #fff;
.title {
height: 58px;
margin-bottom: 20px;
padding-left: 20px;
font-size: 16px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 600;
color: #333333;
line-height: 58px;
border-bottom: 1px solid #e5e5e5;
}
.tableBox {
padding: 0 20px 60px 20px;
}
}
.trans-dia {
/deep/ .el-form-item__label {
width: 154px;
}
/deep/ .el-select {
width: 474px;
}
}
/deep/ .el-dialog__title {
font-weight: 600;
}
.global-messageZindex {
z-index: 3000 !important;
}
</style>