<template>
  <div class="form-wrap">
    <div class="page-title">搜索条件</div>
    <el-form
      ref="form"
      :model="form"
      :inline="true"
      label-width="70px">
      <el-form-item
        label="姓名"
        prop="account">
        <el-input v-model="form.account"></el-input>
      </el-form-item>
      <el-form-item
        label="客源地"
        prop="account">
        <el-input v-model="form.account"></el-input>
      </el-form-item>
      <el-form-item
        label="性别"
        prop="keyWords2">
        <el-select v-model="form.keyWords2">
          <el-option
            value="1"
            label="男">
          </el-option>
          <el-option
            value="0"
            label="女">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="手机号"
        prop="account">
        <el-input v-model="form.account"></el-input>
      </el-form-item>
      <el-form-item
        label="证件号"
        prop="account">
        <el-input v-model="form.account"></el-input>
      </el-form-item>
      <el-form-item
        label="年龄段"
        prop="account">
        <el-input v-model="form.account"></el-input>
        至
        <el-input v-model="form.account"></el-input>
      </el-form-item>
    </el-form>
    <div class="btn-wrap">
      <el-button
        type="info"
        @click="getSaleStatistic">导出</el-button>
      <el-button
        type="primary"
        @click="getSaleStatistic">搜索</el-button>
    </div>
    <div
      class="page-title"
      style="margin-top:30px">
      按票种统计
    </div>
    <el-table :data="tableData1">
      <el-table-column
        width="100"
        prop="ticketTypeName"
        label="客源地">
      </el-table-column>
      <el-table-column
        prop="salePrice"
        label="客户姓名">
      </el-table-column>
      <el-table-column
        prop="saleNum"
        label="证件类型">
      </el-table-column>
      <el-table-column
        prop="sum_people"
        label="身份证号">
      </el-table-column>
      <el-table-column
        prop="cancelPrice"
        label="性别">
      </el-table-column>
      <el-table-column
        prop="sum_cancel"
        label="年龄">
      </el-table-column>
      <el-table-column
        prop="cancel_people"
        label="手机号">
      </el-table-column>
      <el-table-column
        prop="actualPrice"
        label="上次购买时间">
      </el-table-column>
      <el-table-column
        prop="actualNum"
        label="购票数量">
      </el-table-column>
    </el-table>
    <el-pagination
      background
      :current-page.sync="currentPage1"
      @current-change="getSaleStatistic1"
      layout="total, prev, pager, next"
      :total="total1">
    </el-pagination>
  </div>
</template>

<script>
// import { getScenic, getTicketTypeList } from '@/api/ticketType'
import moment from 'moment'
export default {
  data () {
    return {
      ticketTypeList: [],
      channelList: [
        {
          value: '',
          label: '全部'
        },
        {
          value: '1',
          label: '线下'
        },
        {
          value: '2',
          label: '分销商'
        },
        {
          value: '3',
          label: '线下和分销商'
        }
      ],
      scenicList: [],
      scenicOption: [],
      form: {
        startDate: new Date(moment().format('YYYY-MM-DD') + ' 00:00:00'),
        endDate: new Date(moment().format('YYYY-MM-DD HH:mm:ss')),
        keyWords1: '', // sell_channel_id
        keyWords2: '', // 票种id
        keyWords3: '', // 售票员id
        keyWords4: '', // 景点
        pageNum: 1,
        pageSize: 10
      },
      currentPage1: 1,
      currentPage2: 1,
      currentPage3: 1,
      total1: 0,
      total2: 0,
      total3: 0,
      tableData1: [],
      tableData2: [],
      tableData3: []
    }
  },
  created () {
    this.getTicketTypeList().then(() => {
      this.getScenicList()
    }).then(() => {
      this.getSaleStatistic()
    })
  }
}
</script>

<style scoped>

</style>
