zhongrj
2024-03-27 cc1c0a396698648256c350f6f0fe2cb2f0b02c7e
src/views/qualificationExamination/scoreInquiry.vue
@@ -1,13 +1,15 @@
/*
 * @Author: Morpheus
 * @Date: 2021-07-07 17:30:05
 * @Last Modified by: Morpheus
 * @Last Modified time: 2021-07-10 16:06:14
 * menu-name 监管信息
 */
/* * @Author: Morpheus * @Date: 2021-07-07 17:30:05 * @Last Modified by: liu *
@Last Modified time: 2021-10-22 17:27:19 * menu-name 监管信息 */
<template>
  <basic-container>
  <basic-container
    :class="[
      'witerFontColorInput',
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '',
    ]"
  >
    <avue-crud
      class="tablesss"
      :option="option"
      :table-loading="loading"
      :data="data"
@@ -18,6 +20,7 @@
      @row-update="rowUpdates"
      @row-save="rowSave"
      @row-del="rowDel"
      :search.sync="query"
      @search-change="searchChange"
      @search-reset="searchReset"
      @selection-change="selectionChange"
@@ -26,6 +29,17 @@
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <!-- 自定义按钮 -->
      <template slot="menuLeft">
        <el-button
          type="warning"
          size="small"
          plain
          icon="el-icon-download"
          @click="handleExport"
          >导出
        </el-button>
      </template>
    </avue-crud>
  </basic-container>
