<template>
  <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
    <el-form-item label="名称" prop="name">
      <el-input
        v-model="queryParams.name"
        placeholder="请输入名称"
        clearable
        style="width: 220px"
        @keyup.enter.native="handleQuery"
      />
    </el-form-item>
    <el-form-item label="证件号" prop="certificateNo">
      <el-input
        v-model="queryParams.certificateNo"
        placeholder="请输入证件号"
        clearable
        style="width: 220px"
        @keyup.enter.native="handleQuery"
      />
    </el-form-item>
    <el-form-item label="记录类型" prop="recordType">
      <el-select v-model="queryParams.recordType" placeholder="请选择记录类型" clearable style="width: 180px">
        <el-option label="中介本人" value="INTERMEDIARY" />
        <el-option label="中介亲属" value="RELATIVE" />
        <el-option label="关联机构" value="ENTERPRISE_RELATION" />
      </el-select>
    </el-form-item>
    <el-form-item label="关联中介信息" prop="relatedIntermediaryKeyword">
      <el-input
        v-model="queryParams.relatedIntermediaryKeyword"
        placeholder="请输入关联中介姓名或证件号"
        clearable
        style="width: 260px"
        @keyup.enter.native="handleQuery"
      />
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  name: "SearchForm",
  props: {
    queryParams: {
      type: Object,
      required: true
    },
    showSearch: {
      type: Boolean,
      default: true
    }
  },
  methods: {
    handleQuery() {
      this.$emit("query");
    }
  }
};
</script>
