| | |
| | | <el-card class="exampaper-item-box" v-if="titleItem.questionItems.length!==0"> |
| | | <el-form-item :key="questionItem.itemOrder" class="exam-question-item" label-width="0%" |
| | | v-for="questionItem in titleItem.questionItems" :id="'question-'+ questionItem.itemOrder"> |
| | | <QuestionJobEdit @callNextSubject="callNext" :qType="questionItem.questionType" :question="questionItem" |
| | | <QuestionJobEdit @callSelected="callSelected" @callNextSubject="callNext" :qType="questionItem.questionType" :question="questionItem" |
| | | :answer="answer.answerItems[questionItem.itemOrder-1]" :isReadOnly="autoNext"/> |
| | | </el-form-item> |
| | | </el-card> |
| | | </el-row> |
| | | <el-row class="do-align-center" v-if="order < form.titleItems.length - 1"> |
| | | <el-button @click="preSubject" type="warning" v-if ="preDisable" round>{{$t('lastQuestion')}}</el-button> |
| | | <el-button @click="preSubject" type="warning" v-if ="preDisable" :disabled="preDisable2" round>{{$t('lastQuestion')}}</el-button> |
| | | <el-button @click="nextSubject" type="primary" v-if ="nextDisable" round>{{$t('nextQuestion')}}</el-button> |
| | | </el-row> |
| | | <el-row class="do-align-center" v-else> |
| | |
| | | titleItems: null, |
| | | answerItems: [], |
| | | verifyStatus: 2, |
| | | finish: 0, |
| | | questionOrder: [] |
| | | }, |
| | | timer: null, |
| | |
| | | submitDisable: false, |
| | | doTime: 0, |
| | | preDisable: false, |
| | | preDisable2: false, |
| | | nextDisable: false, |
| | | autoNext: true, |
| | | isCallTain: false, // 是否要调用泰国团队接口 |
| | | isLangKaiStyle: false, |
| | | totalTitleNum: 0 |
| | | totalTitleNum: 0, |
| | | selectedCount: 0 |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | this.answer.questionOrder = this.form.questionOrder |
| | | let titleItemArray = this.form.titleItems |
| | | this.answer.titleItems = this.form.titleItems |
| | | this.submitDisable = true |
| | | for (let tIndex in titleItemArray) { |
| | | let questionArray = titleItemArray[tIndex].questionItems |
| | | // titleItem 是一段一段的题目 |
| | |
| | | }, |
| | | nextSubject: function () { |
| | | let _this = this |
| | | _this.preDisable2 = false |
| | | // 设置上一题结束时间 |
| | | _this.form.titleItems[_this.order].endTime = _this.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss') |
| | | _this.isShowGuide(false) |
| | |
| | | } |
| | | }) |
| | | } |
| | | // JAQ报告最后大题完成 启用提交按钮 |
| | | let isCompleted1 = _this.answer.answerItems[_this.answer.answerItems.length - 2].completed; |
| | | let isCompleted2 = _this.answer.answerItems[_this.answer.answerItems.length - 1].completed; |
| | | if (isCompleted1 && isCompleted2) { |
| | | this.submitDisable = false |
| | | } |
| | | |
| | | if (jumpNextFlag) { |
| | | _this.nextSubject() |
| | | } |
| | | }, |
| | | // 触发选中选项 |
| | | callSelected () { |
| | | let _this = this |
| | | if (!_this.preDisable) { |
| | | return |
| | | } |
| | | _this.selectedCount += 1 |
| | | if (_this.selectedCount % 2 === 0) { |
| | | _this.preDisable2 = true |
| | | } |
| | | }, |
| | | submitForm () { |
| | |
| | | for (let i = 0; i < _this.answer.answerItems.length; i++) { |
| | | if (_this.answer.answerItems[i].content === null) { |
| | | unFinish = true |
| | | _this.answer.finish = 0 |
| | | // 有未完成的答题应该是 2答题中 |
| | | // 之前是0未处理 |
| | | _this.answer.finish = 2 |
| | | } |
| | | } |
| | | if (unFinish) { |
| | |
| | | let answerSubmit = _this.getSubmitAnswerValue() |
| | | examPaperAnswerApi.answerSubmit(answerSubmit, _this.memberToken).then(re => { |
| | | if (re.code === 1) { |
| | | _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess } }) |
| | | _this.$router.push({ path: '/exam/finish', query: { name: _this.form.name, content: mess, tokenId: _this.memberToken } }) |
| | | } else { |
| | | _this.$message.error(re.message + '/exam/finish') |
| | | } |