/*
 * Creator:     ML
 * CreatDate:   2020-05-13
 * descripts：  互联网坐诊---坐诊申请
*/
import React from 'react';
import { Form, Row, Col, Input, Button, message, Table, Select, Popconfirm, Modal, Steps, DatePicker, Switch, Icon, Upload, Spin } from 'antd';
import { $http } from '../../../containers/config/https';
import { Util, } from 'tools/index';
import moment from 'moment';
const { Step } = Steps;
const FormItem = Form.Item;
const { Option } = Select;
const SittingApply = Form.create()(
    class SittingApply extends React.Component {
        constructor(props) {
            super(props)
            let userData = sessionStorage.getItem("userData") ? JSON.parse(sessionStorage.getItem("userData")) : {};
            this.state = {
                userData,
                defaultFlag: false,
                baseParms: {},
                visible: false,
                imgPath: "",
                onePath: "",
                twoPath: "",
                threePath: "",
                onePathShow: false,
                twoPathShow: false,
                threePathShow: false,
                oneFlag: undefined,
                twoFlag: undefined,
                threeFlag: undefined,
                zyfwData: [],
                loading: false,
                fileList: [],
                stepData: [],
                buttonStatus: " ",
                formatType: true,
                formatType1: true,
                formatType2: true,
                deg: 0,
                errorImg: false,
                tips: false,
                faceValue: undefined,
                loadingDom: false
            }
        }
        componentDidMount() {
            this.props.onSittingApply(this)
        }
        getIconUrl = () => {
            let { userData } = this.state;
            let aSelect = {
                params: [{
                    dataAry: [{
                        productAppCode: "FileServer",
                        appPropCode: [
                            "UserUploadPath",
                        ]
                    }]
                }]
            };
            // 获取下拉数据
            $http.post('urlS', this, {
                code: "01040211",
                data: aSelect,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        let windowHost = window.location && window.location.origin ? window.location.origin : (window.location && window.location.protocol ? (window.location.protocol + '//' + window.location.hostname) : "");
                        let url = res.result.defaultValue[0].appPropCode[0].defaultValue
                        // console.log("res.result.defaultValue[0].appPropCode[0].defaultValue",res.result.defaultValue[0].appPropCode[0].defaultValue)
                        this.setState({ iconImg: url.indexOf("http") !== -1 ? url : windowHost + url })
                    }
                }
            })
        }
        //国际化
        setMessage(name, message) {
            return this.props.localeProvider ? this.props.localeProvider[name][message] : ''
        }

        //swith开关状态处理
        onChangeSwith = (v) => {
            this.setState({ defaultFlag: v })
        }
        //页面数据 步骤条 个人信息
        getBaseParams = (n) => {
            const { userData } = this.state
            this.props.form.resetFields();
            let data = {
                params: [{
                    userID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).userID : ''
                    // userID: '300'
                }],
            }
            $http.post("urlS", this, {
                code: "03100006",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0 && res.result.data) {
                        this.setState({
                            baseParms: { ...this.state.baseParms, ...{ Info: res.result.data[0] } },
                            twoPath: res.result.data[0].qualificationPhoto || "",
                            threePath: res.result.data[0].certificatePhoto || "",
                            applyID: res.result.data[0].ID || "",
                            buttonStatus: res.result.data[0].status || "",
                            intServicesID: res.result.data[0].intServicesID || "",
                            twoFlag: undefined,
                            threeFlag: undefined,
                            stepData: res.result.data[0].statusRecordData || ""
                        })
                        // console.log("res.result.data[0] ", res.result.data[0])
                    } else {
                        // message.error('失败：' + res.errorMessage);
                    }
                },
                error: function (error) {
                    // message.error('失败：' + error);
                }
            });
            if (!n) {
                let data1 = {
                    params: [{
                        userID: userData && userData.userID || "",
                        locID: userData && userData.locID || "",
                        hospID: userData && userData.hospID || "",
                    }],
                }
                $http.post("urlS", this, {
                    code: "03100086",
                    data: data1,
                    success: function (res) {
                        if (+res.errorCode === 0) {
                            this.setState({
                                baseParms: { ...this.state.baseParms, ...{ baseInfo: res.result.data[0] } },
                                onePath: res.result.data[0].personPhoto || "",
                                oneFlag: res.result.data[0].personImage || "",
                            })
                        } else {
                            // message.error('失败：' + res.errorMessage);
                        }
                    },
                    error: function (error) {
                        // message.error('失败：' + error);
                    }
                });
                let datas = {
                    params: [{

                    }],
                }
                $http.post("urlS", this, {
                    code: "03100081",
                    data: datas,
                    success: function (res) {
                        if (+res.errorCode === 0) {
                            this.setState({
                                baseParms: { ...this.state.baseParms, ...{ zyfwData: res.result } },
                            })
                        } else {
                            // message.error('失败：' + res.errorMessage);
                        }
                    },
                    error: function (error) {
                        // message.error('失败：' + error);
                    }
                });
                let datass = {
                    params: [{

                    }],
                }
                $http.post("urlS", this, {
                    code: "03100103",
                    data: datass,
                    success: function (res) {
                        if (+res.errorCode === 0) {
                            this.setState({
                                baseParms: { ...this.state.baseParms, ...{ group: res.result } },
                            })
                        } else {
                            // message.error('失败：' + res.errorMessage);
                        }
                    },
                    error: function (error) {
                        // message.error('失败：' + error);
                    }
                });
            }
        }
        //删除照片
        handleDetele = (name) => {
            this.setState({
                [name + "Flag"]: "",
                [name + "Path"]: "",
            }, () => {
                if (name == "one") {
                    this.setState({
                        faceValue: undefined
                    })
                }
            })

        }
        //预览图片
        handlePreview = (path) => {
            this.setState({
                imgPath: path
            }, () => {
                this.setState({
                    visible: true
                }, () => {

                })
            })
        }
        //关闭预览
        handleClose = () => {
            this.setState({
                visible: false
            }, () => {
                if (document.getElementById("preview-img")) {
                    document.getElementById("preview-img").style.transform = "rotate(" + 0 + "deg)";
                }
            })
        }
        //旋转图片
        handleRote = () => {
            var deg = this.state.deg;
            deg += 90;
            this.setState({
                deg,
            })
            // transform:rotate(7deg);
            // -ms-transform:rotate(7deg); 	/* IE 9 */
            // -moz-transform:rotate(7deg); 	/* Firefox */
            // -webkit-transform:rotate(7deg); /* Safari 和 Chrome */
            // -o-transform:rotate(7deg); 	/* Opera */
            document.getElementById("preview-img").style.transform = "rotate(" + deg + "deg)";
            document.getElementById("preview-img").style.WebkitTransform = "rotate(" + deg + "deg)";
            document.getElementById("preview-img").style.MozTransform = "rotate(" + deg + "deg)";
            document.getElementById("preview-img").style.OTransform = "rotate(" + deg + "deg)";
            document.getElementById("preview-img").style.MsTransform = "rotate(" + deg + "deg)";
        }
        //新增 修改 申请
        handleSave = (name, n) => {
            //undefind没有修改 " "删除  xxxx保存修改
            const { applyID, userData, onePath, twoPath, threePath, defaultFlag, oneFlag, twoFlag, threeFlag, faceValue } = this.state
            if (this.state.errorImg) {
                message.warning("请上传符合规格的个人照片")
                return
            }
            this.props.form.validateFields((err, values) => {
                if (!err) {
                    let data = {}
                    data = {
                        params: [{
                            ID: applyID,
                            // qualificationCat: values.qualificationCat || "",
                            qualificationNo: values.qualificationNo || "",
                            userID: userData && userData.userID || "",
                            // userID: "300",
                            occupationRangeID: values.occupationRangeID || "",
                            qualificationDate: values.qualificationDate ? moment(values.qualificationDate).format('YYYY-MM-DD') : undefined,
                            certificateNo: values.certificateNo || "",
                            // qualificationCatID: values.qualificationCatID || "",
                            certificateDate: values.certificateDate ? moment(values.certificateDate).format('YYYY-MM-DD') : undefined,
                            workDate: values.workDate ? moment(values.workDate).format('YYYY-MM-DD') : undefined,
                            personPhoto: oneFlag,
                            qualificationPhoto: twoFlag,
                            certificatePhoto: threeFlag,
                            faceValue: faceValue || undefined,
                            generalDoc: defaultFlag && defaultFlag ? "Y" : "N"
                        }],
                    };
                    $http.post('urlS', this, {
                        code: "03100069",
                        data: data,
                        success: function (res) {
                            if (+res.errorCode === 0) {
                                if (n) {
                                    // message.success("图片删除成功")
                                    this.getBaseParams("n")
                                } else {
                                    message.success("保存成功")
                                }

                            }
                        }
                    });
                }

            })
        }
        //提交审核
        handleApply = () => {
            const { applyID, userData, onePath, twoPath, threePath, defaultFlag, oneFlag, twoFlag, threeFlag, faceValue } = this.state
            if (this.state.errorImg) {
                message.warning("请上传符合规格的个人照片")
                return
            } if (!twoPath) {
                message.warning("请上传资格证书照片")
                return
            } if (!threePath) {
                message.warning("请上传执业证书照片")
                return
            }

            this.props.form.validateFields((err, values) => {
                if (!err) {
                    let data = {}
                    data = {
                        params: [{
                            hospID: userData && userData.hospID || "",
                            locID: userData && userData.locID || "",
                            // qualificationCat: values.qualificationCat || "",
                            qualificationNo: values.qualificationNo || "",
                            userID: userData && userData.userID || "",
                            // userID: "300",
                            occupationRangeID: values.occupationRangeID || "",
                            qualificationDate: values.qualificationDate ? moment(values.qualificationDate).format('YYYY-MM-DD') : undefined,
                            certificateNo: values.certificateNo || "",
                            // qualificationCatID: values.qualificationCatID || "",
                            certificateDate: values.certificateDate ? moment(values.certificateDate).format('YYYY-MM-DD') : undefined,
                            workDate: values.workDate ? moment(values.workDate).format('YYYY-MM-DD') : undefined,
                            personPhoto: oneFlag,
                            qualificationPhoto: twoFlag,
                            certificatePhoto: threeFlag,
                            faceValue: faceValue || undefined,
                            generalDoc: defaultFlag && defaultFlag ? "Y" : "N"
                        }],
                    };
                    $http.post('urlS', this, {
                        code: "03100005",
                        data: data,
                        success: function (res) {
                            if (+res.errorCode === 0) {
                                message.success("提交申请成功")
                                // this.setState({
                                //     applyStatua: true
                                // })
                                //申请 更新上方步骤条
                                this.getBaseParams("n")
                            }
                        }
                    });

                }
            })
        }
        //再次提交
        handleAgain = () => {
            const { applyID, userData, onePath, twoPath, threePath, defaultFlag, oneFlag, twoFlag, threeFlag, intServicesID } = this.state
            if (this.state.errorImg) {
                message.warning("请上传符合规格的个人照片")
                return
            } if (!twoPath) {
                message.warning("请上传资格证书照片")
                return
            } if (!threePath) {
                message.warning("请上传执业证书照片")
                return
            }
            let data = {}
            data = {
                params: [{
                    ID: intServicesID,
                    userID: userData && userData.userID || "",
                    statusCode: "04"
                }],
            };
            $http.post('urlS', this, {
                code: "03100008",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        message.success("再次申请成功")
                        this.handleSave()
                        //申请 更新上方步骤条
                        this.getBaseParams("n")
                    }
                }
            });
        }
        //撤回审核 03100008
        handleBack = () => {
            const { applyID, userData, onePath, twoPath, threePath, defaultFlag, oneFlag, twoFlag, threeFlag, intServicesID } = this.state
            let data = {}
            data = {
                params: [{
                    ID: intServicesID,
                    userID: userData && userData.userID || "",
                }],
            };
            $http.post('urlS', this, {
                code: "03100084",
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        message.success("撤回申请成功")
                        //撤回之后 显示再次申请 更新上方步骤条
                        this.getBaseParams("n")
                    } else {
                        setTimeout(() => {
                            this.getBaseParams("n")
                        }, 500)
                    }
                }
            });
        }
        // 人脸识别验证
        VerificationImg = (imageUrl) => {
            // 初始值下拉列表值
            let data = {
                "params": [
                    {
                        "imageBase64": imageUrl.substring(imageUrl.indexOf(",") + 1),
                    }
                ]
            };
            $http.post('urlADS', this, {
                code: "88010021",
                data: data,
                success: function (res) {
                    let errorCode = res.errorCode;
                    if (errorCode === '0') {
                        message.success('图片符合')
                        this.setState({
                            faceValue: res.result.faceValue || null,
                            errorImg: false
                        }, () => {
                            // this.props.handThis.ImgValue(this.state.faceValue, this.state.imageUrl)

                            // this.props.handThis.errorImg(this.state.errorImg)
                        })
                    } else {
                        this.setState({
                            errorImg: true,
                            loadingDom: false,
                            onePath: '', // 图片地址
                        }, () => {
                            // this.props.handThis.ImgValue('', '')
                            // this.props.handThis.errorImg(this.state.errorImg)
                        })

                    }
                }
            });
        }
        beforeUpload = (file, name) => {
            this.setState({
                loadingDom: true
            })
            const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
            if (!isJpgOrPng) {
                message.error('只能上传JPG/PNG文件!');
                this.setState({
                    loadingDom: false
                })
            }
            const isLt2M = file.size / 1024 / 1024 < 2;
            if (!isLt2M) {
                message.error('图片大小不能超过2MB!');
                this.setState({
                    loadingDom: false
                })
            }
            return false;
        }
        getBase64 = (img, callback) => {
            const reader = new FileReader();
            reader.addEventListener('load', () => callback(reader.result));
            reader.readAsDataURL(img);
        }
        onChangePic = (info, name, flag) => {
            let that = this
            that.setState({
                // [name+"Show"]: false,
                loadingDom: true
            })
            that.getBase64(info.file, imageUrl =>
                that.setState({
                    [name]: imageUrl,
                    imageUrl,
                    // loading: false,
                    // fileList: info.file,
                }, () => {
                    // console.log("imageUrl-0-000----",imageUrl)
                }),

            );
            if (that.state.iconImg !== "") {
                if (info.file.status == "removed") {
                    let a = that.state.fileList.filter(data => {
                        if (data.status !== "removed") {
                            return data;
                        }
                    });
                    that.setState({ fileList: a });
                } else {
                    // this.setState({fileList:info.fileList});
                    let formData = new FormData();
                    formData.append("file", info.file);
                    const option = {
                        method: 'post',
                        mode: 'cors',
                        headers: {},
                        body: formData
                    };
                    // http://218.17.212.34:53774/uploadFile?fileType=health
                    // let url  = "http://172.18.100.86:3008/uploadFile?fileType=health";
                    fetch(that.state.iconImg, option).then(response => {
                        if (response.ok) {
                            that.setState({
                                loadingDom: false
                            })
                            return response.text();
                        } else {
                            that.setState({
                                loadingDom: false
                            })
                            console.log('网络错误，请稍后再试');
                            return;
                        }
                    }).then(data => {
                        let dataS = JSON.parse(data);
                        if (+dataS.errorCode == 0) {
                            that.setState({
                                loadingDom: false
                            })
                            // let str = that.state.iconImg.match(/(\S*)\/uploadFile/)[1];
                            if (flag == "oneFlag") {
                                that.VerificationImg(that.state.imageUrl)
                            }

                            that.setState({
                                // [name]:this.state.iconImg + dataS.filePath,
                                [flag]: dataS.filePath
                            })
                        } else {
                            that.setState({
                                loadingDom: false
                            })
                            message.warning(dataS.errorMessage)
                            that.setState({
                                // [name]:this.state.iconImg + dataS.filePath,
                                [flag]: "",
                                [name]: "",
                                [name + "Show"]: true,
                                loadingDom: false
                            }, () => {

                            })
                        }
                        // this.state.fileList.push(obj);
                        // this.setState({imgList:this.state.imgList});
                    }).catch(error => {
                        this.setState({
                            // [name]:this.state.iconImg + dataS.filePath,
                            [flag]: "",
                            [name]: "",
                            [name + "Show"]: true,
                            loadingDom: false
                        }, () => {
                            message.warning("上传失败,请重新上传")
                        })

                    })

                }
            }
        }
        //日期面板打开/关闭
        handleOnOpenChangeData = (status, name) => {
            this.setState({
                [name]: !status
            })
        }
        //点击去排班
        handleToSitting = () => {
            this.props.handleHomeData("7")
        }
        render() {
            const { baseParms, fileList, stepData, buttonStatus, tips } = this.state
            const { getFieldDecorator } = this.props.form;
            const formItemLayout = {    // label 和input宽度
                labelCol: { span: 7 },
                wrapperCol: { span: 16 },
            };
            const formItemLayout10 = {
                labelCol: { span: 10 },
                wrapperCol: { span: 13 },
            };
            // console.log("buttonStatus", buttonStatus)
            //角色
            let groupOp = []
            baseParms.group && baseParms.group.map(item => {
                groupOp.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            })
            //执业范围
            let zyfwOp = []
            baseParms.zyfwData && baseParms.zyfwData.map(item => {
                zyfwOp.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            })
            //执业地点 主要执业医疗机构
            //  let groupOp = []
            //  baseParms.group && baseParms.group.map(item => {
            //      groupOp.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            //  })
            let stepOp = []
            stepData && stepData.length > 0 ? stepData.map((item, s) => {
                stepOp.push(
                    <div className="description" style={{
                        width: item.checkUser && item.checkUser && (s + 1) != stepData.length ? "172px" :
                        !item.checkUser && !item.checkUser? "144px" : stepData.length > 1&&(s + 1) == stepData.length&&item.checkUser && item.checkUser ?"172px": "68px"
                    }}>
                        <p style={{
                            display: "flex",
                            alignItems: "center",
                            width: item.checkUser && item.checkUser && (s + 1) != stepData.length ? "172px" :
                                !item.checkUser && !item.checkUser? "144px" : stepData.length > 1&&(s + 1) == stepData.length&&item.checkUser && item.checkUser ?"172px": "68px"
                        }}>
                            {
                                item.sign=="finish"?<Icon type="check-circle" style={{
                                    color: "#1890ff",
                                    fontSize: "32px",
                                    marginRight: "6px"
                                }}></Icon>:
                                item.sign=="process"?<span className="stepNum-span">{(Number(s)+1)}</span>:
                                item.sign=="error"?<Icon type="close-circle" style={{
                                    color: "#f5222d",
                                    fontSize: "32px",
                                    marginRight: "6px"
                                }}></Icon>:""
                            }
                            <span style={{ fontSize: "16px",color:item.sign=="error"?"#f5222d":"" }}> {item.statusDesc} </span>
                            {
                                (s + 1) == stepData.length ? "" :
                                    <span style={{ backgroundColor: "#1890ff", display: "inline-block", flex:"1", height: "1px", margin: "0 4px" }}></span>
                            }
                        </p>
                        <p style={{ color:item.sign=="error"?"#f5222d":"rgba(0,0,0,.45)", display: (item.checkUser && item.checkUser ? "block" : "none"),paddingLeft:"38px" }}>
                            {item.checkUser + (item.checkUser && item.checkUser ? "/" + item.appDate + " " + item.appTime : "")}
                        </p>
                        <p title={item.refuseReason} className={item.sign=="error"?"error-span":""} style={{ color:item.sign=="error"?"#f5222d":"rgba(0,0,0,.45)",paddingLeft:"38px" }}>{item.refuseReason}</p>
                    </div>
                )
            }) : stepOp.push(
                <p><span className="stepNum-span">1</span>提交注册申请</p>
            )
            const uploadButton = (
                <div>
                    <span className="up change add">+</span>
                    <span onClick={this.handleChange} className="up change">上传照片</span>

                </div>
            );
            const antIcon = <Icon type='reload'
                titie="旋转"
                className='common-icon-style' style={{
                    // color: '#1999db',
                    color: "#bfbfbf",
                    marginLeft: "5px",
                    cursor: "pointer",
                    float: "right",
                }}
                onClick={this.handleRote} />
            return (
                <Spin spinning={this.state.loadingDom} tip="加载中...">
                    <div className="apply-dom">
                        <div>
                            <div className="step-dom" style={{ display: "flex" ,maxHeight:"152px",overflow:"hidden",overflowX:"auto"}}>
                                {/* 步骤条 */}
                                {stepOp}
                                <span className="triangle-topleft"></span>
                                <div className="ribbon-green">
                                    {stepData && stepData.length > 0 ? stepData[stepData.length - 1].statusDesc : "申请"}
                                </div>
                            </div>
                            <div className="content-dom">
                                <Row>
                                    <Col span={19}>
                                        <div className="content-top">
                                            <Row className="first-row">
                                                <Col span={4} className="photo-dom titleDom">
                                                    <div className="top title">
                                                        <div className="small-title">
                                                            <p>个人照片</p>
                                                            <Popconfirm title="删除不可恢复，你确定要删除吗?" onConfirm={() => this.handleDetele("one")} >
                                                                <Icon type="delete" style={{
                                                                    color: 'rgba(240,65,52,1)',
                                                                    display: (this.state.onePath != "" && buttonStatus != "01" && buttonStatus != "03" && buttonStatus != "04" ?
                                                                        "inline-block" : "none")
                                                                }}></Icon>
                                                            </Popconfirm>
                                                            <Icon className="eyeIcons" style={{
                                                                display: this.state.onePath != "" ? "inline-block" : "none",
                                                                right: (buttonStatus == "01" || buttonStatus == "04" || buttonStatus == "03" ? "6px" : "34px")
                                                            }}
                                                                onClick={() => this.handlePreview(this.state.onePath)} type="eye" />
                                                        </div>
                                                        <div >
                                                            {
                                                                buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04" ? <div className="pic">
                                                                    <img src={this.state.onePath}
                                                                        onClick={() => this.handlePreview(this.state.onePath)}
                                                                        style={{
                                                                            width: '100%', top: "0",
                                                                            right: "0",
                                                                            left: "3px",
                                                                            cursor: "pointer",
                                                                        }} />
                                                                </div> :
                                                                    <Upload
                                                                        className="pic"
                                                                        accept="image/jpeg,image/png"
                                                                        listType="picture-card"
                                                                        fileList={fileList}
                                                                        beforeUpload={(e) => this.beforeUpload(e, "onePath")}
                                                                        onChange={(e) => this.onChangePic(e, "onePath", "oneFlag")}
                                                                    >
                                                                        {this.state.onePath ?
                                                                            <div>
                                                                                <img src={this.state.onePath} style={{ width: '100%', border: (this.state.errorImg ? "2px solid #f5222d" : "0") }} />

                                                                                <span className={(baseParms.Info && baseParms.Info.personPhoto) || this.state.onePath != "" ? "change" : ""}
                                                                                    style={{ display: ((baseParms.Info && baseParms.Info.personPhoto) || this.state.onePath != "" ? "inline-block" : "none") }} >重新上传</span>
                                                                            </div>
                                                                            : uploadButton}
                                                                    </Upload>
                                                            }
                                                            {/* <div className="pic">
                                                                <img src={this.state.onePath&&this.state.onePath?this.state.onePath:""}
                                                                alt=""
                                                                    onClick={this.state.onePath!=""?() => this.handlePreview(this.state.onePath):""}
                                                                    style={{
                                                                        width: '100%', top: "0",
                                                                        right: "0",
                                                                        left: "3px",
                                                                        cursor: this.state.onePath!=""?"pointer":"default",
                                                                        background: "#fafafa",
                                                                    }} />
                                                            </div>  */}
                                                        </div>
                                                    </div>
                                                </Col>
                                                <Col className="antd-info-col">
                                                    <Col span={12}>所属医院：<strong>{baseParms.baseInfo && baseParms.baseInfo.hospDesc && baseParms.baseInfo.hospDesc || "--"}</strong></Col>
                                                    <Col span={7}>所属科室：<strong>{baseParms.baseInfo && baseParms.baseInfo.locDesc && baseParms.baseInfo.locDesc || "--"}</strong></Col>
                                                    <Col span={5}>姓名：<strong>{baseParms.baseInfo && baseParms.baseInfo.name && baseParms.baseInfo.name || "--"}</strong></Col>
                                                    <Col span={7}>证件号码：<strong>{baseParms.baseInfo && baseParms.baseInfo.credNo && baseParms.baseInfo.credNo || "--"}</strong></Col>
                                                    <Col span={6}>出生日期：<strong>{baseParms.baseInfo && baseParms.baseInfo.birthDate && baseParms.baseInfo.birthDate || "--"}</strong></Col>
                                                    <Col span={5}>性别：<strong>{baseParms.baseInfo && baseParms.baseInfo.docSex && baseParms.baseInfo.docSex || "--"}</strong></Col>
                                                    <Col span={6}>手机号码：<strong>{baseParms.baseInfo && baseParms.baseInfo.mobile && baseParms.baseInfo.mobile || "--"}</strong></Col>
                                                    <Col span={8} style={{ paddingLeft: "34px" }}>专业技术职称：<strong>{baseParms.baseInfo && baseParms.baseInfo.title && baseParms.baseInfo.title || "--"}</strong></Col></Col>
                                            </Row>
                                        </div>
                                        <div className="content-center">
                                            <Form>
                                                <Row>
                                                    {/* <Col span={12}>
                                                    <FormItem label={"资质类别"} {...formItemLayout10}>
                                                        {getFieldDecorator('qualificationCatID', {
                                                            initialValue: baseParms.Info && baseParms.Info.qualificationCatID && baseParms.Info.qualificationCatID || undefined,
                                                            rules: [{ required: true, message: "请选择资质类别" }],
                                                        })(
                                                            <Select
                                                            disabled={buttonStatus == "01" || buttonStatus == "03"} 
                                                            showSearch allowClear optionFilterProp="role" >
                                                                {groupOp}
                                                            </Select>
                                                        )}
                                                    </FormItem>
                                                </Col > */}
                                                    <Col span={12}>
                                                        <FormItem label="参加工作日期"  {...formItemLayout} >
                                                            {getFieldDecorator('workDate', {
                                                                initialValue: baseParms.Info && baseParms.Info.workDate && baseParms.Info.workDate ? moment(baseParms.Info.workDate, "YYYY-MM-DD") : undefined,
                                                                rules: [{ required: true, message: '请选择参加工作日期' }],
                                                            })(
                                                                <DatePicker
                                                                    placeholder={'例:20010101'}
                                                                    format={this.state.formatType ? 'YYYY-MM-DD' : 'YYYYMMDD'}
                                                                    separator="-"
                                                                    onOpenChange={(e) => this.handleOnOpenChangeData(e, "formatType")}
                                                                    disabled={buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04"}
                                                                    style={{ width: '100%' }}
                                                                    disabledDate={(curDate) => {
                                                                        return curDate && curDate > moment().endOf('day');
                                                                    }} />
                                                            )}
                                                        </FormItem>
                                                    </Col>
                                                    <Col span={12}>
                                                        <FormItem label={"资格证书编号"} {...formItemLayout10}>
                                                            {getFieldDecorator('qualificationNo', {
                                                                initialValue: baseParms.Info && baseParms.Info.qualificationNo && baseParms.Info.qualificationNo || undefined,
                                                                rules: [{ required: true, message: "请输入资格证书编号" }],
                                                            })(
                                                                <Input disabled={buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04"} ></Input>
                                                            )}
                                                        </FormItem>
                                                    </Col >
                                                    <Col span={12}>
                                                        <FormItem label="资格证获得时间"  {...formItemLayout} >
                                                            {getFieldDecorator('qualificationDate', {
                                                                initialValue: baseParms.Info && baseParms.Info.qualificationDate && baseParms.Info.qualificationDate ? moment(baseParms.Info.qualificationDate, "YYYY-MM-DD") : undefined,
                                                                rules: [{ required: true, message: '请选择资格证获得时间' }],
                                                            })(
                                                                <DatePicker
                                                                    placeholder={'例:20010101'}
                                                                    format={this.state.formatType1 ? 'YYYY-MM-DD' : 'YYYYMMDD'}
                                                                    separator="-"
                                                                    onOpenChange={(e) => this.handleOnOpenChangeData(e, "formatType1")}
                                                                    disabled={buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04"} style={{ width: '100%' }} disabledDate={(curDate) => {
                                                                        return curDate && curDate > moment().endOf('day');
                                                                    }} />
                                                            )}
                                                        </FormItem>
                                                    </Col>
                                                    <Col span={12}>
                                                        <FormItem label={"执业证书编码"} {...formItemLayout10}>
                                                            {getFieldDecorator('certificateNo', {
                                                                initialValue: baseParms.Info && baseParms.Info.certificateNo && baseParms.Info.certificateNo || undefined,
                                                                rules: [{ required: true, message: "请输入执业证书编码" }],
                                                            })(
                                                                <Input disabled={buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04"}></Input>
                                                            )}
                                                        </FormItem>
                                                    </Col >
                                                    <Col span={12}>
                                                        <FormItem label="执业证发证日期"  {...formItemLayout} >
                                                            {getFieldDecorator('certificateDate', {
                                                                initialValue: baseParms.Info && baseParms.Info.certificateDate && baseParms.Info.certificateDate ? moment(baseParms.Info.certificateDate, "YYYY-MM-DD") : undefined,
                                                                // initialValue: params && params.startDate ? moment(params.startDate, "YYYY-MM-DD") : moment(),
                                                                rules: [{ required: true, message: '请选择执业证发证日期' }],
                                                            })(
                                                                <DatePicker
                                                                    placeholder={'例:20010101'}
                                                                    format={this.state.formatType2 ? 'YYYY-MM-DD' : 'YYYYMMDD'}
                                                                    separator="-"
                                                                    onOpenChange={(e) => this.handleOnOpenChangeData(e, "formatType2")}
                                                                    disabled={buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04"} style={{ width: '100%' }} disabledDate={(curDate) => {
                                                                        return curDate && curDate > moment().endOf('day');
                                                                    }} />
                                                            )}
                                                        </FormItem>
                                                    </Col>
                                                    {/* <Col span={12}>
                                                <FormItem label={"执业地点"} {...formItemLayout10}>
                                                    {getFieldDecorator('hospDesc', {
                                                        initialValue: baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc || undefined,
                                                        rules: [{ required: true, message: "请输入执业地点" }],
                                                    })(
                                                        <Select showSearch optionFilterProp="role" >
                                                            <Option key={"1"} role={baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc} title={baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc} value={baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc}>{baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc}</Option>
                                                        </Select>
                                                    )}
                                                </FormItem>
                                            </Col > */}
                                                    <Col span={12}>
                                                        <FormItem label={"执业范围"} {...formItemLayout10}>
                                                            {getFieldDecorator('occupationRangeID', {
                                                                initialValue: baseParms.Info && baseParms.Info.occupationRangeID && baseParms.Info.occupationRangeID || undefined,
                                                                rules: [{ required: false, message: "" }],
                                                            })(
                                                                <Select disabled={buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04"} showSearch allowClear optionFilterProp="role" >
                                                                    {zyfwOp}
                                                                </Select>
                                                            )}
                                                        </FormItem>
                                                    </Col >
                                                    {/* <Col span={12}>
                                                <FormItem label={"主要执业医疗机构"} {...formItemLayout10}>
                                                    {getFieldDecorator('hospDescs', {
                                                        initialValue: baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc || undefined,
                                                        rules: [{ required: true, message: "请选择主要执业医疗机构" }],
                                                    })(
                                                        <Select showSearch optionFilterProp="role" >
                                                            <Option key={"2"} role={baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc} title={baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc} value={baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc}>{baseParms.Info && baseParms.Info.hospDesc && baseParms.Info.hospDesc}</Option>
                                                        </Select>
                                                    )}
                                                </FormItem>
                                            </Col > */}
                                                    {/* <Col span={12} >
                                                    <FormItem {...formItemLayout} label='全科医生'>
                                                        {getFieldDecorator('generalDoc', {
                                                            initialValue: baseParms.Info && baseParms.Info.generalDoc && baseParms.Info.generalDoc == "Y" ? true : false,
                                                            rules: [{ required: false, message: '', },
                                                            ],
                                                        })(
                                                            <Switch disabled={buttonStatus == "01" || buttonStatus == "03"|| buttonStatus == "04"} checkedChildren="是" checked={this.state.defaultFlag} unCheckedChildren="否" onChange={(v) => { this.onChangeSwith(v) }} />
                                                        )}
                                                    </FormItem>
                                                </Col> */}
                                                </Row>
                                                <Row style={{ textAlign: "center", paddingTop: "36px" }}>
                                                    {/* <span style={{marginLeft:"4px",cursor:"pointer",color:"blue"}} onClick={this.handleToSitting}>去排班</span> */}
                                                    {
                                                        // buttonStatus == "03" ? <p style={{ color: "#1999db", fontSize: "16px" }}>恭喜您!已成功完成申请!</p> :
                                                        <div>
                                                            <Button onClick={this.handleSave} style={{ display: (buttonStatus == "02" || buttonStatus == "" || buttonStatus == "05" || (stepData && stepData.length == 0) ? "inline-block" : "none"), marginRight: "22px", color: "#3fb108", border: "1px solid #3fb108" }}>保存申请单</Button>
                                                            <Button onClick={this.handleApply} style={{ display: (buttonStatus == "" || (stepData && stepData.length == 0) ? "inline-block" : "none"), marginRight: "22px", background: "rgb(3,167,20)", color: "#ffff" }}>提交审核</Button>
                                                            {buttonStatus == "03" ? <p style={{ color: "#1999db", fontSize: "16px" }}>恭喜您!已成功完成申请!</p> : ""}
                                                            <Button onClick={this.handleBack} style={{ display: (buttonStatus == "01" || buttonStatus == "04" || buttonStatus == "03" ? "inline-block" : "none"), marginRight: "22px", color: "#f5222d", border: "1px solid #d9d9d9" }}>撤回申请</Button>
                                                            <Button onClick={this.handleAgain} style={{ display: (buttonStatus == "02" || buttonStatus == "05" ? "inline-block" : "none"), marginRight: "22px", background: "rgb(3,167,20)", color: "#ffff" }}>重新申请</Button>
                                                        </div>
                                                    }

                                                </Row>
                                            </Form>
                                        </div>
                                    </Col>
                                    <Col span={5} className="photo-dom">

                                        <div className="bottom title">
                                            <div className="small-title">
                                                <p>资格证书</p>
                                                <Popconfirm title="删除不可恢复，你确定要删除吗?" onConfirm={() => this.handleDetele("two")} >
                                                    <Icon type="delete" style={{
                                                        color: 'rgba(240,65,52,1)', display: (this.state.twoPath != "" && buttonStatus != "01" &&
                                                            buttonStatus != "03" && buttonStatus != "04" ? "inline-block" : "none")
                                                    }}></Icon>
                                                </Popconfirm>
                                                <Icon className="eyeIcon" style={{
                                                    display: this.state.twoPath != "" ? "inline-block" : "none",
                                                    right: (buttonStatus == "01" || buttonStatus == "04" || buttonStatus == "03" ? "6px" : "36px")
                                                }} onClick={() => this.handlePreview(this.state.twoPath)} type="eye" />
                                            </div>
                                            <div >
                                                {
                                                    buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04" ? <div className="pic" >
                                                        <img src={this.state.twoPath}
                                                            alt=""
                                                            onClick={() => this.handlePreview(this.state.twoPath)}
                                                            style={{
                                                                width: '100%', top: "0",
                                                                right: "0",
                                                                left: "3px",
                                                                cursor: "pointer",
                                                            }} />
                                                    </div> : <Upload
                                                        className="pic"
                                                        style={{ border: this.state.twoPathShow ? "0.5px dashed red" : "0.5px dashed #bfbfbf" }}
                                                        accept="image/jpeg,image/png"
                                                        listType="picture-card"
                                                        fileList={fileList}
                                                        beforeUpload={(e) => this.beforeUpload(e, "twoPath")}
                                                        onChange={(e) => this.onChangePic(e, "twoPath", "twoFlag")}
                                                    >
                                                            {this.state.twoPath ?
                                                                <div>
                                                                    <img alt="" src={this.state.twoPath} style={{ width: "100%", height: "100%" }}></img>
                                                                    {/* <span className="up change" style={{ display: (baseParms.Info && baseParms.Info.qualificationPhoto && this.state.twoPath != "" ? "none" : "inline-block") }}>上传照片</span> */}
                                                                    <span className="change" style={{ display: ((baseParms.Info && baseParms.Info.qualificationPhoto) || this.state.twoPath != "" ? "inline-block" : "none") }}>重新上传</span>
                                                                </div>
                                                                : uploadButton}
                                                        </Upload>
                                                }
                                            </div>
                                            <div className="small-title" style={{ marginTop: "10px" }}>
                                                <p>执业证书</p>
                                                <Popconfirm title="删除不可恢复，你确定要删除吗?" onConfirm={() => this.handleDetele("three")} >
                                                    <Icon type="delete" style={{ color: 'rgba(240,65,52,1)', display: (this.state.threePath != "" && buttonStatus != "01" && buttonStatus != "03" && buttonStatus != "04" ? "inline-block" : "none") }}></Icon>
                                                </Popconfirm>
                                                <Icon className="eyeIcon" style={{
                                                    display: this.state.threePath != "" ? "inline-block" : "none",
                                                    right: (buttonStatus == "01" || buttonStatus == "04" || buttonStatus == "03" ? "6px" : "36px")
                                                }} onClick={() => this.handlePreview(this.state.threePath)} type="eye" />
                                            </div>
                                            <div>
                                                {
                                                    buttonStatus == "01" || buttonStatus == "03" || buttonStatus == "04" ? <div className="pic">
                                                        <img alt="" src={this.state.threePath}
                                                            onClick={() => this.handlePreview(this.state.threePath)}
                                                            style={{
                                                                width: '100%', top: "0",
                                                                right: "0",
                                                                left: "3px",
                                                                cursor: "pointer",
                                                            }} />
                                                    </div> : <Upload
                                                        className="pic"
                                                        style={{ border: this.state.threePathShow ? "0.5px dashed red" : "0.5px dashed #bfbfbf" }}
                                                        accept="image/jpeg,image/png"
                                                        listType="picture-card"
                                                        fileList={fileList}
                                                        beforeUpload={(e) => this.beforeUpload(e, "threePath")}
                                                        onChange={(e) => this.onChangePic(e, "threePath", "threeFlag")}
                                                    >
                                                            {this.state.threePath ?
                                                                <div>
                                                                    <img alt="" src={this.state.threePath} style={{ width: "100%", height: "100%" }}></img>
                                                                    {/* <span className="up change" style={{ display: (baseParms.Info && baseParms.Info.certificatePhoto && this.state.threePath != "" ? "none" : "inline-block") }}>上传照片</span> */}
                                                                    <span className="change" style={{ display: ((baseParms.Info && baseParms.Info.certificatePhoto) || this.state.threePath != "" ? "inline-block" : "none") }}>重新上传</span>
                                                                </div>
                                                                : uploadButton}
                                                        </Upload>
                                                }
                                            </div>
                                        </div>
                                    </Col>
                                </Row>
                                <Modal
                                    visible={this.state.visible}
                                    title={<div>
                                        <div style={{
                                            display: "flex", justifyContent: "space-between", alignItems: "center", paddingRight: "14px", marginTop: "-4px"
                                        }}>
                                            <span>图片预览</span>
                                            <Spin indicator={antIcon} size='middle' />
                                        </div>
                                    </div>}
                                    onCancel={this.handleClose}
                                    bodyStyle={{ padding: 5, overflow: 'auto' }}
                                    footer={null}
                                    className="view-modal"
                                >
                                    <div className="view-content" >
                                        <img id="preview-img" draggable="false" src={this.state.imgPath} alt="" style={{ width: '100%' }} />
                                        {/* <span  style={{float:"right"}} onClick={this.handleRote}>旋转</span> */}
                                    </div>
                                </Modal>
                            </div>
                        </div>
                    </div>
                </Spin>
            )
        }
    })
export default SittingApply    