// 医疗机构注册
import React from 'react';
import { Link } from 'react-router-dom'
import {
    Layout, Form, Carousel, Input, Button, Row, Col, Steps, Select, DatePicker, Modal, Icon, Cascader, Upload, message
} from 'antd';
import moment from "moment"
import '../../assets/css/login.css'
import { $http } from '../../containers/config/https';
import { httpConfig } from '../../containers/config/httpConfig'
import { Aes, Keup } from '../../tools/index';
import RangeDatePicker from 'components/rangePicker/index';
import '../userInformation/style/index.less';

const Option = Select.Option;
const Step = Steps.Step;

const formItemLayout = {    // label 和input宽度
    labelCol: { span: 6 },
    wrapperCol: { span: 18 },
};


class RegistrationOfInstitutions extends React.Component {
    constructor(props) {
        super(props)
        this.state = {
            current: 0,
            logintext: '基本资料',
            displayBtn: {
                display_prev: 'none',
                display_next: 'block',
                display_register: 'none',
            },
            //注册页面初始值
            sexData: [], // 性别集合
            credtypeData: [], // 证件类型集合
            languageData: [], // 语言集合
            hospitalData: [], // 医院集合
            groupData: [], // 岗位集合
            experiseData: [], // 专长集合
            titleData: [], // 职称集合
            DeptDrData: [{ id: 0, descripts: "" }], // 科室集合
            openSelect1: false,  //展开select
            openSelect2: false,  //展开select
            openSelect5: false,  //展开select
            openSelect6: false,  //展开select
            openSelect7: false,  //展开select
            openSelect8: false,  //展开select
            contentH: '',  //content高度
            StartDate: undefined,  // //开始日期
            EndDate: undefined,  // //结束日期
            languageCode: 'CN',// 国际化标识
            languageData2: {}, // 国际化语言包
            language: {},   // 国际化语言
            selectData1: [],
            selectData2: [],
            selectData3: [],
            provinceArr: [], // 省
            cityArr: [], // 市
            areasArr: [], // 区
            VillagesArr: [], // 乡
            provIDDr: "", // 省
            cityIDDr: "", // 市
            areaIDDr: "", // 区
            villageDr: "", // 乡

        }
    }

    componentDidMount() {
        Keup.UnTab(["title", "post", "passWord2"]);   //禁用组件tab脚本 UnTab([id1,id2,id3])

        this.contentHeight();   // 获取content的高度

        this.CNEN() // 国际化
        this.selectData1()

        this.selectData2()

        this.selectData3()

        this.getProvince("") // 省份
    }


    //点击切换中英文
    handleLanguage = (languageCode) => {
        this.setState({
            languageCode: languageCode === "CN" ? "EN" : "CN",
        }, () => {
            this.LanCNEN(this.state.languageCode)
        })
    }


