提交 db90ccd3 authored 作者: pengxiaohui's avatar pengxiaohui

bug fixes

上级 a1271880
...@@ -75,6 +75,9 @@ export default { ...@@ -75,6 +75,9 @@ export default {
this.fetchCourseRelation() this.fetchCourseRelation()
}).catch(() => {}); }).catch(() => {});
}, },
handleCancel() {
this.$emit('input', false)
},
fetchCourseRelation() { fetchCourseRelation() {
const msg = this.isEdit ? '删除课程' : '添加课程' const msg = this.isEdit ? '删除课程' : '添加课程'
const params = { const params = {
......
...@@ -191,9 +191,10 @@ export default { ...@@ -191,9 +191,10 @@ export default {
} else this.expands = [] } else this.expands = []
}, },
handleSave() { handleSave() {
console.log(this.tableData)
for (let i = 0; i < this.tableData.length; i++) { for (let i = 0; i < this.tableData.length; i++) {
const item = this.tableData[i] const item = this.tableData[i]
if (!item.status) { if (!item.graduation_status) {
this.$message.error('请选择项目状态') this.$message.error('请选择项目状态')
this.expands = [this.tableData[i].id] this.expands = [this.tableData[i].id]
return false return false
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</div> </div>
</template> </template>
<script> <script>
import { getStudentDegreeList, saveStudentDegree, getStudentCourseList } from '@/api/student' import { getStudentDegreeList, saveStudentDegree, getStudentCourseList, deleteStudentDegree } from '@/api/student'
const defaultForm = { const defaultForm = {
major: '', major: '',
level: '', level: '',
...@@ -94,7 +94,12 @@ export default { ...@@ -94,7 +94,12 @@ export default {
this.form = val this.form = val
}, },
handleDelete(val) { handleDelete(val) {
console.log(val) this.$confirm('此操作将删除此关联学位,确认执行操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(() => {
this.fetchDeleteDegree(val.id)
})
}, },
handleClose() { handleClose() {
this.form = Object.assign({ student_id: this.id }, defaultForm) this.form = Object.assign({ student_id: this.id }, defaultForm)
...@@ -134,6 +139,16 @@ export default { ...@@ -134,6 +139,16 @@ export default {
this.$message.error(this.dialogTitle + '失败') this.$message.error(this.dialogTitle + '失败')
} }
}) })
},
fetchDeleteDegree(id) {
deleteStudentDegree(id).then(res => {
if (res.code === 0 && res.message === 'OK') {
this.$message.success('删除学位成功')
this.fetchDegreeList()
} else {
this.$message.error('删除学位失败')
}
})
} }
} }
} }
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
<!-- 图片 --> <!-- 图片 -->
<template v-slot:table_img="{ row }"> <template v-slot:table_img="{ row }">
<img v-if="row.head_img" :src="row.head_img" height="60" width="60"/> <img v-if="row.head_img" :src="row.head_img" height="60" width="60"/>
<img v-else src="https://zws-imgs-pub.ezijing.com/c78a145ba87f1b0d2f5752a0eb4c9851.jpg" height="60" width="60">
</template> </template>
<!-- Id --> <!-- Id -->
<template v-slot:table_id="scope"> <template v-slot:table_id="scope">
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论