<template>
    <div>
        <el-dialog
          title="高级查询"
          :visible="moreQueryVisible"
          @close="close"
          width="66%">
          <el-form
            inline
            ref="queryForm"
            label-position="top"
            :model="formData">
            <el-form-item
              label="费率组编码"
              prop="rateCode">
              <el-input v-model="formData.rateCode"></el-input>
            </el-form-item>
            <el-form-item
              label="费率组名称"
              prop="rateName">
              <el-input v-model="formData.rateName"></el-input>
            </el-form-item>
            <el-form-item
              label="备注"
              prop="remark">
              <el-input v-model="formData.remark"></el-input>
            </el-form-item>
          </el-form>
          <div class="more-query-btn">
            <el-button v-auth="50600010103" type="primary" @click="submitForm">查询</el-button>
            <el-button v-auth="50600010104" @click="resetForm">重置</el-button>
          </div>
        </el-dialog>
    </div>
</template>
<script>
export default {
  data () {
    return {
      formData: {},
    }
  },
  props: {
    moreQueryVisible: Boolean
  },
  methods: {

    // 关闭弹窗
    close () {
      this.$emit('close')
    },

    // 提交表单
    submitForm () {
      this.$emit('toGetList', this.formData)
      this.$refs.queryForm.resetFields()
    },

    // 重置表单
    resetForm () {
      this.$refs.queryForm.resetFields()
    },

    // 格式化对象数据
    // format () {
    //   for (const key in this.formData) {
    //     if (this.formData.hasOwnProperty(key)) {
    //       const element = this.formData[key]
    //       if (Array.isArray(element)) {
    //         this.formData[key] = element.join(',')
    //       }
    //     }
    //   }
    //   return this.formData
    // }
  }
}
</script>
