换组下拉框

This commit is contained in:
lpq
2023-02-23 23:31:09 +08:00
parent 535f51403d
commit 0cf6f858a8
3 changed files with 14 additions and 6 deletions

View File

@@ -59,6 +59,7 @@ const props = defineProps({
});
const option = computed(() => {
debugger
console.log("props.groupList", props.groupList);
return props.groupList.map((e) => ({
label: e.groupName,

View File

@@ -758,10 +758,9 @@ const submitAuth = () => {
};
function handleStageOk() {
debugger
// 判断添加人数是否已超过限制人数 限制 = 本次添加的人 + 原有的人
if (props.type === 1) {
if (props.groupMemberCount < selectsData.value.studentList.length + props.groupMemberNumber) {
if (props.groupMemberCount < selectsData.value.projectMemberList.length + Number(props.groupMemberNumber)) {
return message.warning("添加小组学员超过最大值");
}
// 判断是否是组长,组长不能添加

View File

@@ -3212,6 +3212,7 @@ export default {
state.total = res.data.data.total;
let arr = res.data.data.rows;
getTableDataList(arr);
//
state.loading = false;
})
.catch((err) => {
@@ -3285,7 +3286,10 @@ export default {
pageSize: 10,
projectId: state.projectId,
};
getGroupList(objf).then((res) => { state.groupPageList = res.data.data.rows })
getGroupList(objf).then((res) => {
state.groupPageList = res.data.data.rows;
setGroupList(res.data.data.rows)
})
};
//删除小组
const deleteGroupBtn = (projectGroupId) => {
@@ -3298,13 +3302,17 @@ export default {
const createGroup = async () => {
console.log("state.groupPageList" + state.groupPageList)
const d = state.groupPageList.filter(item => item.leaderId === state.groupInfo.leaderId);
if (d.length > 0) {
return message.warn(d[0].leaderName + "已是小组长,请重新选择");
const id = state.groupInfo.id;
// 过滤掉编辑时候,只修改了组员最大值时候
if(id !== d[0].id) {
if (d.length > 0 ) {
return message.warn(d[0].leaderName + "已是小组长,请重新选择");
}
}
const id = state.groupInfo.id
await editGroup({ ...state.groupInfo, projectId: state.projectId })
message.success(id ? '小组编辑成功' : "小组创建成功");
getGroup();
console.log("state.groupPageList:")
getStu();
};
//搜索小组重置