/**
 * 住院登记
 */
import React from 'react'
import { Form, Row, Col, Input, Select, DatePicker, Button, Modal, message, Tooltip, Icon, Spin, Table, Checkbox, Switch } from 'antd';
import { $http } from '../../containers/config/https';
import { Util, timeFormat, dayFormat } from 'tools/index';
import { $loadTemplate } from '../lodop/Common/Print.js';
import moment from 'moment';
import fetchJsonp from 'fetch-jsonp';
import INSURegister from 'pages/Cashier/INSURegister.jsx';
import ReadCard from '../../components/readcard/ReadCard';
import CorrelationModal from '../opadmReg/component/CorrelationModal'
import HospitalizationListNew from './HospitalizationListNew';
import ShowCommonTableModal from '../../pages/workstation/component/ShowCommonTableModal.jsx';
import PatientAccountManagement from '../Cashier/charges/PatientAccountManagement.jsx';
import titleA from 'assets/images/title-0.png';
import titleB from 'assets/images/title-1.png';
import titleC from 'assets/images/title-2.png';
import titleD from 'assets/images/title-1.png';
import './CSS/inhospital.less';

const confirm = Modal.confirm;
const FormItem = Form.Item;
const Option = Select.Option;
let userData;
let timer = undefined;
const formItemLabel = {
    labelCol: { span: 5 },
    wrapperCol: { span: 17 },
}
const formItemAdressLabel = {
    labelCol: { span: 8 },
    wrapperCol: { span: 14 },
}
const formItemIdentityLabel = {
    labelCol: { span: 5 },
    wrapperCol: { span: 16 },
}
const formItemCredCardLabel = {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
}
const formItemAdressDetail = {
    labelCol: { span: 0 },
    wrapperCol: { span: 23 },
}
const formItemPresentAdressDetail = {
    labelCol: { span: 1 },
    wrapperCol: { span: 22 },
}
const formItemLayoutZero = {
    labelCol: { span: 0 },
    wrapperCol: { span: 22 },
}
const formItemInHosNum = {
    labelCol: { span: 11 },
    wrapperCol: { span: 11 },
}
const formItemContact = {
    labelCol: { span: 10 },
    wrapperCol: { span: 13 },
}

