<template>
  <div class="tableBox">
    <el-table
      border
      stripe
      :data="OrderStatistics"
      :row-class-name="totalRowClassName">
      <el-table-column
        label="今日门票销售数据"
        label-class-name="table_title"
      >
        <el-table-column
          prop="ota_name"
          label="销售渠道">
        </el-table-column>
        <el-table-column
          prop="actual_count"
          label="张数">
        </el-table-column>
        <el-table-column
          prop="actual_people"
          label="人数">
        </el-table-column>
        <el-table-column
          prop="actual_multi_people"
          label="售票总人次">
        </el-table-column>
        <el-table-column
          prop="actual_price"
          label="金额">
        </el-table-column>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import moment from 'moment'
import { totalRowClassName } from '@/utils'
import { getOrderStatisticsBySaleChannel } from '@/api/order.js'

export default {
  data () {
    return {
      totalRowClassName,
      OrderStatistics: [], // 按售票渠道今日门票销售数据
      startDate: new Date(moment().startOf('day').format('YYYY-MM-DD HH:mm:ss')),
      endDate: new Date(moment().endOf('day').format('YYYY-MM-DD HH:mm:ss'))
    }
  },
  created () {
    this.getOrderStatisticsBySaleChannel()
  },
  methods: {
    getOrderStatisticsBySaleChannel () {
      getOrderStatisticsBySaleChannel({
        startDate: this.startDate,
        endDate: this.endDate
      }).then(res => {
        this.OrderStatistics = res.data
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
