<template>
<div class="list">
  <!--<drop-filter :columns="wholeLabels" :storeKey="storeKey" :storeLabels="storeLables" @doFilter="labels => storeLables = labels"></drop-filter>-->
  <el-table
    ref="table"
    stripe
    border
    :max-height="tableMaxHeight"
    :data="list"
    :filteredLabels="storeLables"
  >
    <!--<table-column type="selection" fixed align="center"></table-column>-->
    <table-column label="货主" prop="ownerName"></table-column>
    <table-column label="商品" prop="skuName"></table-column>
    <table-column label="批次号" prop="lotNum"></table-column>
    <table-column label="包装单位" prop="uom"></table-column>
    <table-column label="期初库存数" prop="qtyInvOpening" ></table-column>
    <table-column label="期初库存重量(吨)" prop="weightInvOpening" ></table-column>
    <table-column label="本期入库数" prop="qtyRcvCurrent" ></table-column>
    <table-column label="本期入库重量(吨)" prop="weightRcvCurrent" ></table-column>
    <table-column label="本期出库数" prop="qtySpCurrent" ></table-column>
    <table-column label="本期出库重量(吨)" prop="weightSpCurrent" ></table-column>
    <table-column label="本期调整增加数" prop="qtyAdInCurrent" ></table-column>
    <table-column label="本期调整增加重量(吨)" prop="weightAdInCurrent" ></table-column>
    <table-column label="本期调整减少数" prop="qtyAdOutCurrent" ></table-column>
    <table-column label="本期转移入重量(吨)" prop="weightAdOutCurrent" ></table-column>
    <table-column label="本期转入数" prop="qtyTfInCurrent" ></table-column>
    <table-column label="本期转入重量(吨)" prop="weightTfInCurrent" ></table-column>
    <table-column label="本期转出数" prop="qtyTfOutCurrent" ></table-column>
    <table-column label="本期转移出重量(吨)" prop="weightTfOutCurrent" ></table-column>
    <table-column label="期末库存数" prop="qtyInvEnding" ></table-column>
    <table-column label="期末库存重量(吨)" prop="weightInvEnding" ></table-column>
  </el-table>
  <el-pagination
    class="pagination"
    @size-change="sizeChange"
    @current-change="currentChange"
    :current-page="currentNo"
    :page-sizes="[10, 20, 30, 40, 50]"
    :page-size="pageSize"
    layout="total, sizes, prev, pager, next, jumper"
    :total="total"
  ></el-pagination>
</div>
</template>

<script>
export default {
  props: ['list', 'total', 'currentNo', 'pageSize'],
  created () {
  },
  mounted () {
  },

  data () {
    return {
      storeKey: 'combine',
    }
  },
  methods: {
    // 点击表格行
    // toCheck (row) {
    //   this.$refs.table.toggleRowSelection(row)
    // },
    // 页码变化
    currentChange (currentNo) {
      const query = { 'page.currentPage': currentNo, 'page.limitCount': this.pageSize }
      this.$emit('getList', query)
    },
    // 每页条数变化
    sizeChange (pageSize) {
      const query = { 'page.limitCount': pageSize, 'page.currentPage': this.currentNo }
      this.$emit('getList', query)
    },
    // 勾选变化
    // selectionChange (selection) {
    //   const selectedIds = selection.map(item => item.holdId).join(',')
    //   this.$emit('selectionChange', selectedIds)
    // },
  },
}
</script>

<style lang="scss" scoped>
.pagination {
  margin-top: 20px;
}
</style>
