<template>
<el-dialog
  width="70%"
  class="more-query"
  title="高级查询"
  :visible="showMore"
  @close="close"
>
  <el-form
    inline
    label-position="top"
    :model="query"
    ref="queryForm"
  >
    <!--公用查询框-->
    <el-form-item label="货主" prop="ownerCodes">
      <PublicQuery
        title="货主"
        cfgKey="repWmsCustomer"
        :baseUrl="baseUrl"
        :valueField.sync="query.ownerCodes"
        :textField.sync="query.ownerName"
      ></PublicQuery>
    </el-form-item>
    <el-form-item label="商品" prop="skuCodes">
      <PublicQuery
        title="商品"
        cfgKey="repWmsSku"
        :baseUrl="baseUrl"
        :valueField.sync="query.skuCodes"
        :textField.sync="query.skuName"
      ></PublicQuery>
    </el-form-item>

    <el-form-item label="批次号" prop="lotNum">
      <el-input v-model="query.lot"></el-input>
    </el-form-item>
  </el-form>
  <div class="more-query__btn">
    <el-button type="primary" @click="submitForm">查询</el-button>
    <el-button @click="reset">重置</el-button>
  </div>
</el-dialog>
</template>

<script>
export default {
  props: ['showMore', 'queryProp'],
  created () {
  },
  mounted () {
  },

  data () {
    return {
      query: { ...this.queryProp }, // 查询条件
      baseUrl: '/rep_web/repweb',
    }
  },
  methods: {
    // 关闭弹窗
    close () {
      this.$emit('close')
    },
    // 提交表单
    submitForm () {
      this.$emit('toGetList', this.query)
      this.close()
    },
    // 重置表单
    reset () {
      this.query.ebcuNameCn = ''
      this.query.skuName = ''
      this.$refs.queryForm.resetFields()
    }
  },
}
</script>

<style lang="scss" scoped>
</style>
