search.vue 2.68 KB
<!--
  功能:高级搜索
  作者:calliope
-->
<template>
  <dialogBox :isButton="false" :isFullscreen="false" width="50%" @closeDialog="closeDialog" v-model="myValue"
    title="高级搜索">
    <el-form :model="ruleForm" ref="ruleForm" label-width="100px">
      <el-row>
        <el-col :span="8">
          <el-form-item label="申请业务名称" prop="sqywmc">
            <el-input v-model="ruleForm.sqywmc"  placeholder="请输入申请业务名称"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="权利人" prop="qlrmc">
            <el-input v-model="ruleForm.qlrmc" placeholder="请输入权利人"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="义务人" prop="ywrmc">
            <el-input v-model="ruleForm.ywrmc" placeholder="请输入义务人"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="8">
          <el-form-item label="受理时间" prop="slsj">
            <el-date-picker v-model="ruleForm.slsj" value-format="yyyy-MM-dd" class="width100" type="date"
              placeholder="请选择日期" clearable>
            </el-date-picker>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row class="search-btn">
        <el-button type="text" @click.native="closeDialog">收起搜索</el-button>
        <el-button type="primary" icon="el-icon-search" @click="submitForm('ruleForm')">查询</el-button>
        <el-button icon="el-icon-refresh-left" @click="resetForm('ruleForm')">重置</el-button>
      </el-row>
    </el-form>
  </dialogBox>
</template>
<script>

export default {
  props: {
    value: { type: Boolean, default: false },
    advancedForm:{type: Object, default: "" }
  },
  data () {
    return {
      myValue: this.value,
      ruleForm: {
        sqywmc: '',
        qlrmc: '',
        ywrmc: '',
        slsj: ''
      }
    }
  },
  watch: {
    value (val) {
      this.myValue = val
    },
    advancedForm(){
      this.ruleForm={...this.advancedForm}
    }
  },


  methods: {
    closeDialog () {
      this.$emit('input', false)
    },
    resetForm () {
      this.$refs['ruleForm'].resetFields()
      this.ruleForm={
        sqywmc: '',
        qlrmc: '',
        ywrmc: '',
        slsj: ''
      }
    },
    submitForm () {
      this.$emit('getSearch', _.cloneDeep(this.ruleForm))
      this.$emit('input', false)
      this.$refs['ruleForm'].resetFields()

    }
  }
}
</script>
<style scoped lang='scss'>
@import '~@/styles/public.scss';

.search-btn {
  padding: 0 20px 20px 20px;
  text-align: right;
}

/deep/.el-icon-date {
  display: none;
}
</style>