<template>
    <div>
        <div class="mrg-b">
            <el-table
            ref="table"
            stripe
            border
            :max-height="tableMaxHeight"
            :data="tableData"
            style="width: 100%">
             <table-column
                label="仓库"
                prop="wareHouse">
            </table-column>
             <table-column
                label="区域"
                prop="areaName">
            </table-column>
             <table-column
                label="库区"
                prop="zoneName">
            </table-column>
             <table-column
                label="总库位数"
                prop="locCodeNum">
            </table-column>
            <table-column
                label="占用库位数"
                prop="locOccupyNum">
            </table-column>
            <table-column
                label="库位使用率"
                prop="locUsageRate">
            </table-column>
            </el-table>
            </div>
            <div>
            <el-pagination
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 50, 100]"
                :page-size="pageSize"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total">
            </el-pagination>
        </div>
    </div>
</template>
<script>
export default {
  data () {
    return {

    }
  },
  props: {
    tableData: {
      type: Array,
      default: () => []
    },
    total: Number,
    currentPage: Number,
    pageSize: Number,
  },
  methods: {

    // 当前页码
    handleCurrentChange (currentPage) {
      const query = { 'page.currentPage': currentPage, 'page.limitCount': this.pageSize }
      this.$emit('getList', query)
    },

    // 每页显示条数
    handleSizeChange (pageSize) {
      const query = { 'page.currentPage': this.currentPage, 'page.limitCount': pageSize }
      this.$emit('getList', query)
    },
  }
}
</script>
<style lang="scss" scoped>
    .mrg-b{
        margin-bottom: 20px;
    }
    .mrg-l{
        margin-left:10px;
    }
    .blue{
      cursor:pointer;
      color:#0682ea
    }
</style>
