<template>
  <div class="tableBox">

    <el-table
      ref="multipleTable" v-loading="loading" :data="tableData" border
      :header-cell-style="{ background: '#EEF3FF', color: '#333333' }" tooltip-effect="dark" style="width: 100%"
    >
      <!-- <el-table-column label="订单id" width="220">
        <template slot-scope="scope">{{ scope.row.orderId }}</template>
        </el-table-column> -->
      <el-table-column prop="id" label="ID" width="220" />
      <el-table-column prop="holdId" label="商户ID" show-overflow-tooltip />
      <el-table-column prop="holdId" label="代金卷ID" show-overflow-tooltip />
      <el-table-column prop="number" label="数量" show-overflow-tooltip />
      <el-table-column prop="orderSn" label="订单号" show-overflow-tooltip />
      <el-table-column prop="createTime" label="下单时间" show-overflow-tooltip />
    </el-table>
    <div class="fenye" style="margin-top: 10px;">
      <el-pagination
        :current-page="queruList.page" :page-sizes="[9, 20, 50, 100]" :page-size="9"
        layout="total, sizes, prev, pager, next, jumper" :total="total" @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </div>
  </div>
</template>

<script>
import { getAllVoucher } from '@/api/volumeManagement'
export default {
  // eslint-disable-next-line vue/match-component-file-name
  name: 'VoucherTable',
  data() {
    return {
      loading: false,
      tableData: [],
      queruList: {
        pageSize: 9,
        page: 1
      },
      total: 0
    }
  },
  created() {
    this.getDataList()
  },
  methods: {
    getDataList() {
      getAllVoucher(this.queruList).then((res) => {
        this.tableData = res.data.list
        this.total = res.data.total
      })
    },
    handleSizeChange(value) {
      this.queruList.pageSize = value
      this.getDataList()
    },
    handleCurrentChange(value) {
      this.queruList.page = value
      this.getDataList()
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