    // 国际化
    CNEN = () => {
        var data = {
            params: [{
                "reactCode": ['Register'],
                "compontName": "Register",
                "type": "C"
            }]
        }

        $http.post('urlDeault', this, {
            code: "01040073",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.setState({
                        languageData2: res.result.language || {},  // 国际化语言包
                    }, () => {
                        this.LanCNEN(this.state.languageCode)
                    })
                }
            }
        });
    }

    // 经营性质
    selectData1 = () => {
        var data = {
            params: [{
            }]
        }

        $http.post('urlS', this, {
            code: "05100290",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.setState({
                        selectData1: res.result.Data || [],  // 国际化语言包
                    })
                }
            }
        });
    }

    // 机构类别
    selectData2 = () => {
        var data = {
            params: [{
            }]
        }

        $http.post('urlDeault', this, {
            code: "05100288",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.setState({
                        selectData2: res.result.Data || [],  // 国际化语言包
                    })
                }
            }
        });
    }

    // 机构级别
    selectData3 = () => {
        var data = {
            params: [{
            }]
        }

        $http.post('urlDeault', this, {
            code: "05100289",
            data: data,
            success: function (res) {
                let errorCode = res.errorCode;
                if (errorCode === '0') {
                    this.setState({
                        selectData3: res.result || [],  // 国际化语言包
                    })
                }
            }
        });
    }

    LanCNEN = (code) => {
        let { languageData2 } = this.state
        this.setState({
            language: languageData2[code]
        })
    }

    startChange(date) {
        this.setState({
            StartDate: date,
        })
    }

    endChange(date) {
        this.setState({
            EndDate: date,
        })
    }




    //  上一步
    prevBtn = () => {
        this.refs.setCarouselRef.prev();
    }

    //  下一步
    nextBtn = () => {
        let num = this.state.current
        switch (num) {
            case 0:
                this.props.form.validateFields(['descripts', 'nature', 'principal', 'legalPerson', 'authority', 'registerNumber', 'issueDate', 'applyDate', 'detailedAddress', 'businesslicense', 'institutionType', 'level', 'mobile', '',], (err, values) => { //'descripts', 'sex', 'credType', 'credNo', 'birthdate', 'mobile', 'title','identifyCode'
                    if (!err) {
                        this.refs.setCarouselRef.next();
                    } else {
                        return false;
                    }
                });
                break;
            default:
                break;
        }
    }


    // 开始日期选择限制
    disabledStDate(current) {
        // 开始日期不能选择今天和之前的日期
        return current && current > moment().endOf('day');
    }



    //  切换
    onChange = (a) => {
        let { language } = this.state
        switch (a) {
            case 0:
                this.setState({
                    current: 0,
                    logintext: language.BasicData && language.BasicData.descripts,
                    displayBtn: {
                        display_prev: 'none',
                        display_next: 'block',
                        display_register: 'none',
                    },
                })

                break;
            case 1:
                this.setState({
                    current: 1,
                    logintext: '上传证件',
                    displayBtn: {
                        display_prev: 'block',
                        display_next: 'none',
                        display_register: 'block',
                    }
                })
                break;
            // case 2:
            //     this.setState({
            //         current: 2,
            //         logintext: '密码设置',
            //         displayBtn: {
            //             display_prev: 'block',
            //             display_next: 'none',
            //             display_register: 'block',
            //         }
            //     })
            //     break;
            default:
                break;
        }
    }





    // 获取content的高度
    contentHeight = (e) => {
        let contenth = parseInt(document.body.clientHeight) - 160;
        this.setState({
            contentH: contenth
        })
    }

    // 省
    getProvince = (countryID = '') => {
        let data = {
            params: [{
                countryId: countryID
            }],
        }
        $http.post('urlS', this, {
            code: '03030024',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    let reC = res.result
                    reC.map((item, i) => {
                        item.isLeaf = false
                        item.PC = 1   // 判断省市
                    })
                    this.setState({
                        provinceArr: reC
                    })
                }
            }
        })
    }
    // 市区
    getCity = (provinceID, callback) => {
        let data = {
            params: [{
                provinceId: provinceID
            }],
        }
        $http.post('urlS', this, {
            code: '03030025',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    let reC = res.result
                    reC.map((item, i) => {
                        item.isLeaf = false
                        item.PC = 2   // 判断省市
                    })
                    callback(reC)
                    this.setState({
                        cityArr: reC,
                    })
                }
            }
        })
    }
    //选择市 加载县
    getAreas = (cityID, callback) => {
        let data = {
            params: [{
                cityId: cityID
            }],
        }
        $http.post('urlS', this, {
            code: '03030006',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    let reC = res.result
                    reC.map((item, i) => {
                        item.isLeaf = false
                        item.PC = 3   // 判断省市
                    })
                    callback(reC)
                    this.setState({
                        areasArr: reC,
                    })
                }
            }
        })
    }
    //选择县时加载乡数据
    getVillages = (countyID, callback) => {
        let data = {
            params: [{
                areaId: countyID,
            }],
        }
        $http.post('urlS', this, {
            code: '03030007',
            data: data,
            success: function (res) {
                if (+res.errorCode === 0) {
                    let reC = res.result
                    reC.map((item, i) => {
                        item.isLeaf = false
                        item.PC = 4   // 判断省市
                    })
                    callback(reC)
                    this.setState({
                        VillagesArr: reC,
                    })
                }
            }
        })
    }

    onChangeCader = (value, selectedOptions) => {
        // let pc = selectedOptions[0].PC
        // switch (pc) {
        //     case 1:
        //         this.getCity(value[0]) // 市区
        //         break;
        //     case 2:
        //         this.getAreas(value[0]) // 县
        //         break;
        //     case 3:
        //         this.getVillages(value[0]) // 乡
        //         break;
        //     case 4:

        //         break;
        //     default:
        //         break;
        // }
        console.log(value, selectedOptions);
    };

    loadData = selectedOptions => {
        const targetOption = selectedOptions[selectedOptions.length - 1];
        targetOption.loading = true;
        console.log(targetOption)
        setTimeout(() => {
            targetOption.loading = false;
            let pc = targetOption.PC
            switch (pc) {
                case 1:
                    this.getCity(targetOption.id, (reC) => {
                        targetOption.children = reC // 市区
                    }) // 市区

                    this.setState({
                        provIDDr: targetOption.id || "", // 省
                    })
                    break;
                case 2:
                    this.getAreas(targetOption.id, (reC) => {
                        targetOption.children = reC // 县
                    })
                    this.setState({
                        cityIDDr: targetOption.id || "", // 省
                    })
                    break;
                case 3:
                    this.getVillages(targetOption.id, (reC) => {
                        targetOption.children = reC //乡
                    })
                    this.setState({
                        areaIDDr: targetOption.id || "", // 省
                    })
                    break;
                case 4:
                    this.setState({
                        villageDr: targetOption.id || "", // 省
                    })
                    break;
                default:
                    break;
            }

            this.setState({
                provinceArr: [...this.state.provinceArr],
            });
        }, 10);
    };


    //  注册账号表单提交
    handleSubmit = (e) => {
        e.preventDefault();
        let { EndDate, StartDate, provIDDr, cityIDDr, areaIDDr, villageDr } = this.state
        this.props.form.validateFields((err, values) => {
            if (!err) {
                let data = {
                    "params": [{
                        descripts: values.descripts || '',//       	; 机构名称
                        principal: values.principal || '',// 	 			; 主要负责人
                        legalPerson: values.legalPerson || '',//     		; 法定代表人
                        registerNumber: values.registerNumber || '', // 	; 许可登记号
                        businesslicense: values.businesslicense || '', // 	; 营业执照号码
                        institutionType: values.institutionType || '', //   ; 机构类别
                        level: values.level || '', //      					; 机构级别
                        nature: values.nature || '', //    				; 经营性质
                        startDate: StartDate || '', //      			; 机构生效日期
                        stopDate: EndDate || '', //  			; 机构失效日期
                        authority: values.authority || '', //     			; 发证机关
                        issueDate: values.issueDate || '', //    			; 发证日期
                        applyDate: values.applyDate || '', //     			; 机构申请日期
                        provIDDr: provIDDr || '', // 		; 省
                        cityIDDr: cityIDDr || '',//  			; 市
                        areaIDDr: areaIDDr || '', //    			; 区
                        villageDr: villageDr || '', // 			; 乡
                        detailedAddress: values.detailedAddress || '', // ; 详细地址
                        image: values.image || '', // 				;图片地址,由global获取
                        mobile: values.mobile || '', // 				;手机号
                        comments: values.comments || '', //   			;备注

                    }]
                };
                $http.post('urlDeault', this, {
                    code: "05100286",
                    data: data,
                    success: function (res) {
                        let errorCode = res.errorCode;
                        if (errorCode === '0') {
                            message.success(res.errorMessage)
                        }
                    }
                });
            }
        });
    }

    render() {
        const { getFieldDecorator } = this.props.form;
        let { languageCode, language, current, imageUrl1, imageUrl2, imageUrl3 } = this.state;
        const {
            Header, Footer, Content,
        } = Layout;
        const steps = [{
            title: language.RegisterBasic && language.RegisterBasic.descripts,
        }, {
            title: '上传证件',
        }];
        // , {
        //     title: '密码设置',
        // }

        const uploadButton = (
            <div>
                <Icon type={this.state.loading ? 'loading' : 'plus'} />
                <div className="ant-upload-text">Upload</div>
            </div>
        );

        return (
            <div>
                <Layout>
                    <Content style={{ height: this.state.contentH }} className="loginContent regContent">
                        <div className="registerBody" style={{ width: '1200px' }}>
                            <div className="regHeader mB30" style={{ marginBottom: '30px' }}>
                                <div className="regTittle">医疗机构注册</div>
                            </div>
                            <div >
                                <div className="mB30">
                                    <Row>
                                        <Col span={23} offset={1}>
                                            <Steps current={current} className="fontBlue" labelPlacement="vertical " >
                                                {steps.map((item, i) => <Step key={i} title={item.title} />)}
                                            </Steps>
                                        </Col>
                                    </Row>
                                </div>
                                <Form onSubmit={this.handleSubmit} className="login-form register-form">
                                    <Carousel ref='setCarouselRef' afterChange={this.onChange} dots="false">
                                        <div >
                                            <Row className="mB10">
                                                <Col span={12} >
                                                    <Form.Item label='机构名称' {...formItemLayout}>
                                                        {getFieldDecorator('descripts', {
                                                            rules: [{ required: true, message: language.RegisterName && language.RegisterName.message }],
                                                        })(
                                                            <Input allowClear={true} placeholder={language.RegisterName && language.RegisterName.message} />
                                                        )}
                                                    </Form.Item>
                                                </Col>

                                                <Col span={12} >
                                                    <Form.Item label='经营性质'  {...formItemLayout}>
                                                        {getFieldDecorator('nature', {
                                                            rules: [{ required: true, message: language.Registersex && language.Registersex.message }],
                                                        })(
                                                            <Select allowClear placeholder={language.Registersex && language.Registersex.message}  >
                                                                {this.state.selectData1.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                                            </Select>
                                                        )}
                                                    </Form.Item>
                                                </Col>
                                            </Row>
                                            <Row className="mB10">
                                                <Col span={12} >
                                                    <Form.Item label="主要负责人" {...formItemLayout}>
                                                        {getFieldDecorator('principal', {
                                                            rules: [{ required: true, message: language.RegisterDocument && language.RegisterDocument.message }],
                                                        })(
                                                            <Input allowClear={true} placeholder={language.RegisterName && language.RegisterName.message} />
                                                        )}
                                                    </Form.Item>
                                                </Col>
                                                <Col span={12} >
                                                    <Form.Item label="有效期限" {...formItemLayout}>
                                                        <span style={{ display: 'inline-block', verticalAlign: 'middle' }}><RangeDatePicker format='YYYY-MM-DD' width='100%'
                                                            startDate={this.state.StartDate} endDate={this.state.EndDate} startChange={this.startChange.bind(this)} endChange={this.endChange.bind(this)} /></span>
                                                    </Form.Item>
                                                </Col>
                                            </Row>
                                            <Row className="mB10">
                                                <Col span={12}>
                                                    <Form.Item label="法定代表人" {...formItemLayout}>
                                                        {getFieldDecorator('legalPerson', {
                                                            rules: [{ required: true, message: language.RegisterDate && language.RegisterDate.message }],
                                                        })(
                                                            <Input allowClear={true} placeholder={language.Registerphone && language.Registerphone.message} />
                                                        )}
                                                    </Form.Item>
                                                </Col>
                                                <Col span={12}>
                                                    <Form.Item label="发证机关" {...formItemLayout}>
                                                        {getFieldDecorator('authority', {
                                                            rules: [{ required: true, message: language.Registerphone && language.Registerphone.message },],
                                                        })(
                                                            <Input allowClear={true} placeholder={language.Registerphone && language.Registerphone.message} />
                                                        )}
                                                    </Form.Item>
                                                </Col>
                                            </Row>
                                            <Row className="mB10">
                                                <Col span={12}>
                                                    <Form.Item label="登记号" {...formItemLayout}>
                                                        {getFieldDecorator('registerNumber', {
                                                            rules: [{ required: true, message: language.RegisterCode && language.RegisterCode.message }],
                                                        })(
                                                            <Input allowClear={true} placeholder={language.Registerphone && language.Registerphone.message} />
                                                        )}
                                                    </Form.Item>
                                                </Col>
                                                <Col span={12} >
                                                    <Form.Item label="发证日期" {...formItemLayout}>
                                                        {getFieldDecorator('issueDate', {
                                                            rules: [{ required: true, message: language.RegisterTitle && language.RegisterTitle.message }],
                                                        })(
                                                            <DatePicker disabledDate={this.disabledStDate} id="birthdate" placeholder={language.RegisterDate && language.RegisterDate.message} style={{ width: "100%" }} format='YYYY-MM-DD' />
                                                        )}
                                                    </Form.Item>
                                                </Col>
                                            </Row>
                                            <Row className="mB10">
                                                <Col span={12} >
                                                    <Form.Item label="行政区" {...formItemLayout}>
                                                        <Cascader
                                                            fieldNames={{ label: 'descripts', value: 'id', children: 'children', }}
                                                            options={this.state.provinceArr}
                                                            loadData={this.loadData}
                                                            onChange={this.onChangeCader}
                                                            changeOnSelect
                                                        />
                                                    </Form.Item>
                                                </Col>
                                                <Col span={12} >
                                                    <Form.Item label="机构申请日期" {...formItemLayout}>
                                                        {getFieldDecorator('applyDate', {
                                                            rules: [{ required: true, message: language.RegisterTitle && language.RegisterTitle.message }],
                                                        })(
                                                            <DatePicker disabledDate={this.disabledStDate} id="birthdate" placeholder={language.RegisterDate && language.RegisterDate.message} style={{ width: "100%" }} format='YYYY-MM-DD' />

                                                        )}
                                                    </Form.Item>
                                                </Col>
                                            </Row>
                                            <Row className="mB10">
                                                <Col span={12} >
                                                    <Form.Item label="详细地址" {...formItemLayout}>
                                                        {getFieldDecorator('detailedAddress', {
                                                            rules: [{ required: true, message: language.RegisterTitle && language.RegisterTitle.message }],
                                                        })(
                                                            <Input allowClear={true} placeholder={language.Registerphone && language.Registerphone.message} />

                                                        )}
                                                    </Form.Item>
                                                </Col>
                                                <Col span={12} >
                                                    <Form.Item label="营业执照" {...formItemLayout}>
                                                        {getFieldDecorator('businesslicense', {
                                                            rules: [{ required: true, message: language.RegisterTitle && language.RegisterTitle.message }],
                                                        })(
                                                            <Input allowClear={true} placeholder={language.Registerphone && language.Registerphone.message} />
                                                        )}
                                                    </Form.Item>
                                                </Col>
                                            </Row>
                                            <Row className="mB10">
                                                <Col span={12} >
                                                    <Form.Item label="机构类别" {...formItemLayout}>
                                                        {getFieldDecorator('institutionType', {
                                                            rules: [{ required: true, message: language.RegisterTitle && language.RegisterTitle.message }],
                                                        })(
                                                            <Select allowClear placeholder={language.RegisterTitle && language.RegisterTitle.message}  >
                                                                {this.state.selectData2.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                                            </Select>

                                                        )}
                                                    </Form.Item>
                                                </Col>
                                                <Col span={12} >
                                                    <Form.Item label="机构级别" {...formItemLayout}>
                                                        {getFieldDecorator('level', {
                                                            rules: [{ required: true, message: language.RegisterTitle && language.RegisterTitle.message }],
                                                        })(
                                                            <Select allowClear placeholder={language.RegisterTitle && language.RegisterTitle.message}  >
                                                                {this.state.selectData3.map(item => <Option title={item.descripts + '^' + item.descriptsSPCode} key={item.id} value={item.id}  >{item.descripts}</Option>)}
                                                            </Select>

                                                        )}
                                                    </Form.Item>
                                                </Col>

                                            </Row>
                                            <Row className="mB10">
                                                <Col span={12} >
                                                    <Form.Item label="手机号码" {...formItemLayout}>
                                                        {getFieldDecorator('mobile', {
                                                            rules: [{ required: true, message: language.RegisterTitle && language.RegisterTitle.message }, { pattern: /^1\d{10}$/, message: language.RegisterPleaseNumber && language.RegisterPleaseNumber.descripts }],
                                                        })(
                                                            <Input allowClear={true} placeholder={language.Registerphone && language.Registerphone.message} />


                                                        )}
                                                    </Form.Item>
                                                </Col>
                                                <Col span={12} >
                                                    <Form.Item label="验证码" {...formItemLayout}>
                                                        {getFieldDecorator('code', {
                                                            rules: [{ message: language.RegisterTitle && language.RegisterTitle.message }],
                                                        })(
                                                            <Input prefix={<Icon type="safety-certificate" />} placeholder={language.RegisterErr1 && language.RegisterErr1.descripts} addonAfter={<div className="codePhone">{language.RegisterSend && language.RegisterSend.descripts} </div>} />
                                                        )}
                                                    </Form.Item>
                                                </Col>
                                            </Row>
                                        </div>
                                        <div>
                                            <Row>
                                                <Col span={8}>
                                                    <Row type="flex" justify="center" >
                                                        <div style={{ textAlign: 'center' }}>
                                                            <span className="mB10" style={{ display: 'inline-block' }}>执业许可证</span>
                                                            <div>
                                                                <Upload
                                                                    accept="image/jpeg,image/png"
                                                                    listType="picture-card"
                                                                    // className={this.state.errorImg ? 'errorImg' : ''}
                                                                    className="midUp"
                                                                    showUploadList={false}
                                                                // beforeUpload={this.beforeUpload}
                                                                // onChange={this.handleImgChange}
                                                                >
                                                                    {imageUrl1 ? <img src={imageUrl1} style={{ width: '100%' }} /> : uploadButton}
                                                                </Upload>
                                                            </div>
                                                        </div>
                                                    </Row>
                                                </Col>
                                                <Col span={8} type="flex" justify="center">
                                                    <Row type="flex" justify="center" >
                                                        <div style={{ textAlign: 'center' }}>
                                                            <span className="mB10" style={{ display: 'inline-block' }}>营业执照</span>
                                                            <div>
                                                                <Upload
                                                                    accept="image/jpeg,image/png"
                                                                    listType="picture-card"
                                                                    className="midUp"
                                                                    // className={this.state.errorImg ? 'errorImg' : ''}
                                                                    showUploadList={false}
                                                                // beforeUpload={this.beforeUpload}
                                                                // onChange={this.handleImgChange}
                                                                >
                                                                    {imageUrl2 ? <img src={imageUrl2} style={{ width: '100%' }} /> : uploadButton}
                                                                </Upload>
                                                            </div>
                                                        </div>
                                                    </Row>

                                                </Col>
                                                <Col span={8}>
                                                    <Row type="flex" justify="center" >
                                                        <div style={{ textAlign: 'center' }}>
                                                            <span className="mB10" style={{ display: 'inline-block' }}>门头照</span>
                                                            <div>
                                                                <Upload
                                                                    accept="image/jpeg,image/png"
                                                                    listType="picture-card"
                                                                    className="midUp"
                                                                    // className={this.state.errorImg ? 'errorImg' : ''}
                                                                    showUploadList={false}
                                                                // beforeUpload={this.beforeUpload}
                                                                // onChange={this.handleImgChange}
                                                                >
                                                                    {imageUrl3 ? <img src={imageUrl3} style={{ width: '100%' }} /> : uploadButton}
                                                                </Upload>
                                                            </div>
                                                        </div>
                                                    </Row>

                                                </Col>

                                            </Row>
                                        </div>

                                    </Carousel>
                                    <Row style={{ marginTop: '30px' }}>
                                        <Col span={24}>
                                            <Row >
                                                <Col span={4}>
                                                    <Form.Item style={{ display: this.state.displayBtn.display_prev }}>
                                                        <Button type="default" className="login-form-button back" onClick={this.prevBtn} >{language.Registercall && language.Registercall.descripts}</Button>
                                                    </Form.Item>
                                                </Col>
                                                <Col span={4} offset={16}>
                                                    <Form.Item style={{ display: this.state.displayBtn.display_next }}>
                                                        <Button type="primary" className="login-form-button" onClick={this.nextBtn}>{language.RegisterNextStep && language.RegisterNextStep.descripts}</Button>
                                                    </Form.Item>
                                                    <Form.Item style={{ display: this.state.displayBtn.display_register }}>
                                                        <Button type="primary" htmlType="submit" className="login-form-button" onClick={this.register} >{language.Registerregister && language.Registerregister.descripts}</Button>
                                                    </Form.Item>
                                                </Col>
                                            </Row>
                                        </Col>
                                    </Row>
                                </Form>
                            </div>
                        </div>
                    </Content>
                </Layout>
            </div >
        );
    }
}

const RegistrationOfInstitutionsFrom = Form.create()(RegistrationOfInstitutions);
export default RegistrationOfInstitutionsFrom