<template>
  <div>
    <Modal v-model="showModal" :width="700" footer-hide>
      <p slot="header">
        附件
      </p>
      <div>
        <!--内容-->
        <el-row>
          <!--查询-->
          <el-col :span="24">
            <Form inline onsubmit="return false" :label-width="70">
              <label class="label-sign" />
              <Form-item label="文件名称:" class="search-item">
                <Input v-model="formObj.fileName" placeholder="请输入文件名称" @on-enter="_formSearch" />
              </Form-item>
              <Form-item class="search-btn">
                <Button type="primary" @click="_formSearch">
                  搜索
                </Button>
              </Form-item>
            </Form>
          </el-col>
          <el-col :span="24">
            <Files ref="fileModal" />
          </el-col>
        </el-row>
      </div>
    </Modal>
  </div>
</template>
<script>
import Files from './files'
export default {
  components: {
    Files
  },
  data() {
    return {
      showModal: false,
      formObj: {
        fileName: '',
        subPlanId: ''
      }
    }
  },
  methods: {
    _open(id) {
      this.formObj = this.$resetFields(this.formObj)
      this.formObj.subPlanId = id
      this.showModal = true
      this._formSearch()
    },
    _formSearch() {
      this.$refs.fileModal._open(this.formObj)
    }
  }
}
</script>
