<template>
  <div id="intelligentDockingFinish">
    <el-row>
      <el-col :span="24">
        <el-col :span="24">
          <topInfo :topTitle="topTitle" :display="display"></topInfo>
        </el-col>
        <el-col :span="24">
          <intelligentDockingFinishList :debtTable="debtTable" :total="total" @pagechange="pagechange"></intelligentDockingFinishList>
        </el-col>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import topInfo from '@/layout/common/topInfo.vue';
import intelligentDockingFinishList from '@/layout/intelligentDocking/intelligentDockingFinishList.vue';
import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
const { mapActions: intelligentFollow } = createNamespacedHelpers('intelligentFollow');
export default {
  name: 'intelligentDockingFinish',
  props: {},
  components: {
    topInfo, //头部
    intelligentDockingFinishList, //列表
  },
  data: () => ({
    topTitle: '银企对接已完成列表',
    display: 'none',
    debtTable: [],
    total: 0,
  }),
  created() {
    this.searchInfo();
  },
  computed: {
    ...mapState(['user']),
  },
  methods: {
    ...intelligentFollow(['getFinishList']),
    async searchInfo({ skip = 1, limit = 10, uid = this.user.uid, userid = this.user.userid } = {}) {
      const res = await this.getFinishList({ skip, limit, uid, userid });
      this.$set(this, `debtTable`, res.data.res);
      this.$set(this, `total`, res.data.total);
    },
    // 分頁
    // 分頁
    async pagechange(data) {
      var skip = data.skip;
      var limit = 10;
      var uid = this.user.uid;
      var userid = this.user.userid;
      const res = await this.getFollowList({ skip, limit, uid, userid });
      this.$set(this, `debtTable`, res.data.res);
      this.$set(this, `total`, res.data.total);
    },
  },
};
</script>

<style lang="less" scoped></style>
