// 退药申请
import React from 'react';
import { Card, Row, Col, DatePicker, Button, Input, Table, Select, message, Icon } from 'antd';
// import store from 'store';
// import { $http } from 'containers/config/https';
import InfectiousModel from './InfectiousModel.jsx';

let {Option} = Select;

export default class Infectious extends React.Component {
    constructor(props) {
        super(props);
        var userData = JSON.parse(sessionStorage.getItem('userData'));
        this.state = {
        admID: "",
      
        }
    }

    componentDidMount() {
     
    }

    // componentWillUnmount() {
    //     // 组件销毁前将静止让setState修改state的状态
    //     this.setState = (state,callback)=>{ return; }
    // }
    componentWillReceiveProps(nextProps) {
        if ((nextProps.admID != "")) {
            this.setState({
                admID:nextProps.admID,
            })      
        }
    }

    onColumnRef = (ref) => {
        this.columnRef = ref;
    }
    onRef = ref => {
        this.child = ref;
    }



    // 历史单据 
    handleHistoricalDocuments = () => {
        this.child.handleShowModal();
    }

  
 

    render() {
        return (
            <div className="hospital-pharmacies">
            <Row id="apply-for-refund-medicine" style={{padding: '0 24px'}}>
                <Col span={8} style={{textAlign: 'right'}}>
                    <Button
                        type="dashed"
                        style={{marginTop: '8px', width: '100px'}}
                        onClick={this.handleHistoricalDocuments}
                    >
                        历史单据
                    </Button>
                </Col>
            </Row>
    
            <InfectiousModel
             onRef={this.onRef}
             />
           
        </div>
        )
    }
}