/*
* 取消预约
* */
import React, { Component } from 'react';
import { Modal, Divider } from 'antd';
import { Util } from 'tools/index';
import '../style/index.less';

class CancelOrderModal extends Component {
    closeModal(name) {
        let { onHide } = this.props;
        onHide && onHide();
    }

    //提交
    onSubmit() {
        let { onSubmit } = this.props;
        onSubmit && onSubmit(this.state.repaywinfo);
    }

    changeHopsitalId(name, e) {
        var id = '';
        if (e) {
            id = e.substring(e.indexOf('^') + 1)
        }
        this.setState({
            [name]: id
        })
    }

    render() {
        return (
            <div>
                <Modal className="registr-modal-order"
                    title={'确认取消预约'}
                    maskClosable={false}
                    visible={this.props.isShow}
                    onCancel={this.closeModal.bind(this)}
                    onOk={this.onSubmit.bind(this)}>
                    <div>
                        <div style={{ display: 'flex' }}><div className="border-radius-registr"></div>
                            <div style={{ marginLeft: 10, fontWeight: 'bold' }}>预约信息</div></div>
                        <span>{this.props.patientMsg ? this.props.patientMsg.patNo : undefined}</span><Divider type="vertical" />
                        <span>{this.props.patientMsg ? this.props.patientMsg.patName : undefined}</span><Divider type="vertical" />
                        <span>{this.props.patientMsg ? this.props.patientMsg.patSexDesc : undefined}</span><Divider type="vertical" />
                        <span>{this.props.patientMsg ? this.props.patientMsg.patAge : undefined}</span><Divider type="vertical" />
                        <span>居民身份证&nbsp;&nbsp;{this.props.patientMsg ? this.props.patientMsg.patCredNo : undefined}</span><Divider type="vertical" />
                        <span>{this.props.patientMsg ? this.props.patientMsg.patMobile : undefined}</span>
                    </div>
                    <div style={{ marginTop: 20 }}>
                        <div style={{ float: 'left', marginLeft: 30 }}>
                            <span><span style={{ background: '#F5F4F4' }}>挂号科室：</span>
                                <span>{Util.isEmpty(this.props.recordData) ? undefined : this.props.recordData.locDescripts}</span>
                            </span><br />

                            <span><span style={{ background: '#F5F4F4' }}>费用(元)：</span>
                                <span style={{ color: '#FA8C16' }}>{Util.isEmpty(this.props.recordData) ? undefined :
                                    (parseFloat(this.props.recordData.examinFee) + parseFloat(Util.isEmpty(this.props.recordData.regFee) ? 0 : this.props.recordData.regFee))}</span>
                            </span><br />
                            <span><span style={{ background: '#F5F4F4' }}>预约时间：</span>
                                <span>{Util.isEmpty(this.props.recordData) ? undefined : this.props.recordData.bookDateTime}</span>
                            </span>
                        </div>

                        <div style={{ float: 'right', marginRight: 50 }}>
                            <span><span style={{ background: '#F5F4F4' }}>预约医生：</span>
                                <span>{Util.isEmpty(this.props.recordData) ? undefined : this.props.recordData.docName}</span>
                            </span><br />
                            <span><span style={{ background: '#F5F4F4' }}>缴费状态：</span>
                                <span style={{ color: '#FA8C16' }}>未缴费</span>
                            </span>
                        </div>
                    </div>
                    <br />
                </Modal>
            </div>
        )
    }
};

export default CancelOrderModal;