/*
 * Creator:     ML
 * CreatDate:   2019-12-26
 * descripts：  治疗室--病人信息
 * */
import React from 'react';
import { Form, Row, Col, Input, Select, Button, DatePicker, Popconfirm, Modal, Table, Icon, Pagination, message, Divider, Tooltip } from 'antd';
import { $http } from 'containers/config/https';
import store from 'store';
import '../style/index.less'
import { Util, dayFormat } from 'tools/index';
const FormItem = Form.Item;
const Option = Select.Option;
const PatInfo = Form.create()(
    class PatInfo extends React.Component {
        constructor(props) {
            super(props)
            this.state = {
                titleData:{
                   
                }
            }
        }
        // componentWillReceiveProps(){
        //     this.props.onPat(this)
        // }
        componentDidMount() {
            // this.getInfo()
            this.props.onPat(this)
        }
        getInfo=()=>{
            let data = {}
            data = {
                params: [{
                    patID: this.props.record.patID||"",
                    // RequisitionId:this.props.record.patID||""
                }],
            }
            $http.post('urlS', this, {
                code: '01040168',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            titleData:res.result.dataPatient,
                        })
                    } else {

                    }
                }
            })
        }
         //国际化
         setMessage(name, message) {
            return this.props.localeProvider ? this.props.localeProvider[name][message] : ''
        }
        render() {
            const { getFieldDecorator } = this.props.form;
            const {} = this.state
            return (
                <div className="patDom">
                <Row>
                    <Col span={12}>
                    <div style={{ width: '100%', borderRight: '1px solid #EEEEEE', height: 79, display: 'flex', float: 'left' }}>
                           <div className={this.state.titleData && this.state.titleData.patSexCode == '1' ?
                                'splice-boy' : (this.state.titleData && this.state.titleData.patSexCode == '2' ? 'splice-girl' : 'splice-other')}></div>
                            <div style={{ height: 79, borderRight: '1px solid #EEEEEE' }}></div>
                            {!Util.isEmpty(this.state.titleData) ? <div style={{ fontSize: '16px' }}>
                                {/* <div style={{ padding: '10px 0 0 20px' }}></div> */}
                                <div style={{ padding: '10px 0 0 20px' }}>
                                    <span style={{ color: '#333333', fontWeight: 'bold', cursor: 'pointer' }}>
                                        {this.state.titleData ? this.state.titleData.patName || '--' : '--'}</span><Divider type="vertical" />
                                    <span>{this.state.titleData ? this.state.titleData.patSexDesc || '--' : '--'}</span><Divider type="vertical" />
                                    <span>{this.state.titleData ? this.state.titleData.patAge || '--' : '--'}</span><Divider type="vertical" />
                                    <span><Icon className='patNo-splice' />{this.state.titleData ? this.state.titleData.patNo || '--' : '--'}</span>
                                </div>
                                <div style={{ fontWeight: 400, color: '#666666', fontSize: '16px', padding: '10px 0 0 20px' }}>
                                    <span><Icon className='statusdesc-splice' />{this.state.titleData ? this.state.titleData.patSocialStatusDesc || '--' : '--'}</span><Divider type="vertical" />
                                    <span><Icon className='typeDesc-splice' />{this.state.titleData ? this.state.titleData.patTypeDesc || '--' : '--'}</span><Divider type="vertical" />
                                    <span>{/**{this.setMessage('DoctorAdviceModalAccount', 'descripts')} */}
                                        <span style={{ color: '#1999db' }}><Icon className='account-splice' />{this.state.titleData ? this.state.titleData.accountBalance || '--' : 0}</span> </span>
                                </div>
                            </div> : <span style={{ color: '#999999', lineHeight: '79px', marginLeft: '20%' }}>---</span>}
                </div>
                    </Col>
                    <Col span={12} style={{paddingLeft:"10px"}}>
                    <div>
                             <p style={{margin:"12px 0"}}><span style={{color:"#aaa"}}>{this.props.localeProvider && this.props.localeProvider.BookRecordTreatmentItems? this.setMessage('BookRecordTreatmentItems', 'descripts') : "治疗项目"} :</span><span>{this.props.record&&this.props.record.ordDetailDesc||""}</span></p>
                             <p style={{paddingLeft:"28px"}}><span style={{color:"#aaa"}}>{this.props.localeProvider && this.props.localeProvider.BookRecordDiagnosis? this.setMessage('BookRecordDiagnosis', 'descripts') : "诊断"} :</span><span>{this.props.record&&this.props.record.diag||""}</span></p>
                           </div></Col>
                </Row>
             
                </div>

            )
        }
    })
export default PatInfo    