</template>
@@ -39,10 +53,9 @@
//   remove,
// } from "@/api/regulatoryInformation/regulatoryInformation";
import { mapGetters } from "vuex";
import { datasing } from "./dataqualificationExamination";
// import { getList } from "@/api/qualificationExamination/qualificationExamination";
import Qs from "qs";
import { getToken } from "@/util/auth";
import { getLisperexamScore } from "@/api/qualificationExamination/scoreInquiry";
export default {
  data() {
    return {
@@ -53,6 +66,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      selectionList: [],
      option: {
@@ -72,21 +86,22 @@
        index: true,
        viewBtn: true,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        column: [
          {
            label: "姓名",
            prop: "securityName",
            searchSpan: 4,
            width: 70,
            searchSpan: 3,
            search: true,
          },
          {
            label: "考试名称",
            prop: "examName",
            search:true,
            searchSpan:6,
            // slot: true,
            // display: false,
            search: true,
            searchSpan: 5,
            minWidth: 150,
          },
          {
            // label: "考试开始时间",
@@ -96,7 +111,8 @@
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            labelWidth: 120,
            // width: 140,
            overHidden: true,
            rules: [
              {
@@ -105,11 +121,6 @@
                trigger: "click",
              },
            ],
            // slot: true,
            // display: false,
            // formatter: function (row, value) {
            //   return (value = value + "%");
            // },
          },
          // {
          //   label: "考试结束时间",
@@ -134,69 +145,87 @@
          //   //   return (value = value + "万元");
          //   // },
          // },
          // {
          //   label: "考试类型",
          //   prop: "examinationaddress",
          //   // slot: true,
          //   // display: false,
          // },
          {
            label: "理论成绩",
            prop: "theoryGrade",
            width: 85,
            // slot: true,
            // display: false,
          },
          {
            label: "实操成绩",
            prop: "learnGrade",
            width: 85,
            // slot: true,
            // display: false,
          },
          {
            label: "总成绩",
            prop: "allGrade",
            width: 75,
            // slot: true,
            // display: false,
          },
          {
            label: "考试时间",
            prop: "releaseTimeRange",
            type: "date",
            format: "yyyy-MM-dd",
            valueFormat: "yyyy-MM-dd",
            searchValue: [this.getStartTime(), this.getEndTime()],
            searchRange: true,
            searchSpan: 6,
            searchLabelWidth: 80,
            hide: true,
            addDisplay: false,
            editDisplay: false,
            viewDisplay: false,
            search: true,
            rules: [
              {
                required: true,
                message: "请输入时间",
                trigger: "blur",
              },
            ],
          },
          {
            label: "是否合格",
            prop: "qualified",
            searchSpan: 4,
            searchSpan: 3,
            search: true,
            type:"select",
            dicData:[
            type: "select",
            dicData: [
              {
                label:"合格",
                value: 0
                label: "合格",
                value: 0,
              },
              {
                label:"不合格",
                value: 1
                label: "不合格",
                value: 1,
              },
              {
                label:"实操成绩暂未录入",
                value: 3
                label: "实操成绩暂未录入",
                value: 2,
              },
            ]
            // slot: true,
            // display: false,
              {
                label: "缺考,成绩无效",
                value: 3,
              },
            ],
          },
          {
            label: "是否发证",
            prop: "isFazheng",
            width: 90,
          },
        ],
      },
      data: [
        // {
        //   deptid: "江西众泰保安公司",
        //   punishtype: 2,
        //   punishreason: "非法施工",
        //   punishresult: "没收全部非法所得财产,并罚款3W元",
        //   punishtime: "2021-01-01",
        //   punisnum: 110110110120,
        // },
      ],
      data: [],
    };
  },
  computed: {
    ...mapGetters(["permission"]),
    ...mapGetters(["permission", "userInfo"]),
    permissionList() {
      return {
        addBtn: this.vaildData(this.permission.post_add, false),
@@ -213,70 +242,64 @@
      return ids.join(",");
    },
  },
  mounted() {
    this.$store.commit("setWindowSizeHeightAdd");
  },
  methods: {
    rowSave(row, done, loading) {
      adddata(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowUpdates(row, index, done, loading) {
      // console.log(42342);
      update(row).then(
        () => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
          done();
        },
        (error) => {
          window.console.log(error);
          loading();
        }
      );
    },
    rowDel(row) {
      this.$confirm("确定将选择数据删除?", {
    //导出
    handleExport() {
      this.$confirm("是否导出成绩信息?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          return remove(row.id);
          //获取查询条件
          var data = {
            startTime: this.query.startTime,
            endTime: this.query.endTime,
            qualified: this.query.qualified,
            examName: this.query.examName,
            securityName: this.query.securityName,
            jurisdiction: this.userInfo.jurisdiction,
          };
          //导出
          //序列号url形式,用&拼接
          data = Qs.stringify(data);
          window.open(
            `/api/examScore/export-examScore?${
              this.website.tokenHeader
            }=${getToken()}&` + data
          );
        })
        .then(() => {
          this.onLoad(this.page);
          this.$message({
            type: "success",
            message: "操作成功!",
          });
        });
    },
    // beforeOpen(done, type) {
    //   if (["edit", "view"].includes(type)) {
    //     getDetail(this.form.id).then((res) => {
    //       this.form = res.data.data;
    //     });
    //   }
    //   done();
    // },
    getStartTime() {
      if (
        this.$route.query.startTime != undefined &&
        this.$route.query.startTime != null &&
        this.$route.query.startTime != ""
      ) {
        return this.$route.query.startTime;
      }
      return "";
    },
    getEndTime() {
      if (
        this.$route.query.endTime != undefined &&
        this.$route.query.endTime != null &&
        this.$route.query.endTime != ""
      ) {
        return this.$route.query.endTime;
      }
      return "";
    },
    searchReset() {
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      params["startTime"] = params.releaseTimeRange[0];
      params["endTime"] = params.releaseTimeRange[1];
      this.query = params;
      this.page.currentPage = 1;
      this.onLoad(this.page, params);
@@ -299,7 +322,6 @@
      this.onLoad(this.page, this.query);
    },
    onLoad(page, params = {}) {
      // this.loading = false;
      this.loading = true;
      getLisperexamScore(
        page.currentPage,
@@ -309,69 +331,24 @@
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        for (var k in this.data) {
          if (this.data[k].qualified == 0) {
            this.data[k]["isFazheng"] = "已发证";
          } else {
            this.data[k]["isFazheng"] = "未发证";
          }
          for (var m in this.data[k]) {
            if (this.data[k][m] == -1) {
              this.data[k][m] = "";
            }
          }
        }
        this.$store.commit("setWindowSizeHeightAdd");
        this.loading = false;
        // for (var k in d) {
        //   if (d[k].qualified == 0) {
        //     d[k].qualified = "通过";
        //   } else if (d[k].qualified == 1) {
        //     d[k].qualified = "不通过";
        //   } else if (d[k].qualified == 2) {
        //     d[k].qualified = "暂未录入实操成绩";
        //   }
        // }
        // this.data = d;
        // console.log(this.data);
        // this.selectionClear();
      });
    },
    // onLoad(page, params = {}) {
    //   // this.loading = false;
    //   this.loading = true;
    //   //   getListJSON().then((res) => {
    //   //   axios
    //   //     .get(
    //   //       "../../api/qualificationExamination/signQualificationExamination.json"
    //   //     )
    //   //     .then((res) => {
    //   // page.currentPage,
    //   // page.pageSize,
    //   // Object.assign(params, this.query)
    //   if (datasing) {
    //     var res = datasing;
    //     console.log(res, "signQualificationExamination");
    //     const data = res.data;
    //     // this.page.total = data.total;
    //     var d = data.records;
    //     for (var k in d) {
    //       d[k].examination_mx = "正常";
    //       d[k].examination_type = "正常";
    //       d[k]["carid"] = "370111198807051124";
    //       d[k]["certificate"] = "拥有";
    //       d[k]["reviewTime"] = "2021-02-21";
    //       d[k]["results"] = "通过";
    //       d[k]["onjob"] = "是";
    //     }
    //     this.data = d;
    //     this.loading = false;
    //   }
    //   // this.selectionClear();
    //   // });
    // },
    // 行单击
    // handleRowClick(row) {
    //   // delete (row["name"]);
    //   var obj = row;
    //   obj["name"] = "保安公司详细资料";
    //   this.$router.push({
    //     path: `/securityCompany/index`,
    //     query: obj,
    //   });
    // },
  },
};
</script>
<style>
</style>
<style></style>