src/views/exam/examPayment.vue
@@ -1,108 +1,92 @@
/*
 * @Author: Morpheus
 * @Date: 2021-07-05 16:31:54
 * @Last Modified by: liu
 * @Last Modified time: 2021-11-23 14:20:02
 * menu-name 考试缴费管理
 */
/* * @Author: Morpheus * @Date: 2021-07-05 16:31:54 * @Last Modified by: liu *
@Last Modified time: 2021-11-23 14:20:02 * 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"
      :permission="permissionList"
      :search.sync="questionBankSearch"
      :table-loading="questionBankLoading"
      :data="questionBankData"
      ref="questionBankCrud"
      :page.sync="questionBankPage"
      @on-load="questionBankOnLoad"
      @selection-change="questionBankSelectionChange"
      @search-change="questionBankSearchChange"
      @search-reset="questionBankSearchReset"
      @current-change="questionBankCurrentChange"
      @size-change="questionBankSizeChange"
      @row-del="rowDel"
      @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"
            :permission="permissionList"
            :search.sync="questionBankSearch"
            :table-loading="questionBankLoading"
            :data="questionBankData"
            ref="questionBankCrud"
            :page.sync="questionBankPage"
            @on-load="questionBankOnLoad"
            @selection-change="questionBankSelectionChange"
            @search-change="questionBankSearchChange"
            @search-reset="questionBankSearchReset"
            @current-change="questionBankCurrentChange"
            @size-change="questionBankSizeChange"
            @row-del="rowDel"
            @row-update="questionBankRowUpdate"
            @refresh-change="refreshChange"
          >
            <template slot-scope="{ row }" slot="sex">
              <el-tag v-if="row.sex == 1">男</el-tag>
              <el-tag v-if="row.sex == 2">女</el-tag>
            </template>
      <template slot-scope="{ row }" slot="sex">
        <el-tag v-if="row.sex == 1">男</el-tag>
        <el-tag v-if="row.sex == 2">女</el-tag>
      </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.performance_import"
                @click="handleImport"
                >缴费凭证批量上传
              </el-button>
            </template>
        <el-button
          type="success"
          size="small"
          plain
          icon="el-icon-upload2"
          v-if="permission.performance_import"
          @click="handleImport"
          >缴费凭证批量上传
        </el-button>
      </template>
            <template slot-scope="{ row }" slot="menu">
              <el-button
                style="display: none"
                type="text"
                size="mini"
                icon="el-icon-collection"
                class="start-kaoshi"
                v-if="permission.performance_print"
                :disabled="row.qualified == 1"
                @click="securityPrint(row)"
                >保安证打印
              </el-button>
            </template>
          </avue-crud>
      <template slot-scope="{ row }" slot="menu">
        <el-button
          style="display: none"
          type="text"
          size="mini"
          icon="el-icon-collection"
          class="start-kaoshi"
          v-if="permission.performance_print"
          :disabled="row.qualified == 1"
          @click="securityPrint(row)"
          >保安证打印
        </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"
            >
            </avue-form>
          </el-dialog>
        </div>
      </el-card>
    </el-col>
  </el-row>
    <el-dialog
      title="缴费凭证批量上传"
      append-to-body
      :visible.sync="excelBox"
      width="555px"
    >
      <avue-form
        :option="excelOption"
        v-model="excelForm"
        :upload-after="uploadAfter"
      >
      </avue-form>
    </el-dialog>
  </basic-container>
</template>
<script>
@@ -114,7 +98,7 @@
  data() {
    return {
      obj: {
        name: "张三",
        name: "张三"
      },
      excelBox: false,
      questionBankOption: {
@@ -161,13 +145,13 @@
            label: "缴费人",
            prop: "realName",
            search: true,
            searchSpan: 4,
            searchSpan: 4
          },
          {
            label: "身份证号",
            prop: "idCardNo",
            search: true,
            searchSpan: 4,
            searchSpan: 4
          },
          {
            label: "性别",
@@ -176,23 +160,23 @@
            dicData: [
              {
                label: "男",
                value: 1,
                value: 1
              },
              {
                label: "女",
                value: 2,
              },
            ],
                value: 2
              }
            ]
          },
          {
            label: "联系方式",
            prop: "phone",
            prop: "phone"
          },
          {
            label: "所在单位",
            prop: "deptName",
            search: true,
            searchSpan: 6,
            searchSpan: 6
          },
          // {
          //     label: "缴费状态",
@@ -220,7 +204,7 @@
            prop: "certificateUrl",
            overHidden: true,
            type: "upload",
            listType: "picture-img",
            listType: "picture-img"
          },
          {
            label: "缴费时间",
@@ -236,11 +220,11 @@
              {
                required: true,
                message: "请输入时间",
                trigger: "click",
              },
            ],
          },
        ],
                trigger: "click"
              }
            ]
          }
        ]
      },
      questionBankSearch: {},
      questionBankLoading: true,
@@ -249,7 +233,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 16,
        ...this.$store.state.control.changePageSize,
        ...this.$store.state.control.changePageSize
      },
      questionBankQuery: {},
      questionBankSelectionList: [],
@@ -266,14 +250,13 @@
            loadText: "模板上传中,请稍等",
            span: 24,
            propsHttp: {
              res: "data",
              res: "data"
            },
            tip: "请上传 zip 压缩文件",
            action:
              "/api/blade-resource/oss/endpoint/put-file-exam-payment-zip",
          },
        ],
      },
            action: "/api/blade-resource/oss/endpoint/put-file-exam-payment-zip"
          }
        ]
      }
    };
  },
  computed: {
@@ -284,12 +267,14 @@
        viewBtn: this.vaildData(this.permission.notice_view, false),
        delBtn: this.vaildData(this.permission.notice_delete, false),
        editBtn: this.vaildData(this.permission.performance__edit, false),
        excelBtn: this.vaildData(this.permission.performance_export, false),
        excelBtn: this.vaildData(this.permission.performance_export, false)
      };
    },
    }
  },
  created() {},
  mounted() {},
  mounted() {
    this.$store.commit("setWindowSizeHeightAdd");
  },
  methods: {
    questionBankOnLoad(page, params = {}) {
      //判断角色,如果是保安公司管理员或保安,只能查看当前公司的考试成绩
@@ -302,11 +287,12 @@
        page.currentPage,
        page.pageSize,
        Object.assign(params, this.query)
      ).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();
      });
    },
@@ -315,7 +301,7 @@
      this.$confirm("确定删除当前缴费数据?", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        type: "warning"
      })
        .then(() => {
          return remove(row.id);
@@ -324,7 +310,7 @@
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
        });
    },
@@ -358,17 +344,17 @@
        theoryGrade: row.theoryGrade,
        learnGrade: row.learnGrade,
        examId: row.examId,
        id: row.id,
        id: row.id
      }).then(
        () => {
          this.questionBankOnLoad(this.questionBankPage);
          this.$message({
            type: "success",
            message: "操作成功!",
            message: "操作成功!"
          });
          done();
        },
        (error) => {
        error => {
          window.console.log(error);
          loading();
        }
@@ -385,10 +371,9 @@
    },
    refreshChange() {
      this.questionBankOnLoad(this.questionBankPage, this.questionBankQuery);
    },
  },
    }
  }
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>