|
@@ -57,6 +57,15 @@
|
|
|
<van-col span="12">考试题库</van-col>
|
|
<van-col span="12">考试题库</van-col>
|
|
|
<van-col span="12">{{ item.bankName===''?'/':item.bankName===null?'/':item.bankName===undefined?'/':item.bankName }}</van-col>
|
|
<van-col span="12">{{ item.bankName===''?'/':item.bankName===null?'/':item.bankName===undefined?'/':item.bankName }}</van-col>
|
|
|
</van-row>
|
|
</van-row>
|
|
|
|
|
+ <!-- 增加考试状态 -->
|
|
|
|
|
+ <van-row v-if="tabActive==1">
|
|
|
|
|
+ <van-col span="12">考试达标状态</van-col>
|
|
|
|
|
+ <van-col span="12"> <span :class="examAttainment(item)">{{ examAttainmentText(item) }}</span></van-col>
|
|
|
|
|
+ </van-row>
|
|
|
|
|
+ <van-row v-if="tabActive==1&&item.recentScore">
|
|
|
|
|
+ <van-col span="12">最近得分</van-col>
|
|
|
|
|
+ <van-col span="12"> <span>{{ item.recentScore }}</span></van-col>
|
|
|
|
|
+ </van-row>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 插入内容 -->
|
|
<!-- 插入内容 -->
|
|
@@ -352,21 +361,6 @@ export default {
|
|
|
next()
|
|
next()
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // watch: {
|
|
|
|
|
- // moreParams: {
|
|
|
|
|
- // handler(val) {
|
|
|
|
|
- // console.log('val', val.length)
|
|
|
|
|
- // if (val) {
|
|
|
|
|
- // console.log('1111')
|
|
|
|
|
- // } else {
|
|
|
|
|
- // console.log('222')
|
|
|
|
|
- // }
|
|
|
|
|
- // // this.moreParams = val
|
|
|
|
|
- // }
|
|
|
|
|
- // // deep: true
|
|
|
|
|
- // }
|
|
|
|
|
- // },
|
|
|
|
|
-
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
onClickTab(index) {
|
|
onClickTab(index) {
|
|
|
// this.loadData()
|
|
// this.loadData()
|
|
@@ -384,7 +378,7 @@ export default {
|
|
|
const examineeId = item.examinee
|
|
const examineeId = item.examinee
|
|
|
const bankId = item.bankId
|
|
const bankId = item.bankId
|
|
|
const param = examId ? `and e.exam_id_ = '${examId}'` : 'and e.exam_id_ is null'
|
|
const param = examId ? `and e.exam_id_ = '${examId}'` : 'and e.exam_id_ is null'
|
|
|
- const sql = `select e.id_ as dataId, e.exam_id_ as examId, e.kao_shi_ren_ as examinee, e.bu_men_ as dept, e.zhuang_tai_ as status, e.bao_ming_shi_jian as applyTime, e.kai_shi_shi_jian_ as startTime, e.jie_shu_shi_jian_ as endTime, e.ti_ku_zong_fen_ as totalScore, e.de_fen_ as resultScore, ed.ti_mu_id_ as questionId, ed.ti_gan_ as stem, ed.ti_xing_ as questionType, ed.fen_zhi_ as questionScore, ed.fu_tu_ as img, ed.xuan_xiang_lei_xi as optionsType, ed.xuan_xiang_ as options, ed.can_kao_da_an_ as rightKey, ed.ping_fen_fang_shi as rateType, ed.ping_fen_ren_ as rater, ed.hui_da_ as answer, ed.ping_yue_shi_jian as rateTime, ed.de_fen_ as score, ed.jie_xi_ as analysis, q.ti_ku_ming_cheng_ as paperName, case when e.exam_id_ is not null then ex.da_biao_zhan_bi_ else q.da_biao_zhan_bi_ end as qualifiedRadio, case when e.exam_id_ is not null then ex.ji_fen_fang_shi_ else q.ji_fen_fang_shi_ end as scoringType, case when e.exam_id_ is not null then ex.kao_shi_ming_chen else '自主考核' end as examName, case when e.exam_id_ is not null then ex.xian_kao_shi_jian else '不限' end as limitDate from t_examination e left join t_examination_detail ed on e.id_ = ed.parent_id_ left join t_question_bank q on e.ti_ku_id_ = q.id_ left join t_exams ex on e.exam_id_ = ex.id_ where e.ti_ku_id_ = '${bankId}' ${param} and e.kao_shi_ren_ = '${examineeId}' and (e.zhuang_tai_ = '已完成' or e.zhuang_tai_ = '已交卷') order by field(ed.ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
|
|
|
|
|
|
|
+ const sql = `select e.id_ as dataId, e.exam_id_ as examId, e.kao_shi_ren_ as examinee, e.bu_men_ as dept, e.zhuang_tai_ as status, e.bao_ming_shi_jian as applyTime, e.kai_shi_shi_jian_ as startTime, e.jie_shu_shi_jian_ as endTime, e.ti_ku_zong_fen_ as totalScore, e.de_fen_ as resultScore, ed.ti_mu_id_ as questionId, ed.ti_gan_ as stem, ed.ti_xing_ as questionType, ed.fen_zhi_ as questionScore, ed.fu_tu_ as img, ed.xuan_xiang_lei_xi as optionsType, ed.xuan_xiang_ as options, ed.can_kao_da_an_ as rightKey, ed.ping_fen_fang_shi as rateType, ed.ping_fen_ren_ as rater, ed.hui_da_ as answer, ed.ping_yue_shi_jian as rateTime, ed.de_fen_ as score, ed.jie_xi_ as analysis, q.ti_ku_ming_cheng_ as paperName, case when e.exam_id_ is not null then ex.da_biao_zhan_bi_ else q.da_biao_zhan_bi_ end as qualifiedRadio, case when e.exam_id_ is not null then ex.ji_fen_fang_shi_ else q.ji_fen_fang_shi_ end as scoringType, case when e.exam_id_ is not null then ex.kao_shi_ming_chen else '自主考核' end as examName, case when e.exam_id_ is not null then ex.xian_kao_shi_jian else '不限' end as limitDate from t_examination e left join t_examination_detail ed on e.id_ = ed.parent_id_ left join t_question_bank q on e.ti_ku_id_ = q.id_ left join t_exams ex on e.exam_id_ = ex.id_ where e.ti_ku_id_ = '${bankId}' ${param} and e.kao_shi_ren_ = '${examineeId}' and (e.zhuang_tai_ = '已完成' or e.zhuang_tai_ = '已交卷') order by field(ed.ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题'),applyTime DESC`
|
|
|
// return new Promise((resolve, reject) => {
|
|
// return new Promise((resolve, reject) => {
|
|
|
this.$common.request('sql', sql).then(res => {
|
|
this.$common.request('sql', sql).then(res => {
|
|
|
const { data = [] } = res.variables || {}
|
|
const { data = [] } = res.variables || {}
|
|
@@ -454,6 +448,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
item.totalCount = count
|
|
item.totalCount = count
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
// 获取最高分最低分
|
|
// 获取最高分最低分
|
|
|
const { maxScore, minScore } = result.filter(i => i.status === '已完成').reduce((acc, curr) => {
|
|
const { maxScore, minScore } = result.filter(i => i.status === '已完成').reduce((acc, curr) => {
|
|
|
if (curr.resultScore > acc.maxScore) {
|
|
if (curr.resultScore > acc.maxScore) {
|
|
@@ -482,6 +477,7 @@ export default {
|
|
|
this.closeDetail(false)
|
|
this.closeDetail(false)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
+ // this.detailData = result.find(item => item.status === '已完成')
|
|
|
this.examDetail = true
|
|
this.examDetail = true
|
|
|
// resolve(result)
|
|
// resolve(result)
|
|
|
// }).catch(error => {
|
|
// }).catch(error => {
|
|
@@ -506,6 +502,65 @@ export default {
|
|
|
}
|
|
}
|
|
|
this.ReachBottomShow = true
|
|
this.ReachBottomShow = true
|
|
|
},
|
|
},
|
|
|
|
|
+ // 考试达标状态
|
|
|
|
|
+ examAttainment(data) {
|
|
|
|
|
+ const { paperState, submittedCount, totalScore, qualifiedRadio, averageScore, maxScore, recentScore, scoringType } = data
|
|
|
|
|
+ // 只要有一次已完成,就是完成
|
|
|
|
|
+ if (paperState === '已完成') {
|
|
|
|
|
+ // 计算是否达标
|
|
|
|
|
+ const passScore = +totalScore * +qualifiedRadio / 100
|
|
|
|
|
+ let curScore = null
|
|
|
|
|
+ if (scoringType === '平均分') {
|
|
|
|
|
+ curScore = +averageScore
|
|
|
|
|
+ }
|
|
|
|
|
+ if (scoringType === '最高分') {
|
|
|
|
|
+ curScore = +maxScore
|
|
|
|
|
+ }
|
|
|
|
|
+ if (scoringType === '最近得分') {
|
|
|
|
|
+ curScore = +recentScore
|
|
|
|
|
+ }
|
|
|
|
|
+ return curScore >= passScore ? 'passed' : 'failed'
|
|
|
|
|
+ // if (curScore >= passScore) {
|
|
|
|
|
+ // return `已达标`
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return `未达标`
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 未完成分两种:未开始和待批阅
|
|
|
|
|
+ return submittedCount > 0 ? 'pending-review' : ''
|
|
|
|
|
+ // if (submittedCount > 0) {
|
|
|
|
|
+ // return `待批阅`
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return '/'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ examAttainmentText(data) {
|
|
|
|
|
+ const { paperState, submittedCount, totalScore, qualifiedRadio, averageScore, maxScore, recentScore, scoringType } = data
|
|
|
|
|
+ // 只要有一次已完成,就是完成
|
|
|
|
|
+ if (paperState === '已完成') {
|
|
|
|
|
+ // 计算是否达标
|
|
|
|
|
+ const passScore = +totalScore * +qualifiedRadio / 100
|
|
|
|
|
+ let curScore = null
|
|
|
|
|
+ if (scoringType === '平均分') {
|
|
|
|
|
+ curScore = +averageScore
|
|
|
|
|
+ }
|
|
|
|
|
+ if (scoringType === '最高分') {
|
|
|
|
|
+ curScore = +maxScore
|
|
|
|
|
+ }
|
|
|
|
|
+ if (scoringType === '最近得分') {
|
|
|
|
|
+ curScore = +recentScore
|
|
|
|
|
+ }
|
|
|
|
|
+ if (curScore >= passScore) {
|
|
|
|
|
+ return `已达标`
|
|
|
|
|
+ }
|
|
|
|
|
+ return `未达标`
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 未完成分两种:未开始和待批阅
|
|
|
|
|
+ if (submittedCount > 0) {
|
|
|
|
|
+ return `待批阅`
|
|
|
|
|
+ }
|
|
|
|
|
+ return '/'
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
|
|
|
showPopup() {
|
|
showPopup() {
|
|
|
this.ReachBottomShow = true
|
|
this.ReachBottomShow = true
|
|
@@ -726,9 +781,6 @@ export default {
|
|
|
const canshu = (key1 !== '' || key2 !== '') ? `${canshu1} ${canshu2}`.trim() : key !== '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
|
|
const canshu = (key1 !== '' || key2 !== '') ? `${canshu1} ${canshu2}`.trim() : key !== '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
|
|
|
// let canshu = key != '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
|
|
// let canshu = key != '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
|
|
|
// const sql = `select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu} ORDER BY startDate DESC LIMIT ${page},10`
|
|
// const sql = `select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu} ORDER BY startDate DESC LIMIT ${page},10`
|
|
|
- // 已考待考(以考试次数是否使用完为区分点)
|
|
|
|
|
- // const sql1 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} ORDER BY startDate DESC LIMIT ${page},10) a LEFT JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and zhuang_tai_ != '已取消' GROUP BY exam_id_) b on a.examId = b.exam_id_`
|
|
|
|
|
- // const sql2 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} ) a INNER JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and (zhuang_tai_ ='已完成' OR zhuang_tai_ ='已交卷' ) GROUP BY exam_id_) b on a.examId = b.exam_id_ ORDER BY startDate DESC LIMIT ${page},10`
|
|
|
|
|
// 已考待考(已0为区分点)
|
|
// 已考待考(已0为区分点)
|
|
|
// const sql1 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} ORDER BY startDate DESC LIMIT ${page},10) a LEFT JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and zhuang_tai_ != '已取消' GROUP BY exam_id_) b on a.examId = b.exam_id_ where num = 1 AND paperState='未开始' AND examState='已发布' `
|
|
// const sql1 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} ORDER BY startDate DESC LIMIT ${page},10) a LEFT JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and zhuang_tai_ != '已取消' GROUP BY exam_id_) b on a.examId = b.exam_id_ where num = 1 AND paperState='未开始' AND examState='已发布' `
|
|
|
// const sql2 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} ) a INNER JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and (zhuang_tai_ ='已完成' OR zhuang_tai_ ='已交卷' ) GROUP BY exam_id_) b on a.examId = b.exam_id_ where num>=1 AND paperState='已完成' ORDER BY startDate DESC LIMIT ${page},10`
|
|
// const sql2 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name === '全部' ? '' : this.name}%' ${canshu}${canshu3}${canshu4} ) a INNER JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and (zhuang_tai_ ='已完成' OR zhuang_tai_ ='已交卷' ) GROUP BY exam_id_) b on a.examId = b.exam_id_ where num>=1 AND paperState='已完成' ORDER BY startDate DESC LIMIT ${page},10`
|
|
@@ -829,4 +881,15 @@ export default {
|
|
|
overflow: auto; /* 当内容超出容器时显示滚动条 */
|
|
overflow: auto; /* 当内容超出容器时显示滚动条 */
|
|
|
// padding: 10px; /* 可选:内边距 */
|
|
// padding: 10px; /* 可选:内边距 */
|
|
|
}
|
|
}
|
|
|
|
|
+ .passed {
|
|
|
|
|
+ color: #67c23a; /* 已达标 */
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.failed {
|
|
|
|
|
+ color: #f43636; /* 未达标 */
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.pending-review {
|
|
|
|
|
+ color: #ffa500; /* 待批阅 */
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|