<template>
<el-row class="query">
  <el-form
    inline
    :model="query"
    ref="queryForm"
  >

    <el-form-item label="货主" prop="ownerCodes">
      <PublicQuery
        title="货主"
        cfgKey="repWmsCustomer"
        :baseUrl="baseUrl"
        :valueField.sync="query.ownerCodes"
        @change="toGetData"
      ></PublicQuery>
    </el-form-item>
      <el-form-item >
      <el-button type="primary" @click="toGetData">查询</el-button>
      <el-button type="primary" @click="reset">重置</el-button>
    </el-form-item>
  </el-form>
</el-row>
</template>

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

  data () {
    return {
      query: {
        ownerCodes: '',
      }, // 查询条件
      baseUrl: '/rep_web/repweb'
    }
  },
  methods: {
    // 查询
    toGetData () {
      this.$emit('getData', this.query)
    },
    // 重置
    reset () {
      this.$refs.queryForm.resetFields()
      this.toGetData()
    }
  },
}
</script>

<style lang="scss" scoped>
  // .query {
  //   .btn {
  //     float: right;
  //     margin-top: 36px;
  //   }
  // }
</style>
