<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="cdwhName"></table-column>
    <table-column label="批次号" prop="lotNum"></table-column>
    <table-column label="数量" prop="invQty"></table-column>
    <table-column label="重量(吨)" prop="invWeight"></table-column>
    <table-column label="生产日期" prop="lotAtt01" ></table-column>
    <table-column label="失效日期" prop="lotAtt02" ></table-column>
    <table-column label="入库日期" prop="lotAtt03" ></table-column>
    <table-column label="品质" prop="lotAtt04">
      <template slot-scope="scope">
        {{$utils.keyMatcher(scope.row.lotAtt04, $keys.common.lotAtt04).name}}
      </template>
    </table-column>
    <table-column label="批次属性05" prop="lotAtt05" ></table-column>
    <table-column label="批次属性06" prop="lotAtt06" ></table-column>
    <table-column label="批次属性07" prop="lotAtt07" ></table-column>
    <table-column label="批次属性08" prop="lotAtt08" ></table-column>
    <table-column label="批次属性09" prop="lotAtt09" ></table-column>
    <table-column label="批次属性10" prop="lotAtt10" ></table-column>
    <table-column label="批次属性11" prop="lotAtt11" ></table-column>
    <table-column label="批次属性12" prop="lotAtt12" ></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: 'warehousesInventory',
    }
  },
  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>
