src/views/trainingRegistration/index.vue
@@ -1,8 +1,12 @@
<template>
  <basic-container
    :class="[$store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '']"
    :class="[
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
    ]"
  >
    <avue-crud
      class="tablesss"
      v-if="visibles"
      :option="option"
      :table-loading="loading"
@@ -137,7 +141,7 @@
  update,
  remove,
  cancelTrain,
  addExam,
  addExam
} from "@/api/trainingRegistration/trainingRegistration";
import { mapGetters } from "vuex";
import { getRoleDetail } from "@/api/system/role";
@@ -154,7 +158,7 @@
      dialogExamFormVisible: false,
      search: {},
      examApply: {
        number: 0,
        number: 0
      },
      optionExamApply: {
        height: "auto",
@@ -180,7 +184,7 @@
            span: 24,
            value: 0,
            disabled: true,
            labelWidth: 110,
            labelWidth: 110
          },
          // {
          //   label: "序号开始",
@@ -248,11 +252,11 @@
              {
                required: true,
                message: "请选择考试时间",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            span: 12,
            labelWidth: 110,
            labelWidth: 110
          },
          {
            label: "考试开始截止时间",
@@ -276,13 +280,13 @@
              {
                required: true,
                message: "请选择考试时间",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            span: 12,
            labelWidth: 140,
          },
        ],
            labelWidth: 140
          }
        ]
      },
      excelForm: {},
      excelOption: {
@@ -297,25 +301,25 @@
            loadText: "模板上传中,请稍等",
            span: 24,
            propsHttp: {
              res: "data",
              res: "data"
            },
            tip: "请上传 .xls,.xlsx 标准格式文件",
            action: "/api/trainingRegistration/import-trainingRegistration",
            action: "/api/trainingRegistration/import-trainingRegistration"
          },
          {
            label: "模板下载",
            prop: "excelTemplate",
            formslot: true,
            span: 24,
          },
        ],
            span: 24
          }
        ]
      },
      selectionList: [],
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
        ...this.$store.state.control.changePageSize
      },
      query: {},
      data: [],
@@ -343,14 +347,14 @@
        delBtn: false,
        editBtn: false,
        addBtn: false,
        ...this.$store.state.control.clearOtherBut,
      },
        ...this.$store.state.control.clearOtherBut
      }
    };
  },
  computed: {
    ids() {
      let ids = [];
      this.selectionList.forEach((ele) => {
      this.selectionList.forEach(ele => {
        ids.push(ele.id);
      });
      return ids.join(",");
@@ -361,26 +365,16 @@
        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),
        editBtn: this.vaildData(this.permission.notice_edit, false)
      };
    },
    }
  },
  created() {
    this.search["cancel"] = 1;
    this.search["auditStatus"] = 4;
    this.search["isExam"] = 1;
  },
  watch: {
    windowHeight() {
      // console.log(this.windowHeight, "windowHeight");
      this.option.height = this.windowHeight - 320;
      this.visibles = false;
      this.$nextTick(() => {
        this.visibles = true;
        this.refreshChange();
      });
    },
  },
  mounted() {
    // if (window.name == "baoming") {
    //   let old = JSON.parse(window.localStorage.getItem("baoming"));
@@ -391,6 +385,7 @@
    //   window.name = "baoming";
    //   console.log("不刷新");
    // }
    this.$store.commit("setWindowSizeHeightAdd");
  },
  methods: {
    //报名信息导出
@@ -398,7 +393,7 @@
      this.$confirm("是否导出报名信息数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      }).then(() => {
        //获取查询条件
        // const { releaseTimeRange } = this.questionBankSearch;
@@ -411,7 +406,7 @@
          auditStatus: this.search.auditStatus,
          deptName: this.search.deptName,
          isExam: this.search.isExam,
          realName: this.search.realName,
          realName: this.search.realName
        };
        if (
          this.userInfo.role_name == "保安公司管理员" ||
@@ -440,7 +435,7 @@
      obj["name"] = "准考证信息";
      this.$router.push({
        path: `/applyexam/papers`,
        query: obj,
        query: obj
      });
    },
    sizeChange(val) {
@@ -454,27 +449,27 @@
    rowSave(form, done, loading) {
      var that = this;
      adddata(form).then(
        (res) => {
        res => {
          this.onLoad(this.page);
          if (res.data.data == 201) {
            this.$message({
              type: "warning",
              message: "已报名,不能重复报名",
              message: "已报名,不能重复报名"
            });
          } else if (res.data.data == 201) {
            this.$message({
              type: "warning",
              message: "报名失败",
              message: "报名失败"
            });
          } else {
            this.$message({
              type: "success",
              message: "报名成功",
              message: "报名成功"
            });
          }
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -496,11 +491,11 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -511,7 +506,7 @@
      this.$confirm("确认报名?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      }).then(() => {
        row.cancel = 3;
        update(row).then(
@@ -519,11 +514,11 @@
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "确认报名成功!",
              message: "确认报名成功!"
            });
            done();
          },
          (error) => {
          error => {
            window.console.log(error);
            loading();
          }
@@ -534,7 +529,7 @@
      this.$confirm("确定取消报名?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      }).then(() => {
        row.cancel = 2;
        cancelTrain(row).then(
@@ -542,11 +537,11 @@
            this.onLoad(this.page);
            this.$message({
              type: "success",
              message: "取消报名成功!",
              message: "取消报名成功!"
            });
            done();
          },
          (error) => {
          error => {
            window.console.log(error);
            loading();
          }
@@ -557,7 +552,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
@@ -566,7 +561,7 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
        });
    },
@@ -577,7 +572,7 @@
      for (let k in list) {
        this.choiceName.push({
          label: list[k].realName,
          value: list[k].id,
          value: list[k].id
        });
      }
@@ -592,7 +587,7 @@
      this.$confirm("确定将选择数据删除?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(this.ids);
@@ -601,7 +596,7 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          this.$refs.crudrec.toggleSelection();
        });
@@ -616,8 +611,8 @@
      //获取当前登录人员的角色信息
      var roleIds = this.userInfo.role_id.split(",");
      params = this.search;
      roleIds.forEach((roleId) => {
        getRoleDetail(roleId).then((res) => {
      roleIds.forEach(roleId => {
        getRoleDetail(roleId).then(res => {
          var roleAlias = res.data.data.roleAlias;
          if (
            roleAlias == "保安公司管理员" ||
@@ -636,12 +631,13 @@
            page.currentPage,
            page.pageSize,
            Object.assign(params, this.query)
          ).then((res) => {
          ).then(res => {
            // console.log(res);
            const data = res.data.data;
            this.page.total = data.total;
            this.data = data.records;
            // console.log(this.data);
            this.$store.commit("setWindowSizeHeightAdd");
            this.loading = false;
          });
        });
@@ -666,7 +662,7 @@
      if (this.choiceName.length == 0) {
        this.$message({
          message: "未选择保安员",
          type: "warning",
          type: "warning"
        });
        return;
      }
@@ -731,12 +727,12 @@
          that.dialogExamFormVisible = false;
          this.$message({
            type: "success",
            message: "操作成功",
            message: "操作成功"
          });
          this.$refs.crud.toggleSelection();
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -745,10 +741,9 @@
    //关闭窗口清除数据
    closeDialog() {
      this.$refs.formExamApply.resetFields();
    },
  },
    }
  }
};
</script>
<style>
</style>
<style></style>