src/views/trainExam/performance.vue
@@ -1,166 +1,161 @@
/* * @Author: Morpheus * @Date: 2021-07-05 16:31:54 * @Last Modified by: liu *
@Last Modified time: 2021-11-27 10:20:19 * menu-name 成绩管理 */
<template>
  <el-row class="morpheus-box">
    <el-col :span="24">
      <el-card>
        <div
          :class="[
            'exam-card-body',
            $store.state.control.windowWidth >= 1024 ? 'tooRowSearch' : ''
          ]"
        >
          <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"
            @sort-change="sortChange"
            @on-load="questionBankOnLoad"
            @selection-change="questionBankSelectionChange"
            @search-change="questionBankSearchChange"
            @search-reset="questionBankSearchReset"
            @current-change="questionBankCurrentChange"
            @size-change="questionBankSizeChange"
            @row-update="questionBankRowUpdate"
            @refresh-change="refreshChange"
          >
            <template slot-scope="{ row }" slot="theoryGrade">
              {{ row.theoryGrade }}
            </template>
            <template slot-scope="{ row }" slot="learnGrade">
              {{ row.learnGrade == "" ? "暂未录入" : row.learnGrade }}
            </template>
            <template slot-scope="{ row }" slot="allGrade">
              {{ row.allGrade == -1 ? "" : row.allGrade }}
            </template>
            <template slot-scope="{ row }" slot="qualified">
              {{
                row.qualified == ""
                  ? ""
                  : row.qualified == 0
                  ? "合格"
                  : row.qualified == 1
                  ? "不合格"
                  : row.qualified == 3
                  ? "缺考,成绩无效"
                  : ""
              }}
            </template>
  <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"
      @sort-change="sortChange"
      @on-load="questionBankOnLoad"
      @selection-change="questionBankSelectionChange"
      @search-change="questionBankSearchChange"
      @search-reset="questionBankSearchReset"
      @current-change="questionBankCurrentChange"
      @size-change="questionBankSizeChange"
      @row-update="questionBankRowUpdate"
      @refresh-change="refreshChange"
    >
      <template slot-scope="{ row }" slot="theoryGrade">
        {{ row.theoryGrade }}
      </template>
      <template slot-scope="{ row }" slot="learnGrade">
        {{ row.learnGrade == "" ? "暂未录入" : row.learnGrade }}
      </template>
      <template slot-scope="{ row }" slot="allGrade">
        {{ row.allGrade == -1 ? "" : row.allGrade }}
      </template>
      <template slot-scope="{ row }" slot="qualified">
        {{
          row.qualified == ""
            ? ""
            : row.qualified == 0
            ? "合格"
            : row.qualified == 1
            ? "不合格"
            : row.qualified == 3
            ? "缺考,成绩无效"
            : ""
        }}
      </template>
            <!-- 自定义按钮 -->
            <template slot="menuLeft">
              <!-- <el-button type="danger"
      <!-- 自定义按钮 -->
      <template slot="menuLeft">
        <!-- <el-button type="danger"
                                       size="mini"
                                       icon="el-icon-delete"
                                       plain
                                       @click="handleDelete">新增
                            </el-button> -->
              <!-- <el-button type="danger"
        <!-- <el-button type="danger"
                                       size="mini"
                                       icon="el-icon-delete"
                                       plain
                                       @click="handleDelete">删除
                            </el-button> -->
              <el-button
                type="success"
                size="small"
                plain
                icon="el-icon-upload2"
                v-if="permission.trainExam_performance_import"
                @click="handleImport"
                >实操成绩导入
              </el-button>
              <el-button
                type="warning"
                size="small"
                plain
                icon="el-icon-download"
                v-if="permission.trainExam_performance_export"
                @click="handleExport"
                >成绩导出
              </el-button>
              <el-button
                type="primary"
                size="small"
                plain
                v-if="permission.trainExam_performance_paper_apply"
                icon="el-icon-collection-tag"
                @click="handleSecurityPaperApply"
                >证书制证申请
              </el-button>
              <el-button
                type="primary"
                size="small"
                plain
                v-if="permission.trainExam_performance_worker_paper_apply"
                icon="el-icon-collection-tag"
                @click="handleWorkerPaperApply"
                >上岗证制证申请
              </el-button>
            </template>
        <el-button
          type="success"
          size="small"
          plain
          icon="el-icon-upload2"
          v-if="permission.trainExam_performance_import"
          @click="handleImport"
          >实操成绩导入
        </el-button>
        <el-button
          type="warning"
          size="small"
          plain
          icon="el-icon-download"
          v-if="permission.trainExam_performance_export"
          @click="handleExport"
          >成绩导出
        </el-button>
        <el-button
          type="primary"
          size="small"
          plain
          v-if="permission.trainExam_performance_paper_apply"
          icon="el-icon-collection-tag"
          @click="handleSecurityPaperApply"
          >证书制证申请
        </el-button>
        <el-button
          type="primary"
          size="small"
          plain
          v-if="permission.trainExam_performance_worker_paper_apply"
          icon="el-icon-collection-tag"
          @click="handleWorkerPaperApply"
          >上岗证制证申请
        </el-button>
      </template>
            <template slot-scope="{ type, size, row }" slot="menu">
              <el-button
                style="display: none"
                icon="el-icon-s-flag"
                @click="absent(row)"
                :size="size"
                :type="type"
                >缺考标记</el-button
              >
              <el-button
                icon="el-icon-s-promotion"
                @click="openzhengjian(row)"
                :disabled="row.qualified != 0"
                :size="size"
                :type="type"
                >查看证件</el-button
              >
              <el-button
                icon="el-icon-edit"
                @click="modifiedGrades(row)"
                :size="size"
                :type="type"
                >申请修改成绩</el-button
              >
              <el-button
                icon="el-icon-edit"
                v-if="row.isPaper == 6"
                @click="securityPaperApply(row)"
                :size="size"
                :type="type"
                >补证申请</el-button
              >
            </template>
          </avue-crud>
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          style="display: none"
          icon="el-icon-s-flag"
          @click="absent(row)"
          :size="size"
          :type="type"
          >缺考标记</el-button
        >
        <el-button
          icon="el-icon-s-promotion"
          @click="openzhengjian(row)"
          :disabled="row.qualified != 0"
          :size="size"
          :type="type"
          >查看证件</el-button
        >
        <el-button
          icon="el-icon-edit"
          @click="modifiedGrades(row)"
          :size="size"
          :type="type"
          >申请修改成绩</el-button
        >
        <el-button
          icon="el-icon-edit"
          v-if="row.isPaper == 6"
          @click="securityPaperApply(row)"
          :size="size"
          :type="type"
          >补证申请</el-button
        >
      </template>
    </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>
          </el-dialog>
        </div>
      </el-card>
    </el-col>
    <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>
    </el-dialog>
    <el-dialog
      title="申请修改成绩"
