f86c9c69
“wangming”
添加库存管理和学习班级管理功能
|
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
</el-table-column>
<el-table-column prop="className" label="班级名称" width="150" />
<el-table-column prop="hrBelong" label="HR归属" width="120" />
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button type="text" size="small" @click="viewStudyRecords(scope.row)">学习记录</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="pagination-section">
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="pagination.pageIndex" :page-sizes="[10, 20, 50, 100]"
:page-size="pagination.pageSize" layout="total, sizes, prev, pager, next, jumper"
:total="pagination.total">
</el-pagination>
</div>
</div>
</div>
|
f86c9c69
“wangming”
添加库存管理和学习班级管理功能
|
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
|
</el-dialog>
</template>
<script>
import { getStudentListByClassId } from '@/api/extend/lqStudyClass'
export default {
name: 'StudentListDialog',
data() {
return {
visible: false,
loading: false,
classId: '',
className: '',
studentList: [],
query: {
employeeName: '',
employeePhone: '',
employeeId: '',
hrBelong: '',
classId: ''
},
pagination: {
pageIndex: 1,
pageSize: 20,
total: 0
}
}
},
methods: {
init(classId, className) {
this.visible = true
this.classId = classId
this.className = className
this.query.classId = classId
this.getStudentList()
},
// 获取学员列表
getStudentList() {
this.loading = true
const params = {
...this.query,
currentPage: this.pagination.pageIndex,
pageSize: this.pagination.pageSize
}
getStudentListByClassId(params).then(response => {
if (response.code === 200) {
this.studentList = response.data.list || []
this.pagination.total = (response.data.pagination && response.data.pagination.total) || 0
} else {
this.$message.error(response.msg || '获取学员列表失败')
}
this.loading = false
}).catch(() => {
this.loading = false
})
},
// 搜索
search() {
this.pagination.pageIndex = 1
this.getStudentList()
},
// 重置
reset() {
this.query = {
employeeName: '',
employeePhone: '',
employeeId: '',
hrBelong: '',
classId: this.classId
}
this.pagination.pageIndex = 1
this.getStudentList()
},
// 分页大小改变
handleSizeChange(val) {
this.pagination.pageSize = val
this.pagination.pageIndex = 1
this.getStudentList()
},
// 当前页改变
handleCurrentChange(val) {
this.pagination.pageIndex = val
this.getStudentList()
},
// 查看学习记录
viewStudyRecords(row) {
this.$emit('viewStudyRecords', row)
},
// 关闭弹窗
closeDialog() {
this.visible = false
this.studentList = []
this.query = {
employeeName: '',
employeePhone: '',
employeeId: '',
hrBelong: '',
classId: ''
}
this.pagination = {
pageIndex: 1,
pageSize: 20,
total: 0
}
}
}
}
</script>
<style scoped>
.student-list-container {
|