Administrator
2022-04-11 79d9fc857559982b00b68b2d709807bdc4cd286f
src/views/trainExam/modifiedGrades.vue
@@ -1,74 +1,74 @@
/*
 * @Author: Morpheus
 * @Date: 2021-07-05 16:31:54
 * @Last Modified by: liu
 * @Last Modified time: 2021-11-23 13:55:09
 * menu-name 成绩修改管理
 */
/* * @Author: Morpheus * @Date: 2021-07-05 16:31:54 * @Last Modified by: liu *
@Last Modified time: 2021-11-23 13:55:09 * menu-name 成绩修改管理 */
<template>
  <el-row class="morpheus-box">
    <el-col
      :span="24"
      :class="[
        'recruitmentManagement',
        $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
      ]"
  <basic-container
    :class="[
      'exam-card-body',
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
    ]"
  >
    <avue-crud
      v-model="obj"
      class="company-box tablesss"
      :option="questionBankOption"
      :search.sync="questionBankSearch"
      :table-loading="questionBankLoading"
      :data="questionBankData"
      :permission="permissionList"
      ref="questionBankCrud"
      :page.sync="questionBankPage"
      @on-load="questionBankOnLoad"
      @selection-change="selectionChange"
      @search-change="questionBankSearchChange"
      @search-reset="questionBankSearchReset"
      @current-change="questionBankCurrentChange"
      @size-change="questionBankSizeChange"
      @row-update="questionBankRowUpdate"
      @refresh-change="refreshChange"
    >
      <el-card>
        <div
          :class="[
            'exam-card-body',
            $store.state.control.windowWidth >= 1024 ? 'oneRowSearch' : '',
          ]"
        >
          <avue-crud
            v-model="obj"
            class="company-box"
            :option="questionBankOption"
            :search.sync="questionBankSearch"
            :table-loading="questionBankLoading"
            :data="questionBankData"
            :permission="permissionList"
            ref="questionBankCrud"
            :page.sync="questionBankPage"
            @on-load="questionBankOnLoad"
            @selection-change="selectionChange"
            @search-change="questionBankSearchChange"
            @search-reset="questionBankSearchReset"
            @current-change="questionBankCurrentChange"
            @size-change="questionBankSizeChange"
            @row-update="questionBankRowUpdate"
            @refresh-change="refreshChange"
          >
            <!-- 自定义按钮 -->
      <template slot-scope="{ row }" slot="status">
        <el-tag class="dtype">
          {{
            row.status == 2
              ? "审核通过"
              : row.status == 3
              ? "审核不通过"
              : "待审核"
          }}
          <i class="zc" v-if="row.status == 2"></i>
          <i class="yj" v-if="row.status == 3"></i>
          <i class="gz" v-if="row.status == 1"></i>
        </el-tag>
      </template>
      <!-- 自定义按钮 -->
      <template slot="menuLeft">
        <el-button
          type="primary"
          size="small"
          plain
          v-if="checks"
          icon="el-icon-collection-tag"
          @click="handleBatchAudit"
          >批量审批
        </el-button>
        <!--图例 components-->
        <span>
          <Legend :datas="datalistLIU"></Legend>
        </span>
      </template>
            <template slot="menuLeft">
              <el-button
                type="primary"
                size="small"
                plain
                v-if="checks"
                icon="el-icon-collection-tag"
                @click="handleBatchAudit"
                >批量审批
              </el-button>
            </template>
            <template slot-scope="{ type, size, row }" slot="menu">
              <el-button
                :type="type"
                :size="size"
                icon="el-icon-folder-checked"
                v-if="permission.score_audit_check || check"
                @click="handleAudit(row)"
                >审核
              </el-button>
            </template>
          </avue-crud>
        </div>
      </el-card>
    </el-col>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          :type="type"
          :size="size"
          icon="el-icon-folder-checked"
          v-if="permission.score_audit_check || check"
          @click="handleAudit(row)"
          >审核
        </el-button>
      </template>
    </avue-crud>
    <el-dialog
      title="成绩修改审核"
      :visible.sync="dialogFormVisible"
