<template>
  <div>
    <tableLayout :layout="tablecols" :data="list" :opwidth="200"  :custom="true" :width="false"  :height="tableHieght" fixedName="operation">
      <template v-slot:customcol="scope">
        <p >{{scope.column.data[scope.column.columnname]}}</p>
      </template>
      <template v-slot:opreation="scope">
      </template>
    </tableLayout>
    <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 {
  name: "payDetails",
  data(){
    return {
      tableHieght:"600px",
      tablecols:[],
      list:[],
      total:0,
      currentPage:0,
      param:{
        "id": 20230216195002,
        "content": {
          "sa_cashbillid": this.$route.query.id,
          "pageNumber": 1,
          "pageSize": 20,
          "where": {
            "condition": ""
          }
        }
      }
    }
  },
  methods:{
    async listData(){
      this.param.content.sa_cashbillid = this.$route.query.id
      const res = await this.$api.requested(this.param)
      this.list = res.data
      this.total = res.tatal
      this.currentPage = res.pageNumber
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
      this.param.content.pageSize = val
      this.listData()
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.param.content.pageNumber = val
      this.listData()
    },
  },
  created() {
    this.listData()
    this.tablecols = this.tool.tabelCol(this.$route.name).payDetailsTable.tablecols
  }

}
</script>

<style scoped>

</style>