/** 
 * Creator:     JYW
 * CreatDate:   2019-05-06
 * descripts：  置皮试结果
*/
import React from 'react'
import { Modal, DatePicker, TimePicker, Col, Select, message, Input, Switch, Tag } from 'antd';
import { $http } from '../../../containers/config/https';
import Moment from 'moment';

const Option = Select.Option;
class SkinTest extends React.Component {

    constructor() {
        super();
        this.state = {
        }
    }
    componentWillUnmount() {
        this.setState = (state, callback) => {
            return
        }
    }
    render() {
        let Execute = (this.props.visible ?
            <div style={{ width: "100%", height: "80%" }}>
                {
                    /**皮试计时 */
                    (this.props.type !== "S") ? (
                        <div style={{ textAlign: 'center' }}>
                            <Col span={12} style={{ paddingBottom: "12px" }}>
                                阴性
                                <Switch

                                    checked={this.props.result}
                                    checkedChildren="阳"
                                    unCheckedChildren="阴"
                                    onChange={this.props.onSwitchChange.bind(this, "result")}
                                />
                                阳性
                            </Col>
                            <Col span={12} style={{ paddingBottom: "12px" }}>药品批号:
                                <Input
                                    placeholder="药品批号"
                                    style={{ width: "138px" }}
                                    value={this.props.batchNumber}
                                    disabled={this.props.type === "A" ? true : false}
                                    onChange={this.props.onInputChange.bind(this, "batchNumber")}
                                />
                            </Col>
                            <Col span={12} style={{ paddingBottom: "12px" }}>
                                <span>结果日期:</span>
                                <DatePicker
                                    onChange={this.props.handleDateTimeChange.bind(this, "setDate")}
                                    disabled={this.props.type === "A" ? true : false}
                                    value={this.props.setDate === "" ? null : Moment(this.props.setDate, 'YYYY-MM-DD')}
                                    style={{ width: '138px' }}
                                >

                                </DatePicker>
                            </Col>
                            <Col span={12} style={{ paddingBottom: "12px" }}>
                                结果时间:
                                <TimePicker
                                    onChange={this.props.handleDateTimeChange.bind(this, "setTime")}
                                    disabled={this.props.type === "A" ? true : false}
                                    value={this.props.setTime === "" ? null : Moment(this.props.setTime, 'HH:mm:ss')}
                                    style={{ width: '138px' }}
                                >
                                </TimePicker>
                            </Col>
                            <Col span={12} style={{ paddingBottom: "12px" }}>
                                复核日期:
                                <DatePicker
                                    onChange={this.props.handleDateTimeChange.bind(this, "auditDate")}
                                    disabled={this.props.type === "U" ? true : false}
                                    value={this.props.auditDate === "" ? null : Moment(this.props.auditDate, 'YYYY-MM-DD')}
                                    style={{ width: '138px' }}
                                >

                                </DatePicker>
                            </Col>
                            <Col span={12} style={{ paddingBottom: "12px" }}>
                                复核时间:
                                <TimePicker
                                    onChange={this.props.handleDateTimeChange.bind(this, "auditTime")}
                                    disabled={this.props.type === "U" ? true : false}
                                    value={this.props.auditTime === "" ? null : Moment(this.props.auditTime, 'HH:mm:ss')}
                                    style={{ width: '138px' }}
                                >
                                </TimePicker>
                            </Col>
                        </div>
                    ) : (
                            <div style={{ textAlign: 'center' }}>
                                <Col style={{ textAlign: 'center' }}>
                                    开始日期:
                                <DatePicker
                                        onChange={this.props.handleDateTimeChange.bind(this, "startDate")}
                                        value={this.props.startDate === "" ? null : Moment(this.props.startDate, 'YYYY-MM-DD')}
                                        style={{ width: '138px', padding: '0 0 10px 12px' }}
                                    >

                                    </DatePicker>
                                </Col>
                                <Col style={{ textAlign: 'center' }}>
                                    开始时间:
                                <TimePicker
                                        onChange={this.props.handleDateTimeChange.bind(this, "startTime")}
                                        value={this.props.startTime === "" ? null : Moment(this.props.startTime, 'HH:mm:ss')}
                                        style={{ width: '138px', padding: '0 0 10px 12px' }}
                                    >
                                    </TimePicker>
                                </Col>
                                <Col>计时:
                                    <Input style={{ width: '138px' }}
                                        placeholder="皮试计时"
                                        value={this.props.timeimg}
                                        onChange={this.props.onInputChange.bind(this, "timeimg")}
                                    />
                                    分钟</Col>
                                <Col style={{ paddingTop: '20px' }}>
                                    开始计时<Switch
                                        style={{ marginLeft: '3px' }}
                                        checked={this.props.timingFlag}
                                        onChange={this.props.onSwitchChange.bind(this, "timingFlag")}
                                    /> 重新计时
                                </Col>
                            </div>
                        )
                }


            </div> : ""
        )
        return (
            <Modal
                title={this.props.button === "" ? "" : this.props.button.descripts}
                width={this.props.type === "S" ? '308px' : '478px'}
                className='SignOrd'
                visible={this.props.visible}
                onOk={this.props.onOk}
                onCancel={this.props.onClose}
                style={{
                    height: '268px',
                    background: '#FFFFFF',
                    borderRadius: '6px',
                    top: '357px'
                }}
                bodyStyle={{
                    height: '220px'
                }}
                okText={this.props.okTitle}
                okButtonProps={{ disabled: this.props.okDisabled }}
                cancelText="取消"
                destroyOnClose
                maskClosable={false}
            >
                {
                    Execute
                }
                {/* <Col style={{ textAlign: 'center' }}>剩余时间:
                        <Input style={{ width: '100px' }}
                        value={this.state.remainderTime}
                        disabled={true}
                    />
                    分钟</Col> */}
            </Modal>
        );
    }

}
export default SkinTest;