## 表单页面
<br />

#### 用于表单页面添加数据

### 基本用法

:::demo
```html
<template>
	<div>
	<el-button @click="open" type="primary">打开form表单</el-button>
	<ve-dialog :show.sync="content.isShow" title="添加弹窗" width='600px'>
	<el-form :model="content.form" :rules="content.rules" ref="form" label-width="135px" :inline="false" style="padding-right: 40px;">
	                <el-form-item label="所属品牌" prop="brandId">
	                    <el-select v-model="content.form.brandId" clearable filterable placeholder="请选择所属品牌" :disabled='true' style="width: 100%" >
	                        <el-option v-for="item in brandIdList" :key="item.brandId" :label="item.brandName" :value="item.brandId">
	                        </el-option>
	                    </el-select>
	                </el-form-item>
	                <el-form-item label="目标分校" prop="schoolId">
	                    <el-select v-model="content.form.schoolId" clearable filterable placeholder="请选择目标分校" style="width: 100%">
	                        <el-option v-for="item in schoolList" :key="item.schoolId" :label="item.schoolName" :value="item.schoolId">
	                        </el-option>
	                    </el-select>
	                </el-form-item>
	                <el-form-item label="权重级别" prop="weightruleLevel">
	                    <el-select v-model="content.form.weightruleLevel" clearable filterable placeholder="请选择权重级别" style="width: 100%">
	                        <el-option v-for="item in weightruleLevelList" :key="item.dictCode" :label="item.dictName" :value="item.dictCode"></el-option>
	                    </el-select>
	                </el-form-item>
	                <el-form-item label="成单业绩（元）" prop="weightrulePerformanceamount">
	                    <el-input @input="value =>{
	                        content.form.weightrulePerformanceamount= value.replace(/[^0-9.]/g,'')}" v-model="content.form.weightrulePerformanceamount" clearable placeholder="0">
	                        <span slot="suffix" class="slot-right">
	                        单位：元
	                        <el-tooltip placement="bottom" effect="light">
	                        <div slot="content" style="maxWidth: 200px;lineHeight: 1.5;">
	                            <!-- <p> 1，成单业绩不能为空；</p> -->
	                            <!-- <p> 2，成单业绩精确到两位小数。</p> -->
	                            <p>小数形式：如: 0.03</p>
	                        </div>
	                        <i class="el-icon-info"></i>
	                    </el-tooltip>
	                        </span>
	                    </el-input>
	                </el-form-item>
	                <el-form-item label="转化率（%）" prop="weightruleConvertrate">
	                    <el-input @input="value =>{
	                        content.form.weightruleConvertrate= value.replace(/[^0-9.]/g,'')}"  v-model="content.form.weightruleConvertrate" clearable placeholder="0">
	                        <span slot="suffix" class="slot-right">单位：%</span>
	                    </el-input>
	                </el-form-item>
	                <el-form-item label="通话情况（分钟）" prop="weightruleTalktime">
	                    <el-input @input="value =>{
	                        content.form.weightruleTalktime= value.replace(/[^0-9]/g,'')}" v-model="content.form.weightruleTalktime" clearable placeholder="0">
	                        <span slot="suffix" class="slot-right">单位：分钟</span>
	                    </el-input>
	                </el-form-item>
	                <el-form-item label="每天新增客户量" prop="weightruleFirstcount">
	                    <el-input @input="value =>{
	                        content.form.weightruleFirstcount= value.replace(/[^0-9]/g,'')}" v-model="content.form.weightruleFirstcount" clearable placeholder="0"></el-input>
	                </el-form-item>
	                <el-form-item label="拥有客户量" prop="weightruleCustcount">
	                    <el-input @input="value =>{
	                        content.form.weightruleCustcount= value.replace(/[^0-9]/g,'')}" v-model="content.form.weightruleCustcount" clearable placeholder="0"></el-input>
	                </el-form-item>
	                <el-form-item label="启用状态">
	                    <template>
	                        <el-radio :disabled="!PermissUtil.checkPermiss('CT/SchoolWeight/Cmd/Reuse')" v-model="content.form.weightruleAvlstatus" label="Y">启用</el-radio>
	                        <el-radio :disabled="!PermissUtil.checkPermiss('CT/SchoolWeight/Cmd/Reuse')" v-model="content.form.weightruleAvlstatus" label="N">禁用</el-radio>
	                    </template>
	                </el-form-item>
	            </el-form>
	            <span slot="footer">
	            <el-button @click="cancle">
	                取 消
	            </el-button>
	            <el-button :loading='saveBtnFlag' @click="save" type="primary">
	                确 定
	            </el-button>
	            </span>
	        </ve-dialog>
	</div>
</template>

<script>
  export default {
    data () {
		return {
			weightruleLevelList: [{ dictCode: '1', dictName: '一' }],
			brandIdList: [{ brandId: 'YOULU', brandName: '优路' }],
			schoolList: [{ schoolId: '1', schoolName: '郑州' }],
			content: {
			    form: {
			        brandId: 'YOULU',
			        schoolId: '',
			        weightruleLevel: '',
			        weightrulePerformanceamount: null,
			        weightruleConvertrate: null,
			        weightruleTalktime: null,
			        weightruleFirstcount: null,
			        weightruleCustcount: null,
			        weightruleAvlstatus: 'Y'
			    },
			    rules: {
			        schoolId: [{ required: true, message: '请选择目标分校', trigger: 'change' }],
			        weightruleLevel: [{ required: true, message: '请选择权重等级', trigger: 'change' }],
			        weightruleFirstcount: [{ required: true, message: '每天新增客户量不可为空', trigger: 'change' },
			        { required: true, message: '每天新增客户量不可为空', trigger: 'blur' },],
			        weightruleCustcount: [{ required: true, message: '拥有客户量不可为空', trigger: 'change' },
			        { required: true, message: '拥有客户量不可为空', trigger: 'blur' },],
			    },
			    isShow: false,
			},
			saveBtnFlag: false
		}
	},
	created() {
	},
	methods: {
	    open() {
	        this.content.isShow = true;
	        this.$nextTick(()=>{
	            this.$refs['form'].resetFields()
	        })
	    },
	    save() {
	        this.$refs['form'].validate((valid) => {
	            if (valid) {
	                this.saveBtnFlag = true;
	                setTimeout(() => {
	                    this.saveBtnFlag = false;
	                    this.$message({ type: 'success', message: "操作成功" })
	                    this.content.isShow = false;
	                }, 1000)
	            } else {
	                // console.log('error submit!!');
	                return false;
	            }
	        });
	    },
	    cancle() {
	        this.content.isShow = false;
	    }
	}
  }
</script>
```
:::

###  Form Attributes

| 参数      | 说明          | 类型      | 可选值                           | 默认值  |
|---------- |-------------- |---------- |--------------------------------  |-------- |
| show      |  是否打开弹窗           | Boolean | true/false | — |
| model      |  绑定的数据           | object | — | — |
| rules      |  角色           | object | — | — |
| label-width      |  label宽度           | string | — | — |
| inline      |  是否是为行内元素           | Boolean | true/false | false |

###  Form-item Attributes
| 参数      | 说明          | 类型      | 可选值                           | 默认值  |
|---------- |-------------- |---------- |--------------------------------  |-------- |
| prop     |  列prop值           | string | — | — |
| label     |  列名           | string | — | — |

### Slot

| 名称      | 描述   |
|---------- |-------------- |
| suffix      |  input框右侧提示内容  | 