保安服务企业管理-验收版本
shuishen
2021-12-04 ecb9547b49041a67dc85a884eccf8612fade717e
src/views/securityAnalysis/child/examination.vue
@@ -1,123 +1,121 @@
<template>
  <div class="certificateTJ">
    <avue-crud
      :option="option1"
      :data="data1"
      :page.sync="page1"
      :table-loading="loading1"
      @on-load="getPractitionersPageInfo"
      @search-change="searchChange"
      @search-reset="searchReset"
      @refresh-change="refreshChange"
    >
    </avue-crud>
  </div>
    <div class="certificateTJ">
        <avue-crud :option="option1"
                   :data="data1"
                   :page.sync="page1"
                   :table-loading="loading1"
                   @on-load="getPractitionersPageInfo"
                   @search-change="searchChange"
                   @search-reset="searchReset"
                   @refresh-change="refreshChange">
        </avue-crud>
    </div>
</template>
<script>
import {
  getinformationstatisticsXX, //保安员考试情况详情统计
    getinformationstatisticsXX, //保安员考试情况详情统计
} from "@/api/securityAnalysis/securityAnalysis";
export default {
  props: ["card"],
  data() {
    return {
      securityid1: "",
      ExperienceVisible: false,
      loading1: true,
      page1: {
        pageSize: 10,
        currentPage: 1,
        total: 0,
      },
      query1: {},
      data1: [],
      option1: {
        addBtn: false,
        searchShowBtn: false,
        columnBtn: false,
        // refreshBtn: false,
        // card: true,
        menu: false,
        height: 450,
        widtd: "auto",
        // calcHeight: 54,
        border: true, //liu
        stripe: true,
        // tip: false,
        index: true,
        // dialogClickModal: false,
        // headerAlign: "center",
        align: "center",
        column: [
          {
            label: "姓名",
            prop: "realName",
            disabled: true,
            search: true,
          },
          {
            label: "考试场次",
            prop: "examName",
            disabled: true,
          },
          {
            label: "考试时间",
            prop: "examTime",
            disabled: true,
          },
          {
            label: "考试分数",
            prop: "allGrade",
            disabled: true,
          },
        ],
      },
    };
  },
  methods: {
    getPractitionersPageInfo(page, params = {}) {
      // this.data1 = this.czdata;
      // console.log(page);
      params = {
        ...params,
        ...this.card,
      };
      getinformationstatisticsXX(page.currentPage, page.pageSize, params).then(
        (res) => {
          // console.log(res.data.data.records);
          const data = res.data.data;
          this.data1 = data.records;
          this.page1.total = data.total;
          this.loading1 = false;
        }
      );
    props: ["card"],
    data () {
        return {
            securityid1: "",
            ExperienceVisible: false,
            loading1: true,
            page1: {
                pageSize: 10,
                currentPage: 1,
                total: 0,
            },
            query1: {},
            data1: [],
            option1: {
                addBtn: false,
                searchShowBtn: false,
                columnBtn: false,
                // refreshBtn: false,
                // card: true,
                menu: false,
                height: 450,
                widtd: "auto",
                // calcHeight: 54,
                border: true, //liu
                stripe: true,
                // tip: false,
                index: true,
                // dialogClickModal: false,
                // headerAlign: "center",
                align: "center",
                column: [
                    {
                        label: "姓名",
                        prop: "realName",
                        disabled: true,
                        search: true,
                    },
                    {
                        label: "考试场次",
                        prop: "examName",
                        disabled: true,
                    },
                    {
                        label: "考试时间",
                        prop: "examTime",
                        disabled: true,
                    },
                    {
                        label: "考试分数",
                        prop: "allGrade",
                        disabled: true,
                    },
                ],
            },
        };
    },
    refreshChange() {
      this.getPractitionersPageInfo(this.page1);
    methods: {
        getPractitionersPageInfo (page, params = {}) {
            // this.data1 = this.czdata;
            // console.log(page);
            params = {
                ...params,
                ...this.card,
            };
            getinformationstatisticsXX(page.currentPage, page.pageSize, params).then(
                (res) => {
                    // console.log(res.data.data.records);
                    const data = res.data.data;
                    this.data1 = data.records;
                    this.page1.total = data.total;
                    this.loading1 = false;
                }
            );
        },
        refreshChange () {
            this.getPractitionersPageInfo(this.page1);
        },
        searchChange (params, done) {
            if (params.czname == undefined) {
                this.data1 = this.czdata;
                done();
                return;
            }
            var text = new RegExp(params.czname, "g"),
                d = [];
            for (let k in this.czdata) {
                if (text.test(this.czdata[k].czname)) {
                    d.push(this.czdata[k]);
                }
            }
            this.data1 = d;
            done();
        },
        searchReset (done) {
            this.data1 = this.czdata;
        },
    },
    searchChange(params, done) {
      if (params.czname == undefined) {
        this.data1 = this.czdata;
        done();
        return;
      }
      var text = new RegExp(params.czname, "g"),
        d = [];
      for (let k in this.czdata) {
        if (text.test(this.czdata[k].czname)) {
          d.push(this.czdata[k]);
        }
      }
      this.data1 = d;
      done();
    },
    searchReset(done) {
      this.data1 = this.czdata;
    },
  },
};
</script>
<style scoped>
</style>
</style>