<template>
    <el-dialog
        :title="formTitle"
        width="900px"
        :visible.sync="visible"
        :before-close="_close"
    >
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="基础数据" name="first">
                <div>
                    <el-form :model="form" :rules="rules" ref="form" label-width="100px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
                        <el-form-item label="耗材名称 : " prop="name" style="width:100%">
                            <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
                        </el-form-item>
                        <el-form-item label="拼音 : " prop="name" style="width:100%">
                            <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
                        </el-form-item>
                        <el-form-item label="五笔 : " prop="name" style="width:100%">
                            <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
                        </el-form-item>
                        <el-form-item label="价格(元) : " prop="name">
                            <el-input v-model="form.name" placeholder="" maxlength="30"></el-input>
                        </el-form-item>
                        <el-form-item label="单位 : " prop="name">
                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="费用类别 : " prop="name">
                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="执行科室 : " prop="name">
                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="医保等级 : " prop="name">
                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="统计分类 : " prop="name">
                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="是否特病目录:" prop="name">
                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="是否备案 : " prop="name">
                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="医保编码 : " prop="name">
                            <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
                        </el-form-item>
                        <el-form-item label="试管颜色 : " prop="name">
                            <el-select v-model="value" style="width:160px;" placeholder="请选择">
                                <el-option
                                v-for="item in options"
                                :key="item.value"
                                :label="item.label"
                                :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="状态 : " prop="name" style="width:100%;">
                            <el-radio-group v-model="radio">
                                <el-radio :label="1">停用</el-radio>
                                <el-radio :label="2">收费</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="备注 : " prop="name" style="width:100%;">
                            <el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="textarea"></el-input>
                        </el-form-item>
                    </el-form>
                </div>
            </el-tab-pane>
            <el-tab-pane label="扩展数据" name="second">
                <el-form :model="form" :rules="rules" ref="form" label-width="120px" style="display: flex;flex-wrap: wrap;justify-content: space-between;">
                    <el-form-item label="标签 : " prop="name">
                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="默认使用数量:" prop="name">
                        <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
                    </el-form-item>
                    <el-form-item label="是否默认:" prop="name">
                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否收费常用项:" prop="name">
                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否收费预估项:" prop="name">
                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="是否统计工作量:" prop="name">
                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="收费项目排序:" prop="name">
                        <el-input v-model="form.name" style="width:160px;" placeholder="" maxlength="30"></el-input>
                    </el-form-item>
                    <el-form-item label="是否常用医嘱:" prop="name">
                        <el-select v-model="value" style="width:160px;" placeholder="请选择">
                            <el-option
                            v-for="item in options"
                            :key="item.value"
                            :label="item.label"
                            :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="收费项目排序:" prop="name" style="visibility: hidden;">
                        <el-input style="width:160px;" placeholder="" maxlength="30"></el-input>
                    </el-form-item>
                        
                </el-form>
            </el-tab-pane>
        </el-tabs>


        <div slot="footer" class="dialog-footer">
            <el-button @click="hide">取 消</el-button>
            <el-button type="primary" :loading="submitLoading" @click="submitAction()">保 存</el-button>
        </div>
  </el-dialog>
</template>

<script>
export default {
    data(){
        return{
            visible:false,
            formTitle:'',
            activeName:'first',
            form:{
                name:''
            },
            options: [{
            value: '选项1',
            label: '黄金糕'
            }, {
            value: '选项2',
            label: '双皮奶'
            }, {
            value: '选项3',
            label: '蚵仔煎'
            }, {
            value: '选项4',
            label: '龙须面'
            }, {
            value: '选项5',
            label: '北京烤鸭'
            }],
            value: '',
            radio:'1'
        }
    },
    methods:{
        _close: function(done) {
            // this.clear()
            done()
        },
        clear: function() {
            this.form.id = 0;
            this.form.name = "";
            this.form.intro = "";
        },
        show(id) {
            // this.clear()
            this.visible = true
            if(id == 0){
                this.formTitle = '新增'
            }else{
                this.formTitle = '编辑'
            }
        },
        hide() {
            // this.clear()
            this.visible = false
        },
    }
}
</script>
