<template>
  <div class="page">
    <el-form :model="headerForm" :inline="true" ref="headerForm" size="mini">
      <el-row>
        <el-col :span="8">
          <el-form-item label="全宗号:" prop="fonds_no">
            <el-select filterable clearable style="width:163px" v-model="headerForm.fonds_no" size="mini">
              <el-option v-for="(item,key) in fondsList" :key="key" :label="item.fondsname" :value="item.fondscode">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="归档年度:" prop="filing_year">
            <el-input-number controls-position="right" :min="0" placeholder="请输入" v-model="headerForm.filing_year">
            </el-input-number>
          </el-form-item>
        </el-col>
        <el-col :span="9">
          <el-form-item label="保管期限:" prop="retention">
            <el-select filterable clearable v-model="headerForm.retention">
              <el-option v-for="(ele,index) in keepList" :key="index" :label="ele.label" :value="ele.label">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="分类号:" prop="archive_ctg_no">
            <el-input v-model="headerForm.archive_ctg_no" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item prop="type">
            <el-radio-group v-model="headerForm.type">
              <el-radio :label="0">未入库</el-radio>
              <el-radio :label="1">已入库</el-radio>
            </el-radio-group>
          </el-form-item>
        </el-col>
        <el-col :span="9">
          <el-form-item>
            <el-button type="primary" size="mini" :disabled="disabled" @click="searchClick">
              查询
            </el-button>
            <el-button size="mini" @click="handleReset">重置</el-button>
            <el-button type="success" size="mini" :disabled="disabled" @click="handleExport">导出</el-button>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: {
    headerForm: {
      type: Object,
      default: () => {},
    },
    disabled: {
      type: Boolean,
      default: () => true,
    },
    fondsList: {
      type: Array,
      default: () => [],
    },
    keepList: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    searchClick() {
      this.$emit("searchClick");
    },
    handleReset() {
      this.$refs.headerForm.resetFields();
      this.$emit("reset");
    },
    handleExport() {
      this.$emit("export");
    },
  },
};
</script>

<style lang="scss" scoped>
.page {
  width: 100%;
  background-color: #fff;
  padding: 10px 10px 0 10px;
  box-sizing: border-box;
}
</style>
