<template>
  <div class="mrg-b">
        <el-form :model="query" inline>
          <el-form-item label="货主">
            <PublicQuery
              title="货主"
              baseUrl="/rep_web/repweb"
              cfgKey="repWmsCustomer"
              :valueField.sync="query.ownerCodes"
              :textField.sync="query.ownerName">
              </PublicQuery>
          </el-form-item>
          <el-form-item>
            <el-date-picker
              v-model="date1"
              type="datetimerange"
              format="yyyy-MM-dd HH:mm"
              value-format="yyyy-MM-dd HH:mm:ss"
              :default-time="['00:00:00', '23:59:59']"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              :picker-options="pickerOptions2"
              @change="getTime1">
            </el-date-picker>
          </el-form-item>
          <el-button v-auth="50930010101" icon="el-icon-refresh" class="query__item" type="primary" @click="handleSearch" plain circle></el-button>
        </el-form>
  </div>
</template>
<script>
import { today, yesterday, week, month, twoMonths, threeMonths } from '@/config/shortcuts'
export default {
  data () {
    return {
      query: {},
      pickerOptions2: {
        shortcuts: [today, yesterday, week, month, twoMonths, threeMonths]
      },
      moreQueryVisible: false,
      date1: [new Date(), new Date(new Date() - 3600 * 1000 * 24 * 7)],
    }
  },
  methods: {
    // 获得生效时间
    getTime1 (val) {
      this.formData.effectiveTimeFm = val[0]
      this.formData.effectiveTimeTo = val[1]
    },

    handleSearch (list) {
      this.$emit('getList', this.query)
    },

  }
}
</script>
<style lang="scss" scoped>
  .mrg-b{
        margin-bottom: 20px;
    }
    .mrg-l{
        margin-left:10px;
    }
  .inline{
    width: 15%
  }
   .query {
    &__operations {
      float: left;
    }
    &__retrieve {
      float: right;
      .el-input {
        max-width: 180px;
      }
    }
    &__item {
      margin-left: 10px;
    }
  }
</style>
