<template>
  <div id="claimList">
    <el-row>
      <el-col :span="24">
        <el-table ref="debtTable" :data="debtTable" style="width: 100%" border>
          <el-table-column type="index" label="序号" width="50" align="center"> </el-table-column>
          <el-table-column property="name" label="经理名称" align="center"> </el-table-column>
          <el-table-column fixed="right" label="操作" align="center">
            <template slot-scope="scope">
              <el-tooltip class="item" effect="dark" content="密码重置" placement="bottom">
                <el-button @click="clickRest(scope.row.id)" type="text"><i class="el-icon-refresh"></i></el-button>
              </el-tooltip>
              <el-button @click="$router.push({ path: '/otheruser/detail', query: { id: scope.row.id } })" type="text"
              ><i class="el-icon-edit"></i
              ></el-button>
              <el-button class="delete" @click.prevent="deleteRow(scope.row.id)" type="text"><i class="el-icon-delete"></i></el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-row class="page">
          <el-pagination
                  @size-change="handleSizeChange"
                  @current-change="handleCurrentChange"
                  :current-page="currentPage"
                  :page-size="10"
                  layout="total, prev, pager, next, jumper"
                  :total="total"
          >
          </el-pagination>
        </el-row>
      </el-col>
    </el-row>
  </div>
</template>

<script>
  export default {
    name: 'claimList',
    props: {
      debtTable: null,
      total: null,
    },
    components: {},
    data: () => ({
      currentPage: 1,
    }),
    created() {},
    computed: {},
    methods: {
      deleteRow(id) {
        this.$emit('deleteRow', id);
      },
      clickRest(id) {
        this.$emit('clickRest', id);
      },
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
      },
      handleCurrentChange(currentPage) {
        this.$emit('pagechange', { skip: (currentPage - 1) * this.pageSize, limit: this.pageSize, currentPage });
      },
      ljdelete(val) {
        this.$emit('ljdelete', { delid: val });
      },
    },
  };
</script>

<style lang="less" scoped>
  .page {
    text-align: center;
    padding: 15px 0;
  }
</style>
