<template>
  <div class="SalesReport">
    <el-table
      :data="tableData"
      v-loading="loading"
      border
      stripe
      :max-height="maxHeight"
      :size="'mini'"
      style="width: 100%"
    >
      <el-table-column prop="p" label="业绩类型" fixed="left" width="81">
      </el-table-column>
      <el-table-column show-overflow-tooltip label="本日退款" width="120">
        <template slot-scope="scope">
          <span>{{ scope.row.thfee | toThousandFilter }}</span>
        </template>
      </el-table-column>
      <el-table-column show-overflow-tooltip label="本周退款" width="120">
        <template slot-scope="scope">
          <span>{{ scope.row.wthfee | toThousandFilter }}</span>
        </template>
      </el-table-column>
      <el-table-column show-overflow-tooltip label="本月退款" width="120">
        <template slot-scope="scope">
          <span>{{ scope.row.mthfee | toThousandFilter }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import asyncRequest from "@/api/index";
import setHeight from "@/mixins/index";
export default {
  name: "SalesReportM",
  mixins: [setHeight],
  data() {
    return {
      loading: false,
      maxHeight: "0",
      tableData: []
    };
  },
  async created() {
    window.onresize = () => {
      this.getHeight();
    };
  },
  mounted() {
    this.$nextTick(() => {
      this.getHeight();
    });
    this.searchList();
  },
  methods: {
    async searchList() {
      this.loading = true;
      this.tableData = [];
      const res = await asyncRequest.MReturn({});
      if (res.code === 0 && res.data && res.data.length > 0) {
        this.tableData = res.data;
      } else {
        this.tableData = [];
      }
      this.getHeight();
      this.loading = false;
    }
  }
};
</script>

<style lang="scss" scoped>
.SalesReport {
}
</style>
