<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="asnNo"></table-column>
    <table-column label="物流单号" prop="logisticNo" ></table-column>
    <table-column label="状态" prop="status">
      <template slot-scope="scope">
        {{$utils.keyMatcher(scope.row.status, $keys.stockIn.status).name}}
      </template>
    </table-column>
    <table-column label="入库单类型" prop="asnType">
      <template slot-scope="scope">
        {{$utils.keyMatcher(scope.row.asnType, $keys.stockIn.asnType).name}}
      </template>
    </table-column>
    <table-column label="订单时间" prop="orderTime"></table-column>
    <table-column label="预计到货时间" prop="eta"></table-column>
    <table-column label="货主" prop="ebcuNameCn"></table-column>
    <table-column label="入库单行号" prop="lineNo"></table-column>
    <table-column label="入库单明细状态" prop="detailStatus">
      <template slot-scope="scope">
        {{$utils.keyMatcher(scope.row.detailStatus, $keys.summaryReport.noRcvAsn.detailStatus).name}}
      </template>
    </table-column>
    <table-column label="商品" prop="skuName"></table-column>
    <table-column label="包装规格" prop="cdpaFormat"></table-column>
    <table-column label="包装单位" prop="cdprDesc"></table-column>
    <table-column label="预收数" prop="qtyAsnEa"></table-column>
    <table-column label="已收数" prop="qtyRcvEa"></table-column>
    <table-column label="差异件数" prop="difference"></table-column>
    <table-column label="预收重量(吨)" prop="asnWeight"></table-column>
    <table-column label="已收重量(吨)" prop="rcvWeight"></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: 'noRcvAsn',
    }
  },
  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>