@@ -91,15 +91,15 @@
      width="900px"
      @close="closeDialog"
    >
    <avue-form
      ref="formBatchAudit"
      v-model="batchAudit"
      :option="optionBatchAudit"
      @reset-change="emptytChange"
      @submit="submitBatchAudit"
    ></avue-form>
      <avue-form
        ref="formBatchAudit"
        v-model="batchAudit"
        :option="optionBatchAudit"
        @reset-change="emptytChange"
        @submit="submitBatchAudit"
      ></avue-form>
    </el-dialog>
  </el-row>
  </basic-container>
</template>
<script>
@@ -107,18 +107,37 @@
  getList,
  update,
  applyAudit,
  batchAudit,
  batchAudit
} from "@/api/examapi/modifiedGrades";
import { mapGetters } from "vuex";
import { getRoleDetail } from "@/api/system/role";
import Legend from "@/components/liu-legend/Legend";
export default {
  components: {
    Legend
  },
  data() {
    return {
      //legend-liu数据
      datalistLIU: [
        {
          color: "#29C093",
          text: "审核通过"
        },
        {
          color: "#F34A4A",
          text: "审核不通过"
        },
        {
          color: "#F48F57",
          text: "待审核"
        }
      ],
      Audit: {},
      dialogFormVisible: false,
      dialogBatchAudit: false,
      batchAudit: {
        number: 0,
        number: 0
      },
      optionBatchAudit: {
        height: "auto",
@@ -144,7 +163,7 @@
            span: 24,
            value: 0,
            disabled: true,
            labelWidth: 110,
            labelWidth: 110
          },
          {
            label: "审核状态",
@@ -160,31 +179,31 @@
              {
                required: true,
                message: "请选择审核类型",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            dicData: [
              {
                label: "待审核",
                value: 1,
                value: 1
              },
              {
                label: "审核通过",
                value: 2,
                value: 2
              },
              {
                label: "审核不通过",
                value: 3,
              },
            ],
                value: 3
              }
            ]
          },
          {
            label: "审核明细",
            span: 24,
            type: "textarea",
            prop: "auditDetail",
          },
        ],
            prop: "auditDetail"
          }
        ]
      },
      choiceList: [],
      optionAudit: {
@@ -220,34 +239,34 @@
              {
                required: true,
                message: "请选择审核类型",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            dicData: [
              {
                label: "待审核",
                value: 1,
                value: 1
              },
              {
                label: "审核通过",
                value: 2,
                value: 2
              },
              {
                label: "审核不通过",
                value: 3,
              },
            ],
                value: 3
              }
            ]
          },
          {
            label: "审核明细",
            span: 24,
            type: "textarea",
            prop: "auditDetail",
          },
        ],
            prop: "auditDetail"
          }
        ]
      },
      obj: {
        name: "张三",
        name: "张三"
      },
      questionBankOption: {
        // 操作栏多余按钮去除
@@ -259,7 +278,7 @@
        selection: true,
        reserveSelection: true,
        tip: false,
        viewBtn: true,
        viewBtn: false,
        // title: '成绩',
        align: "center",
        height: "auto",
@@ -272,16 +291,18 @@
        dialogClickModal: false,
        // 操作栏宽度
        menu: true,
        menuWidth: 220,
        menuWidth: 160,
        labelWidth: 120,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
            label: "考试名称",
            prop: "examName",
            label: "考试时间",
            prop: "examTime",
            search: true,
            searchSpan: 5,
            slot: true,
            searchSpan: 4,
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            viewDisplay: true,
            // 表单新增时是否禁止
            addDisabled: false,
@@ -300,13 +321,12 @@
              {
                required: true,
                message: "请输入试卷名称",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            width: 210,
            // overHidden:true,
            width: 90,
            overHidden: true
          },
          {
            label: "姓名",
            prop: "realName",
@@ -331,10 +351,10 @@
              {
                required: true,
                message: "请输入试卷名称",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            width: 80,
            width: 80
            // overHidden:true,
          },
@@ -365,10 +385,11 @@
              {
                required: true,
                message: "请输入所属公司",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            width: 230,
            width: 200,
            overHidden: true
          },
          {
@@ -393,10 +414,10 @@
              {
                required: true,
                message: "请输入保安姓名",
                trigger: "blur",
              },
                trigger: "blur"
              }
            ],
            width: 140,
            width: 140
          },
          {
@@ -415,11 +436,12 @@
            editDisplay: true,
            // 表单编辑时是否为查看模式
            editDetail: false,
            width: 88,
            width: 88
          },
          {
            label: "修改后理论成绩",
            width: 110,
            prop: "newScore",
            slot: true,
            // 表单新增时是否禁止
@@ -434,7 +456,32 @@
            editDisplay: true,
            // 表单编辑时是否为查看模式
            editDetail: false,
            width: 88,
            rules: [
              {
                required: true,
                message: "请输入修改后理论成绩",
                trigger: "blur"
              }
            ]
          },
          {
            label: "笔试答题图片",
            prop: "url",
            labelWidth: 110,
            type: "upload",
            dataType: "string",
            width: 98,
            span: 24,
            limit: 5,
            listType: "picture-card",
            disabled: true,
            tip: "只能上传jpg/png文件,最多上传5张",
            propsHttp: {
              res: "data",
              url: "url"
            },
            action: "/api/blade-resource/oss/endpoint/put-files"
          },
          {
@@ -455,8 +502,9 @@
            // 表单编辑时是否可见
            editDisplay: true,
            // 表单编辑时是否为查看模式
            width: 200,
            editDetail: false,
            overHidden: true,
            overHidden: true
          },
          {
            label: "申请理由",
@@ -474,14 +522,16 @@
            editDisplay: true,
            // 表单编辑时是否为查看模式
            editDetail: false,
            minWidth: 70,
            overHidden: true
          },
          {
            label: "修改申请时间",
            prop: "createTime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd  HH:mm:ss",
            slot: true,
            searchSpan: 4,
            // 表单新增时是否禁止
@@ -497,15 +547,15 @@
            // 表单编辑时是否为查看模式
            editDetail: false,
            viewDisplay: false,
            width: 120,
            width: 130
          },
          {
            label: "审核时间",
            prop: "auditTime",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            format: "yyyy-MM-dd HH:mm:ss",
            valueFormat: "yyyy-MM-dd  HH:mm:ss",
            slot: true,
            searchSpan: 4,
            // 表单新增时是否禁止
@@ -521,7 +571,7 @@
            // 表单编辑时是否为查看模式
            editDetail: false,
            viewDisplay: false,
            width: 120,
            width: 130
          },
          {
@@ -534,16 +584,16 @@
            dicData: [
              {
                label: "待审核",
                value: 1,
                value: 1
              },
              {
                label: "审核通过",
                value: 2,
                value: 2
              },
              {
                label: "审核不通过",
                value: 3,
              },
                value: 3
              }
            ],
            // 表单新增时是否禁止
            addDisabled: false,
