<template>
    <el-dialog :title="titleMap[mode]" v-model="visible" :width="660" destroy-on-close @closed="$emit('closed')" :close-on-click-modal="false" :close-on-press-escape="false">
        <el-form ref="dialogForm" :model="formData" :rules="rules" label-width="100px" label-position="top">
            <el-form-item label="续期时效" prop="val">
                <el-select v-model="formData.val" clearable placeholder="请选择时效" :style="{width: '100%'}">
                    <el-option value="1-year" label="一年"></el-option>
                    <el-option value="2-year" label="两年"></el-option>
                    <el-option value="7-day" label="7天"></el-option>
                    <el-option value="15-day" label="15天"></el-option>
                    <el-option value="30-day" label="30天"></el-option>
                </el-select>
                <div class="el-form-item-msg"></div>
            </el-form-item>
        </el-form>
		<template #footer>
            <el-button @click="visible = false">取 消</el-button>
			<el-button type="primary" :loading="isSaveing" @click="submit()">提交</el-button>
		</template>
    </el-dialog>
</template>
<script>
export default{
    data(){
        return {
            disabled:false,
            loading: false,
            mode:"add",
            titleMap:{
                add:"代理续期",
                edit:"代理续期"
            },
            visible: false,
            isSaveing: false,
            idData:[],
            formData:{}
        }
    },
    methods:{
        open(mode = 'add'){
            this.mode = mode;
            this.visible = true;
            return this
        },
        //表单注入数据
        setData(data){
            this.idData = data;
        },
    }
}
</script>
