<template>
  <el-card>
      <el-date-picker
      v-model="searchDate"
      type="month"
      value-format="yyyy-MM"
      placeholder="选择月">
    </el-date-picker>
      <el-button type="primary" class="filter-item" icon="el-icon-search" @click="btn_search">搜索</el-button>
    <el-table :data="tableData" border max-height="600" style="width: 100%">
      <el-table-column prop="time" label="日期" align="center"></el-table-column>
      <el-table-column prop="name" label="销售人员" align="center"></el-table-column>
      <el-table-column prop="total" label="发货总数" align="center"></el-table-column>
      <el-table-column prop="problem" label="产品问题" align="center"></el-table-column>
      <el-table-column prop="warehousehair" label="仓库错发漏发" align="center"></el-table-column>
      <el-table-column prop="Saleserror" label="销售错发漏发" align="center"></el-table-column>
      <el-table-column prop="refund" label="退款单数" align="center"></el-table-column>
      <el-table-column prop="refundamount" label="退款总金额" align="center"></el-table-column>
      <el-table-column prop="Totalaftersales" label="售后总计" align="center"></el-table-column>
      <el-table-column prop="delivergoods" label="月总发货数" align="center"></el-table-column>
      <el-table-column prop="exchange" label="调换占总发货比例" align="center"></el-table-column>
    </el-table>
    <div class="content">{{content}}</div>
  </el-card>
</template>
<script>
import { getAfterMarketData } from "@/api/reportFormManagement/reportFormManagement";
export default {
  data() {
    return {
        searchDate:'',
      tableData: [],
      content: "",
    };
  },
  created() {
    this.getList();
  },
  methods: {
    getList() {
      const params = {
          month:this.searchDate
      };
      getAfterMarketData(params).then((response) => {
        if (response.state == "success") {
          this.tableData = response.aftersaleInputs;
          this.content = response.msg
        }
      });
    },
    btn_search(){
        this.getList()
    }
  },
};
</script>
<style lang="scss" scoped>
.content{
    margin-top: 20px;
    text-align: center;
}
</style>