考试申请审核通过限制培训学校修改考试时间,考试截止时间超过24小时则不能申请修改成绩
3 files modified
45 ■■■■■ changed files
src/api/examapi/performance.js 8 ●●●●● patch | view | raw | blame | history
src/views/trainExam/index.vue 15 ●●●●● patch | view | raw | blame | history
src/views/trainExam/performance.vue 22 ●●●●● patch | view | raw | blame | history
src/api/examapi/performance.js
@@ -35,3 +35,11 @@
    data: row
  })
}
export const getNowDate = () => {
    return request({
        url: '/api/examScore/getNowDate',
        method: 'get',
        params: {}
    })
}
src/views/trainExam/index.vue
@@ -25,6 +25,7 @@
            ref="questionBankCrud"
            :page.sync="questionBankPage"
            @on-load="questionBankOnLoad"
            :before-open="beforeOpen"
            @selection-change="questionBankSelectionChange"
            @search-change="questionBankSearchChange"
            @search-reset="questionBankSearchReset"
@@ -709,6 +710,20 @@
        }
      );
    },
     beforeOpen(done, type) {
      if(this.userInfo.role_name=="培训公司管理员"){
         if (["edit"].includes(type)) {
            if(this.form.auditStatus==1){
              this.$message({
                type: "warning",
                message: "当前考试申请已审核通过,无法再修改考试申请信息!",
              });
              return;
            }
          }
      }
      done();
    },
    startExam(row) {
      //正式考试
      if (row.examType == 1) {
src/views/trainExam/performance.vue
@@ -338,6 +338,7 @@
  update,
  updateAbsent,
  updateGrade,
  getNowDate
} from "@/api/examapi/performance";
import { mapGetters } from "vuex";
import { getRoleDetail } from "@/api/system/role";
@@ -1419,7 +1420,17 @@
    // 修改考试成绩
    modifiedGrades(row) {
      console.log(row,97998);
      var that = this;
      //判断时间,获取系统时间,减去考试结束时间,小于24小时则可以申请,超过则提示无法申请
      var endTime = row.endTime;
      //必须把日期'-'转为'/'
      endTime = endTime.replace(/-/g,'/');
      //得到时间戳
      var longtime = new Date(endTime).getTime();
      console.log(longtime,123466);
      getNowDate().then((res)=>{
        var num = 24*3600*1000;
        if(res.data.data-longtime<=num){
      this.form = {
        id:null,
        examScoreId:row.id,
@@ -1432,6 +1443,15 @@
        allGrade:row.allGrade,
      }
      this.gradeBoxVisible = true;
        }else{
          //提示
          that.$message({
            type: "warning",
            message: "成绩修改申请只能在考试截止时间后的24小内提交!",
          });
        }
      })
    },
    uploadGrade(formName) {