/*
 * Creator:     ML
 * CreatDate:
 * descripts：编辑病人信息列表
 * */
import React from 'react';
import { Form, Row, Col, Input, Select, DatePicker, Button, Modal, message, Tooltip, Table, Icon, Popconfirm, Divider, Empty } from 'antd';
import moment from 'moment';
import { $http } from '../../../containers/config/https';
import { Util } from 'tools/index';
import '.././css/error.less';

const FormItem = Form.Item;
const Option = Select.Option;
const warning = Modal.warning;
const style = {
    padding: '0 6px'
}
const adressStyle = {
    width: '13.2%',
    padding: '0',
    marginRight: '14px'
}
const provinceStyle = {
    width: '13.2%',
    padding: '0',
    marginRight: '14px'
}
const nowAdStyle = {
    width: '10.2%',
    padding: '0',
    marginRight: '14px'
}
const formItemLayoutBirthData = {
    labelCol: { span: 7 },
    wrapperCol: { span: 11 },
}
// const formItemLayoutBirthTime = {
//     labelCol: { span: 2 },
//     wrapperCol: { span: 14 },
// }
const formItemLayouNowAdress = {
    labelCol: { span: 10 },
    wrapperCol: { span: 14 },
}
// const formItemMoney = {
//     labelCol: { span: 11 },
//     wrapperCol: { span: 11 },
// }
const formItemLayouAdress = {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
}
// const formItemMoreAdress = {
//     labelCol: { span: 10 },
//     wrapperCol: { span: 23 },
// }
const formItemThreeAdress = {
    labelCol: { span: 10 },
    wrapperCol: { span: 24 },
}
// const formItemLayoutBind = {
//     labelCol: { span: 3 },
//     wrapperCol: { span: 25 },
// }
const formItemLayoutSexy = {
    labelCol: { span: 10 },
    wrapperCol: { span: 14 },
}
const formItemLayoutBirth = {
    labelCol: { span: 7 },
    wrapperCol: { span: 17 },
}
// const formItemNew = {
//     labelCol: { span: 2 },
//     wrapperCol: { span: 16 },
// }
// const formItemNewButton = {
//     labelCol: { span: 2 },
//     wrapperCol: { span: 22 },
// }
// let timer = undefined;
const confirm = Modal.confirm;
const ModificationPatientInfo = Form.create()(
    class ModificationPatientInfo extends React.Component {
        cacheOriginData = {};
        constructor(props) {
            super(props)
            var userData = JSON.parse(sessionStorage.getItem('userData'));
            var updateMessage = JSON.parse(sessionStorage.getItem('updateMessage'))
            this.state = {
                birthCity: [],//出生地市区信息
                birthAreas: [],//出生地县信息
                birthVillages: [],//出生地乡信息
                birthHamlets: [],//出生地村落信息

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

                presentCity: [],//现住址市区信息
                presentAreas: [],//现住址县信息
                presentVillages: [],//现住址乡信息
                presentHamlets: [],//现住址村落信息

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

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

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

                invoiceValue: '',
                loading: false,
                postLoading: false,//提交loading状态
                visible: false,
                baseParms: {},//下拉框信息
                parms: {},//接收查找病人传递来的信息
                patieParms: {},//接收关联病人传递来的信息

                bindDis: true,//绑卡操作按钮
                cardSatus: {},//当前录入卡
                isCancel: -1,//是否挂失
                patId: '',//病人信息id
                patientInfo: [],//病人关联信息
                visibleCardTips: false,//卡操作成功弹窗
                popCardVis: false,//卡操作 弹窗
                initpatCardID: '',//卡操作 弹窗 卡类型选择
                bindMoreInfo: false,//绑卡更多信息显示
                bindVail: true,
                canRetarCard: 'N',//注销按钮
                cardInfo: {},

                patPresentOthID: '',//修改现住址Id
                patNativeOthID: '',//修改籍贯住址Id
                patRegisterOthID: '',//修改户口住址Id
                patCompanyOthID: '',//修改单位住址Id
                patBirthOthID: '',//修改出生住址Id
                patContactOthID: '',//修改联系人住址Id

                nowAdressProvinceId: 0,//现住址省id
                bornProvinceId: 0,//出生地省id
                nativeProvinceId: 0,//籍贯省id
                houseProvinceId: 0,//户口地址省id
                workProvinceId: 0,//单位省id
                eContactProvinceId: 0,//紧急联系人

                municipals: [],//市区信息
                countys: [],//县信息
                villages: [],//乡镇信息
                hamlets: [],//村落信息
                readLoading: false,//读卡loading状态
                credSex: '1',//性别
                credBirthday: '',//出生日期
                credAge: '',//年龄
                provinceId: '',//匹配省级id
                proviceBornId: '',//匹配出生省级id
                proviceNativeId: '',//匹配籍贯省级id
                proviceHouseId: '',//匹配户口省级id
                proviceWorkId: '',//匹配工作单位省级id
                proviceContactId: '',//匹配联系人省级id
                credCountry: 44,//国家Id
                posType: '',//证件类型code
                credTypeID: '',//证件类型id
                socialTag: -1,//身份标签
                nowCost: 0,//当前卡费
                str: '',//地址标识
                nowRead: 'n',//卡类型设置是否可操作
                cardLength: '',//卡长度
                idCardCode: '',//身份证code
                idCardCodePop: '',//弹窗身份证code
                nowReadCard: 'n',//卡类型设置是否可操作 --卡操作
                nowReadCardPop: 'n',//卡类型设置是否可操作 -- 弹窗
                cardLengthCard: '',//卡长度 ---卡长度
                replenishZero: '',//是否补0
                nowCard: '',//当前卡类型
                nowInv: '',//是否显示发票
                initCardDr: '',//默认卡类型
                isModefined: 1,//是否点击修改基本资料
                patiId: '',//病人id
                reciprocal: 2,//2S后关闭弹窗
                visibles: false,//是否弹取消补卡
                cardId: '',//记录头卡id
                isFlag: '',//卡操作
                originalNo: '',//卡操作---原卡号
                localProvince: [],//存第一次请求的loca 省
                localCity: [],//存第一次请求的loca 市
                localArea: [],//存第一次请求的loca 县
                selfCredNo: '',//修改前的身份证号
                bindCardArr: [],//已绑卡类型
                allDis: false,//全部锁定建卡类型
                cardNoVisible: false,//建卡卡号错误提示 - title框显示
                cardNoMessage: '',//建卡卡号错误提示 - 文字信息
                posVisible: false,//身份证号码错误提示 - title框显示
                posMessage: '',//身份证号码错误提示 - 文字信息
                patNameVisible: false,//病人姓名错误提示 - title框显示
                patNameMessage: '',//病人姓名错误提示 - 文字信息
                econNameVisible: false,//联系人姓名错误提示 - title框显示
                econNameMessage: '',//联系人姓名错误提示 - 文字信息
                econRelationMessage: '',//联系人关系错误提示 - 文字信息
                econRelationVisible: false,//联系人关系错误提示 - title框显示
                patBirthVisible: false,//病人出生日期错误提示 - title框显示
                patBirthMessage: '',//病人出生日期错误提示 - 文字信息
                patTypeVisible: false,//病人类型错误提示 - 文字信息
                patTypeMessage: '',//病人类型错误提示 - 文字信息
                patAdressVisible: false,//详细地址错误提示 - 文字信息
                patAdressMessage: '',//详细地址错误提示 - 文字信息
                patAdressMessageZip: '',//详细地址邮编错误提示 - 文字信息
                patAdressZipVisible: false,
                patAdressHouseMessageZip: '',//详细地址户口邮编错误提示 - 文字信息
                patAdressHouseZipVisible: false,
                patAdressComMessageZip: '',//详细地址单位邮编错误提示 - 文字信息
                patAdressComZipVisible: false,

                cardPayMentID: '',//当前操作注销的卡
                econPhoneVisible: false,
                econPhoneMessage: '',

                changeCardVisible: false,//换卡操作错误提示
                changeCardMessage: '',//换卡操作错误文字提示
                patchCardVisible: false,//补卡操作错误提示
                patchCardMessage: '',//补卡操作错误文字提示
                bindCardVisible: false,//绑卡操作错误提示
                bindCardMessage: '',//绑卡操作错误文字提示
                canSave: false,
                credWarning: false,
                formatType: true,//日期手动录入
                noCard: true,//绑卡显示
                repariFeeFlag: 'N',//费用置为0或空
                repariFeeFlagCard: 'N',//卡操作 费用置为0或空
                nowCostCard: 0,
                readInfoLoading: false,//无卡时loading信息

                credMustFlag: 'N',//挂号配置设置目前医院是否必填证件类型和证件号码

                noSend: true,//优化 回车后失去焦点二次请求
                findPatNo: '',//记录上一条查找病人
                birthData: '',
                birthTime: '',
                isTransitionStart: false,
                openTime: false,
                modifVisible: false,
                tableData: [],
                editable: false,
                isAdd: false,
                abs: true,
                userData: userData,
                updateMessage: updateMessage,
                copyVisible: false,
                fromAddress: '',
                toAddress: undefined, // 地址复制到
                toAddressSelectData: [{
                    id: 'birth',
                    descripts: '出生地址',
                    descriptsSPCode: 'csdz'
                }, {
                    id: 'native',
                    descripts: '籍贯',
                    descriptsSPCode: 'jg'
                }, {
                    id: 'present',
                    descripts: '现住址',
                    descriptsSPCode: 'xzz'
                }, {
                    id: 'register',
                    descripts: '户口地址',
                    descriptsSPCode: 'hkdz'
                }, {
                    id: 'company',
                    descripts: '单位地址',
                    descriptsSPCode: 'dwdz'
                }, {
                    id: 'contact',
                    descripts: '联系人地址',
                    descriptsSPCode: 'lxrdz'
                }]
            }
            this.readOneButton = React.createRef();

            this.cardNo = React.createRef();
            this.patName = React.createRef();
            this.sex = React.createRef();
            this.credType = React.createRef();
            this.patCredNo = React.createRef();
            this.patBirthDate = React.createRef();
            this.patMobile = React.createRef();
            this.patType = React.createRef();
            this.nation = React.createRef();
            this.patMaritalID = React.createRef();
            this.patAddress = React.createRef();
            this.cardPayMethodID = React.createRef();
            this.creadCard = React.createRef();

            this.province = React.createRef();
            this.city = React.createRef();
            this.country = React.createRef();
            this.village = React.createRef();
            this.hamlet = React.createRef();

            this.bornProvince = React.createRef();
            this.birthCity = React.createRef();
            this.bornCountry = React.createRef();
            this.bornVillage = React.createRef();
            this.bornHamlet = React.createRef();
            this.birthAddress = React.createRef();

            this.nativeProvince = React.createRef();
            this.nativeCity = React.createRef();
            this.nativeCountry = React.createRef();
            this.nativeVillage = React.createRef();
            this.nativeHamlet = React.createRef();
            this.nativeAddress = React.createRef();

            this.houseProvince = React.createRef();
            this.houseCity = React.createRef();
            this.houseCountry = React.createRef();
            this.houseVillage = React.createRef();
            this.houseHamlet = React.createRef();
            this.houseAddress = React.createRef();
            this.registerZIP = React.createRef();

            this.companyProvince = React.createRef();
            this.companyCity = React.createRef();
            this.companyCountry = React.createRef();
            this.companyVillage = React.createRef();
            this.companyHamlet = React.createRef();
            this.companyAddress = React.createRef();
            this.companyZIP = React.createRef();

            this.patSocialStatusID = React.createRef();
            this.patSourceID = React.createRef();
            this.econProvince = React.createRef();
            this.econCity = React.createRef();
            this.econCountry = React.createRef();
            this.econVillage = React.createRef();
            this.econHamlet = React.createRef();
            this.contactsAddress = React.createRef();

            this.econName = React.createRef();
            this.econMobile = React.createRef();
            this.econRelation = React.createRef();

            this.patCompany = React.createRef();
            this.patCompanyTel = React.createRef();

            this.changeCard = React.createRef();
            this.patchCard = React.createRef();
            this.creadCardPop = React.createRef();
            this.creadCardPops = React.createRef();
            this.bindNewCard = React.createRef();
            this.bindCardNu = React.createRef();
            this.bindCardButton = React.createRef();

            this.companyZIP = React.createRef();
            this.registerZIP = React.createRef();
            this.presentZIP = React.createRef();

            this.changeOkButton = React.createRef();
            this.patchOkButton = React.createRef();
            this.bindOkButton = React.createRef();
        }

        componentDidMount() {
            this.props.OnChildref && this.props.OnChildref(this);
            var updateMessage = JSON.parse(sessionStorage.getItem('updateMessage'));
            console.log('updateMessage', updateMessage)
            this.getPatForm()
            let self = this
            document.addEventListener('keydown', function (e) {
                self.KeyDowns(e)
            })
            let data = {}
            data = {
                params: [{
                    cardTypeFlag: 1,//卡类型
                    credTypeFlag: 1,//证件类型
                    patTypeFlag: 1,//病人类型
                    sexFlag: 1,	//性别
                    countryFlag: 1,	//国家
                    nationFlag: 1,//民族
                    occupationFlag: 1,//职业
                    maritalFlag: 1,	//婚姻
                    socialStatusFlag: 1,//身份标签
                    ageUnitFlag: '',
                    payMethodFlag: 1,
                    eduFlag: '1',
                    provinceFlag: localStorage.getItem('province') != null ? '' : 1,	//省
                    cityFlag: localStorage.getItem('city') != null ? '' : 1,  //市
                    // areaFlag: localStorage.getItem('area') != null ? '' : 1,//县
                    relationFlag: 1,
                }]
            }
            $http.post('urlS', this, {
                code: '03030005',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            baseParms: res,
                            invoiceValue: res.transactionNo,
                        }, () => {
                            if (!Util.isEmpty(updateMessage)) {
                                this.loadData(updateMessage)
                            } else if (this.props.modal === '1') { // 科室菜单弹窗
                                this.setState({ modifVisible: true })
                            }
                        })
                        res.cardType.map((item, i) => {
                            if (item.defaultFlag == 'Y') {
                                this.setState({
                                    initCardDr: item.id,
                                    nowRead: item.readMode,
                                    idCardCode: item.code,
                                    cardLength: item.cardLength && item.cardLength != '' ? item.cardLength + '位,' : '',
                                    cardLengthInput: item.cardLength,
                                    replenishZero: item.replenishZero,
                                    repariFeeFlag: item.repariFeeFlag,
                                    nowCost: item.cardCost,
                                    nowInv: item.invFlag,
                                })
                            }
                            if (res.cardType[i].defaultFlag == 'N') {
                                this.setState({
                                    initCardDr: res.cardType[0].id,
                                    nowRead: res.cardType[0].readMode,
                                    idCardCode: res.cardType[0].code,
                                    cardLength: res.cardType[0].cardLength && res.cardType[0].cardLength != '' ? res.cardType[0].cardLength + '位,' : '',
                                    cardLengthInput: res.cardType[0].cardLength,
                                    replenishZero: res.cardType[0].replenishZero,
                                    repariFeeFlag: res.cardType[0].repariFeeFlag,
                                    nowCost: res.cardType[0].cardCost,
                                    nowInv: res.cardType[0].invFlag,

                                })
                            }
                        })
                        this.props.form.setFieldsValue({
                            cardPayMethodID: res.payMethod && res.payMethod.length > 0 ? res.payMethod[0].id : undefined,
                            payMethods: res.payMethod && res.payMethod.length > 0 ? res.payMethod[0].id : undefined
                        })
                        if (JSON.parse(localStorage.getItem('province')) && JSON.parse(localStorage.getItem('province')).length > 0) {
                            this.setState({
                                localProvince: JSON.parse(localStorage.getItem('province'))
                            })
                        } else {
                            localStorage.setItem('province', JSON.stringify(res.province))
                            this.setState({
                                localProvince: res.province
                            })
                        } if (JSON.parse(localStorage.getItem('city')) && JSON.parse(localStorage.getItem('city')).length > 0) {
                            this.setState({
                                localCity: JSON.parse(localStorage.getItem('city'))
                            })
                        } else {
                            localStorage.setItem('city', JSON.stringify(res.city))
                            this.setState({
                                localCity: res.city
                            })
                        }
                    } else {

                    }
                }
            })
        }

        componentWillUnmount() {
          this.setState = (state, callback) => { return; }
        }

        loadData(updateMessage) {
            const { baseParms } = this.state
            var patientData = JSON.parse(sessionStorage.getItem('patientData'));
            baseParms.credType.map((items, index) => {
                items.disabled = false
            })
            let data = {}
            data = {
                params: [{
                    patID: (updateMessage && updateMessage.patID) ? updateMessage.patID : (patientData ? patientData.patID : ''),
                }]
            }
            this.handleVail();
            this.props.form.resetFields();
            $http.post('urlS', this, {
                code: '03050277',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            parms: []
                        }, () => {
                            this.setState({
                                parms: res.result,
                                patiId: res.result.patID,
                                socialTag: res.result.patSocialStatusID,
                                posType: res.result.patCredTypeCode,
                                credTypeID: res.result.patCredTypeID,
                                modifVisible: true,

                            })
                            this.getCred(res.result.patID)
                        })
                    }
                }
            })
        }

        showModifDom = (record) => {
            const { baseParms } = this.state
            let data = {}
            data = {
                params: [{
                    hospID: record && record ? record.regHospID : '',
                }]
            }
            $http.post('urlS', this, {
                code: '03030005',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            credMustFlag: res.credMustFlag,
                        })
                    }
                }
            })
            baseParms.credType.map((items, index) => {
                items.disabled = false

            })
            this.handleVail();
            this.props.form.resetFields();
            this.setState({
                parms: []
            }, () => {
                this.setState({
                    updateMessage: record,
                    parms: record,
                    patiId: record.patID,
                    socialTag: record.patSocialStatusID,
                    posType: record.patCredTypeCode,
                    credTypeID: record.patCredTypeID,
                    modifVisible: true,

                })
                this.getCred(record.patID)
            })
        }

        //获取病人证件
        getCred = (patID) => {
            this.setState({
                patid: patID
            })
            let data = {
                params: [{
                    patID,
                }],
            }
            $http.post('urlS', this, {
                code: '03030016',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            tableData: res.result.Data
                        })
                    }
                }
            })

        }

        //添加病人其他证件类型
        addCards = () => {
            const { tableData, patiId } = this.state
            // console.log('tableData',this.state.tableData)
            let bs = true
            let find = true;
            for (var i = 0; i < tableData.length; i++) {
                tableData[i].patID = patiId
                tableData[i].updateUserID = sessionStorage.userData ? JSON.parse(sessionStorage.userData).userID : ''
                if (tableData[i].key && tableData[i].key) {
                    tableData[i].credID = ''
                } if (tableData[i].id == this.props.form.getFieldValue('patCredTypeCode')) {
                    message.warning(tableData[i].credTypeDesc + '已存在')
                    bs = false
                    this.setState({
                        abs: false
                    })
                }
                for (var j = i + 1; j < tableData.length; j++) {
                    if (find) {
                        if (tableData[i].credTypeID == tableData[j].credTypeID && tableData[i].credTypeDesc == tableData[j].credTypeDesc) {
                            find = false;
                            bs = false;
                            this.setState({
                                abs: false
                            })
                            message.warning(tableData[i].credTypeDesc + '已添加')
                        }
                    }
                }
            }
            if (bs) {
                let data = {
                    params: tableData,
                }
                $http.post('urlS', this, {
                    code: '03030017',
                    data: data,
                    success: function (res) {
                        if (+res.errorCode === 0) {
                            this.setState({
                                abs: true
                            })
                            this.getCred(this.state.patiId)
                        } else {
                        }
                    }
                })
            }
        }

        //删除证件类型
        delect = (credID) => {
            let data = {
                params: [{
                    credID,
                    updateUserID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).userID : ''
                }],
            }
            $http.post('urlS', this, {
                code: '03030018',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        message.success('删除成功')
                        this.getCred(this.state.patid)
                    } else {

                    }
                }
            })
        }

        //删除 卡类型新增行
        cut = (e, key) => {
            // e.stopPropagation();
            // e.nativeEvent.stopImmediatePropagation();
            // e.preventDefault();
            const { tableData } = this.state;
            const newData = tableData.filter(item => item.credID !== key);
            let bs = false
            newData.map((item, i) => {
                if (item.key && item.editable && item.editable == true) {
                    bs = true
                    this.setState({
                        canSaveStatus: false,
                        disAdd: false,
                        tableData: newData,
                    })
                    return
                }
            })
            if (!bs) {
                this.setState({ tableData: newData, disAdd: false, canSaveStatus: true, });
            }
        }

        range(start, end) {
            const result = [];
            for (let i = start; i < end; i++) {
                result.push(i);
            }
            return result;
        }

        //秒禁止
        disabledDateTime = () => {
            let that = this
            return {
                disabledSeconds: () => that.range(1, 60),
            };
        }

        //选择证件类型
        handleCerdType = (data) => {
            setTimeout(() => {
                this.patCredNo.current.focus();
            }, 300)
            this.setState({
                posType: data
            })
        }

        //清空证件类型 卡号不必填
        handleCredNo = (code) => {
            if (!code) {
                this.setState({
                    posType: '',
                    credTypeID: ''
                })
            } else {
                this.setState({
                    posType: code
                })
            }
        }

        //病人姓名
        patNameTip = (num) => {
            this.props.form.validateFields(['patName',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        patNameVisible: false
                    })
                    if (num != 2) {
                        if (this.props.form.getFieldValue('patCredTypeCode') && this.props.form.getFieldValue('patCredTypeCode') == '01') {
                            setTimeout(() => {
                                this.patCredNo.current.focus();
                            }, 300)
                        } else {
                            setTimeout(() => {
                                this.sex.current.focus()
                            }, 300)
                        }
                    }
                } else {
                    this.setState({
                        patNameVisible: true,
                        patNameMessage: errors.patName.errors[0].message,
                    })
                }
            });
        }

        //联系人姓名
        econNameTip = (num) => {
            this.props.form.validateFields(['patEContact',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        econNameVisible: false
                    })
                    if (num != 2) {
                        setTimeout(() => {
                            this.econRelation.current.focus();
                        }, 300)
                    }
                } else {
                    this.setState({
                        econNameVisible: true,
                        econNameMessage: errors.patEContact.errors[0].message,
                    })
                }
            });
        }

        //联系人关系
        econRelationTip = (num) => {
            this.props.form.validateFields(['patERelationID',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        econRelationVisible: false
                    })
                    if (num != 2) {
                        setTimeout(() => {
                            this.econMobile.current.focus();
                        }, 300)
                    }
                } else {
                    this.setState({
                        econRelationVisible: true,
                        econRelationMessage: errors.patERelationID.errors[0].message,
                    })
                    setTimeout(() => {
                        this.setState({
                            econRelationVisible: false
                        })
                    }, 1500)
                }
            });
        }

        //病人出生日期
        patBirthTip = () => {
            this.props.form.validateFields(['patBirthDate',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        patBirthVisible: false
                    })
                    if (this.props.form.getFieldValue('patBirthDate')) {
                        setTimeout(() => {
                            this.patMobile.current.focus();
                        }, 300)
                    }
                } else {
                    this.setState({
                        patBirthVisible: true,
                        patBirthMessage: errors.patBirthDate.errors[0].message,
                    })
                }
            });
        }

        //证件号
        posTip = (data, num) => {
            this.props.form.validateFields(['patCredNo',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        posVisible: false
                    })
                    if (this.props.form.getFieldValue('patCredTypeCode') == '01') {
                        if (this.props.form.getFieldValue('patCredNo').length == 18 && this.state.credWarning == false) {
                            this.setState({
                                credBirthday: this.getBirthday(data),
                                birthData: this.getBirthday(data),
                                credAge: this.getAge(data),
                            })
                            this.props.form.setFieldsValue({ patSexCode: this.getSex(data), patBirthDate: moment(this.getBirthday(data)) });
                            this.handleInmations(data)
                            if (num != 2) {
                                setTimeout(() => {
                                    this.sex.current.focus();
                                }, 300)
                            }
                        }
                    } else {

                    }
                } else {
                    this.setState({
                        posVisible: true,
                        posMessage: errors.patCredNo.errors[0].message,
                    })
                }
            });
        }

        //病人手机号码
        patMobileTip = (num) => {
            this.props.form.validateFields(['patMobile',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        patMobileVisible: false
                    })
                    if (num != 2) {
                        if (this.props.form.getFieldValue('patMobile')) {
                            setTimeout(() => {
                                this.patType.current.focus();
                            }, 300)
                        }
                    }
                } else {
                    this.setState({
                        patMobileVisible: true,
                        patMobileMessage: errors.patMobile.errors[0].message,
                    })
                }
            });
        }

        //病人类型
        patTypeTip = (num) => {
            this.props.form.validateFields(['patTypeID',], (errors, values) => {
                const { credAge, parms } = this.state
                if (!errors) {
                    this.setState({
                        patTypeVisible: false
                    })
                    if (num != 2) {
                        if (parseInt(credAge) < 14 || parseInt(parms.patAge) < 14 || credAge && credAge.indexOf('天') != -1 || parms.patAge && parms.patAge.indexOf('天') != -1) {
                            setTimeout(() => {
                                this.econName.current.focus();
                            }, 300)
                        } else {
                            setTimeout(() => {
                                this.patSourceID.current.focus();
                            }, 600)
                        }
                    }
                } else {
                    this.setState({
                        patTypeVisible: true,
                        patTypeMessage: errors.patTypeID.errors[0].message,
                    })
                    setTimeout(() => {
                        this.setState({
                            patTypeVisible: false
                        })
                    }, 1500)
                }
            });
        }

        //详细地址
        // patAdressTip = (num) => {
        //     const { repariFeeFlag, nowCost, isModefined, isFlag, noCard, parms, credAge } = this.state
        //     this.props.form.validateFields(['presentAddressDesc',], (errors, values) => {
        //         if (!errors) {
        //             this.setState({
        //                 patAdressVisible: false
        //             })
        //             if (num != 2) {
        //                 if (this.props.form.getFieldValue('presentAddressDesc')) {
        //                     if (parseInt(credAge) < 14 || parseInt(parms.patAge) < 14 || credAge && credAge.indexOf('天') != -1 || parms.patAge && parms.patAge.indexOf('天') != -1) {
        //                         this.econName.current.focus();
        //                     } else {
        //                         setTimeout(() => {
        //                             this.creadCard.current.buttonNode.focus();
        //                         }, 300)
        //                     }
        //                 }
        //             }
        //         } else {
        //             this.setState({
        //                 patAdressVisible: true,
        //                 patAdressMessage: errors.presentAddressDesc.errors[0].message,
        //             })
        //         }
        //     });
        // }

        //详细地址单位邮编
        patAdressComZipTip = (num) => {
            // const { repariFeeFlag, nowCost, isModefined, isFlag, noCard } = this.state
            this.props.form.validateFields(['companyZIP',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        patAdressComZipVisible: false
                    })
                    if (num != 2) {

                    }
                } else {
                    this.setState({
                        patAdressComZipVisible: true,
                        patAdressComMessageZip: errors.companyZIP.errors[0].message,
                    })
                }
            });
        }

        //详细地址户口邮编
        patAdressHouseZipTip = (num) => {
            // const { repariFeeFlag, nowCost, isModefined, isFlag, noCard } = this.state
            this.props.form.validateFields(['registerZIP',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        patAdressHouseZipVisible: false
                    })
                    if (num != 2) {

                    }
                } else {
                    this.setState({
                        patAdressHouseZipVisible: true,
                        patAdressHouseMessageZip: errors.registerZIP.errors[0].message,
                    })
                }
            });
        }

        //详细地址邮编
        patAdressZipTip = (num) => {
            // const { repariFeeFlag, nowCost, isModefined, isFlag, noCard } = this.state
            this.props.form.validateFields(['presentZIP',], (errors, values) => {
                if (errors == undefined) {
                    return
                }
                if (!errors) {
                    this.setState({
                        patAdressZipVisible: false
                    })
                    if (num != 2) {
                        // if (this.props.form.getFieldValue('presentZIP')) {
                        //     if(repariFeeFlag=='Y'||nowCost == 0 || isModefined == 1 || isFlag == 3 ||!noCard){
                        //         setTimeout(() => {
                        //             this.creadCard.current.buttonNode.focus();
                        //         }, 300)
                        //     }else{
                        //         setTimeout(() => {
                        //             this.cardPayMethodID.current.focus();
                        //         }, 600)
                        //     }

                        // }
                    }
                } else {
                    this.setState({
                        patAdressZipVisible: true,
                        patAdressMessageZip: errors.presentZIP.errors[0].message,
                    })
                }
            });
        }

        //联系人手机
        econPhoneTip = () => {
            let { credAge, parms } = this.state
            this.props.form.validateFields(['patEContactMobile',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        econPhoneVisible: false
                    })

                    if (parseInt(credAge) < 14 || parseInt(parms.patAge) < 14 || credAge && credAge.indexOf('天') != -1 || parms.patAge && parms.patAge.indexOf('天') != -1) {
                        setTimeout(() => {
                            this.creadCard.current.buttonNode.focus();
                        }, 300)
                    }
                    else {
                        setTimeout(() => {
                            this.patCompany.current.focus();
                        }, 300)
                    }
                } else {
                    this.setState({
                        econPhoneVisible: true,
                        econPhoneMessage: errors.patEContactMobile.errors[0].message,
                    })
                }
            });
        }

        //失去焦点 patName
        patBlur = () => {
            this.patNameTip(2)
        }

        //失去焦点 patName
        patEconNameBlur = () => {
            this.econNameTip(2)
        }

        //失去焦点 patMobile
        patMobileBlur = () => {
            this.patMobileTip(2)
        }

        //失去焦点 patTypeId
        patTypeBlur = () => {
            this.patTypeTip(2)
        }

        //失去焦点 payMethods
        // patAdressBlur = () => {
        //     this.patAdressTip(2)
        // }
        //身份证点击获取焦点
        fouceCredNo = () => {
            setTimeout(() => {
                this.patCredNo.current.focus();
            }, 300)
        }

        // 失去焦点--日期
        onChangeTimeBlur = () => {
            this.setState({
                formatType: true
            });
        }

        checkPatMobile = () => {
            this.econPhoneTip()
        }

        //必填项错误提示显示时 框内内容变化 隐藏
        visibleTip = (num) => {
            switch (num) {
                case 1:
                    this.setState({
                        cardNoVisible: false
                    })
                    break;
                case 2:
                    this.setState({
                        patNameVisible: false
                    })
                    break;
                case 3:
                    this.setState({
                        posVisible: false
                    })
                    break;
                case 4:
                    this.setState({
                        patMobileVisible: false
                    })
                    break;
                case 5:
                    this.setState({
                        patAdressVisible: false
                    })
                    break;
                case 6:
                    this.setState({
                        changeCardVisible: false
                    })
                    break;
                case 8:
                    this.setState({
                        bindCardVisible: false
                    })
                    break;
                case 9:
                    this.setState({
                        patTypeVisible: false
                    })
                    break;
                case 10:
                    this.setState({
                        patBirthVisible: false,
                        formatType: false
                    })
                    break;
                case 11:
                    this.setState({
                        econPhoneVisible: false,
                    })
                case 12:
                    this.setState({
                        econNameVisible: false,
                    })
                    break;
                case 13:
                    this.setState({
                        patAdressZipVisible: false,
                    })
                    break;
                case 14:
                    this.setState({
                        patAdressHouseZipVisible: false,
                    })
                    break;
                case 15:
                    this.setState({
                        patAdressComZipVisible: false,
                    })
                    break;
                default:

            }
        }

        //下拉框无数据时 跳到下一个必填项
        checkOption = (num) => {
            switch (num) {
                case 1:
                    setTimeout(() => {
                        if (this.state.bornhamlets.length == 0) {
                            this.patAddress.current.focus();
                        }
                    }, 600)
                    break;
                case 2:
                    setTimeout(() => {
                        if (this.state.nativehamlets.length == 0) {
                            this.patAddress.current.focus();
                        }
                    }, 600)
                    break;
                case 3:
                    setTimeout(() => {
                        if (this.state.hamlets.length == 0) {
                            this.patAddress.current.focus();
                        }
                    }, 600)
                    break;
                case 4:
                    setTimeout(() => {
                        if (this.state.househamlets.length == 0) {
                            this.cardPayMethodID.current.focus();
                        }
                    }, 600)
                    break;
                case 5:
                    setTimeout(() => {
                        if (this.state.eContacthamlets.length == 0) {
                            this.cardPayMethodID.current.focus();
                        }
                    }, 600)
                    break;
                case 6:
                    setTimeout(() => {
                        if (this.state.workhamlets.length == 0) {
                            this.cardPayMethodID.current.focus();
                        }
                    }, 600)
                    break;
                default:

            }
        }

        //失去焦点 patCard
        patCardBlur = () => {
            this.cardTip(1)
        }

        autoNextFocus = (open, num, filName) => {
            if (!open && num == 7) {
                this.handleKeydownM(num)
                return
            }
            if (!open && this.props.form.getFieldValue(filName)) {
                this.handleKeydownM(num)
            }
        }

        checkPatSource = () => {
            this.sourceTip(2)
        }

        //回车调到下一个必填项 卡号--->姓名
        handleKeydownM = (num, id) => {
            switch (num) {
                case 1:
                    break;
                case 2:
                    this.patNameTip()
                    break;
                case 3:
                    setTimeout(() => {
                        this.patBirthDate.current.focus();
                    }, 300)
                    break;
                case 4:
                    this.setState({
                        credTypeID: id
                    })
                    if (this.props.form.getFieldValue('patCredTypeCode') == '01') {
                        setTimeout(() => {
                            this.patCredNo.current.focus();
                        }, 300)
                    } else {
                        setTimeout(() => {
                            this.sex.current.focus()
                        }, 300)
                    }
                    break;
                case 5:
                    this.posTip()
                    break;
                case 6:
                    this.patMobileTip()
                    break;
                case 7:
                    this.patTypeTip()
                    break;
                case 8:
                    if (this.props.form.getFieldValue('patNationID')) {
                        setTimeout(() => {
                            this.patAddress.current.focus();
                        }, 300)
                    }
                    break;
                // case 9:
                //     this.patAdressTip()
                //     break;
                case 10:
                    if (this.state.nowCost != 0 && this.props.form.getFieldValue('cardPayMethodID')) {
                        setTimeout(() => {
                            this.creadCard.current.buttonNode.focus();
                        }, 300)
                    }
                    break;
                case 11:
                    this.econNameTip()
                    break;
                case 12:
                    this.econPhoneTip()
                    break;
                case 13:
                    setTimeout(() => {
                        this.econMobile.current.focus();
                    }, 300)
                    break;
                case 14:
                    setTimeout(() => {
                        this.econHamlet.current.focus()
                    }, 300)
                    break;
                case 14.1:
                    setTimeout(() => {
                        this.contactsAddress.current.focus()
                    }, 300)
                    break;
                case 14.2:
                    setTimeout(() => {
                        this.cardPayMethodID.current.focus()
                    }, 300)
                    break;
                case 15:
                    if (this.props.form.getFieldValue('patCompany')) {
                        setTimeout(() => {
                            this.patCompanyTel.current.focus();
                        }, 300)
                    }
                    break;
                case 16:
                    if (this.props.form.getFieldValue('patCompanyTel')) {
                        setTimeout(() => {
                            this.patSocialStatusID.current.focus();
                        }, 300)
                    }
                    break;
                case 17:
                    setTimeout(() => {
                        this.companyAddress.current.focus();
                    }, 300)
                    break;
                case 18:
                    if (this.props.form.getFieldValue('companyAddress')) {
                        setTimeout(() => {
                            this.companyZIP.current.focus();
                        }, 300)
                    }
                    break;
                case 19:
                    this.patAdressComZipTip()
                    break;
                // case 20:
                //     setTimeout(() => {
                //         this.patAddress.current.focus();
                //     }, 300)
                //     break;
                // case 21:
                //     setTimeout(() => {
                //         this.patAddress.current.focus();
                //     }, 300)
                //     break;
                case 22:
                    setTimeout(() => {
                        this.birthAddress.current.focus();
                    }, 300)
                    break;
                case 23:
                    setTimeout(() => {
                        this.patAddress.current.focus();
                    }, 300)
                    break;
                case 24:
                    setTimeout(() => {
                        this.nativeAddress.current.focus();
                    }, 300)
                    break;
                case 25:
                    setTimeout(() => {
                        this.patAddress.current.focus();
                    }, 300)
                    break;
                case 26:
                    setTimeout(() => {
                        this.patAddress.current.focus();
                    }, 300)
                    break;
                case 27://现住址邮编
                    this.patAdressZipTip()
                    break;
                case 28:
                    setTimeout(() => {
                        this.houseAddress.current.focus();
                    }, 300)
                    break;
                case 29:
                    if (this.props.form.getFieldValue('houseAddress')) {
                        setTimeout(() => {
                            this.registerZIP.current.focus();
                        }, 300)
                    }
                    break;
                case 30:
                    this.patAdressHouseZipTip()
                    break;
                case 31:
                    setTimeout(() => {
                        this.sourceTip()
                    }, 100)
                    break;
                case 1.1:
                    setTimeout(() => {
                        this.patSourceID.current.focus();
                    }, 300)
                    break;
                default:
                    setTimeout(() => {
                        this.creadCard.current.buttonNode.focus();
                    }, 300)
            }
        }

        //选择身份标签
        handleposTag = (data) => {
            this.setState({
                socialTag: data
            })

        }

        //输入身份证号码 自动获取到出生日期 年龄
        validCard = (e, num) => {
            if (this.props.form.getFieldValue('patCredNo') && this.props.form.getFieldValue('patCredNo').length > 0 && this.props.form.getFieldValue('patCredTypeCode') == '01') {
                this.posTip(e.target.value, num)
                return
            }
            if (this.props.form.getFieldValue('patCredTypeCode') != '01' && this.props.form.getFieldValue('patCredNo') && this.props.form.getFieldValue('patCredNo').length > 0) {
                setTimeout(() => {
                    this.sex.current.focus();
                }, 300)
            }
        }

        //选择乡时加载村数据
        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']: [],
                        })
                    }
                }
            })

        }

        //选择或清除省
        onProvinceChange(flag, value, option) {
            if (value) {
                let city = []
                city = this.state.localCity.filter((item) => item.province == value);
                let patInfo = this.state.parms;
                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;
                }
                switch (flag) {
                    case 'birth':
                        setTimeout(() => {
                            this.birthCity.current.focus();
                        }, 300)
                        break;
                    case 'native':
                        setTimeout(() => {
                            this.nativeCity.current.focus();
                        }, 300)
                        break;
                    case 'present':
                        setTimeout(() => {
                            this.city.current.focus();
                        }, 300)
                        break;
                    case 'register':
                        setTimeout(() => {
                            this.houseCity.current.focus();
                        }, 300)
                        break;
                    case 'company':
                        setTimeout(() => {
                            this.companyCity.current.focus();
                        }, 300)
                        break;
                    case 'contact':
                        setTimeout(() => {
                            this.econCity.current.focus();
                        }, 300)
                        break;
                }
                this.setState({
                    [flag + 'City']: city,
                    [flag + 'Areas']: [],
                    [flag + 'Villages']: [],
                    [flag + 'Hamlets']: [],
                    parms: patInfo,
                })
            } else {
                //清除省
                this.props.form.setFieldsValue({
                    [flag + 'CityID']: undefined,
                    [flag + 'AreaID']: undefined,
                    [flag + 'VillageID']: undefined,
                    [flag + 'HamletID']: undefined
                });
                let patInfo = this.state.parms;
                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']: [],
                    parms: 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.localCity.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
                });
                switch (flag) {
                    case 'birth':
                        setTimeout(() => {
                            this.bornCountry.current.focus();
                        }, 300)
                        break;
                    case 'native':
                        setTimeout(() => {
                            this.nativeCountry.current.focus();
                        }, 300)
                        break;
                    case 'present':
                        setTimeout(() => {
                            this.country.current.focus();
                        }, 300)
                        break;
                    case 'register':
                        setTimeout(() => {
                            this.houseCountry.current.focus();
                        }, 300)
                        break;
                    case 'company':
                        setTimeout(() => {
                            this.companyCountry.current.focus();
                        }, 300)
                        break;
                    case 'contact':
                        setTimeout(() => {
                            this.econCountry.current.focus();
                        }, 300)
                        break;
                }
                let patInfo = this.state.parms;
                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({
                    parms: patInfo,
                })
                this.getAreas(value, flag, '1');
            } else {
                //清除市
                this.props.form.setFieldsValue({
                    [flag + 'CityID']: undefined,
                    [flag + 'AreaID']: undefined,
                    [flag + 'VillageID']: undefined,
                    [flag + 'HamletID']: undefined
                });
                let patInfo = this.state.parms;
                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']: [],
                    parms: 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
                });
                this.getVillages(value, flag, '1');
                // this.autoFocusVillage(flag)
                switch (flag) {
                    case 'birth':
                        setTimeout(() => {
                            this.bornVillage.current.focus();
                        }, 300)
                        break;
                    case 'native':
                        setTimeout(() => {
                            this.nativeVillage.current.focus();
                        }, 300)
                        break;
                    case 'present':
                        setTimeout(() => {
                            this.village.current.focus();
                        }, 300)
                        break;
                    case 'register':
                        setTimeout(() => {
                            this.houseVillage.current.focus()
                        }, 300)
                        break;
                    case 'company':
                        setTimeout(() => {
                            this.companyVillage.current.focus()
                        }, 300)
                        break;
                    case 'contact':
                        setTimeout(() => {
                            this.econVillage.current.focus()
                        }, 300)
                        break;
                }
            } else {
                //清除市
                this.props.form.setFieldsValue({
                    [flag + 'VillageID']: undefined,
                    [flag + 'HamletID']: undefined
                });
                let patInfo = this.state.parms;
                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']: [],
                    parms: 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');
            }
        }

        //选择或清除乡
        onVillageChange(flag, value, option) {
            if (value) {
                this.props.form.setFieldsValue({
                    [flag + 'HamletID']: undefined
                });
                this.getHamlets(value, flag);
                switch (flag) {
                    case 'birth':
                        setTimeout(() => {
                            this.bornHamlet.current.focus()
                        }, 300)
                        break;
                    case 'native':
                        setTimeout(() => {
                            this.nativeHamlet.current.focus()
                        }, 300)
                        break;
                    case 'present':
                        setTimeout(() => {
                            this.hamlet.current.focus()
                        }, 300)
                        break;
                    case 'register':
                        setTimeout(() => {
                            this.houseHamlet.current.focus()
                        }, 300)
                        break;
                    case 'company':
                        setTimeout(() => {
                            this.companyHamlet.current.focus()
                        }, 300)
                        break;
                    case 'contact':
                        setTimeout(() => {
                            this.econHamlet.current.focus()
                        }, 300)
                        break;
                }
            } else {
                //清除市
                this.props.form.setFieldsValue({
                    [flag + 'HamletID']: undefined
                });
                let patInfo = this.state.parms;
                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']: [],
                    parms: patInfo,
                })
            }
        }

        //选择县 去到乡
        autoFocusVillage = (flag, zipCode) => {
            console.log('flag, zipCode', flag, zipCode)
            let { parms } = this.state;
            switch (flag) {
                case 'birth': // 出生地址
                    setTimeout(() => {
                        parms.patBirthZIP = zipCode;
                        console.log('parms', parms)
                        this.setState({});
                        this.bornVillage.current.focus();
                    }, 300)
                    break;
                case 'native': // 籍贯
                    setTimeout(() => {
                        parms.patNativeZIP = zipCode;
                        this.setState({});
                        this.nativeVillage.current.focus();
                    }, 300)
                    break;
                case 'present': // 现住址
                    setTimeout(() => {
                        parms.patPresentZIP = zipCode;
                        this.setState({});
                        this.village.current.focus();
                        if (zipCode) {
                            this.props.form.setFieldsValue({ presentZIP: zipCode });
                        }
                    }, 300)
                    break;
                case 'register': // 户口地址
                    setTimeout(() => {
                        parms.patRegisterZIP = zipCode;
                        this.setState({});
                        this.houseVillage.current.focus()
                        if (zipCode) {
                            this.props.form.setFieldsValue({ registerZIP: zipCode });
                        }
                    }, 300)
                    break;
                case 'company': // 单位地址
                    setTimeout(() => {
                        parms.patCompanyZIP = zipCode;
                        this.setState({});
                        this.companyVillage.current.focus()
                        if (zipCode) {
                            this.props.form.setFieldsValue({ companyZIP: zipCode });
                        }
                    }, 300)
                    break;
                case 'contact': // 联系人地址
                    setTimeout(() => {
                        parms.patContactZIP = zipCode;
                        this.setState({});
                        this.econVillage.current.focus()
                    }, 300)
                    break;
            }
        }

        //乡获取焦点时调用
        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');
            }
        }

        //选择县时加载乡数据
        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']: [],
                        })
                    }
                }
            })

        }

        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);
            }
        }

        //选择国籍 -- 民族
        handleCountry = (data, dats) => {
            this.setState({
                credCountry: data
            })
            if (data != 44) {
                this.props.form.setFieldsValue({ patNationID: undefined });
            }
        }

        //获取到出生日期自动计算年龄
        autoAge = (patBirthDate, patBirthTime) => {
            let data = {}
            data = {
                params: [{
                    birthday: patBirthDate,
                    birthTime: patBirthTime ? patBirthTime : '',
                    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) {
                            let parmsAge = { ...this.state.parms }
                            parmsAge['patAge'] = res.result
                            this.setState({
                                credAge: res.result,
                                parms: parmsAge
                            })
                            this.props.form.setFieldsValue({ age: res.result })
                        } else {

                        }
                    }
                })
            }
        }

        //选择日期 计算年龄
        onPanelChange = (mode) => {
            this.setState({
                patBirthVisible: false,
                birthTime: this.state.birthTime,
                birthData: moment(mode).format('YYYY-MM-DD'),
            })
            this.props.form.setFieldsValue({ patBirthTime: undefined })
            this.autoAge(moment(mode).format('YYYY-MM-DD'), this.state.birthTime && this.state.birthTime ? this.state.birthTime : undefined);
        }

        //日期面板打开/关闭
        handleOnOpenChangeData = (status) => {
            if (!status) {
                setTimeout(() => {
                    this.patMobile.current.focus();
                }, 300)
            }
        }

        //选择时间
        onPanelChangeTime = (mode) => {
            this.setState({
                patBirthVisible: false,
                birthTime: moment(mode).format('HH:mm'),
                birthData: this.state.birthData,
            })
            this.autoAge(this.state.birthData && this.state.birthData ? this.state.birthData : undefined, moment(mode).format('HH:mm'));
        }

        //展开/关闭起始时间
        handleOnOpenChangeStart = (status) => {
            if (status) {
                this.setState({
                    openTime: true,
                })
            } else {
                this.setState({
                    openTime: false,
                })
                setTimeout(() => {
                    this.patMobile.current.focus();
                }, 300)
            }
            if (!status) {
                this.setState({ isTransitionStart: true })
            } else {
                this.setState({ isTransitionStart: false })
            }
        }

        //时间框回车跳到手机号码项
        timeBlur = (e) => {
            var e = window.event || e;
            if (e.keyCode == 13) {
                setTimeout(() => {
                    this.patMobile.current.focus();
                }, 300)
                this.setState({
                    openTime: false,
                    isTransitionStart: true
                })
            }
        }

        //获取身份证号年龄
        getAge(patCredNo) {
            var len = (patCredNo + '').length;
            if (len == 0) {
                return 0;
            } else {
                if ((len != 15) && (len != 18))//身份证号码只能为15位或18位其它不合法 ---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.length == undefined) {
                return
            }
            if (patCredNo && patCredNo.length == 18) {
                birthdayno = patCredNo.substring(6, 14)
            } else if (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 {
                // alert('错误的身份证号码，请核对！')
                return false
            }
            var tempid = sexno % 2;
            if (tempid == 0) {
                sex = '2'
            } else {
                sex = '1'
            }
            return sex
        }

        //取地址栏传过来的数据
        getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = this.props.location.search.substr(1).match(reg);
            if (r != null) {
                return decodeURIComponent(r[2]);
            }
            return null;
        }

        // 调用子组件的连接事件 -- 寻找病人
        OnChildrefs = (ref) => {
            this.child = ref
        }

        // 调用子组件的连接事件 -- 关联病人信息
        Onrefs = (ref) => {
            this.childs = ref
        }

        //查找病人
        handlePatients = () => {
            this.child.setValue(this.state.findPatNo)
            this.child.showModal()
        }

        //病人姓名 格式验证 是否允许带空格
        validName = (rule, value, callback) => {
            if ((this.props.form.getFieldValue('patName') && this.props.form.getFieldValue('patName').length > 0)) {
                var reg = /^(([a-zA-Z+\.?\·?a-zA-Z+]{2,30}$)|([\u4e00-\u9fa5+\s·?\u4e00-\u9fa5+]{2,30}$))/;
                if (!reg.test(value)) {
                    callback('姓名格式填写错误'); // 校验未通过
                    return;
                }
                callback();
            }
            callback();
        }

        validNames = (rule, value, callback) => {
            if (this.props.form.getFieldValue('patEContact') && this.props.form.getFieldValue('patEContact').length > 0) {
                var reg = /^(([a-zA-Z+\.?\·?a-zA-Z+]{2,30}$)|([\u4e00-\u9fa5+\s·?\u4e00-\u9fa5+]{2,30}$))/;
                if (!reg.test(value)) {
                    callback('姓名格式填写错误'); // 校验未通过
                    return;
                }
                callback();
            }
            callback();
        }

        //输入完身份证进行读卡操作
        handleInmations = (credN) => {
            let data = {}
            data = {
                params: [{
                    cardTypeID: '',
                    cardNo: '',
                    credTypeID: this.props.form.getFieldValue('patCredTypeCode') ? this.props.form.getFieldValue('patCredTypeCode') : '',
                    credNo: typeof (credN) != 'object' ? credN : (this.props.form.getFieldValue('patCredNo') ? this.props.form.getFieldValue('patCredNo') : '')
                }],
            }
            $http.post('urlS', this, {
                code: '03030009',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0 && res.result.data.length > 0) {
                        //判断接口请求成功数据是否返回成功
                        if (this.state.isModefined == 1 && this.state.selfCredNo != this.props.form.getFieldValue('patCredNo')) {
                            this.setState({
                                credWarning: true
                            })
                            warning({
                                key: 'card',
                                centered: true,
                                maskClosable: true,
                                content: (
                                    <p style={{ color: 'rgba(0, 0, 0, 0.85)', fontSize: '16px', marginTop: '-8px' }}>证件号码已被使用,病人ID:<span style={{ marginRight: '6px' }}>{res.result ? res.result.patInfo.patNo : ''}</span><span style={{ marginRight: '6px' }}>{res.res ? status.cardType : ''}</span><span>{status ? status.cardNo : ''}</span></p>
                                ),
                                onOk() {
                                    Modal.destroyAll();
                                },
                            })
                        } else {
                            if (this.state.selfCredNo == this.props.form.getFieldValue('patCredNo')) {
                                return
                            } else {

                            }
                        }
                    } else {
                    }
                },
                error: function () {

                }
            })
        }

        //来源提示
        sourceTip = (num) => {
            this.props.form.validateFields(['patSourceID',], (errors, values) => {
                if (!errors) {
                    this.setState({
                        sourceVisible: false
                    })
                    if (num != 2) {
                        if (this.props.form.getFieldValue('patSourceID')) {
                            setTimeout(() => {
                                this.creadCard.current.buttonNode.focus();
                            }, 300)
                        }
                    }
                } else {
                    this.setState({
                        sourceVisible: true,
                        sourceMessage: errors.patSourceID.errors[0].message,
                    })
                    setTimeout(() => {
                        this.setState({
                            sourceVisible: false
                        })
                    }, 1500)
                }
            });
        }

        //提交表格内容
        handleSubmit = (e) => {
            this.props.form.validateFields((err, values) => {
                if (err) {
                    this.patNameTip()
                    this.econNameTip()
                    this.patBirthTip()
                    this.posTip()
                    this.patMobileTip()
                    this.patTypeTip()
                    // this.patAdressTip()
                    this.econPhoneTip()
                    this.sourceTip()
                    var arr = []
                    for (let i in err) {
                        arr.push(err[i]); //属性
                        //arr.push(obj[i]); //值
                    }
                    let info = arr[0].errors[0].field
                    if (info == 'cardNo') {
                        setTimeout(() => {
                            this.cardNo.current.focus();
                        }, 300)
                        return
                    } if (info == 'patName') {
                        if (this.popCardVis == 'false') {
                            setTimeout(() => {
                                this.patName.current.focus();
                            }, 800)
                        }
                        return
                    } if (info == 'patSexCode') {
                        setTimeout(() => {
                            this.sex.current.focus();
                        }, 300)
                        return
                    } if (info == 'patCredTypeCode ') {
                        setTimeout(() => {
                            this.credType.current.focus();
                        }, 300)
                        return
                    }
                    if (info == 'patCredNo') {
                        setTimeout(() => {
                            this.patCredNo.current.focus();
                        }, 300)
                        return
                    } if (info == 'patBirthDate') {
                        setTimeout(() => {
                            this.patBirthDate.current.focus();
                        }, 300)
                        return
                    } if (info == 'patMobile') {
                        setTimeout(() => {
                            this.patMobile.current.focus();
                        }, 300)
                        return
                    } if (info == 'patTypeID') {
                        setTimeout(() => {
                            this.patType.current.focus();
                        }, 300)
                        return
                    } if (info == 'patNationID') {
                        setTimeout(() => {
                            this.nation.current.focus();
                        }, 300)
                        return
                    } if (info == 'presentAddressDesc') {
                        setTimeout(() => {
                            this.patAddress.current.focus();
                        }, 300)
                        return
                    } if (info == 'patEContact') {

                        setTimeout(() => {
                            this.econName.current.focus();
                        }, 300)
                        return
                    } if (info == 'patERelationID') {

                        setTimeout(() => {
                            this.econRelation.current.focus();
                        }, 300)
                        return
                    } if (info == 'patEContactMobile') {

                        setTimeout(() => {
                            this.econMobile.current.focus();
                        }, 300)
                        return
                    } if (info == 'cardPayMethodID') {
                        setTimeout(() => {
                            this.cardPayMethodID.current.focus();
                        }, 300)
                        return
                    } if (info == 'patEContact') {
                        setTimeout(() => {
                            this.econName.current.focus();
                        }, 300)
                        return
                    } if (info == 'presentZIP') {
                        setTimeout(() => {
                            this.presentZIP.current.focus();
                        }, 300)
                        return
                    } if (info == 'registerZIP') {
                        setTimeout(() => {
                            this.registerZIP.current.focus();
                        }, 300)
                        return
                    } if (info == 'companyZIP') {
                        setTimeout(() => {
                            this.companyZIP.current.focus();
                        }, 300)
                        return
                    }
                }
                if (!err) {
                    // console.log('---',this.state.credTypeID)
                    //添加其他卡类型
                    this.addCards()
                    setTimeout(() => {
                        if (this.state.abs) {
                            this.setState({
                                postLoading: true,
                                canSave: true,
                            })
                            if (this.props.form.getFieldValue('patCredTypeCode') == '01' && moment(values.patBirthDate).format('YYYY-MM-DD') != this.getBirthday(values.patCredNo)) {
                                this.setState({
                                    postLoading: false,
                                    canSave: false
                                })
                                message.warning('请保持身份证号码中的出生日期与出生日期框一致')
                                return
                            }
                            if (this.state.isModefined == 1) {
                                let patDr = ''
                                if (this.state.patiId != '') {
                                    patDr = this.state.patiId
                                } else {
                                    this.setState({
                                        patDr: ''
                                    })
                                }
                                let data = {}
                                data = {
                                    params: [{
                                        active: '',
                                        telphone: '',
                                        contractUnitDr: '',
                                        patID: patDr,
                                        patName: values.patName,
                                        patSexCode: values.patSexCode,
                                        patBirthDate: values.patBirthDate ? moment(values.patBirthDate).format('YYYY-MM-DD') : undefined,
                                        patBirthTime: values.patBirthTime ? moment(values.patBirthTime).format('HH:mm') : undefined,
                                        // patCredTypeCode: values.patCredTypeCode || '',
                                        patCredTypeID: this.state.credTypeID || '',
                                        // credTypeID:record.patCredTypeID,
                                        patCredNo: values.patCredNo || '',
                                        patOccupationID: values.patOccupationID || '',
                                        patNationID: values.patNationID || '',
                                        patTypeID: values.patTypeID || '',
                                        patEduID: values.patEduID || '',
                                        patMobile: values.patMobile || '',
                                        patEContact: values.patEContact || '',
                                        patEContactMobile: values.patEContactMobile || '',
                                        patERelationID: values.patERelationID || '',
                                        patEContactCredTypeIDNo: values.patEContactCredTypeIDNo || '',
                                        patMaritalID: values.patMaritalID || '',
                                        patCompany: values.patCompany || '',
                                        patCountryID: values.patCountryID || '',
                                        patSocialStatusID: values.patSocialStatusID || '',
                                        patSourceID: values.patSourceID || '',
                                        patUpdateUserID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).userID : '',
                                        patCompanyTel: values.patCompanyTel,
                                        patIDCardNo: '',
                                        addressInfo: [
                                            {
                                                addressTypeCode: 'Present',
                                                addressData: {
                                                    patOthID: this.state.patPresentOthID,
                                                    patProvinceID: values.presentProvinceID,
                                                    patCityID: values.presentCityID,
                                                    patAreaID: values.presentAreaID,
                                                    patVillageID: values.presentVillageID,
                                                    patHamletID: values.presentHamletID,
                                                    patAddress: values.presentAddressDesc,
                                                    patZIP: values.presentZIP
                                                }
                                            },
                                            {
                                                addressTypeCode: 'Birth',
                                                addressData: {
                                                    patOthID: this.state.patBirthOthID,
                                                    patAddress: values.birthAddress,
                                                    patProvinceID: values.birthProvinceID,
                                                    patCityID: values.birthCityID,
                                                    patAreaID: values.birthAreaID,
                                                    patVillageID: values.birthVillageID,
                                                    patHamletID: values.birthHamletID,
                                                }
                                            },
                                            {
                                                addressTypeCode: 'Native',
                                                addressData: {
                                                    patOthID: this.state.patNativeOthID,
                                                    patAddress: values.nativeAddress,
                                                    patProvinceID: values.nativeProvinceID,
                                                    patCityID: values.nativeCityID,
                                                    patAreaID: values.nativeAreaID,
                                                    patVillageID: values.nativeVillageID,
                                                    patHamletID: values.nativeHamletID,
                                                }
                                            }, {
                                                addressTypeCode: 'Register',
                                                addressData: {
                                                    patOthID: this.state.patRegisterOthID,
                                                    patAddress: values.registerAddress,
                                                    patProvinceID: values.registerProvinceID,
                                                    patCityID: values.registerCityID,
                                                    patAreaID: values.registerAreaID,
                                                    patVillageID: values.registerVillageID,
                                                    patHamletID: values.registerHamletID,
                                                    patZIP: values.registerZIP,
                                                }
                                            },
                                            {
                                                addressTypeCode: 'Company',
                                                addressData: {
                                                    patOthID: this.state.patCompanyOthID,
                                                    patAddress: values.companyAddress,
                                                    patProvinceID: values.companyProvinceID,
                                                    patCityID: values.companyCityID,
                                                    patAreaID: values.companyAreaID,
                                                    patVillageID: values.companyVillageID,
                                                    patHamletID: values.companyHamletID,
                                                    patZIP: values.companyZIP
                                                }
                                            }, {
                                                addressTypeCode: 'Contact',
                                                addressData: {
                                                    patOthID: this.state.patContactOthID,
                                                    patAddress: values.contactAddress,
                                                    patProvinceID: values.contactProvinceID,
                                                    patCityID: values.contactCityID,
                                                    patAreaID: values.contactAreaID,
                                                    patVillageID: values.contactVillageID,
                                                    patHamletID: values.contactHamletID,
                                                }
                                            }
                                        ],

                                    }]
                                }
                                $http.post('urlS', this, {
                                    code: '03030012',
                                    data: data,
                                    success: function (res) {
                                        if (+res.errorCode === 0) {
                                            message.success('保存成功');
                                            this.setState({
                                                postLoading: false,
                                                canSave: false,
                                            })
                                            let self = this
                                            if (Util.isEmpty(this.state.updateMessage)) {
                                                confirm({
                                                    key: 11,
                                                    title: '信息修改成功,是否返回',
                                                    centered: true,
                                                    onOk() {
                                                        Modal.destroyAll()
                                                        self.backList();
                                                        self.setState({
                                                            postLoading: false,
                                                            canSave: false,
                                                        })
                                                    },
                                                    onCancel() {
                                                        self.setState({
                                                            postLoading: false,
                                                            canSave: false,
                                                        })
                                                    },
                                                });
                                            }

                                        } else {
                                            this.setState({
                                                postLoading: false,
                                                canSave: false,
                                            })
                                        }
                                    },
                                    error: function () {
                                        this.setState({
                                            postLoading: false,
                                            canSave: false,
                                        })
                                    }
                                })
                            }

                        }
                    }, 300)
                }
            })
        }

        //隐藏验证提示
        handleVail = () => {
            this.setState({
                cardNoVisible: false,
                patNameVisible: false,
                patAdressVisible: false,
                patAdressZipVisible: false,
                patBirthVisible: false,
                posVisible: false,
                patTypeVisible: false,
                patMobileVisible: false,
                econPhoneVisible: false,
                econNameVisible: false,
            })
        }

        handleOk = () => {
            this.setState({ loading: true });
            setTimeout(() => {
                this.setState({ loading: false, visible: false });
            }, 3000);
        }

        handleCancel = () => {
            this.setState({ visible: false });
        }

        KeyDowns = (e) => {
            if (e && e.keyCode) {
                let currKey = 0;
                e = e || event || window.event;
                currKey = e.keyCode || e.which || e.charCode;
                //快捷键保存  shilt/alt/ctrl + s
                if (currKey == 83 && (e.ctrlKey || e.metaKey || e.shiftKey)) {
                    e.preventDefault();
                    this.handleSubmit()
                }
                //快捷键清空 shilt/alt/ctrl + z
                // if (currKey == 90 && (e.ctrlKey || e.metaKey || e.shiftKey)) {
                //     e.preventDefault();
                //     this.patName.current.blur();
                // }
            }
        }

        backList = () => {
            this.setState({
                modifVisible: false
            })
            this.props.handleClose && this.props.handleClose();
            this.props.handleBack && this.props.handleBack();
        }

        //添加其他证件类型
        addCard = () => {
            const { tableData } = this.state;
            this.openSelect()
            const newData = {
                credID: tableData && tableData.length > 0 ? tableData.length + 1 : 1,
                credNo: '',
                key: tableData && tableData.length > 0 ? tableData.length + 1 : 1,
                credTypeCode: '',
                credTypeDesc: '',
                credTypeID: '',
                editable: true,
                isAdd: true,
            }
            this.setState({ isAdd: true, disAdd: false, ordDetailValue: '', ordTemPrice: 0, tableData: [...tableData, newData] }, () => {
            });
        }

        //已选卡类型不可再被选择
        openSelect = (id) => {
            const { tableData, baseParms, selectID } = this.state;
            baseParms.credType.map((items, index) => {
                tableData.map((item, i) => {
                    if (items.id == item.credTypeID && id != item.credTypeID) {
                        // tableData[i].credTypeDesc =  baseParms.credType[j].descripts
                        // console.log('9999',item.credTypeDesc)
                        items.disabled = true
                    }
                })

            })
            baseParms.credType.map((items, index) => {
                if (items.id == selectID) {
                    // tableData[i].credTypeDesc =  baseParms.credType[j].descripts
                    // console.log('9999',item.credTypeDesc)
                    items.disabled = true
                }
            })
        }

        //编辑 卡类型
        toggleEditable = (e, key, record) => {
            e.preventDefault();
            const { tableData } = this.state;
            this.setState({
                //   ordTempletDetailItemDesc:record.ordTempletDetailItemDesc,
                //   ordTempletDetailQty:record.ordTempletDetailQty,
                //   ordTempletDetailQtyUnitDr:record.ordTempletDetailQtyUnitDr,
                //   ordTempletDetailID:record.ordTempletDetailID,
                disAdd: false
            })
            const newData = tableData.map(item => ({ ...item }));
            const target = this.getRowByKey(key, newData);
            if (target) {
                if (!target.editable) {
                    this.cacheOriginData[key] = { ...target };
                }
                target.editable = !target.editable;
                this.setState({
                    tableData: newData,
                    // canSaveStatus:false,
                })
            }
            //     setTimeout(() => {
            //       this.detailDeInput.current.focus();
            //   }, 300)
        }

        //取消 卡类型
        cancel = (e, key) => {
            this.clickedCancel = true;
            e.preventDefault();
            const { tableData } = this.state;
            const newData = tableData.map((item) => ({ ...item }));
            const target = this.getRowByKey(key, newData);
            if (this.cacheOriginData[key]) {
                Object.assign(target, this.cacheOriginData[key]);
                delete this.cacheOriginData[key];
            }
            target.editable = false;
            this.setState({ tableData: newData, disAdd: false });
            this.ClickedCancel = false;
        }

        //获取操作行数据对象
        getRowByKey(key, newData) {
            const { tableData } = this.state;
            return (newData || tableData).filter(item => item.credID === key)[0];
        }

        //文本框数据修改
        handleFieldChange = (e, fieldName, key) => {
            const { tableData, baseParms } = this.state;
            const newData = tableData.map(item => ({ ...item }));
            const target = this.getRowByKey(key, newData);
            if (fieldName == 'cardType') {
                this.setState({
                    selectID: e
                })
                for (var i = 0; i < newData.length; i++) {
                    if (newData[i].credID === key) {
                        newData[i].credTypeID = e
                        for (var j = 0; j < baseParms.credType.length; j++) {
                            if (newData[i].credTypeID == baseParms.credType[j].id) {
                                newData[i].credTypeDesc = baseParms.credType[j].descripts
                            }
                        }
                    }
                }
                this.setState({
                    tableData: newData,
                    canSaveStatus: false,
                })
                return
            }
            if (target) {
                target[fieldName] = e.target.value;
                this.setState({
                    tableData: newData,
                    canSaveStatus: false,
                })
            }
        }

        //获取病人来源下拉框
        getPatForm = () => {
            let data = {
                params: [{
                }],
            }
            $http.post('urlS', this, {
                code: '03050175',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            patFormData: res.result.data
                        })
                    } else {
                        message.error('失败：' + res.errorMessage);
                    }
                },
                error: function (error) {
                    message.error('失败：' + error);
                }
            });
        }

        // 户口地址一键复制  一键复制地址
        handleCopyAddress() {
            var { parms, registerCity, registerAreas, registerVillages, registerHamlets } = this.state;
            // if (!(registerCity && registerCity.length > 0)) {
            //     this.onCityFocus('registerProvinceID', 'registerCity')
            // }
            // if (!(registerAreas && registerAreas.length > 0)) {
            //     this.onAreaFocus('registerCityID', 'register')
            // }
            // if (!(registerVillages && registerVillages.length > 0)) {
            //     this.onVillageFocus('registerAreaID', 'register')
            // }
            // if (!(registerHamlets && registerHamlets.length > 0)) {
            //     this.onHamletFocus('registerVillageID', 'register')
            // }
            this.props.form.validateFields((err, values) => {
                /*
                    birthCity: [],//出生地市区信息
                    birthAreas: [],//出生地县信息
                    birthVillages: [],//出生地乡信息
                    birthHamlets: [],//出生地村落信息

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

                    presentCity: [],//现住址市区信息
                    presentAreas: [],//现住址县信息
                    presentVillages: [],//现住址乡信息
                    presentHamlets: [],//现住址村落信息

                    registerCity: [],//户口地址市区信息
                    registerAreas: [],//户口地址县信息
                    registerVillages: [],//户口地址乡信息
                    registerHamlets: [],//户口地址村落信息
                */
                //出生地址 现住址
                setTimeout(() => {
                    // 出生地
                    parms.patBirthProvinceID = values.registerProvinceID;
                    parms.patBirthCityID = values.registerCityID;
                    parms.patBirthAreaID = values.registerAreaID;
                    parms.patBirthAreaDesc = parms.patRegisterAreaDesc || values.registerAreaDesc;
                    parms.patBirthVillageID = values.registerVillageID;
                    parms.patBirthVillageDesc = parms.patRegisterVillageDesc || values.registerVillageDesc;
                    parms.patBirthAddressDesc = values.registerAddress;
                    parms.patBirthZIP = parms.patRegisterZIP || values.registerZIP;
                    //籍贯
                    parms.patNativeProvinceID = values.registerProvinceID;
                    parms.patNativeCityID = values.registerCityID;
                    parms.patNativeAreaID = values.registerAreaID;
                    parms.patNativeAreaDesc = parms.patRegisterAreaDesc || values.registerAreaDesc;
                    parms.patNativeVillageID = values.registerVillageID;
                    parms.patNativeVillageDesc = parms.patRegisterVillageDesc || values.registerVillageDesc;
                    parms.patNativeAddressDesc = values.registerAddress;
                    parms.patNativeZIP = parms.patRegisterZIP || values.registerZIP;
                    //现住址
                    parms.patPresentProvinceID = values.registerProvinceID;
                    parms.patPresentCityID = values.registerCityID;
                    parms.patPresentAreaID = values.registerAreaID;
                    parms.patPresentAreaDesc = parms.patRegisterAreaDesc || values.registerAreaDesc;
                    parms.patPresentVillageID = values.registerVillageID;
                    parms.patPresentVillageDesc = parms.patRegisterVillageDesc || values.registerVillageDesc;
                    parms.patPresentAddressDesc = values.registerAddress;
                    parms.patPresentZIP = parms.patRegisterZIP || values.registerZIP;
                    //联系人地址
                    parms.patContactProvinceID = values.registerProvinceID;
                    parms.patContactCityID = values.registerCityID;
                    parms.patContactAreaID = values.registerAreaID;
                    parms.patContactAreaDesc = parms.patRegisterAreaDesc || values.registerAreaDesc;
                    parms.patContactVillageID = values.registerVillageID;
                    parms.patContactVillageDesc = parms.patRegisterVillageDesc || values.registerVillageDesc;
                    parms.patContactAddressDesc = values.registerAddress;
                    parms.patContactZIP = parms.patRegisterZIP || values.registerZIP;

                    this.props.form.setFieldsValue({
                        // 出生地
                        birthProvinceID: values.registerProvinceID,
                        birthCityID: values.registerCityID,
                        birthAreaID: values.registerAreaID,
                        birthAreaDesc: parms.patRegisterAreaDesc || values.registerAreaDesc,
                        birthVillageID: values.registerVillageID,
                        birthVillageDesc: parms.patRegisterVillageDesc || values.registerVillageDesc,
                        birthAddress: values.registerAddress,
                        birthZIP: parms.patRegisterZIP || values.registerZIP,
                        // 籍贯
                        nativeProvinceID: values.registerProvinceID,
                        nativeCityID: values.registerCityID,
                        nativeAreaID: values.registerAreaID,
                        nativeAreaDesc: parms.patRegisterAreaDesc || values.registerAreaDesc,
                        nativeVillageID: values.registerVillageID,
                        nativeVillageDesc: parms.patRegisterVillageDesc || values.registerVillageDesc,
                        nativeAddress: values.registerAddress,
                        nativeZIP: parms.patRegisterZIP || values.registerZIP,
                        // 现住址
                        presentProvinceID: values.registerProvinceID,
                        presentCityID: values.registerCityID,
                        presentAreaID: values.registerAreaID,
                        presentAreaDesc: parms.patRegisterAreaDesc || values.registerAreaDesc,
                        presentVillageID: values.registerVillageID,
                        PresentVillageDesc: parms.patRegisterVillageDesc || values.registerVillageDesc,
                        presentAddressDesc: values.registerAddress,
                        presentZIP: parms.patRegisterZIP || values.registerZIP,
                        //联系人地址
                        contactProvinceID: values.registerProvinceID,
                        contactCityID: values.registerCityID,
                        contactAreaID: values.registerAreaID,
                        contactAreaDesc: parms.patRegisterAreaDesc || values.registerAreaDesc,
                        contactVillageID: values.registerVillageID,
                        contactVillageDesc: parms.patRegisterVillageDesc || values.registerVillageDesc,
                        contactAddress: values.registerAddress,
                        contactZIP: parms.patRegisterZIP || values.registerZIP,
                    })
                    this.setState({
                        birthCity: registerCity,//出生地市区信息
                        birthAreas: registerAreas,//出生地县信息
                        birthVillages: registerVillages,//出生地乡信息
                        birthHamlets: registerHamlets,//出生地村落信息

                        nativeCity: registerCity,//籍贯市区信息
                        nativeAreas: registerAreas,//籍贯县信息
                        nativeVillages: registerVillages,//籍贯乡信息
                        nativeHamlets: registerHamlets,//籍贯村落信息

                        presentCity: registerCity,//现住址市区信息
                        presentAreas: registerAreas,//现住址县信息
                        presentVillages: registerVillages,//现住址乡信息
                        presentHamlets: registerHamlets,//现住址村落信息

                        contactCity: registerCity,//紧急联系人市区信息
                        contactAreas: registerAreas,//紧急联系人县信息
                        contactVillages: registerVillages,//紧急联系人乡信息
                        contactHamlets: registerHamlets,//紧急联系人村落信息
                    })
                }, 200)
            })
        }

        // 现住址一键复制
        handleCopyPresentAddress() {
            var { parms, presentCity, presentAreas, presentVillages, presentHamlets } = this.state;
            this.props.form.validateFields((err, values) => {
                //出生地址
                setTimeout(() => {
                    parms.patBirthProvinceID = values.presentProvinceID;
                    parms.patBirthCityID = values.presentCityID;
                    parms.patBirthAreaID = values.presentAreaID;
                    parms.patBirthAreaDesc = parms.patPresentAreaDesc || values.presentAreaDesc;
                    parms.patBirthVillageID = values.presentVillageID;
                    parms.patBirthVillageDesc = parms.patPresentVillageDesc || values.presentVillageDesc;
                    parms.patBirthAddressDesc = values.presentAddressDesc;
                    parms.patBirthZIP = parms.patPresentZIP || values.presentZIP;
                    //籍贯
                    parms.patNativeProvinceID = values.presentProvinceID;
                    parms.patNativeCityID = values.presentCityID;
                    parms.patNativeAreaID = values.presentAreaID;
                    parms.patNativeAreaDesc = parms.patPresentAreaDesc || values.presentAreaDesc;
                    parms.patNativeVillageID = values.presentVillageID;
                    parms.patNativeVillageDesc = parms.patPresentVillageDesc || values.presentVillageDesc;
                    parms.patNativeAddressDesc = values.presentAddressDesc;
                    parms.patNativeZIP = parms.patPresentZIP || values.presentZIP;
                    //现住址
                    parms.patRegisterProvinceID = values.presentProvinceID;
                    parms.patRegisterCityID = values.presentCityID;
                    parms.patRegisterAreaID = values.presentAreaID;
                    parms.patRegisterAreaDesc = parms.patPresentAreaDesc || values.presentAreaDesc;
                    parms.patRegisterVillageID = values.presentVillageID;
                    parms.patRegisterVillageDesc = parms.patPresentVillageDesc || values.presentVillageDesc;
                    parms.patRegisterAddressDesc = values.presentAddressDesc;
                    parms.patRegisterZIP = parms.patPresentZIP || values.presentZIP;
                    // this.props.form.setFieldsValue({ registerAddressDesc: values.presentAddress })
                    //联系人地址
                    parms.patContactProvinceID = values.presentProvinceID;
                    parms.patContactCityID = values.presentCityID;
                    parms.patContactAreaID = values.presentAreaID;
                    parms.patContactAreaDesc = parms.patPresentAreaDesc || values.presentAreaDesc;
                    parms.patContactVillageID = values.presentVillageID;
                    parms.patContactVillageDesc = parms.patPresentVillageDesc || values.presentVillageDesc;
                    parms.patContactAddressDesc = values.presentAddress;
                    parms.patContactZIP = parms.patPresentZIP || values.presentZIP;

                    this.props.form.setFieldsValue({
                        // 出生地
                        birthProvinceID: values.presentProvinceID,
                        birthCityID: values.presentCityID,
                        birthAreaID: values.presentAreaID,
                        birthAreaDesc: parms.patPresentAreaDesc || values.presentAreaDesc,
                        birthVillageID: values.presentVillageID,
                        birthVillageDesc: parms.patPresentVillageDesc || values.presentVillageDesc,
                        birthAddress: values.presentAddressDesc,
                        birthZIP: parms.patPresentZIP || values.presentZIP,
                        // 籍贯
                        nativeProvinceID: values.presentProvinceID,
                        nativeCityID: values.presentCityID,
                        nativeAreaID: values.presentAreaID,
                        nativeAreaDesc: parms.patPresentAreaDesc || values.presentAreaDesc,
                        nativeVillageID: values.presentVillageID,
                        nativeVillageDesc: parms.patPresentVillageDesc || values.presentVillageDesc,
                        nativeAddress: values.presentAddressDesc,
                        nativeZIP: parms.patPresentZIP || values.presentZIP,
                        // 户籍地址
                        registerProvinceID: values.presentProvinceID,
                        registerCityID: values.presentCityID,
                        registerAreaID: values.presentAreaID,
                        registerAreaDesc: parms.patPresentAreaDesc || values.presentAreaDesc,
                        registerVillageID: values.presentVillageID,
                        registerVillageDesc: parms.patPresentVillageDesc || values.presentVillageDesc,
                        registerAddress: values.presentAddressDesc,
                        registerZIP: parms.patPresentZIP || values.presentZIP,
                        //联系人地址
                        contactProvinceID: values.presentProvinceID,
                        contactCityID: values.presentCityID,
                        contactAreaID: values.presentAreaID,
                        contactAreaDesc: parms.patPresentAreaDesc || values.presentAreaDesc,
                        contactVillageID: values.presentVillageID,
                        contactVillageDesc: parms.patPresentVillageDesc || values.presentVillageDesc,
                        contactAddress: values.presentAddressDesc,
                        contactZIP: parms.patPresentZIP || values.presentZIP
                    })
                }, 200)
                this.setState({
                    birthCity: presentCity,//出生地市区信息
                    birthAreas: presentAreas,//出生地县信息
                    birthVillages: presentVillages,//出生地乡信息
                    birthHamlets: presentHamlets,//出生地村落信息

                    nativeCity: presentCity,//籍贯市区信息
                    nativeAreas: presentAreas,//籍贯县信息
                    nativeVillages: presentVillages,//籍贯乡信息
                    nativeHamlets: presentHamlets,//籍贯村落信息

                    registerCity: presentCity,//户口地址市区信息
                    registerAreas: presentAreas,//户口地址县信息
                    registerVillages: presentVillages,//户口地址乡信息
                    registerHamlets: presentHamlets,//户口地址村落信息

                    contactCity: presentCity,//紧急联系人市区信息
                    contactAreas: presentAreas,//紧急联系人县信息
                    contactVillages: presentVillages,//紧急联系人乡信息
                    contactHamlets: presentHamlets,//紧急联系人村落信息
                })
            })
        }

        // 出生地地址复制
        handleCopyBirthAddress() {
            var { parms, birthCity, birthAreas, birthVillages, birthHamlets } = this.state;
            console.log('parms', parms)
            this.props.form.validateFields((err, values) => {
                //出生地址
                setTimeout(() => {
                    parms.patPresentProvinceID = values.birthProvinceID;
                    parms.patPresentCityID = values.birthCityID;
                    parms.patPresentAreaID = values.birthAreaID;
                    parms.patPresentAreaDesc = parms.patBirthAreaDesc || values.birthAreaDesc;
                    parms.patPresentVillageID = values.birthVillageID;
                    parms.patPresentVillageDesc = parms.patBirthVillageDesc || values.birthVillageDesc;
                    parms.patPresentAddressDesc = values.birthAddress;
                    parms.patPresentZIP = parms.patBirthZIP || values.birthZIP;
                    // this.props.form.setFieldsValue({ presentAddressDesc: values.birthAddressDesc })
                    //籍贯
                    parms.patNativeProvinceID = values.birthProvinceID;
                    parms.patNativeCityID = values.birthCityID;
                    parms.patNativeAreaID = values.birthAreaID;
                    parms.patNativeAreaDesc = parms.patBirthAreaDesc || values.birthAreaDesc;
                    parms.patNativeVillageID = values.birthVillageID;
                    parms.patNativeVillageDesc = parms.patBirthVillageDesc || values.birthVillageDesc;
                    parms.patNativeAddressDesc = values.birthAddress;
                    parms.patNativeZIP = parms.patBirthZIP || values.birthZIP;
                    //现住址
                    parms.patRegisterProvinceID = values.birthProvinceID;
                    parms.patRegisterCityID = values.birthCityID;
                    parms.patRegisterAreaID = values.birthAreaID;
                    parms.patRegisterAreaDesc = parms.patBirthAreaDesc || values.birthAreaDesc;
                    parms.patRegisterVillageID = values.birthVillageID;
                    parms.patRegisterVillageDesc = parms.patBirthVillageDesc || values.birthVillageDesc;
                    parms.patRegisterAddressDesc = values.birthAddress;
                    parms.patRegisterZIP = parms.patBirthZIP || values.birthZIP;

                    // this.props.form.setFieldsValue({ registerAddressDesc: values.birthAddress })
                    //联系人地址
                    parms.patContactProvinceID = values.birthProvinceID;
                    parms.patContactCityID = values.birthCityID;
                    parms.patContactAreaID = values.birthAreaID;
                    parms.patContactAreaDesc = parms.patBirthAreaDesc || values.birthAreaDesc;
                    parms.patContactVillageID = values.birthVillageID;
                    parms.patContactVillageDesc = parms.patBirthVillageDesc || values.birthVillageDesc;
                    parms.patContactAddressDesc = values.birthAddress;
                    parms.patContactZIP = parms.patBirthZIP || values.birthZIP;

                    this.props.form.setFieldsValue({
                        // 现住址
                        presentProvinceID: values.birthProvinceID,
                        presentCityID: values.birthCityID,
                        presentAreaID: values.birthAreaID,
                        presentAreaDesc: parms.patBirthAreaDesc || values.birthAreaDesc,
                        presentVillageID: values.birthVillageID,
                        presentVillageDesc: parms.patBirthVillageDesc || values.birthVillageDesc,
                        presentAddressDesc: values.birthAddress,
                        presentZIP: parms.patBirthZIP || values.birthZIP,
                        // 籍贯
                        nativeProvinceID: values.birthProvinceID,
                        nativeCityID: values.birthCityID,
                        nativeAreaID: values.birthAreaID,
                        nativeAreaDesc: parms.patBirthAreaDesc || values.birthAreaDesc,
                        nativeVillageID: values.birthVillageID,
                        nativeVillageDesc: parms.patBirthVillageDesc || values.birthVillageDesc,
                        nativeAddress: values.birthAddress,
                        nativeZIP: parms.patBirthZIP || values.birthZIP,
                        // 户籍地址
                        registerProvinceID: values.birthProvinceID,
                        registerCityID: values.birthCityID,
                        registerAreaID: values.birthAreaID,
                        registerAreaDesc: parms.patBirthAreaDesc || values.birthAreaDesc,
                        registerVillageID: values.birthVillageID,
                        registerVillageDesc: parms.patBirthVillageDesc || values.birthVillageDesc,
                        registerAddress: values.birthAddress,
                        registerZIP: parms.patBirthZIP || values.birthZIP,
                        //联系人地址
                        contactProvinceID: values.birthProvinceID,
                        contactCityID: values.birthCityID,
                        contactAreaID: values.birthAreaID,
                        contactAreaDesc: parms.patBirthAreaDesc || values.birthAreaDesc,
                        contactVillageID: values.birthVillageID,
                        contactVillageDesc: parms.patBirthVillageDesc || values.birthVillageDesc,
                        contactAddress: values.birthAddress,
                        contactZIP: parms.patBirthZIP || values.birthZIP,
                    })
                }, 200)
                this.setState({
                    presentCity: birthCity,//现住址市区信息
                    presentAreas: birthAreas,//现住址县信息
                    presentVillages: birthVillages,//现住址乡信息
                    presentHamlets: birthHamlets,//现住址村落信息

                    nativeCity: birthCity,//籍贯市区信息
                    nativeAreas: birthAreas,//籍贯县信息
                    nativeVillages: birthVillages,//籍贯乡信息
                    nativeHamlets: birthHamlets,//籍贯村落信息

                    registerCity: birthCity,//户口地址市区信息
                    registerAreas: birthAreas,//户口地址县信息
                    registerVillages: birthVillages,//户口地址乡信息
                    registerHamlets: birthHamlets,//户口地址村落信息

                    contactCity: birthCity,//紧急联系人市区信息
                    contactAreas: birthAreas,//紧急联系人县信息
                    contactVillages: birthVillages,//紧急联系人乡信息
                    contactHamlets: birthHamlets,//紧急联系人村落信息
                })
            })
        }

        // 籍贯一键复制
        handleCopyNativeAddress() {
            var { parms, nativeCity, nativeAreas, nativeVillages, nativeHamlets } = this.state;
            this.props.form.validateFields((err, values) => {
                // this.getAreas(parms.patNativeCityID || values.nativeCityID, 'birth', '1')
                // this.getAreas(parms.patNativeCityID || values.nativeCityID, 'register', '1')
                // this.getAreas(parms.patNativeCityID || values.nativeCityID, 'present', '1')
                // this.getAreas(parms.patNativeCityID || values.nativeCityID, 'contact', '1')
                //出生地址
                setTimeout(() => {
                    parms.patBirthProvinceID = values.nativeProvinceID;
                    parms.patBirthCityID = values.nativeCityID;
                    parms.patBirthAreaID = values.nativeAreaID;
                    parms.patBirthAreaDesc = parms.patNativeAreaDesc || values.nativeAreaDesc;
                    parms.patBirthVillageID = values.nativeVillageID;
                    parms.patBirthVillageDesc = parms.patNativeVillageDesc || values.nativeVillageDesc;
                    parms.patBirthAddressDesc = values.nativeAddress;
                    parms.patBirthZIP = parms.patNativeZIP || values.nativeZIP;
                    //籍贯
                    parms.patRegisterProvinceID = values.nativeProvinceID;
                    parms.patRegisterCityID = values.nativeCityID;
                    parms.patRegisterAreaID = values.nativeAreaID;
                    parms.patRegisterAreaDesc = parms.patNativeAreaDesc || values.nativeAreaDesc;
                    parms.patRegisterVillageID = values.nativeVillageID;
                    parms.patRegisterVillageDesc = parms.patNativeVillageDesc || values.nativeVillageDesc;
                    parms.patRegisterAddressDesc = values.nativeAddress;
                    parms.patRegisterZIP = parms.patNativeZIP || values.nativeZIP;
                    //现住址
                    parms.patPresentProvinceID = values.nativeProvinceID;
                    parms.patPresentCityID = values.nativeCityID;
                    parms.patPresentAreaID = values.nativeAreaID;
                    parms.patPresentAreaDesc = parms.patNativeAreaDesc || values.nativeAreaDesc;
                    parms.patPresentVillageID = values.nativeVillageID;
                    parms.patPresentVillageDesc = parms.patNativeVillageDesc || values.nativeVillageDesc;
                    parms.patPresentAddressDesc = values.nativeAddress;
                    parms.patPresentZIP = parms.patNativeZIP || values.nativeZIP;
                    // this.props.form.setFieldsValue({ presentAddressDesc: values.nativeAddress })
                    //联系人地址
                    parms.patContactProvinceID = values.nativeProvinceID;
                    parms.patContactCityID = values.nativeCityID;
                    parms.patContactAreaID = values.nativeAreaID;
                    parms.patContactAreaDesc = parms.patNativeAreaDesc || values.nativeAreaDesc;
                    parms.patContactVillageID = values.nativeVillageID;
                    parms.patContactVillageDesc = parms.patNativeVillageDesc || values.nativeVillageDesc;
                    parms.patContactAddressDesc = values.nativeAddress;
                    parms.patContactZIP = parms.patNativeZIP || values.nativeZIP;

                    this.props.form.setFieldsValue({
                        // 现住址
                        presentProvinceID: values.nativeProvinceID,
                        presentCityID: values.nativeCityID,
                        presentAreaID: values.nativeAreaID,
                        presentAreaDesc: parms.patNativeAreaDesc || values.nativeAreaDesc,
                        presentVillageID: values.nativeVillageID,
                        presentVillageDesc: parms.patNativeVillageDesc || values.nativeVillageDesc,
                        presentAddressDesc: values.nativeAddress,
                        presentZIP: parms.patNativeZIP || values.nativeZIP,

                        // 出生地
                        birthProvinceID: values.nativeProvinceID,
                        birthCityID: values.nativeCityID,
                        birthAreaID: values.nativeAreaID,
                        birthAreaDesc: parms.patNativeAreaDesc || values.nativeAreaDesc,
                        birthVillageID: values.nativeVillageID,
                        birthVillageDesc: parms.patNativeVillageDesc || values.nativeVillageDesc,
                        birthAddress: values.nativeAddress,
                        birthZIP: parms.patNativeZIP || values.nativeZIP,

                        // 户籍地址
                        registerProvinceID: values.nativeProvinceID,
                        registerCityID: values.nativeCityID,
                        registerAreaID: values.nativeAreaID,
                        registerAreaDesc: parms.patNativeAreaDesc || values.nativeAreaDesc,
                        registerVillageID: values.nativeVillageID,
                        registerVillageDesc: parms.patNativeVillageDesc || values.nativeVillageDesc,
                        registerAddress: values.nativeAddress,
                        registerZIP: parms.patNativeZIP || values.nativeZIP,

                        //联系人地址
                        contactProvinceID: values.presentProvinceID,
                        contactCityID: values.nativeCityID,
                        contactAreaID: values.nativeAreaID,
                        contactAreaDesc: parms.patNativeAreaDesc || values.nativeAreaDesc,
                        contactVillageID: values.nativeVillageID,
                        contactVillageDesc: parms.patNativeVillageDesc || values.nativeVillageDesc,
                        contactAddress: values.nativeAddress,
                        contactZIP: parms.patNativeZIP || values.nativeZIP
                    })
                }, 200)
                this.setState({
                    birthCity: nativeCity,//出生地市区信息
                    birthAreas: nativeAreas,//出生地县信息
                    birthVillages: nativeVillages,//出生地乡信息
                    birthHamlets: nativeHamlets,//出生地村落信息

                    presentCity: nativeCity,//现住址市区信息
                    presentAreas: nativeAreas,//现住址县信息
                    presentVillages: nativeVillages,//现住址乡信息
                    presentHamlets: nativeHamlets,//现住址村落信息

                    registerCity: nativeCity,//户口地址市区信息
                    registerAreas: nativeAreas,//户口地址县信息
                    registerVillages: nativeVillages,//户口地址乡信息
                    registerHamlets: nativeHamlets,//户口地址村落信息

                    contactCity: nativeCity,//紧急联系人市区信息
                    contactAreas: nativeAreas,//紧急联系人县信息
                    contactVillages: nativeVillages,//紧急联系人乡信息
                    contactHamlets: nativeHamlets,//紧急联系人村落信息
                })
            })
        }

        // 修改复制弹窗状态
        modifyVisible = (visible, type) => {
            this.setState({ copyVisible: visible, fromAddress: type });
        }

        // 地址复制
        handleCopyAddressOk = () => {
            try {
                const { fromAddress, toAddress } = this.state;
                if (!toAddress) {
                    message.warning('请选择需要复制的地址！')
                    return;
                };
                let { parms } = this.state;
                this.props.form.validateFields((err, values) => {
                    let toInitial = React.$toUpperCase(toAddress, 1);
                    let toRemainder = toAddress.slice(1, toAddress.length);
                    let formInitial = React.$toUpperCase(fromAddress, 1);
                    let formRemainder = fromAddress.slice(1, fromAddress.length);
                    //出生地址
                    setTimeout(() => {
                        parms['pat' + toInitial + toRemainder + 'ProvinceID'] = values[fromAddress + 'ProvinceID'];
                        parms['pat' + toInitial + toRemainder + 'CityID'] = values[fromAddress + 'CityID'];
                        parms['pat' + toInitial + toRemainder + 'AreaID'] = values[fromAddress + 'AreaID'];
                        parms['pat' + toInitial + toRemainder + 'AreaDesc'] = parms['pat' + formInitial + formRemainder + 'AreaDesc'] || values[fromAddress + 'AreaDesc'];
                        parms['pat' + toInitial + toRemainder + 'VillageID'] = values[fromAddress + 'VillageID'];
                        parms['pat' + toInitial + toRemainder + 'VillageDesc'] = parms['pat' + formInitial + formRemainder + 'VillageDesc'] || values[fromAddress + 'VillageDesc'];
                        parms['pat' + toInitial + toRemainder + 'AddressDesc'] = fromAddress === 'present' ? values[fromAddress + 'AddressDesc'] : values[fromAddress + 'Address'];
                        parms['pat' + toInitial + toRemainder + 'ZIP'] = parms['pat' + formInitial + formRemainder + 'ZIP'] || values[fromAddress + 'ZIP'];
                        this.props.form.setFieldsValue({
                            [toAddress + 'ProvinceID']: values[fromAddress + 'ProvinceID'],
                            [toAddress + 'CityID']: values[fromAddress + 'CityID'],
                            [toAddress + 'AreaID']: values[fromAddress + 'AreaID'],
                            [toAddress + 'AreaDesc']: parms['pat' + formInitial + formRemainder + 'AreaDesc'] || values[fromAddress + 'AreaDesc'],
                            [toAddress + 'VillageID']: values[fromAddress + 'VillageID'],
                            [toAddress + 'VillageDesc']: parms['pat' + formInitial + formRemainder + 'VillageDesc'] || values[fromAddress + 'VillageDesc'],
                            [toAddress === 'present' ? toAddress + 'AddressDesc' : toAddress + 'Address']: fromAddress === 'present' ? values[fromAddress + 'AddressDesc'] : values[fromAddress + 'Address'],
                            [toAddress + 'ZIP']: parms['pat' + formInitial + formRemainder + 'ZIP'] || values[fromAddress + 'ZIP'],
                        })
                    }, 200)
                    this.state[toAddress + 'City'] = this.state[fromAddress + 'City'];
                    this.state[toAddress + 'Areas'] = this.state[fromAddress + 'Areas'];
                    this.state[toAddress + 'Villages'] = this.state[fromAddress + 'Villages'];
                    this.state[toAddress + 'Hamlets'] = this.state[fromAddress + 'Hamlets'];
                    this.setState({ toAddress: undefined }, () => {
                        this.modifyVisible(false);
                    });
                })
            } catch (error) {
                console.log(error);
            }
        }

        render() {
            const { getFieldDecorator } = this.props.form;
            //证件数据表
            const columns = [{
                key: '1',
                title: '证件类型',
                dataIndex: 'credTypeDesc',
                width: 160,
                align: 'center',
                editable: true,
                render: (text, record, index) => {
                    // const { isAdd, rightUnitDr } = this.state
                    if (record.editable) {
                        return (
                            <Select value={record.credTypeID} style={{ width: '200px', textAlign: 'center' }} onDropdownVisibleChange={() => this.openSelect(record.credTypeID)} onSelect={(e) => this.handleFieldChange(e, 'cardType', record.credID)} disable={this.state.editDis}>
                                {addCredType}
                            </Select>
                        )
                    } if (!record.editable) {
                        return (
                            <Input style={{ textAlign: 'center', border: '0' }}
                                readOnly
                                value={text} />
                        )
                    }
                    return text;
                },
            }, {
                key: '2',
                title: '证件号码',
                dataIndex: 'credNo',
                width: 180,
                align: 'center',
                editable: true,
                render: (text, record, index) => {
                    if (record.editable) {
                        return (
                            <Input
                                value={text} onChange={(e) => this.handleFieldChange(e, 'credNo', record.credID)} />
                        )
                    } if (!record.editable) {
                        return (
                            <Input style={{ textAlign: 'center', border: '0' }}
                                readOnly
                                value={text} />

                        )
                    }
                    return text;
                },
            }, {
                title: '操作',
                dataIndex: 'edit',
                // key: 'action',
                align: 'center',
                key: 'cardEdit',
                width: 90,
                render: (text, record, index) => {
                    if (record.isAdd) {
                        return (
                            <span style={{ textAlign: 'center' }}>
                                <a style={{ color: 'red' }} onClick={(e) => this.cut(e, record.credID)}>删除</a>
                            </span>
                        )
                    }
                    if (!record.editable) {
                        return (
                            <p style={{ margin: '0' }}>
                                <span style={{ textAlign: 'center' }}>
                                    <a onClick={(e) => this.toggleEditable(e, record.credID, record)}>编辑</a>
                                </span>
                                <Divider type="vertical" />
                                <Popconfirm title="是否要删除此行" onConfirm={() => this.delect(record.credID)}>
                                    <a style={{ color: 'red' }} >删除</a>
                                </Popconfirm>
                            </p>
                        )
                    } else {
                        return (
                            <span style={{ textAlign: 'center' }}>
                                <a onClick={(e) => this.cancel(e, record.credID)}>取消</a>
                            </span>
                        )
                    }
                    // if (!record.isAdd) {
                    //     return (
                    //         <Popconfirm title="是否要删除此行" onConfirm={() => this.cut(record.credID)}>
                    //             <a style={{ color: "red" }} >删除</a>
                    //         </Popconfirm>
                    //     )
                    // } else {
                    //     return (
                    //         <a style={{ color: "" }} onClick={(e) => this.del(e, record.credTypeID)}>删除</a>
                    //     )
                    // }
                }
            }];
            let { copyVisible, toAddress, toAddressSelectData, fromAddress, 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 { patFormData, sourceMessage, posMessage, patNameMessage, patBirthMessage, patMobileMessage, patTypeMessage, patAdressMessage,
                patAdressMessageZip, patAdressHouseMessageZip, patAdressComMessageZip, econPhoneMessage, econNameMessage, canSave, parms, baseParms,
                postLoading, credSex, credBirthday, credAge, credCountry, posType, isModefined, isFlag, localProvince, localCity, bindCardArr, allDis, credMustFlag
            } = this.state
            let card = []
            baseParms.cardType && baseParms.cardType.map(item => {
                card.push(<Option key={item.id} disabled={item.disabled ? item.disabled : (isFlag == 3 || isFlag == 4 ? true : false)} value={String(item.id)}>{item.descripts}</Option>)
            })
            let sex = []
            baseParms.sex && baseParms.sex.map(item => {
                sex.push(<Option key={item.code} onClick={() => this.handleKeydownM(3)} value={String(item.code)}>{item.descripts}</Option>)
            })
            let addCredType = []
            let credType = []
            baseParms.credType && baseParms.credType.map(item => {
                credType.push(<Option key={item.code} value={String(item.code)} title={item.descripts} onClick={() => this.handleKeydownM(4, item.id)} role={item.descripts + '^' + item.descriptsSPCode}>{item.descripts}</Option>)
                addCredType.push(<Option key={item.code} value={String(item.code)} disabled={item.code == this.props.form.getFieldValue("patCredTypeCode")} title={item.descripts} role={item.descripts + '^' + item.descriptsSPCode}>{item.descripts}</Option>)
            })
            let ageUnit = []
            baseParms.ageUnit && baseParms.ageUnit.map(item => {
                ageUnit.push(<Option key={item.id} value={String(item.id)}>{item.descripts}</Option>)
            })
            let patType = []
            baseParms.patType && baseParms.patType.map(item => {
                patType.push(<Option key={item.id} value={String(item.id)} onClick={() => this.handleKeydownM(7)}>{item.descripts}</Option>)
            })
            let country = []
            baseParms.country && baseParms.country.map(item => {
                country.push(<Option key={item.id} title={item.descripts} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)}>{item.descripts}</Option>)
            })

            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 patInfo = this.state.parms;
            let provinceItem = [];
            localProvince && localProvince.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>)
            });
            //病人来源渠道
            let patFormOpt = []
            patFormData && patFormData.map(item => {
                patFormOpt.push(<Option key={item.id} onClick={() => this.handleKeydownM(31)} value={item.id} title={item.descripts}>{item.descripts}</Option>)
            })

            // let firstCityItem = []
            //第一次加载的城市;
            localCity && localCity.map(item => {
                firstCityItem.push(<Option provinceid={item.province} 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} 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} title={item.descripts} value={String(item.id)} onClick={() => this.autoFocusVillage('birth', item.zipCode)}>{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)} onClick={() => this.autoFocusVillage('birth', item.zipCode)}>{patInfo.patBirthAreaDesc}</Option>)
            }
            birthVillages && birthVillages.map(item => {
                birthVillagesItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} 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} 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} 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} title={item.descripts} value={String(item.id)} onClick={() => this.autoFocusVillage('native', item.zipCode)}>{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)} onClick={() => this.autoFocusVillage('native', item.zipCode)}>{patInfo.patNativeAreaDesc}</Option>)
            }
            nativeVillages && nativeVillages.map(item => {
                nativeVillagesItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} 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} 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} 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} onClick={() => this.autoFocusVillage('present', item.zipCode)} role={item.descripts + '^' + item.descriptsSPCode} 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)} onClick={() => this.autoFocusVillage('present', item.zipCode)}>{patInfo.patPresentAreaDesc}</Option>)
            }
            presentVillages && presentVillages.map(item => {
                presentVillagesItem.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} 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} 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} 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} onClick={() => this.autoFocusVillage('register', 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)} onClick={() => this.autoFocusVillage('register', item.zipCode)}>{patInfo.patRegisterAreaDesc}</Option>)
            }
            registerVillages && registerVillages.map(item => {
                registerVillagesItem.push(<Option key={item.id} 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} 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} 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} onClick={() => this.autoFocusVillage('company', 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)} onClick={() => this.autoFocusVillage('company', item.zipCode)}>{patInfo.patCompanyAreaDesc}</Option>)
            }
            companyVillages && companyVillages.map(item => {
                companyVillagesItem.push(<Option key={item.id} 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} 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} 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} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)} onClick={() => this.autoFocusVillage('contact', item.zipCode)}>{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)} onClick={() => this.autoFocusVillage('contact', item.zipCode)}>{patInfo.patContactAreaDesc}</Option>)
            }
            contactVillages && contactVillages.map(item => {
                contactVillagesItem.push(<Option key={item.id} 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} 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 nation = []
            baseParms.nation && baseParms.nation.map(item => {
                nation.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} title={item.descripts} value={String(item.id)}>{item.descripts}</Option>)
            })

            let occupation = []
            baseParms.occupation && baseParms.occupation.map(item => {
                occupation.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} title={item.descripts}>{item.descripts}</Option>)
            })

            let marital = []
            baseParms.marital && baseParms.marital.map(item => {
                marital.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)} title={item.descripts}>{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>)
            })

            let relation = []
            baseParms.relation && baseParms.relation.map(item => {
                relation.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} onClick={() => this.handleKeydownM(13)} value={String(item.id)} title={item.descripts}>{item.descripts}</Option>)
            })

            let socialStatus = []
            baseParms.socialStatus && baseParms.socialStatus.map(item => {
                socialStatus.push(<Option key={item.id} role={item.descripts + '^' + item.descriptsSPCode} onClick={() => this.handleKeydownM(1.1)} value={String(item.id)} title={item.descripts}>{item.descripts}</Option>)
            })

            let payMethod = []
            baseParms.payMethod && baseParms.payMethod.map(item => {
                payMethod.push(<Option key={item.id} value={String(item.id)}>{item.descripts}</Option>)
            })

            let bindArr = []
            bindCardArr && bindCardArr.map(item => {
                bindArr.push(<span style={{ color: (item.light == true ? "#1999db" : "rgba(0, 0, 0, 0.75)") }}><span style={{ margin: '0 8px', }}>{item.cardTypeDesc}<span style={{ margin: "0 6px" }}>{item.cardNo}</span>({item.cardStatusDesc})</span></span>)
            })
            const mesIcon = <Icon type="exclamation-circle" />
            return (
                <>
                    {Util.isEmpty(this.state.updateMessage) ? (
                        <div style={{ paddingTop: '86px', display: this.state.modifVisible ? 'block' : 'none' }}>
                            <Empty
                                description={(
                                    <span>
                                        非本院建卡病人暂不支持修改信息！您可以
                                        <span className="span" onClick={this.backList}>
                                            返回
                                        </span>
                                    </span>
                                )}
                            />
                        </div>
                    ) : (
                        <div className={this.props.position && this.props.position === 'fixed' ? 'register-dom-fixed registerDom' : 'registerDom'} style={{ height: '100%', overflow: 'hidden', display: this.state.modifVisible ? 'block' : 'none' }}>
                            {/* <a style={{ fontSize: "16px", paddingLeft: "10px" }} onClick={this.backList}><Icon type="arrow-left" style={{ marginRight: "4px" }} />返回</a> */}
                            <Form style={{ height: '100%', overflow: 'hidden auto' }}>
                                <div className="baseInfoDom oneConts" style={{ padding: '12px 0px' }}>
                                    <Row gutter={60} style={{ position: 'relative' }}>
                                        <Col span={5} style={style} className="patNameDom">
                                            <Tooltip getPopupContainer={() => document.querySelector('.patNameDom')} overlayClassName="toolTipDom patNameC" title={<div className="titleIcon">{mesIcon}<span >{patNameMessage}</span></div>} visible={this.state.patNameVisible} overlayStyle={{ zIndex: 999, }}>
                                                <FormItem {...formItemLayouAdress} label='病人姓名'>
                                                    {getFieldDecorator('patName', {
                                                        validateTrigger: [""],
                                                        initialValue: parms.patName ? parms.patName : undefined,
                                                        rules: [{ required: true, message: '请输入', },
                                                            // { validator: this.validName },
                                                        ],
                                                    })(
                                                        <Input
                                                            onMouseOver={() => this.visibleTip(2)}
                                                            ref={this.patName}
                                                            onPressEnter={() => this.handleKeydownM(2)}
                                                            onBlur={this.patBlur}
                                                            disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}
                                                        />
                                                    )}
                                                </FormItem>
                                            </Tooltip>
                                        </Col>
                                        <Col span={3} style={{ padding: '0' }} className="leftLine">
                                            <FormItem {...formItemLayoutSexy} label="证件类型">
                                                {getFieldDecorator('patCredTypeCode', {
                                                    initialValue: parms.patCredTypeCode || parms.patCredTypeCode == '' ? parms.patCredTypeCode : undefined,
                                                    rules: [{ required: credMustFlag == 'Y' ? true : false, message: '' }],
                                                })(
                                                    <Select ref={this.credType} onChange={this.handleCredNo} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} showSearch allowClear placeholder='请选择证件类型' optionFilterProp="role" onSelect={this.handleCerdType}>
                                                        {credType}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4} style={{ padding: '0' }} className="patNoDom">
                                            <Tooltip overlayClassName="toolTipDom patNoC" getPopupContainer={() => document.querySelector('.patNoDom')} title={<div className="titleIcon">{mesIcon}<span >{posMessage}</span></div>} visible={this.state.posVisible} overlayStyle={{ zIndex: 999 }}>
                                                <FormItem  {...formItemLayouAdress} label='证件号码' className="contentLeft">
                                                    {getFieldDecorator('patCredNo', {
                                                        validateTrigger: ['onPressEnter', 'onBlur'],
                                                        initialValue: parms.patCredNo ? parms.patCredNo : undefined,
                                                        rules: [{ required: posType == '01' || credMustFlag == 'Y' ? true : false, message: '请输入' },
                                                        { validator: posType == '01' ? Util.vailIdCard : '' },],
                                                        getValueFromEvent: (event) => {
                                                            if (posType == '01') {
                                                                return event.target.value.replace(/[^\d|Xx]/g, '')
                                                            }
                                                            else {
                                                                return event.target.value.replace(/[^0-9a-zA-Z]/g, '')
                                                            }
                                                        },
                                                    })(
                                                        <Input
                                                            style={{ padding: '0 2px', }}
                                                            onClick={this.fouceCredNo}
                                                            onMouseOver={() => this.visibleTip(3)}
                                                            maxLength={posType == '01' ? 18 : 99}
                                                            ref={this.patCredNo}
                                                            onPressEnter={this.validCard}
                                                            disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}
                                                            placeholder="完善证件,以便退款"
                                                            onBlur={(e) => this.validCard(e, 2)}
                                                        />
                                                    )}
                                                </FormItem>
                                            </Tooltip>
                                        </Col>
                                        <Col span={4} style={style} className="sexConant leftLine">
                                            <FormItem  {...formItemLayouAdress} label='性别'>
                                                {getFieldDecorator('patSexCode', {
                                                    initialValue: parms.patSexCode ? String(parms.patSexCode) : String(credSex),
                                                    rules: [{ required: true, message: ' ' }],
                                                })(
                                                    <Select ref={this.sex} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}>
                                                        {sex}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4} style={{ padding: "0" }} className="patBirth leftLine">
                                            <Tooltip getPopupContainer={() => document.querySelector('.patBirth')} overlayClassName="toolTipDom patBir" title={<div className="titleIcon">{mesIcon}<span >{patBirthMessage}</span></div>} visible={this.state.patBirthVisible} overlayStyle={{ zIndex: 999 }}>
                                                <Form.Item {...formItemLayoutBirthData} label={"出生日期"}>
                                                    {getFieldDecorator('patBirthDate',
                                                        {
                                                            initialValue: credBirthday ? moment(credBirthday, "YYYY-MM-DD") : (parms.patBirthDateTime ? moment(parms.patBirthDateTime, "YYYY-MM-DD") : (parms.patBirthDateTime ? moment(parms.patBirthDateTime, "YYYY-MM-DD") : undefined)),
                                                            rules: [{ required: true, message: '请选择' }],
                                                        })(
                                                            <DatePicker
                                                                showToday={false}
                                                                style={{ width: '100%' }}
                                                                onBlur={() => this.onChangeTimeBlur()}
                                                                onFocus={() => this.visibleTip(10)}
                                                                ref={this.patBirthDate}
                                                                disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}
                                                                format={this.state.formatType ? 'YYYY-MM-DD' : "YYYYMMDD"}
                                                                onOpenChange={this.handleOnOpenChangeData}
                                                                onChange={this.onPanelChange}
                                                                placeholder={'例:19910101'}
                                                                separator="-"
                                                                allowClear
                                                                disabledDate={(curDate) => {
                                                                    return curDate && curDate > moment().endOf('day');
                                                                }}
                                                            />
                                                        )}
                                                </Form.Item>
                                            </Tooltip>
                                        </Col>
                                        {/* <Col span={2} style={{ padding: "0", position: "absolute", right: "233px" }} className="patBirthTime" >
                                    <FormItem {...formItemLayoutBirthTime}>
                                        {getFieldDecorator('patBirthTime',
                                            {
                                                initialValue: parms.patAge && parms.patBirthTime != "" ? moment(parms.patBirthTime, "HH:mm") : undefined,
                                                rules: [{ required: false, message: '' }],
                                            })(
                                                <TimePicker
                                                    separator=":"
                                                    showToday
                                                    format={this.state.isTransitionStart ? 'HH:mm' : 'HHmm'}
                                                    onOpenChange={this.handleOnOpenChangeStart}
                                                    open={this.state.openTime}
                                                    onKeyDown={this.timeBlur}
                                                    onChange={this.onPanelChangeTime}
                                                    style={{ width: '100%' }}
                                                    placeholder="非必选"
                                                    disabledHours={() => {
                                                        let hours = moment().hours();//0~23
                                                        if (this.state.birthData === moment().format('YYYY-MM-DD')) {
                                                            return MlUtils.range(hours + 1, 24);
                                                        }
                                                    }}
                                                    disabledMinutes={
                                                        () => {
                                                            let minutes = moment().minutes();//0~23
                                                            if (this.state.birthData === moment().format('YYYY-MM-DD')) {
                                                                return MlUtils.range(minutes - 1, 60);
                                                            }
                                                        }
                                                    }
                                                />
                                            )}
                                    </FormItem>
                                </Col> */}
                                        <Col span={4} style={{ padding: '0' }} className="lastLeft leftLine">
                                            <FormItem {...formItemLayouAdress} className="lastRightBorder" label={'年龄'}>
                                                {getFieldDecorator('age', {
                                                    initialValue: credAge ? credAge : (parms.patAge ? parms.patAge : undefined),
                                                    rules: [{ required: false, message: '年龄' },],
                                                })(
                                                    <Input disabled readOnly="ture" style={{ marginRight: '4px', textAlign: 'left' }} />
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row gutter={60} className="borderBottomRow">
                                        <Col span={5} style={style} className="patMobile">
                                            <Tooltip getPopupContainer={() => document.querySelector('.patMobile')} overlayClassName="toolTipDom patNoC" placement="right" title={<div className="titleIcon">{mesIcon}<span >{patMobileMessage}</span></div>} visible={this.state.patMobileVisible} overlayStyle={{ zIndex: 999 }}>
                                                <FormItem {...formItemLayouAdress} label='联系电话'>
                                                    {getFieldDecorator('patMobile', {
                                                        validateTrigger: [""],
                                                        initialValue: parms.patMobile ? parms.patMobile : undefined,
                                                        rules: [{ required: true, message: '请输入', },
                                                        { pattern: new RegExp(/^1\d{10}$/), message: '请输入正确的手机号' }
                                                        ],
                                                        getValueFromEvent: (event) => {
                                                            return event.target.value.replace(/\D/g, '')
                                                        },
                                                    })(
                                                        <Input
                                                            maxLength={11}
                                                            ref={this.patMobile}
                                                            onMouseOver={() => this.visibleTip(4)}
                                                            onBlur={this.patMobileBlur} onPressEnter={() => this.handleKeydownM(6)} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} />
                                                    )}
                                                </FormItem>
                                            </Tooltip>
                                        </Col>
                                        <Col span={3} style={{ padding: '0' }} className="sexConant leftLine" id="patType">
                                            <Tooltip getPopupContainer={() => document.querySelector('#patType')} overlayClassName="toolTipDom patTypeC" title={<div className="titleIcon">{mesIcon}<span >{patTypeMessage}</span></div>} visible={this.state.patTypeVisible} overlayStyle={{ zIndex: 999 }}>
                                                <FormItem  {...formItemLayoutSexy} label='病人类型'>
                                                    {getFieldDecorator('patTypeID', {
                                                        initialValue: parms.patTypeID ? parms.patTypeID : undefined,
                                                        rules: [{ required: true, message: '请选择' }],
                                                    })(
                                                        <Select onMouseEnter={() => this.visibleTip(9)} ref={this.patType} onBlur={this.patTypeBlur} onDropdownVisibleChange={(value) => this.autoNextFocus(value, 7, "patTypeID")} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}>
                                                            {patType}
                                                        </Select>
                                                    )}
                                                </FormItem>
                                            </Tooltip>
                                        </Col>
                                        <Col span={4} style={style} className="leftLine">
                                            <FormItem {...formItemLayouAdress} label='国籍'>
                                                {getFieldDecorator('patCountryID', {
                                                    initialValue: parms.patCountryID ? parms.patCountryID : "44",
                                                    rules: [{ required: false, message: '请选择国籍' }],
                                                })(
                                                    <Select disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} showSearch allowClear optionFilterProp="role" onChange={this.handleCountry}>
                                                        {country}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4} style={style}>
                                            <FormItem {...formItemLayouAdress} label='民族' className="contentLeft">
                                                {getFieldDecorator('patNationID', {
                                                    initialValue: parms.patNationID ? parms.patNationID : '1',
                                                    rules: [{ required: false, message: '' }],
                                                })(
                                                    <Select ref={this.nation} onDropdownVisibleChange={(value) => this.autoNextFocus(value, 8, "patNationID")} disabled={credCountry != 44 || isModefined == 2 || isModefined == 3 || isModefined == 6} showSearch allowClear optionFilterProp="role" >
                                                        {nation}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4}>
                                            <FormItem {...formItemLayoutBirth} label='文化程度'>
                                                {getFieldDecorator('patEduID', {
                                                    initialValue: parms.patEduID ? parms.patEduID : undefined,
                                                })(
                                                    <Select showSearch allowClear optionFilterProp="role"
                                                        filterOption={(input, option) =>
                                                            option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                            || option.props.name.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                        }>
                                                        {educationListOption}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4} style={{ padding: '0' }} className="lastLeft leftLine">
                                            <FormItem {...formItemLayouAdress} className="lastRightBorder" label='婚姻状况'>
                                                {getFieldDecorator('patMaritalID', {
                                                    initialValue: parms.patMaritalID ? parms.patMaritalID : undefined,
                                                    rules: [{ required: false, message: '' }],
                                                })(
                                                    <Select ref={this.patMaritalID} onSelect={() => this.handleKeydownM(21)} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} showSearch allowClear optionFilterProp="role" >
                                                        {marital}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                    </Row>

                                    <Row>
                                        <Col span={5} style={style} className="leftLine">
                                            <FormItem {...formItemLayouAdress} label='职业'>
                                                {getFieldDecorator('patOccupationID', {
                                                    initialValue: parms.patOccupationID ? parms.patOccupationID : undefined,
                                                    rules: [{ required: false, message: '请选择职业' }],
                                                })(
                                                    <Select onSelect={() => this.handleKeydownM(20)} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} showSearch allowClear optionFilterProp="role" >
                                                        {occupation}
                                                    </Select>
                                                )}
                                            </FormItem>
                                        </Col>
                                        <Col span={3} style={{ padding: '0' }} className="patNoDom">
                                            <Form.Item label={"工作单位"} {...formItemLayoutSexy}>
                                                {getFieldDecorator('patCompany',
                                                    {
                                                        initialValue: parms.patCompany ? parms.patCompany : undefined,
                                                        rules: [{ required: false, message: '' }],
                                                    })(
                                                        <Input
                                                            onPressEnter={() => this.handleKeydownM(15)}
                                                            ref={this.patCompany}
                                                            disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} />
                                                    )}
                                            </Form.Item>
                                        </Col>
                                        <Col span={4} style={{ padding: "0" }} className="patBirth leftLine">
                                            <Form.Item label={'单位电话'} {...formItemLayouAdress}>
                                                {getFieldDecorator('patCompanyTel',
                                                    {
                                                        validateTrigger: ["onPressEnter", "onBlur"],
                                                        initialValue: parms.patCompanyTel ? parms.patCompanyTel : undefined,
                                                        rules: [{ required: false, message: '' }],
                                                        getValueFromEvent: (event) => {
                                                            return event.target.value.replace(/[^0-9-]/g, '')
                                                        },
                                                    })
                                                    (
                                                        <Input
                                                            onPressEnter={() => this.handleKeydownM(16)}
                                                            ref={this.patCompanyTel}
                                                            disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}
                                                        />
                                                    )}
                                            </Form.Item>
                                        </Col>
                                    </Row>

                                    <Row className="borderBottomRow">
                                        <Col span={5}>
                                            <FormItem className="lastRightBorder birthLine" label={"出生地址"} {...formItemLayouAdress} >
                                                {getFieldDecorator('birthProvinceID',
                                                    {
                                                        initialValue: parms.patBirthProvinceID ? parms.patBirthProvinceID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.bornProvince}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='省'
                                                            optionFilterProp="role"
                                                            onChange={this.onProvinceChange.bind(this, "birth")}
                                                        >
                                                            {provinceItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('birthCityID',
                                                    {
                                                        initialValue: parms.patBirthCityID ? parms.patBirthCityID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.birthCity}
                                                            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={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('birthAreaID',
                                                    {
                                                        initialValue: parms.patBirthAreaID ? parms.patBirthAreaID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.bornCountry}
                                                            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={5} style={adressStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('birthVillageID',
                                                    {
                                                        initialValue: parms.patBirthVillageID ? parms.patBirthVillageID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.bornVillage}
                                                            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={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('birthHamletID',
                                                    {
                                                        initialValue: parms.patBirthHamletID ? parms.patBirthHamletID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.bornHamlet}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='村'
                                                            optionFilterProp="role"
                                                            onFocus={this.onHamletFocus.bind(this, "birthVillageID", "birth")}
                                                        >
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4} style={{ padding: '0', width: "16.34%" }}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('birthAddress',
                                                    {
                                                        initialValue: parms.patBirthAddressDesc ? parms.patBirthAddressDesc : undefined,
                                                    })(
                                                        <Input placeholder='详细地址(出生)' />
                                                    )}
                                            </FormItem>
                                        </Col>

                                        <Col span={2} style={{ padding: '0' }} className="lastRightBorder">
                                            <div style={{ paddingTop: '10px', paddingLeft: '6px' }}>
                                                <Popconfirm title="确认将其他地址信息一键同步成出生地址吗？" onConfirm={this.handleCopyBirthAddress.bind(this)}>
                                                    <span className="span">一键同步</span>
                                                </Popconfirm>
                                                <Divider type="vertical" />
                                                <span className="span" onClick={() => this.modifyVisible(true, 'birth')}>单个复制</span>
                                            </div>
                                        </Col>
                                    </Row>
                                    <Row className="borderBottomRow">
                                        <Col span={5} >
                                            <FormItem className="lastRightBorder" label={"籍贯"} {...formItemLayouAdress}>
                                                {getFieldDecorator('nativeProvinceID',
                                                    {
                                                        initialValue: parms.patNativeProvinceID ? parms.patNativeProvinceID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.nativeProvince}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='省'
                                                            optionFilterProp="role"
                                                            onChange={this.onProvinceChange.bind(this, "native")}
                                                        >
                                                            {provinceItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('nativeCityID',
                                                    {
                                                        initialValue: parms.patNativeCityID ? parms.patNativeCityID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.nativeCity}
                                                            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={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('nativeAreaID',
                                                    {
                                                        initialValue: parms.patNativeAreaID ? parms.patNativeAreaID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.nativeCountry}
                                                            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={5} style={adressStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('nativeVillageID',
                                                    {
                                                        initialValue: parms.patNativeVillageID ? parms.patNativeVillageID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.nativeVillage}
                                                            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={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('nativeHamletID',
                                                    {
                                                        initialValue: parms.patNativeHamletID ? parms.patNativeHamletID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.nativeHamlet}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='村'
                                                            optionFilterProp="role"
                                                            onFocus={this.onHamletFocus.bind(this, "nativeVillageID", "native")}
                                                        >
                                                            {nativeHamletsItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4} style={{ padding: '0', width: "16.34%" }}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('nativeAddress',
                                                    {
                                                        initialValue: parms.patNativeAddressDesc ? parms.patNativeAddressDesc : undefined,
                                                    })(
                                                        <Input placeholder='详细地址(籍贯)' />
                                                    )}
                                            </FormItem>
                                        </Col>

                                        <Col span={2} style={{ padding: '0' }} className="lastRightBorder">
                                            <div style={{ paddingTop: '10px', paddingLeft: '6px' }}>
                                                <Popconfirm title="确认将其他地址信息一键同步成籍贯地址吗？" onConfirm={this.handleCopyNativeAddress.bind(this)}>
                                                    <span className="span">一键同步</span>
                                                </Popconfirm>
                                                <Divider type="vertical" />
                                                <span className="span" onClick={() => this.modifyVisible(true, 'native')}>单个复制</span>
                                            </div>
                                        </Col>
                                    </Row>
                                    <Row className="borderBottomRow">
                                        <Col span={4}>
                                            <FormItem className="lastRightBorder" label={"现住址"} {...formItemLayouNowAdress} >
                                                {getFieldDecorator('presentProvinceID',
                                                    {
                                                        initialValue: parms.patPresentProvinceID ? parms.patPresentProvinceID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.province}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='省'
                                                            optionFilterProp="role"
                                                            onChange={this.onProvinceChange.bind(this, "present")}
                                                        >
                                                            {provinceItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('presentCityID',
                                                    {
                                                        initialValue: parms.patPresentCityID ? parms.patPresentCityID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.city}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('presentAreaID',
                                                    {
                                                        initialValue: parms.patPresentAreaID ? parms.patPresentAreaID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.country}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('presentVillageID',
                                                    {
                                                        initialValue: parms.patPresentVillageID ? parms.patPresentVillageID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.village}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('presentHamletID',
                                                    {
                                                        initialValue: parms.patPresentHamletID ? parms.patPresentHamletID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.hamlet}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='村'
                                                            optionFilterProp="role"
                                                            onFocus={this.onHamletFocus.bind(this, "presentVillageID", "present")}
                                                        >
                                                            {presentHamletsItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4} style={{ padding: '0', width: "15.8%", position: "relative", }} id="patAdress">
                                            <Tooltip getPopupContainer={() => document.querySelector('#patAdress')} overlayClassName="toolTipDom patAd" title={<div className="titleIcon">{mesIcon}<span >{patAdressMessage}</span></div>} visible={this.state.patAdressVisible} overlayStyle={{ zIndex: 999 }}>
                                                <FormItem className="lastRightBorder nowStarDom" label={""}  {...formItemThreeAdress}>
                                                    {getFieldDecorator('presentAddressDesc',
                                                        {
                                                            rules: [{ required: false, message: '' }],
                                                            initialValue: parms.patPresentAddressDesc ? parms.patPresentAddressDesc : undefined,
                                                        })(
                                                            <Input
                                                                ref={this.patAddress}
                                                                onMouseOver={() => this.visibleTip(5)}
                                                                // ref={this.patAddress}
                                                                // onBlur={this.patAdressBlur}
                                                                // onPressEnter={() => this.handleKeydownM(9)}
                                                                // onBlur={this.onTipsItemBlur.bind(this, "presentAddressDesc", "请填写现住址详细地址")}
                                                                // onPressEnter={this.onTipsItemBlur.bind(this, "presentAddressDesc", "请填写现住址详细地址")}
                                                                placeholder='详细地址(现住址)'
                                                            // onFocus={this.onFocus.bind(this, "presentAddressDesc")}
                                                            />
                                                        )}
                                                </FormItem>
                                                {/* <span className="star">
                                        </span> */}
                                            </Tooltip>
                                        </Col>

                                        <Col span={2} style={{ padding: '0' }} className="lastRightBorder">
                                            <div style={{ paddingTop: '10px', paddingLeft: '6px' }}>
                                                <Popconfirm title="确认将其他地址信息一键同步成现住址吗？" onConfirm={this.handleCopyPresentAddress.bind(this)}>
                                                    <span className="span">一键同步</span>
                                                </Popconfirm>
                                                <Divider type="vertical" />
                                                <span className="span" onClick={() => this.modifyVisible(true, 'present')}>单个复制</span>
                                            </div>
                                        </Col>

                                        <Col span={4} className="lastRightBorder lastLeft leftOLine" id="patAdressZip">
                                            <Tooltip getPopupContainer={() => document.querySelector('#patAdressZip')} overlayClassName="toolTipDom patAd" title={<div className="titleIcon">{mesIcon}<span >{patAdressMessageZip}</span></div>} visible={this.state.patAdressZipVisible} overlayStyle={{ zIndex: 999 }}>
                                                <FormItem label={"邮编"} {...formItemLayouAdress} className="zipBorder">
                                                    {getFieldDecorator('presentZIP',
                                                        {
                                                            initialValue: parms.patPresentZIPDesc ? parms.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}
                                                                ref={this.presentZIP}
                                                                onPressEnter={() => this.handleKeydownM(27)}
                                                                onMouseOver={() => this.visibleTip(13)}
                                                                onBlur={() => this.handleKeydownM(27)}
                                                                disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}
                                                                placeholder='0-9 6位'
                                                            />
                                                        )}
                                                </FormItem>
                                            </Tooltip>
                                        </Col>
                                    </Row>
                                    <Row className="borderBottomRow">
                                        <Col span={4}>
                                            <FormItem className="lastRightBorder" label={"户口地址"} {...formItemLayouNowAdress}>
                                                {getFieldDecorator('registerProvinceID',
                                                    {
                                                        initialValue: patInfo.patRegisterProvinceID ? patInfo.patRegisterProvinceID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.houseProvince}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='省'
                                                            optionFilterProp="role"
                                                            onChange={this.onProvinceChange.bind(this, "register")}
                                                        >
                                                            {provinceItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('registerCityID',
                                                    {
                                                        initialValue: patInfo.patRegisterCityID ? patInfo.patRegisterCityID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.houseCity}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('registerAreaID',
                                                    {
                                                        initialValue: patInfo.patRegisterAreaID ? patInfo.patRegisterAreaID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.houseCountry}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('registerVillageID',
                                                    {
                                                        initialValue: patInfo.patRegisterVillageID ? patInfo.patRegisterVillageID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.houseVillage}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('registerHamletID',
                                                    {
                                                        initialValue: patInfo.patRegisterHamletID ? patInfo.patRegisterHamletID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.houseHamlet}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='村'
                                                            optionFilterProp="role"
                                                            onFocus={this.onHamletFocus.bind(this, "registerVillageID", "register")}
                                                        >
                                                            {registerHamletsItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={5} style={{ padding: '0', width: '17.5%' }} >
                                            <FormItem className="lastRightBorder"  {...formItemThreeAdress}>
                                                {getFieldDecorator('registerAddress',
                                                    {
                                                        initialValue: patInfo.patRegisterAddressDesc ? patInfo.patRegisterAddressDesc : undefined,
                                                    })(
                                                        <Input placeholder='详细地址(户口地址)' />
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={2} style={{ padding: '0' }} className="lastRightBorder">
                                            <div style={{ paddingTop: '10px', paddingLeft: '6px' }}>
                                                <Popconfirm title="确认将其他地址信息一键同步成户口地址吗？" onConfirm={this.handleCopyAddress.bind(this)}>
                                                    <span className="span">一键同步</span>
                                                </Popconfirm>
                                                <Divider type="vertical" />
                                                <span className="span" onClick={() => this.modifyVisible(true, 'register')}>单个复制</span>
                                            </div>
                                        </Col>
                                        <Col span={4} className="lastRightBorder lastLeft leftOLine" id="patAdressHouseZip">
                                            <Tooltip getPopupContainer={() => document.querySelector('#patAdressHouseZip')} overlayClassName="toolTipDom patAd" title={<div className="titleIcon">{mesIcon}<span >{patAdressHouseMessageZip}</span></div>} visible={this.state.patAdressHouseZipVisible} overlayStyle={{ zIndex: 999 }}>
                                                <FormItem label={"邮编"} {...formItemLayouAdress} className="zipBorder">
                                                    {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} ref={this.registerZIP} onMouseOver={() => this.visibleTip(14)} onPressEnter={() => this.handleKeydownM(30)} onBlur={() => this.handleKeydownM(30)} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} placeholder='0-9 6位' />
                                                        )}
                                                </FormItem>
                                            </Tooltip>
                                        </Col>
                                    </Row>
                                    <Row className="borderBottomRow">
                                        <Col span={4}>
                                            <FormItem className="lastRightBorder" label={"单位地址"} {...formItemLayouNowAdress}>
                                                {getFieldDecorator('companyProvinceID',
                                                    {
                                                        initialValue: patInfo.patCompanyProvinceID ? patInfo.patCompanyProvinceID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.companyProvince}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='省'
                                                            optionFilterProp="role"
                                                            onChange={this.onProvinceChange.bind(this, "company")}
                                                        >
                                                            {provinceItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('companyCityID',
                                                    {
                                                        initialValue: patInfo.patCompanyCityID ? patInfo.patCompanyCityID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.companyCity}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('companyAreaID',
                                                    {
                                                        initialValue: patInfo.patCompanyAreaID ? patInfo.patCompanyAreaID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.companyCountry}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('companyVillageID',
                                                    {
                                                        initialValue: patInfo.patCompanyVillageID ? patInfo.patCompanyVillageID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.companyVillage}
                                                            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={5} style={nowAdStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('companyHamletID',
                                                    {
                                                        initialValue: patInfo.patCompanyHamletID ? patInfo.patCompanyHamletID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.companyHamlet}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='村'
                                                            optionFilterProp="role"
                                                            onFocus={this.onHamletFocus.bind(this, "companyVillageID", "company")}
                                                        >
                                                            {companyHamletsItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={8} style={{ padding: '0', width: "25.8%" }} >
                                            <FormItem className="lastRightBorder"  {...formItemThreeAdress}>
                                                {getFieldDecorator('companyAddress',
                                                    {
                                                        initialValue: patInfo.patCompanyAddressDesc ? patInfo.patCompanyAddressDesc : undefined,
                                                    })(
                                                        <Input placeholder='详细地址(单位地址)' />
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={4} className="lastRightBorder lastLeft leftOLine" id="patAdressComZip">
                                            <Tooltip getPopupContainer={() => document.querySelector('#patAdressComZip')} overlayClassName="toolTipDom patAd" title={<div className="titleIcon">{mesIcon}<span >{patAdressComMessageZip}</span></div>} visible={this.state.patAdressComZipVisible} overlayStyle={{ zIndex: 999 }}>
                                                <Form.Item label={"邮编"} {...formItemLayouAdress} className="zipBorder">
                                                    {getFieldDecorator('companyZIP',
                                                        {
                                                            validateTrigger: "",
                                                            initialValue: parms.patCompanyZIPDesc ? parms.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} ref={this.companyZIP} onMouseOver={() => this.visibleTip(15)} onPressEnter={() => this.handleKeydownM(19)} onBlur={() => this.handleKeydownM(19)} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} placeholder='0-9 6位' />
                                                        )}
                                                </Form.Item>
                                            </Tooltip>
                                        </Col>
                                    </Row>
                                    <Row className="borderBottomRow">
                                        <Col span={5}>
                                            <FormItem className="lastRightBorder birthLine" label={"联系人地址"} {...formItemLayouAdress}>
                                                {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={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('contactCityID',
                                                    {
                                                        initialValue: patInfo.patContactCityID ? patInfo.patContactCityID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.econCity}
                                                            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={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('contactAreaID',
                                                    {
                                                        initialValue: patInfo.patContactAreaID ? patInfo.patContactAreaID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.econCountry}
                                                            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={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('contactVillageID',
                                                    {
                                                        initialValue: patInfo.patContactVillageID ? patInfo.patContactVillageID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.econVillage}
                                                            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={5} style={provinceStyle}>
                                            <FormItem className="lastRightBorder">
                                                {getFieldDecorator('contactHamletID',
                                                    {
                                                        initialValue: patInfo.patContactHamletID ? patInfo.patContactHamletID : undefined,
                                                    })(
                                                        <Select
                                                            ref={this.econHamlet}
                                                            allowClear={true}
                                                            showSearch={true}
                                                            placeholder='村'
                                                            optionFilterProp="role"
                                                            onFocus={this.onHamletFocus.bind(this, "contactVillageID", "contact")}
                                                        >
                                                            {contactHamletsItem}
                                                        </Select>
                                                    )}
                                            </FormItem>
                                        </Col>
                                        <Col span={6} style={{ padding: '0', width: "26.34%" }}>
                                            <FormItem className="lastRightBorder" >
                                                {getFieldDecorator('contactAddress',
                                                    {
                                                        initialValue: patInfo.patContactAddressDesc ? patInfo.patContactAddressDesc : undefined,
                                                    })(
                                                        <Input placeholder='详细地址(联系人地址)' />
                                                    )}
                                            </FormItem>
                                        </Col>
                                    </Row>
                                    <Row gutter={60} className="countryLine">
                                        <Col span={5} style={{ padding: '0' }} className="ecoNameDom">
                                            <Tooltip getPopupContainer={() => document.querySelector('.ecoNameDom')} overlayClassName="toolTipDom patNameC" title={<div className="titleIcon">{mesIcon}<span >{econNameMessage}</span></div>} visible={this.state.econNameVisible} overlayStyle={{ zIndex: 999, }}>
                                                <Form.Item label={'联系人姓名'} {...formItemLayouAdress} >
                                                    {getFieldDecorator('patEContact',
                                                        {
                                                            validateTrigger: ["onPressEnter",],
                                                            initialValue: parms.patEContact ? parms.patEContact : undefined,
                                                            // credAge&&parseInt(credAge)<14||parms.patAge&&parseInt(parms.patAge)<14?true:false
                                                            rules: [{ required: parseInt(credAge) < 14 || parseInt(parms.patAge) < 14 || credAge && credAge.indexOf("天") != -1 || parms.patAge && parms.patAge.indexOf("天") != -1 ? true : false, message: '请填写联系人姓名' },
                                                                // { validator: this.validNames }
                                                            ],
                                                        })(
                                                            <Input
                                                                onMouseOver={() => this.visibleTip(12)}
                                                                onPressEnter={() => this.handleKeydownM(11)}
                                                                ref={this.econName}
                                                                disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}
                                                                onBlur={this.patEconNameBlur}
                                                            />
                                                        )}
                                                </Form.Item>
                                            </Tooltip>
                                        </Col>
                                        <Col span={3} style={{ padding: '0' }} className="sexConant leftLine ecorelationDom">
                                            <Tooltip getPopupContainer={() => document.querySelector('.ecorelationDom')} overlayClassName="toolTipDom patNameC" title={<div className="titleIcon">{mesIcon}<span >{this.state.econRelationMessage}</span></div>} visible={this.state.econRelationVisible} overlayStyle={{ zIndex: 999, }}>
                                                <Form.Item label={'联系人关系'} {...formItemLayoutSexy} >
                                                    {getFieldDecorator('patERelationID',
                                                        {
                                                            validateTrigger: ["onPressEnter",],
                                                            initialValue: parms.patERelationID ? parms.patERelationID : undefined,
                                                            rules: [{ required: parseInt(credAge) < 14 || parseInt(parms.patAge) < 14 || credAge && credAge.indexOf("天") != -1 || parms.patAge && parms.patAge.indexOf("天") != -1 ? true : false, message: '请选择' }],
                                                        })(
                                                            <Select
                                                                onMouseOver={() => this.visibleTip(16)}
                                                                onBlur={this.patEconRelationBlur}
                                                                ref={this.econRelation}
                                                                disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}
                                                                showSearch
                                                                allowClear
                                                                optionFilterProp="role"
                                                            >
                                                                {relation}
                                                            </Select>
                                                        )}
                                                </Form.Item>
                                            </Tooltip>
                                        </Col>
                                        <Col span={4} style={{ padding: "0 0 0 12px" }} className="econPhone leftLine">
                                            <Tooltip getPopupContainer={() => document.querySelector('.econPhone')} overlayClassName="toolTipDom patNoNum" placement="right" title={<div className="titleIcon">{mesIcon}<span >{econPhoneMessage}</span></div>} visible={this.state.econPhoneVisible} overlayStyle={{ zIndex: 999 }}>
                                                <Form.Item label={'联系人手机'} {...formItemLayouAdress}>
                                                    {getFieldDecorator('patEContactMobile',
                                                        {
                                                            validateTrigger: ["onPressEnter",],
                                                            initialValue: parms.patEContactMobile ? parms.patEContactMobile : undefined,
                                                            rules: [{
                                                                required: parseInt(credAge) < 14 || parseInt(parms.patAge) < 14 || credAge && credAge.indexOf("天") != -1 || parms.patAge && parms.patAge.indexOf("天") != -1 ? true : false,
                                                                message: '请输入正确的手机号'
                                                            },
                                                            { pattern: new RegExp(/^1\d{10}$|(无|\/)/),message: '请输入正确的手机号或者无或者/' }
                                                            ],
                                                            getValueFromEvent: (event) => {
                                                                return event.target.value.replace(/[^0-9无\/]/g, '');
                                                            },
                                                        })(
                                                            <Input
                                                                onMouseOver={() => this.visibleTip(11)}
                                                                placeholder='请输入联系人手机号或者无或者/'
                                                                maxLength={11}
                                                                onPressEnter={() => this.handleKeydownM(12)}
                                                                onBlur={this.checkPatMobile}
                                                                ref={this.econMobile} disabled={isModefined == 2 || isModefined == 3 || isModefined == 6}
                                                            />
                                                        )}
                                                </Form.Item>
                                            </Tooltip>
                                        </Col>
                                        <Col span={4} style={{ padding: "0 0 0 12px" }} className="patNoDom">
                                            <Tooltip getPopupContainer={() => document.querySelector('.patNoDom')} overlayClassName="toolTipDom patNoNum" placement="right" overlayStyle={{ zIndex: 999 }}>
                                                <Form.Item label={'联系人身份证'} {...formItemLayouAdress}>
                                                    {getFieldDecorator('patEContactCredTypeIDNo', {
                                                        validateTrigger: ["onPressEnter", "onBlur"],
                                                        initialValue: parms.patEContactCredTypeIDNo ? parms.patEContactCredTypeIDNo : undefined,
                                                        rules: [{ required: false, message: '' }],
                                                        getValueFromEvent: (event) => {
                                                            return event.target.value.replace(/[^\d|Xx]/g, '')
                                                        },
                                                    })(
                                                        <Input
                                                            style={{ padding: "0 2px", }}
                                                            onMouseOver={() => this.visibleTip(3)}
                                                            maxLength={18}
                                                            ref={this.patEContactCredTypeIDNo}
                                                        />
                                                    )}
                                                </Form.Item>
                                            </Tooltip>
                                        </Col>
                                        <Col span={4} style={{ padding: '0' }} className="lastLeft leftLine">
                                            <Form.Item label={"身份标签"} {...formItemLayouAdress} className="lastRightBorder">
                                                {getFieldDecorator('patSocialStatusID',
                                                    {
                                                        initialValue: parms.patSocialStatusID ? parms.patSocialStatusID : undefined,
                                                        rules: [{ required: false, message: '' }],
                                                    })(
                                                        <Select ref={this.patSocialStatusID} optionFilterProp="role" showSearch allowClear disabled={isModefined == 2 || isModefined == 3 || isModefined == 6} onChange={this.handleposTag} >
                                                            {socialStatus}
                                                        </Select>
                                                    )}
                                            </Form.Item>
                                        </Col>
                                    </Row>
                                    <Row gutter={60} style={{ padding: '0', border: "1px solid #BFBFBF", borderTop: "0", borderLeft: "0" }}>
                                        <Col span={5} className="lastLeft leftLine ecoNameDom sourceDom">
                                            <Tooltip getPopupContainer={() => document.querySelector('.sourceDom')} overlayClassName="toolTipDom patNoC" placement="right" title={<div className="titleIcon">{mesIcon}<span >{sourceMessage}</span></div>} visible={this.state.sourceVisible} overlayStyle={{ zIndex: 999 }}>
                                                <Form.Item label={"渠道来源"} {...formItemLayouAdress} className="lastRightBorder" style={{ borderTop: "0" }}>
                                                    {getFieldDecorator('patSourceID',
                                                        {
                                                            validateTrigger: ["onPressEnter",],
                                                            initialValue: parms.patSourceID ? parms.patSourceID : undefined,
                                                        })(
                                                            <Select
                                                                ref={this.patSourceID}
                                                                optionFilterProp="role"
                                                                showSearch
                                                                onBlur={this.checkPatSource}
                                                            >
                                                                {patFormOpt}
                                                            </Select>
                                                        )}
                                                </Form.Item>
                                            </Tooltip>
                                        </Col>
                                    </Row>
                                </div>
                                {/* <Divider /> */}
                                <Row gutter={12} className="cardTitle">
                                    <div className="sCard">
                                        <span>完善其他证件类型</span>
                                        <a onClick={this.addCard}>+添加</a>
                                    </div>
                                    <Table
                                        pagination={false}
                                        columns={columns}
                                        dataSource={this.state.tableData}
                                        rowClassName={this.setRowClassName}
                                        bordered
                                        // onRow={this.onClickRow}
                                        rowKey={record => record.key}
                                        // locale={{emptyText:this.state.findInfo}}
                                        style={{
                                            marginTop: '12px', height: '268px',
                                            width: '630px',
                                            overflow: 'auto'
                                        }}
                                    />
                                </Row>
                                <Row style={{ textAlign: 'center', paddingTop: '6px', background: '#fff' }}>
                                    <Col>
                                        <Form.Item wrapperCol={{ span: 24, offset: 18.5 }} >
                                            <Button ghost type="primary" style={{ marginRight: '12px' }} onClick={this.backList}>返回主界面</Button>
                                            <Button
                                                disabled={allDis || canSave}
                                                ref={this.creadCard}
                                                type="primary"
                                                loading={postLoading}
                                                onClick={this.handleSubmit}>
                                                {isModefined == 1 ? '保存修改( ctrl + s )' : '保存修改'}
                                            </Button>
                                        </Form.Item>
                                    </Col>
                                </Row>
                            </Form>
                        </div>
                    )}
                    <Modal
                        title="地址复制"
                        visible={copyVisible}
                        onCancel={() => this.modifyVisible(false)}
                        onOk={this.handleCopyAddressOk}
                    >
                        <div style={{ textAlign: 'center', padding: '12px 0' }}>
                            <div>
                                <span style={{ position: 'relative', padding: '6px 0 6px 22px' }}>数据源：</span>
                                <Select
                                    disabled
                                    showSearch
                                    allowClear
                                    value={fromAddress}
                                    placeholder="请选择"
                                    optionFilterProp="seachprop"
                                    style={{ width: '300px' }}
                                    onChange={Util.handleSelectChange.bind(this, 'fromAddress')}
                                >
                                    {React.$SelectOptions(toAddressSelectData)}
                                </Select>
                            </div>
                            <div style={{ marginTop: '24px' }}>
                                <span style={{ position: 'relative', padding: '6px 0 6px 22px' }} className="formRequired">复制到：</span>
                                <Select
                                    showSearch
                                    allowClear
                                    value={toAddress}
                                    placeholder="请选择"
                                    optionFilterProp="seachprop"
                                    style={{ width: '300px' }}
                                    onChange={Util.handleSelectChange.bind(this, 'toAddress')}
                                >
                                    {React.$SelectOptions(toAddressSelectData.filter(item => item.id !== fromAddress))}
                                </Select>
                            </div>
                        </div>
                    </Modal>
                </>
            )
        }
    });
export default ModificationPatientInfo;
