<template>
    <el-dialog :title="title" :close-on-click-modal="false" :visible.sync="visible" :before-close="close" width="600px">
        <el-form :model="formData">
            <el-form-item label="等级:">
                <el-input v-model="formData.vip_commission_1" autocomplete="off"></el-input>
            </el-form-item>
            <el-form-item label="金额:">
                <el-input v-model="formData.vip_commission_2" autocomplete="off"></el-input>
            </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
            <el-button @click="close">取 消</el-button>
            <el-button type="primary" @click="close">确 定</el-button>
        </div>
    </el-dialog>
</template>
<script>
    export default {

        data() {
            return {
                title: '新增',
                formData: {},
                visible: false,
                type: null,
            };
        },
        methods: {
            open(type, data) {
                this.type = type;
                if (type === 'edit') {
                    this.title = '编辑';
                }
                if (type === 'add') {
                    this.title = '新增';
                }
                this.visible = true;
            },
            close() {
                this.visible = false;
            },
        },
        watch: {
            addEditDialogType(val) {
                switch (val) {
                    case 'add':
                        this.title = '新增';
                        break;
                    case 'edit':
                        this.title = '编辑';
                        break;
                    default:
                        this.title = '新增';
                }
            },
        },
    };
</script>
<style lang="stylus" scoped>
    ::v-deep .el-textarea__inner {
      min-height: 200px !important;
    }
    .el-input {
      width: auto;
    }
    ::v-deep .el-input__inner {
      width: 200px;
    }
</style>
