<template>
    <div class="page_callingConfigure">
        <div class="cell clearfix">
            就诊状态显示屏幕切换屏幕时长配置(秒) : 
            <div class="time ">
                <el-input-number v-model="form.qhsj" :min="1"></el-input-number>
            </div>
        </div>
        <div style="display:flex;">
            <div class="configureBox">
                <div class="configureBoxTitle">接诊叫号</div>
                <div class="configureBoxMain">
                    <div style="margin-bottom:10px;">单次叫号语音播报次数：<el-input-number v-model="form.jzdcbbcs" :min="1"></el-input-number></div>
                    <div style="margin-bottom:10px;">
                        语音播报声音：
                        <el-radio-group v-model="form.jzbbsy">
                            <el-radio :label="1">男生</el-radio>
                            <el-radio :label="2">女生</el-radio>
                        </el-radio-group>
                    </div>
                    <div>
                        隐藏接诊叫号区域：
                        <el-radio-group v-model="form.jzjhyc">
                            <el-radio :label="0">是</el-radio>
                            <el-radio :label="1">否</el-radio>
                        </el-radio-group>
                    </div>
                </div>
                
            </div>
            <div class="configureBox" style="border-left:none;">
                <div class="configureBoxTitle">上机叫号</div>
                <div class="configureBoxMain">
                    <div style="margin-bottom:10px;">单次叫号语音播报次数：<el-input-number v-model="form.sjdcbbcs" :min="1"></el-input-number></div>
                    <div style="margin-bottom:10px;">
                        语音播报声音：
                        <el-radio-group v-model="form.sjbbsy">
                            <el-radio :label="1">男生</el-radio>
                            <el-radio :label="2">女生</el-radio>
                        </el-radio-group>
                    </div>
                    <div style="width:480px;">
                        隐藏上机叫号区域：
                        <el-radio-group v-model="form.sjjhyc">
                            <el-radio :label="0">是</el-radio>
                            <el-radio :label="1">否</el-radio>
                        </el-radio-group>
                    </div>
                </div>
                
            </div>
        </div>
        <div style="display:flex;margin-top:10px;">
            <div style="width:480px;">
                是否在透析管理页面显示排队叫号：
                <el-radio-group v-model="form.txglsyxs">
                    <el-radio :label="1">显示</el-radio>
                    <el-radio :label="0">不显示</el-radio>
                </el-radio-group>
            </div>
            <div style="width:480px;margin-bottom:10px;">
                是否在透析记录详情页面显示排队叫号：
                <el-radio-group v-model="form.txxqyxs">
                    <el-radio :label="1">显示</el-radio>
                    <el-radio :label="0">不显示</el-radio>
                </el-radio-group>
            </div>
            
        </div>
        <div style="display:flex;margin-top:10px;">
            <div style="width:480px;">
            </div>
            <div style="width:480px;margin-bottom:10px;">
                <el-button @click="changeQueue" type="primary" style="float:right;">修改</el-button>
            </div>
        </div>
        
        
    </div>
</template>

<script>
import {
  getQueue,changeQueue
} from '@/api/call'
export default {
    data(){
        return{
            num:3,
            typeOptions:[{ value: 1, label: '姓名'},{ value: 2, label: '透析号'}],
            type: 1,
            stateOptions:[{ value: 1, label: '智能匹配诊台'},{ value: 2, label: '自定义内容'}],
            state: 1,
            input:'',
            radio:1,


            form:{
                qhsj:10,
                jzdcbbcs:3,
                jzbbsy:1,
                jzjhyc:0,
                sjdcbbcs:3,
                sjbbsy:1,
                sjjhyc:0,
                txxqyxs:0,
                txglsyxs:0




            }
        }
    },
    created(){
        this.getQueue()
    },
    methods:{
        getQueue(){
            getQueue().then(res => {
                console.log('peizhi',res)
                let queue_config = res.data.data.queue_config

                this.form.qhsj = queue_config.qhsj
                this.form.jzdcbbcs = queue_config.jzdcbbcs
                this.form.jzbbsy = queue_config.jzbbsy
                this.form.jzjhyc = queue_config.jzjhyc
                this.form.sjdcbbcs = queue_config.sjdcbbcs
                this.form.sjbbsy = queue_config.sjbbsy
                this.form.sjjhyc = queue_config.sjjhyc
                this.form.txxqyxs = queue_config.txxqyxs
                this.form.txglsyxs = queue_config.txglsyxs
            })
        },
        changeQueue(){
            let org_id =  parseInt(sessionStorage.getItem("org_id"));
            let params = {
                org_id:org_id,
                jzbbsy:this.form.jzbbsy,
                jzdcbbcs:this.form.jzdcbbcs,
                jzjhyc: this.form.jzjhyc,
                qhsj: this.form.qhsj,
                sjbbsy: this.form.sjbbsy,
                sjdcbbcs:this.form.sjdcbbcs,
                sjjhyc: this.form.sjjhyc,
                txxqyxs: this.form.txxqyxs,
                txglsyxs: this.form.txglsyxs,

            }
            changeQueue(params).then(res => {
                if(res.data.state == 1){
                    this.$message({
                        message: "修改成功",
                        type: 'success'
                    });
                }
            })
        }
    }
}
</script>


<style lang="scss" scoped>
.configureBox{
    width:480px;
    height: 300px;
    border: 1px solid #e5e5e5;
    .configureBoxTitle{
        height: 40px;
        text-align: center;
        line-height: 40px;
        background: rgb(245, 247, 250);
        color:rgb(96, 98, 102);
        font-weight: 600;
        border-bottom: 1px solid #e5e5e5;
    }
    .configureBoxMain{
        padding: 10px;
    }
}
</style>
