|
@@ -144,6 +144,13 @@
|
|
|
<a @click="editStudent(text, 'edit')">编辑</a>
|
|
|
<a-divider type="vertical" />
|
|
|
<a @click="buyCourse(text)">购课</a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a-popconfirm
|
|
|
+ title="确定删除吗?"
|
|
|
+ @confirm="delStudent(record.id)"
|
|
|
+ >
|
|
|
+ <a>删除</a>
|
|
|
+ </a-popconfirm>
|
|
|
</span>
|
|
|
</a-table>
|
|
|
</a-card>
|
|
@@ -152,7 +159,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getComplex } from '@/api/student'
|
|
|
+import { getComplex, delLearnerById } from '@/api/student'
|
|
|
import mixinOptions from '@/mixin/index'
|
|
|
import AddStudent from './components/addStudent'
|
|
|
|
|
@@ -237,6 +244,30 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ async delStudent (id) {
|
|
|
+ const { code } = await delLearnerById(id)
|
|
|
+ if (code === 0) {
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ this.getComplex()
|
|
|
+ } else {
|
|
|
+ this.$message.error('删除失败')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getCourse () {
|
|
|
+ this.getSelectList('course').then(res => {
|
|
|
+ this.courseList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getGrade () {
|
|
|
+ this.getSelectList('grade').then(res => {
|
|
|
+ this.classList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getTeacher () {
|
|
|
+ this.getSelectList('teacher').then(res => {
|
|
|
+ this.roleList = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
changePagination (page) {
|
|
|
console.log(page)
|
|
|
this.queryParams.curPage = page
|