<template>
    <div>
        <div class="mrg-b">
          <!--<drop-filter :columns="wholeLabels" :storeKey="storeKey" :storeLabels="storeLables" @doFilter="labels => storeLables = labels"></drop-filter>-->
            <el-table
            ref="table"
            stripe
            border
            :max-height="tableMaxHeight"
            :data="tableData"
            :filteredLabels="storeLables"
            style="width: 100%">
            <table-column
                label="货主">
                <template slot-scope="scope">
                  <p>{{scope.row.ownerCode}}</p>
                  <p>{{scope.row.ownerName}}</p>
                </template>
            </table-column>
            <table-column
                label="商品">
                <template slot-scope="scope">
                  <p>{{scope.row.skuCode}}</p>
                  <p>{{scope.row.skuName}}</p>
                </template>
            </table-column>
            <table-column
                label="批次号"
                prop="lotNum">
            </table-column>
            <table-column
                label="数量"
                prop="invQty">
            </table-column>
            <table-column
                label="重量"
                prop="invWeight" :render-header="renderWeightHeader">
                <template slot-scope="scope">
                  {{scope.column.unit === 'KG' ? (+scope.row.invWeight * 1000).toFixed($consts.numFix.KG) : (+scope.row.invWeight).toFixed($consts.numFix.TON)}}
                </template>
            </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="品质">
                <template slot-scope="scope">
                  {{ $utils.keyMatcher(scope.row.lotAtt04, $keys.common.lotAtt04).name }}
                </template>
              </table-column>
            <table-column
                label="批次属性5"
                prop="lotAtt05">
            </table-column>
            <table-column
                label="批次属性6"
                prop="lotAtt06">
            </table-column>
            <table-column
                label="批次属性7"
                prop="lotAtt07">
            </table-column>
            <table-column
                label="批次属性8"
                prop="lotAtt08">
            </table-column>
            <table-column
                label="批次属性9"
                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>
            </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 {

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

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

    // 每页显示条数
    handleSizeChange (pageSize) {
      const query = { 'page.limitCount': pageSize, 'page.currentPage': this.currentPage }
      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>
