// 医嘱项信息
import React from 'react';
import {Card, Row, Col, Form, DatePicker, Select, Checkbox, Switch, Input } from 'antd';
import { $http } from 'containers/config/https';
import { Util } from 'tools/index';
import Moment from 'moment';

const { Option } = Select;
const FormItem = Form.Item;
const formItemCheckbox  = {
    labelCol: {span: 14},
    wrapperCol: {span: 10}
};
const formItemItem  = {
    labelCol: {span: 11},
    wrapperCol: {span: 13}
};
const DoctorOrderInformation = Form.create()(
class  extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            language: JSON.parse(window.sessionStorage.userData),
            userInfo: {},
            SelectData: {},
        }
    }

    componentDidMount() {
        this.props.onRef(this);
    }

    render() {
        const { getFieldDecorator } = this.props.form;
        const ChineseEnglishSize = this.props.ChineseEnglishSize;
        const userInfo = this.props.userInfo;
        return (
            <Card
                type="inner"
                title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.HosMaterialInfoMaintenanceMedicalOrder ? ChineseEnglishSize.HosMaterialInfoMaintenanceMedicalOrder.descripts:'医嘱项'}</div>}
                size="small"
            >
                <Col >
                    <Row>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedCode ? ChineseEnglishSize.HosMaterialInfoMaintenancemedCode.descripts:'医嘱项代码：'} {...formItemItem}>
                                {getFieldDecorator('medCode', {
                                    initialValue: userInfo.medCode ? userInfo.medCode : undefined,
                                })(
                                    <Input style={{width: '100%'}} disabled/>
                                )}
                            </FormItem>
                        </Col>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedDesc ? ChineseEnglishSize.HosMaterialInfoMaintenanceOrderDescription.descripts:'医嘱项描述：'} {...formItemItem}>
                                {getFieldDecorator('medDesc', {
                                    initialValue: userInfo.medDesc ? userInfo.medDesc : undefined,
                                })(
                                    <Input style={{width: '100%'}} disabled />
                                )}
                            </FormItem>
                        </Col>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedShortDesc ? ChineseEnglishSize.HosMaterialInfoMaintenancemedShortDesc.descripts:'简称：'} {...formItemItem}>
                                {getFieldDecorator('medShortDesc', {
                                    initialValue:  userInfo.medShortDesc ? userInfo.medShortDesc : undefined,
                                })(
                                    <Input style={{width: '100%'}} disabled />
                                )}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedSubCatDesc ? ChineseEnglishSize.HosMaterialInfoMaintenancemedSubCatDesc.descripts:'医嘱子类：'} {...formItemItem}>
                                {getFieldDecorator('medSubCatID', {
                                    initialValue:   userInfo.medSubCatDesc ? userInfo.medSubCatDesc : undefined,
                                })(
                                    <Input style={{width: '100%'}} disabled />
                                )}
                            </FormItem>
                        </Col>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedPriorityDesc ? ChineseEnglishSize.HosMaterialInfoMaintenancemedPriorityDesc.descripts:'医嘱优先级：'} {...formItemItem}>
                                {getFieldDecorator('medPriorityID', {
                                    initialValue:  userInfo.medPriorityDesc ? userInfo.medPriorityDesc : undefined,
                                })(
                                    <Input style={{width: '100%'}} disabled />
                                )}
                            </FormItem>
                        </Col>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedUnitDesc ? ChineseEnglishSize.HosMaterialInfoMaintenancemedUnitDesc.descripts:'计价单位：'} {...formItemItem}>
                                {getFieldDecorator('medUnitID', {
                                    initialValue:   userInfo.medUnitDesc ? userInfo.medUnitDesc : undefined,

                                })(
                                    <Input style={{width: '100%'}} disabled />
                                )}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancestockStartDate ? ChineseEnglishSize.HosMaterialInfoMaintenancestockStartDate.descripts:'生效日期：'} {...formItemItem}>
                                {getFieldDecorator('medStartDate', {
                                    initialValue: userInfo.medStartDate ? Moment(userInfo.medStartDate) : undefined,
                                })(
                                    <DatePicker
                                        format="YYYY-MM-DD"
                                        style={{width:'100%'}}
                                        disabled
                                        placeholder=' '
                                    >
                                    </DatePicker>
                                )}
                            </FormItem>
                        </Col>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedEndDate ? ChineseEnglishSize.HosMaterialInfoMaintenancemedEndDate.descripts:'失效日期：'} {...formItemItem}>
                                {getFieldDecorator('medStopDate', {
                                    initialValue: userInfo.medStopDate ? Moment(userInfo.medStopDate) : undefined,
                                })(
                                    <DatePicker
                                        format="YYYY-MM-DD"
                                        style={{width:'100%'}}
                                        disabled
                                        placeholder=' '
                                    >
                                    </DatePicker>
                                )}
                            </FormItem>
                        </Col>
                        <Col span={8}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedMessage ? ChineseEnglishSize.HosMaterialInfoMaintenancemedMessage.descripts:'医嘱提示'} {...formItemItem}>
                                {getFieldDecorator('medMessage', {
                                    initialValue: userInfo.medMessage ? userInfo.medMessage : undefined,
                                })(
                                    <Input style={{width: '100%'}} disabled />
                                )}
                            </FormItem>
                        </Col>
                    </Row>
                    <Row>
                        <Col span={6}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedNoAloneOrder ? ChineseEnglishSize.HosMaterialInfoMaintenancemedNoAloneOrder.descripts:'独立医嘱：'} {...formItemCheckbox}>
                                {getFieldDecorator('medNoAloneOrder', {
                                    valuePropName: 'checked',
                                    initialValue: userInfo.medNoAloneOrder === 'Y' ? true : false,
                                })(
                                    this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                                )}
                            </FormItem>
                        </Col>
                        <Col span={6}>
                            <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemedNoStockFlag ? ChineseEnglishSize.HosMaterialInfoMaintenancemedNoStockFlag.descripts:'无库存医嘱：'} {...formItemCheckbox}>
                                {getFieldDecorator('medNoStockFlag', {
                                    valuePropName: 'checked',
                                    initialValue:  userInfo.medNoStockFlag === 'Y' ? true : false,
                                })(
                                    this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                                )}
                            </FormItem>
                        </Col>
                    </Row>
                </Col>
            </Card>
        )
    }
});
export default DoctorOrderInformation;