<template>
|
<div class="notice">
|
<el-dialog
|
v-model="dialogVisible"
|
title="培训考试记录"
|
width="50%"
|
:before-close="handleClose"
|
:close-on-press-escape="false"
|
:close-on-click-modal="false"
|
>
|
<el-table v-loading="state.loading" :data="state.dataList" :border="true">
|
<el-table-column label="序号" type="index" align="center" width="80" />
|
<!-- <el-table-column label="学生姓名" prop="stuName" align="center" />-->
|
<el-table-column label="培训名称" prop="name" align="center" >
|
<template #default="scope">
|
{{scope.row.trainType == 1 ? scope.row.name : ''}}
|
</template>
|
</el-table-column>
|
<el-table-column label="考试名称" prop="name" align="center" >
|
<template #default="scope">
|
{{scope.row.trainType == 2 ? scope.row.name : ''}}
|
</template>
|
</el-table-column>
|
<el-table-column label="所在公司" prop="companyName" align="center"/>
|
</el-table>
|
</el-dialog>
|
</div>
|
</template>
|
<script setup>
|
import {reactive, ref, toRefs} from 'vue'
|
import {ElMessage} from "element-plus";
|
|
import {
|
getClassification
|
} from "@/api/onlineEducation/courseClass";
|
import {addCourse, checkCourseName, editCourse, getCourseById} from "@/api/onlineEducation/courseManage";
|
import {getToken} from "@/utils/auth";
|
import {delPic, getBannerById} from "@/api/onlineEducation/banner";
|
import Cookies from "js-cookie";
|
import {addQuestionBank, checkQuestionBankName, editQuestionBank} from "@/api/onlineEducation/questionBank";
|
import {getStudent, getStuTrainRecord} from "@/api/onlineEducation/student";
|
|
const dialogVisible = ref(false);
|
const title = ref("");
|
const busRef = ref();
|
const length = ref()
|
const emit = defineEmits(["getList"]);
|
const state = reactive({
|
loading: false,
|
dataList: []
|
})
|
|
const openDialog = async (value) => {
|
state.loading = true
|
const param = {
|
studentId: value.id
|
}
|
const res = await getStuTrainRecord(param)
|
if(res.code == 200){
|
state.dataList = res.data.map(item => {
|
return{
|
...item,
|
stuName: value.name
|
}
|
})
|
state.loading = false
|
console.log(state.dataList,'state.dataList')
|
}else{
|
ElMessage.warning(res.message)
|
}
|
|
dialogVisible.value = true;
|
}
|
|
const handleClose = () => {
|
dialogVisible.value = false;
|
emit("getList")
|
|
}
|
|
defineExpose({
|
openDialog
|
});
|
|
</script>
|
|
<style scoped lang="scss">
|
.notice{
|
:deep(.el-form .el-form-item__label) {
|
font-size: 15px;
|
}
|
.file {
|
display: flex;
|
flex-direction: column;
|
align-items: flex-start;
|
}
|
}
|
</style>
|