// 储存条件
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}
};
class StorageConditionClass extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            language: JSON.parse(window.sessionStorage.userData),
            userInfo: {},
            ChineseEnglishSize: {},
            SelectData: {},
        }
    }

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

    render() {
        const { getFieldDecorator } = this.props.form;
        const userInfo = this.props.userInfo;
        const ChineseEnglishSize = this.props.ChineseEnglishSize;
        return (
            <Card
                type="inner"
                title={<div className="card-title-left-icon"><div></div>{ChineseEnglishSize.HosMaterialInfoMaintenancestorageConditions ? ChineseEnglishSize.HosMaterialInfoMaintenancestorageConditions.descripts:'存储条件'}</div>}
                size="small"
            >
                <Row>
                    <Col span={8}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenanceminTemp ? ChineseEnglishSize.HosMaterialInfoMaintenanceminTemp.descripts:'最低温度(°C)：'} {...formItemItem}>
                            {getFieldDecorator('minTemp', {
                                initialValue:  userInfo.minTemp ? userInfo.minTemp : undefined,
                            })(
                                <Input style={{width: '100%'}} type="number" className="input-number" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancecommonTemp ? ChineseEnglishSize.HosMaterialInfoMaintenancecommonTemp.descripts:'常温：'} {...formItemCheckbox}>
                            {getFieldDecorator('commonTemp', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.commonTemp === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenanceradiation ? ChineseEnglishSize.HosMaterialInfoMaintenanceradiation.descripts:'防辐射：'} {...formItemCheckbox}>
                            {getFieldDecorator('radiation', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.radiation === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancecoldST ? ChineseEnglishSize.HosMaterialInfoMaintenancecoldST.descripts:'冷藏：'} {...formItemCheckbox}>
                            {getFieldDecorator('coldST', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.coldST === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span={8}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemaxTemp ? ChineseEnglishSize.HosMaterialInfoMaintenancemaxTemp.descripts:'最高温度(°C)：'} {...formItemItem}>
                            {getFieldDecorator('maxTemp', {
                                initialValue: userInfo.maxTemp ? userInfo.maxTemp : undefined,
                            })(
                                <Input style={{width: '100%'}} type="number" className="input-number" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancedry ? ChineseEnglishSize.HosMaterialInfoMaintenancedry.descripts:'干燥：'} {...formItemCheckbox}>
                            {getFieldDecorator('dry', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.dry === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenanceseal ? ChineseEnglishSize.HosMaterialInfoMaintenanceseal.descripts:'熔封：'} {...formItemCheckbox}>
                            {getFieldDecorator('seal', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.seal === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancefreeze ? ChineseEnglishSize.HosMaterialInfoMaintenancefreeze.descripts:'冷冻：'} {...formItemCheckbox}>
                            {getFieldDecorator('freeze', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.freeze === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span={8}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenanceminHumidity ? ChineseEnglishSize.HosMaterialInfoMaintenanceminHumidity.descripts:'最低湿度：'} {...formItemItem}>
                            {getFieldDecorator('minHumidity', {
                                initialValue: userInfo.minHumidity ? userInfo.minHumidity : undefined,
                            })(
                                <Input style={{width: '100%'}} type="number" className="input-number" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenanceairtight ? ChineseEnglishSize.HosMaterialInfoMaintenanceairtight.descripts:'封闭：'} {...formItemCheckbox}>
                            {getFieldDecorator('airtight', {
                                valuePropName: 'checked',
                                initialValue: userInfo.airtight === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancegloomyCool ? ChineseEnglishSize.HosMaterialInfoMaintenancegloomyCool.descripts:'凉暗：'} {...formItemCheckbox}>
                            {getFieldDecorator('gloomyCool', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.gloomyCool === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancedampProof ? ChineseEnglishSize.HosMaterialInfoMaintenancedampProof.descripts:'防潮：'} {...formItemCheckbox}>
                            {getFieldDecorator('dampProof', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.dampProof === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                </Row>
                <Row>
                    <Col span={8}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemaxHumidity ? ChineseEnglishSize.HosMaterialInfoMaintenancemaxHumidity.descripts:'最高湿度：'} {...formItemItem}>
                            {getFieldDecorator('maxHumidity', {
                                initialValue: userInfo.maxHumidity ? userInfo.maxHumidity : undefined,
                            })(
                                <Input style={{width: '100%'}} type="number" className="input-number" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancedark ? ChineseEnglishSize.HosMaterialInfoMaintenancedark.descripts:'遮光：'} {...formItemCheckbox}>
                            {getFieldDecorator('dark', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.dark === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={5}>
                        <FormItem label={ChineseEnglishSize.HosMaterialInfoMaintenancemeltPack ? ChineseEnglishSize.HosMaterialInfoMaintenancemeltPack.descripts:'密封：'} {...formItemCheckbox}>
                            {getFieldDecorator('meltPack', {
                                valuePropName: 'checked',
                                initialValue:  userInfo.meltPack === 'Y' ? true : false,
                            })(
                                this.state.language.language == "EN" ?   <Switch checkedChildren="yes" unCheckedChildren="no" disabled />:  <Switch checkedChildren="是" unCheckedChildren="否" disabled />
                            )}
                        </FormItem>
                    </Col>
                </Row>
            </Card>
        )
    }
};
let StorageCondition = Form.create()(StorageConditionClass);
export default StorageCondition;