/*
 * Creator:     ML
 * CreatDate:   2019-12-13
 * descripts：  床位费用设置（医院关联床位费、护理单元关联床位费、床位费类型）
 * */
import React from 'react';
import { Tabs } from 'antd';
import './style/index.less';
import BedToHospital from './BedToHospital.jsx'; // 医院关联床位费
import BedToNursingUnit from './BedToNursingUnit.jsx'; // 护理单元关联床位费
import BedCostType from './BedCostType.jsx'; // 床位费类型
import BedCostTypeToMedItem from './BedCostTypeToMedItem.jsx'; // 床位费类型和费用项目
import BedCostToBedType from './BedCostToBedType.jsx'; // 房间类型和床位费类型
import BedCostToBed from './BedCostToBed.jsx'; // 床位关联床位费

const TabPane = Tabs.TabPane;

class TerminologySetTabs extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            prioritySelectData: []
        }
    }

    componentDidMount() {
        this.getSelectData();
    }

    // 获取初始化数据
    getSelectData = async () => {
        try {
            let res = await React.$asyncPost(this, '03060028');
            this.setState({ prioritySelectData: res?.result || [] });
        } catch (error) {
            console.log(error);
        }
    }

    render() {
        const { prioritySelectData } = this.state;
        return (
            <div className='outpatient-station-body' style={{ height: '100%' }}>
                <Tabs type="card" className='patient-tab-body' style={{ height: '100%' }} size='small' >
                    <TabPane tab={<span>医院关联床位费</span>} key="1">
                        <BedToHospital prioritySelectData={prioritySelectData} />
                    </TabPane>
                    <TabPane tab={<span>护理单元关联床位费</span>} key="2">
                        <BedToNursingUnit prioritySelectData={prioritySelectData} />
                    </TabPane>
                    <TabPane tab={<span>床位关联床位费</span>} key="5">
                        <BedCostToBed prioritySelectData={prioritySelectData} />
                    </TabPane>
                    <TabPane tab={<span>床位费类型</span>} key="3">
                        <BedCostType />
                    </TabPane>
                    <TabPane tab={<span>床位费类型关联费用项目</span>} key="6">
                        <BedCostTypeToMedItem />
                    </TabPane>
                    <TabPane tab={<span>房间类型关联床位费类型</span>} key="4">
                        <BedCostToBedType prioritySelectData={prioritySelectData} />
                    </TabPane>
                </Tabs>
            </div>
        )
    }
}

export default TerminologySetTabs;