/*
 * Creator:     ML
 * CreatDate:   2019-10-28
 * descripts：  科室设备维护维护表(科室,设备，科室设备维护表)
 * */
import React from 'react';
import {Card, Tabs, Divider} from 'antd';
import './style/index.less';
import Department from './component/Department.jsx'; // 科室
import Equipment from './component/Equipment.jsx'; // 设备
import DepartEquAssociated from './component/DepartEquAssociated.jsx'; //科室设备维护

const TabPane = Tabs.TabPane;

class DepartmentTabs extends React.Component {
    constructor(props) {
        super(props)
        var userData = JSON.parse(sessionStorage.getItem('userData'))
        this.state = {
            dataSource: [],
            total: 0,
            page: 1,
            pageSize: 10,
            userData: userData,
        }
    }
    componentDidMount() {
    }
    onRef=(ref)=>{
        this.departRef=ref
    }
    tabsChange=(key)=>{
        if(key=="3"){
            if(this.departRef){
                this.departRef.getNewEqu()
            }
        }
    }
    render() {
        return <div className='outpatient-station-body' style={{ height: '100%' }}>
            <Tabs type="card" className='patient-tab-body' size='small' onChange={this.tabsChange}>
                <TabPane  tab={<span>设备</span>} key="2">
                    <Equipment />
                </TabPane>
                <TabPane  tab={<span>科室设备维护表</span>} key="1">
                    <Department />
                </TabPane>
                <TabPane tab={<span>科室设备医嘱关联表</span>} key="3">
                    <DepartEquAssociated onRef={this.onRef}/>
                </TabPane>
            </Tabs>
        </div>
    }
}
export default DepartmentTabs;