<template>
  <div>
    <el-row :gutter="10">
      <el-col :span="setcol">
      <div class="flex-align-center">
      </div>
    <el-table
      ref="multipleTable"
      :data="tableData"
      height="500px"
      style="width: 100%;"
      size="small"
      stripe
      border>
      <!-- <el-table-column
        type="selection"
        width="55"
        align="center">
      </el-table-column> -->
      <el-table-column
        prop="erpbillno"
        label="erp单号">
      </el-table-column>
      <el-table-column
        prop="request"
        width="100px"
        label="推送人">
      </el-table-column>
      <el-table-column
        prop="createdate"
        fixed
        label="推送时间">
      </el-table-column>
       <el-table-column
        prop="status"
        label="返回状态">
      </el-table-column>
      <el-table-column
        prop="errmsg"
        label="错误信息">
      </el-table-column>
      <el-table-column
        prop="type"
        label="类型">
      </el-table-column>
    </el-table>
    <div style="margin-top:16px;text-align:right">
      <el-pagination
        background
        small
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-size="param.content.pageSize"
        layout="total, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props:['data'],
  components:{},
  data () {
    return {
      tableData:[],
      drawer:false,
      setcol:24,
      param:{
        "id": 20230228133403,
        "content": {
          "pageNumber": 1,
          "pageSize": 20,
          "where": {
              "condition": ""
          }
        },
      },
      total:0,
      currentPage:0,
      time: null
    }
  },
  methods:{
    async listData () {
      this.param.content.sa_dispatchid = this.$route.query.id
      const res = await this.$api.requested(this.param)
      this.tableData = res.data
      this.total = res.total
      this.currentPage = res.pageNumber
      console.log(res.data);
      
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
      this.params.content.pageSize = val
      this.listData()
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.params.content.pageNumber = val
      this.listData()
    },
  },
  mounted () {
    this.listData()
  }
}

</script>
<style>
</style>