Files
learning-system-portal/src/views/lecturer/FinalSuccess.vue
2024-10-30 17:57:56 +08:00

407 lines
11 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script>
import lecturer, {
addTeacher,
getCertificationProcess,
getProgress,
getReviewResult,
getTeacherInfo, secondExamine
} from "@/api/modules/lecturer";
import processStatus from "@/components/processStatus.vue";
export default {
name: "FinalSuccess",
components: {processStatus},
data() {
return {
teacherId: '',
form: {
teacherName: '',
teacherNo: '',
orgName: ''
},
progressData: {},
fileBaseUrl: process.env.VUE_APP_BOE_MOBILE_URL,
uploadUrl:process.env.VUE_APP_FILE_BASE_URL,
disabled: false,
statusInfo: '',
result: '',
newTeacherId: '',
isFalse: true,
teacherInfo: ''
}
},
created() {
//读取路由参数
this.teacherId = this.$route.query.teacherId
//获取教师基本信息
this.baseInfo()
this.getStatus()
this.getReviewResult()
},
methods: {
//前往二次认证
getoFactor(second) {
secondExamine({teacherId: this.teacherId, second,}).then(res => {
this.newTeacherId = res.data.replace(/[^0-9]/ig, '')
if (res.code == 200) {
if (second == 1) {
this.$router.push({
path: '/need/twoathentication',
query: {teacherId: this.newTeacherId}
})
} else {
this.$router.push('/need/lecturer')
}
} else {
this.$message({
message: res.msg,
type: 'error'
});
}
})
},
//获取认证结果
getReviewResult() {
getReviewResult({teacherId: this.teacherId}).then(res => {
this.result = res.data
})
},
//获取教师认证状态
getStatus() {
getCertificationProcess({teacherId: this.teacherId}).then(res => {
this.statusInfo = res.data
})
},
baseInfo() {
getTeacherInfo({teacherId: this.teacherId}).then(res => {
this.teacherInfo = res.data[0]
var orgNameList=res.data[0].orgName.split('/')
if (orgNameList.length<=3){
this.form.orgName=res.data[0].orgName
}else {
this.form.orgName=orgNameList[orgNameList.length-3]+'/'+orgNameList[orgNameList.length-2]+'/'+orgNameList[orgNameList.length-1]
}
/*
* teacherName:教师姓名 teacherNo:教师工号 orgName:组织 positionName:岗位 bandCode:职级 courseName:认证课程名称 courseContent课程内容分类
* courseIntroduction:课程简介
* */
this.form.teacherName = res.data[0].teacherName
this.form.teacherNo = res.data[0].teacherNo
this.form.positionName = res.data[0].positionName
this.form.bandCode = res.data[0].bandCode
this.form.courseName = res.data[0].courseName
this.form.courseContent = res.data[0].courseContent
this.form.courseIntroduction = res.data[0].courseIntroduction
this.form.coursewareName = res.data[0].examineCourseware.coursewareName
this.form.tutor = res.data[0].tutor.split(',')
this.form.tutorTime = res.data[0].tutorTime
//获取学习进度
this.addTeacher()
})
},
addTeacher() {
addTeacher({pageNo: 1, pageSize: 10, userNo: this.form.teacherNo}).then(res => {
this.getProgress(res.data[0].id)
})
},
getProgress(id) {
getProgress({teacherId: id}).then(res => {
this.progressData = res.data
res.data.forEach((item, index) => {
if (item.progress != 100) {
this.disabled = true
return
}
})
})
},
getJump() {
this.$router.push({
path: '/need/final',
query: {teacherId: this.teacherId}
})
},
toCaseData(courseId) {
this.$router.push("/course/studyindex?id=" + courseId);
},
downloadFile() {
lecturer.exportPdf({coursewareId: this.teacherInfo.examineCourseware.id}).then(res => {
if (res.status) {
this.$message.error('导出失败');
} else {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([res], {type: 'application/vnd.;charset=UTF-8'}); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", this.teacherInfo.examineCourseware.coursewareName);
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
this.dialogVisible = false;
}
})
},
getJumplist() {
this.$router.push('/need/lecturer')
}
}
}
</script>
<template>
<div>
<process-status :teacherId="teacherId"></process-status>
<div class="title">基本信息</div>
<el-container>
<div class="form-table">
<el-form>
<div>
<el-col :span="11">
<el-form-item label="姓名:">
{{ form.teacherName }}
</el-form-item>
</el-col>
<el-col :span="11" :offset="2">
<el-form-item label="工号:">
{{ form.teacherNo }}
</el-form-item>
</el-col>
</div>
<div>
<el-col :span="11">
<el-form-item label="组织:">
{{ form.orgName }}
</el-form-item>
</el-col>
<el-col :span="11" :offset="2">
<el-form-item label="岗位:">
{{ form.positionName }}
</el-form-item>
</el-col>
</div>
<div>
<el-col :span="11">
<el-form-item label="认证课程名称:" prop="courseName">
<div style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;cursor: pointer;" :title="form.courseName">
{{ form.courseName }}
</div>
</el-form-item>
</el-col>
<el-col :span="11" :offset="2">
<el-form-item label="课程内容分类:" prop="courseContent">
{{ form.courseContent }}
</el-form-item>
</el-col>
</div>
<el-form-item label="课程简介:" prop="courseIntroduction">
{{ form.courseIntroduction }}
</el-form-item>
<el-form-item label="终稿课件:" prop="courseIntroduction">
{{ form.coursewareName }} <span
style="color: #1378f6;display: inline-block;margin-left: 16px;cursor: pointer;"
@click="downloadFile">查看</span>
</el-form-item>
</el-form>
</div>
</el-container>
<div class="title" style="margin-top: 20px">线上课程</div>
<div class="progress">
<div v-for="(item,index) in progressData" :key="index" @click="toCaseData(item.courseId)">
<div class="uc-course-img" style="width: 212px;height:119px">
<img style="width: 100%;" v-if="item.courseImage!=''&&item.courseImage.includes('https://')" :src="item.courseImage">
<img style="width: 100%;" v-else-if="item.courseImage!=''" :src="uploadUrl+item.courseImage">
<img style="width: 100%;" v-else :src="fileBaseUrl+'/pc/images/bgimg/course.png'">
</div>
<div class="courseName" :title="item.courseName">{{ item.courseName }}</div>
<div class="smallTitle">当前进度</div>
<el-progress :percentage="parseInt(item.progress)"
:color="parseInt(item.progress)=='100'?'#31AF0D':'#FFA050'"></el-progress>
</div>
</div>
<div>
<div class="title" style="margin-top: 20px">线下辅导</div>
<el-container>
<div class="form-table">
<el-form>
<el-form-item label="辅导老师:">
<span v-for="(item,index) in form.tutor" :key="item"
style="display: inline-block;margin-right: 20px">{{ item }}</span>
</el-form-item>
<el-form-item label="辅导时间:">
{{ form.tutorTime }}
</el-form-item>
</el-form>
</div>
</el-container>
</div>
<div>
<div class="title" style="margin-top: 20px">认证结果</div>
<div v-if="statusInfo.reviewResult==2" class="score">请您耐心等待线下认证安排</div>
<div v-if="statusInfo.reviewResult==0" class="score" style="color: #31AF0D;">
恭喜您您的认证分数为{{ result.avgScore }}已经通过认证
</div>
<div v-if="statusInfo.reviewResult==1" class="score" style="color: #ff0000">
很遗憾您的认证分数为{{ result.avgScore }}没有通过认证
</div>
</div>
<div class="twoFactorAuthentication" v-if="statusInfo.reviewResult==1&&statusInfo.second==0">
<img src="../../assets/images/rightImg.png" alt="">
<div class="titleAuthentication">是否进行二次认证</div>
<div class="yes" @click="getoFactor(1)"></div>
<div class="no" @click="getoFactor(2)"></div>
</div>
</div>
</template>
<style scoped lang="scss">
.title {
font-size: 16px;
font-weight: 800;
border-bottom: 1px solid rgba(153, 153, 153, 0.2);
padding: 2px 2px 20px 2px;
}
.form-table {
width: 100%;
margin-top: 20px;
}
.progress {
display: flex;
align-items: center;
margin-top: 20px;
flex-wrap: wrap;
}
.progress > div {
width: 300px;
margin-right: 30px;
margin-bottom: 12px;
}
.courseName {
font-weight: 650;
color: #333333;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
width: 100%;
}
.smallTitle {
color: #134054;
font-size: 12px;
margin-top: 7px;
}
::v-deep .el-form-item__content {
font-weight: 500;
}
::v-deep .el-form-item {
margin-bottom: 0px;
}
.tip {
color: #7d7c7c;
font-size: 14px;
margin-top: 20px;
}
.score {
margin-top: 28px;
font-size: 18px;
color: #333333;
font-weight: 400;
}
.twoFactorAuthentication {
width: 100%;
height: 56px;
background: #F0F6FC;
margin-top: 20px;
border-radius: 6px;
display: flex;
align-items: center;
img {
width: 20px;
height: 20px;
margin-left: 23px;
}
.titleAuthentication {
font-weight: 500;
font-size: 16px;
color: #333333;
margin-left: 16px;
}
.yes {
width: 64px;
height: 24px;
background: #409EFF;
border: 1px solid #409EFF;
font-weight: 400;
font-size: 14px;
color: #FFFFFF;
display: flex;
justify-content: center;
align-items: center;
border-radius: 3px;
margin-left: 20px;
cursor: pointer;
}
.no {
width: 64px;
height: 24px;
background: rgba(64, 158, 255, 0.1);
border: 1px solid #409EFF;
font-weight: 400;
font-size: 14px;
color: #409EFF;
display: flex;
justify-content: center;
align-items: center;
border-radius: 3px;
margin-left: 16px;
cursor: pointer;
}
}
.remind {
margin-bottom: 20px;
box-sizing: border-box;
color: #797979;
}
::v-deep .el-progress-bar__outer {
background-color: rgba(255, 160, 80, 0.2);
}
::v-deep .el-form-item__label {
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 40px;
}
::v-deep .el-form-item__content {
font-weight: 400;
font-size: 14px;
color: #333333;
line-height: 40px;
}
.over {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
width: 580px;
}
</style>