班级管理

dev
LiuJiaNan 2024-03-18 18:01:48 +08:00
parent f0c4ec11bb
commit fa41f42465
16 changed files with 964 additions and 1198 deletions

View File

@ -224,12 +224,12 @@ export const layoutFnGetInsuranceCompany = async () => {
// 培训类型
export const layoutFnGetTrainingType = async (params) => {
const resData = await getTrainingType(params);
return ref(resData.trainingtypelist);
return ref(resData.varList);
};
// 行业类型
export const layoutFnGetIndustryType = async (params) => {
const resData = await getIndustryType(params);
return ref(JSON.parse(resData.zTreeNodes));
return ref(resData.zTreeNodes);
};
// 岗位类型
export const layoutFnGetPostType = async (params) => {

File diff suppressed because it is too large Load Diff

View File

@ -59,8 +59,8 @@ axios.interceptors.response.use(
import.meta.env.DEV &&
ElMessage.error(`连接错误${error.response.status}`);
endLoading();
ElMessage.error("登录失效,请重新登陆");
router.push("/login").then();
// ElMessage.error("登录失效,请重新登陆");
// router.push("/login").then();
}
} else {
error.message = "连接到服务器失败";

View File

@ -133,7 +133,7 @@ export const getStandardLevels = () =>
});
// 培训类型
export const getTrainingType = (params) =>
post("/trainingtype/privateList", {
post("/trainingtype/listAll", {
loading: false,
...params,
});

View File

@ -18,3 +18,15 @@ export const setExamPaperManagementTestQuestionsEdit = (params) =>
post("/paperQuestion/edit", params); // 试卷管理试题修改
export const getAssociatedCoursewareNameList = (params) =>
post("/videocourseware/getCourseWareName", params); // 关联课件名称
export const getClassManagementList = (params) => post("/class/list", params); // 班级管理列表
export const setClassManagementDelete = (params) =>
post("/class/delete", params); // 班级管理删除
export const setClassManagementDelay = (params) =>
post("/class/postpone", params); // 班级管理延期
export const getPersonnelList = (params) =>
post("/trainedusersign/listByEnt", { loading: false, params }); // 班级管理添加人员
export const getClassManagementView = (params) => post("/class/goEdit", params); // 班级管理查看
export const setClassManagementAdd = (params) => post("/class/add", params); // 班级管理添加
export const setClassManagementEdit = (params) => post("/class/edit", params); // 班级管理修改
export const setClassManagementModifyExamTimes = (params) =>
post("/class/editNumberofexams", params); // 班级管理修改考试次数

View File

@ -0,0 +1,57 @@
<template>
<layout-card>
<el-tabs v-model="active" @tab-change="fnTabChange">
<el-tab-pane
label="基本信息"
:name="
!CLASS_ID
? '/training_process_management/class_management/add'
: STATE === '1'
? '/training_process_management/class_management/edit'
: '/training_process_management/class_management/view'
"
lazy
:disabled="!CLASS_ID"
>
<basic-info />
</el-tab-pane>
<el-tab-pane
label="学员"
name="/training_process_management/class_management/student"
lazy
:disabled="!CLASS_ID"
>
<student />
</el-tab-pane>
<el-tab-pane
label="课程"
name="/training_process_management/class_management/curriculum"
lazy
:disabled="!CLASS_ID"
>
<curriculum />
</el-tab-pane>
</el-tabs>
</layout-card>
</template>
<script setup>
import BasicInfo from "./components/basic_info.vue";
import Student from "./components/student.vue";
import Curriculum from "./components/curriculum.vue";
import { ref } from "vue";
import { useRoute, useRouter } from "vue-router";
const router = useRouter();
const route = useRoute();
const { CLASS_ID, STATE } = route.query;
const active = ref(route.path);
const fnTabChange = (path) => {
router.replace({
path,
query: { ...route.query },
});
};
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,374 @@
<template>
<el-form ref="formRef" :model="data.form" :rules="rules" label-width="160px">
<el-row>
<el-col :span="24">
<el-divider content-position="left">基本信息</el-divider>
</el-col>
<el-col :span="12">
<el-form-item label="班级名称" prop="NAME">
<el-input
v-model="data.form.NAME"
placeholder="请输入班级名称"
:disabled="isDisabled"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训日期" prop="TIME">
<el-date-picker
v-model="data.form.TIME"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:disabled="isDisabled"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="培训类型" prop="TRAINTYPE">
<layout-learning-train-type
ref="trainingTypeRef"
v-model="data.form.TRAINTYPE"
type="trainingType"
:disabled="isDisabled"
@update:model-value="
data.form.POSTTYPE = '';
data.form.TRAINLEVEL = '';
"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="岗位类型" prop="POSTTYPE">
<layout-learning-train-type
ref="postTypeRef"
v-model="data.form.POSTTYPE"
type="postType"
:search-value="data.form.TRAINTYPE"
:disabled="isDisabled"
@update:model-value="data.form.TRAINLEVEL = ''"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="培训级别"
prop="TRAINLEVEL"
:rules="[
{
required: data.trainingLevelList.length !== 0,
message: '请选择培训级别',
trigger: 'change',
},
]"
>
<layout-learning-train-type
ref="trainingLevelRef"
v-model="data.form.TRAINLEVEL"
type="trainingLevel"
:search-value="data.form.POSTTYPE"
:disabled="isDisabled"
@throw-data="data.trainingLevelList = $event"
/>
</el-form-item>
</el-col>
<template
v-if="
data.form.TRAINTYPE &&
data.form.TRAINTYPE !== 'c70bf859512241579a8a30fc5d1ae153'
"
>
<el-col :span="12">
<el-form-item label="记录人员" prop="RECORDOR">
<el-select
v-model="data.form.RECORDOR"
filterable
:disabled="isDisabled"
>
<el-option
v-for="item in data.recordingPersonnelList"
:key="item.USERSIGNID"
:value="item.USERSIGNID"
:label="item.USERNAME"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="考核人员" prop="ASSESSOR">
<el-select
v-model="data.form.ASSESSOR"
filterable
:disabled="isDisabled"
>
<el-option
v-for="item in data.assessorsList"
:key="item.USERSIGNID"
:value="item.USERSIGNID"
:label="item.USERNAME"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="安全管理部门负责人" prop="SAFETYDEPTOR">
<el-select
v-model="data.form.SAFETYDEPTOR"
filterable
:disabled="isDisabled"
>
<el-option
v-for="item in data.headOfSafetyManagementDepartmentList"
:key="item.USERSIGNID"
:value="item.USERSIGNID"
:label="item.USERNAME"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人" prop="PRINCIPAL">
<el-input
v-model="data.form.PRINCIPAL"
placeholder="请输入负责人"
:disabled="isDisabled"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="负责人电话" prop="PRINCIPAL_PHONE">
<el-input
v-model="data.form.PRINCIPAL_PHONE"
placeholder="请输入负责人电话"
:disabled="isDisabled"
/>
</el-form-item>
</el-col>
</template>
<el-col :span="24">
<el-divider content-position="left">基本设置</el-divider>
</el-col>
<el-col :span="12">
<el-form-item label="是否开启考试" prop="EXAMINATION">
<el-radio-group
v-model="data.form.EXAMINATION"
:disabled="isDisabled"
>
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
<span class="ml-10">
不考试的班级学员学习完所有课程即为完成学业
</span>
</el-form-item>
</el-col>
<el-col v-if="data.form.EXAMINATION === 1" :span="12">
<el-form-item label="考试次数" prop="NUMBEROFEXAMS">
<div style="flex: 1; display: flex">
<el-input-number
v-model="data.form.NUMBEROFEXAMS"
:min="1"
:max="2147483600"
:disabled="isDisabled"
/>
<el-button
v-if="STATE && STATE !== '1' && STATE !== '6'"
type="primary"
class="ml-10"
@click="fnModifyExamTimes"
>
修改考试次数
</el-button>
</div>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否人脸识别" prop="ISFACE">
<el-radio-group v-model="data.form.ISFACE" :disabled="isDisabled">
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col v-if="data.form.EXAMINATION === 1" :span="12">
<el-form-item label="是否效果评估" prop="ISSTRENGTHEN">
<el-radio-group
v-model="data.form.ISSTRENGTHEN"
:disabled="isDisabled"
>
<el-radio label="2">强制</el-radio>
<el-radio label="1"></el-radio>
<el-radio label="0"></el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="mt-10 tc">
<el-button type="primary" @click="fnSubmit">
{{ !CLASS_ID ? "保存并下一步" : "保存" }}
</el-button>
</div>
<modify-exam-times
:id="CLASS_ID"
v-model:visible="data.modifyExamTimesDialog.visible"
v-model:form="data.modifyExamTimesDialog.form"
@get-data="fnGetData"
/>
</template>
<script setup>
import { nextTick, reactive, ref } from "vue";
import LayoutLearningTrainType from "@/components/learning_train_type/index.vue";
import {
getClassManagementView,
getPersonnelList,
setClassManagementAdd,
setClassManagementEdit,
} from "@/request/training_process_management.js";
import { debounce } from "throttle-debounce";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus";
import { useRoute, useRouter } from "vue-router";
import ModifyExamTimes from "./modify_exam_times.vue";
const route = useRoute();
const router = useRouter();
const { STATE, CLASS_ID } = route.query;
const isDisabled = STATE && STATE !== "1";
const formRef = ref(null);
const trainingTypeRef = ref(null);
const postTypeRef = ref(null);
const trainingLevelRef = ref(null);
const data = reactive({
recordingPersonnelList: [],
assessorsList: [],
headOfSafetyManagementDepartmentList: [],
trainingLevelList: [],
form: {
NAME: "",
TIME: "",
TRAINTYPE: "",
POSTTYPE: "",
TRAINLEVEL: "",
RECORDOR: "",
ASSESSOR: "",
SAFETYDEPTOR: "",
PRINCIPAL: "",
PRINCIPAL_PHONE: "",
EXAMINATION: 1,
NUMBEROFEXAMS: 1,
ISFACE: "1",
ISSTRENGTHEN: "1",
},
modifyExamTimesDialog: {
visible: false,
form: { NUMBEROFEXAMS: 1, source: 1 },
},
});
const rules = {
NAME: [{ required: true, message: "请输入班级名称", trigger: "blur" }],
TIME: [{ required: true, message: "请选择培训日期", trigger: "change" }],
TRAINTYPE: [{ required: true, message: "请选择培训类型", trigger: "change" }],
POSTTYPE: [{ required: true, message: "请选择岗位类型", trigger: "change" }],
RECORDOR: [{ required: true, message: "请选择记录人员", trigger: "change" }],
ASSESSOR: [{ required: true, message: "请选择考核人员", trigger: "change" }],
SAFETYDEPTOR: [
{ required: true, message: "请选择安全管理部门负责人", trigger: "change" },
],
PRINCIPAL: [{ required: true, message: "请输入负责人", trigger: "blur" }],
PRINCIPAL_PHONE: [
{ required: true, message: "请输入负责人电话", trigger: "blur" },
{
pattern:
/^(?:(?:\+|00)86)?1(?:(?:3[\d])|(?:4[5-79])|(?:5[0-35-9])|(?:6[5-7])|(?:7[0-8])|(?:8[\d])|(?:9[189]))\d{8}$/,
message: "请输入正确的手机号码",
},
],
EXAMINATION: [
{ required: true, message: "请选择是否开启考试", trigger: "change" },
],
ISFACE: [
{ required: true, message: "请选择是否人脸识别", trigger: "change" },
],
ISSTRENGTHEN: [
{ required: true, message: "请选择是否效果评估", trigger: "change" },
],
NUMBEROFEXAMS: [
{ required: true, message: "请输入考试次数", trigger: "blur" },
],
};
const fnGetData = async () => {
if (!CLASS_ID) return;
const resData = await getClassManagementView({ CLASS_ID });
resData.pd.TIME = [resData.pd.START_TIME, resData.pd.END_TIME];
data.form = resData.pd;
};
fnGetData();
const fnGetPersonnelList = async () => {
const { varList: recordingPersonnelList } = await getPersonnelList({
USERSIGNTYPE: "854c77daf3734384807a638dfafe04d5",
});
const { varList: assessorsList } = await getPersonnelList({
USERSIGNTYPE: "f2726f92987d4f77be1c3f0460669418",
});
const { varList: headOfSafetyManagementDepartmentList } =
await getPersonnelList({
USERSIGNTYPE: "5f4794189cf24fc2a7e12fa47b70139e",
});
data.recordingPersonnelList = recordingPersonnelList;
data.assessorsList = assessorsList;
data.headOfSafetyManagementDepartmentList =
headOfSafetyManagementDepartmentList;
};
fnGetPersonnelList();
const fnSubmit = debounce(
1000,
async () => {
await useFormValidate(formRef);
const params = {
...data.form,
ISSTRENGTHEN: data.form.EXAMINATION === 1 ? data.form.ISSTRENGTHEN : "0",
START_TIME: data.form.TIME[0],
END_TIME: data.form.TIME[1],
SAMPLINGNUMBER: "0",
TRAINTYPE_NAME: trainingTypeRef.value.getCurrentNode().NAME,
POSTTYPE_NAME: postTypeRef.value.getCurrentNode().NAME,
TRAINLEVEL_NAME: trainingLevelRef.value.getCurrentNode().NAME || "",
trainAllName:
trainingTypeRef.value.getCurrentNode().NAME +
"-" +
postTypeRef.value.getCurrentNode().NAME,
};
let resData;
!CLASS_ID
? (resData = await setClassManagementAdd(params))
: await setClassManagementEdit(params);
ElMessage.success("提交成功");
await router.replace({
path: !CLASS_ID
? "/training_process_management/class_management/student"
: STATE === "1"
? "/training_process_management/class_management/edit"
: "/training_process_management/class_management/view",
query: {
...route.query,
CLASS_ID: !CLASS_ID ? resData.CLASS_ID : CLASS_ID,
TRAINTYPE: data.form.TRAINTYPE,
},
});
},
{ atBegin: true }
);
const fnModifyExamTimes = async () => {
data.modifyExamTimesDialog.visible = true;
await nextTick();
data.modifyExamTimesDialog.form.NUMBEROFEXAMS = data.form.NUMBEROFEXAMS;
data.modifyExamTimesDialog.form.source = data.form.NUMBEROFEXAMS;
};
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,7 @@
<template>
<div></div>
</template>
<script setup></script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,61 @@
<template>
<el-dialog v-model="visible" title="延期" :on-close="fnClose">
<el-form ref="formRef" :model="form" :rules="rules" label-width="60px">
<el-form-item label="日期" prop="TIME">
<el-date-picker
v-model="form.TIME"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
:disabled-date="fnDisabledDate"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="fnClose"></el-button>
<el-button type="primary" @click="fnSubmit"></el-button>
</template>
</el-dialog>
</template>
<script setup>
import { useVModels } from "@vueuse/core";
import { ref } from "vue";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { setClassManagementDelay } from "@/request/training_process_management.js";
import { ElMessage } from "element-plus";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
form: {
type: Object,
required: true,
default: () => {},
},
});
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible, form } = useVModels(props, emits);
const formRef = ref(null);
const rules = {
TIME: [{ required: true, message: "请选择日期", trigger: "change" }],
};
const fnDisabledDate = (time) => {
return time.getTime() <= new Date(form.value.TIME).getTime();
};
const fnClose = () => {
formRef.value.resetFields();
visible.value = false;
};
const fnSubmit = async () => {
await useFormValidate(formRef);
await setClassManagementDelay({ ...form.value });
ElMessage.success("延期成功");
fnClose();
emits("get-data");
};
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="修改考试次数" :on-close="fnClose">
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="原考试次数" prop="source">
<el-input-number v-model="form.source" disabled />
</el-form-item>
<el-form-item label="新考试次数" prop="NUMBEROFEXAMS">
<el-input-number v-model="form.NUMBEROFEXAMS" :min="+form.source + 1" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="fnClose"></el-button>
<el-button type="primary" @click="fnSubmit"></el-button>
</template>
</el-dialog>
</template>
<script setup>
import { useVModels } from "@vueuse/core";
import { ref } from "vue";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { setClassManagementModifyExamTimes } from "@/request/training_process_management.js";
import { ElMessage, ElMessageBox } from "element-plus";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
form: {
type: Object,
required: true,
default: () => {},
},
id: {
type: String,
required: true,
default: "",
},
});
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible, form } = useVModels(props, emits);
const formRef = ref(null);
const rules = {
NUMBEROFEXAMS: [
{ required: true, message: "请填写考试次数", trigger: "blur" },
],
};
const fnClose = () => {
formRef.value.resetFields();
visible.value = false;
};
const fnSubmit = async () => {
await useFormValidate(formRef);
await ElMessageBox.confirm(
"确定要修改该班级的考试次数吗?考试已通过的学员不受影响",
{ type: "warning" }
);
await setClassManagementModifyExamTimes({
...form.value,
CLASS_ID: props.id,
});
ElMessage.success("修改成功");
fnClose();
emits("get-data");
};
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,7 @@
<template>
<div></div>
</template>
<script setup></script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,334 @@
<template>
<div>
<el-card>
<el-form
:model="searchForm"
label-width="100px"
@submit.prevent="fnResetPaginationTransfer"
>
<el-row>
<el-col :span="6">
<el-form-item label="班级编码" prop="CODE">
<el-input v-model="searchForm.CODE" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="班级名称" prop="KEYWORDS">
<el-input v-model="searchForm.KEYWORDS" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="培训类型" prop="TRAINTYPE">
<layout-learning-train-type
v-model="searchForm.TRAINTYPE"
type="trainingType"
@update:model-value="
searchForm.POSTTYPE = '';
searchForm.TRAINLEVEL = '';
"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="行业类型" prop="INDUSTRY_END_ID">
<layout-learning-train-type
v-model="searchForm.INDUSTRY_END_ID"
type="industryType"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="岗位类型" prop="POSTTYPE">
<layout-learning-train-type
v-model="searchForm.POSTTYPE"
type="postType"
:search-value="searchForm.TRAINTYPE"
@update:model-value="searchForm.TRAINLEVEL = ''"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="培训级别" prop="TRAINLEVEL">
<layout-learning-train-type
v-model="searchForm.TRAINLEVEL"
type="trainingLevel"
:search-value="searchForm.POSTTYPE"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="班级状态" prop="STATE">
<el-select v-model="searchForm.STATE">
<el-option
v-for="item in classStatusList"
:key="item.ID"
:value="item.ID"
:label="item.NAME"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="开班时间" prop="TIME">
<el-date-picker
v-model="searchForm.TIME"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="结束时间" prop="TIME1">
<el-date-picker
v-model="searchForm.TIME1"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label-width="10px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPaginationTransfer">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<layout-card>
<div class="mb-10">
<span class="mr-10">
班级总数<i>{{ data.clsNum }}</i>
</span>
<span>
班级总人次<i>{{ data.stuNum }}</i>
</span>
</div>
<layout-table
v-model:pagination="pagination"
:data="list"
@get-data="fnGetDataTransfer"
>
<el-table-column label="序号" width="60" fixed="left">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column
label="班级名称"
prop="NAME"
show-overflow-tooltip
fixed="left"
/>
<el-table-column
label="班级编码"
prop="CODE"
width="150"
fixed="left"
/>
<el-table-column
label="培训类型"
prop="TRAININGTYPE_NAME"
width="150"
/>
<el-table-column label="行业类型" prop="POSTTYPE_NAME" width="150" />
<el-table-column
label="岗位类型"
prop="INDUSTRY_ALL_NAME"
width="200"
/>
<el-table-column label="培训等级" prop="TRAINLEVEL_NAME" width="150" />
<el-table-column label="负责人" prop="PRINCIPAL" width="150" />
<el-table-column label="培训开始时间" prop="START_TIME" width="150" />
<el-table-column label="培训结束时间" prop="END_TIME" width="150" />
<el-table-column label="涉及培训岗位数" prop="POSTNUM" width="150" />
<el-table-column label="学员人员数" prop="STUDENT_NUM" width="150" />
<el-table-column label="试卷类型" width="150">
<template #default="{ row }">
{{ translationStatus(row.STATE, classStatusList) }}
</template>
</el-table-column>
<el-table-column label="操作" width="200" fixed="right">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="
router.push({
path:
row.STATE === '1'
? '/training_process_management/class_management/edit'
: '/training_process_management/class_management/view',
query: {
STATE: row.STATE,
CLASS_ID: row.CLASS_ID,
TRAINTYPE: row.TRAINTYPE,
},
})
"
>
{{ row.STATE === "1" ? "编辑" : "查看" }}
</el-button>
<el-button
type="primary"
text
link
@click="
router.push({
path: '/training_process_management/class_management/student',
query: {
STATE: row.STATE,
CLASS_ID: row.CLASS_ID,
TRAINTYPE: row.TRAINTYPE,
},
})
"
>
学员
</el-button>
<el-button
type="primary"
text
link
@click="
router.push({
path: '/training_process_management/class_management/curriculum',
query: {
STATE: row.STATE,
CLASS_ID: row.CLASS_ID,
TRAINTYPE: row.TRAINTYPE,
},
})
"
>
课程
</el-button>
<el-button
v-if="row.STATE === '1' && row.STUDYRECORDCNT === 0"
type="primary"
text
link
@click="fnDelete(row.CLASS_ID)"
>
删除
</el-button>
<el-button
v-if="row.STATE !== '1'"
type="primary"
text
link
@click="fnDelay(row.CLASS_ID, row.END_TIME)"
>
延期
</el-button>
</template>
</el-table-column>
<template #button>
<el-button
type="primary"
@click="
router.push({
path: '/training_process_management/class_management/add',
})
"
>
新建培训任务
</el-button>
</template>
</layout-table>
</layout-card>
<delay
v-model:visible="data.delayDialog.visible"
v-model:form="data.delayDialog.form"
@get-data="fnResetPaginationTransfer"
/>
</div>
</template>
<script setup>
import useListData from "@/assets/js/useListData.js";
import { serialNumber, translationStatus } from "@/assets/js/utils.js";
import { useRouter } from "vue-router";
import { debounce } from "throttle-debounce";
import { ElMessage, ElMessageBox } from "element-plus";
import {
getClassManagementList,
setClassManagementDelete,
} from "@/request/training_process_management.js";
import LayoutLearningTrainType from "@/components/learning_train_type/index.vue";
import { nextTick, reactive } from "vue";
import Delay from "./components/delay.vue";
const classStatusList = [
{ ID: "1", NAME: "未申请" },
{ ID: "4", NAME: "待开班" },
{ ID: "5", NAME: "培训中" },
{ ID: "6", NAME: "培训结束" },
];
const router = useRouter();
const data = reactive({
stuNum: 0,
clsNum: 0,
delayDialog: {
visible: false,
form: {
CLASS_ID: "",
TIME: "",
},
},
});
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getClassManagementList, {
callbackFn: (list, resData) => {
data.stuNum = resData.stuNum;
data.clsNum = resData.clsNum;
},
});
const fnGetDataTransfer = () => {
fnGetData({
STARTTIME: searchForm.value.TIME?.[0],
ENDTIME: searchForm.value.TIME?.[1],
OVERSTARTTIME: searchForm.value.TIME1?.[0],
OVERENDTIME: searchForm.value.TIME1?.[1],
});
};
const fnResetPaginationTransfer = () => {
fnResetPagination({
STARTTIME: searchForm.value.TIME?.[0],
ENDTIME: searchForm.value.TIME?.[1],
OVERSTARTTIME: searchForm.value.TIME1?.[0],
OVERENDTIME: searchForm.value.TIME1?.[1],
});
};
const fnDelete = debounce(
1000,
async (CLASS_ID) => {
await ElMessageBox.confirm("确定要删除吗?", {
type: "warning",
});
await setClassManagementDelete({ CLASS_ID });
ElMessage.success("删除成功");
fnResetPaginationTransfer();
},
{ atBegin: true }
);
const fnDelay = async (CLASS_ID, END_TIME) => {
data.delayDialog.visible = true;
await nextTick();
data.delayDialog.form.CLASS_ID = CLASS_ID;
data.delayDialog.form.TIME = END_TIME;
};
</script>
<style scoped lang="scss"></style>

