<template>
    <div>
        <el-dialog title="编号新增" :visible="caseVisable" @close="cancel" width="600px" center>
            <el-form  label-position="left" :model="ruleForm" ref="ruleForm" :rules="rules"  label-width="100px"
                class="demo-ruleForm">
                <el-form-item label="规则类型:" prop="ruleType">
                    <el-select  placeholder="请选择规则类型" v-model="ruleForm.ruleType">
                        <el-option label="字符串" value="1"></el-option>
                        <el-option label="整数" value="2"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="前缀:" prop="prefixstr">
                    <el-input v-model="ruleForm.prefixstr" placeholder="请输入前缀内容" />
                </el-form-item>
                <el-form-item label="时间格式:" prop="dateFormat">
                    <el-select  placeholder="请选择时间格式" v-model="ruleForm.dateFormat">
                        <el-option label="yyyy-MM-dd" value="1"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="机构名称:" prop="deptName">
                    <el-input v-model="ruleForm.deptName" placeholder="请输入机构名称" />
                </el-form-item>
                <el-form-item label="机构名称首字母拼写:" prop="deptNameFirchar">
                    <el-input v-model="ruleForm.deptNameFirchar" placeholder="请输入机构名称首字母拼写" />
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button  class="endbutton" @click="cancel"><span>取 消</span></el-button>
                <el-button type="primary"  class="endbutton"><span>确认</span></el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
export default {
    props: ["caseVisable"],
    dicts: ["manager_type"],
    data() {
        return {
            ruleForm:{
                ruleType:''
            },
             rules: {
                ruleType: [
                    { required: true, message: '请输入规则类型', trigger: 'blur' },
                ],
                prefixstr: [
                    { required: true, message: '请输入前缀', trigger: 'blur' },
                ],
                dateFormat: [
                    { required: true, message: '请输入时间格式', trigger: 'blur' },
                ],
                deptName: [
                    { required: true, message: '请输入机构名称', trigger: 'blur' },
                ],
                deptNameFirchar: [
                    { required: true, message: '请输入首字母拼写', trigger: 'blur' },
                ]
            }
           
        };
    },
    watch: {
        // uploadVisable(val) {
        //     if (val) {
        //         this.ruleForm = {};
        //     }
        // }
    },
    created() {

    },
    methods: {
        cancel() {
            this.$emit("cancelCase");
        },
        // 新增模板
        // insertManagerFn(data) {
        //     insertManager(data).then(res => {
        //         this.$message.success('新增成功');
        //         this.$emit("cancelUpload");
        //         this.$emit('getList', this.queryParams);
        //     })
        // },
        // submitUpload() {
        //     this.$refs['ruleForm'].validate((valid) => {
        //         if (valid) {
        //             this.insertManagerFn(this.ruleForm)
        //         }
        //     });
        // },
    },
};
</script>
  
<style lang="scss" scoped></style>