<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="startDate">
        <el-date-picker
          v-model="form.startDate"
          type="datetime"
          placeholder="选择日期时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item
        label="至"
        prop="endDate">
        <el-date-picker
          v-model="form.endDate"
          type="datetime"
          placeholder="选择日期时间">
        </el-date-picker>
      </el-form-item>
      <br>
      <el-form-item
        label="导出人"
        prop="keyWords1">
        <el-select v-model="form.keyWords1">
          <el-option
            value="1"
            label="管理员1">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item
        label="导出类型"
        prop="keyWords2">
        <el-input
          v-model="form.keyWords2"
        ></el-input>
      </el-form-item>
    </el-form>
    <div class="btn-wrap">
      <el-button
        type="info"
      >下载</el-button>
      <el-button
        type="error"
      >删除</el-button>
      <el-button
        type="primary"
        @click="getExportMissionList">搜索</el-button>
    </div>
    <div
      class="page-title"
      style="margin-top:30px">
      导出记录
    </div>

    <el-table :data="tableData">
      <el-table-column
        prop="type"
        label="导出类型">
      </el-table-column>
      <el-table-column
        prop="search_condition"
        label="检票详情">
      </el-table-column>
      <el-table-column
        prop="createtime"
        label="创建时间">
      </el-table-column>
      <el-table-column
        prop="operator"
        label="导出人">
      </el-table-column>
      <el-table-column
        width="140"
        fixed="right"
        label="操作">
        <template>
          <el-button
            type="text"
          >下载</el-button>
          <el-button
            type="text"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      background
      layout="total, prev, pager, next">
    </el-pagination>
  </div>
</template>

<script>
// import { getTicketTypeList } from '@/api/ticketType'
import { getExportMissionList } from '@/api/queryReport.js'
import moment from 'moment'
export default {
  data () {
    return {
      // channelList: [
      //   {
      //     value: '',
      //     label: '全部'
      //   },
      //   {
      //     value: '1',
      //     label: '线下'
      //   },
      //   {
      //     value: '2',
      //     label: '分销商'
      //   },
      //   {
      //     value: '3',
      //     label: '线下和分销商'
      //   }
      // ],
      form: {
        startDate: new Date(moment().format('YYYY-MM-DD') + ' 00:00:00'),
        endDate: new Date(moment().format('YYYY-MM-DD HH:mm:ss')),
        keyWords1: '', // ticketTypeId
        keyWords2: '', // sell_channel
        pageNum: 1,
        pageSize: 10
      },
      tableData: []
    }
  },
  created () {
    this.getExportMissionList()
  },
  methods: {
    getExportMissionList () {
      getExportMissionList(this.form).then(res => {
        this.tableData = res.list
        console.log(this.form)
      })
    }
  }
}
</script>

<style scoped>

</style>
