<template>
  <div class="search-box">
    <el-form :model="form" :inline="true" ref="create">
      <el-form-item label="对账编码" prop="initCode">
        <el-input
          v-model="form.initCode"
          style="width: 170px; margin-right: 2px"
          placeholder="请输入对账编码"
          clearable
        />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit">查询</el-button>
        <el-button @click="resetForm('create')">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { searchInputData } from "./searchData";
export default {
  name: "searchView",
  data() {
    return {
      form: {
        initCode: "",
      },
      searchData: [],
    };
  },
  methods: {
    onSubmit() {
      this.$refs["create"].validate((valid) => {
        if (valid) {
          this.$emit("searchSuses", this.form);
        }
      });
    },
    resetForm(formName) {
      this.$refs[formName].resetFields();
      this.$emit("searchSuses", this.form);
    },
  },
};
</script>
<style scoped lang="scss">
.search-box {
  padding: 0;
}
</style>
