新增学员:支持零业务引用档案安全删除与引用保护

This commit is contained in:
wangzhibiao committed 2026-09-20 16:16:58 +08:00
1 parent 2dc22b06f8
commit 225f58481a
13 files changed
+469 -5

No files matched your search

+8
View File
@@ -51,3 +51,11 @@ export function unbindStudentUser(sId) {
method: 'delete'
})
}
// 删除学员主档
export function delStudent(sId) {
return request({
url: '/train/student/' + sId,
method: 'delete'
})
}
+21 -2
View File
@@ -98,7 +98,7 @@
<el-tag v-else type="info" size="mini">未关联</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="160">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210">
<template slot-scope="scope">
<el-button
v-hasPermi="['train:student:query']"
@@ -124,6 +124,14 @@
style="color: #F56C6C;"
@click="handleUnbind(scope.row)"
>解绑账号</el-button>
<el-button
v-hasPermi="['train:student:remove']"
size="mini"
type="text"
icon="el-icon-delete"
style="color: #F56C6C;"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -267,7 +275,7 @@
</template>
<script>
import { addStudent, getStudent, listStudent, getStudentBindableUsers, bindStudentUser, unbindStudentUser } from '@/api/train/student'
import { addStudent, getStudent, listStudent, delStudent, getStudentBindableUsers, bindStudentUser, unbindStudentUser } from '@/api/train/student'
export default {
name: 'Student',
@@ -440,6 +448,17 @@ export default {
this.getList()
})
},
/** 删除按钮操作 */
handleDelete(row) {
const sId = row.sId;
const sName = row.sName;
this.$modal.confirm(`确定删除学员【${sName} / ${sId}】吗?`).then(() => {
return delStudent(sId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
sourceTypeLabel(sourceType) {
const labels = {
1: '管理员录入',