|
|
@@ -92,17 +92,38 @@
|
|
|
<!--<p>成绩无效</p>-->
|
|
|
<!--</div>-->
|
|
|
<p class="text-p">{{shadeData.type==1||shadeData.type==2?'本次考试成绩不及格!':(shadeData.type==3?'本次考试成绩突破历史最佳记录':(shadeData.type==4?'本次考试成绩未突破历史最佳记录,故作无效处理!':''))}}</p>
|
|
|
+ <p class="text-p" style="line-height:30px;" v-if="shadeData.type==5">成绩合格!</p>
|
|
|
+ <p class="text-p" style="line-height:30px;" v-if="shadeData.type==5">请仔细阅读并确认《实验室安全承诺书》,否则考试成绩无效。</p>
|
|
|
<div class="button-box">
|
|
|
<p class="null-p"></p>
|
|
|
<p class="button-p-1" v-if="shadeData.type==1||shadeData.type==2" @click="reviewMistakes()">查看错题</p>
|
|
|
<p class="button-p-2" v-if="(shadeData.type==1||shadeData.type==2)&&shadeData.canContinueExam == 1" @click="retakeExam()">重新考试</p>
|
|
|
<p class="button-p-2" v-if="shadeData.type==3||shadeData.type==4" @click="backPage()">确定</p>
|
|
|
+ <p class="button-p-3" v-if="shadeData.type==5" @click="safetyCommitmentLetterDialogButton(1)">确认安全承诺书</p>
|
|
|
<p class="null-p"></p>
|
|
|
</div>
|
|
|
<p class="out-button el-icon-close" @click="backPage()"></p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<historyOfIncorrectQuestions :historyOfIncorrectQuestionsPropsData="historyOfIncorrectQuestionsPropsData" v-if="pageType === 2"></historyOfIncorrectQuestions>
|
|
|
+ <el-dialog class="safetyCommitmentLetter-dialog"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ :close-on-click-modal="false" :close-on-press-escape="false"
|
|
|
+ title="安全承诺书"
|
|
|
+ :visible.sync="safetyCommitmentLetterDialogType"
|
|
|
+ v-if="safetyCommitmentLetterDialogType"
|
|
|
+ width="908px"
|
|
|
+ append-to-body>
|
|
|
+ <div style="height:600px;display: flex;flex-direction: column;overflow: hidden">
|
|
|
+ <safetyCommitmentLetter ref="dataStatisticsReport" :safetyCommitmentLetterPropsData="safetyCommitmentLetterPropsData"></safetyCommitmentLetter>
|
|
|
+ </div>
|
|
|
+ <div slot="footer" class="dialog-footer dialog-footer-box" v-if="safetyCommitmentLetterPropsData.securityCommitmentPrintEnabled == 1 && safetyCommitmentLetterPropsData.securityCommitmentStatus != 1">
|
|
|
+ <p class="dialog-footer-button-null"></p>
|
|
|
+ <p class="dialog-footer-button-border" v-if="safetyCommitmentLetterPropsData.securityCommitmentPrintEnabled == 1" @click="safetyCommitmentLetterDialogButton(2)">下载</p>
|
|
|
+ <p class="dialog-footer-button-primary" v-if="safetyCommitmentLetterPropsData.securityCommitmentStatus != 1" @click="safetyCommitmentLetterDialogButton(3)">确认</p>
|
|
|
+ <p class="dialog-footer-button-null"></p>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -110,14 +131,16 @@
|
|
|
import {
|
|
|
examElExamAttemptReviewSidebar, examElExamAttemptReviewQuestion,
|
|
|
examUserExamGetExamSurplusTime,examUserExamAnswerSave,
|
|
|
- examUserExamSubmit,examUserExamStart,
|
|
|
+ examUserExamSubmit,examUserExamStart,examUserExamSecurityCommitmentExamConfirm,
|
|
|
} from '@/api/safetyEducationExaminationNew/index'
|
|
|
import historyOfIncorrectQuestions from "@/views/safetyEducationExaminationNew/components/historyOfIncorrectQuestions.vue";
|
|
|
+ import safetyCommitmentLetter from "@/views/safetyEducationExaminationNew/components/safetyCommitmentLetter.vue";
|
|
|
|
|
|
export default {
|
|
|
name: 'index',
|
|
|
components: {
|
|
|
historyOfIncorrectQuestions,
|
|
|
+ safetyCommitmentLetter
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -153,6 +176,13 @@
|
|
|
},
|
|
|
historyOfIncorrectQuestionsPropsData:{},
|
|
|
submitType:false,
|
|
|
+ //安全承诺书
|
|
|
+ safetyCommitmentLetterDialogType:false,
|
|
|
+ safetyCommitmentLetterPropsData:{
|
|
|
+ securityCommitmentPath:'',
|
|
|
+ securityCommitmentPrintEnabled:0,
|
|
|
+ securityCommitmentStatus:0,
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -373,22 +403,39 @@
|
|
|
this.warningTimer = null; // 建议同时将实例置为 null
|
|
|
}
|
|
|
if(response.data.totalScore >= this.examInfo.passScore){
|
|
|
- if(response.data.needPrompt == 1){
|
|
|
+ //考试通过-判定通知书相关
|
|
|
+ if(response.data.securityCommitmentEnabled == 1 && response.data.securityCommitmentStatus != 1){
|
|
|
//最佳记录
|
|
|
- this.$set(this,'shadeData',{
|
|
|
- type:3,
|
|
|
- totalScore:response.data.totalScore,
|
|
|
- canContinueExam:0,
|
|
|
+ this.$set(this,'safetyCommitmentLetterPropsData',{
|
|
|
+ examId:this.newData.examId,
|
|
|
+ securityCommitmentPath:response.data.securityCommitmentPath,
|
|
|
+ securityCommitmentPrintEnabled:response.data.securityCommitmentPrintEnabled,
|
|
|
+ securityCommitmentStatus:response.data.securityCommitmentStatus,
|
|
|
});
|
|
|
- this.$set(this,'shadeType',true);
|
|
|
- }else{
|
|
|
- //非最佳记录
|
|
|
this.$set(this,'shadeData',{
|
|
|
- type:4,
|
|
|
+ type:5,
|
|
|
totalScore:response.data.totalScore,
|
|
|
canContinueExam:0,
|
|
|
});
|
|
|
this.$set(this,'shadeType',true);
|
|
|
+ }else{
|
|
|
+ if(response.data.needPrompt == 1){
|
|
|
+ //最佳记录
|
|
|
+ this.$set(this,'shadeData',{
|
|
|
+ type:3,
|
|
|
+ totalScore:response.data.totalScore,
|
|
|
+ canContinueExam:0,
|
|
|
+ });
|
|
|
+ this.$set(this,'shadeType',true);
|
|
|
+ }else{
|
|
|
+ //非最佳记录
|
|
|
+ this.$set(this,'shadeData',{
|
|
|
+ type:4,
|
|
|
+ totalScore:response.data.totalScore,
|
|
|
+ canContinueExam:0,
|
|
|
+ });
|
|
|
+ this.$set(this,'shadeType',true);
|
|
|
+ }
|
|
|
}
|
|
|
}else{
|
|
|
if(response.data.canContinueExam == 1){
|
|
|
@@ -532,7 +579,42 @@
|
|
|
} else {
|
|
|
return `${seconds}秒`
|
|
|
}
|
|
|
- }
|
|
|
+ },
|
|
|
+
|
|
|
+ //安全承诺书
|
|
|
+ safetyCommitmentLetterDialogButton(type,item){
|
|
|
+ if(type == 1){
|
|
|
+ this.$set(this,'safetyCommitmentLetterDialogType',true);
|
|
|
+ }else if(type == 2){
|
|
|
+ this.downloadOffice();
|
|
|
+ }else if(type == 3){
|
|
|
+ this.examUserExamSecurityCommitmentExamConfirm();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //下载
|
|
|
+ async downloadOffice() {
|
|
|
+ // 获取图片对象和画布对象
|
|
|
+ const imgUrl = this.safetyCommitmentLetterPropsData.securityCommitmentPath;
|
|
|
+ const response = await fetch(imgUrl)
|
|
|
+ const blob = await response.blob()
|
|
|
+ // 创建下载链接
|
|
|
+ const url = window.URL.createObjectURL(blob)
|
|
|
+ const link = document.createElement('a')
|
|
|
+ link.href = url
|
|
|
+ link.download = '安全承诺书'
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ document.body.removeChild(link)
|
|
|
+ // 释放 Blob URL
|
|
|
+ window.URL.revokeObjectURL(url)
|
|
|
+ },
|
|
|
+ //确认安全承诺书
|
|
|
+ examUserExamSecurityCommitmentExamConfirm(){
|
|
|
+ examUserExamSecurityCommitmentExamConfirm({examId:this.safetyCommitmentLetterPropsData.examId}).then(response => {
|
|
|
+ this.msgSuccess(response.message);
|
|
|
+ this.$router.back();
|
|
|
+ })
|
|
|
+ },
|
|
|
},
|
|
|
beforeDestroy() {
|
|
|
//离开提交
|
|
|
@@ -1095,6 +1177,15 @@
|
|
|
color:#fff;
|
|
|
background-color: #0183fa;
|
|
|
}
|
|
|
+ .button-p-3{
|
|
|
+ cursor: pointer;
|
|
|
+ width:150px;
|
|
|
+ border:1px solid #0183fa;
|
|
|
+ color:#fff;
|
|
|
+ background-color: #0183fa;
|
|
|
+ margin-left:0;
|
|
|
+ margin-top:0;
|
|
|
+ }
|
|
|
}
|
|
|
.out-button{
|
|
|
position: absolute;
|