<template>
  <el-row class="query">
    <el-form
      class="query__retrieve"
      inline
      ref="queryForm"
      :model="query"
    >
      <el-form-item label="仓库" prop="cdwhcode">
        <PublicQuery
          title="仓库"
          cfgKey="enpWmsWareHouse"
          :baseUrl="baseUrl"
          :valueField.sync="query.cdwhcode"
          :textField.sync="query.cdwhName"
          @change="toGetList(query)"
        />
      </el-form-item>
      <el-form-item>
        <el-button v-auth="50940060101" icon="el-icon-refresh" class="query__item" type="primary" @click="e => toGetList(query)" plain circle></el-button>
        <el-button
    v-if="false"
      icon="el-icon-download"
      type="primary"
      @click="handleExcel"
      plain
      circle
    ></el-button>
      </el-form-item>
    </el-form>
  </el-row>
</template>

<script>
export default {
  created () {
  },
  mounted () {
  },

  data () {
    return {
      query: {}, // 查询条件
      baseUrl: '/enp_web/enpweb',
      moreData: {}
    }
  },
  methods: {
    // 查询
    toGetList (query = {}) {
      this.moreData = query
      this.$emit('getList', query)
    },
    handleExcel () {
      const url = this.$API.enterprise.warehousesCapacityList
      const options = this.moreData
      this.$exportExcel(url, options)
    },
  },
}
</script>

<style lang="scss" scoped>
  .query {
    &__retrieve {
      float: right;
      .el-input {
        max-width: 180px;
      }
    }
    &__item {
      margin-left: 10px;
    }
  }
</style>
