Administrator
2021-08-12 25a3655dd6e2f5b72390ce76d61f953c4ed46ec4
培训考试修改
4 files modified
193 ■■■■ changed files
src/api/trainingRegistration/trainingRegistration.js 9 ●●●●● patch | view | raw | blame | history
src/views/traincompany/index.vue 132 ●●●● patch | view | raw | blame | history
src/views/trainingRegistration/data.js 37 ●●●● patch | view | raw | blame | history
src/views/trainingRegistration/index.vue 15 ●●●● patch | view | raw | blame | history
src/api/trainingRegistration/trainingRegistration.js
@@ -21,6 +21,15 @@
}
export const batchTrain = (row) => {
    return request({
        url: '/api/trainingRegistration/batchTrain',
        method: 'post',
        data: row
    })
}
export const cancelTrain = (row) => {
    return request({
        url: '/api/trainingRegistration/cancelTrain',
src/views/traincompany/index.vue
@@ -48,7 +48,7 @@
    </avue-crud>
    <el-dialog
        title="报名"
        title="批量报名"
        append-to-body
        :visible.sync="dialogDisable"
        width="1000px"
@@ -66,7 +66,7 @@
  update,
  remove,
} from "@/api/securityCompany/train";
import {adddata} from "@/api/trainingRegistration/trainingRegistration";
import {adddata,batchTrain} from "@/api/trainingRegistration/trainingRegistration";
import { mapGetters } from "vuex";
import { mapState } from 'vuex';
@@ -77,6 +77,7 @@
      form: {},
      formTrainApply: {},
      query: {},
      deptId:null,
      loading: true,
      dialogDisable:false,
      page: {
@@ -194,58 +195,47 @@
              span:24
          },
          // {
          //     label: "考试名称",
          //     prop: "trainExamId",
          //     dicUrl: "/api/trainExam/page-tree?deptId={{key}}",
          //     label: "单位名称",
          //     prop: "deptId",
          //     dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
          //     // dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=0",
          //     cascaderItem: ["userId"],
          //     props: {
          //         label: "trainExamName",
          //         label: "title",
          //         value: "id"
          //     },
          //     // search: true,
          //     type: "select",
          //     hide: true,
          //     rules: [{
          //         required: true,
          //         message: "请输入考试名称",
          //         message: "请输入单位名称",
          //         trigger: "blur"
          //     }],
          //     hide: true,
          //     span: 24
          // },
          {
              label: "单位名称",
              prop: "deptId",
              // width: 70,
              // search: true,
              // searchSpan: 4,
              dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
              cascaderItem: ["userId"],
              props: {
                  label: "title",
                  value: "id"
              },
              // search: true,
              type: "select",
              hide: true,
              rules: [{
                  required: true,
                  message: "请输入单位名称",
                  trigger: "blur"
              }],
              overHidden: true
          }, {
              label: "姓名",
              prop: "userId",
              type: "select",
            type: "tree",
              hide: true,
              dicUrl: "/api/blade-user/page-security-unit?deptId={{key}}",
            // dicUrl: "/api/blade-user/page-security-unit?deptId="+this.deptId,
              props: {
                  label: "realName",
                  value: "id"
              label: "name",
              value: "id",
              },
            //不包含父节点值
            leafOnly:true,
            multiple: true,
              searchSpan: 5,
              rules: [{
            rules: [
              {
                  required: true,
                  message: "请输入姓名",
                  trigger: "blur"
              }],
                trigger: "blur",
              },
            ],
            span: 24,
          },
        ],
@@ -273,15 +263,55 @@
    ...mapState({
        userInfo: state => state.user.userInfo
    })
  },
  created() {
      this.optionTrainApply.column[1].dicUrl =
        "/api/blade-user/security-apply-tree?deptId=" +
        this.userInfo.dept_id;
  },
  methods: {
    //保安公司批量报名
    handleTrainApplyBatch(row){
      this.dialogDisable = true;
      this.optionTrainApply.column.trainingUnitId = row.departmentid;
      // this.deptId= this.userInfo.dept_id;
      this.formTrainApply = {
        trainingUnitId: row.departmentid
      }
    },
    //批量报名提交
    submit(){
        batchTrain({
          userIds: this.formTrainApply.userId.join(","),
        }).then(
          (res) => {
            this.onLoad(this.page);
            if (res.data.data == 201) {
              this.$message({
                type: "warning",
                message: "已报名,不能重复报名",
              });
            } else if (res.data.data == 201) {
              this.$message({
                type: "warning",
                message: "报名失败",
              });
            } else {
              this.$message({
                type: "success",
                message: "报名成功",
              });
              this.$refs.formTrainApply.resetFields();
              this.dialogDisable = false;
            }
          },
          (error) => {
            window.console.log(error);
          }
        );
    },
    //未持证保安人员报名
    handleTrainApply(row,done,loading){
@@ -317,36 +347,6 @@
    //关闭窗口清除数据
    closeDialog(){
      this.$refs.formTrainApply.resetFields();
    },
    submit(row, done, loading) {
      adddata(row).then(
        (res) => {
          // this.onLoad(this.page);
          if(res.data.data==201){
              this.$message({
                type: "warning",
                message:"已报名,不能重复报名",
              });
          }else if(res.data.data==201){
              this.$message({
                type: "warning",
                message:"报名失败",
              });
          }else{
              this.$message({
                type: "success",
                message:"报名成功",
              });
              this.dialogDisable = false;
              this.$refs.formTrainApply.resetFields();
          }
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowSave(row, done, loading) {
      add(row).then(
src/views/trainingRegistration/data.js
@@ -9,7 +9,7 @@
    label: '已报名',
    value: 1,
}, {
    label: '已撤销',
    label: '已取消',
    value: 2,
}, {
    label: '已确认',
@@ -35,7 +35,6 @@
    }],
    searchSpan: 4,
    searchLabelWidth: 110,
    search: true,
}, {
    label: "姓名",
    prop: "userId",
@@ -97,35 +96,35 @@
    },
    // search: true,
    type: "select",
    // hide: true,
        hide: true,
    rules: [{
        required: true,
        message: "请输入单位名称",
        trigger: "blur"
    }],
    overHidden: true
},
{
    type: "select",
    }, {
        label: "单位名称",
        prop: "deptName",
        // hide: true,
        search: true,
        searchSpan: 6,
    rules: [{
        required: true,
        message: "请输入培训公司名称",
            message: "请输入单位名称",
        trigger: "blur"
    }],
    searchSpan: 4,
    searchLabelWidth: 110,
    search: true,
},
{
    label: "考试名称",
    prop: "trainExamId",
    dicUrl: "/api/trainExam/page-tree?deptId={{key}}",
    props: {
        label: "trainExamName",
        value: "id"
    },
    // {
    //     label: "考试名称",
    //     prop: "trainExamId",
    //     dicUrl: "/api/trainExam/page-tree?deptId={{key}}",
    //     props: {
    //         label: "trainExamName",
    //         value: "id"
    //     },
},
    // },
{
    label: "报名状态",
    prop: "cancel",
src/views/trainingRegistration/index.vue
@@ -31,6 +31,15 @@
          @click="handleDelete"
          >删 除
        </el-button>
        <el-button
          type="primary"
          size="small"
          plain
          icon="el-icon-folder-checked"
          @click="handleBatchExam"
          >考试申请
        </el-button>
      </template>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
@@ -38,7 +47,6 @@
          @click="revoke(row)"
          :size="size"
          :type="type"
          :disabled="row.cancel == 2"
          >取消报名</el-button
        >
        <el-button
@@ -61,6 +69,7 @@
  adddata,
  update,
  remove,
  cancelTrain
} from "@/api/trainingRegistration/trainingRegistration";
export default {
@@ -78,7 +87,7 @@
      option: {
        // card: true,
        tip: false,
        searchSize: "mini",
        // searchSize: "mini",
        searchMenuSpan: 6,
        height: 583,
        index: true,
@@ -202,7 +211,7 @@
        type: "warning",
      }).then(() => {
        row.cancel = 2;
        update(row).then(
        cancelTrain(row).then(
          () => {
            this.onLoad(this.page);
            this.$message({