<template>
  <div class="tableBox">
    <el-table
      border
      stripe
      :data="CheckStatistics"
      :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="count"
          label="张数">
        </el-table-column>
        <el-table-column
          prop="people_count"
          label="人数">
        </el-table-column>
        <el-table-column
          prop="sum_price"
          label="金额">
        </el-table-column>
      </el-table-column>
    </el-table>
  </div>
</template>

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

export default {
  data () {
    return {
      totalRowClassName,
      CheckStatistics: [], // 按售票渠道今日门票检票数据
      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.getCheckStatisticsByOtaName()
  },
  methods: {
    getCheckStatisticsByOtaName () {
      getCheckStatisticsByOtaName({
        startDate: this.startDate,
        endDate: this.endDate
      }).then(res => {
        this.CheckStatistics = res.data
        console.log('this.CheckStatistics', this.CheckStatistics)
      })
    }
  }
}
</script>

<style lang="scss" scoped>

</style>
