批量换组

This commit is contained in:
lpq
2023-02-23 01:37:12 +08:00
parent b8bf1cd2dd
commit 9ab0016efc
3 changed files with 35 additions and 21 deletions

View File

@@ -100,24 +100,29 @@ const selectGroup = (e, v) => {
};
//确认换组
const changeGroup = (item) => {
debugger
console.log("换组", selectGroupId.value, item);
let obj = {
groupId: selectGroupId.value,
groupName: selectGroupName.value,
studentId: props.checkgroupStuId,
};
console.log("换组obj", obj);
api
.changeGroupByStudentId(obj)
.then((res) => {
console.log("换组成功", res);
if (res.data.code === 200) {
message.success("换组成功");
}
})
.catch((err) => {
console.log("换组失败", err);
});
props.checkgroupStuId.forEach(stu => {
let obj = {
groupId: selectGroupId.value,
groupName: selectGroupName.value,
studentId: stu,
};
console.log("换组obj", obj);
api
.changeGroupByStudentId(obj)
.then((res) => {
console.log("换组成功", res);
if (res.data.code === 200) {
message.success("换组成功");
closeChangeModal();
}
})
.catch((err) => {
console.log("换组失败", err);
});
})
};
</script>

View File

@@ -255,8 +255,8 @@
<!-- 换组弹窗 -->
<ChangeGroupModal
v-model:changegroupV="checkgroupParam.changegroupV"
:groupList="checkgroupParam.checkgroupList"
:checkgroupStuId="checkgroupParam.checkgroupStuId"
:groupList="groupList"
:checkgroupStuId="stuSelectKeys"
/>
<!-- 批量调整关卡弹窗 -->
<!-- 取消学员弹窗 -->
@@ -394,6 +394,10 @@ const props = defineProps({
type: Boolean,
default: null,
},
groupList: {
type: Array,
default: () => [],
}
});
const topFlagList = ref([
{
@@ -533,6 +537,7 @@ const tableData = ref({
loading: false,
});
const stuRowSelection = computed(() => ({
columnWidth: 20,
selectedRowKeys: stuSelectKeys.value,
@@ -542,6 +547,8 @@ const stuRowSelection = computed(() => ({
//显示学员换组弹窗
function showChangeGroupModal() {
const d = props.groupList
console.log("d"+d)
// debugger
checkgroupParam.value.changegroupV = true;
}
@@ -609,6 +616,8 @@ function getStuList() {
});
}
function reset() {
tableParam.value.studentName = "";
tableParam.value.groupName = ""; //学员小组
@@ -619,7 +628,6 @@ function reset() {
}
function bathDel() {
debugger
if (stuSelectKeys.value && stuSelectKeys.value.length === 0) {
message.destroy();
return message.warning("请先选中学员");

View File

@@ -712,6 +712,7 @@
:columns="stuColumns"
:stage="stage"
:visable="tabFlag"
:groupList="groupList"
>
<template #extension="{ data: { record } }">
<a-button @click="showStudent(record)" type="link"