Administrator
2021-08-28 e4100ecc3a88273dcdbc2c1452d4e9f00736f3db
src/views/trainingRegistration/index.vue
@@ -37,7 +37,7 @@
          plain
          icon="el-icon-folder-checked"
          @click="handleBatchExam"
          v-if="permission.trainingRegistration_exam"
          >考试申请
        </el-button>
        <el-button
@@ -45,6 +45,7 @@
          size="small"
          plain
          icon="el-icon-folder-checked"
          v-if="permission.trainingRegistration_import"
          @click="handleImport"
          >清册导入
        </el-button>
@@ -55,13 +56,15 @@
          @click="revoke(row)"
          :size="size"
          :type="type"
          v-if="permission.trainingRegistration_cancel"
          >取消报名</el-button
        >
        <el-button
          :type="type"
          size="small"
          icon="el-icon-receiving"
          :disabled="row.candidateNo==''"
          v-if="permission.trainingRegistration_print"
          :disabled="row.candidateNo == ''"
          @click="handlePrint(row)"
          >准考证打印
        </el-button>
@@ -77,31 +80,30 @@
    </avue-crud>
    <el-dialog
        title="清册数据导入"
        append-to-body
        :visible.sync="excelBox"
        width="555px"
        >
        <avue-form
            :option="excelOption"
            v-model="excelForm"
            :upload-after="uploadAfter"
        >
            <template slot="excelTemplate">
            <el-button type="primary" @click="handleTemplate">
                点击下载<i class="el-icon-download el-icon--right"></i>
            </el-button>
            </template>
        </avue-form>
      title="清册数据导入"
      append-to-body
      :visible.sync="excelBox"
      width="555px"
    >
      <avue-form
        :option="excelOption"
        v-model="excelForm"
        :upload-after="uploadAfter"
      >
        <template slot="excelTemplate">
          <el-button type="primary" @click="handleTemplate">
            点击下载<i class="el-icon-download el-icon--right"></i>
          </el-button>
        </template>
      </avue-form>
    </el-dialog>
    <el-dialog
      title="考试申请"
      append-to-body
      :visible.sync="dialogExamFormVisible"
      width="1000px"
      @close='closeDialog'
      @close="closeDialog"
    >
      <avue-form
        ref="formExamApply"
@@ -122,15 +124,15 @@
  update,
  remove,
  cancelTrain,
  addExam
  addExam,
} from "@/api/trainingRegistration/trainingRegistration";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      loading: true,
      excelBox:false,
      dialogExamFormVisible:false,
      excelBox: false,
      dialogExamFormVisible: false,
      optionExamApply: {
        height: "auto",
        filterBtn: true,
@@ -139,7 +141,7 @@
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: false,
        border: true, //liu
        index: true,
        stripe: true,
        viewBtn: true,
@@ -150,12 +152,10 @@
        column: [
          {
            label: "考试时间",
            prop: "examTime",
            type: "daterange",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd HH:mm:ss",
            startPlaceholder: "考试开始时间",
            endPlaceholder: "考试结束时间",
            prop: "startTime",
            type: "datetime",
            format: "yyyy-MM-dd HH:mm",
            valueFormat: "yyyy-MM-dd HH:mm",
            // 表单新增时是否禁止
            addDisabled: false,
            // 表单新增时是否可见
@@ -181,29 +181,29 @@
      },
      excelForm: {},
      excelOption: {
          submitBtn: false,
          emptyBtn: false,
          column: [
        submitBtn: false,
        emptyBtn: false,
        column: [
          {
              label: "模板上传",
              prop: "excelFile",
              type: "upload",
              drag: true,
              loadText: "模板上传中,请稍等",
              span: 24,
              propsHttp: {
            label: "模板上传",
            prop: "excelFile",
            type: "upload",
            drag: true,
            loadText: "模板上传中,请稍等",
            span: 24,
            propsHttp: {
              res: "data",
              },
              tip: "请上传 .xls,.xlsx 标准格式文件",
              action: "/api/trainingRegistration/import-trainingRegistration",
            },
            tip: "请上传 .xls,.xlsx 标准格式文件",
            action: "/api/trainingRegistration/import-trainingRegistration",
          },
          {
              label: "模板下载",
              prop: "excelTemplate",
              formslot: true,
              span: 24,
            label: "模板下载",
            prop: "excelTemplate",
            formslot: true,
            span: 24,
          },
          ],
        ],
      },
      selectionList: [],
      page: {
@@ -239,16 +239,25 @@
      });
      return ids.join(",");
    },
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.notice_add, false),
        viewBtn: this.vaildData(this.permission.notice_view, false),
        delBtn: this.vaildData(this.permission.notice_delete, false),
        editBtn: this.vaildData(this.permission.notice_edit, false),
      };
    },
  },
  methods: {
    //准考证查看
    handlePrint(row) {
        var obj = row;
        obj["name"] = "准考证信息";
        this.$router.push({
            path: `/applyexam/papers`,
            query: obj,
        });
      var obj = row;
      obj["name"] = "准考证信息";
      this.$router.push({
        path: `/applyexam/papers`,
        query: obj,
      });
    },
    sizeChange(val) {
      this.page1.currentPage = 1;
@@ -430,32 +439,30 @@
    },
    handleTemplate() {
        window.open(
            `/api/trainingRegistration/export-template`
        );
      window.open(`/api/trainingRegistration/export-template`);
    },
    uploadAfter(res, done, loading, column) {
        window.console.log(column);
        this.excelBox = false;
        this.refreshChange();
        done();
      window.console.log(column);
      this.excelBox = false;
      this.refreshChange();
      done();
    },
    //生成考试弹窗
    handleBatchExam(){
    handleBatchExam() {
      this.dialogExamFormVisible = true;
      if (this.selectionList.length === 0) {
        this.ids = "";
      }
    },
    //生成考试
    submitExamApply(row, done, loading){
    submitExamApply(row, done, loading) {
      var that = this;
      var startTime = row.examTime[0];
      var endTime = row.examTime[1];
      var examTime = JSON.stringify(row.examTime);
      console.log(this.ids,111);
      addExam(this.ids, examTime, startTime, endTime).then(
      var startTime = row.startTime + ":00";
      // var endTime = row.examTime[1];
      // var examTime = JSON.stringify(row.examTime);
      // console.log(this.ids,111);
      addExam(this.ids, null, startTime, null).then(
        () => {
          this.onLoad(this.page);
          this.$message({
@@ -473,7 +480,7 @@
      );
    },
    //关闭窗口清除数据
    closeDialog(){
    closeDialog() {
      this.$refs.formExamApply.resetFields();
    },
  },