<template>
    <div class="header">
        <div class="leftheader">
            <div class="item" v-for="(item, index) in categorylist" :key="item.id" @click="clickcategory(item, index)"
                :class="index == categoryindex ? 'selectitem' : ''">
                <div class="time">{{ item.time }}
                </div>
                <div class="name">
                    {{ item.name }}
                </div>
                <div class="text">
                    {{ item.text }}
                </div>
                <el-tag class="type" size="mini">服务中</el-tag>
                <!-- <el-tag class="type" size="mini" type="success">门诊</el-tag> -->
            </div>
        </div>
        <div class="rightheader">
            <div class="richtext">
                <el-descriptions title="基本信息" style="margin-top: 20px;">
                    <el-descriptions-item label="医院">kooriookami</el-descriptions-item>
                    <el-descriptions-item label="科室">18100000000</el-descriptions-item>
                    <el-descriptions-item label="签约时诊断">苏州市</el-descriptions-item>
                    <el-descriptions-item label="院区">苏州市</el-descriptions-item>
                    <el-descriptions-item label="病区">苏州市</el-descriptions-item>
                    <el-descriptions-item label="审核后诊断">苏州市</el-descriptions-item>
                </el-descriptions>
                <el-descriptions title="签约信息" style="margin-top: 40px;">
                    <el-descriptions-item label="服务包">kooriookami</el-descriptions-item>
                    <el-descriptions-item label="服务包缴费状态">18100000000</el-descriptions-item>
                    <el-descriptions-item label="到期时间">苏州市</el-descriptions-item>
                    <el-descriptions-item label="服务包价格">￥1188</el-descriptions-item>
                    <el-descriptions-item label="服务时间">2024-02-19 00:00:00至2024-03-1823:59:59</el-descriptions-item>
                    <el-descriptions-item label="服务周期">苏州市 1188 号</el-descriptions-item>
                    <el-descriptions-item label="签约时间">2024-02-19 15:43:40</el-descriptions-item>
                </el-descriptions>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: "signingRecords",
    data() {
        return {
            pickerOptions: {
                disabledDate(time) {
                    return time.getTime() > Date.now(); //禁止选择今天以后的时间
                },
            },
            //选择时间区间
            datePickerStart: "",
            datePickerEnd: "",
            //右侧标题选中
            recordindex: 0,
            //左侧类型选中
            categoryindex: 0,
            //左侧选中的item
            categoryItem: {},
            //左侧list
            categorylist: [{
                id: 1,
                name: '冠状动脉粥样硬化性心脏病',
                text: '冠状动脉粥样硬化性心脏病',
                time: '2022-02-02 10:33:00'
            }, {
                id: 2,
                name: '冠状动脉粥样硬化性心脏病',
                text: '冠状动脉粥样硬化性心脏病',
                time: '2022-02-02 10:33:00'
            }]
        };
    },
    created() {
        this.categoryItem = this.categorylist[0]
    },
    methods: {
        clickcategory(item, index) {
            this.categoryindex = index
            this.categoryItem = item
        }
    }
};
</script>
<style lang="scss" scoped>
.header {
    background-color: #fff !important;
    padding: 0 !important;
    display: flex;

    .rightheader {
        width: 75%;
        padding-top: 20px;
        border-left: 3px solid #DFE4ED;

        .richtext {
            width: 90%;
            margin: 0 auto;
            height: 450px;
        }
    }

    .leftheader {
        margin-top: 20px;
        width: 25%;
        height: 450px;
        overflow: scroll;
        // 隐藏表头的滚动条
        overflow-x: hidden !important;

        .selectitem {
            background-color: #D2E9FC;
            border-left: 2px solid #1890ff !important;
            border-bottom: 1px solid #fff !important;
        }

        .item {
            height: 120px;
            padding: 25px 10px;
            position: relative;
            border-left: 2px solid #fff;
            border-bottom: 1px solid #E7E7E7;

            .type {
                position: absolute;
                right: 10px;
                top: 20px;
                font-size: 12px;
            }

            .text {
                height: 20px;
                line-height: 20px;
                font-size: 12px;
                color: #999999;
            }

            .name {
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
                height: 30px;
                line-height: 30px;
                font-size: 18px;
                font-weight: 600;
            }

            .time {
                line-height: 20px;
                height: 20px;
                font-size: 14px;
            }
        }
    }
}
</style>
  