Merge remote-tracking branch 'zcwy/zcwy-teacher-manage' into zcwy-teacher-manage

# Conflicts:
#	src/views/lecturer/InsideTeaching.vue
This commit is contained in:
zhangsir
2024-11-11 11:14:10 +08:00
5 changed files with 39 additions and 23 deletions

View File

@@ -192,10 +192,19 @@ import {getCookieForName} from "@/api/method";
state.fileList = [];
state.uploadpercent = -1;
message.destroy();
message.error("请上传正确的文件格式");
message.error("请按模板格式上传文件");
return;
}
}
let isLt1M = info.file.size < 512000000;
console.log(info.file.size, isLt1M)
if (!isLt1M) {
state.fileList = [];
state.uploadpercent = -1;
message.destroy();
message.error("图片不能超过500KB! 请重新上传");
return;
}
state.addLoading = true;
state.uploadpercent = parseInt(info.file.percent);

View File

@@ -60,7 +60,7 @@ function debounce(func, wait) {
timeout = setTimeout(() => func.apply(this, args), wait);
};
}
const memberParam = ref({name: '', pageNo:1, pageSize: 999,teacherType:2})
const memberParam = ref({name: '', pageNo:1, pageSize: 999,teacherType:2 ,status:1})
const userList = ref([])
const loading = ref(false)

View File

