<template>
  <el-dialog
    title="提示"
    v-model="hidden"
    width="80%"
    :before-close="handleClose"
  >
    <el-table :data="gridData">
      <el-table-column property="date" label="审核时间"></el-table-column>
      <el-table-column property="name" label="审核人"></el-table-column>
      <el-table-column property="address" label="审核结果"></el-table-column>
      <el-table-column property="address" label="失败原因" width="200">
        <template class=""> </template>
      </el-table-column>
      <el-table-column property="address" label="操作">
        <template>
          <el-button
            @click="goDetail(scope.row)"
            class="c0D9078"
            type="text"
            size="small"
            >查看详情</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <div class="pagination">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleNumChange"
        :current-page="pageNo"
        :page-sizes="[10, 30, 50, 100]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
      ></el-pagination>
    </div>
  </el-dialog>
</template>

<script>
import { $on, $off, $once, $emit } from '../../../../utils/gogocodeTransfer'
import { getCertifyHistory } from '@/utils/qualification'
export default {
  props: {
    hidden: {
      type: Boolean,
      default: () => {
        return false
      },
    },
    id: {
      type: Number,
      default: () => {
        return 0
      },
    },
  },
  data() {
    return {
      pageNo: 0,
      pageSize: 10,
      total: 100,
      gridData: [],
    }
  },
  created() {},
  methods: {
    init() {
      const params = {
        certificateInfoId: this.id,
        pageNo: this.pageNo,
        pageSize: this.pageSize,
      }
      getCertifyHistory(params).then((res) => {
        this.gridData = res.data.contentList
      })
    },
    handleSizeChange(value) {
      this.pageSize = value
      this.init()
    },
    handleNumChange(value) {
      this.pageNo = value
    },
    goDetail() {},
    show() {},
    handleClose() {
      this.pageSize = 10
      this.pageNo = 1
      this.gridData = []
      $emit(this, 'close')
    },
  },
  emits: ['close'],
}
</script>
