mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-10 19:36:46 +08:00
学员添加判断
This commit is contained in:
@@ -141,6 +141,7 @@ export const addStudentCourse = (obj) => http.post("/admin/offcourse/addStudent"
|
|||||||
// 获取组织结构树
|
// 获取组织结构树
|
||||||
export const orgtree = () => http.get("/org/tree");
|
export const orgtree = () => http.get("/org/tree");
|
||||||
export const saveStu = obj => http.post("/admin/student/addStudent", obj);
|
export const saveStu = obj => http.post("/admin/student/addStudent", obj);
|
||||||
|
export const getAllStudentByProjectId = obj => http.get("/admin/student/getAllStudentByProjectId", { params: obj });
|
||||||
export const moveStudent = obj => http.post("/admin/student/moveStudent", obj);
|
export const moveStudent = obj => http.post("/admin/student/moveStudent", obj);
|
||||||
export const getStuPage = obj => http.get("/admin/student/getStudent", { params: obj });
|
export const getStuPage = obj => http.get("/admin/student/getStudent", { params: obj });
|
||||||
export const delStudentList = obj => http.post("/admin/student/delStudent", obj);
|
export const delStudentList = obj => http.post("/admin/student/delStudent", obj);
|
||||||
@@ -176,7 +177,7 @@ export const exportHomeWork = (obj) => http.get('/admin/student/exportHomeWork',
|
|||||||
export const exportHomeWorkTemplate = (obj) => http.get('/admin/student/exportHomeWorkTemplate', { params: obj })
|
export const exportHomeWorkTemplate = (obj) => http.get('/admin/student/exportHomeWorkTemplate', { params: obj })
|
||||||
//签到
|
//签到
|
||||||
export const attendanceSign = (obj) => http.post('/stu/task/attendance/sign', obj)
|
export const attendanceSign = (obj) => http.post('/stu/task/attendance/sign', obj)
|
||||||
//请假
|
//请假
|
||||||
export const attendanceLeave = (obj) => http.post('/stu/task/attendance/leave', obj)
|
export const attendanceLeave = (obj) => http.post('/stu/task/attendance/leave', obj)
|
||||||
|
|
||||||
//批量标记完成
|
//批量标记完成
|
||||||
|
|||||||
@@ -304,6 +304,7 @@ import {
|
|||||||
} from "@/api/ThirdApi";
|
} from "@/api/ThirdApi";
|
||||||
import {
|
import {
|
||||||
saveStu,
|
saveStu,
|
||||||
|
getAllStudentByProjectId,
|
||||||
// addGroupMember,
|
// addGroupMember,
|
||||||
getStuPage,
|
getStuPage,
|
||||||
} from "@/api/index1";
|
} from "@/api/index1";
|
||||||
@@ -366,6 +367,7 @@ console.log("props.activeKey1" + props.activeKey1);
|
|||||||
// 获取项目学员;
|
// 获取项目学员;
|
||||||
const procurrentPage = ref(1);
|
const procurrentPage = ref(1);
|
||||||
const projectList = ref([]);
|
const projectList = ref([]);
|
||||||
|
const allProjectStudent = ref([]);
|
||||||
const proStudentName = ref("");
|
const proStudentName = ref("");
|
||||||
const projectListTotal = ref(-1);
|
const projectListTotal = ref(-1);
|
||||||
const projectPageSize = ref(10);
|
const projectPageSize = ref(10);
|
||||||
@@ -384,6 +386,16 @@ const projectRowSelection = computed(() => ({
|
|||||||
onChange: onProjectSelectChange,
|
onChange: onProjectSelectChange,
|
||||||
preserveSelectedRowKeys: true,
|
preserveSelectedRowKeys: true,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const getAllStudent = () => {
|
||||||
|
let params = {
|
||||||
|
projectId:props.id
|
||||||
|
};
|
||||||
|
getAllStudentByProjectId(params).then(res => {
|
||||||
|
allProjectStudent.value = res.data.data;
|
||||||
|
})
|
||||||
|
};
|
||||||
|
getAllStudent();
|
||||||
const getStu = () => {
|
const getStu = () => {
|
||||||
let obj = {
|
let obj = {
|
||||||
studentName: proStudentName.value,
|
studentName: proStudentName.value,
|
||||||
@@ -811,15 +823,16 @@ function handleStageOk() {
|
|||||||
}
|
}
|
||||||
} else if (activeKey.value === 1) {
|
} else if (activeKey.value === 1) {
|
||||||
selectMember = selectsData.value.studentList.length;
|
selectMember = selectsData.value.studentList.length;
|
||||||
|
let arr = [...allProjectStudent.value].filter(x => [...selectsData.value.studentList].some(y => y.id === x.studentId));
|
||||||
|
if (arr.length > 0) {
|
||||||
|
message.warning("部分学员已经有小组,再次添加会被添加到当前小组.");
|
||||||
|
}
|
||||||
} else if (activeKey.value === 2) {
|
} else if (activeKey.value === 2) {
|
||||||
selectMember = selectsData.value.groupList.length;
|
selectMember = selectsData.value.groupList.length;
|
||||||
} else if (activeKey.value === 3) {
|
} else if (activeKey.value === 3) {
|
||||||
selectMember = selectsData.value.deptList.length;
|
selectMember = selectsData.value.deptList.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (props.groupMemberCount < selectMember + Number(props.groupMemberNumber)) {
|
if (props.groupMemberCount < selectMember + Number(props.groupMemberNumber)) {
|
||||||
return message.warning("添加小组学员超过最大值");
|
return message.warning("添加小组学员超过最大值");
|
||||||
}
|
}
|
||||||
@@ -839,7 +852,7 @@ function handleStageOk() {
|
|||||||
stageId: selectsData.value.stageId,
|
stageId: selectsData.value.stageId,
|
||||||
groupIds: selectsData.value.groupList?.map((e) => e.id),
|
groupIds: selectsData.value.groupList?.map((e) => e.id),
|
||||||
studentList: selectsData.value.studentList.concat(
|
studentList: selectsData.value.studentList.concat(
|
||||||
selectsData.value.projectMemberList
|
selectsData.value.projectMemberList
|
||||||
),
|
),
|
||||||
groupName: props.groupName,
|
groupName: props.groupName,
|
||||||
groupId: props.groupId,
|
groupId: props.groupId,
|
||||||
|
|||||||
Reference in New Issue
Block a user