@@ -21,7 +21,7 @@
</a-form-item>
<a-form-item class="select ">
<div class="select addTimeBox">
<div class="addTime">创建时间</div>
<div class="addTime">课程日期</div>
<a-range-picker v-model:value="searchdate" style="width: 420px" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD"
separator="至" :placeholder="[' 开始时间', ' 结束时间']
"
@@ -98,7 +98,7 @@
<template v-if="column.key === 'operation'">
<a-space>
<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-space>
</template>
@@ -168,14 +168,15 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="授课/课程日期 :" name="teachingDate">
<a-date-picker class="draitem" v-model:value="teachingDate" style="width:100%" format="YYYY-MM-DD"
<a-date-picker class="draitem" v-model:value="teachingDate" style="width:100%" format="YYYY-MM-DD HH:mm" :show-time="{ format: 'HH:mm' }"
placeholder="请选择课程日期" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="授课时长" name="teaching">
<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>
<span style="margin-left: 5px ;" v-if="formParam.teaching != null">{{ (formParam.teaching / 60
).toFixed(2) }}小时</span>
@@ -187,16 +188,17 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="参训人数" name="studys">
<a-input v-model:value="formParam.studys" class="draitem" placeholder="0 " allowClear showSearch
<a-input v-model:value="formParam.studys" class="draitem" placeholder="0 " allowClear showSearch :maxLength="8"
@blur="clearstudysNumber">
</a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="评分" name="score">
<a-input v-model:value="formParam.score" class="draitem" placeholder="0 " allowClear showSearch
@blur="clearscoreNumber">
</a-input>
<!-- <a-input class="draitem" v-model:value="formParam.score" @blur="clearscoreNumber" placeholder="" allowClear showSearch>
</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-col>
</a-row>
@@ -239,8 +241,8 @@
? '已开课' : '' }}</a-descriptions-item>
<a-descriptions-item label="内容分类 ">{{ formParam.courseTypeName }}</a-descriptions-item>
<a-descriptions-item label="授课/课程日期 ">{{ formParam.teachingDate }}</a-descriptions-item>
<a-descriptions-item label="授课时长 ">{{ formParam.teaching }}
<span style="margin-left: 5px ;" v-if="formParam.teaching != null">({{ (formParam.teaching / 60
<a-descriptions-item label="授课时长 ">{{ formParam.teaching }} 分钟
<span style="margin-left: 10px ;" v-if="formParam.teaching != null">({{ (formParam.teaching / 60
).toFixed(2) }}小时)</span>
</a-descriptions-item>
<a-descriptions-item label="评分 ">{{ formParam.score }}</a-descriptions-item>
@@ -381,7 +383,7 @@ export default {
const AddressList = ref([
]);
const rules = {
name: [{ required: true, message: '', log: '讲师不能为空' }],
teacherName: [{ required: true, message: '', log: '讲师不能为空' }],
courseTypeId: [{ required: true, message: '', log: '内容分类不能为空' }],
courseName: [{ required: true, message: '', log: '课程名称不能为空' }],
courseStatus: [{ required: true, message: '', log: '讲开课状态不能为空' }],
@@ -402,10 +404,12 @@ export default {
{ value: 3, label: "面授开课" },
])
const AuthenticationStatusList = ref([
{ value: '', label: "全部" },
{ value: 0, label: "未开课" },
{ value: 1, label: "已开课" },
])
const entryTypeList = ref([
{ value: '', label: "全部" },
{ value: 0, label: "系统生成" },
{ value: 1, label: "手动录入" },
])
@@ -643,7 +647,7 @@ export default {
//修改讲师信息弹窗
const handleModify = (record) => {
state.teacherdialog = true;
state.teacherdialogtitle = '修改授课记录'
state.teacherdialogtitle = '编辑授课记录'
state.lookTeacherId = record.id
state.formParam.recordType = '1'
state.vf = false
@@ -662,7 +666,7 @@ export default {
}
//保存
const createTeacherDialog = async () => {
state.formParam.teachingDate = state.teachingDate ? dayjs(state.teachingDate).format("YYYY-MM-DD").toString() : ""
state.formParam.teachingDate = state.teachingDate ? dayjs(state.teachingDate).format("YYYY-MM-DD HH:mm").toString() : ""
console.log(state.formParam)
const formItemNames = Object.keys(rules);
for (let i = 0; i < formItemNames.length; i++) {
@@ -774,7 +778,7 @@ export default {
const TeacherSystem = () => {
getTeacherCourseList({ id: state.lookTeacherId }).then((res) => {
state.formParam = res.data.data
state.teachingDate = dayjs(res.data.data.teachingDate, 'YYYY-MM-DD'),
state.teachingDate = dayjs(res.data.data.teachingDate, 'YYYY-MM-DD HH:mm'),
state.formParam.name=state.formParam.teacherName
console.log(state.formParam);
})

View File

@@ -175,7 +175,7 @@
<a-col :span="24">
<!-- <div @click="handleformlevel"> -->
<a-form-item label="讲师级别" name="tlevelId">
<a-select class="draitem" v-model:value="formParam.tlevelId" placeholder="请选择讲师级别" allowClear
<a-select class="draitem" v-model:value="formParam.tlevelId" placeholder="请选择讲师级别" allowClear disableda
:options="tSystemNames.levelVoList" @change="handleformlevel">
</a-select>
</a-form-item>

View File

@@ -229,8 +229,10 @@
<a-row :gutter="16">
<a-col :span="12">
<a-form-item label="授课/课程日期 :" name="teachingDate">
<a-date-picker class="draitem" v-model:value="teachingDate" style="width:100%" format="YYYY-MM-DD"
<a-date-picker class="draitem" v-model:value="teachingDate" style="width:100%" format="YYYY-MM-DD HH:mm" :show-time="{ format: 'HH:mm' }"
type="datetime"
placeholder="请选择课程日期" />
<!-- <a-time-picker v-model:value="value" format="HH:mm" /> -->
<!-- @change="editTimeChange" -->
</a-form-item>
</a-col>
@@ -312,7 +314,7 @@
<a-descriptions-item label="讲师工号">{{ formParam.userNo }}</a-descriptions-item>
<a-descriptions-item label="讲师组织" :span="2">{{ formParam.orgName }}</a-descriptions-item>
<a-descriptions-item label="讲师体系">{{ formParam.tsystemName }}</a-descriptions-item>
<a-descriptions-item label="讲师级别">{{ formParam.tlevelName
<a-descriptions-item label="讲师级别">{{ formParam.levelName
}}</a-descriptions-item>
<a-descriptions-item label="录入方式">
{{ formParam.createFrom == 0 ? '系统生成' : formParam.createFrom == 1 ? '手动录入' : '' }}</a-descriptions-item>
@@ -325,7 +327,7 @@
<a-descriptions-item label="授课/课程日期 ">{{ formParam.teachingDate }}</a-descriptions-item>
<a-descriptions-item label="参训人数 ">{{ formParam.studys }}</a-descriptions-item>
<a-descriptions-item label="评分 ">{{ formParam.score }}</a-descriptions-item>
<a-descriptions-item label="内容分类 ">{{ formParam.courseTypeName }}</a-descriptions-item>
<a-descriptions-item label="内容分类">{{ formParam.courseTypeName }}</a-descriptions-item>
<a-descriptions-item label="备注 ">{{ formParam.remark }}</a-descriptions-item>
</a-descriptions>
<div style="margin-top:20px ;line-height: 24px;" >
@@ -870,7 +872,7 @@ export default {
//修改信息弹窗
const handleModify = (record) => {
state.teacherdialog = true;
state.teacherdialogtitle = '修改授课记录'
state.teacherdialogtitle = '编辑授课记录'
state.lookTeacherId = record.teacherId
state.vf = false
TeacherSystem1(record)
@@ -895,7 +897,8 @@ export default {
state.formParam.teacherName = state.formParam.name?.split('/')[0]
state.formParam.userNo =state.formParam.name?.split('/')[1]
state.formParam.tsystemName = state.tSystemNames.systemName
state.formParam.teachingDate=state.teachingDate ? dayjs(state.teachingDate).format("YYYY-MM-DD").toString() : " "
state.formParam.tsystemId = state.tSystemNames?.systemId
state.formParam.teachingDate=state.teachingDate ? dayjs(state.teachingDate).format("YYYY-MM-DD HH:mm").toString() : " "
const formItemNames = Object.keys(rules);
for(let i=0;i<formItemNames.length;i++){
const result = await validateField(formItemNames[i]);
@@ -1052,7 +1055,7 @@ export default {
state.formParam.tlevelId = res.data.data.tlevelId
state.formParam.name = res.data.data.teacherName+'/'+res.data.data.userNo
state.formParam.orgLists = res.data.data.expertiseNames?.split(',').map(item=>({ name: item }))
state.teachingDate=dayjs(res.data.data.teachingDate, 'YYYY-MM-DD'),
state.teachingDate=dayjs(res.data.data.teachingDate, 'YYYY-MM-DD HH:mm' ),
console.log( state.formParam);
})
.catch((err) => {