<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="移动单号"
                prop="mvNo">
            </table-column>
             <table-column
                label="状态"
                prop="status">
                <template slot-scope="scope">
                  {{ $utils.keyMatcher(scope.row.status, $keys.storageTasks.mvOrder.status).name }}
                </template>
            </table-column>
             <table-column
                label="创建人"
                prop="creatorName">
            </table-column>
             <table-column
                label="创建时间"
                prop="createTime">
            </table-column>
            <table-column
                label="货主">
                <template slot-scope="scope">
                  <p>{{scope.row.ownerCode}}</p>
                  <p>{{scope.row.ownerName}}</p>
                </template>
            </table-column>
             <table-column
                label="移动原因"
                prop="reason">
                <template slot-scope="scope">
                  {{ $utils.keyMatcher(scope.row.reason, $keys.storageTasks.mvOrder.reason).name }}
                </template>
            </table-column>
             <table-column
                label="移动单行号"
                prop="lineNo">
            </table-column>
             <table-column
                label="移动单行状态"
                prop="detailStatus">
                <template slot-scope="scope">
                  {{ $utils.keyMatcher(scope.row.detailStatus, $keys.storageTasks.mvOrder.status).name }}
                </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="fmLoc">
            </table-column>
            <table-column
                label="源跟踪号"
                prop="fmId">
            </table-column>
            <table-column
                label="库存数"
                prop="fmQtyEa">
            </table-column>
            <table-column
                label="计划移动数EA"
                prop="qtyPlanMvEa">
            </table-column>
            <table-column
                label="已移动重量(吨)"
                prop="already_mv_weight">
            </table-column>
            <table-column
                label="计划移动重量(吨)"
                prop="plan_mv_weight">
            </table-column>
            <table-column
                label="已移动数"
                prop="mvNumber">
            </table-column>
            <table-column
                label="包装单位"
                prop="uom">
            </table-column>
            <table-column
                label="目标库位"
                prop="toLoc">
            </table-column>
            <table-column
                label="目标跟踪号"
                prop="toId">
            </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: 'mvOrder'
    }
  },
  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>
