Commit 9c7f0684 authored by 刘怀志's avatar 刘怀志

岗位考核

parent 9893aef4
......@@ -128,6 +128,13 @@ export function queryBLessonByPagination(data) {
data
})
}
// 用户删除答题记录接口
export function removeLogical(id) {
return request({
url: '/post/user/blesson/removeLogical/' + id,
method: 'DELETE'
})
}
// 用户查询试卷
export function findByLessonIdExam(data) {
data = Qs.stringify(data)
......
......@@ -187,7 +187,8 @@ export default {
'score',
'isFalse',
'getscore',
'black'
'black',
'sbumitFinish'
],
data() {
return {
......@@ -229,6 +230,23 @@ export default {
if (val != '') {
this.$emit('selectedClick', val)
}
},
sbumitFinish(val, oldVal) {
console.log('KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK',this.exeUAnswer)
if (this.exeUAnswer && this.exeUAnswer != '') {
if (this.exeType == 'multipleSelect') {
this.msAnswer = this.exeUAnswer.split(',')
}
if (this.exeType == 'singleSelect') {
this.ssAnswer = this.exeUAnswer
}
if (this.exeType == 'judge') {
this.juAnswer = this.exeUAnswer
}
if (this.exeType == 'text') {
this.textAnswer = this.exeUAnswer
}
}
}
},
mounted() {
......
......@@ -67,7 +67,7 @@
/>
<div v-show="showExamBtns" class="exam-area">
<el-link type="primary" @click="showExamRecord">考核记录</el-link>
<el-button type="warning" plain @click="startExam">{{ this.examData.status === '1' ? '继续岗位考核' : (this.examData.status === '2' ? '重新岗位考核' : '开始岗位考核') }}</el-button>
<el-button type="warning" plain @click="startExam('todo')">{{ this.examData.status === '1' ? '继续岗位考核' : (this.examData.status === '2' ? '重新岗位考核' : '开始岗位考核') }}</el-button>
</div>
</div>
......@@ -182,7 +182,7 @@
width="180"
/>
<el-table-column
prop="submitTime"
prop="endTime"
label="提交时间"
width="180"
/>
......@@ -219,7 +219,7 @@ import NavList from '@/views/homePage/components/NavList/index'
import { queryBLessonsByPagination } from '@/api/bLesson/courseResources'
import { selectDictLabel } from '@/utils/common'
import dictCons from '@/utils/dictCons'
import { queryAllExamQuestionDto, queryBLessonByPagination } from '@/api/learnLession'
import { queryAllExamQuestionDto, queryBLessonByPagination, removeLogical } from '@/api/learnLession'
import { mapGetters } from 'vuex'
export default {
......@@ -353,15 +353,36 @@ export default {
}
},
methods: {
handleDelete(index, row) {
const id = row.businessId
this.$confirm('是否确认操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(function() {
return removeLogical(id)
}).then(() => {
this.getExamTableData()
this.$message({
message: '删除成功',
type: 'success'
})
}).catch(function() {
})
},
handleEdit(index, row) {
// 1 继续答题
// 2 重新答题
// 什么值都没有是开始答题
if (row.status == '1') {
this.startExam()
this.startExam('todo')
} else {
this.startExam('done')
}
},
startExam() {
startExam(type = 'todo') {
console.log('startExam', this.jobClassifyOptions, this.difficultyGradeOptions, this.queryParams)
let jobClassifyText = ''
let difficultyClassifyText = ''
......@@ -383,7 +404,7 @@ export default {
businessId: this.examData.businessId,
questionId: this.examData.questionId ? this.examData.questionId : '',
title: jobClassifyText + difficultyClassifyText + '考核',
type: 'todo'
type: type
}
})
},
......
......@@ -12,7 +12,7 @@
</div>
</div>
<div class="detail-header">
{{ qsList.length }}道题,总分值:{{ totalScore }}
{{ qsList.length }}道题,总分值:{{ totalScore }} | 及格分:{{ priceScore }}
</div>
<div v-show="type !== 'todo'" class="detail-header-total">
<span class="score-text">本次考核成绩:</span>
......@@ -22,6 +22,7 @@
<edu-exe
:id="'s' + index"
:is-finish="type !== 'todo'"
:sbumit-finish="sbumitFinsh"
:exe-index="index + 1"
:exe-subject="item.questionStem"
:exe-type="views[item.questionType - 1]"
......@@ -56,6 +57,7 @@ export default {
},
data() {
return {
sbumitFinsh: false,
getTotalScore: null, // 得分总分
title: this.$route.query.title,
lessonId: this.$route.query.lessonId,
......@@ -64,6 +66,7 @@ export default {
type: this.$route.query.type,
qsList: [],
totalScore: 0,
priceScore: 0,
questionsId: 0,
views: ['singleSelect', 'multipleSelect', 'judge', 'text']
}
......@@ -85,17 +88,33 @@ export default {
this.type = 'done'
this.qsList = res.data.qsList
this.getTotalScore = res.data.totalScore
this.$nextTick(() => {
this.sbumitFinsh = !this.sbumitFinsh
})
})
}
},
// 考试初始化
examInit() {
// 根据课程id查询试卷
console.log('this.businessId', this.businessId)
findByLessonIdExam({ userId: this.userId, lessonId: this.lessonId, businessId: this.businessId }).then(res => {
console.log('examFindByLessonId', res)
this.qsList = res.data.qsList
this.totalScore = res.data.totalScore
this.priceScore = res.data.priceScore
this.questionsId = res.data.questionsId
if (this.type === 'done') {
blessonSubmit(this.businessId).then(resSubmit => {
console.log('blessonSubmit', resSubmit)
this.type = 'done'
this.qsList = resSubmit.data.qsList
this.getTotalScore = resSubmit.data.totalScore
this.$nextTick(() => {
this.sbumitFinsh = !this.sbumitFinsh
})
})
}
})
},
// 单选题点击选项
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment