<template>
  <div>
    <el-table
      :data="tableData"
      style="width: 100%"
      size="small"
      border>
      <el-table-column
        prop="billno"
        label="物流单号"
        width="180">
        <template slot-scope="scope">
          <a class="table_row_link" @click="linkDetail(scope.row)">{{scope.row.billno}}</a>
        </template>
      </el-table-column>
      <el-table-column
        prop="status"
        label="状态"
        width="90">
      </el-table-column>
      <el-table-column
        prop="createdate"
        label="单据日期">
      </el-table-column>
      <el-table-column
        prop="address"
        label="备注">
      </el-table-column>
    </el-table>
    <div class="container normal-panel" style="text-align:right">
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[20, 50, 100, 200]"
        layout="total,sizes, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      tableData:[],
      param:{
        "id": 20221205111402,
        "content": {
          "sa_orderid": '',
          "pageNumber": 1,
          "pageSize": 17,
          "where": {
            "condition": ""
          }
        },
      },
      total:0,
      currentPage:0,
    }
  },
  methods:{
    async listData() {
      this.param.content.sa_orderid = this.$route.query.id
      const res = await this.$api.requested(this.param)
      this.tableData = res.data
      this.total = res.total
      this.currentPage = res.pageNumber
    },
    handleSizeChange(val) {
      this.param.pageSize = val
      this.listData()
    },
    handleCurrentChange(val) {
      this.param.pageNumber = val
      this.listData()
    },
    linkDetail (item) {
        let route = this.$route
        if (route.path !== '/taskDetails') {
          this.oldRoute = {path:route.path,query:route.query}
          this.$store.dispatch('setHistoryRouter',this.oldRoute)
        }
        this.$router.replace({path:'/logisticsdetail',query:{id:item.sa_logisticsid,rowindex:item.rowindex}})
      }
  },
  mounted () {
    this.listData()
  }
}

</script>
<style>
</style>