<template>

  <div v-loading="loading">
    <div class="white-box">
      <leo-filter :filter="handleFilter" :dateRangePickerDisplay="false" :dateMonthPickerDisplay="true"></leo-filter>
      <el-table class="withdraw-table" :data="tableData" stripe style="width: 100%;">
        <el-table-column label="结算月份" prop="CALC_MONTH">
        </el-table-column>
        <el-table-column label="基础积分" prop="BASE_SCORE">
        </el-table-column>
        <el-table-column label="级别积分" prop="LEVEL_SCORE">
        </el-table-column>
        <el-table-column label="升级积分" prop="UPGRADE_SCORE">
        </el-table-column>
        <el-table-column label="总积分" prop="TOTAL_SCORE">
        </el-table-column>

        <el-table-column label="创建时间">
          <template slot-scope="scope">
            {{tool.formatDate(scope.row.CREATED_AT)}}
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>

  import network from '@/utils/network'
  import tool from '@/utils/tool'
  import LeoFilter from '@/components/Filter'
  import Pagination from '@/components/Pagination'
  export default {
    name: "fc-point",
    components: {LeoFilter, Pagination},
    mounted() {
      this.getData();
    },

    data() {
      return {
        loading: false,
        form:{

        },
        tableData:null,
        list: null,
        currentPage: 1,
        totalPages: 1,
        totalCount: 1,
        pageSize: 20,
        tool: tool,
        filterData: null,
        message:'',
        submitButtonStat: false,
        id:'',
      }
    },
    methods:{
      handleCurrentChange (page) {
        this.getData(page, this.pageSize)
      },
      handleSizeChange (pageSize) {
        this.getData(this.currentPage, pageSize)
      },
      getData (page, pageSize) {
        network.getPageData(this, '/bonus/fc-point', page, pageSize, this.filterData, function (response) {
          this.loading = false;
          this.list = response.list;
          let settingObj=this.list;
          let settingArr = Object.keys(settingObj).map(key => {
            //console.log(key); //为每个键名
            return settingObj[key];  //把每个对象返回出去生成一个新的数组中相当于0:{id:1}
          });
          this.tableData=settingArr;

          console.log(this.tableData)

        });
      },
      handleFilter(model) {
        this.filterData = model
        this.getData(1, this.pageSize)
      },
    }
  }
</script>

<style scoped>

</style>
