学院列表删除小组长

This commit is contained in:
lpq
2023-02-22 22:29:55 +08:00
parent 471fc7c4b9
commit f4a5e909b8
3 changed files with 16 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
>
<div class="drawerMain">
<div class="header">
<div class="headerTitle">组员名单1</div>
<div class="headerTitle">组员名单</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"

View File

@@ -233,7 +233,8 @@
>
<a-button
v-if="checkPer(permissions)"
@click="del(record.id)"
:disabled="record.isLeader === '1' "
@click="del(record.id,record)"
type="link"
danger
>删除</a-button
@@ -618,15 +619,25 @@ function reset() {
}
function bathDel() {
debugger
if (stuSelectKeys.value && stuSelectKeys.value.length === 0) {
message.destroy();
return message.warning("请先选中学员");
}
// 判断选择的人员中是否有小组长
let arr = [...tableData.value.list].filter(x => [...stuSelectKeys.value].some(id => id === x.id)).filter(item => item.isLeader === '1');
if (arr.length > 0) {
return message.warning("选择人员中:"+arr[0].studentName + "是小组长,请勿删除!");
}
tableData.value.loading = true;
delStudentList({ ids: stuSelectKeys.value }).then(() => getStuList());
// delStudentList({ ids: stuSelectKeys.value }).then(() => getStuList());
}
function del(id) {
function del(id,row) {
if (row.isLeader === '1') {
return message.warning(""+row.name + "是小组长,请勿删除!");
}
Modal.confirm({
title: () => "确定删除?",
icon: () => createVNode(ExclamationCircleOutlined),