/*
* 编辑通道
* */

import React, { Component } from 'react';
import { Input, Form, Select, Modal, Button,DatePicker } from 'antd';
import {Util} from 'tools/index';
import '../style/index.less';
import moment from 'moment';

const Option = Select.Option;
const FormItem = Form.Item;

class ConfirmModal extends Component {

    constructor(props) {
        super(props);
        this.state = {
        }
    }

    componentWillReceiveProps(nextProp) {
        if (!this.props.isShow && nextProp.isShow === true) {
            
        } else if (this.props.isShow === false) {
            this.cleanInput();
        }
    }

    closeModal() {
        let { onHide } = this.props;
        onHide && onHide();
        this.cleanInput();
    }

    //清空输入框
    cleanInput() {
        this.props.form.resetFields();
    }

    //提交
    onSubmit() {
        let { validateFields } = this.props.form;
        validateFields({ force: true }, (err, params) => {
            if (err) {
                return;
            }
            let { onSubmit } = this.props;

            onSubmit && onSubmit();
        });
    }

    render() {
        let { getFieldDecorator, getFieldValue } = this.props.form;
        let formItemLayout = {
            labelCol: { span: 5 },
            wrapperCol: { span: 19 }
        };

        var modalData = this.props.modalData;

        //所属医院下拉参数
        let hospitalOption = [];
        // this.props.hospitalData && this.props.hospitalData.map((item, index) => {
        //     hospitalOption.push(<Option key={index} value={item.id + ''}>{item.descripts}</Option>)
        // })

        return <Modal className='timeSoltModal'
            title={'生成排班'}
            maskClosable={false}
            visible={this.props.isShow}
            onCancel={this.closeModal.bind(this)}
            onOk={this.onSubmit.bind(this)}>
            <div>
                <h4>确定生成排班吗？</h4>
                <h4>生成排班后，已生成排班不能重复再生成</h4>
                <h4>如需调整排班，可双击设置！</h4>
            </div>
        </Modal>
    }
}

export default Form.create()(ConfirmModal);