外部讲师调整

This commit is contained in:
wangxuemei
2024-11-10 15:21:04 +08:00
parent 4b8f436ef8
commit 9a7f38fbb9
3 changed files with 68 additions and 35 deletions

View File

@@ -100,7 +100,7 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="讲师名称" name="name"> <a-form-item label="讲师名称" name="name">
<a-input v-model:value="formParam.name" class="draitem" <a-input v-model:value="formParam.name" class="draitem" :maxlength="20"
placeholder="请输入讲师姓名" allowClear showSearch> placeholder="请输入讲师姓名" allowClear showSearch>
</a-input> </a-input>
</a-form-item> </a-form-item>
@@ -117,7 +117,7 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="供应商" name="supplier"> <a-form-item label="供应商" name="supplier">
<a-input v-model:value="formParam.supplier" class="draitem" <a-input v-model:value="formParam.supplier" class="draitem" :maxlength="30"
placeholder="请输入供应商" allowClear showSearch> placeholder="请输入供应商" allowClear showSearch>
</a-input> </a-input>
</a-form-item> </a-form-item>
@@ -129,8 +129,17 @@
</a-input> </a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24">
<a-form-item label="授课时长" name="defaultteachingtime">
<a-input v-model:value="formParam.defaultteachingtime" style="width:80%; height: 40px; border-radius: 8px ; "
placeholder="0" allowClear showSearch suffix="分钟" @blur="clearNonNumber">
</a-input>
<span style="margin-left: 5px ;" v-if="formParam.defaultteachingtime != null">{{ (formParam.defaultteachingtime / 60
).toFixed(2) }}小时</span>
<span style="margin-left: 5px ;" v-if="formParam.defaultteachingtime == null">0.00小时</span>
</a-form-item>
</a-col>
</a-row> </a-row>
<!-- 其他信息 --> <!-- 其他信息 -->
<a-row> <a-row>
<a-col :span="24"> <a-col :span="24">
@@ -218,8 +227,8 @@
<span>提示</span> <span>提示</span>
</div> </div>
<div class="body"> <div class="body">
<span v-if="handleOperate1 == 2">确定要将该讲师启用吗<div></div>启用后讲师可以登录教师端</span> <span v-if="handleOperate1 == 2">确定要将该讲师启用吗<div></div>启用后讲师可以登选为授课讲师</span>
<span v-if="handleOperate1 == 1">确定要将该讲师停用吗<div></div>停用后讲师不可登录教师端</span> <span v-if="handleOperate1 == 1">确定要将该讲师停用吗<div></div>停用后不可选为授课讲师</span>
</div> </div>
<div class="del_btnbox"> <div class="del_btnbox">
<div class="del_btn btn2" @click="cancelTeacherDialog1" style="margin-right: 32px"> <div class="del_btn btn2" @click="cancelTeacherDialog1" style="margin-right: 32px">
@@ -241,7 +250,7 @@
</div> </div>
</template> </template>
<script lang="jsx"> <script lang="jsx">
import { reactive, toRefs, ref,watch } from "vue"; import { reactive, toRefs, ref,watch ,computed} from "vue";
import Editor from "@/components/project/Editor"; import Editor from "@/components/project/Editor";
import { useRouter } from "vue-router"; import { useRouter } from "vue-router";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
@@ -268,6 +277,7 @@ export default {
setup() { setup() {
const formRef = ref(); const formRef = ref();
const router = useRouter(); const router = useRouter();
const userInfo = computed(() => store.state.userInfo);
const state = reactive({ const state = reactive({
currentPage1: 1, currentPage1: 1,
pageSize1: 10, pageSize1: 10,
@@ -297,8 +307,9 @@ export default {
formParam: { formParam: {
description:"", description:"",
teacherType:'2', teacherType:'2',
photo:boe, photo:'',
status:1 status:1,
defaultteachingtime:null,
}, },
vf:true, vf:true,
searchParam: { searchParam: {
@@ -381,8 +392,8 @@ export default {
}, },
{ {
title: '授课时长 ', title: '授课时长 ',
dataIndex: 'teaching', dataIndex: 'defaultteachingtime',
key: 'teaching', key: 'defaultteachingtime',
elipsis: true, align: "center", elipsis: true, align: "center",
width: 200, width: 200,
}, },
@@ -446,6 +457,10 @@ export default {
state.tableLoading = false state.tableLoading = false
// console.log("获取讲师tableDatateacherName", tableData); // console.log("获取讲师tableDatateacherName", tableData);
}) })
.catch(err => {
state.tableLoading = false
message.error(err.data.msg)
})
}; };
getTableDate() getTableDate()
// // 翻页 // // 翻页
@@ -459,7 +474,9 @@ export default {
cancel() cancel()
state.teacherdialog = true; state.teacherdialog = true;
state.teacherdialogtitle = '新增讲师' state.teacherdialogtitle = '新增讲师'
state.formParam.photo =userInfo.value?.avatar
state.vf = true state.vf = true
state.formParam.status = '1'
state.formParam.photo = state.formParam.photo === null ?boe : state.formParam.photo state.formParam.photo = state.formParam.photo === null ?boe : state.formParam.photo
} }
@@ -586,7 +603,8 @@ export default {
state.formParam = { state.formParam = {
status:1, status:1,
teacherType:2, teacherType:2,
photo:boe, photo:null,
defaultteachingtime:null,
name: null, name: null,
mobile: null, mobile: null,
email: null, email: null,
@@ -641,7 +659,7 @@ export default {
console.log("外部讲师详情", res.data); console.log("外部讲师详情", res.data);
state.formParam = res.data.data state.formParam = res.data.data
state.formParam.description = state.formParam.description === null ? '' : state.formParam.description state.formParam.description = state.formParam.description === null ? '' : state.formParam.description
state.formParam.photo = state.formParam.photo === null ?boe : state.formParam.photo state.formParam.photo = state.formParam.photo === null ? userInfo.value?.avatar : state.formParam.photo
}) })
.catch((err) => { .catch((err) => {
console.log("外部讲师详情", err); console.log("外部讲师详情", err);
@@ -661,6 +679,10 @@ export default {
// message.warning( '邮箱格式不正确') // message.warning( '邮箱格式不正确')
// } // }
} }
const clearNonNumber = () => {
state.formParam.defaultteachingtime = state.formParam.defaultteachingtime.replace(/\D/g, '');
// state.formParam.teaching
}
// getpromotionrecordstableData() // getpromotionrecordstableData()
//导出功能 //导出功能
const handleExport = () => { const handleExport = () => {
@@ -689,6 +711,7 @@ export default {
return { return {
...toRefs(state), ...toRefs(state),
lecturerAdmin, lecturerAdmin,
clearNonNumber,
enterPressHadlerSearch, enterPressHadlerSearch,
validateField, validateField,
rules, rules,

View File

@@ -135,8 +135,8 @@
<template #bodyCell="{ record, column }"> <template #bodyCell="{ record, column }">
<template v-if="column.key === 'operation'"> <template v-if="column.key === 'operation'">
<a-space> <a-space>
<a-button type="link" @click="() => handleLook(record, String(record.courseform))">查看</a-button> <a-button type="link" @click="() => handleLook(record, String(record.courseform))">查看</a-button>
<a-button type="link" @click="() => handleModify(record, String(record.courseform))">修改</a-button> <a-button type="link" @click="() => handleModify(record, String(record.courseform))" v-if="record.createFrom == 1 && record.courseStatus == 0 ">修改 </a-button>
<a-button type="link" @click="() => deleteModal(record, String(record.courseform))">删除</a-button> <a-button type="link" @click="() => deleteModal(record, String(record.courseform))">删除</a-button>
<!-- <a-button type="link" @click="() => deleteModal(record, String(record.courseform))">删除</a-button> --> <!-- <a-button type="link" @click="() => deleteModal(record, String(record.courseform))">删除</a-button> -->
</a-space> </a-space>
@@ -225,7 +225,7 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
<!-- 授课日期 beginTime 开课状态 courseStatus --> <!-- 授课日期 teachingDate 开课状态 courseStatus -->
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="授课/课程日期 :" name="teachingDate"> <a-form-item label="授课/课程日期 :" name="teachingDate">
@@ -237,8 +237,8 @@
<a-col :span="12"> <a-col :span="12">
<a-form-item label="开课状态"> <a-form-item label="开课状态">
<a-radio-group v-model:value="formParam.courseStatus" class="draitem"> <a-radio-group v-model:value="formParam.courseStatus" class="draitem">
<a-radio :value="1">未开课</a-radio> <a-radio :value="0">未开课</a-radio>
<a-radio :value="0">已开课</a-radio> <a-radio :value="1">已开课</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -248,7 +248,9 @@
<a-col :span="12"> <a-col :span="12">
<a-form-item label="授课时长" name="teaching"> <a-form-item label="授课时长" name="teaching">
<a-input v-model:value="formParam.teaching" style="width:80%; height: 40px; border-radius: 8px ; " <a-input v-model:value="formParam.teaching" style="width:80%; height: 40px; border-radius: 8px ; "
placeholder="0" allowClear showSearch suffix="分钟" @blur="clearNonNumber"> placeholder="0" allowClear showSearch suffix="分钟"
:maxLength="8"
@blur="clearNonNumber">
</a-input> </a-input>
<span style="margin-left: 5px ;" v-if="formParam.teaching != null">{{ (formParam.teaching / 60 <span style="margin-left: 5px ;" v-if="formParam.teaching != null">{{ (formParam.teaching / 60
).toFixed(2) }}小时</span> ).toFixed(2) }}小时</span>
@@ -257,8 +259,10 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="评分" name="score"> <a-form-item label="评分" name="score">
<a-input class="draitem" v-model:value="formParam.score" @blur="clearscoreNumber" placeholder="" allowClear showSearch> <!-- <a-input class="draitem" v-model:value="formParam.score" @blur="clearscoreNumber" placeholder="" allowClear showSearch>
</a-input> </a-input> -->
<a-input-number v-model:value="formParam.score" :min="0" :max="10"
style="width:100%; height: 40px; border-radius: 8px ; " />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@@ -266,7 +270,7 @@
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="24"> <a-col :span="24">
<a-form-item label="参训人数" name="studys"> <a-form-item label="参训人数" name="studys">
<a-input v-model:value="formParam.studys" class="draitem" placeholder="0 " <a-input v-model:value="formParam.studys" class="draitem" placeholder="0 " :maxLength="8"
@blur="clearstudysNumber" allowClear showSearch> @blur="clearstudysNumber" allowClear showSearch>
</a-input> </a-input>
</a-form-item> </a-form-item>
@@ -314,7 +318,7 @@
{{ formParam.createFrom == 0 ? '系统生成' : formParam.createFrom == 1 ? '手动录入' : '' }}</a-descriptions-item> {{ formParam.createFrom == 0 ? '系统生成' : formParam.createFrom == 1 ? '手动录入' : '' }}</a-descriptions-item>
<a-descriptions-item label="课程类型">{{ formParam.type == 1 ? '在线课' : formParam.type == 0 ? '面授课' : '' }}</a-descriptions-item> <a-descriptions-item label="课程类型">{{ formParam.type == 1 ? '在线课' : formParam.type == 0 ? '面授课' : '' }}</a-descriptions-item>
<a-descriptions-item label="课程名称">{{ formParam.courseName }}</a-descriptions-item> <a-descriptions-item label="课程名称">{{ formParam.courseName }}</a-descriptions-item>
<a-descriptions-item label="开课状态">{{ formParam.courseStatus == 1? '未开课' : formParam.courseStatus == 0 <a-descriptions-item label="开课状态">{{ formParam.courseStatus == 0? '未开课' : formParam.courseStatus == 1
? '已开课' : '' }}</a-descriptions-item> ? '已开课' : '' }}</a-descriptions-item>
<a-descriptions-item label="授课时长 "><span style="margin-left: 5px ;" v-if="formParam.teaching != null">{{ <a-descriptions-item label="授课时长 "><span style="margin-left: 5px ;" v-if="formParam.teaching != null">{{
(formParam.teaching / 60).toFixed(2) }}小时</span> </a-descriptions-item> (formParam.teaching / 60).toFixed(2) }}小时</span> </a-descriptions-item>
@@ -490,7 +494,7 @@ export default {
arr.map((value) => { arr.map((value) => {
let obj = { let obj = {
value: value.id, value: value.id,
label: value.trainOrgName, label: value.affiliationName,
}; };
array.push(obj); array.push(obj);
}); });
@@ -538,10 +542,12 @@ export default {
{ value: 3, label: "面授开课" }, { value: 3, label: "面授开课" },
]) ])
const AuthenticationStatusList = ref([ const AuthenticationStatusList = ref([
{ value: 1, label: "未开课" }, { value: '', label: "全部" },
{ value: 0, label: "开课" }, { value:0, label: "开课" },
{ value: 1, label: "已开课" },
]) ])
const entryTypeList = ref([ const entryTypeList = ref([
{ value: '', label: "全部" },
{ value: 0, label: "系统生成" }, { value: 0, label: "系统生成" },
{ value: 1, label: "手动录入" }, { value: 1, label: "手动录入" },
]) ])
@@ -642,7 +648,7 @@ export default {
customRender: (value) => { customRender: (value) => {
return ( return (
<div> <div>
{value.record.createFrom == "1" || value.record.createFrom == "2" {value.record.createFrom == "0" || value.record.createFrom == "1"
? { ? {
"0": "系统生成", "0": "系统生成",
"1": "手动录入", "1": "手动录入",
@@ -696,8 +702,8 @@ export default {
<div> <div>
{value.record.courseStatus == 0 || value.record.courseStatus == 1 {value.record.courseStatus == 0 || value.record.courseStatus == 1
? { ? {
"0": "开课", "0": "开课",
"1": "开课", "1": "开课",
}[value.record.courseStatus + ""] || "" }[value.record.courseStatus + ""] || ""
: "-"} : "-"}
</div> </div>
@@ -839,6 +845,10 @@ export default {
state.tableLoading = false state.tableLoading = false
console.log("获取tableData", tableData); console.log("获取tableData", tableData);
}) })
.catch(err => {
state.tableLoading = false
message.error(err.data.msg)
})
}; };
getTableDate() getTableDate()
@@ -954,7 +964,7 @@ export default {
teacher: null, teacher: null,
orgName: null, orgName: null,
tsystemName: null, tsystemName: null,
levelId: null, tlevelId: null,
courseName: null, courseName: null,
teaching:null, teaching:null,
studys: null, studys: null,
@@ -1010,7 +1020,7 @@ export default {
// userNo: record.userNo, // userNo: record.userNo,
// orgName: record.orgName, // orgName: record.orgName,
// tsystemName: record.tsystemName, // tsystemName: record.tsystemName,
// levelId: record.levelId, // tlevelId: record.tlevelId,
// type: record.type, // type: record.type,
// courseName: record.courseName, // courseName: record.courseName,
// courseStatus:record.courseStatus, // courseStatus:record.courseStatus,
@@ -1127,7 +1137,7 @@ export default {
const rules = { const rules = {
name: [{ required: true, message:'',log: '讲师不能为空' }], name: [{ required: true, message:'',log: '讲师不能为空' }],
orgName: [{ required: true, message: '',log:'讲师组织不能为空' }], orgName: [{ required: true, message: '',log:'讲师组织不能为空' }],
levelId: [{ required: true, message: '',log:'讲师级别不能为空' }], tlevelId: [{ required: true, message: '',log:'讲师级别不能为空' }],
tsystemName: [{ required: true, message: '',log:'讲师体系不能为空' }], tsystemName: [{ required: true, message: '',log:'讲师体系不能为空' }],
courseTypeId: [{ required: true, message: '',log:'内容分类不能为空' }], courseTypeId: [{ required: true, message: '',log:'内容分类不能为空' }],
courseName: [{ required: true, message: '',log:'课程名称不能为空' }], courseName: [{ required: true, message: '',log:'课程名称不能为空' }],

View File

@@ -26,9 +26,9 @@ ExternalLecturer
<a-descriptions-item label="讲师姓名">{{formParam.name}}</a-descriptions-item> <a-descriptions-item label="讲师姓名">{{formParam.name}}</a-descriptions-item>
<a-descriptions-item label="手机号码">{{formParam.mobile}}</a-descriptions-item> <a-descriptions-item label="手机号码">{{formParam.mobile}}</a-descriptions-item>
<a-descriptions-item label="讲师邮箱">{{formParam.email}}</a-descriptions-item> <a-descriptions-item label="讲师邮箱">{{formParam.email}}</a-descriptions-item>
<a-descriptions-item label="授课时长" :span="2">{{formParam.teaching}} <a-descriptions-item label="授课时长" :span="2">{{formParam.defaultteachingtime}}
<span style="margin-left: 5px ;" v-if="formParam.teaching != null">({{ <span style="margin-left: 5px ;" v-if="formParam.defaultteachingtime != null">({{
(formParam.teaching / 60).toFixed(2) }}小时)</span> (formParam.defaultteachingtime / 60).toFixed(2) }}小时)</span>
</a-descriptions-item> </a-descriptions-item>
</a-descriptions> </a-descriptions>
<div style="margin-top: 10px;"></div> <div style="margin-top: 10px;"></div>