const HospitalizationRegisterNewINSU = Form.create()(
    class HospitalizationRegisterNewINSU extends React.Component {
        constructor(props) {
            super(props);
            userData = window.sessionStorage.userData ? JSON.parse(window.sessionStorage.userData) : {}
            this.state = {
                readInfoLoading: false,//无卡时loading信息
                dataSource: [],
                patInfo: {},
                admInfo: {},
                patAge: '',
                patAdminList: [], //住院证列表
                patAdminInfo: {}, //住院证信息
                typeData: [], //诊断类型
                statusData: [],//诊断备注
                catData: [], //诊断级别
                diagData: [],//诊断基础数据
                selectData: [],
                locList: [],         //科室
                wardList: [],        //病区
                docList: [],         //医生
                admReasonList: [],   //病人费别
                wardListColumns: [],
                wardColumnsWidth: 0,
                searchWardValue: '',
                total: 0,
                page: 1,
                pageSize: 10,
                current: 1,
                showDialog: false,
                indexTable: '',
                visible: false,
                visStatus: false,
                inHospDisabled: false, //入院按钮状态
                CMark: 'N',
                mainDiag: 'N',
                diagTypeDefID: '',
                diagCatDefID: '',
                diagStatusDefID: '',
                changeValue: '',
                editData: [],
                baseParms: {},
                initCardDr: '',  //卡类型ID
                nowRead: 'n',//卡类型设置是否可操作
                cardLength: '',//卡长度
                nowCost: 0,//当前卡费
                nowInv: '',//是否显示发票
                replenishZero: '',//是否补0
                repariFeeFlag: 'N',//费用置为0或空
                cardNoVisible: false,//建卡卡号错误提示 - title框显示
                idCardCodePop: '',
                tipsCardNo: '',//建卡卡号错误提示 - 文字信息
                province: [],// 省数据
                firstCity: [],//第一次请求到的市

                birthCity: [],//出生地市区信息
                birthAreas: [],//出生地县信息
                birthVillages: [],//出生地乡信息
                birthHamlets: [],//出生地村落信息

                nativeCity: [],//籍贯市区信息
                nativeAreas: [],//籍贯县信息
                nativeVillages: [],//籍贯乡信息
                nativeHamlets: [],//籍贯村落信息

                presentCity: [],//籍贯市区信息
                presentAreas: [],//籍贯县信息
                presentVillages: [],//籍贯乡信息
                presentHamlets: [],//籍贯村落信息

                registerCity: [],//户口地址市区信息
                registerAreas: [],//户口地址县信息
                registerVillages: [],//户口地址乡信息
                registerHamlets: [],//户口地址村落信息

                companyCity: [],//单位市区信息
                companyAreas: [],//单位县信息
                companyVillages: [],//单位乡信息
                companyHamlets: [],//单位村落信息

                contactCity: [],//紧急联系人市区信息
                contactAreas: [],//紧急联系人县信息
                contactVillages: [],//紧急联系人乡信息
                contactHamlets: [],//紧急联系人村落信息

                patCredTypeID: '',       //患者证件类型
                contactCredTypeID: '',   //紧急联系人证件类型
                patCredNo: '',           //患者证件号
                contactCredNo: '',       //联系人证件号

                isShowCorrelationModal: false, //关联患者弹框
                checkMsg: '',  //弹框提示信息
                checkData: '',  //弹框患者信息

                adminListVisible: false, // 住院证列表弹框

                remainBed: 0, //剩余床位数
                remainSecond: 2, //成功后弹框延迟时间
                visibleSuccess: false,
                //提示信息
                tipsPatName: '',
                tipsPatSexID: '',
                tipsPatCredTypeID: '',
                tipsPatCredNo: '',
                tipsPatTypeID: '',
                tipsPatMobile: '',
                tipsTelPhone: '',
                tipsPresentAddressDesc: '',
                tipsInHospNum: '',
                tipsAdmReasonID: '',
                tipsInsuranceId: '',
                tipsInLocID: '',
                tipsInWardID: '',
                tipsPatEContactCredTypeIDNo: '',
                tipsPatEContactMobile: '',
                tipsPatCompanyTel: '',
                modelHeight: 330,
                patientAccountVisile: false,
                poorFlag: false,
                inDeposit: 0.00,           // 预交金
                payReasonCode: '',

                //E 空数据校验, M 手机号校验,N 数值类型元素校验
                tipsItem: [{
                    code: 'patName',
                    flag: 'E',
                    msg: '请填写患者姓名'
                }, {
                    code: 'patSexID',
                    flag: 'E',
                    msg: '请选择性别'
                },
                //  {
                //     code: 'patCredTypeID',
                //     flag: 'E',
                //     msg: '请选择证件类型'
                // },
                {
                    code: 'patTypeID',
                    flag: 'E',
                    msg: '请选择病人类型'
                }, {
                    code: 'patMobile',
                    flag: 'M',
                    msg: '请输入正确的手机号'
                }, {
                    code: 'presentAddressDesc',
                    flag: 'E',
                    msg: '请填写现住址详细地址'
                }, {
                    code: 'inHospNum',
                    flag: 'N',
                    msg: '非正整数'
                }, {
                    code: 'admReasonID',
                    flag: 'E',
                    msg: '请选择结算类型'
                }, {
                    code: 'insuranceId',
                    flag: 'E',
                    msg: '请选择险种类型'
                }, {
                    code: 'inWardID',
                    flag: 'E',
                    msg: '请选择就诊病区'
                }, {
                    code: 'inLocID',
                    flag: 'E',
                    msg: '请选择就诊科室'
                }, {
                    code: 'patEContactMobile',
                    flag: 'M',
                    msg: '手机号不正确'
                }, {
                    code: 'patCompanyTel',
                    flag: 'M',
                    msg: '手机号不正确'
                }, {
                    code: 'patCredNo',
                    flag: 'E',
                    msg: '请输入证件号码'
                }, {
                    code: 'patEContactCredTypeIDNo',
                    flag: 'E',
                    msg: '请输入证件号码'
                }],
                sourceData: {}
            }
            this.columns = [
                {
                    title: '类别',
                    dataIndex: 'mark',
                    width: '6.2%',
                    align: 'center',
                    render: (text, data, index) => {
                        return (Util.isEmpty(data.id) && (data.editable)) ?
                            <Select
                                style={{ width: '98%', }} value={data.diagCMarkID || this.state.CMark}
                                onChange={this.onCMarkChange.bind(this, index)}
                            >
                                {
                                    this.state.diagCategory && this.state.diagCategory.map((item) => {
                                        return (<Option key={item.code + ''} value={item.code}>{item.descripts}</Option>)
                                    })
                                }
                            </Select> : data.diagCMark
                    }
                }, {
                    title: '诊断类型',
                    dataIndex: 'diagType',
                    width: 105,
                    align: 'center',
                    render: (text, data, index) => {
                        return (Util.isEmpty(data.id)) || (data.editable) ? <Select style={{ width: '100%' }} value={data.diagTypeID || this.state.diagTypeDefID} onChange={this.onDiagTypeChange.bind(this, index)} >
                            {
                                this.state.typeData && this.state.typeData.map((item) => {
                                    return (<Option key={item.id} value={item.id}>{item.descripts}</Option>)
                                })
                            }</Select> : data.diagTypeDesc
                    }
                }, {
                    title: '级别',
                    dataIndex: 'cat',
                    width: 110,
                    align: 'center',
                    render: (text, data, index) => {
                        return (Util.isEmpty(data.id)) || (data.editable) ? <Select style={{ width: '100%' }} value={data.catID || this.state.diagCatDefID} onChange={this.onCatChange.bind(this, index)} >{
                            this.state.catData && this.state.catData.map((item) => {
                                return (<Option key={item.id} value={item.id}>{item.descripts}</Option>)
                            })
                        }</Select> : data.catDesc
                    }
                }, {
                    title: '诊断代码',
                    dataIndex: 'diagCode',
                    width: 110,
                    align: 'center',
                }, {
                    title: '诊断名称',
                    dataIndex: 'diagDesc',
                    width: 210,
                    align: 'center',
                    render: (text, data, index) => {
                        return (!(Util.isEmpty(data.id))) || (!data.editable) ? <span>{data.diagDesc}</span> :
                            <Input style={{ width: '99%' }}
                                id={'diagDesc-input' + index}
                                onKeyDown={this.showCommonTableModal.bind(this, index, data, 'diagDesc')} allowClear={true}
                                autoFocus
                                value={data.diagDesc || ''}
                                onChange={this.handleSearchInput.bind(this, 'diagDesc', index, data)}
                            />
                    }
                }, {
                    title: '眼别',
                    dataIndex: 'eyePart',
                    width: 120,
                    align: 'center',
                    render: (text, data, index) => {
                        return (Util.isEmpty(data.id)) || (data.editable) ? <Select style={{ width: '98%' }} value={data.eyePartID || this.state.eyePartID} onChange={this.onEyePartChange.bind(this, index)} >
                            {
                                this.state.eyePart && this.state.eyePart.map((item) => {
                                    return (<Option key={item.id + ''} value={item.id}>{item.descripts}</Option>)
                                })
                            }</Select> : data.eyePartDesc
                    }
                }, {
                    title: '病种',
                    dataIndex: 'disease',
                    width: 120,
                    align: 'center',
                    render: (text, data, index) => {
                        return (Util.isEmpty(data.id)) || (data.editable) ? <Select allowClear style={{ width: '98%' }} value={data.diseasesID || this.state.diseasesID} onChange={this.onDiseaseChange.bind(this, index)} >
                            {
                                this.state.disease && this.state.disease.map((item) => {
                                    return (<Option key={item.id + ''} value={item.id}>{item.descripts}</Option>)
                                })
                            }</Select> : data.diseasesDesc
                    }
                }, {
                    title: '主诊断',
                    dataIndex: 'mainDiag',
                    width: 60,
                    align: 'center',
                    render: (text, data, index) => {
                        return <Checkbox onChange={this.onMainDiagChange.bind(this, index)} checked={data.mainDiagID == 'Y'}
                            disabled={((!data.editable) || (data.mainFlag != 'Y'))}>
                        </Checkbox>
                    }
                }, {
                    title: '诊断注释',
                    dataIndex: 'descripts',
                    width: 120,
                    align: 'center',
                    render: (text, data, index) => {
                        return data.editable || (data.editable) ? <Input key="descripts" style={{ width: '100%' }} onPressEnter={this.onDescriptsEnter} value={data.descripts} onChange={this.onDescChange.bind(this, index)} /> : data.descripts
                    }
                }, {
                    title: '诊断状态',
                    dataIndex: 'status',
                    width: 80,
                    align: 'center',
                    render: (text, data, index) => {
                        return (Util.isEmpty(data.id)) || (data.editable) ? <Select style={{ width: '100%' }} value={data.diagStatusID || this.state.diagStatusDefID} onChange={this.onStatusChange.bind(this, index)}>{
                            this.state.statusData && this.state.statusData.map((item) => {
                                return (<Option key={item.id} value={item.id}>{item.descripts}</Option>)
                            })
                        }</Select> : data.diagStatusDesc
                    }
                },
                //  {
                //     title: '发病日期',
                //     dataIndex: 'onsetDate',
                //     width: 120,
                //     align: 'center',
                //     render: (text, data, index) => {
                //         return (Util.isEmpty(data.id)) || (data.editable) ? <DatePicker
                //             onChange={this.onsetDateChange.bind(this, index)}
                //             value={data.onsetDate ? moment(data.onsetDate, 'YYYY-MM-DD') : moment(new Date(), 'YYYY-MM-DD')}>
                //         </DatePicker> : data.onsetDate
                //     }
                // }
            ]
            this.dialogColumns = [
                {
                    title: '诊断编码',
                    dataIndex: 'diagCode',
                    width: 80,
                    align: 'left',
                }, {
                    title: '名称',
                    dataIndex: 'diagDesc',
                    width: 200,
                    align: 'left',
                }, {
                    title: 'ICD编码',
                    dataIndex: 'ICDCode',
                    width: 80,
                    align: 'left',
                }, {
                    title: 'ICD名称',
                    dataIndex: 'ICDDesc',
                    width: 200,
                    align: 'left',
                }, {
                    title: '版本号',
                    dataIndex: 'ICDVersion',
                    width: 60,
                    align: 'left',
                },
            ]
            this.cardNo = React.createRef();
            this.patName = React.createRef();
            this.patCredNo = React.createRef();
            this.ward = React.createRef();
        }

        componentDidMount() {
            message.config({ top: 320, duration: 3 });
            this.loadBaseParms();
            this.loadDiagBaseData();
            this.getInsuAlertListInfo();    //加载险种类型
            this.getLocList("locList", "");
            let self = this;
            document.addEventListener("keydown", function (e) {
                self.KeyDowns(e)
            })
        }

        componentWillUnmount() {
            // 组件销毁前将静止让setState修改state的状态
            this.setState = (state, callback) => { return; }
            clearInterval(timer);
            window.removeEventListener("keydown", this.KeyDowns())
        }

        showCommonTableModal(index, data, name, e) {
            if (e.keyCode == '13') {
                if (data[name]) {
                    this.setState({
                        isShowCommonTableModal: true,
                        searchData: data,
                        search: "1",
                    }, () => {
                        this.loadSelectData(data[name], '', '')
                        this.child.showModal();
                    })
                }
            }
        }

        ChangeRatio = () => {
            var ratio = 0;
            var screen = window.screen;
            var ua = navigator.userAgent.toLowerCase();

            if (window.devicePixelRatio !== undefined) {
                ratio = window.devicePixelRatio;
            }
            else if (~ua.indexOf('msie')) {
                if (screen.deviceXDPI && screen.logicalXDPI) {
                    ratio = screen.deviceXDPI / screen.logicalXDPI;
                }

            }
            else if (window.outerWidth !== undefined && window.innerWidth !== undefined) {
                ratio = window.outerWidth / window.innerWidth;
            }

            if (ratio) {
                ratio = Math.round(ratio * 100);
            }
            return ratio;
        }

        handleSearchWard = () => {
            var params = {
                params: [{
                }]
            }
            $http.post('urlDeault', this, {
                code: "03050168",
                data: params,
                success: function (res) {
                    if (res.errorCode == '0') {
                        this.setState({
                            wardList: res.result,
                        })
                    }
                }
            });
        }

        //列修改为input框，change事件处理
        handleSearchInput(name, index, data, e) {
            var dataSource = this.state.dataSource;
            let top = document.getElementById(name + "-input" + index).getBoundingClientRect().top + 40
            let left = document.getElementById(name + "-input" + index).getBoundingClientRect().left;
            let windowHeight = window.innerHeight - 58;
            let rate = this.ChangeRatio();
            let modelHeight = this.state.modelHeight;
            let oldTop = top;
            if ((top + modelHeight + 30) > windowHeight) {
                top = top - 330 - 40;
                if (top < 58) {
                    top = 58;
                    if ((windowHeight - oldTop) > oldTop) {
                        top = oldTop;
                        if ((windowHeight - oldTop) < modelHeight) {
                            modelHeight = windowHeight - oldTop;
                        }

                    } else {
                        if ((oldTop - 58) < modelHeight) {
                            modelHeight = oldTop - 58 - 40;
                        } else {
                            top = oldTop - 40 - modelHeight;
                        }
                    }
                }
            } else {
                if ((windowHeight - top) < modelHeight) {
                    //剩余位置小于默认的弹框高度
                    if ((windowHeight - top) > top) {
                        //下半部分高度大于上半部分
                        modelHeight = windowHeight - top - 40;
                    } else {
                        //下半部分小于上半部分
                        if ((windowHeight - top) > modelHeight) {
                            //上半部分高度大于默认高度
                            top = top - 330 - 40;
                        } else {
                            //上半部分高度小于默认高度
                            modelHeight = windowHeight - 40 - oldTop;
                            top = 58;
                        }
                    }
                }
            }
            //modelHeight = rate / 100 * modelHeight;
            top = top + "px";
            left = left + "px";
            var value = e.target.value;
            dataSource[index][name] = value;
            this.setState({
                indexTab: index,
                top: top,
                left: left,
                searchData: data,
                selectIndex: index,
                dataSource: dataSource,
                changename: name,
                changeValue: value,
                diseasesID: data.diseasesID,
                selectData: [],
                total: 0,
                modelHeight: modelHeight,
                page: 1,
            })
            if (value.length >= 2) {
                this.loadSelectData(value, '', '')
            } else {
                this.setState({
                    selectData: [],
                    total: 0,
                    page: 1,
                })
            }
            document.addEventListener('elementTable', this.loadListener)
        }

        KeyDowns = (e) => {
            if (e) {

                e.stopPropagation();
                let currKey = 0;
                e = e || event || window.event;
                currKey = e.keyCode || e.which || e.charCode;
                //快捷键入院 ctrl + s
                if (currKey == 83 && e.ctrlKey) {
                    this.handlesubmit();
                }
                if (currKey == 90 && e.ctrlKey) {
                    //快捷键清空ctrl + z
                    this.handleReset();
                }
                if (currKey == 115) {
                    //快捷键F4
                    event.returnValue = false;
                    this.handlePrintBedCard();
                }
                if (currKey == 119) {
                    //快捷键F8
                    event.returnValue = false;
                    this.CancelRegister();
                }
                if (currKey == 113) {
                    //编辑患者信息
                    this.handleEditSubmit();
                }
                if (currKey == 114) {
                    event.returnValue = false;
                    //充值
                    this.setState({
                        patientAccountVisile: true,
                    })
                }
            }
        }

        handleReset = () => {
            this.props.form.resetFields();
            this.setState({
                dataSource: [],
                patInfo: {},
                admInfo: {},
                patAdminInfo: {}, //住院证信息
                selectData: [],
                docList: [],    //医生
                readInfoLoading: false,
                inHospDisabled: false,
                birthCity: [],//出生地市区信息
                birthAreas: [],//出生地县信息
                birthVillages: [],//出生地乡信息
                birthHamlets: [],//出生地村落信息

                nativeCity: [],//籍贯市区信息
                nativeAreas: [],//籍贯县信息
                nativeVillages: [],//籍贯乡信息
                nativeHamlets: [],//籍贯村落信息

                presentCity: [],//籍贯市区信息
                presentAreas: [],//籍贯县信息
                presentVillages: [],//籍贯乡信息
                presentHamlets: [],//籍贯村落信息

                registerCity: [],//户口地址市区信息
                registerAreas: [],//户口地址县信息
                registerVillages: [],//户口地址乡信息
                registerHamlets: [],//户口地址村落信息

                companyCity: [],//单位市区信息
                companyAreas: [],//单位县信息
                companyVillages: [],//单位乡信息
                companyHamlets: [],//单位村落信息

                contactCity: [],//紧急联系人市区信息
                contactAreas: [],//紧急联系人县信息
                contactVillages: [],//紧急联系人乡信息
                contactHamlets: [],//紧急联系人村落信息
                patCredTypeID: "",       //患者证件类型
                contactCredTypeID: "",   //紧急联系人证件类型
                //提示信息
                tipsPatName: "",
                tipsPatSexID: "",
                tipsPatCredTypeID: "",
                tipsPatCredNo: "",
                tipsPatTypeID: "",
                tipsPatMobile: "",
                tipsTelPhone:"",
                tipsPresentAddressDesc: "",
                tipsInHospNum: "",
                tipsAdmReasonID: "",
                tipsInsuranceId: "",
                tipsInLocID: "",
                tipsInWardID: "",
                tipsPatEContactCredTypeIDNo: "",
                tipsPatEContactMobile: "",
                tipsPatCompanyTel: "",
                patPoor: false
            })
        }

        handlesubmit = () => {
            let that = this;
            this.checkAllTips();
            this.props.form.validateFields((err, values) => {
                if (!err) {
                    //from数据不合法
                    if (that.state.dataSource.length == 0) {
                        message.warn("请添加诊断信息!");
                        return;
                    }
                    if (that.state.remainBed == 0) {
                        confirm({
                            title: '提示',
                            content: "当前入院病区已无空床，是否继续办理登记，点击确定则继续办理，取消则不操作",
                            onOk() {
                                that.handleRegister("0");
                            }
                        });

                    } else {
                        that.handleRegister("0");
                    }
                }
            })
        }

        //退院
        CancelRegister = () => {
            if (!this.state.admInfo.admID) {
                message.warn("请先查找患者");
                return;
            }
            let data = {};
            data = {
                params: [{
                    admID: this.state.admInfo.admID,
                    patID: this.state.admInfo.patID,
                }]
            }
            $http.post('urlS', this, {
                code: "03060026",
                data: data,
                success: function (res) {
                    if (res.errorCode === '0') {
                        message.success("已退院!");
                    }
                    this.handleReset();
                }
            })
        }

        //分页切换
        changePageSize(current, pageSize) {
            if ((pageSize == this.state.pageSize) && (current == this.state.page)) {
                if (this.state.rowMedID) {
                    let oneArr = this.state.selectData && this.state.selectData.length > 0 ? this.state.selectData : [];
                    let obj = {}
                    for (var i = 0; i < oneArr.length; i++) {
                        if (oneArr[i].id === this.state.rowMedID) {
                            obj = i > 0 ? oneArr[i] : oneArr[0];
                            break;
                        }
                    }
                    if (this.state.changename == "ICDDesc") {
                        this.ICDRowClick(obj)
                    } else {

                        this.rowClick(obj)
                    }
                }
            } else {
                this.setState({ pageSize: pageSize, page: current }, () => {
                    this.loadSelectData('', current, pageSize);
                });
            }
        }

        setRowClassNamePublic = (record) => {
            return record.id === this.state.rowMedID ? 'clickRowStyle' : '';
        }

        onRef = (ref) => {
            this.child = ref;
        }

        onWardRef = (ref) => {
            this.wardChild = ref;
        }

        onPatAccManagement = (ref) => {
            this.patAccManagementChild = ref;
        }

        //取消弹框显示，焦点问题
        handleFocus() {
            this.setState({
                selectData: []
            }, () => {
                if ((this["diagDesc" + this.state.selectIndex]) && (this["diagDesc" + this.state.selectIndex].current)) {
                    this["diagDesc" + this.state.selectIndex].current.focus()
                }
            })
        }

        //取消弹框显示，焦点问题
        handleWardFocus() {
            if ((this["wardLsit" + this.state.selectIndex]) && (this["wardLsit" + this.state.selectIndex].current)) {
                this["wardLsit" + this.state.selectIndex].current.focus()
            }
        }

        onClickWardRowPublic = (record, index) => {
            return {
                onDoubleClick: () => {
                    this.props.form.setFieldsValue({
                        inWardID: record.id,
                    })
                    this.wardChild.handleCancel();
                },
                onClick: () => {
                    this.setState({
                        rowMedID: record.id
                    })
                }
            }
        }

        // 操作弹框
        onClickRowPublic = (record, index) => {
            return {
                onDoubleClick: () => {
                    if (this.state.changename == "ICDDesc") {
                        this.ICDRowClick(record, index)
                    } else {

                        this.rowClick(record, index)
                    }
                },
                onClick: () => {
                    this.setState({
                        rowMedID: record.id
                    })
                }
            }
        }

        handleWardOnKeydown = (e) => {
            var e = window.event || e;
            let scroll_height = 50;
            let id = '';
            let oneArr = this.state.wardList && this.state.wardList.length > 0 ? this.state.wardList : [];
            switch (e.keyCode) {
                case 13:
                    if ((this.state.rowMedID) && (e.target.nodeName != "INPUT")) {
                        let obj = {}
                        for (var i = 0; i < oneArr.length; i++) {
                            if (oneArr[i].id === this.state.rowMedID) {
                                obj = i > 0 ? oneArr[i] : oneArr[0];
                                break;
                            }
                        }
                        this.props.form.setFieldsValue({
                            inWardID: obj.id,
                        })
                    }
                    break;
                case 38: //上
                    if (this.state.rowMedID) {
                        for (var i = 0; i < oneArr.length; i++) {
                            if (oneArr[i].id === this.state.rowMedID) {
                                id = i > 0 ? oneArr[i - 1].id : oneArr[0].id;
                                break;
                            }
                        }
                        this.setState({ rowMedID: id }, () => {
                            var gundong = document.getElementById("wardgundong");
                            gundong.scrollTop = gundong.scrollTop - scroll_height;
                        })
                    } else {
                        this.setState({ rowMedID: oneArr[0].id })
                    }
                    break;
                case 40: //下
                    if (this.state.rowMedID) {
                        for (let i = 0; i < oneArr.length; i++) {
                            if (oneArr[i].id === this.state.rowMedID) {
                                id = i + 1 >= oneArr.length ? oneArr[oneArr.length - 1].id : oneArr[i + 1].id;
                                break;
                            }
                        }
                        this.setState({ rowMedID: id }, () => {
                            var gundong = document.getElementById("wardgundong");
                            gundong.scrollTop = gundong.scrollTop + scroll_height;
                        })
                    } else {
                        this.setState({ rowMedID: oneArr[0].id })
                    }
                    break;
            }
        }

        handleOnKeydown(e) {
            var e = window.event || e;
            let scroll_height = 50;
            let id = '';
            let oneArr = this.state.selectData && this.state.selectData.length > 0 ? this.state.selectData : [];
            switch (e.keyCode) {
                case 13:
                    if ((this.state.rowMedID) && (e.target.nodeName != "INPUT")) {
                        let obj = {}
                        for (var i = 0; i < oneArr.length; i++) {
                            if (oneArr[i].id === this.state.rowMedID) {
                                obj = i > 0 ? oneArr[i] : oneArr[0];
                                break;
                            }
                        }
                        if (this.state.changename == "ICDDesc") {
                            this.ICDRowClick(obj)
                        } else {

                            this.rowClick(obj)
                        }
                    }
                    break;
                case 38: //上
                    if (this.state.rowMedID) {
                        for (var i = 0; i < oneArr.length; i++) {
                            if (oneArr[i].id === this.state.rowMedID) {
                                id = i > 0 ? oneArr[i - 1].id : oneArr[0].id;
                                break;
                            }
                        }
                        this.setState({ rowMedID: id }, () => {
                            var gundong = document.getElementById("gundong");
                            gundong.scrollTop = gundong.scrollTop - scroll_height;
                        })
                    } else {
                        this.setState({ rowMedID: oneArr[0].id })
                    }
                    break;
                case 40: //下
                    if (this.state.rowMedID) {
                        for (let i = 0; i < oneArr.length; i++) {
                            if (oneArr[i].id === this.state.rowMedID) {
                                id = i + 1 >= oneArr.length ? oneArr[oneArr.length - 1].id : oneArr[i + 1].id;
                                break;
                            }
                        }
                        this.setState({ rowMedID: id }, () => {
                            var gundong = document.getElementById("gundong");
                            gundong.scrollTop = gundong.scrollTop + scroll_height;
                        })
                    } else {
                        this.setState({ rowMedID: oneArr[0].id })
                    }
                    break;
            }
        }

        handleRegister = (flag) => {
            this.props.form.validateFields((err, values) => {
                if (!err) {  //!err
                    if (!Util.isEmpty(values.patEContactMobile) && values.patEContactMobile.length != 11) {
                        return message.error("联系人电话格式错误")
                    }
                    let data = {}
                    data = {
                        params: [{
                            insFlag: flag,
                            userID: userData.userID,
                            patInfo: {
                                addressInfo: [
                                    {
                                        addressTypeCode: 'Birth',
                                        addressData: {
                                            // 出生地址
                                            patAddress: values.birthAddress || '',
                                            patProvinceID: values.birthProvinceID || '',
                                            patCityID: values.birthCityID || '',
                                            patAreaID: values.birthAreaID || '',
                                            patVillageID: values.birthVillageID || '',
                                            patHamletID: values.birthHamletID || '',
                                        }
                                    },
                                    {
                                        addressTypeCode: 'Company',
                                        addressData: {
                                            //单位地址
                                            patAddress: values.companyAddress || '',
                                            patProvinceID: values.companyProvinceID || '',
                                            patCityID: values.companyCityID || '',
                                            patAreaID: values.companyAreaID || '',
                                            patVillageID: values.companyVillageID || '',
                                            patHamletID: values.companyHamletID || '',
                                            patZIP: values.companyZIP || '',
                                        }
                                    },
                                    {
                                        addressTypeCode: 'Contact',
                                        addressData: {
                                            //联系人地址
                                            patAddress: values.contactAddress || '',
                                            patProvinceID: values.contactProvinceID || '',
                                            patCityID: values.contactCityID || '',
                                            patAreaID: values.contactAreaID || '',
                                            patVillageID: values.contactVillageID || '',
                                            patHamletID: values.contactHamletID || '',
                                        }
                                    },
                                    {
                                        addressTypeCode: 'Native',
                                        addressData: {
                                            //籍贯
                                            patAddress: values.nativeAddress || '',
                                            patProvinceID: values.nativeProvinceID || '',
                                            patCityID: values.nativeCityID || '',
                                            patAreaID: values.nativeAreaID || '',
                                            patVillageID: values.nativeVillageID || '',
                                            patHamletID: values.nativeHamletID || '',
                                        }
                                    },
                                    {
                                        addressTypeCode: 'Present',
                                        addressData: {
                                            //现住址
                                            patAddress: values.presentAddressDesc || '',
                                            patProvinceID: values.presentProvinceID || '',
                                            patCityID: values.presentCityID || '',
                                            patAreaID: values.presentAreaID || '',
                                            patVillageID: values.presentVillageID || '',
                                            patHamletID: values.presentHamletID || '',
                                            patZIP: values.presentZIP || '',
                                        }
                                    },
                                    {
                                        addressTypeCode: 'Register',
                                        addressData: {
                                            //户口
                                            patAddress: values.registerAddress || '',
                                            patProvinceID: values.registerProvinceID || '',
                                            patCityID: values.registerCityID || '',
                                            patAreaID: values.registerAreaID || '',
                                            patVillageID: values.registerVillageID || '',
                                            patHamletID: values.registerHamletID || '',
                                            patZIP: values.registerZIP || '',
                                        }
                                    }
                                ],
                                patName: values.patName || '',
                                patSexID: values.patSexID || '',
                                patBirthDate: moment(values.patBirthDateTime).format(dayFormat) || '',
                                patBirthTime: moment(values.patBirthDateTime).format(timeFormat) || '',
                                patCredTypeID: values.patCredTypeID || '',
                                patCredNo: values.patCredNo || '',
                                patOccupationID: values.patOccupationID || '',
                                patNationID: values.patNationID || '',
                                patTypeID: values.patTypeID || '',
                                patEduID: values.patEduID || '',
                                patMobile: values.patMobile || '',
                                telphone: values.telphone || '',
                                patEContact: values.patEContact || '',
                                patEContactMobile: values.patEContactMobile || '',
                                patERelationID: values.patERelationID || '',
                                patMaritalID: values.patMaritalID || '',
                                patCompany: values.patCompany || '',
                                patCompanyTel: values.patCompanyTel || '',
                                patCountryID: values.patCountryID || '',
                                patSocialStatusID: values.patSocialStatusID || '',
                                patEContactCredTypeID: values.patEContactCredTypeID || '',
                                patEContactCredTypeIDNo: values.patEContactCredTypeIDNo || '',
                                userID: userData.userID,
                                patID: this.state.patInfo.patID,
                                patPoor: values.patPoor ? 'Y' : 'N',
                            },
                            //就诊信息
                            admInfo: {
                                admID: this.state.admInfo.admID,
                                locID: values.inLocID,
                                wardID: values.inWardID,
                                docID: values.mainDocID,
                                admReasonID: values.admReasonID,
                                patInNum: values.inHospNum,
                            },
                            adminID: this.state.patAdminInfo.id,
                            diagList: this.state.dataSource,
                            //险种类型
                            insuTypeCode: values.insuranceId
                        }]
                    }
                    $http.post('urlADS', this, {
                        code: "03060002",
                        data: data,
                        success: function (res) {
                            let errorCode = res.errorCode;
                            if (errorCode === '0') {
                                if (this.props.form.getFieldValue('cardNo') && (this.props.form.getFieldValue('cardNo') !== "")) {
                                    this.getPatInfo("", "", this.state.admReasonCode == 'INSU' ? () => this.onChangeINSURegisterVisable() : '');
                                } else {
                                    this.getPatInfo(
                                        this.props.form.getFieldValue('patCredTypeID'),
                                        this.props.form.getFieldValue('patCredNo'),
                                        this.state.admReasonCode == 'INSU' ? () => this.onChangeINSURegisterVisable() : ''
                                    );
                                }
                                if (flag == "0") {
                                    this.setState({
                                        visibleSuccess: true,
                                        remainSecond: 2,
                                    })
                                    this.timerStart();
                                    this.handleSearchWard();
                                } else {
                                    message.warn("修改成功!");
                                }
                            }
                        }
                    });
                }
            });
        }

        //2s后自动关闭提示
        timerStart = () => {
            timer = setInterval(() => {
                if (this.state.remainSecond > 0) {
                    this.setState({
                        remainSecond: this.state.remainSecond - 1
                    })
                }
            }, 1000);
        }

        handleEditSubmit = () => {
            this.handleRegister("1");
        }

        //加载下拉框信息
        loadBaseParms = () => {
            let data = {}
            data = {
                params: [{
                    cardTypeFlag: 1,//卡类型
                    credTypeFlag: 1,//证件类型
                    patTypeFlag: 1,//病人类型
                    sexFlag: 1,	//性别
                    countryFlag: 1,	//国家
                    nationFlag: 1,//民族
                    occupationFlag: 1,//职业
                    maritalFlag: 1,	//婚姻
                    socialStatusFlag: 1,//身份标签
                    ageUnitFlag: '',
                    payMethodFlag: '',
                    eduFlag: '1',
                    provinceFlag: 1,	//省
                    cityFlag: 1,  //市
                    relationFlag: 1,
                    admReasonFlag: "1",
                    wardListFlag: 1,
                    wardColumnFlag: 1,
                }]
            }
            $http.post('urlS', this, {
                code: '03030005',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        let defCardType = {};
                        res.cardType.map((item, i) => {
                            if (item.defaultFlag === "Y") {
                                defCardType = res.cardType[i];
                            }
                        })
                        if ((!defCardType.id) && (res.cardType.length > 0)) {
                            defCardType = res.cardType[0];
                        }
                        this.setState({
                            initCardDr: defCardType.id,
                            nowRead: defCardType.readMode,
                            cardLength: defCardType.cardLength && defCardType.cardLength != "" ? defCardType.cardLength + "位," : "",
                            nowCost: defCardType.cardCost,
                            idCardCodePop: defCardType.code,
                            nowInv: defCardType.invFlag,
                            replenishZero: defCardType.replenishZero,
                            repariFeeFlag: defCardType.repariFeeFlag,
                            cardNoVisible: false,
                            baseParms: res,
                            province: res.province,
                            firstCity: res.city,
                            admReasonList: res.admReason,
                            wardList: res.wardList,
                            wardListColumns: res.wardColumn,
                            wardColumnsWidth: res.wardTotalWidth,
                        })
                    }
                }
            })
        }

        //加载诊断信息
        loadDiagBaseData() {
            var params = {
                params: [{
                }]
            }
            $http.post('urlDeault', this, {
                code: "03050030",
                data: params,
                success: function (res) {
                    if (res.errorCode == '0') {
                        this.setState({
                            // typeData: res.result.diagType, //诊断类型
                            // statusData: res.result.diagStatus,//诊断备注
                            // catData: res.result.diagCat, //诊断级别
                            // diagTypeDefID: res.result.diagTypeDefID,//诊断类型默认ID
                            // diagCatDefID: res.result.diagCatDefID,  //诊断级别默认ID
                            // diagStatusDefID: res.result.diagStatusDefID, //诊断备注默认ID
                            // eyePart: res.result.eyePart,  // 眼别
                            // disease: res.result.diseases,  // 病种
                            typeData: res.result.diagType, //诊断类型
                            statusData: res.result.diagStatus,//诊断备注
                            catData: res.result.diagCat, //诊断级别
                            medicalType: res.result.medicalType, //复诊类型
                            templetType: res.result.templetType, //模板类型
                            diagTypeDefID: res.result.diagTypeDefID,//诊断类型默认ID
                            diagCatDefID: res.result.diagCatDefID,  //诊断级别默认ID
                            diagStatusDefID: res.result.diagStatusDefID, //诊断备注默认ID
                            admInfo: res.result.admInfo,
                            diagCategory: res.result.diagCategory,   //诊断类别
                            selectedMode: res.result.selectedMode,
                            conditionData: res.result.conditionData, //病情
                            conditionDefID: res.result.conditionDefID,  // 默认病情
                            eyePart: res.result.eyePart,  // 眼别
                            disease: res.result.diseases,  // 病种
                        })
                    }
                }
            });
        }

        /**
         * @ByYQL: 获取险种类型
         * Create 2021-12-21
         */
        getInsuAlertListInfo() {
            var params = {
                params: [{ "admReasonCode": "INSUJNSYB" }]
            }
            $http.post('urlDeault', this, {
                code: "pr02900",
                data: params,
                success: function (res) {
                    if (res.errorCode === '0') {
                        this.setState({
                            insuranceData: res.result.Data
                        })
                    }
                }
            });
        }

        //诊断类别改变
        onCMarkChange = (index, value) => {
            let dataSource = this.state.dataSource;
            dataSource[index].diagCMarkID = value;
            this.forceUpdate();
        }

        //诊断类型改变
        onDiagTypeChange = (index, value) => {
            let dataSource = this.state.dataSource;
            dataSource[index].diagTypeID = value;
            this.forceUpdate();
        }

        //诊断级别改变
        onCatChange = (index, value) => {
            let dataSource = this.state.dataSource;
            dataSource[index].catID = value;
            this.forceUpdate();
        }

        //眼别
        onEyePartChange = (index, value) => {
            let dataSource = this.state.dataSource;
            dataSource[index].eyePartID = value;
            this.forceUpdate();
        }

        //病种
        onDiseaseChange = (index, value) => {
            let dataSource = this.state.dataSource;
            dataSource[index].diseasesID = value;
            this.forceUpdate();
        }

        //是否主诊断
        onMainDiagChange = (index, e) => {
            let dataSource = this.state.dataSource;
            let value = "N";
            if (e.target.checked) {
                value = "Y";
            }
            if (Util.isEmpty(dataSource[index].diagID)) {
                message.warn("请先添加诊断信息!");
                return;
            }

            if ((dataSource[index].mainFlag !== "Y") && (value === "Y")) {
                message.warn("该诊断不能做为主诊断");
                return;
            }

            dataSource[index].mainDiagID = value;
            this.forceUpdate();
        }

        //诊断状态
        onStatusChange = (index, value) => {
            let dataSource = this.state.dataSource;
            dataSource[index].diagStatusID = value;
            this.forceUpdate();
        }

        //诊断注释
        onDescChange = (index, e) => {
            let dataSource = this.state.dataSource;
            dataSource[index].descripts = e.target.value;
            this.forceUpdate();
        }

        //onfocus名称规格展示下拉table
        handleFocusInput(index, e) {
            this.setState({
                indexTable: index,
                visible: e,
            })
        }

        onsetDateChange = (index, date, dateString) => {
            let dataSource = this.state.dataSource;
            dataSource[index].onsetDate = dateString;
            this.forceUpdate();
        }

        handleSearch(index, value) {
            if ((this.state.changeValue !== '') && (value === "")) {
                return;
            }
            this.setState({
                changeValue: value
            })
            if (value.length >= 2) {
                this.loadSelectData(value, '', '')
            } else {
                this.setState({
                    selectData: [],
                    total: 0,
                    page: 1,
                })
            }
            document.addEventListener('elementTable', this.loadListener)
        }

        loadSelectData(value, page, pageSize) {
            var params = {
                params: [{
                    desc: value ? value : this.state.changeValue,
                    hospID: userData.hospID,
                    CMark: this.state.CMark,
                    admID: this.state.patInfo.patAdmID,
                    diseasesID: this.state.diseasesID,
                    // eyesDiagnosis: (this.state.changename == 'ICDDesc') && (this.state.searchData.diagCMarkID != "Z") ? undefined : (this.state.checked == true ? 'Y' : 'N')
                }],
                pagination: [{
                    pageSize: this.state.pageSize,
                    currentPage: page
                }]

            }
            $http.post('urlDeault', this, {
                code: "03050031",
                data: params,
                success: function (res) {
                    if (res.errorCode == '0') {
                        let rowMedID = "";
                        if ((res.result.data) && (res.result.data.length > 0)) {
                            rowMedID = res.result.data[0].id
                        }
                        this.setState({
                            selectData: res.result.data,
                            total: res.result.totalCount,
                            rowMedID: rowMedID,
                        })
                    }
                }
            });
        }

        ///诊断下拉框双击
        rowClick = (record, index, e) => {
            index = this.state.selectIndex;
            if (e) { e.stopPropagation(); }
            let dataSource = this.state.dataSource;
            let findFlag = false;
            for (var i = 0; i < dataSource.length; i++) {
                let obj = dataSource[i];
                if ((obj.diagID == record['id']) && (i !== index)) {
                    findFlag = true;
                }
            }
            if (findFlag) {
                message.error("已存在该诊断!");
                return;
            }
            // dataSource[index]['diagCode'] = record['diagCode'];
            // dataSource[index]['diagDesc'] = record['diagDesc'];
            // dataSource[index]['diagID'] = record['id'];
            // dataSource[index]['mainFlag'] = record['mainFlag']; //是否可作为主诊断
            dataSource[index]['diagCode'] = record['diagCode'] || record['code'];
            dataSource[index]['diagDesc'] = record['diagDesc'] || record['desc'];
            dataSource[index]['insuFlag'] = record['insuFlag'];
            dataSource[index]['diseasesID'] = record['diseasesID'];
            dataSource[index]['diagID'] = record['id'];
            dataSource[index]['ICDID'] = record['ICDID'];
            dataSource[index]['ICDDesc'] = record['ICDDesc'];
            dataSource[index]['ICDCode'] = record['ICDCode'];
            dataSource[index]['mainFlag'] = record['mainFlag']; //是否可作为主诊断

            this.setState({
                visible: false,
                selectData: [],
                total: 0,
                page: 1,
                dataSource: dataSource,
                changeValue: '',
                visStatus: false,
            }, () => {
                this.child.handleCancel();
            })
        }

        //分页切换
        changePageSize(current, pageSize) {
            this.setState({ pageSize: pageSize, page: current }, () => {
                this.loadSelectData('', current, pageSize);
            });
        }

        //分页切换
        onChange = (page, pageSize) => {
            this.setState({ page: page }, () => {
                this.loadSelectData('', page, '');
            });
        }

        //添加空白诊断
        addDiag = (e) => {
            var { dataSource } = this.state;
            //加入添加限制，只有录入了医嘱信息之后才能再次添加
            for (var i = 0; i < dataSource.length; i++) {
                if ((Util.isEmpty(dataSource[i].diagDesc)) && (Util.isEmpty(dataSource[i].id)) && (Util.isEmpty(dataSource[i].descripts))) {
                    message.error('请先录入诊断信息再添加！');
                    return
                }
            }
            let editData = this.state.editData;
            editData.push(this.state.dataSource.length);
            let data = {
                diagCMarkID: this.state.CMark,
                mainDiagID: this.state.mainDiag,
                diagTypeID: this.state.diagTypeDefID,
                catID: this.state.diagCatDefID,
                diagStatusID: this.state.diagStatusDefID,
                index: this.state.dataSource.length + 1,
                editable: true,
            }
            dataSource.push(data);
            this.setState({ visible: false, changeValue: '', editData: editData, dataSource: dataSource })
        }

        //卡类型改变触发
        onCardTypeChange = (value, Option) => {

            setTimeout(() => {
                this.cardNo.current.focus();
            }, 300)
            if (value) {
                this.setState({
                    initCardDr: Option.props.data.id,
                    initCardCode: Option.props.data.code,
                    nowRead: Option.props.data.readMode,
                    cardLength: Option.props.data.cardLength && Option.props.data.cardLength != "" ? Option.props.data.cardLength + "位," : "",
                    nowCost: Option.props.data.cardCost,
                    nowInv: Option.props.data.invFlag,
                    replenishZero: Option.props.data.replenishZero,
                    repariFeeFlag: Option.props.data.repariFeeFlag,
                    cardNoVisible: false,
                    idCardCodePop: Option.props.data.code,
                })
            }
        }

        //选择建卡类型 格式验证
        validFunction = (rule, value, callback) => {
            //控制选择建卡和卡操作选择绑卡id 正确提示 及 校验
            if ((value === "") || (!value)) {
                callback();
                return;
            }
            let diffLength = this.state.cardLengthCard;
            let replenishZero = this.state.replenishZero;
            let idCardCodePop = this.state.replenishZero;
            if (idCardCodePop == '02') {
                var city = { 11: "北京", 12: "天津", 13: "河北", 14: "山西", 15: "内蒙古", 21: "辽宁", 22: "吉林", 23: "黑龙江 ", 31: "上海", 32: "江苏", 33: "浙江", 34: "安徽", 35: "福建", 36: "江西", 37: "山东", 41: "河南", 42: "湖北 ", 43: "湖南", 44: "广东", 45: "广西", 46: "海南", 50: "重庆", 51: "四川", 52: "贵州", 53: "云南", 54: "西藏 ", 61: "陕西", 62: "甘肃", 63: "青海", 64: "宁夏", 65: "新疆", 71: "台湾", 81: "香港", 82: "澳门", 91: "国外 " };
                var tip = "";
                var pass = true;
                if (!value || !/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(value)) {
                    callback('身份证号格式错误'); // 校验未通过
                    return;
                }

                else if (!city[value.substr(0, 2)]) {
                    callback('身份证号格式错误'); // 校验未通过
                    return;
                }
                else {
                    //18位身份证需要验证最后一位校验位
                    if (value.length == 18) {
                        value = value.split('');
                        //∑(ai×Wi)(mod 11)
                        //加权因子
                        var factor = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2];
                        //校验位
                        var parity = [1, 0, 'X', 9, 8, 7, 6, 5, 4, 3, 2];
                        var sum = 0;
                        var ai = 0;
                        var wi = 0;
                        for (var i = 0; i < 17; i++) {
                            ai = value[i];
                            wi = factor[i];
                            sum += ai * wi;
                        }
                        var last = parity[sum % 11];
                        //最后一位不区分大小写
                        if (value[17] == 'x') value[17] = value[17].toUpperCase();
                        if (parity[sum % 11] != value[17]) {
                            callback('最后一位校验位错误'); // 校验未通过
                            return;
                        }
                    }
                }
                callback();
            }
            if (replenishZero == "N" && parseInt(diffLength) > 0 && idCardCodePop != '12') {
                let length = parseInt(diffLength)
                var reg = new RegExp('^\\d{' + length + '}$')
                if (!reg.test(value)) {
                    callback('该卡号长度不正确，请输入有效卡号'); // 校验未通过
                    return;
                } else {
                }
            }
            if (replenishZero == "Y" && parseInt(diffLength) > 0) {
                let length = parseInt(diffLength)
                var reg = new RegExp("^\\d{" + length + "}$");
                if (!reg.test(value)) {
                    callback('该卡号无效，请输入有效卡号,数字可自动补0'); // 校验未通过
                    return;
                } else {
                }
            }
            if (replenishZero == "N" && !parseInt(diffLength) > 0) {
                if (!/^[0-9]*$/.test(value)) {
                    callback('请输入任意数字'); // 校验未通过
                    return;
                } else {
                }
            }
            callback();
        }

        //选择或清除省
        onProvinceChange(flag, value, option) {
            if (value) {
                let city = []
                city = this.state.firstCity.filter((item) => item.province == value);
                let patInfo = this.state.patInfo;
                let patFlag = this.firstToUp(flag);
                if (patInfo["pat" + patFlag + "ProvinceID"]) {
                    patInfo["pat" + patFlag + "ProvinceID"] = undefined;
                    patInfo["pat" + patFlag + "CityID"] = undefined;
                    patInfo["pat" + patFlag + "AreaID"] = undefined;
                    patInfo["pat" + patFlag + "VillageID"] = undefined;
                    patInfo["pat" + patFlag + "HamletID"] = undefined;
                }
                this.props.form.setFieldsValue({
                    [flag + "CityID"]: undefined,
                    [flag + "AreaID"]: undefined,
                    [flag + "VillageID"]: undefined,
                    [flag + "HamletID"]: undefined
                });
                this.setState({
                    [flag + "City"]: city,
                    [flag + "Areas"]: [],
                    [flag + "Villages"]: [],
                    [flag + "Hamlets"]: [],
                    patInfo: patInfo,
                })
            } else {
                //清除省
                this.props.form.setFieldsValue({
                    [flag + "CityID"]: undefined,
                    [flag + "AreaID"]: undefined,
                    [flag + "VillageID"]: undefined,
                    [flag + "HamletID"]: undefined
                });
                let patInfo = this.state.patInfo;
                let patFlag = this.firstToUp(flag);
                if (patInfo["pat" + patFlag + "ProvinceID"]) {
                    patInfo["pat" + patFlag + "ProvinceID"] = undefined;
                    patInfo["pat" + patFlag + "CityID"] = undefined;
                    patInfo["pat" + patFlag + "AreaID"] = undefined;
                    patInfo["pat" + patFlag + "VillageID"] = undefined;
                    patInfo["pat" + patFlag + "HamletID"] = undefined;
                }
                this.setState({
                    [flag + "City"]: [],
                    [flag + "Areas"]: [],
                    [flag + "Villages"]: [],
                    [flag + "Hamlets"]: [],
                    patInfo: patInfo,
                })
            }
        }

        //首字母大写
        firstToUp = (str) => {
            return str.substring(0, 1).toUpperCase() + str.substring(1);
            // 正则法
            // str = str.toLowerCase();
            // var reg = /\b(\w)|\s(\w)/g; //  \b判断边界\s判断空格
            // return str.replace(reg, function (m) {
            //     return m.toUpperCase()
            // });
        }

        onCityFocus = (provinceFlag, cityFlag) => {
            let city = this.state[cityFlag];
            let provinceID = this.props.form.getFieldValue(provinceFlag);
            if ((city.length === 0) && (provinceID)) {
                let newCity = []
                newCity = this.state.firstCity.filter((item) => item.province == provinceID);
                this.setState({
                    [cityFlag]: newCity,
                })
            }
        }

        //选择或清除市
        onCityChange(flag, value, option) {
            if (value) {
                this.props.form.setFieldsValue({
                    [flag + "ProvinceID"]: option.props.provinceid,
                    [flag + "AreaID"]: undefined,
                    [flag + "VillageID"]: undefined,
                    [flag + "HamletID"]: undefined,
                    [flag + "ZIP"]: option.props.zip,
                });

                let patInfo = this.state.patInfo;
                let patFlag = this.firstToUp(flag);
                if (patInfo["pat" + patFlag + "CityID"]) {
                    patInfo["pat" + patFlag + "CityID"] = undefined;
                    patInfo["pat" + patFlag + "AreaID"] = undefined;
                    patInfo["pat" + patFlag + "VillageID"] = undefined;
                    patInfo["pat" + patFlag + "HamletID"] = undefined;
                }
                this.setState({
                    patInfo: patInfo,
                })
                this.getAreas(value, flag, "1");
            } else {
                //清除市
                this.props.form.setFieldsValue({
                    [flag + "CityID"]: undefined,
                    [flag + "AreaID"]: undefined,
                    [flag + "VillageID"]: undefined,
                    [flag + "HamletID"]: undefined,
                    [flag + "ZIP"]: undefined,
                });
                let patInfo = this.state.patInfo;
                let patFlag = this.firstToUp(flag);
                if (patInfo["pat" + patFlag + "CityID"]) {
                    patInfo["pat" + patFlag + "CityID"] = undefined;
                    patInfo["pat" + patFlag + "AreaID"] = undefined;
                    patInfo["pat" + patFlag + "VillageID"] = undefined;
                    patInfo["pat" + patFlag + "HamletID"] = undefined;
                }
                this.setState({
                    [flag + "Areas"]: [],
                    [flag + "Villages"]: [],
                    [flag + "Hamlets"]: [],
                    patInfo: patInfo,
                })
            }
        }

        //选择市时加载县数据
        getAreas = (cityID, flag, cleanFlag) => {
            let data = {
                params: [{
                    cityId: cityID
                }],
            }
            $http.post('urlS', this, {
                code: '03030006',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        if (cleanFlag === "1") {
                            this.setState({
                                [flag + "Areas"]: res.result,
                                [flag + "Villages"]: [],
                                [flag + "Hamlets"]: [],
                            })
                        } else {
                            this.setState({
                                [flag + "Areas"]: res.result,
                            })
                        }
                    } else {
                        this.setState({
                            [flag + "Areas"]: [],
                            [flag + "Villages"]: [],
                            [flag + "Hamlets"]: [],
                        })
                    }
                }
            })
        }

        //选择或清除县
        onAreaChange(flag, value, option) {
            if (value) {
                this.props.form.setFieldsValue({
                    [flag + "VillageID"]: undefined,
                    [flag + "HamletID"]: undefined,
                    [flag + "ZIP"]: option.props.zip,
                });
                this.getVillages(value, flag, "1");
            } else {
                //清除市
                this.props.form.setFieldsValue({
                    [flag + "VillageID"]: undefined,
                    [flag + "HamletID"]: undefined,
                    [flag + "ZIP"]: undefined,
                });
                let patInfo = this.state.patInfo;
                let patFlag = "";
                switch (flag) {
                    case "birth":
                        patFlag = "Birth";
                        break;
                    case "native":
                        patFlag = "Native";
                        break;
                    case "present":
                        patFlag = "Present";
                        break;
                    case "register":
                        patFlag = "Register";
                        break;
                    case "company":
                        patFlag = "Company";
                        break;
                    case "contact":
                        patFlag = "Contact";
                        break;
                }
                if (patInfo["pat" + patFlag + "AreaID"]) {
                    patInfo["pat" + patFlag + "AreaID"] = undefined;
                    patInfo["pat" + patFlag + "VillageID"] = undefined;
                    patInfo["pat" + patFlag + "HamletID"] = undefined;
                }
                this.setState({
                    [flag + "Villages"]: [],
                    [flag + "Hamlets"]: [],
                    patInfo: patInfo,
                })
            }
        }

        //县获取焦点
        onAreaFocus(cityFlag, areaFlag) {
            let area = this.state[areaFlag + "Areas"];
            let cityID = this.props.form.getFieldValue(cityFlag);
            if ((area.length === 0) && (cityID)) {
                this.getAreas(cityID, areaFlag, "0");
            }
        }

        //选择县时加载乡数据
        getVillages = (countyID, flag, cleanFlag) => {
            let data = {
                params: [{
                    areaId: countyID,
                }],
            }
            $http.post('urlS', this, {
                code: '03030007',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        if (cleanFlag === "1") {
                            this.setState({
                                [flag + "Villages"]: res.result,
                                [flag + "Hamlets"]: [],
                            })
                        } else {
                            this.setState({
                                [flag + "Villages"]: res.result,
                            })
                        }
                    } else {
                        this.setState({
                            [flag + "Villages"]: [],
                            [flag + "Hamlets"]: [],
                        })
                    }
                }
            })
        }

        //选择县或清除乡
        onVillageChange(flag, value, option) {
            if (value) {
                this.props.form.setFieldsValue({
                    [flag + "HamletID"]: undefined,
                    [flag + "ZIP"]: option.props.zip,
                });
                this.getHamlets(value, flag);
            } else {
                //清除市
                this.props.form.setFieldsValue({
                    [flag + "HamletID"]: undefined,
                    [flag + "ZIP"]: undefined
                });
                let patInfo = this.state.patInfo;
                let patFlag = "";
                switch (flag) {
                    case "birth":
                        patFlag = "Birth";
                        break;
                    case "native":
                        patFlag = "Native";
                        break;
                    case "present":
                        patFlag = "Present";
                        break;
                    case "register":
                        patFlag = "Register";
                        break;
                    case "company":
                        patFlag = "Company";
                        break;
                    case "contact":
                        patFlag = "Contact";
                        break;
                }
                if (patInfo["pat" + patFlag + "VillageID"]) {
                    patInfo["pat" + patFlag + "VillageID"] = undefined;
                    patInfo["pat" + patFlag + "HamletID"] = undefined;
                }
                this.setState({
                    [flag + "Hamlets"]: [],
                    patInfo: patInfo,
                })
            }
        }

        //乡获取焦点时调用
        onVillageFocus(areaFlag, villageFlag) {
            let village = this.state[villageFlag + "Villages"];
            let areaID = this.props.form.getFieldValue(areaFlag);
            if ((village.length === 0) && (areaID)) {
                this.getVillages(areaID, villageFlag, "0");
            }
        }

        //选择乡时加载村数据
        getHamlets = (villageID, flag) => {
            let data = {
                params: [{
                    villageId: villageID
                }],
            }
            $http.post('urlS', this, {
                code: '03030008',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            [flag + "hamlets"]: res.result,
                        })
                    } else {
                        this.setState({
                            [flag + "hamlets"]: [],
                        })
                    }
                }
            })
        }

        onHamletFocus(villageFlag, hamletsFlag) {
            let hamlets = this.state[hamletsFlag + "Hamlets"];
            let villageID = this.props.form.getFieldValue(villageFlag);
            if ((hamlets.length === 0) && (villageID)) {
                this.getHamlets(villageID, hamletsFlag);
            }
        }

        //卡号回车
        onCardPressEnter = () => {
            if (this.state.replenishZero == "Y" && parseInt(this.state.cardLength) && parseInt(this.state.cardLength) > 0 && this.props.form.getFieldValue('cardNo') && this.props.form.getFieldValue('cardNo').length > 0) {
                let No = this.props.form.getFieldValue('cardNo') ? this.props.form.getFieldValue('cardNo') : ''
                let length = parseInt(this.state.cardLength)
                let num = (Array(length).join(0) + No).slice(-length)
                this.props.form.setFieldsValue({ cardNo: num });
                this.setState({
                    cardNoVisible: false,
                });

            }
            let errorMsg = "";
            let cardNo = this.props.form.getFieldValue('cardNo');
            this.validFunction("", cardNo, (error) => {
                errorMsg = error;
            });
            if (errorMsg && (errorMsg !== "")) {
                message.warn(errorMsg);
                return;
            }
            if (cardNo && cardNo.length > 0) {
                this.getPatInfo("", "");
            } else {
                message.warn("请输入卡号!");
                return;
            }
        }

        onNumberPressEnter = (callback) => {
            if (this.props.form.getFieldValue('number') && this.props.form.getFieldValue('number').length > 0) {
                this.getPatInfo('', '', callback);
            } else {
                message.warn('请输入病人ID/身份证号!');
                return;
            }
        }

        //卡号失去焦点 onCardBlur
        onCardBlur = (e) => {
            if (e) {
                this.handleZero();
                this.cardTip(1);
            }
        }

        //卡号改变时触发
        onCardNoChange = (e) => {
            e.stopPropagation();
            if (e.target.value === '') {
                this.setState({
                    cardNoVisible: false,
                    tipsCardNo: '',
                })
            }
        }

        //进行卡号检测补0操作
        handleZero = () => {
            if (this.props.form.getFieldValue('cardNo') && this.props.form.getFieldValue('cardNo').length == 0) {
                this.setState({
                    cardNoVisible: false
                })
                return
            } else {
                this.handleLength()
            }
        }

        //不足12字补0
        handleLength = () => {
            if (this.state.replenishZero == 'Y' && parseInt(this.state.cardLength) && parseInt(this.state.cardLength) > 0 && this.props.form.getFieldValue('cardNo') && this.props.form.getFieldValue('cardNo').length > 0) {
                let No = this.props.form.getFieldValue('cardNo') ? this.props.form.getFieldValue('cardNo') : ''
                let length = parseInt(this.state.cardLength)
                let num = (Array(length).join(0) + No).slice(-length)
                this.props.form.setFieldsValue({ cardNo: num });
                this.setState({
                    cardNoVisible: false,
                });
                return
            }
        }

        //建卡卡号
        cardTip = (num) => {
            this.props.form.validateFields(['cardNo',], (errors, values) => {
                if (errors == null && num != 1) {
                    setTimeout(() => {
                        this.patName.current.focus();
                    }, 300)
                    return
                }
                if (!errors) {
                    this.setState({
                        cardNoVisible: false
                    })
                    if (num != 1) {
                        if (this.props.form.getFieldValue('cardNo')) {
                            setTimeout(() => {
                                this.patName.current.focus();
                            }, 300)

                        }
                    }
                } else {
                    this.setState({
                        cardNoVisible: true,
                        tipsCardNo: errors.cardNo.errors[0].message,
                    })
                }
            });
        }

        // 获取患者信息
        // 办理住院时结算费别为医保时调用医保登记
        getPatInfo = (credTypeID, credNo, callback) => {
            let cardNo = this.props.form.getFieldValue('cardNo');
            let cardTypeID = this.props.form.getFieldValue('cardTypeID');
            let number = this.props.form.getFieldValue('number');
            if (credTypeID != '' && credNo != '') {
                cardNo = '';
                cardTypeID = '';
                number = '';
            }
            let data = {}
            data = {
                params: [{
                    cardTypeID: cardTypeID ? cardTypeID : '',
                    cardNo: cardNo ? cardNo : '',
                    number: number != '' ? number : this.state.patInfo.patNo,
                    // credTypeID: credTypeID,
                    // credNo: credNo,
                }],
            }
            this.handleReset();
            if (credTypeID === '') {
                this.props.form.setFieldsValue({ cardNo: cardNo, cardTypeID: cardTypeID, number: number });
            }
            $http.post('urlS', this, {
                code: '03060001',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        //判断接口请求成功数据是否返回成功
                        let content = '';
                        if ((res.result.patAdmin.length === 0) && (!res.result.admInfo.admID)) {
                            content = '患者未开住院证,是否确认办理住院登记';
                        }
                        if (!res.result.patInfo.patID) {
                            content = '患者未在本院就诊,是否确认办理住院登记';
                        }
                        let thisPointer = this;
                        if (content !== '') {
                            confirm({
                                title: '确认办理住院',
                                content: content,
                                okText: '确定',
                                cancelText: '取消',
                                onOk() {
                                    let patInfo = res.result.patInfo;

                                    setTimeout(() => {
                                        thisPointer.patName.current.focus();
                                    }, 300)
                                    thisPointer.setState({
                                        patInfo: patInfo,
                                        admInfo: res.result.admInfo,
                                        readInfoLoading: false,
                                        admReasonList: res.result.admReasonList,
                                        dataSource: res.result.diagList,
                                        poorFlag: patInfo.patPoor == 'Y' ? true : false,
                                    }, () => {
                                        callback && callback();
                                        if (patInfo.patPoor == 'Y') {
                                            message.warn('该患者是建档立卡户,禁止收取押金！')
                                        }
                                    })
                                },
                                onCancel() {
                                    thisPointer.initPatInfo();
                                },
                            });
                        } else {
                            let patInfo = res.result.patInfo;
                            let patAdminInfo = {};
                            let { inDeposit } = this.state
                            let adminListVisible = false;
                            if ((res.result.admInfo.admID) && (res.result.admInfo.admHospID != userData.hospID)) {
                                message.warn('患者' + patInfo.patName + '已在其他医院办理住院!');
                                this.setState({
                                    inHospDisabled: true,
                                    patInfo: patInfo,
                                })
                                return;
                            }
                            if (res.result.patAdmin.length === 1) {
                                patAdminInfo = res.result.patAdmin[0];
                                inDeposit = patAdminInfo?.inDeposit || '';
                                let inLocID = patAdminInfo?.locID || '';
                                const { docList } = this.state;
                                if (!(docList && docList.length > 0 && inLocID)) {
                                    this.getLocList('wardList', patAdminInfo.locID, 'N');
                                    this.getLinkWardList(patAdminInfo?.locID || '');
                                }
                                //住院证是预住院的就提示
                                if (patAdminInfo && patAdminInfo.preInFlag == 'Y') {
                                    message.info('该患者是预住院患者');
                                }
                                this.loadBedList(patAdminInfo.wardID)
                            }
                            if (res.result.patAdmin.length > 1) {
                                adminListVisible = true;
                            }
                            setTimeout(() => {
                                this.patName.current.focus();
                            }, 300)
                            this.setState({
                                patInfo: patInfo,
                                admInfo: res.result.admInfo,
                                patAdminList: res.result.patAdmin,
                                patAdminInfo: patAdminInfo,
                                readInfoLoading: false,
                                adminListVisible: adminListVisible,
                                admReasonList: res.result.admReasonList,
                                dataSource: res.result.diagList,
                                poorFlag: patInfo.patPoor == 'Y' ? true : false,
                                inDeposit
                            }, () => {
                                callback && callback();
                                if (patInfo.patPoor == 'Y') {
                                    message.warn('该患者是建档立卡户,禁止收取押金！')
                                }
                            })
                        }
                    } else {
                        this.initPatInfo();
                    }
                }, error: function () {
                    this.initPatInfo();
                }
            })

        }

        /**
         * @ByYQL: 住院登记结算类型改变监听事件
         * Create 2021-12-21
         */
        onadmReasonChange = (value, option) => {
            this.setState({
                insuAlertBeforeAdm: option.props.insuAlertBeforeAdm,
                admReasonCode: option.props.admReasonCode
            })
        }

        initPatInfo = () => {
            this.setState({
                patInfo: {},
                admInfo: {},
                patAdminInfo: {},
                readInfoLoading: false,
                adminListVisible: false,
            })
        }

        getLocList = (flag, locID, isDefaultWard, isClearWardID) => {
            let linkFlag = "", docFlag = "";
            if (flag === "locList") {
                linkFlag = "";
            } else {
                linkFlag = "1";
                docFlag = "1";
            }
            let data = {
                params: [{
                    type: "I^OI",
                    hospID: userData.hospID,
                    locID: locID,
                    detailFlag: "",
                    linkFlag: linkFlag,
                    docFlag: docFlag,
                    linkType: "W",
                }]
            }
            $http.post('urlDeault', this, {
                code: "04020008", data: data,
                success: (res) => {
                    if (+res.errorCode === 0) {
                        if (flag === "locList") {
                            this.setState({
                                [flag]: res.result.Data,
                            })
                        } else {
                            if (res.result.Data.length > 0) {
                                let wardList = res.result.Data[0]?.linkLoc || [];
                                if (isDefaultWard !== 'N') {
                                    let inWardID = undefined;
                                    if (wardList.length > 0) {
                                        inWardID = wardList[0].id;
                                    }
                                    // 手动选择时不默认病区
                                    this.props.form.setFieldsValue({
                                        inWardID: inWardID,
                                    });
                                    let bedEmptyNumber = '';
                                    for (let i = 0; i < wardList.length; i++) {
                                        if (inWardID == wardList[i].id) {
                                            bedEmptyNumber = wardList[i].bedEmptyNumber
                                        }
                                    }
                                    this.state.remainBed = bedEmptyNumber;
                                }
                                if (isClearWardID === 'Y') {
                                    this.props.form.setFieldsValue({
                                        inWardID: undefined,
                                    });
                                }
                                this.setState({
                                    docList: res.result.Data[0]?.locDoctor || [], // 医生下拉框
                                    // wardList, // 病区下拉框【原接口太复杂，改后影响太大，走前接口获取数据】
                                })
                            }
                        }
                    } else {
                        message.error('获取科室信息失败!:' + res.errorMessage);
                    }
                }
            })
        }

        // 获取科室关联病区下拉数据
        getLinkWardList = async (locID) => {
            try {
                if (!locID) return;
                let data = {
                    params: [{
                        locID
                    }]
                }
                let res = await React.$asyncPost(this, '03050168', data);
                this.setState({ wardList: res.result });
            } catch (error) {
                console.log(error)
            }
        }

        //科室获取焦点
        onLocFocus = () => {
            if (this.state.locList.length === 0) {
                this.getLocList("locList", "");
            }
            let tipsFlag = "tips" + this.firstToUp("inLocID");
            this.setState({
                [tipsFlag]: "",
            })
        }

        //病区获取焦点
        onWardFocus = (flag, e) => {
            const locID = this.props.form.getFieldValue('inLocID');
            if ((this.state.wardList.length === 0) && (locID) && (locID !== "")) {
                // this.getLocList("wardList", locID);
            }
            let tips = "tips" + this.firstToUp(flag);
            this.setState({

                [tips]: "",
            })
        }

        //科室改变
        onInLocChange = (value, option) => {
            if (value) {
                this.getLocList("wardList", value, 'N', 'Y');
                this.getLinkWardList(value);
            }
        }

        //病区改变
        onInWardChange = (value, option) => {
            if (value) {
                let itemObj = option.props.itemobj;
                if (itemObj && 'bedEmptyNumber' in itemObj && itemObj.bedEmptyNumber !== '' && itemObj.bedEmptyNumber !== undefined) {
                    if (itemObj.bedEmptyNumber == 0) {
                        message.warn("该病区剩余空床数为0！")
                    }
                    this.setState({
                        remainBed: itemObj.bedEmptyNumber
                    })
                } else {
                    this.loadBedList(value)
                }
            }
        }

        //查询床位数
        loadBedList = (wardID) => {
            let data = {
                params: [{
                    wardID: wardID,
                }]
            }
            $http.post('urlDeault', this, {
                code: "04020018",
                data: data,
                success: (res) => {
                    if (+res.errorCode === 0) {
                        if (res.result.length == 0) {
                            message.warn("该病区剩余空床数为0！")
                        }
                        this.setState({
                            remainBed: res.result.length,
                        })
                    }
                }
            })
        }

        ///需要提醒的Input元素失去焦点
        onTipsItemBlur(flag, title, e) {
            const value = this.props.form.getFieldValue(flag);
            let tipsFlag = "tips" + this.firstToUp(flag);
            let msg = "";
            if (!value || (value === "")) {
                msg = title;
            }
            this.setState({
                [tipsFlag]: msg,
            })
        }

        ///需要提醒的手机号校验
        onTipsItemTel(flag, title) {
            let tipsFlag = "tips" + this.firstToUp(flag);
            this.props.form.validateFields([flag,], (errors, values) => {
                if (!errors) {
                    let regex = new RegExp(/^1\d{10}$/);
                    if (values[flag] && (values[flag] !== "")) {
                        if (!regex.test(values[flag])) {
                            this.setState({
                                [tipsFlag]: title,
                            })
                        } else {
                            this.setState({
                                [tipsFlag]: "",
                            })
                        }
                    }

                } else {
                    this.setState({
                        [tipsFlag]: errors[flag].errors[0].message,
                    })
                }
            });
        }

        ///需要提醒的住院次数校验
        onTipsItemInHosNum(flag, title) {
            let tipsFlag = "tips" + this.firstToUp(flag);
            let regex = new RegExp(/^[1-9]\d*$/);
            let value = this.props.form.getFieldValue(flag);
            if (!regex.test(value)) {
                this.setState({
                    [tipsFlag]: title,
                })
            } else {
                this.setState({
                    [tipsFlag]: "",
                })
            }
        }

        //证件类型改变
        onCredTypeChange = (flag, value, option) => {
            this.setState({
                [flag]: option ? option.props.code : "",
            })
        }

        //证件号失去焦点或回车时调用
        patCredNoTip = (e) => {
            let data = e.target.value;
            if (!data || data.length === 0) {
                this.setState({
                    tipsPatCredNo: "",
                    patCredNo: "",
                })
                return;
            }
            let patCredTypeID = this.props.form.getFieldValue('patCredTypeID');
            let patCredTypeCode = this.state.patCredTypeCode;
            this.props.form.validateFields(['patCredNo',], (errors, values) => {
                if (!errors) {
                    if (this.state.patInfo.patCredNo !== data) {

                        if (patCredTypeCode == '01') {
                            this.setState({
                                tipsPatCredNo: "",
                                patCredNo: data,
                                tipsPatSexID: "",
                            })
                            if (data.length == 18) {
                                this.getAge(data);
                                this.props.form.setFieldsValue({ patSexID: this.getSex(data), patBirthDateTime: moment(this.getBirthday(data)) });
                            }
                        } else {
                            this.setState({
                                tipsPatCredNo: "",
                                patCredNo: data,
                            })
                        }
                        if (e.keyCode == 13) {
                            this.patCredNo.current.blur();
                            this.getPatInfoByCredNo(patCredTypeID, data);
                        }
                    }
                } else {
                    this.setState({
                        tipsPatCredNo: errors.patCredNo.errors[0].message,
                        patCredNo: "",
                    })
                }
            });
        }

        //获取患者信息
        getPatInfoByCredNo = (credTypeID, credNo) => {
            var params = {
                params: [{
                    credTypeID: credTypeID,
                    credNo: credNo,
                }]
            }
            $http.post('urlDeault', this, {
                code: "03040019",
                data: params,
                success: function (res) {
                    if (res.errorCode === '0') {
                        if (Util.isEmpty(res.patInfo.patCredNo)) {
                            this.setState({
                                patInfo: {},
                                admInfo: {},
                                patAdminInfo: {},
                                readInfoLoading: false,
                                adminListVisible: false,
                                patCredTypeID: credTypeID,
                            })
                            return;
                        }
                        this.setState({
                            checkData: res.patInfo,
                            isShowCorrelationModal: res.patInfo.patCredNo ? true : false,
                            checkMsg: res.message,
                            poorFlag: res.patInfo.patPoor == 'Y' ? true : false,
                        }, () => {
                            if (res.patInfo.patPoor == 'Y') {
                                message.warn('该患者是建档立卡户,禁止收取押金！')
                            }
                        })
                    }
                }
            });
        }

        submitCorrelation() {
            var { checkData } = this.state;
            this.hideModal('isShowCorrelationModal')
            this.getPatInfo(checkData.patCredTypeID, checkData.patCredNo);
        }

        contactCredNoTip = (e) => {
            let data = e.target.value;
            if (!data || data.length === 0) {
                this.setState({
                    tipsPatEContactCredTypeIDNo: "",
                    contactCredNo: "",
                })
                return;
            }
            this.props.form.validateFields(['patEContactCredTypeIDNo',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        tipsPatEContactCredTypeIDNo: "",
                        contactCredNo: data,
                    })

                } else {
                    this.setState({
                        tipsPatEContactCredTypeIDNo: errors.patEContactCredTypeIDNo.errors[0].message,
                        contactCredNo: "",
                    })
                }
            });
        }

        //选择日期 计算年龄
        onPanelChange = (mode) => {
            this.autoAge(moment(mode).format('YYYY-MM-DD'), moment(mode).format('HH:mm'));
        }

        //获取到出生日期自动计算年龄
        autoAge = (patBirthDate, patBirthTime) => {
            let data = {}
            data = {
                params: [{
                    birthday: patBirthDate ? patBirthDate : undefined,
                    birthTime: patBirthTime ? patBirthTime : undefined,
                    hospID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).hospID : "",
                }],
            }
            if (patBirthDate && patBirthDate != "Invalid date") {
                $http.post('urlS', this, {
                    code: '03030013',
                    data: data,
                    success: function (res) {
                        if (+res.errorCode === 0) {
                            this.props.form.setFieldsValue({ age: res.result })
                        }
                    }
                })
            }
        }

        //获取身份证号年龄
        getAge = (patCredNo) => {
            var len = (patCredNo + "").length;
            if (len == 0) {
                return 0;
            } else {
                if ((len != 15) && (len != 18))//身份证号码只能为15位或18位其它不合法
                {
                    return 0;
                }
            }
            var strBirthday = "";
            if (len == 18)//处理18位的身份证号码从号码中得到生日和性别代码
            {
                strBirthday = patCredNo.substr(6, 4) + "-" + patCredNo.substr(10, 2) + "-" + patCredNo.substr(12, 2);
            }
            if (len == 15) {
                strBirthday = "19" + patCredNo.substr(6, 2) + "-" + patCredNo.substr(8, 2) + "-" + patCredNo.substr(10, 2);
            }
            this.autoAge(strBirthday)
        }

        //获取身份证号出生日期
        getBirthday = (patCredNo) => {
            var birthdayno, birthdaytemp
            if (patCredNo && patCredNo.length == 18) {
                birthdayno = patCredNo.substring(6, 14)
            } else if (patCredNo && patCredNo.length == 15) {
                birthdaytemp = patCredNo.substring(6, 12)
                patCredNo = "19" + birthdaytemp
            } else {
            }
            var birthday = birthdayno.substring(0, 4) + "-" + birthdayno.substring(4, 6) + "-" + birthdayno.substring(6, 8)
            return birthday
        }

        //获取身份证号性别 第17位代表性别，奇数为男，偶数为女
        getSex = (patCredNo) => {
            let sexno, sex
            if (patCredNo && patCredNo.length == 18) {
                sexno = patCredNo.substring(16, 17)
            } else if (patCredNo.length == 15) {
                sexno = patCredNo.substring(14, 15)
            } else {
                return false
            }
            var tempid = sexno % 2;
            if (tempid == 0) {
                sex = '2'
            } else {
                sex = '1'
            }
            return sex
        }

        //校验所有需要校验的数据
        checkAllTips = () => {
            //E 空数据校验, M 手机号校验,N 数值类型元素校验

            this.state.tipsItem.map((item) => {
                switch (item.flag) {
                    case "M":
                        this.onTipsItemTel(item.code, item.msg);
                        break;
                    case "N":
                        this.onTipsItemInHosNum(item.code, item.msg);
                        break;
                    case "E":
                        var patCredTypeID = this.props.form.getFieldValue('patCredTypeID')
                        var patEContactCredTypeID = this.props.form.getFieldValue('patEContactCredTypeID')

                        if (
                            (item.code === 'patCredNo' && this.state.patCredTypeCode === "01") ||
                            (item.code === 'patEContactCredTypeIDNo' && this.state.patEContactCredTypeCode === "01") ||
                            (item.code !== 'patCredNo' && item.code != 'patEContactCredTypeIDNo')

                        ) {
                            this.onTipsItemBlur(item.code, item.msg)
                        }
                        break;
                }
            })
        }

        //元素获取焦点时触发
        onFocus = (flag, e) => {
            let tipsFlag = "tips" + this.firstToUp(flag);
            this.setState({
                [tipsFlag]: "",
            })
        }

        //隐藏弹出框
        hideModal(name) {
            this.setState({
                [name]: false,//将所有参数置为false
            });
        }

        //选择住院证
        onSelectAdmin = (adminObj) => {
            this.setState({
                adminListVisible: false,
                patAdminInfo: adminObj,
            }, () => {
                this.getPatDiagList(adminObj.admID);
            })
            if ((this.state.wardList.length === 0) && (adminObj.locID) && (adminObj.locID !== "")) {
                this.getLocList("wardList", adminObj.locID);
                this.getLinkWardList(adminObj?.locID || '');
            }
            this.loadBedList(adminObj.wardID)
            //住院证是预住院的就提示
            if (adminObj.preInFlag == "Y") {
                message.info("该患者是预住院患者")
            }
        }

        getPatDiagList = (admID) => {
            var params = {
                params: [{
                    admID: admID,
                    patID: "",
                    historyType: "",
                    historyFlag: "N",
                }]
            }
            $http.post('urlDeault', this, {
                code: "03050033",
                data: params,
                success: function (res) {
                    if (res.errorCode == '0') {
                        this.setState({
                            dataSource: res.result.diagList,
                        })
                    }
                }
            });
        }

        closeSuccessPop = () => {
            this.setState({
                remainSecond: 0,
            });
            clearInterval(timer)
        }

        //读卡时调用
        handleReadCard = (e) => {
            // message.warn("暂不能读卡");
            const cardTypeID = this.state.initCardDr;
            this.readCard.ReadCard(cardTypeID, "R", (json) => {
                if (!Util.isEmpty(json)) {
                    this.props.form.setFieldsValue({ cardNo: json.cardNo, number: !Util.isEmpty(json.patInfo.patNo) ? json.patInfo.patNo : '' });
                    this.setState({
                        cardNoVisible: false,
                    }, () => {
                        this.onNumberPressEnter();
                    });
                }
            })
        }

        handleCancel = () => {
            this.setState({
                patientAccountVisile: false,
            })
        }

        //腕带打印
        handlePrintBedCard = (e) => {
            let data = {};
            data = {
                params: [{
                    admID: this.state.admInfo.admID,
                    bedID: this.state.admInfo.patID,
                }]
            }
            let code = "04140013"
            let templateCode = "Wristband"
            $http.post('urlS', this, {
                code: code,
                data: data,
                success: function (res) {
                    if (res.errorCode === '0') {
                        //加载模板
                        $loadTemplate(templateCode, res.result);
                    }
                }
            })
        }

        poorChange = (checked, e) => {
            this.setState({ poorFlag: checked })
        }

        /** 病区筛选 */
        filterOption = (input, option) => {
            if (option.key == "-1") { return true; }
            return ((option.props.descripts.toLowerCase().indexOf(input.toLowerCase()) >= 0)
                || (option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0)
                || (option.props.descriptsspcode.toLowerCase().indexOf(input.toLowerCase()) >= 0))
        }

        // 医保登记
        onChangeINSURegisterVisable = () => {
            if (!this.state.admInfo.admID || this.state.admInfo.admID == '') {
                message.error('请先选择就诊信息')
                return false
            }
            this.insuChild.resetFields()
            this.insuChild.readYBPatdataNew(this.state.admInfo.admID, userData, "")
        }

        // 调用子组件的连接事件
        onInsuRef = (ref) => {
            this.insuChild = ref
        }

        // 读身份证
        handleReadIDCard = () => {
            let hospID = sessionStorage.userData ? JSON.parse(sessionStorage.userData).hospID : '';
            let inputDirRoute = hospID == 25 || hospID == 62 ? 'ReadCard/ReadCard.dll' : 'ReadCard_UC/ReadCard.dll';
            let that = this;
            let dllParams = JSON.stringify({ 'inputDir': inputDirRoute, 'clsName': 'ReadCard.ReadCardObj', 'funcName': 'ReadIDCardInfo' });
            if (typeof (CefSharp) != 'undefined') {   // 新元素定制浏览器
                CefSharp.BindObjectAsync('xysCefToJavaScripts');
                setTimeout(() => {
                    xysCefToJavaScripts.driveLocalHardware(dllParams).then((returnVale) => {
                        var json = JSON.parse(returnVale);
                        if (json.errorCode == '0') {
                            that.setState({
                                sourceData: json.result
                            }, () => {
                                that.loadReadCardMessage()
                            })
                            message.success('读卡成功');
                        } else {
                            message.error(json.errorMessage);
                        }
                    })
                }, 100);
            } else {
                const frame = chrome?.webview?.hostObjects?.Bridge || ''; // 新版浏览器
                if (frame) {
                    frame.DynamicLoadingDLL(dllParams)
                        .then(
                            data => {
                                var res = JSON.parse(data);
                                if (res.errorCode == '0') {
                                    that.setState({
                                        sourceData: res.result
                                    }, () => {
                                        that.loadReadCardMessage()
                                    })
                                    message.success('读卡成功');
                                } else {
                                    message.error(res.errorMessage);
                                }
                            },
                            err => {
                                console.log('error', err);
                            }
                        )
                } else {
                    let data = 'input={"inputDir":"' + inputDirRoute + '","clsName":"' + 'ReadCard.ReadCardObj' + '","funcName":"' + 'ReadIDCardInfo' + '"}';
                    fetchJsonp('http://127.0.0.1:62534/XYSWCFService/DynamicLoadingDLL?' + '&' + data, {
                        jsonpCallback: 'JsonCallback',
                    })
                        .then(function (response) {
                            return response.json()
                        }).then(function (json) {
                            //返回卡号
                            json = JSON.parse(json)
                            if (json.errorCode == '0') {
                                that.setState({
                                    sourceData: json.result
                                }, () => {
                                    that.loadReadCardMessage()
                                })
                                message.success('读卡成功');
                            } else {
                                message.error(json.errorMessage);
                            }
                            return cardNo;
                        }).catch(function (ex) {
                            return false;
                        })
                }
            }
        }

        loadReadCardMessage = () => {
            var params = {
                params: [this.state.sourceData]
            }
            $http.post('urlS', this, {
                code: '03030115',
                data: params,
                success: function (res) {
                    if (res.errorCode === '0') {
                        this.props.form.setFieldsValue({
                            number: res.result?.patCredNo || undefined
                        }, () => {
                            this.onNumberPressEnter(() => this.handleUpdateAddressInfo(res.result));
                        })
                    }
                }
            });
        }

        // 同步身份证上的地址信息
        handleUpdateAddressInfo = (source) => {
            const { baseParms } = this.state;
            var code = ''
            var nationData = baseParms?.credType || [];
            if (!Util.isEmpty(nationData)) {
                for (var i = 0; i < nationData.length; i++) {
                    if (!Util.isEmpty(source)) {
                        if (source.patCredTypeID == nationData[i].id) {
                            code = nationData[i].code
                        }
                    }
                }
            }
            this.props.form.setFieldsValue({
                patName: !Util.isEmpty(source) ? source.patName : '',
                patBirthDateTime: !Util.isEmpty(source) ? moment(source.patBirthDate, 'YYYY-MM-DD HH:mm') : '',
                patCredNo: !Util.isEmpty(source) ? source.patCredNo : '',
                patCredTypeID: !Util.isEmpty(source) ? source.patCredTypeID : '',
                patCredTypeCode: code,
                patSexID: !Util.isEmpty(source) ? source.patSexID : '',
                age: !Util.isEmpty(source) ? source.patAge : '',
                patNationID: !Util.isEmpty(source) ? source.patNationID : '',
                // 户口地址
                registerProvinceID: !Util.isEmpty(source) ? source.patRegisterProvinceID : '',
                registerCityID: !Util.isEmpty(source) ? source.patRegisterCityID : '',
                registerAreaID: !Util.isEmpty(source) ? source.patRegisterAreaID : '',
                registerVillageID: !Util.isEmpty(source) ? source.patRegisterVillageID : '',
                registerAddress: source?.address || source?.patRegisterAddressDesc || '',
            })
            // 根据医院配置读卡时现住址和单位地址是否跟户口地址一致
            if (baseParms?.addressSame === 'Y') {
                this.props.form.setFieldsValue({
                    // 现住址
                    presentProvinceID: !Util.isEmpty(source) ? source.patRegisterProvinceID : '',
                    presentCityID: !Util.isEmpty(source) ? source.patRegisterCityID : '',
                    presentAreaID: !Util.isEmpty(source) ? source.patRegisterAreaID : '',
                    presentVillageID: !Util.isEmpty(source) ? source.patRegisterVillageID : '',
                    presentAddressDesc: !Util.isEmpty(source) ? source.patRegisterAddressDesc : '',
                    // 单位地址
                    companyProvinceID: !Util.isEmpty(source) ? source.patRegisterProvinceID : '',
                    companyCityID: !Util.isEmpty(source) ? source.patRegisterCityID : '',
                    companyAreaID: !Util.isEmpty(source) ? source.patRegisterAreaID : '',
                    companyVillageID: !Util.isEmpty(source) ? source.patRegisterVillageID : '',
                    companyAddress: !Util.isEmpty(source) ? source.patRegisterAddressDesc : '',
                })
            }
        }

        render() {
            const { getFieldDecorator } = this.props.form;
            let { patInfo, admInfo, patAdminInfo, admReasonList, insuranceData } = this.state; //患者信息,住院证信息,费别信息
            let { readInfoLoading, baseParms, nowRead, initCardDr, initCardCode, contactCredTypeID, cardLength, tipsCardNo } = this.state; //卡信息
            let { province, firstCity, birthCity, nativeCity, presentCity, registerCity, companyCity, contactCity } = this.state; //省,市
            let { birthAreas, nativeAreas, presentAreas, registerAreas, companyAreas, contactAreas } = this.state;//县
            let { birthVillages, nativeVillages, presentVillages, registerVillages, companyVillages, contactVillages } = this.state;//乡
            let { birthHamlets, nativeHamlets, presentHamlets, registerHamlets, companyHamlets, contactHamlets } = this.state;//村

            let firstCityItem = [], birthCityItem = [], nativeCityItem = [], presentCityItem = [], registerCityItem = [], companyCityItem = [], contactCityItem = []; //省,市Option
            let birthAreasItem = [], nativeAreasItem = [], presentAreasItem = [], registerAreasItem = [], companyAreasItem = [], contactAreasItem = [];//县Option
            let birthVillagesItem = [], nativeVillagesItem = [], presentVillagesItem = [], registerVillagesItem = [], companyVillagesItem = [], contactVillagesItem = [];//乡
            let birthHamletsItem = [], nativeHamletsItem = [], presentHamletsItem = [], registerHamletsItem = [], companyHamletsItem = [], contactHamletsItem = [];//村
            let card = []
            baseParms.cardType && baseParms.cardType.map(item => {
                card.push(<Option key={item.id} disabled={item.disabled ? true : false} data={item} value={String(item.id)}>{item.descripts}</Option>)
            })
            let provinceItem = [];
            province && province.map(item => {
                provinceItem.push(<Option key={item.id} className={'1' + item.province} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} title={item.descripts}>{item.descripts}</Option>)
            });

            //第一次加载的城市;
            firstCity && firstCity.map(item => {
                firstCityItem.push(<Option provinceid={item.province} zip={item.zipCode} key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} className={'2' + item.province} title={item.descripts}>{item.descripts}</Option>)
            });
            //出生城市
            if ((!birthCity) || (birthCity.length === 0)) {
                //出生城市下拉数据为空时加载所有城市
                birthCityItem = firstCityItem;
            } else {
                birthCity && birthCity.map(item => {
                    birthCityItem.push(<Option provinceid={item.province} zip={item.zipCode} key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} className={'2' + item.province} title={item.descripts}>{item.descripts}</Option>)
                });
            }
            birthAreas && birthAreas.map(item => {
                birthAreasItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((birthAreas) && (birthAreas.length === 0) && (patInfo.patBirthAreaID)) {
                birthAreasItem.push(<Option key={patInfo.patBirthAreaID} role={patInfo.patBirthAreaDesc} title={patInfo.patBirthAreaDesc} value={String(patInfo.patBirthAreaID)}>{patInfo.patBirthAreaDesc}</Option>)
            }
            birthVillages && birthVillages.map(item => {
                birthVillagesItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((birthVillages) && (birthVillages.length === 0) && (patInfo.patBirthVillageID)) {
                birthVillagesItem.push(<Option key={patInfo.patBirthVillageID} role={patInfo.patBirthVillageDesc} title={patInfo.patBirthVillageDesc} value={String(patInfo.patBirthVillageID)}>{patInfo.patBirthVillageDesc}</Option>)
            }
            birthHamlets && birthHamlets.map(item => {
                birthHamletsItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((birthHamlets) && (birthHamlets.length === 0) && (patInfo.patBirthHamletID)) {
                birthHamletsItem.push(<Option key={patInfo.patBirthHamletID} role={patInfo.patBirthHamletDesc} title={patInfo.patBirthHamletDesc} value={String(patInfo.patBirthHamletID)}>{patInfo.patBirthHamletDesc}</Option>)
            }
            //籍贯
            if ((!nativeCity) || (nativeCity.length === 0)) {
                //籍贯城市下拉数据为空时加载所有城市
                nativeCityItem = firstCityItem;
            } else {
                nativeCity && nativeCity.map(item => {
                    nativeCityItem.push(<Option provinceid={item.province} key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} className={'2' + item.province} title={item.descripts}>{item.descripts}</Option>)
                });
            }
            nativeAreas && nativeAreas.map(item => {
                nativeAreasItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((nativeAreas) && (nativeAreas.length === 0) && (patInfo.patNativeAreaID)) {
                nativeAreasItem.push(<Option key={patInfo.patNativeAreaID} role={patInfo.patNativeAreaDesc} title={patInfo.patNativeAreaDesc} value={String(patInfo.patNativeAreaID)}>{patInfo.patNativeAreaDesc}</Option>)
            }
            nativeVillages && nativeVillages.map(item => {
                nativeVillagesItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((nativeVillages) && (nativeVillages.length === 0) && (patInfo.patNativeVillageID)) {
                nativeVillagesItem.push(<Option key={patInfo.patNativeVillageID} role={patInfo.patNativeVillageDesc} title={patInfo.patNativeVillageDesc} value={String(patInfo.patNativeVillageID)}>{patInfo.patNativeVillageDesc}</Option>)
            }
            nativeHamlets && nativeHamlets.map(item => {
                nativeHamletsItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((nativeHamlets) && (nativeHamlets.length === 0) && (patInfo.patNativeHamletID)) {
                nativeHamletsItem.push(<Option key={patInfo.patNativeHamletID} role={patInfo.patNativeHamletDesc} title={patInfo.patNativeHamletDesc} value={String(patInfo.patNativeHamletID)}>{patInfo.patNativeHamletDesc}</Option>)
            }
            //现住址
            if ((!presentCity) || (presentCity.length === 0)) {
                //籍贯城市下拉数据为空时加载所有城市
                presentCityItem = firstCityItem;
            } else {
                presentCity && presentCity.map(item => {
                    presentCityItem.push(<Option provinceid={item.province} key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} className={'2' + item.province} title={item.descripts}>{item.descripts}</Option>)
                });
            }
            presentAreas && presentAreas.map(item => {
                presentAreasItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((presentAreas) && (presentAreas.length === 0) && (patInfo.patPresentAreaID)) {
                presentAreasItem.push(<Option key={patInfo.patPresentAreaID} role={patInfo.patPresentAreaDesc} title={patInfo.patPresentAreaDesc} value={String(patInfo.patPresentAreaID)}>{patInfo.patPresentAreaDesc}</Option>)
            }
            presentVillages && presentVillages.map(item => {
                presentVillagesItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((presentVillages) && (presentVillages.length === 0) && (patInfo.patPresentVillageID)) {
                presentVillagesItem.push(<Option key={patInfo.patPresentVillageID} role={patInfo.patPresentVillageDesc} title={patInfo.patPresentVillageDesc} value={String(patInfo.patPresentVillageID)}>{patInfo.patPresentVillageDesc}</Option>)
            }
            presentHamlets && presentHamlets.map(item => {
                presentHamletsItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} zip={item.zipCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((presentHamlets) && (presentHamlets.length === 0) && (patInfo.patPresentHamletID)) {
                presentHamletsItem.push(<Option key={patInfo.patPresentHamletID} role={patInfo.patPresentHamletDesc} title={patInfo.patPresentHamletDesc} value={String(patInfo.patPresentHamletID)}>{patInfo.patPresentHamletDesc}</Option>)
            }
            //户口
            if ((!registerCity) || (registerCity.length === 0)) {
                //籍贯城市下拉数据为空时加载所有城市
                registerCityItem = firstCityItem;
            } else {
                registerCity && registerCity.map(item => {
                    registerCityItem.push(<Option provinceid={item.province} zip={item.zipCode} key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} className={'2' + item.province} title={item.descripts}>{item.descripts}</Option>)
                });
            }
            registerAreas && registerAreas.map(item => {
                registerAreasItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((registerAreas) && (registerAreas.length === 0) && (patInfo.patRegisterAreaID)) {
                registerAreasItem.push(<Option key={patInfo.patRegisterAreaID} role={patInfo.patRegisterAreaDesc} title={patInfo.patRegisterAreaDesc} value={String(patInfo.patRegisterAreaID)}>{patInfo.patRegisterAreaDesc}</Option>)
            }
            registerVillages && registerVillages.map(item => {
                registerVillagesItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((registerVillages) && (registerVillages.length === 0) && (patInfo.patRegisterVillageID)) {
                registerVillagesItem.push(<Option key={patInfo.patRegisterVillageID} role={patInfo.patRegisterVillageDesc} title={patInfo.patRegisterVillageDesc} value={String(patInfo.patRegisterVillageID)}>{patInfo.patRegisterVillageDesc}</Option>)
            }
            registerHamlets && registerHamlets.map(item => {
                registerHamletsItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((registerHamlets) && (registerHamlets.length === 0) && (patInfo.patRegisterHamletID)) {
                registerHamletsItem.push(<Option key={patInfo.patRegisterHamletID} role={patInfo.patRegisterHamletDesc} title={patInfo.patRegisterHamletDesc} value={String(patInfo.patRegisterHamletID)}>{patInfo.patRegisterHamletDesc}</Option>)
            }
            //单位
            if ((!companyCity) || (companyCity.length === 0)) {
                //籍贯城市下拉数据为空时加载所有城市
                companyCityItem = firstCityItem;
            } else {
                companyCity && companyCity.map(item => {
                    companyCityItem.push(<Option provinceid={item.province} zip={item.zipCode} key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} className={'2' + item.province} title={item.descripts}>{item.descripts}</Option>)
                });
            }
            companyAreas && companyAreas.map(item => {
                companyAreasItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((companyAreas) && (companyAreas.length === 0) && (patInfo.patCompanyAreaID)) {
                companyAreasItem.push(<Option key={patInfo.patCompanyAreaID} role={patInfo.patCompanyAreaDesc} title={patInfo.patCompanyAreaDesc} value={String(patInfo.patCompanyAreaID)}>{patInfo.patCompanyAreaDesc}</Option>)
            }
            companyVillages && companyVillages.map(item => {
                companyVillagesItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((companyVillages) && (companyVillages.length === 0) && (patInfo.patCompanyVillageID)) {
                companyVillagesItem.push(<Option key={patInfo.patCompanyVillageID} role={patInfo.patCompanyVillageDesc} title={patInfo.patCompanyVillageDesc} value={String(patInfo.patCompanyVillageID)}>{patInfo.patCompanyVillageDesc}</Option>)
            }
            companyHamlets && companyHamlets.map(item => {
                companyHamletsItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((companyHamlets) && (companyHamlets.length === 0) && (patInfo.patCompanyHamletID)) {
                companyHamletsItem.push(<Option key={patInfo.patCompanyHamletID} role={patInfo.patCompanyHamletDesc} title={patInfo.patCompanyHamletDesc} value={String(patInfo.patCompanyHamletID)}>{patInfo.patCompanyHamletDesc}</Option>)
            }
            //联系人
            if ((!contactCity) || (contactCity.length === 0)) {
                //籍贯城市下拉数据为空时加载所有城市
                contactCityItem = firstCityItem;
            } else {
                contactCity && contactCity.map(item => {
                    contactCityItem.push(<Option provinceid={item.province} zip={item.zipCode} key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} className={'2' + item.province} title={item.descripts}>{item.descripts}</Option>)
                });
            }
            contactAreas && contactAreas.map(item => {
                contactAreasItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((contactAreas) && (contactAreas.length === 0) && (patInfo.patContactAreaID)) {
                contactAreasItem.push(<Option key={patInfo.patContactAreaID} role={patInfo.patContactAreaDesc} title={patInfo.patContactAreaDesc} value={String(patInfo.patContactAreaID)}>{patInfo.patContactAreaDesc}</Option>)
            }
            contactVillages && contactVillages.map(item => {
                contactVillagesItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((contactVillages) && (contactVillages.length === 0) && (patInfo.patContactVillageID)) {
                contactVillagesItem.push(<Option key={patInfo.patContactVillageID} role={patInfo.patContactVillageDesc} title={patInfo.patContactVillageDesc} value={String(patInfo.patContactVillageID)}>{patInfo.patContactVillageDesc}</Option>)
            }
            contactHamlets && contactHamlets.map(item => {
                contactHamletsItem.push(<Option key={item.id} zip={item.zipCode} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            if ((contactHamlets) && (contactHamlets.length === 0) && (patInfo.patContactHamletID)) {
                contactHamletsItem.push(<Option key={patInfo.patContactHamletID} role={patInfo.patContactHamletDesc} title={patInfo.patContactHamletDesc} value={String(patInfo.patContactHamletID)}>{patInfo.patContactHamletDesc}</Option>)
            }
            let credTypeItem = [], maritalItem = [], nationItem = [], occupationItem = [], patTypeItem = [], relationItem = [], sexItem = [], socialStatusItem = [], countryItem = [];
            //证件类型
            baseParms.credType && baseParms.credType.map(item => {
                credTypeItem.push(<Option key={item.id} value={String(item.id)} code={String(item.code)} title={item.descripts} role={item.descripts + '^' + item.descriptsSPCode}>{item.descripts}</Option>)
            });
            //文化程度
            let educationListOption = []
            baseParms.education && baseParms.education.map((item, index) => {
                educationListOption.push(<Option key={index} value={String(item.id)} name={item.descripts} code={item.descriptsSPCode}>{item.descripts}</Option>)
            })
            //婚姻状况
            baseParms.marital && baseParms.marital.map(item => {
                maritalItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} title={item.descripts}>{item.descripts}</Option>)
            });
            //民族
            baseParms.nation && baseParms.nation.map(item => {
                nationItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            //职业
            baseParms.occupation && baseParms.occupation.map(item => {
                occupationItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} title={item.descripts}>{item.descripts}</Option>)
            });
            //病人费别
            baseParms.patType && baseParms.patType.map(item => {
                patTypeItem.push(<Option key={item.id} value={String(item.id)}>{item.descripts}</Option>)
            });
            //与本人关系
            baseParms.relation && baseParms.relation.map(item => {
                relationItem.push(<Option key={item.id} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            });
            //性别
            baseParms.sex && baseParms.sex.map(item => {
                sexItem.push(<Option key={item.id} value={String(item.id)}>{item.descripts}</Option>)
            });
            //身份标签
            baseParms.socialStatus && baseParms.socialStatus.map(item => {
                socialStatusItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} title={item.descripts}>{item.descripts}</Option>)
            });
            //国籍
            baseParms.country && baseParms.country.map(item => {
                countryItem.push(<Option key={item.id} title={item.descripts} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)}>{item.descripts}</Option>)
            });
            //科室,病区
            let loc = [], ward = [], doctor = [];
            let { locList, wardList, docList } = this.state;
            locList && locList.map(item => {
                loc.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} >{item.descripts} </Option>)
            });
            if ((locList.length === 0) && (patAdminInfo.locID) && (patAdminInfo.locID !== "")) {
                loc.push(<Option key={patAdminInfo.locID} role={patAdminInfo.locDesc}>{patAdminInfo.locDesc} </Option>)
            }
            ward.push(
                <Option disabled={true} key="-1" >
                    <div style={{ width: this.state.wardColumnsWidth }}>
                        {
                            this.state.wardListColumns.map((item, index) => {
                                return (
                                    <Col key={index} span={1} className="title" style={{ borderRight: '2px solid #cccccc', textAlign: 'center', width: item.width }}>
                                        {item.descripts}
                                    </Col>
                                )
                            })
                        }
                    </div>
                </Option>
            )
            wardList && wardList.map(item => {
                ward.push(<Option key={item.id} itemobj={item} code={item.code} descripts={item.descripts} descriptsspcode={item.descriptsSPCode} >
                    <div style={{ width: this.state.wardColumnsWidth }}>
                        {
                            this.state.wardListColumns.map((column, index) => {
                                return (
                                    <Col key={index} span={1} style={{ borderRight: '2px solid #cccccc', textAlign: column.align, width: column.width }}>
                                        {item[column.code]}
                                    </Col>
                                )
                            })
                        }
                    </div>
                </Option>)
            });

            docList && docList.map(item => {
                doctor.push(<Option key={item.id} role={item.descspell + '^' + item.descripts} >{item.descripts}</Option>)
            });
            if ((docList.length === 0) && (patAdminInfo.docID) && (patAdminInfo.docID !== "")) {
                doctor.push(<Option key={patAdminInfo.docID} role={patAdminInfo.docName}>{patAdminInfo.docName} </Option>)
            }
            if ((docList.length === 0) && (admInfo.admDocID) && (admInfo.admDocID !== "") && (admInfo.admDocID !== patAdminInfo.docID)) {
                doctor.push(<Option key={admInfo.admDocID} role={admInfo.admDocDesc}>{admInfo.admDocDesc} </Option>)
            }
            let admReason = []
            admReasonList && admReasonList.map(item => {
                admReason.push(<Option key={item.id} role={item.descriptsSPCode + '^' + item.descripts} admReasonCode={item.code} insuAlertBeforeAdm={item.insuAlertBeforeAdm}>{item.descripts}</Option>)
            });
            //险种类型
            let insurance = []
            insuranceData && insuranceData.map(item => {
                insurance.push(<Option key={item.id} role={item.descriptsSPCode + '^' + item.descripts} code={item.code} >{item.descripts}</Option>)
            });
            const mesIcon = <Icon type="exclamation-circle" />
            const { ids, page, total, top, left, selectData } = this.state;
            let param = {
                width: '800px',
                height: this.state.modelHeight,
                top: top,
                left: left,
                bordered: true,
                columns: this.dialogColumns,
                data: selectData,
                isOnRow: true,
                TableClassName: 'tab-placeholder',
                rowClassName: true,
                showPagination: true,
                page,
                total,
                x: 600,
            }
            let wardParam = {
                width: '800px',
                height: this.state.modelHeight,
                top: top,
                left: left,
                bordered: true,
                columns: this.state.wardListColumns,
                data: this.state.wardList,
                isOnRow: true,
                TableClassName: 'tab-placeholder',
                rowClassName: true,
                showPagination: false,
                x: 600,
            }
            return (
                <Spin spinning={readInfoLoading} wrapperClassName="hospRegister">
                    <div style={{ height: "100%", overflow: "hidden" }}>
                        <INSURegister
                            size="small"
                            onRef={this.onInsuRef}
                            admID={this.state.admID}
                        />
                        <ReadCard ref={r => this.readCard = r} />
                        <Modal
                            width='600px'
                            visible={this.state.remainSecond == 0 ? false : this.state.visibleSuccess}
                            title={[
                                <div>
                                    <p style={{ textAlign: 'center', height: '26px', fontSize: '18px' }}>
                                        <span>入院登记办理成功</span>
                                        <span style={{ color: 'red' }}>病人:&nbsp;&nbsp;{this.state.patInfo.patName}住院号:&nbsp;&nbsp;{this.state.patInfo.patMedicalNo}</span>
                                        <span style={{ color: 'red' }}>{this.state.remainSecond}S</span>
                                        <span>自动关闭</span>
                                    </p>
                                </div>
                            ]}
                            onCancel={this.closeSuccessPop}
                            centered={true}
                            footer={null}>
                        </Modal>
                        {/**关联信息弹框 */}
                        <CorrelationModal isShow={this.state.isShowCorrelationModal}
                            onSubmit={this.submitCorrelation.bind(this)}
                            checkData={this.state.checkMsg}
                            onHide={this.hideModal.bind(this, 'isShowCorrelationModal')}>
                        </CorrelationModal>
                        {/**住院证列表 */}
                        <HospitalizationListNew
                            visible={this.state.adminListVisible}
                            patAdminList={this.state.patAdminList}
                            onCancel={this.hideModal.bind(this, 'adminListVisible')}
                            onSubmit={this.onSelectAdmin}
                        >
                        </HospitalizationListNew>
                        <Form style={{ height: "100%", overflow: "hidden" }}>
                            <div className="whiteBlack bodyconent">
                                <div className="whiteBlack cardInfo" style={{ position: 'relative' }}>
                                    <div className="bg1"></div>
                                    <Row style={{ background: "#ffffff", padding: '4px 0' }} >
                                        <span className="cardTitle-title">当前卡信息</span>
                                    </Row>
                                    <Row className="content">
                                        <Col span={2} >
                                            <FormItem wrapperCol={{ span: 23 }}>
                                                {getFieldDecorator('cardTypeID', {
                                                    initialValue: initCardDr,
                                                    rules: [{ required: true, message: '请选择卡类型' }],
                                                })(
                                                    <Select
                                                        onChange={this.onCardTypeChange}
                                                    >
                                                        {card}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={5} className="cardNoDom">
                                            <Tooltip getPopupContainer={() => document.querySelector('.cardNoDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{tipsCardNo}</span></div>} visible={this.state.tipsCardNo !== ""}>
                                                <FormItem wrapperCol={{ span: 24 }}>
                                                    {getFieldDecorator('cardNo', {
                                                        validateTrigger: [""],
                                                        rules: [
                                                            { validator: this.validFunction },
                                                        ],
                                                        getValueFromEvent: (event) => {
                                                            return initCardCode == '01' ? event.target.value.replace(/[^\d|Xx]/g, '') : event.target.value.replace(/\D/g, '')
                                                        },
                                                    })(
                                                        <Input
                                                            ref={this.cardNo}
                                                            maxLength={initCardCode == '01' ? 18 : (initCardCode == '03' ? 12 : 99)}
                                                            allowClear={true}
                                                            onBlur={this.onCardBlur}
                                                            placeholder={nowRead == 'R' ? '请点击读卡按钮查找病人' : (nowRead == "" && initCardCode == '01' ? cardLength + '刷卡/输入或点击读卡（卡号可自动补零）' : (nowRead == "" && initCardCode != '01' ? cardLength + '刷卡/输入或点击读卡' : (nowRead == 'I' && initCardDr == "01" ? cardLength + '刷卡/输入卡号（卡号可自动补零）' : (nowRead == 'I' && initCardDr != "01" ? cardLength + '刷卡/输入卡号' : ""))))}
                                                            onPressEnter={this.onCardPressEnter}
                                                            onChange={this.onCardNoChange}
                                                            onFocus={this.onFocus.bind(this, "cardNo")}
                                                        />
                                                    )}
                                                </FormItem>
                                            </Tooltip>
                                        </Col>
                                        <Col span={3}>
                                            <Button className="readCardBtn" style={{ margin: '0 20px' }} onClick={this.handleReadCard}>读卡</Button>
                                            <Button ghost type="primary" onClick={this.handleReadIDCard}>读身份证</Button>
                                        </Col>
                                        <Col span={4}>
                                            <Form.Item  {...formItemLayoutZero}>
                                                {getFieldDecorator('number',
                                                    {
                                                    })(
                                                        <Input allowClear={true}
                                                            autoFocus={true} onPressEnter={() => this.onNumberPressEnter('')} placeholder="输入病人ID/身份证号码回车查询" />
                                                    )}
                                            </Form.Item>
                                        </Col>
                                        <Col span={5}>
                                            <Form.Item label={"账户余额"} {...formItemAdressLabel}>
                                                {getFieldDecorator('balance',
                                                    {
                                                        initialValue: patInfo.balance ? patInfo.balance : undefined,
                                                    })(
                                                        <Input disabled />
                                                    )}
                                            </Form.Item>
                                        </Col>
                                        <Col span={5}>
                                            <Form.Item label={"当前住院号"} {...formItemAdressLabel}>
                                                {getFieldDecorator('admNo',
                                                    {
                                                        initialValue: admInfo.admNo ? admInfo.admNo : undefined,
                                                        // initialValue: patAdminInfo.admNo ? patAdminInfo.admNo : undefined,
                                                    })(
                                                        <Input disabled />
                                                    )}
                                            </Form.Item>
                                        </Col>
                                    </Row>
                                </div>
                                <div className="whiteBlack patInfo">
                                    <Row className="title">
                                        <div className="title-contnet">
                                            <img src={titleA} />
                                            <span>病人基本信息</span>
                                            <text style={{ color: 'red', marginLeft: '20px', display: this.state.poorFlag === true ? 'inline' : 'none' }}>【贫困属性】:已脱贫(享受政策)</text>
                                        </div>
                                    </Row>

                                    <div className="content">
                                        <Row className="borderBottomRow">
                                            <Col span={4} className="patNameDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.patNameDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatName}</span></div>} visible={this.state.tipsPatName !== ""}>
                                                    <FormItem label='病人姓名' {...formItemAdressLabel}>
                                                        {getFieldDecorator('patName', {
                                                            initialValue: patInfo.patName ? patInfo.patName : undefined,
                                                            rules: [{ required: true, message: '请填写' }],
                                                        })(
                                                            <Input
                                                                onBlur={this.onTipsItemBlur.bind(this, "patName", "请填写患者姓名")}
                                                                onPressEnter={this.onTipsItemBlur.bind(this, "patName", "请填写患者姓名")}
                                                                ref={this.patName}
                                                                onFocus={this.onFocus.bind(this, "patName")}
                                                            />
                                                        )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>

                                            <Col span={4} className="patSexDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.patSexDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatSexID}</span></div>} visible={this.state.tipsPatSexID !== ""}>

                                                    <FormItem label='性别' {...formItemAdressLabel}>
                                                        {getFieldDecorator('patSexID', {
                                                            rules: [{ required: true, message: '请选择' }],
                                                            initialValue: patInfo.patSexID ? patInfo.patSexID : undefined,
                                                        })(
                                                            <Select
                                                                onFocus={this.onFocus.bind(this, "patSexID")}
                                                            >
                                                                {sexItem}
                                                            </Select>
                                                        )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={4} className="patCredTypeDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.patCredTypeDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatCredTypeID}</span></div>} visible={this.state.tipsPatCredTypeID !== ""}>

                                                    <FormItem label='证件类型' {...formItemCredCardLabel}>
                                                        {getFieldDecorator('patCredTypeID', {
                                                            initialValue: patInfo.patCredTypeID ? patInfo.patCredTypeID : this.state.patCredTypeID ? this.state.patCredTypeID : undefined,
                                                            // rules: [{ required: true, message: '请选择' }],
                                                        })(
                                                            <Select
                                                                showSearch
                                                                allowClear
                                                                optionFilterProp="role"
                                                                onChange={this.onCredTypeChange.bind(this, "patCredTypeCode")}
                                                                onFocus={this.onFocus.bind(this, "patCredTypeID")}
                                                            >
                                                                {credTypeItem}
                                                            </Select>
                                                        )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={4} className="patCredNoDom" >
                                                <Tooltip getPopupContainer={() => document.querySelector('.patCredNoDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatCredNo}</span></div>} visible={this.state.tipsPatCredNo !== ""}>
                                                    <FormItem label='证件号码' {...formItemAdressLabel}>
                                                        {getFieldDecorator('patCredNo', {
                                                            validateTrigger: ["onPressEnter", "onBlur"],
                                                            initialValue: patInfo.patCredNo ? patInfo.patCredNo : undefined,
                                                            rules: [
                                                                { required: (this.state.patCredTypeCode === "01") },
                                                                { message: '请输证件号码' },
                                                                { validator: (this.state.patCredTypeCode == '01') || (patInfo.patCredTypeCode == '01') ? Util.vailIdCard : "" },
                                                            ],
                                                            getValueFromEvent: (event) => {
                                                                return (this.state.patCredTypeCode == '01') || (patInfo.patCredTypeCode == '01') ? event.target.value.replace(/[^\d|Xx]/g, '') : event.target.value.replace(/\D/g, '')
                                                            },
                                                        })(
                                                            <Input
                                                                ref={this.patCredNo}
                                                                allowClear={true}
                                                                onPressEnter={this.patCredNoTip}
                                                                onBlur={this.patCredNoTip}
                                                                maxLength={(this.state.patCredTypeCode == '01') || (patInfo.patCredTypeCode == '01') ? 18 : 99}
                                                                onFocus={this.onFocus.bind(this, "patCredNo")}
                                                            />
                                                        )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={4} >
                                                <FormItem label={"出生日期"} {...formItemAdressLabel}>
                                                    {getFieldDecorator('patBirthDateTime',
                                                        {
                                                            initialValue: patInfo.patBirthDateTime ? moment(patInfo.patBirthDateTime, 'YYYY-MM-DD HH:mm') : undefined,
                                                        })(
                                                            <DatePicker
                                                                showTime={{ format: 'HH:mm' }}
                                                                format="YYYY-MM-DD HH:mm"
                                                                onChange={this.onPanelChange}
                                                            />
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}  >
                                                <FormItem label={'年龄'} {...formItemAdressLabel}>
                                                    {getFieldDecorator('age', {
                                                        initialValue: patInfo.patAge ? patInfo.patAge : this.state.patAge ? this.state.patAge : undefined,
                                                    })(
                                                        <Input disabled readOnly="ture" />
                                                    )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}   >
                                                <FormItem label='婚姻状况' {...formItemContact}>
                                                    {getFieldDecorator('patMaritalID', {
                                                        initialValue: patInfo.patMaritalID ? patInfo.patMaritalID : undefined,
                                                    })(
                                                        <Select >
                                                            {maritalItem}
                                                        </Select>
                                                    )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                        <Row className="borderBottomRow">

                                            <Col span={4} id="patType" className="patTypeDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.patTypeDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatTypeID}</span></div>} visible={this.state.tipsPatTypeID !== ""}>
                                                    <FormItem label='病人类型' {...formItemAdressLabel}>
                                                        {getFieldDecorator('patTypeID', {
                                                            initialValue: patInfo.patTypeID ? patInfo.patTypeID : undefined,
                                                            rules: [{ required: true, message: '请选择病人类型' }],
                                                        })(
                                                            <Select
                                                                onFocus={this.onFocus.bind(this, "patTypeID")}
                                                            >
                                                                {patTypeItem}
                                                            </Select>
                                                        )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={4} className="patMobileDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.patMobileDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatMobile}</span></div>} visible={this.state.tipsPatMobile !== ""}>
                                                    <FormItem label='联系电话' {...formItemAdressLabel}>
                                                        {getFieldDecorator('patMobile', {
                                                            initialValue: patInfo.patMobile ? patInfo.patMobile : undefined,
                                                            rules: [{ required: false, message: '请填写联系电话', }],
                                                            getValueFromEvent: (event) => {
                                                                return event.target.value.replace(/\D/g, '')
                                                            },
                                                        })(
                                                            <Input
                                                                onFocus={this.onFocus.bind(this, "patMobile")}
                                                            />
                                                        )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={4} className="patMobileDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.patMobileDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsTelPhone}</span></div>} visible={this.state.tipsTelPhone !== ""}>
                                                    <FormItem label='座机电话' {...formItemAdressLabel}>
                                                        {getFieldDecorator('telphone', {
                                                            initialValue: patInfo.telphone ? patInfo.telphone : undefined,
                                                            rules: [{ required: false, message: '请填写座机电话', }],
                                                            getValueFromEvent: (event) => {
                                                                return event.target.value.replace(/\D/g, '')
                                                            },
                                                        })(
                                                            <Input
                                                                onFocus={this.onFocus.bind(this, "telphone")}
                                                            />
                                                        )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={4}>
                                                <FormItem label='国籍' {...formItemCredCardLabel}>
                                                    {getFieldDecorator('patCountryID', {
                                                        initialValue: patInfo.patCountryID ? patInfo.patCountryID : undefined,
                                                    })(
                                                        <Select showSearch allowClear filterOption={(input, option) =>
                                                            option.props.title.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                        }>
                                                            {countryItem}
                                                        </Select>
                                                    )}
                                                </FormItem>
                                            </Col>
                                            <Col span={4} >
                                                <FormItem label='民族' {...formItemAdressLabel}>
                                                    {getFieldDecorator('patNationID', {
                                                        initialValue: patInfo.patNationID ? patInfo.patNationID : undefined,
                                                    })(
                                                        <Select showSearch allowClear filterOption={(input, option) =>
                                                            option.props.title.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                        }>
                                                            {nationItem}
                                                        </Select>
                                                    )}
                                                </FormItem>
                                            </Col>
                                            <Col span={4} >
                                                <FormItem label={"身份标签"} {...formItemIdentityLabel}>
                                                    {getFieldDecorator('patSocialStatusID',
                                                        {
                                                            initialValue: patInfo.patSocialStatusID ? patInfo.patSocialStatusID : undefined,
                                                        })(
                                                            <Select>
                                                                {socialStatusItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>

                                        </Row>
                                        <Row>
                                            <Col span={4} >
                                                <FormItem label='职业' {...formItemAdressLabel}>
                                                    {getFieldDecorator('patOccupationID', {
                                                        initialValue: patInfo.patOccupationID ? patInfo.patOccupationID : undefined,
                                                    })(
                                                        <Select >
                                                            {occupationItem}
                                                        </Select>
                                                    )}
                                                </FormItem>
                                            </Col>
                                            <Col span={4} >
                                                <FormItem label='贫困' {...formItemAdressLabel}>
                                                    {getFieldDecorator('patPoor', {
                                                    })(
                                                        <Switch checkedChildren="是" unCheckedChildren="否" checked={this.state.poorFlag} onChange={this.poorChange}>
                                                        </Switch>
                                                    )}
                                                </FormItem>
                                            </Col>
                                            <Col span={4} id="patType" className="patTypeDom">
                                                <FormItem label='文化程度' {...formItemAdressLabel}>
                                                    {getFieldDecorator('patEduID', {
                                                        initialValue: patInfo.patEduID ? patInfo.patEduID : undefined,
                                                        rules: [{ required: false, message: '请选择文化程度' }],
                                                    })(
                                                        <Select showSearch allowClear filterOption={(input, option) =>
                                                            option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                            || option.props.name.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                        }>
                                                            {educationListOption}
                                                        </Select>
                                                    )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                    </div>
                                </div>
                                <div className="whiteBlack addressInfo">
                                    <Row className="addressTitle">
                                        <div className="title-contnet">
                                            <img src={titleB} />
                                            <span>联系地址</span>
                                        </div>
                                    </Row>

                                    <div className="content">
                                        <Row className="borderBottomRow">
                                            <Col span={4}>
                                                <FormItem label={"出生地址"}  {...formItemAdressLabel} >
                                                    {getFieldDecorator('birthProvinceID',
                                                        {
                                                            initialValue: patInfo.patBirthProvinceID ? patInfo.patBirthProvinceID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='省'
                                                                optionFilterProp="role"
                                                                onChange={this.onProvinceChange.bind(this, "birth")}
                                                            >
                                                                {provinceItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}>
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('birthCityID',
                                                        {
                                                            initialValue: patInfo.patBirthCityID ? patInfo.patBirthCityID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='市'
                                                                optionFilterProp="role"
                                                                onFocus={this.onCityFocus.bind(this, "birthProvinceID", "birthCity")}
                                                                onChange={this.onCityChange.bind(this, "birth")}
                                                            >
                                                                {birthCityItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('birthAreaID',
                                                        {
                                                            initialValue: patInfo.patBirthAreaID ? patInfo.patBirthAreaID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='县'
                                                                optionFilterProp="role"
                                                                onChange={this.onAreaChange.bind(this, "birth")}
                                                                onFocus={this.onAreaFocus.bind(this, "birthCityID", "birth")}
                                                            >
                                                                {birthAreasItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('birthVillageID',
                                                        {
                                                            initialValue: patInfo.patBirthVillageID ? patInfo.patBirthVillageID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='乡'
                                                                optionFilterProp="role"
                                                                onChange={this.onVillageChange.bind(this, "birth")}
                                                                onFocus={this.onVillageFocus.bind(this, "birthAreaID", "birth")}
                                                            >
                                                                {birthVillagesItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('birthHamletID',
                                                        {
                                                            initialValue: patInfo.patBirthHamletID ? patInfo.patBirthHamletID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='村'
                                                                optionFilterProp="role"
                                                                onFocus={this.onHamletFocus.bind(this, "birthVillageID", "birth")}
                                                            >
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={6}>
                                                <FormItem {...formItemAdressDetail} >
                                                    {getFieldDecorator('birthAddress',
                                                        {
                                                            initialValue: patInfo.patBirthAddressDesc ? patInfo.patBirthAddressDesc : undefined,
                                                        })(
                                                            <Input placeholder='详细地址(出生)' />
                                                        )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                        <Row className="borderBottomRow">
                                            <Col span={4} >
                                                <FormItem label={"籍贯"} {...formItemAdressLabel}>
                                                    {getFieldDecorator('nativeProvinceID',
                                                        {
                                                            initialValue: patInfo.patNativeProvinceID ? patInfo.patNativeProvinceID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='省'
                                                                optionFilterProp="role"
                                                                onChange={this.onProvinceChange.bind(this, "native")}
                                                            >
                                                                {provinceItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('nativeCityID',
                                                        {
                                                            initialValue: patInfo.patNativeCityID ? patInfo.patNativeCityID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='市'
                                                                optionFilterProp="role"
                                                                onChange={this.onCityChange.bind(this, "native")}
                                                                onFocus={this.onCityFocus.bind(this, "nativeProvinceID", "nativeCity")}
                                                            >
                                                                {nativeCityItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('nativeAreaID',
                                                        {
                                                            initialValue: patInfo.patNativeAreaID ? patInfo.patNativeAreaID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='县'
                                                                optionFilterProp="role"
                                                                onChange={this.onAreaChange.bind(this, "native")}
                                                                onFocus={this.onAreaFocus.bind(this, "nativeCityID", "native")}
                                                            >
                                                                {nativeAreasItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('nativeVillageID',
                                                        {
                                                            initialValue: patInfo.patNativeVillageID ? patInfo.patNativeVillageID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='乡'
                                                                optionFilterProp="role"
                                                                onChange={this.onVillageChange.bind(this, "native")}
                                                                onFocus={this.onVillageFocus.bind(this, "nativeAreaID", "native")}
                                                            >
                                                                {nativeVillagesItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}  >
                                                <FormItem {...formItemLayoutZero}>
                                                    {getFieldDecorator('nativeHamletID',
                                                        {
                                                            initialValue: patInfo.patNativeHamletID ? patInfo.patNativeHamletID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='村'
                                                                optionFilterProp="role"
                                                                onFocus={this.onHamletFocus.bind(this, "nativeVillageID", "native")}
                                                            >
                                                                {nativeHamletsItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={6}  >
                                                <FormItem {...formItemAdressDetail} >
                                                    {getFieldDecorator('nativeAddress',
                                                        {
                                                            initialValue: patInfo.patNativeAddressDesc ? patInfo.patNativeAddressDesc : undefined,
                                                        })(
                                                            <Input placeholder='详细地址(籍贯)' />
                                                        )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                        <Row className="borderBottomRow">
                                            <Col span={4}>
                                                <FormItem label={"现住址"}  {...formItemAdressLabel}>
                                                    {getFieldDecorator('presentProvinceID',
                                                        {
                                                            initialValue: patInfo.patPresentProvinceID ? patInfo.patPresentProvinceID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='省'
                                                                optionFilterProp="role"
                                                                onChange={this.onProvinceChange.bind(this, "present")}
                                                            >
                                                                {provinceItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('presentCityID',
                                                        {
                                                            initialValue: patInfo.patPresentCityID ? patInfo.patPresentCityID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='市'
                                                                optionFilterProp="role"
                                                                onChange={this.onCityChange.bind(this, "present")}
                                                                onFocus={this.onCityFocus.bind(this, "presentProvinceID", "presentCity")}
                                                            >
                                                                {
                                                                    presentCityItem
                                                                }
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('presentAreaID',
                                                        {
                                                            initialValue: patInfo.patPresentAreaID ? patInfo.patPresentAreaID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='县'
                                                                optionFilterProp="role"
                                                                onChange={this.onAreaChange.bind(this, "present")}
                                                                onFocus={this.onAreaFocus.bind(this, "presentCityID", "present")}
                                                            >
                                                                {presentAreasItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('presentVillageID',
                                                        {
                                                            initialValue: patInfo.patPresentVillageID ? patInfo.patPresentVillageID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='乡'
                                                                optionFilterProp="role"
                                                                onChange={this.onVillageChange.bind(this, "present")}
                                                                onFocus={this.onVillageFocus.bind(this, "presentAreaID", "present")}
                                                            >
                                                                {presentVillagesItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}  >
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('presentHamletID',
                                                        {
                                                            initialValue: patInfo.patPresentHamletID ? patInfo.patPresentHamletID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='村'
                                                                optionFilterProp="role"
                                                                onFocus={this.onHamletFocus.bind(this, "presentVillageID", "present")}
                                                            >
                                                                {presentHamletsItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={6} id="patAdress" className="presentAddressDescDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.presentAddressDescDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPresentAddressDesc}</span></div>} visible={this.state.tipsPresentAddressDesc !== ""}>
                                                    <FormItem label={" "}  {...formItemPresentAdressDetail} >
                                                        {getFieldDecorator('presentAddressDesc',
                                                            {
                                                                rules: [{ required: true, message: '请填写' }],
                                                                initialValue: patInfo.patPresentAddressDesc ? patInfo.patPresentAddressDesc : undefined,
                                                            })(
                                                                <Input
                                                                    onBlur={this.onTipsItemBlur.bind(this, "presentAddressDesc", "请填写现住址详细地址")}
                                                                    onPressEnter={this.onTipsItemBlur.bind(this, "presentAddressDesc", "请填写现住址详细地址")}
                                                                    placeholder='详细地址(现住址)'
                                                                    onFocus={this.onFocus.bind(this, "presentAddressDesc")}
                                                                />
                                                            )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={3}>
                                                <FormItem label={"邮编"} {...formItemLabel}>
                                                    {getFieldDecorator('presentZIP',
                                                        {
                                                            initialValue: patInfo.patPresentZIPDesc ? patInfo.patPresentZIPDesc : undefined,
                                                            rules: [{ required: false, message: '' },
                                                            { pattern: new RegExp(/^[0-9][0-9]{5}$/), message: '请输入正确的邮编' }],
                                                            getValueFromEvent: (event) => {
                                                                return event.target.value.replace(/\D/g, '')
                                                            },
                                                        })(
                                                            <Input
                                                                maxLength={6}
                                                                placeholder='0-9 6位'
                                                            />
                                                        )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                        <Row className="borderBottomRow">
                                            <Col span={4}>
                                                <FormItem label={"户口地址"} {...formItemAdressLabel} >
                                                    {getFieldDecorator('registerProvinceID',
                                                        {
                                                            initialValue: patInfo.patRegisterProvinceID ? patInfo.patRegisterProvinceID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='省'
                                                                optionFilterProp="role"
                                                                onChange={this.onProvinceChange.bind(this, "register")}
                                                            >
                                                                {provinceItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}>
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('registerCityID',
                                                        {
                                                            initialValue: patInfo.patRegisterCityID ? patInfo.patRegisterCityID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='市'
                                                                optionFilterProp="role"
                                                                onChange={this.onCityChange.bind(this, "register")}
                                                                onFocus={this.onCityFocus.bind(this, "registerProvinceID", "registerCity")}
                                                            >
                                                                {
                                                                    registerCityItem
                                                                }
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}>
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('registerAreaID',
                                                        {
                                                            initialValue: patInfo.patRegisterAreaID ? patInfo.patRegisterAreaID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='县'
                                                                optionFilterProp="role"
                                                                onChange={this.onAreaChange.bind(this, "register")}
                                                                onFocus={this.onAreaFocus.bind(this, "registerCityID", "register")}
                                                            >
                                                                {registerAreasItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}>
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('registerVillageID',
                                                        {
                                                            initialValue: patInfo.patRegisterVillageID ? patInfo.patRegisterVillageID : undefined,
                                                        })(
                                                            <Select allowClear={true}
                                                                showSearch={true}
                                                                placeholder='乡'
                                                                optionFilterProp="role"
                                                                onChange={this.onVillageChange.bind(this, "register")}
                                                                onFocus={this.onVillageFocus.bind(this, "registerAreaID", "register")}
                                                            >
                                                                {registerVillagesItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}>
                                                <FormItem {...formItemLayoutZero} >
                                                    {getFieldDecorator('registerHamletID',
                                                        {
                                                            initialValue: patInfo.patRegisterHamletID ? patInfo.patRegisterHamletID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='村'
                                                                optionFilterProp="role"
                                                                onFocus={this.onHamletFocus.bind(this, "registerVillageID", "register")}
                                                            >
                                                                {registerHamletsItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={6}
                                            >
                                                <FormItem  {...formItemAdressDetail}>
                                                    {getFieldDecorator('registerAddress',
                                                        {
                                                            initialValue: patInfo.patRegisterAddressDesc ? patInfo.patRegisterAddressDesc : undefined,
                                                        })(
                                                            <Input placeholder='详细地址(户口地址)' />
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={3}>
                                                <FormItem label={"邮编"} {...formItemLabel}>
                                                    {getFieldDecorator('registerZIP',
                                                        {
                                                            initialValue: patInfo.patRegisterZIPDesc ? patInfo.patRegisterZIPDesc : undefined,
                                                            rules: [{ required: false, message: '' },
                                                            { pattern: new RegExp(/^[0-9][0-9]{5}$/), message: '请输入正确的邮编' }],
                                                            getValueFromEvent: (event) => {
                                                                return event.target.value.replace(/\D/g, '')
                                                            },
                                                        })(
                                                            <Input
                                                                maxLength={6}
                                                                placeholder='0-9 6位'
                                                            />
                                                        )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                        <Row className="borderBottomRow">
                                            <Col span={4}>
                                                <FormItem label={"单位地址"} {...formItemAdressLabel}>
                                                    {getFieldDecorator('companyProvinceID',
                                                        {
                                                            initialValue: patInfo.patCompanyProvinceID ? patInfo.patCompanyProvinceID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='省'
                                                                optionFilterProp="role"
                                                                onChange={this.onProvinceChange.bind(this, "company")}
                                                            >
                                                                {provinceItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem  {...formItemLayoutZero}>
                                                    {getFieldDecorator('companyCityID',
                                                        {
                                                            initialValue: patInfo.patCompanyCityID ? patInfo.patCompanyCityID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='市'
                                                                optionFilterProp="role"
                                                                onChange={this.onCityChange.bind(this, "company")}
                                                                onFocus={this.onCityFocus.bind(this, "companyProvinceID", "companyCity")}
                                                            >
                                                                {companyCityItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}>
                                                <FormItem  {...formItemLayoutZero}>
                                                    {getFieldDecorator('companyAreaID',
                                                        {
                                                            initialValue: patInfo.patCompanyAreaID ? patInfo.patCompanyAreaID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='县'
                                                                optionFilterProp="role"
                                                                onChange={this.onAreaChange.bind(this, "company")}
                                                                onFocus={this.onAreaFocus.bind(this, "companyCityID", "company")}
                                                            >
                                                                {companyAreasItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2} >
                                                <FormItem  {...formItemLayoutZero}>
                                                    {getFieldDecorator('companyVillageID',
                                                        {
                                                            initialValue: patInfo.patCompanyVillageID ? patInfo.patCompanyVillageID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='乡'
                                                                optionFilterProp="role"
                                                                onChange={this.onVillageChange.bind(this, "company")}
                                                                onFocus={this.onVillageFocus.bind(this, "companyAreaID", "company")}
                                                            >
                                                                {companyVillagesItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}>
                                                <FormItem {...formItemLayoutZero}>
                                                    {getFieldDecorator('companyHamletID',
                                                        {
                                                            initialValue: patInfo.patCompanyHamletID ? patInfo.patCompanyHamletID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='村'
                                                                optionFilterProp="role"
                                                                onFocus={this.onHamletFocus.bind(this, "companyVillageID", "company")}
                                                            >
                                                                {companyHamletsItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={6}  >
                                                <FormItem  {...formItemAdressDetail}>
                                                    {getFieldDecorator('companyAddress',
                                                        {
                                                            initialValue: patInfo.patCompanyAddressDesc ? patInfo.patCompanyAddressDesc : undefined,
                                                        })(
                                                            <Input placeholder='详细地址(单位地址)' />
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={3} >
                                                <FormItem label={"邮编"} {...formItemLabel}>
                                                    {getFieldDecorator('companyZIP',
                                                        {
                                                            initialValue: patInfo.patCompanyZIPDesc ? patInfo.patCompanyZIPDesc : undefined,
                                                            rules: [{ required: false, message: '' },
                                                            { pattern: new RegExp(/^[0-9][0-9]{5}$/), message: '请输入正确的邮编' }],
                                                            getValueFromEvent: (event) => {
                                                                return event.target.value.replace(/\D/g, '')
                                                            },
                                                        })(
                                                            <Input
                                                                maxLength={6}
                                                                placeholder='0-9 6位'
                                                            />
                                                        )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                        <Row className="borderBottomRow">
                                            <Col span={4}>
                                                <FormItem label={"联系人地址"} {...formItemAdressLabel}>
                                                    {getFieldDecorator('contactProvinceID',
                                                        {
                                                            initialValue: patInfo.patContactProvinceID ? patInfo.patContactProvinceID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='省'
                                                                optionFilterProp="role"
                                                                onChange={this.onProvinceChange.bind(this, "contact")}
                                                            >
                                                                {provinceItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}  >
                                                <FormItem {...formItemLayoutZero}>
                                                    {getFieldDecorator('contactCityID',
                                                        {
                                                            initialValue: patInfo.patContactCityID ? patInfo.patContactCityID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='市'
                                                                optionFilterProp="role"
                                                                onChange={this.onCityChange.bind(this, "contact")}
                                                                onFocus={this.onCityFocus.bind(this, "contactProvinceID", "contactCity")}
                                                            >
                                                                {contactCityItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}  >
                                                <FormItem  {...formItemLayoutZero}>
                                                    {getFieldDecorator('contactAreaID',
                                                        {
                                                            initialValue: patInfo.patContactAreaID ? patInfo.patContactAreaID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='县'
                                                                optionFilterProp="role"
                                                                onChange={this.onAreaChange.bind(this, "contact")}
                                                                onFocus={this.onAreaFocus.bind(this, "contactCityID", "contact")}
                                                            >
                                                                {contactAreasItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}  >
                                                <FormItem  {...formItemLayoutZero}>
                                                    {getFieldDecorator('contactVillageID',
                                                        {
                                                            initialValue: patInfo.patContactVillageID ? patInfo.patContactVillageID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='乡'
                                                                optionFilterProp="role"
                                                                onChange={this.onVillageChange.bind(this, "contact")}
                                                                onFocus={this.onVillageFocus.bind(this, "contactAreaID", "contact")}
                                                            >
                                                                {contactVillagesItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={2}    >
                                                <FormItem  {...formItemLayoutZero}>
                                                    {getFieldDecorator('contactHamletID',
                                                        {
                                                            initialValue: patInfo.patContactHamletID ? patInfo.patContactHamletID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='村'
                                                                optionFilterProp="role"
                                                                onFocus={this.onHamletFocus.bind(this, "contactVillageID", "contact")}
                                                            >
                                                                {contactHamletsItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={6}>
                                                <FormItem   {...formItemAdressDetail}>
                                                    {getFieldDecorator('contactAddress',
                                                        {
                                                            initialValue: patInfo.patContactAddressDesc ? patInfo.patContactAddressDesc : undefined,
                                                        })(
                                                            <Input placeholder='详细地址(联系人地址)' />
                                                        )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                        <Row >
                                            <Col span={4} >
                                                <FormItem label={'联系人姓名'} {...formItemAdressLabel}>
                                                    {getFieldDecorator('patEContact',
                                                        {
                                                            initialValue: patInfo.patEContact ? patInfo.patEContact : undefined,
                                                        })(
                                                            <Input
                                                            />
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={4} >
                                                <FormItem label={'联系人证件类型'} {...formItemContact}>
                                                    {getFieldDecorator('patEContactCredTypeID',
                                                        {
                                                            initialValue: patInfo.patEContactCredTypeID ? patInfo.patEContactCredTypeID : undefined,
                                                        })(
                                                            <Select
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='证件类型'
                                                                onChange={this.onCredTypeChange.bind(this, "patEContactCredTypeCode")}
                                                            >
                                                                {credTypeItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={4} className="pECCTIDNoNoDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.pECCTIDNoNoDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatEContactCredTypeIDNo}</span></div>} visible={this.state.tipsPatEContactCredTypeIDNo !== ""}>
                                                    <FormItem label={'联系人证件号'} {...formItemAdressLabel}>
                                                        {getFieldDecorator('patEContactCredTypeIDNo',
                                                            {
                                                                initialValue: patInfo.patEContactCredTypeIDNo ? patInfo.patEContactCredTypeIDNo : undefined,
                                                                validateTrigger: ["onPressEnter", "onBlur", "this.handlesubmit"],
                                                                rules: [
                                                                    { required: this.state.contactCredTypeID == '01' },
                                                                    { validator: (this.state.contactCredTypeID == '01') || (patInfo.patEContactCredTypeCode == '01') ? Util.vailIdCard : "" },
                                                                ],
                                                                getValueFromEvent: (event) => {
                                                                    return (contactCredTypeID == '01') || (patInfo.patEContactCredTypeCode == '01') ? event.target.value.replace(/[^\d|Xx]/g, '') : event.target.value
                                                                },

                                                            })(
                                                                <Input
                                                                    ref={this.patEContactCredTypeIDNo}
                                                                    onPressEnter={this.contactCredNoTip}
                                                                    onBlur={this.contactCredNoTip}
                                                                    onFocus={this.onFocus.bind(this, "patEContactCredTypeIDNo")}
                                                                />
                                                            )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={3}  >
                                                <FormItem label={'联系人关系'} {...formItemAdressLabel}>
                                                    {getFieldDecorator('patERelationID',
                                                        {
                                                            initialValue: patInfo.patERelationID ? patInfo.patERelationID : undefined,
                                                        })(
                                                            <Select showSearch allowClear filterOption={(input, option) =>
                                                                option.props.title.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                            }>
                                                                {relationItem}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={3} className="pECMDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.pECMDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatEContactMobile}</span></div>} visible={this.state.tipsPatEContactMobile !== ""}>
                                                    <FormItem label={'联系人手机'} {...formItemAdressLabel}>
                                                        {getFieldDecorator('patEContactMobile',
                                                            {
                                                                rules: [
                                                                    { required: (this.state.tipsPatEContactMobile !== "") },
                                                                ],
                                                                initialValue: patInfo.patEContactMobile ? patInfo.patEContactMobile : undefined,
                                                                getValueFromEvent: (event) => {
                                                                    return event.target.value.replace(/\D/g, '')
                                                                },
                                                            })(
                                                                <Input
                                                                    onBlur={this.onTipsItemTel.bind(this, "patEContactMobile", "手机号不正确")}
                                                                    onFocus={this.onFocus.bind(this, "patEContactMobile")}
                                                                    maxLength={11}
                                                                />
                                                            )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={3} >
                                                <FormItem label={"工作单位"} {...formItemAdressLabel}>
                                                    {getFieldDecorator('patCompany',
                                                        {
                                                            initialValue: patInfo.patCompany ? patInfo.patCompany : undefined,
                                                        })(
                                                            <Input />
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={3} className="patCompanyTelDom" >
                                                <Tooltip getPopupContainer={() => document.querySelector('.patCompanyTelDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsPatCompanyTel}</span></div>} visible={this.state.tipsPatCompanyTel !== ""}>
                                                    <FormItem label={'单位电话'} {...formItemAdressLabel}>
                                                        {getFieldDecorator('patCompanyTel',
                                                            {
                                                                rules: [
                                                                    { required: (this.state.tipsPatCompanyTel !== "") },
                                                                ],
                                                                initialValue: patInfo.patCompanyTel ? patInfo.patCompanyTel : undefined,
                                                                getValueFromEvent: (event) => {
                                                                    return event.target.value.replace(/[^\d|-]/g, '', '')
                                                                },
                                                            })
                                                            (
                                                                <Input />
                                                            )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                        </Row>
                                    </div>
                                </div>
                                <div className="whiteBlack inHosInfo">
                                    <Row className="addressTitle">
                                        <div className="title-contnet">
                                            <img src={titleC} />
                                            <span>住院信息</span>
                                        </div>
                                    </Row>

                                    <div className="content">
                                        <Row>
                                            <Col span={3} className="inHospNumDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.inHospNumDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsInHospNum}</span></div>} visible={this.state.tipsInHospNum !== ""}>
                                                    <FormItem label={"当前住院次数"} {...formItemInHosNum}>
                                                        {getFieldDecorator('inHospNum',
                                                            {
                                                                rules: [{ required: true, message: '请填写' }],
                                                                initialValue: admInfo.admInNum ? admInfo.admInNum : patInfo.patInNum ? patInfo.patInNum : undefined,
                                                            })(
                                                                <Input
                                                                    onFocus={this.onFocus.bind(this, "inHospNum")}
                                                                />
                                                            )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={3} className="admReasonDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.admReasonDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsAdmReasonID}</span></div>} visible={this.state.tipsAdmReasonID !== ""}>
                                                    <FormItem label={"结算类型"} {...formItemAdressLabel}>
                                                        {getFieldDecorator('admReasonID',
                                                            {
                                                                initialValue: admInfo.admReasonID ? admInfo.admReasonID : undefined,
                                                                rules: [{ required: true, message: '请选择结算类型' }]
                                                            })(
                                                                <Select
                                                                    allowClear={true}
                                                                    showSearch={true}
                                                                    placeholder='结算类型'
                                                                    optionFilterProp="role"
                                                                    onFocus={this.onFocus.bind(this, "admReasonID")}
                                                                    onChange={this.onadmReasonChange}
                                                                >
                                                                    {admReason}
                                                                </Select>
                                                            )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>

                                            {/**
                                              @ByYQL 住院事前审核添加险种类型
                                              Creat：2021-12-20
                                              */}
                                            {this.state.insuAlertBeforeAdm == 'Y' ?
                                                <Col span={3} className="insuranceDom">
                                                    <Tooltip getPopupContainer={() => document.querySelector('.insuranceDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsInsuranceId}</span></div>} visible={this.state.tipsInsuranceId !== ""}>
                                                        <FormItem label={"险种类型"} {...formItemAdressLabel}>
                                                            {getFieldDecorator('insuranceId',
                                                                {
                                                                    initialValue: admInfo.insuTypeCode ? admInfo.insuTypeCode : undefined,
                                                                    rules: [{ required: true, message: '请选择险种类型' }]
                                                                })(
                                                                    <Select
                                                                        allowClear={true}
                                                                        showSearch={true}
                                                                        placeholder='险种类型'
                                                                        optionFilterProp="role"
                                                                        onFocus={this.onFocus.bind(this, "insuranceId")}
                                                                    >
                                                                        {insurance}
                                                                    </Select>
                                                                )}
                                                        </FormItem>
                                                    </Tooltip>
                                                </Col>
                                                : ''}

                                            <Col span={3} className="inLocDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.inLocDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsInLocID}</span></div>} visible={this.state.tipsInLocID !== ""}>
                                                    <FormItem label={"入院科室"} {...formItemAdressLabel}>
                                                        {getFieldDecorator('inLocID',
                                                            {
                                                                rules: [{ required: true, message: '请选择' }],
                                                                initialValue: admInfo.admLocID ? admInfo.admLocID : patAdminInfo.locID ? patAdminInfo.locID : undefined,
                                                            })(
                                                                <Select
                                                                    // 2023/11/22添加入院科室控制【有住院证办理入院的不能修改入院科室】
                                                                    disabled={this.state.admInfo.admID || (patAdminInfo?.id && baseParms?.admissionWardNotAvailable === 'Y') ? true : false}
                                                                    allowClear={true}
                                                                    showSearch={true}
                                                                    placeholder='入院科室'
                                                                    optionFilterProp="role"
                                                                    onFocus={this.onLocFocus}
                                                                    onChange={this.onInLocChange}
                                                                >
                                                                    {loc}
                                                                </Select>
                                                            )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={3} className="inWardDom">
                                                <Tooltip getPopupContainer={() => document.querySelector('.inWardDom')} overlayStyle={{ zIndex: 999, }} overlayClassName="toolTipDom topTips" title={<div className="titleIcon">{mesIcon}<span >{this.state.tipsInWardID}</span></div>} visible={this.state.tipsInWardID !== ""}>
                                                    <FormItem label='入院病区' {...formItemAdressLabel}>
                                                        {getFieldDecorator('inWardID', {
                                                            rules: [{ required: true, message: '请选择' }],
                                                            initialValue: admInfo.admWardID ? admInfo.admWardID : patAdminInfo.wardID ? patAdminInfo.wardID : undefined,
                                                        })(
                                                            // <Input style={{ width: '99%' }}
                                                            //     allowClear={true}
                                                            //     ref={this.ward}
                                                            //     onFocus={this.onWardFocus.bind(this, "inWardID")}
                                                            //     onChange={this.handleWardSearchInput.bind(this)}
                                                            // />
                                                            <Select
                                                                disabled={this.state.admInfo.admID ? true : false}
                                                                allowClear={true}
                                                                showSearch={true}
                                                                dropdownClassName="warddropdownClassName"
                                                                placeholder="入院病区"
                                                                dropdownMatchSelectWidth={false}
                                                                filterOption={this.filterOption}
                                                                onFocus={this.onWardFocus.bind(this, "inWardID")}
                                                                onChange={this.onInWardChange}
                                                                optionLabelProp="descripts"
                                                            >
                                                                {ward}
                                                            </Select>
                                                        )}
                                                    </FormItem>
                                                </Tooltip>
                                            </Col>
                                            <Col span={3} className="mainDocDom">
                                                <FormItem label={"主诊医生"} {...formItemAdressLabel} >
                                                    {getFieldDecorator('mainDocID',
                                                        {
                                                            initialValue: admInfo.admDocID ? admInfo.admDocID : patAdminInfo.docID ? patAdminInfo.docID : undefined,
                                                        })(
                                                            <Select
                                                                disabled={this.state.admInfo.admID ? true : false}
                                                                allowClear={true}
                                                                showSearch={true}
                                                                placeholder='主诊医生'
                                                                optionFilterProp="role"
                                                                onFocus={this.onWardFocus.bind(this, "mainDocID")}
                                                            >
                                                                {doctor}
                                                            </Select>
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={3}  >
                                                <FormItem label={"门诊科室"} {...formItemAdressLabel}>
                                                    {getFieldDecorator('opLoc',
                                                        {
                                                            initialValue: patAdminInfo.opLocDesc ? patAdminInfo.opLocDesc : undefined,
                                                        })(
                                                            <Input disabled />
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={3}  >
                                                <FormItem label={"门诊医生"}{...formItemAdressLabel}>
                                                    {getFieldDecorator('opDoc',
                                                        {
                                                            initialValue: patAdminInfo.opDocName ? patAdminInfo.opDocName : undefined,
                                                        })(
                                                            <Input disabled />
                                                        )}
                                                </FormItem>
                                            </Col>
                                            <Col span={3}  >
                                                <FormItem label={"住院证编号"}{...formItemAdressLabel}>
                                                    {getFieldDecorator('opDoc',
                                                        {
                                                            initialValue: patAdminInfo.medicalNo ? patAdminInfo.medicalNo : undefined,
                                                        })(
                                                            <Input disabled />
                                                        )}
                                                </FormItem>
                                            </Col>
                                        </Row>
                                    </div>
                                </div>
                                <div className="whiteBlack diagInfo">
                                    <Row className="otherTitle">
                                        <div className="title-contnet">
                                            <Col span={22}>
                                                <img src={titleD} />
                                                <span>诊断信息</span>
                                            </Col>
                                            <Col span={2}>
                                                <Button ghost icon="plus" disabled={admInfo.admID ? true : false} style={{ color: admInfo.admID ? "#CCCCCC" : '#409EFF', border: '0px' }} onClick={this.addDiag} >添加</Button>
                                            </Col>

                                        </div>
                                    </Row>
                                    <div className="whiteBlack diagTable">
                                        <Table
                                            columns={this.columns} style={{ height: '100%' }}
                                            dataSource={this.state.dataSource}
                                            scroll={{ y: 'calc(100% - 55px)' }}
                                            bordered
                                            rowKey={(data) => {
                                                return data.index
                                            }}
                                            pagination={false}>

                                        </Table>
                                    </div>
                                </div>
                            </div>
                            <div className="whiteBlack btnArea">
                                <Row style={{ textAlign: 'right' }}>
                                    <Col style={{ padding: '2px 14px' }}>
                                        <FormItem wrapperCol={{ span: 24, offset: 18.5 }} >
                                            <Button style={{ margin: '0 5px', display: admInfo.admID ? "none" : "" }} disabled={this.state.inHospDisabled} className={this.state.inHospDisabled ? "" : "searchPatBtn"}
                                                onClick={this.handlesubmit} >
                                                入院( ctrl + s )
                                            </Button>
                                            <Button style={{ margin: '0 5px', display: admInfo.admID ? "inline-block" : "none" }} className="searchPatBtn"
                                                onClick={this.handleEditSubmit}>
                                                保存修改( F2 )
                                            </Button>
                                            <Button style={{ margin: '0 5px', display: this.state.poorFlag === true ? 'none' : '' }} className="searchPatBtn" onClick={() => {
                                                //充值
                                                this.setState({
                                                    patientAccountVisile: true,
                                                }, () => {
                                                    if (this.patAccManagementChild) {
                                                        this.patAccManagementChild.setState({
                                                            patNo: this.props.form.getFieldValue('number') ? this.props.form.getFieldValue('number') : this.state.patInfo.patNo
                                                        }, () => {
                                                            this.patAccManagementChild.searchUser()
                                                        })
                                                    }
                                                })
                                            }}>
                                                充值( F3 )
                                            </Button>
                                            <Button style={{ margin: '0 5px' }} className="searchPatBtn" onClick={this.handlePrintBedCard}>
                                                腕带打印( F4 )
                                            </Button>
                                            <Button style={{ margin: '0 5px' }} className="searchPatBtn"
                                                onClick={this.handleReset}
                                            >
                                                清空( ctrl + z )
                                            </Button>
                                            <Button style={{ margin: '0 5px' }}
                                                className="searchPatBtn"
                                                onClick={this.CancelRegister}
                                            >
                                                退院( F8 )
                                            </Button>
                                            <Button style={{ margin: '0 5px' }} className="searchPatBtn"
                                                onClick={this.onChangeINSURegisterVisable}
                                            >
                                                医保登记
                                            </Button>
                                        </FormItem>
                                    </Col>
                                </Row>
                            </div>
                        </Form>
                        <div
                            tabIndex={1}
                            onKeyDown={this.handleOnKeydown.bind(this)}
                            style={{ outline: 'none' }}
                        >
                            <ShowCommonTableModal onClickRowPublic={this.onClickRowPublic}
                                handleFocus={this.handleFocus.bind(this)}
                                setRowClassNamePublic={this.setRowClassNamePublic}
                                param={param}
                                onRef={this.onRef}
                                id="gundong"
                                search={this.state.search}
                                compilePage={this.changePageSize.bind(this)}>
                            </ShowCommonTableModal>
                        </div>
                        <div
                            tabIndex={2}
                            onKeyDown={this.handleWardOnKeydown.bind(this)}
                            style={{ outline: 'none' }}
                        >
                            <ShowCommonTableModal onClickRowPublic={this.onClickWardRowPublic}
                                handleFocus={this.handleWardFocus.bind(this)}
                                setRowClassNamePublic={this.setRowClassNamePublic}
                                param={wardParam}
                                onRef={this.onWardRef}
                                id="wardgundong"
                                search={this.state.search} >
                            </ShowCommonTableModal>
                        </div>
                        <Modal
                            className='patientAccountModal'
                            style={{
                                top: '8vh',
                                height: '90vh',
                                width: '90vw',
                            }}
                            maskClosable={false}
                            visible={this.state.patientAccountVisile}
                            title='充值'
                            onCancel={this.handleCancel}
                            footer={null}
                            width="90vw"
                        >
                            <PatientAccountManagement inDeposit={this.state.inDeposit} typeCinFlage="I"
                                onRef={this.onPatAccManagement}
                                key={this.props.form.getFieldValue('number') ? this.props.form.getFieldValue('number') : this.state.patInfo.patNo}
                                number={this.props.form.getFieldValue('number') ? this.props.form.getFieldValue('number') : this.state.patInfo.patNo}
                            ></PatientAccountManagement>
                        </Modal>
                    </div>
                </Spin>
            )
        }
    });

export default HospitalizationRegisterNewINSU;