View File

@ -61,14 +61,12 @@
</el-select>
</el-form-item>
<el-form-item label="关联课件名称" prop="VIDEOCOURSEWARE_ID">
<el-select v-model="form.VIDEOCOURSEWARE_ID" filterable>
<el-option
v-for="item in associatedCoursewareName"
:key="item.VIDEOCOURSEWARE_ID"
:label="item.COURSEWARENAME"
:value="item.VIDEOCOURSEWARE_ID"
/>
</el-select>
<el-select-v2
v-model="form.VIDEOCOURSEWARE_ID"
:options="associatedCoursewareName"
filterable
:props="{ label: 'COURSEWARENAME', value: 'VIDEOCOURSEWARE_ID' }"
/>
</el-form-item>
<el-form-item label="答案解析" prop="DESCR">
<el-input

View File

@ -19,6 +19,10 @@
ref="trainingTypeRef"
v-model="data.form.TRAINTYPE"
type="trainingType"
@update:model-value="
data.form.POSTTYPE = '';
data.form.TRAINLEVEL = '';
"
/>
</el-form-item>
</el-col>
@ -38,6 +42,7 @@
v-model="data.form.POSTTYPE"
type="postType"
:search-value="data.form.TRAINTYPE"
@update:model-value="data.form.TRAINLEVEL = ''"
/>
</el-form-item>
</el-col>

View File

@ -30,6 +30,10 @@
<layout-learning-train-type
v-model="searchForm.TRAINTYPE"
type="trainingType"
@update:model-value="
searchForm.POSTTYPE = '';
searchForm.TRAINLEVEL = '';
"
/>
</el-form-item>
</el-col>
@ -47,6 +51,7 @@
v-model="searchForm.POSTTYPE"
type="postType"
:search-value="searchForm.TRAINTYPE"
@update:model-value="searchForm.TRAINLEVEL = ''"
/>
</el-form-item>
</el-col>

View File

@ -17,6 +17,7 @@
<layout-learning-train-type
v-model="searchForm.TRAINTYPE"
type="trainingType"
@update:model-value="searchForm.POSTTYPE = ''"
/>
</el-form-item>
</el-col>