mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-20 08:16:46 +08:00
--demand 面授课
This commit is contained in:
@@ -14,26 +14,27 @@
|
||||
<div style="display: flex; overflow-x: auto; overflow-y: auto">
|
||||
<div class="tabs" style="min-width: 800px">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane v-if="isGroup" :key="4" tab="项目内学员">
|
||||
<a-tab-pane v-if="infoType" :key="4" tab="项目内学员">
|
||||
<div :style="{ height: screenHeight - 235 + 'px' }">
|
||||
<div>
|
||||
<a-form-item label="姓名:">
|
||||
<a-input v-model:value="proStudentName" style="width: 260px; height: 40px; border-radius: 8px"
|
||||
<a-input v-model:value="projectParams.studentName"
|
||||
style="width: 260px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入姓名"/>
|
||||
<a-button type="primary" @click="getStu" style="margin-left: 20px; border-radius: 4px">
|
||||
<a-button type="primary" @click="getProjectStu" style="margin-left: 20px; border-radius: 4px">
|
||||
<template #icon>
|
||||
<SearchOutlined/>
|
||||
</template>
|
||||
搜索
|
||||
</a-button>
|
||||
<a-button @click="getStu" style="margin-left: 20px; border-radius: 4px">重置
|
||||
<a-button @click="resetProjectStu" style="margin-left: 20px; border-radius: 4px">重置
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="tableBox tabb">
|
||||
<a-table style="border: 1px solid #f2f6fe; width: 800px" row-key="id" :columns="stuColumns"
|
||||
:data-source="projectList" :loading="projectListTotal" :pagination="projectPagination"
|
||||
:row-selection="projectRowSelection"/>
|
||||
<BaseTable ref="projectStuTableRef" :columns="projectStuColumns" :url="STUDENT_LIST"
|
||||
:params="projectParams" v-model:selectedRows="projectSelectRows"
|
||||
type="checkbox"></BaseTable>
|
||||
</div>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
@@ -42,7 +43,7 @@
|
||||
<div class="tab1">
|
||||
<a-form-item label="姓名">
|
||||
<a-input v-model:value="nameSearch.keyword" style="width: 270px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入姓名" @change="peopleName"/>
|
||||
placeholder="请输入姓名"/>
|
||||
<a-button type="primary" @click="onSearchStu" style="margin-left: 20px; border-radius: 4px">
|
||||
<template #icon>
|
||||
<SearchOutlined/>
|
||||
@@ -74,8 +75,9 @@
|
||||
margin: 0px 4px 120px 10px;
|
||||
border: 1px solid #f0f0f0;
|
||||
">
|
||||
<a-table :columns="stuColumns" :data-source="stuData" :pagination="stuPagination"
|
||||
:loading="stuLoading" row-key="id" :row-selection="stuRowSelection"/>
|
||||
<BaseTable ref="stuTableRef" :columns="stuColumns" :url="USER_LIST_PAGE"
|
||||
:request="useBoeApiUserInfoPage" :params="nameSearch"
|
||||
v-model:selectedRows="stuSelectRows" type="checkbox"></BaseTable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -123,14 +125,16 @@
|
||||
</template>
|
||||
搜索
|
||||
</a-button>
|
||||
<a-button type="primary" @click="resetAudienceInfo" style="margin-left: 20px; border-radius: 4px">重置
|
||||
<a-button type="primary" @click="resetAudienceInfo" style="margin-left: 20px; border-radius: 4px">
|
||||
重置
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="tableBox tabb">
|
||||
<a-table style="border: 1px solid #f2f6fe; width: 800px" row-key="id" :columns="audiColums"
|
||||
:data-source="audiData" :loading="audiLoading" :pagination="auditPagination"
|
||||
:row-selection="auditRowSelection"/>
|
||||
<BaseTable ref="auditTableRef" :columns="audiColums" :url="AUDIENCE_LIST"
|
||||
:request="useBoeApiAuditPage" :params="audienceName"
|
||||
v-model:selectedRows="auditSelectRows" v-model:selectedRowKeys="auditSelectRowKeys"
|
||||
type="checkbox"></BaseTable>
|
||||
</div>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
@@ -143,59 +147,59 @@
|
||||
</div>
|
||||
</div>
|
||||
<div :style="{ 'max-height': screenHeight - 235 + 'px' }" style="overflow-y: auto">
|
||||
<div class="selecteds" v-if="isGroup">
|
||||
<div class="selecteds" v-if="infoType">
|
||||
<div class="person">项目内学员</div>
|
||||
<div v-for="(item, i) in selectsData.projectMemberList" :key="i">
|
||||
<div v-for="(item, i) in projectSelectRows" :key="i">
|
||||
<div v-if="i < 11">
|
||||
<div class="chose">
|
||||
{{ item.realName }}
|
||||
<div class="ch" @click="memberDel(i)"></div>
|
||||
{{ item.studentName }}
|
||||
<div class="ch" @click="auditTableRef.remove(i)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="person">
|
||||
<div class="chose">
|
||||
{{ item.realName }}
|
||||
<div class="ch" @click="memberDel(i)"></div>
|
||||
{{ item.studentName }}
|
||||
<div class="ch" @click="auditTableRef.remove(i)"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!member && selectsData.projectMemberList?.length > 10" class="ifsw">
|
||||
<div v-if="!member && projectSelectRows?.length > 10" class="ifsw">
|
||||
<div @click="member = !member" class="“sw”">查看更多></div>
|
||||
</div>
|
||||
<div v-if="member && selectsData.projectMemberList?.length > 10" class="ifsw">
|
||||
<div v-if="member && projectSelectRows?.length > 10" class="ifsw">
|
||||
<div @click="member = !member" class="sw">收起<</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="selecteds">
|
||||
<div class="person">快速选人</div>
|
||||
<div v-for="(item, i) in selectsData.studentList" :key="i">
|
||||
<div v-for="(item, i) in stuSelectRows" :key="i">
|
||||
<div v-if="i < 11">
|
||||
<div class="chose">
|
||||
{{ item.realName }}
|
||||
<div class="ch" @click="stuDel(i)"></div>
|
||||
<div class="ch" @click="stuTableRef.remove(i)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="person">
|
||||
<div class="chose">
|
||||
{{ item.realName }}
|
||||
<div class="ch" @click="stuDel(i)"></div>
|
||||
<div class="ch" @click="stuTableRef.remove(i)"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!person && selectsData.studentList.length > 10" class="ifsw">
|
||||
<div v-if="!person && stuSelectRows.length > 10" class="ifsw">
|
||||
<div @click="person = !person" class="“sw”">查看更多></div>
|
||||
</div>
|
||||
<div v-if="person && selectsData.studentList.length > 10" class="ifsw">
|
||||
<div v-if="person && stuSelectRows.length > 10" class="ifsw">
|
||||
<div @click="person = !person" class="sw">收起<</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!selectStu" class="selecteds">
|
||||
<div class="dept">添加组织</div>
|
||||
<div v-for="(item, i) in selectsData.deptList" :key="i">
|
||||
<div v-for="(item, i) in deptList" :key="i">
|
||||
<div v-if="i < 11">
|
||||
<div class="chose1">
|
||||
<div class="span">{{ item.name }}</div>
|
||||
@@ -211,36 +215,36 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!dept && selectsData.deptList.length > 10" class="ifsw">
|
||||
<div v-if="!dept && deptList.length > 10" class="ifsw">
|
||||
<div @click="dept = !dept" class="“sw”">查看更多></div>
|
||||
</div>
|
||||
<div v-if="dept && selectsData.deptList.length > 10" class="ifsw">
|
||||
<div v-if="dept && deptList.length > 10" class="ifsw">
|
||||
<div @click="dept = !dept" class="sw">收起<</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--受众-->
|
||||
<div v-if="!selectStu" class="selecteds">
|
||||
<div class="group">受众关联</div>
|
||||
<div v-for="(item, i) in selectsData.groupList" :key="i">
|
||||
<div v-for="(item, i) in auditSelectRows" :key="i">
|
||||
<div v-if="i < 11">
|
||||
<div class="chose2">
|
||||
<div class="span">{{ item.audienceName }}</div>
|
||||
<div class="ch2" @click="AuditDel(i)"></div>
|
||||
<div class="ch2" @click="auditTableRef.remove(i)"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="group">
|
||||
<div class="chose2">
|
||||
<div class="span">{{ item.audienceName }}</div>
|
||||
<div class="ch2" @click="AuditDel(i)"></div>
|
||||
<div class="ch2" @click="auditTableRef.remove(i)"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!group && selectsData.groupList.length > 10" class="ifsw">
|
||||
<div v-if="!group && auditSelectRows.length > 10" class="ifsw">
|
||||
<div @click="group = !group" class="“sw”">查看更多></div>
|
||||
</div>
|
||||
<div v-if="group && selectsData.groupList > 10" class="ifsw">
|
||||
<div v-if="group && auditSelectRows.length > 10" class="ifsw">
|
||||
<div @click="group = !group" class="sw">收起<</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -257,7 +261,7 @@
|
||||
<slot></slot>
|
||||
</a-button>
|
||||
</div>
|
||||
<a-modal :style="{ padding: 0, position: relative, right: '-20%' }" :closable="true" :visible="stageVisible"
|
||||
<a-modal :style="{ padding: 0, position:'relative', right: '-20%' }" :closable="true" :visible="stageVisible"
|
||||
:footer="null" centered="true" @ok="handleStageOk" wrapClassName="changeModal">
|
||||
<div class="con">
|
||||
<div class="header">
|
||||
@@ -268,11 +272,8 @@
|
||||
</div>
|
||||
<div class="mid">
|
||||
<div class="inher">
|
||||
<!-- <div class="cur">当前关卡:关卡2</div> -->
|
||||
<div class="select">
|
||||
<a-select style="width: 400px" :placeholder="type === 1 ? '选择阶段' : '选择关卡'"
|
||||
v-model:value="selectsData.stageId"
|
||||
className="cus-select">
|
||||
<a-select style="width: 400px" :placeholder="type === 1 ? '选择阶段' : '选择关卡'" v-model:value="stageId" className="cus-select">
|
||||
<a-select-option v-for="(item, i) in stageIds" :key="i" :value="item.id">{{ item.name || "默认" }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@@ -294,25 +295,25 @@
|
||||
<script setup>
|
||||
import {message} from "ant-design-vue";
|
||||
import {computed, defineEmits, defineProps, ref, watch} from "vue";
|
||||
import {boeRequest, useBoeApi, useBoeApiPage} from "@/api/request";
|
||||
import {boeRequest, useBoeApi, useBoeApiPage, useBoeApiUserInfoPage, useBoeApiAuditPage} from "@/api/request";
|
||||
import {
|
||||
AUDIENCE_LIST,
|
||||
ORG_CHILD_LIST,
|
||||
ORG_LIST,
|
||||
// USER_LIST,
|
||||
USER_LIST_PAGE,
|
||||
AUDIENCE_LIST,
|
||||
} from "@/api/ThirdApi";
|
||||
import {
|
||||
saveStu,
|
||||
getAllStudentByProjectId,
|
||||
// addGroupMember,
|
||||
getStuPage,
|
||||
} from "@/api/index1";
|
||||
import dialog from "@/utils/dialog";
|
||||
// import { getProjStu } from "@/api/indexProjStu";
|
||||
import BaseTable from "@/components/common/BaseTable";
|
||||
import {STUDENT_LIST} from "@/api/apis";
|
||||
|
||||
const emit = defineEmits({});
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
infoType: Number,
|
||||
infoId: Number,
|
||||
id: String,
|
||||
title: {
|
||||
type: String,
|
||||
@@ -363,108 +364,31 @@ const props = defineProps({
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
console.log("props.activeKey1" + props.activeKey1);
|
||||
// 获取项目学员;
|
||||
const procurrentPage = ref(1);
|
||||
const projectList = ref([]);
|
||||
const allProjectStudent = ref([]);
|
||||
const proStudentName = ref("");
|
||||
const projectListTotal = ref(-1);
|
||||
const projectPageSize = ref(10);
|
||||
const projectSelectKeys = ref([]);
|
||||
const projectSelectRows = ref([]);
|
||||
const stuSelectRows = ref([]);
|
||||
const auditSelectRows = ref([]);
|
||||
const auditSelectRowKeys = ref([]);
|
||||
const deptList = ref([]);
|
||||
const member = ref(false);
|
||||
const projectPagination = computed(() => ({
|
||||
total: projectListTotal.value,
|
||||
showSizeChanger: false,
|
||||
current: procurrentPage.value,
|
||||
pageSize: projectPageSize.value,
|
||||
onChange: projectChangePagination,
|
||||
}));
|
||||
const projectRowSelection = computed(() => ({
|
||||
columnWidth: 20,
|
||||
selectedRowKeys: projectSelectKeys.value,
|
||||
onChange: onProjectSelectChange,
|
||||
preserveSelectedRowKeys: true,
|
||||
}));
|
||||
const dept = ref(false);
|
||||
const projectStuTableRef = ref();
|
||||
const stuTableRef = ref();
|
||||
const projectParams = ref({ pid: props.infoId, type: props.infoType });
|
||||
|
||||
const getAllStudent = () => {
|
||||
let params = {
|
||||
projectId:props.id
|
||||
};
|
||||
getAllStudentByProjectId(params).then(res => {
|
||||
allProjectStudent.value = res.data.data;
|
||||
})
|
||||
};
|
||||
getAllStudent();
|
||||
const getStu = () => {
|
||||
let obj = {
|
||||
studentName: proStudentName.value,
|
||||
pageNo: procurrentPage.value,
|
||||
pageSize: 10,
|
||||
pid: props.id,
|
||||
type: props.type
|
||||
};
|
||||
projectListTotal.value = -1;
|
||||
console.log("获取项目学员", obj);
|
||||
getStuPage(obj).then((res) => {
|
||||
console.log("获取项目学员", res);
|
||||
let arr = res.data.data.records;
|
||||
let array = [];
|
||||
arr.map((value) => {
|
||||
let obj = {
|
||||
id: value.studentId,
|
||||
studentId: value.studentId,
|
||||
realName: value.studentName,
|
||||
userNo: value.studentUserNo,
|
||||
isLeader: value.isLeader,
|
||||
groupId: value.groupId,
|
||||
orgName: value.studentOrgName ? value.studentOrgName : "-",
|
||||
departName: value.studentDepartName ? value.studentDepartName : "-",
|
||||
};
|
||||
array.push(obj);
|
||||
});
|
||||
projectList.value = array;
|
||||
projectListTotal.value = res.data.data.total;
|
||||
});
|
||||
};
|
||||
getStu();
|
||||
const projectChangePagination = (page) => {
|
||||
procurrentPage.value = page;
|
||||
getStu();
|
||||
};
|
||||
|
||||
function onProjectSelectChange(e, l) {
|
||||
console.log("eeeee", e, l);
|
||||
projectSelectKeys.value = e;
|
||||
selectsData.value.projectMemberList = l;
|
||||
}
|
||||
|
||||
function memberDel(i) {
|
||||
projectSelectKeys.value = projectSelectKeys.value.filter(
|
||||
(e) => e !== selectsData.value.projectMemberList[i].id
|
||||
);
|
||||
selectsData.value.projectMemberList.splice(i, 1);
|
||||
}
|
||||
const getProjectStu = () => projectStuTableRef.value.fetch();
|
||||
const resetProjectStu = () => projectStuTableRef.value.reset();
|
||||
|
||||
const person = ref(false);
|
||||
// const dept =ref(false)
|
||||
const group = ref(false);
|
||||
const visiable = ref(false);
|
||||
const activeKey = ref(props.isGroup ? 4 : 1);
|
||||
// const activeKey = ref(1);
|
||||
const activeKey = ref(props.infoType ? 4 : 1);
|
||||
const stageVisible = ref(false);
|
||||
const selectsData = ref({
|
||||
stageId: "",
|
||||
studentList: [],
|
||||
deptList: [],
|
||||
groupList: [],
|
||||
projectMemberList: [],
|
||||
});
|
||||
const stageId = ref();
|
||||
|
||||
const nameSearch = ref({
|
||||
keyword: "",
|
||||
departId: null,
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const stuTreeSelectKeys = ref([]);
|
||||
const stuTreeExpandedKeys = ref([]);
|
||||
@@ -479,20 +403,7 @@ const searchOrgName = ref({
|
||||
pageSize: 10,
|
||||
});
|
||||
const stageIds = computed(() => props.stage);
|
||||
const {
|
||||
data: stuData,
|
||||
page: stuPageNo,
|
||||
fetch: searchStu,
|
||||
pageSize: stuPageSize,
|
||||
loading: stuLoading,
|
||||
total: stuTotal,
|
||||
reset: stuReset,
|
||||
} = useBoeApiPage(USER_LIST_PAGE, nameSearch.value, {
|
||||
init: false,
|
||||
result: (res) => res.result.userInfoList,
|
||||
totalPage: (res) => res.result.totalPage,
|
||||
total: (res) => res.result.totalElement,
|
||||
});
|
||||
|
||||
const { data: orgData, fetch: searchOrg } = useBoeApiPage(
|
||||
ORG_LIST,
|
||||
searchOrgName.value
|
||||
@@ -514,21 +425,44 @@ const { data: treeOrgData, loading: orgOrgLoading } = useBoeApi(
|
||||
}
|
||||
);
|
||||
|
||||
const {
|
||||
data: audiData,
|
||||
fetch: searchAudi,
|
||||
page: audiPageNo,
|
||||
pageSize: audiPageSize,
|
||||
loading: audiLoading,
|
||||
total: audiTotal,
|
||||
reset: auditReset,
|
||||
} = useBoeApiPage(AUDIENCE_LIST, audienceName.value, {
|
||||
init: true,
|
||||
result: (res) =>
|
||||
res.result.audienceList.map((e) => ({ ...e, id: e.id + "" })),
|
||||
totalPage: (res) => res.result.totalPage,
|
||||
total: (res) => res.result.totalElement,
|
||||
});
|
||||
const projectStuColumns = ref([
|
||||
{
|
||||
title: "姓名",
|
||||
dataIndex: "studentName",
|
||||
key: "studentName",
|
||||
width: 80,
|
||||
align: "center",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: "工号",
|
||||
dataIndex: "studentUserNo",
|
||||
key: "studentUserNo",
|
||||
width: 80,
|
||||
align: "center",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: "归属组织",
|
||||
dataIndex: "studentOrgName",
|
||||
key: "studentOrgName",
|
||||
width: 80,
|
||||
align: "center",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: "部门",
|
||||
dataIndex: "studentDepartName",
|
||||
key: "studentDepartName",
|
||||
width: 80,
|
||||
align: "center",
|
||||
className: "h",
|
||||
ellipsis: true,
|
||||
},
|
||||
]);
|
||||
const stuColumns = ref([
|
||||
{
|
||||
title: "姓名",
|
||||
@@ -594,52 +528,28 @@ const audiColums = ref([
|
||||
className: "h",
|
||||
},
|
||||
]);
|
||||
const stuSelectKeys = ref([]);
|
||||
const orgSelectKeys = ref([]);
|
||||
const auditSelectKeys = ref([]);
|
||||
const auditTableRef = ref();
|
||||
const screenHeight = ref(document.body.clientHeight);
|
||||
//const screenWidth = ref(document.body.clientWidth);
|
||||
const stuRowSelection = computed(() => ({
|
||||
type: props.selectOne ? "radio" : "checkbox",
|
||||
columnWidth: 20,
|
||||
selectedRowKeys: stuSelectKeys.value,
|
||||
onChange: onStuSelectChange,
|
||||
preserveSelectedRowKeys: true,
|
||||
}));
|
||||
|
||||
const orgRowSelection = computed(() => ({
|
||||
columnWidth: 20,
|
||||
selectedRowKeys: orgSelectKeys.value,
|
||||
onChange: onOrgSelectChange,
|
||||
preserveSelectedRowKeys: true,
|
||||
}));
|
||||
const stuPagination = computed(() => ({
|
||||
total: stuTotal.value,
|
||||
showSizeChanger: false,
|
||||
current: stuPageNo.value,
|
||||
pageSize: stuPageSize.value,
|
||||
onChange: changePagination,
|
||||
}));
|
||||
const auditPagination = computed(() => ({
|
||||
total: audiTotal.value,
|
||||
showSizeChanger: false,
|
||||
current: audiPageNo.value,
|
||||
pageSize: audiPageSize.value,
|
||||
onChange: auditChangePagination,
|
||||
}));
|
||||
const auditRowSelection = computed(() => ({
|
||||
columnWidth: 20,
|
||||
selectedRowKeys: auditSelectKeys.value,
|
||||
onChange: onAuditSelectChange,
|
||||
preserveSelectedRowKeys: true,
|
||||
}));
|
||||
|
||||
const closeDrawer = () => {
|
||||
deleteDepSelect();
|
||||
visiable.value = false;
|
||||
stuData.value = [];
|
||||
nameSearch.value.keyword = "";
|
||||
selectedOrgKeys.value = [];
|
||||
};
|
||||
|
||||
function searchAudi() {
|
||||
auditTableRef.value.fetch();
|
||||
}
|
||||
|
||||
function onLoadData(treeNode) {
|
||||
return boeRequest(ORG_CHILD_LIST, { keyword: "", orgId: treeNode.id }).then(
|
||||
(r) => {
|
||||
@@ -664,26 +574,15 @@ const closeChangeModal = () => {
|
||||
const openDrawer = () => {
|
||||
visiable.value = true;
|
||||
};
|
||||
//获取组织树
|
||||
// const treeData = computed(() => {
|
||||
// return store.state.orgtreeList ? store.state.orgtreeList : [];
|
||||
// });
|
||||
|
||||
function onSearchStu() {
|
||||
nameSearch.value.page = 1;
|
||||
searchStu();
|
||||
stuTableRef.value.fetch();
|
||||
}
|
||||
|
||||
function stuStuOrgSelect(e) {
|
||||
nameSearch.value.departId = e.join("");
|
||||
searchStu();
|
||||
}
|
||||
|
||||
function stuDel(i) {
|
||||
stuSelectKeys.value = stuSelectKeys.value.filter(
|
||||
(e) => e !== selectsData.value.studentList[i].id
|
||||
);
|
||||
selectsData.value.studentList.splice(i, 1);
|
||||
stuTableRef.value.fetch();
|
||||
}
|
||||
|
||||
const selectedOrgKeys = ref([]);
|
||||
@@ -693,77 +592,19 @@ watch(selectedOrgKeys, () => {
|
||||
});
|
||||
|
||||
function orgDel(i) {
|
||||
console.log(selectedOrgKeys.value);
|
||||
orgSelectKeys.value = orgSelectKeys.value.filter(e => e !== selectsData.value.deptList[i].id);
|
||||
orgSelectKeys.value = orgSelectKeys.value.filter(e => e !== deptList.value[i].id);
|
||||
selectedOrgKeys.value.splice(i, 1);
|
||||
selectsData.value.deptList.splice(i, 1);
|
||||
}
|
||||
|
||||
function AuditDel(i) {
|
||||
auditSelectKeys.value = auditSelectKeys.value.filter(
|
||||
(e) => e !== selectsData.value.groupList[i].id
|
||||
);
|
||||
selectsData.value.groupList.splice(i, 1);
|
||||
}
|
||||
|
||||
// function orgSelect(key, obj) {
|
||||
// console.log(obj)
|
||||
//request(ORG_CHILD_LIST, {orgId: null}).then(res => {
|
||||
//console.log(res.result)
|
||||
//})
|
||||
//}
|
||||
function onStuSelectChange(e, l) {
|
||||
stuSelectKeys.value = e;
|
||||
selectsData.value.studentList = l;
|
||||
deptList.value.splice(i, 1);
|
||||
}
|
||||
|
||||
function onOrgSelectChange(e, l) {
|
||||
|
||||
orgRowSelection.value = e;
|
||||
selectsData.value.deptList = l.selectedNodes;
|
||||
|
||||
// 获取被点击的树节点
|
||||
|
||||
deptList.value = l.selectedNodes;
|
||||
}
|
||||
|
||||
function onAuditSelectChange(e, l) {
|
||||
auditSelectKeys.value = e;
|
||||
selectsData.value.groupList = l;
|
||||
}
|
||||
|
||||
// const stuDepartmentSelect = (e) => {
|
||||
// nameSearch.value.orgId = e.join('')
|
||||
// searchStu()
|
||||
// };
|
||||
//分页获取学员
|
||||
const changePagination = (page) => {
|
||||
nameSearch.value.page = page;
|
||||
searchStu();
|
||||
};
|
||||
const auditChangePagination = (page) => {
|
||||
audienceName.value.page = page;
|
||||
searchAudi();
|
||||
};
|
||||
|
||||
//重置
|
||||
function peopleName(name) {
|
||||
console.log("people-name", name.target.value);
|
||||
nameSearch.value.keyword = name.target.value;
|
||||
}
|
||||
|
||||
const resetStu = () => {
|
||||
// deleteDepSelect();
|
||||
nameSearch.value.keyword = "";
|
||||
nameSearch.value.page = 1;
|
||||
nameSearch.value.pageSize = 10;
|
||||
nameSearch.value.departId = null;
|
||||
stuTreeExpandedKeys.value = [];
|
||||
stuTreeSelectKeys.value = [];
|
||||
stuReset();
|
||||
};
|
||||
const resetStu = () => stuTableRef.value.reset({ keyword: "", departId: null });
|
||||
//清空选择部门信息
|
||||
const deleteDepSelect = () => {
|
||||
stuSelectKeys.value = [];
|
||||
selectedOrgKeys.value = [];
|
||||
projectSelectKeys.value = [];
|
||||
};
|
||||
@@ -772,21 +613,8 @@ const resetOrg = () => {
|
||||
searchOrgName.value = { keyword: "", page: 1, pageSize: 10 };
|
||||
};
|
||||
//重置受众
|
||||
const resetAudienceInfo = () => {
|
||||
audienceName.value.keyword = "";
|
||||
audienceName.value.page = 1;
|
||||
audienceName.value.pageSize = 10;
|
||||
auditReset();
|
||||
searchAudi();
|
||||
};
|
||||
//全部清除
|
||||
// const deleteAll = () => {
|
||||
// selectsData.value = {
|
||||
// studentList: [],
|
||||
// deptList: [],
|
||||
// groupList: []
|
||||
// }
|
||||
// };
|
||||
const resetAudienceInfo = () => auditTableRef.value.reset({ keyword: "" });
|
||||
|
||||
//确定添加授权
|
||||
const submitAuth = () => {
|
||||
if (props.type === 2) {
|
||||
@@ -797,7 +625,7 @@ const submitAuth = () => {
|
||||
};
|
||||
|
||||
function handleDialogOk() {
|
||||
if (selectsData.value.groupList.length || selectsData.value.deptList.length) {
|
||||
if (auditSelectRowKeys.value.length || deptList.value.length) {
|
||||
dialog({ content: "您选择了组织或受众,此添加为异步添加,请稍后手动刷新学员!", ok: handleStageOk });
|
||||
return;
|
||||
}
|
||||
@@ -805,40 +633,8 @@ function handleDialogOk() {
|
||||
}
|
||||
|
||||
function handleStageOk() {
|
||||
// 判断添加人数是否已超过限制人数 限制 = 本次添加的人 + 原有的人
|
||||
if (props.type === 1) {
|
||||
if (props.groupMemberCount !== null) { // 只有添加组员的时候判断
|
||||
let selectMember = 0;
|
||||
if (activeKey.value === 4) { // 项目内选人
|
||||
selectMember = selectsData.value.projectMemberList.length;
|
||||
// 对选中的人员进行判断是否已经分组了
|
||||
let haveGroupNum = selectsData.value.projectMemberList.filter(item => item.groupId !== null);
|
||||
if (haveGroupNum.length > 0) {
|
||||
message.warning("部分学员已经有小组,再次添加会被添加到当前小组.");
|
||||
}
|
||||
// 判断是否是组长,组长不能添加
|
||||
const leaderArray = selectsData.value.projectMemberList.filter(item => item.isLeader === "1");
|
||||
if (leaderArray.length > 0) {
|
||||
return message.warning("当前选中学员" + leaderArray[0].realName + "已是小组长,请勿重复选择。");
|
||||
}
|
||||
} else if (activeKey.value === 1) {
|
||||
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) {
|
||||
selectMember = selectsData.value.groupList.length;
|
||||
} else if (activeKey.value === 3) {
|
||||
selectMember = selectsData.value.deptList.length;
|
||||
}
|
||||
|
||||
if (props.groupMemberCount < selectMember + Number(props.groupMemberNumber)) {
|
||||
return message.warning("添加小组学员超过最大值");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (props.type === 1 && props.groupId && props.groupMemberCount < projectSelectRows.value.length + stuSelectRows.value.length) {
|
||||
return message.warning("添加小组学员超过最大值");
|
||||
}
|
||||
stageVisible.value = false;
|
||||
visiable.value = false;
|
||||
@@ -848,43 +644,17 @@ function handleStageOk() {
|
||||
targetId: props.id,
|
||||
type: props.type,
|
||||
clear: props.clear,
|
||||
deptIds: selectsData.value.deptList?.map((e) => e.id),
|
||||
stageId: selectsData.value.stageId,
|
||||
groupIds: selectsData.value.groupList?.map((e) => e.id),
|
||||
studentList: selectsData.value.studentList.concat(
|
||||
selectsData.value.projectMemberList
|
||||
),
|
||||
deptIds: deptList.value?.map((e) => e.id),
|
||||
stageId: stageId.value,
|
||||
groupIds: auditSelectRows.value?.map((e) => e.id),
|
||||
studentList: stuSelectRows.value,
|
||||
projectList: projectSelectRows.value,
|
||||
groupName: props.groupName,
|
||||
groupId: props.groupId,
|
||||
}).then(() => {
|
||||
deleteDepSelect();
|
||||
emit("finash", true);
|
||||
});
|
||||
// //添加小组学员
|
||||
// if (props.isGroup) {
|
||||
// console.log("添加组员传参", selectsData.value, {
|
||||
// groupId: props.groupId,
|
||||
// pid: props.projectId,
|
||||
// groupName: props.groupName,
|
||||
// ids: selectsData.value.studentList?.map((e) => e.id),
|
||||
// });
|
||||
// addGroupMember({
|
||||
// groupId: props.groupId,
|
||||
// pid: props.projectId,
|
||||
// groupName: props.groupName,
|
||||
// studentIds: selectsData.value.studentList?.map((e) => e.id),
|
||||
// })
|
||||
// .then((res) => {
|
||||
// console.log("添加小组学员", res);
|
||||
// deleteDepSelect();
|
||||
// emit("finash", true);
|
||||
// })
|
||||
// .catch((err) => {
|
||||
// console.log("添加小组学员失败", err);
|
||||
// });
|
||||
// } else {
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
// 搜索受众值发生变化
|
||||
@@ -894,28 +664,18 @@ function orgValue(value) {
|
||||
}
|
||||
|
||||
watch(visiable, () => {
|
||||
stuSelectKeys.value = [];
|
||||
orgSelectKeys.value = [];
|
||||
auditSelectKeys.value = [];
|
||||
deptList.value = [];
|
||||
audienceName.value.keyword = "";
|
||||
audienceName.value.page = 1;
|
||||
audienceName.value.pageSize = 10;
|
||||
nameSearch.value.departId = null;
|
||||
stuTreeExpandedKeys.value = [];
|
||||
stuTreeSelectKeys.value = [];
|
||||
activeKey.value = props.isGroup ? 4 : 1;
|
||||
// activeKey.value = 1;
|
||||
selectsData.value = {
|
||||
stageId: "",
|
||||
studentList: [],
|
||||
deptList: [],
|
||||
groupList: [],
|
||||
projectMemberList: [],
|
||||
};
|
||||
stuReset();
|
||||
auditReset();
|
||||
|
||||
searchAudi();
|
||||
if (!visiable.value) {
|
||||
auditTableRef.value && auditTableRef.value.clear();
|
||||
stuTableRef.value && stuTableRef.value.clear();
|
||||
projectStuTableRef.value && projectStuTableRef.value.clear();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user