@@ -557,7 +607,7 @@
            editDisplay: true,
            // 表单编辑时是否为查看模式
            editDetail: false,
            width: 96,
            width: 110
          },
          {
@@ -576,9 +626,9 @@
            editDisplay: true,
            // 表单编辑时是否为查看模式
            editDetail: false,
            width: 68,
          },
        ],
            width: 68
          }
        ]
      },
      questionBankSearch: {},
      questionBankLoading: true,
@@ -587,14 +637,14 @@
        pageSize: 10,
        currentPage: 1,
        total: 16,
        ...this.$store.state.control.changePageSize,
        ...this.$store.state.control.changePageSize
      },
      questionBankQuery: {},
      questionBankSelectionList: [],
      questionBankSelectionList: []
    };
  },
  created() {
    if (this.userInfo.role_name == "公安管理员") {
    if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警") {
      //判断是否为市局管理员
      if (this.userInfo.jurisdiction == "1372091709474910209") {
        this.check = true;
@@ -606,11 +656,11 @@
    //判断是否为超级管理员
    if (this.userInfo.role_name == "administrator") {
      this.checks = true;
      this.questionBankOption.tip = true
      this.questionBankOption.tip = true;
    }
  },
  mounted() {
    this.$store.commit("setWindowSizeHeightAdd");
  },
  computed: {
    ...mapGetters(["userInfo", "permission"]),
@@ -619,9 +669,9 @@
        addBtn: this.vaildData(null, false),
        viewBtn: this.vaildData(this.permission.score_audit_view, false),
        delBtn: this.vaildData(null, false),
        editBtn: this.vaildData(this.permission.score_audit_edit, false),
        editBtn: this.vaildData(this.permission.score_audit_edit, false)
      };
    },
    }
  },
  methods: {
    getNewTime() {
@@ -681,7 +731,7 @@
        id: row.id,
        status: row.status,
        auditDetail: row.auditDetail,
        auditUser: this.userInfo.Id,
        auditUser: this.userInfo.Id
      };
      applyAudit(data).then(
@@ -690,11 +740,11 @@
          this.questionBankOnLoad(this.questionBankPage);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -705,7 +755,7 @@
      if (this.choiceList.length == 0) {
        this.$message({
          message: "未选择考试的人员",
          type: "warning",
          type: "warning"
        });
        return;
      }
@@ -717,7 +767,7 @@
      this.choiceList = [];
      for (let k in list) {
        this.choiceList.push({
          id: list[k].id,
          id: list[k].id
        });
      }
    },
@@ -726,8 +776,8 @@
      var that = this;
      //获取当前登录人员的角色信息
      var roleIds = this.userInfo.role_id.split(",");
      roleIds.forEach((roleId) => {
        getRoleDetail(roleId).then((res) => {
      roleIds.forEach(roleId => {
        getRoleDetail(roleId).then(res => {
          var roleAlias = res.data.data.roleAlias;
          if (roleAlias == "保安公司管理员" || roleAlias == "保安") {
            //如果是保安公司管理员
@@ -737,7 +787,7 @@
            //如果是培训公司管理员
            params["trainUnitId"] = that.userInfo.dept_id;
          }
          if (this.userInfo.role_name == "公安管理员") {
          if (this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警") {
            //如果是公安管理员
            params["jurisdiction"] = this.userInfo.jurisdiction;
          }
@@ -746,11 +796,12 @@
            page.currentPage,
            page.pageSize,
            Object.assign(params, this.questionBankQuery)
          ).then((res) => {
          ).then(res => {
            const data = res.data.data;
            that.questionBankPage.total = data.total;
            that.questionBankData = data.records;
            that.questionBankLoading = false;
            this.$store.commit("setWindowSizeHeightAdd");
            that.questionBankSelectionClear();
          });
        });
@@ -784,17 +835,17 @@
    questionBankRowUpdate(row, index, done, loading) {
      update({
        id: row.id,
        newScore: row.newScore,
        newScore: row.newScore
      }).then(
        () => {
          this.questionBankOnLoad(this.questionBankPage);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -815,7 +866,7 @@
        ids: str,
        status: row.status,
        auditDetail: row.auditDetail,
        auditUser: this.userInfo.Id,
        auditUser: this.userInfo.Id
      };
      //提交申请
      batchAudit(data).then(
@@ -825,13 +876,13 @@
          that.dialogBatchAudit = false;
          this.$message({
            type: "success",
            message: "操作成功",
            message: "操作成功"
          });
          //清除选项
          that.$refs.questionBankCrud.toggleSelection();
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -839,8 +890,8 @@
    },
    refreshChange() {
      this.questionBankOnLoad(this.questionBankPage, this.questionBankQuery);
    },
  },
    }
  }
};
</script>
@@ -848,4 +899,50 @@
.morpheus-box {
  position: relative;
}
.dtype {
  width: 100%;
  padding-left: 0px;
}
.dx {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 6px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #dfdfdf;
}
.zc {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #29c093;
}
.yj {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f34a4a;
}
.gz {
  position: absolute;
  top: 50%;
  margin-top: -5px;
  margin-left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 30%;
  background: #f48f57;
}
</style>