<template>
  <div class="page-byh-service">
    <block-header title="复审列表"></block-header>
    <div class="block-box">
      <el-table
          border
          size="mini"
          :highlight-current-row="true"
          :header-row-class-name="headerStyle"
          :data="data" stripe style="width: 100%;">
        <el-table-column align="center" type="index" label="#"></el-table-column>
        <el-table-column align="center" prop="id" label="id"></el-table-column>
        <el-table-column align="center" prop="clientName" label="姓名"></el-table-column>
        <el-table-column align="center" prop="clientCell" label="手机号" ></el-table-column>
        <el-table-column align="center" prop="withdrawalDate" label="提现时间"></el-table-column>
        <el-table-column align="center" label="操作">
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="handleClick(scope.row)">待查询确认</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>


    <div class="pages">
      <el-pagination
          background
          @current-change="handleCurrentChange"
          @size-change="handleSizeChange"
          :current-page.sync="form.current"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="form.size"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
      >
      </el-pagination>
    </div>


    <!-- 生成协议弹框 -->
    <template v-if="SignVisible">
      <CreateCredit
          :user-info="item"
          :dialog-visible="SignVisible"
          @handleCallback="init"
          @handleClose="SignVisible = false"/>
    </template>

  </div>
</template>

<script>


import CreateCredit from "@/views/recheck/com/CreateCredit";

export default {
  name: "ReCheck",
  components: {
    CreateCredit
  },
  data() {
    return {
      data: null,
      total:0,

      form: {
        current: 1,
        size: 50
      },


      SignVisible: false,
      item: null,

    }
  },
  async created() {

    await this.init()
  },

  methods: {
    /** 表格样式 */
    headerStyle() {
      return "tableHeaderStyle";
    },

    /** 初始化订单列表 **/
    async init() {
      try {
        const form = this.form
        const res = await this.$$post('/retrial/selectRetrialList', {...form})
        if (res.status === 200 && res.data.success) {
          const {data,total} = res.data.result;
          this.data = data;
          this.total = total
        } else {
          this.$message.error(res.data.message);
        }
      } catch (err) {
        this.$Message.error(err || '系统异常');
        console.log(err, '初始化协议列表错误')
      }
    },


    handleCurrentChange(e) {
      this.form.current = e;
      this.init();
    },
    handleSizeChange(e) {
      this.form.size = e;
      this.form.current = 1;
      this.init();
    },

    // 切换选项卡
    handleClick(row) {
      this.SignVisible = true;1
      this.item = row;
    }
  }
}


</script>

<style scoped>
.link-active, .link-null {
  text-decoration: none;
}

.link-active {
  color: #155bd4;
}

ul, li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-table {
  margin-bottom: 20px;
}

.pages {
  display: flex;
  align-items: center;
  justify-content: center;
}

</style>
