<template>
  <div class="search-box">
    <el-form :model="form" :inline="true" ref="create">
      <el-form-item label="医疗机构" prop="hospName">
        <el-input
          v-model="form.hospName"
          style="width: 170px; margin-right: 2px"
          placeholder="请输入医疗机构"
          clearable
        />
      </el-form-item>
      <el-form-item label="结算周期" prop="initCode">
        <el-date-picker
          v-model="form.initCode"
          type="month"
          style="width: 240px; margin-right: 2px"
          value-format="yyyyMM"
          :picker-options="pickerOptions0"
        />
      </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: {
        hospName: "",
        initCode: "",
      },
      searchData: [],
      pickerOptions0: {
        disabledDate(time) {
          return time.getTime() > Date.now() - 8.64e6;
        },
      },
    };
  },
  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>
