<template>
    <div style="margin-bottom: 20px">
      <el-table v-loading="loading" :data="recordList">
        <el-table-column label="操作人" align="center" prop="createBy" />
        <el-table-column label="数量" align="center" prop="number" />
        <el-table-column label="操作时间" align="center" prop="createTime" />
      </el-table>

      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
    </div>
</template>

<script>
  import { listLog } from "@/api/track/storeLog.js";
  export default {
    name: "record-info",
    props:{
      tab: {
        type: String,
        default: "import"
      },
      id: {
        type: Number
      }
    },
    data(){
        return{
          loading: false,
          recordList: [],
          total: 0,
          queryParams:{
            pageNum: 1,
            pageSize: 10,
            storeId: null
          }
        }
    },
    created(){
      this.queryParams.storeId = this.id;
      this.getList();
    },
    methods:{
      getList(){
        if(this.tab == 'import'){
          this.getImportRecord();
        }else{

        }

      },
      //入库信息
      getImportRecord(){
        this.loading = true;
        listLog(this.queryParams).then(res =>{
          this.loading = false;
          if(res.code == 200){
              this.total = res.total;
              this.recordList = res.rows;
          }
        })
      },
      //出库记录
      getExportRecord(){

      }
    }
  }
</script>

<style scoped>

</style>
