<template>
  <el-form
    class="form-wrap"
    inline>
    <div
      class="dialog-info"
      style="padding-bottom: 0;">
      <el-form-item
        label="交班时间"
        label-width="150px">
        <el-date-picker
          type="datetime"
          v-model="exportParams.startDate"
          placeholder="选择日期时间"
        ></el-date-picker>
      </el-form-item>
      <el-form-item
        label="至"
        label-width="40px">
        <el-date-picker
          default-time="23:59:59"
          type="datetime"
          v-model="exportParams.endDate"
          placeholder="选择日期时间"
        ></el-date-picker>
      </el-form-item>
    </div>
    <div class="dialog-btn-wrap">
      <el-button @click="reportExport">
        确定
      </el-button>
    </div>
  </el-form>
</template>
<script>
import { exportSaleStatisticsByTicketSpot } from '@/api/queryReport'
export default {
  data () {
    return {
      exportParams: {
        startDate: '',
        endDate: '',
        keyWords2: this.$store.getters.name
      }
    }
  },
  methods: {
    handleClose () {
      this.$parent.handleClose()
    },
    reportExport () {
      exportSaleStatisticsByTicketSpot(this.exportParams).then(() => {
        this.$notify({
          title: '',
          message: '导出成功',
          type: 'success'
        })
        this.handleClose()
      }, () => {
        this.$notify.error({
          title: '',
          message: '导出失败'
        })
      })
    }
  }
}
</script>