@@ -332,8 +327,7 @@
        :closePrint="1"
      ></baoanz>
    </div>
    <!-- </el-dialog> -->
  </el-row>
  </basic-container>
</template>
<script>
@@ -660,7 +654,7 @@
            label: "姓名",
            prop: "securityName",
            search: true,
            searchSpan: 4,
            searchSpan: 3,
            slot: true,
            viewDisplay: true,
            // 表单新增时是否禁止
@@ -674,6 +668,8 @@
            viewDisabled: true,
            // 表单编辑时是否可见
            editDisplay: true,
            searchLabelWidth: 50,
            searchSpan: 3,
            // 表单编辑时是否为查看模式
            editDetail: false,
            rules: [
@@ -837,7 +833,7 @@
            type: "select",
            slot: true,
            search: true,
            searchSpan: 4,
            searchSpan: 3,
            width: 80,
            dicData: [
              {
@@ -944,7 +940,7 @@
            slot: true,
            hide: true,
            search: true,
            searchSpan: 3,
            searchSpan: 4,
            width: 90,
            dicData: [
              {
@@ -1141,7 +1137,9 @@
    };
  },
  created() {},
  mounted() {},
  mounted() {
    this.$store.commit("setWindowSizeHeightAdd");
  },
  computed: {
    ...mapGetters(["userInfo", "permission"]),
    permissionList() {
@@ -1279,7 +1277,9 @@
        return;
      }
      this.$confirm(
        "共选择上岗证制证申请人数" + this.choiceList.length + "人,确定申请制证?",
        "共选择上岗证制证申请人数" +
          this.choiceList.length +
          "人,确定申请制证?",
        {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
@@ -1407,6 +1407,7 @@
            that.questionBankPage.total = data.total;
            that.questionBankData = data.records;
            that.questionBankLoading = false;
            that.$store.commit("setWindowSizeHeightAdd");
            that.questionBankSelectionClear();
          });
        });