保安服务企业管理-验收版本
liuyg
2021-12-06 5a3ace296c010b5c11501dedf252e1c144cda9e2
src/views/trainingRegistration/index.vue
@@ -1,8 +1,8 @@
/*
 * @Author: Morpheus
 * @Date: 2021-07-05 16:31:54
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-07-19 19:39:45
 * @Last Modified by: liu
 * @Last Modified time: 2021-11-30 14:39:14
 * menu-name 报名考试
 */
<template>
@@ -27,6 +27,7 @@
            @size-change="questionBankSizeChange"
            @row-save="questionBankRowSave"
            @row-del="questionBankRowDel"
            :before-open="beforeOpen"
          >
            <!-- 自定义按钮 -->
            <!-- <template slot="menuLeft">
@@ -61,7 +62,7 @@
            <template slot="menuLeft">
              <el-button
                type="primary"
                style="display:none"
                style="display: none"
                size="small"
                plain
                icon="el-icon-folder-checked"
@@ -71,7 +72,7 @@
              </el-button>
              <!-- v-if="examPersission" -->
              <el-button
                style="display:none"
                style="display: none"
                type="primary"
                size="small"
                plain
@@ -90,7 +91,7 @@
                v-if="permission.applyexam_cancel"
                :disabled="row.cancel == 2"
                @click="handleCancel(row)"
                >取消报名
                >撤销报名
              </el-button>
              <el-button
                style="display: none"
@@ -184,13 +185,14 @@
import { mapState } from "vuex";
import { mapGetters } from "vuex";
import { getRoleDetail } from "@/api/system/role";
import { getUserDetails } from "@/api/experience/experience"
import { getUserDetails } from "@/api/experience/experience";
export default {
  data() {
    return {
      obj:{
        userId:''
      obj: {
        userId: "",
        deptId: "",
      },
      dialogFormVisible: false,
      dialogExamFormVisible: false,
@@ -423,7 +425,8 @@
        delBtn: false,
        editBtn: false,
        addBtn: true,
        addBtnText: "报名新增",
        addBtnText: "培训报名新增",
        addTitle: "培训报名新增",
        selection: false,
        menu: true,
        // 导出按钮
@@ -476,8 +479,8 @@
            prop: "deptId",
            type: "tree",
            hide: true,
            viewDisabled:false,
            viewDisplay:false,
            viewDisabled: false,
            viewDisplay: false,
            dicUrl:
              "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
            props: {
@@ -501,7 +504,7 @@
            prop: "userId",
            type: "tree",
            dicUrl:
              "/api/blade-user/security-apply-tree?examType=2&deptId={{key}}",
              "/api/blade-user/page-security-units?status=1&deptId={{key}}",
            hide: true,
            slot: true,
            searchSpan: 4,
@@ -520,7 +523,7 @@
            // 表单编辑时是否为查看模式
            editDetail: false,
            props: {
              label: "name",
              label: "realName",
              value: "id",
            },
            rules: [
@@ -536,9 +539,8 @@
            label: "培训机构名称",
            prop: "trainingUnitId",
            type: "select",
            labelWidth:110,
            dicUrl:
              "/api/information/train-unit-tree",
            labelWidth: 110,
            dicUrl: "/api/information/train-unit-tree",
            hide: true,
            slot: true,
            searchSpan: 4,
@@ -644,7 +646,7 @@
            addDisabled: true,
            // 表单新增时是否可见
            addDisplay: true,
            hide:true,
            hide: true,
            rules: [
              {
                required: true,
@@ -851,15 +853,15 @@
    "obj.userId": {
      // form是表单或者表格绑定的数据集,v-model='form'
      handler(val) {
        if(val){
        if (val) {
          //查询用户信息
          getUserDetails(this.userId).then((res)=>{
          getUserDetails(this.userId).then((res) => {
            var data = res.data.data;
            this.obj.cardid = data.cardid;
            this.obj.age = data.age;
            this.obj.nativeplace = data.nativeplace;
            this.obj.phone = data.phone;
          })
          });
        }
      },
      immediate: true,
@@ -898,11 +900,34 @@
      return ids.join(",");
    },
    userId() {
        var d = this.obj.userId + "";
        return d;
      var d = this.obj.userId + "";
      return d;
    },
  },
  methods: {
    beforeOpen(done, type) {
      //  :before-open="beforeOpen"
      //  deptId: "",
      //       realName
      // `/api/blade-user/page-security-units?status=1&deptId={{key}}`
      if (this.userInfo.role_name == "保安公司管理员") {
        // console.log("保安公司管理员登入");
        const deptColumn = this.findObject(
          this.questionBankOption.column,
          "deptId"
        );
        deptColumn.disabled = true;
        console.log(this.userInfo.dept_id);
        this.obj["deptId"] = this.userInfo.dept_id;
      } else {
        // const deptColumn = this.findObject(
        //   this.questionBankOption.column,
        //   "dispatcherUnitId"
        // );
        // deptColumn.search = false;
      }
      done();
    },
    //准考证查看
    handlePrint(row) {
      var obj = row;
@@ -978,7 +1003,7 @@
    },
    questionBankSearchReset() {
      this.questionBankQuery = {
        cancel:11,
        cancel: 11,
      };
      this.questionBankOnLoad(this.questionBankPage);
    },
@@ -992,7 +1017,7 @@
    // 新增
    questionBankRowSave(row, done, loading) {
      // debugger;
      console.log(row,11111);
      console.log(row, 11111);
      adddata(row).then(
        (res) => {
          this.questionBankOnLoad(this.questionBankPage);
@@ -1094,14 +1119,14 @@
    //取消报名
    handleCancel(row) {
      this.$confirm("确定取消报名?", {
      this.$confirm("确定撤销报名?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          row.cancel = 2;
          row['isExam'] = 1;
          row["isExam"] = 1;
          return cancelTrain(row);
        })
        .then(() => {