mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 22:06:45 +08:00
fix:修改小组
This commit is contained in:
@@ -777,7 +777,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="second2">
|
||||
<div class="btn1" @click="showModal2">
|
||||
<div class="btn1" @click="showModal2(1, null)">
|
||||
<img src="../../assets/images/courseManage/add0.png" />
|
||||
<span class="btn1text">创建小组</span>
|
||||
</div>
|
||||
@@ -803,7 +803,9 @@
|
||||
>. . .</span
|
||||
>
|
||||
<div class="moreItems">
|
||||
<div class="sammo">编辑</div>
|
||||
<div class="sammo" @click="showModal2(2, item)">
|
||||
编辑
|
||||
</div>
|
||||
<div
|
||||
class="sammo"
|
||||
@click="deleteGroupBtn(item.projectGroupId)"
|
||||
@@ -1936,6 +1938,8 @@ export default {
|
||||
valuestub: "", //学员管理部门
|
||||
valuestug: "", //学员小组管理名称
|
||||
valuestugroup: "", //学员管理小组名称
|
||||
projectGroupId: null, //是编辑小组id
|
||||
stuMemberClassify: null, //1:新建小组 2:编辑小组
|
||||
valueDate: "", //排行榜输入日期
|
||||
noticeChecked: true,
|
||||
noticeContent: "",
|
||||
@@ -2642,11 +2646,23 @@ export default {
|
||||
state.canclestu1 = false;
|
||||
};
|
||||
|
||||
const showModal2 = () => {
|
||||
const showModal2 = (classify, item) => {
|
||||
state.stuMemberClassify = classify;
|
||||
state.projectGroupId =
|
||||
item && item.projectGroupId ? item.projectGroupId : null;
|
||||
state.stugroup = true;
|
||||
if (item) {
|
||||
state.valueaddg = item.groupName;
|
||||
state.valueaddm = item.leaderName;
|
||||
}
|
||||
console.log("编辑小组item", item);
|
||||
};
|
||||
const closeModal2 = () => {
|
||||
state.stugroup = false;
|
||||
state.valueaddg = null;
|
||||
state.valueaddm = null;
|
||||
state.projectGroupId = null;
|
||||
state.stuMemberClassify = null;
|
||||
};
|
||||
//点击确定创建小组
|
||||
const createG = () => {
|
||||
@@ -2655,7 +2671,7 @@ export default {
|
||||
return message.warning("请输入必填项");
|
||||
} else {
|
||||
createGroup();
|
||||
state.stugroup = false;
|
||||
closeModal2();
|
||||
}
|
||||
};
|
||||
const showFaceIn = () => {
|
||||
@@ -3234,6 +3250,7 @@ export default {
|
||||
array.push(obj);
|
||||
});
|
||||
state.groupList = array;
|
||||
console.log("编辑小组", state.groupList);
|
||||
};
|
||||
//学员搜索
|
||||
const searchStu = () => {
|
||||
@@ -3294,7 +3311,7 @@ export default {
|
||||
};
|
||||
//获取学员列表
|
||||
const getStu = (obj) => {
|
||||
state.loading = true
|
||||
state.loading = true;
|
||||
let objf = obj || {
|
||||
deptIds: [], //部门
|
||||
groupId: 0,
|
||||
@@ -3394,11 +3411,14 @@ export default {
|
||||
getGroupList(objf)
|
||||
.then((res) => {
|
||||
console.log(res.data.data.rows, "获取小组列表成功");
|
||||
let leng = res.data.data.rows.length;
|
||||
if (leng > 0) {
|
||||
if (res.data.code === 200) {
|
||||
let arr = res.data.data.rows;
|
||||
setGroupList(arr);
|
||||
}
|
||||
// let leng = res.data.data.rows.length;
|
||||
// if (leng > 0) {
|
||||
|
||||
// }
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err, "获取列表失败");
|
||||
@@ -3416,23 +3436,47 @@ export default {
|
||||
};
|
||||
//创建小组
|
||||
const createGroup = () => {
|
||||
let obj = {
|
||||
groupName: state.valueaddg,
|
||||
leaderId: 0,
|
||||
leaderName: state.valueaddm,
|
||||
projectGroupId: 0,
|
||||
projectId: state.projectId,
|
||||
};
|
||||
editGroup(obj)
|
||||
.then((res) => {
|
||||
console.log("小组创建成功", res);
|
||||
message.success("小组创建成功");
|
||||
getGroup();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("小组创建失败", err);
|
||||
message.warning("小组创建失败");
|
||||
});
|
||||
//新建
|
||||
if (state.stuMemberClassify === 1) {
|
||||
let obj = {
|
||||
groupName: state.valueaddg,
|
||||
leaderId: 0,
|
||||
leaderName: state.valueaddm,
|
||||
// projectGroupId: 0,
|
||||
projectId: state.projectId,
|
||||
};
|
||||
editGroup(obj)
|
||||
.then((res) => {
|
||||
console.log("小组创建成功", res);
|
||||
message.success("小组创建成功");
|
||||
getGroup();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("小组创建失败", err);
|
||||
message.warning("小组创建失败");
|
||||
});
|
||||
}
|
||||
//编辑
|
||||
if (state.stuMemberClassify === 2) {
|
||||
let obj = {
|
||||
groupName: state.valueaddg,
|
||||
leaderId: 0,
|
||||
leaderName: state.valueaddm,
|
||||
projectGroupId: state.projectGroupId,
|
||||
projectId: state.projectId,
|
||||
};
|
||||
console.log("编辑小组obj", obj);
|
||||
editGroup(obj)
|
||||
.then((res) => {
|
||||
console.log("小组编辑成功", res);
|
||||
message.success("小组编辑成功");
|
||||
getGroup();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("小组编辑失败", err);
|
||||
message.warning("小组编辑失败");
|
||||
});
|
||||
}
|
||||
};
|
||||
//搜索小组重置
|
||||
const resetGroupName = () => {
|
||||
|
||||
Reference in New Issue
Block a user