/*
 * Creator:     ML
 * CreatDate:   2020-06-03
 * descripts：  骨质疏松一分钟问卷(原骨质疏松)
 * */
import React from 'react';
import moment from 'moment';
import { dayFormat } from 'tools/index';
import { Form, Col, Select, Icon, Tooltip, Button, Row, TimePicker, DatePicker, Radio, message, Popconfirm, Input } from 'antd';
import { $http } from 'containers/config/https';
import store from 'store';
//组件const
const Option = Select.Option;
const FormItem = Form.Item;
const padding = {
    padding: "0px"
}
const formItemLayout = { // label 和input宽度
    labelCol: { span: 3 },
    wrapperCol: { span: 20 }
}
const formItemLayoutPeo = {
    labelCol: { span: 6 },
    wrapperCol: { span: 18 }
}
const formItemLayoutDataForm = {
    labelCol: { span: 8 },
    wrapperCol: { span: 16 },
}
const formItemLayoutDate = {
    labelCol: { span: 7 },
    wrapperCol: { span: 17 },
}
const formItemLayouts = {
    labelCol: { span: 3 },
    wrapperCol: { span: 24 }
}
const AssessmentOsteoporosis = Form.create()(
    class AssessmentOsteoporosis extends React.Component {
        constructor(props) {
            let userData = sessionStorage.getItem("userData") ? JSON.parse(sessionStorage.getItem("userData")) : {};
            let assessData = sessionStorage.getItem("assessData") ? JSON.parse(sessionStorage.getItem("assessData")) : {};
            super(props);
            var date = new Date();
            this.state = {
                userData,
                assessData,
                diseaseArr: [],
                diseaseSubArr: [],
                typeArr: [],
                StartDate: undefined,  // //开始日期
                EndDate: moment(date).format(dayFormat),  // //结束日期
                advicelogMessage: "",
                advicelogVisible: false,
                requid: this.props.requireds,
                requireds: true,
                isTransitionStart: true,
                doctor: "",
                delStatus: true,
                a330401Show: false,
                formatType: true,
                a33040101Value: "",
                a33040102Value: "",
                patInfoData: {},
                tipObj: {},
                itemObj: {
                    a3301: "",
                    a3302: "",
                    a3303: "",
                    a3304: "",
                    a33040101: "",
                    a33040102: "",
                    a3305: "",
                    a3306: "",
                    a3307: "",
                    a3308: "",
                    a3309: "",
                    a3310: "",
                    a3311: "",
                    a3312: "",
                    a3313: "",
                    a3314: "",
                    a3315: "",
                    a3316: "",
                    a3317: "",
                    a3318: "",
                    a3319: "",
                },
            };

        }

        componentWillReceiveProps(nextProps) {
            if (nextProps.doctorID != this.state.doctor) {
                if (nextProps.doctorID) {
                    this.handleGetData(nextProps.doctorID)
                    this.setState({
                        doctorID: nextProps.doctorID,
                        doctor: nextProps.doctorID
                    })
                }
            }
        }
        componentDidMount = () => {
            this.props.onOso(this)
            const { userData } = this.state
            // this.handleGetData()
            document.getElementById('oso-conent').style.height = store.getState().tableHeight.y - 30 + 'px';
            let data = {}
            data = {
                params: [{
                    hospID: userData && userData.hospID || "",
                }],
            }
            $http.post('urlS', this, {
                code: '03070033',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            diseaseArr: res.result.data
                        })
                    }
                }
            })
            this.getInfo()

        }
        getTips = (name, a3304) => {
            const { patInfoData } = this.state
            let datas = {}
            let itemObj = this.state.itemObj
            datas = {
                params: [{
                    healthRecordID: JSON.parse(sessionStorage.getItem('healthRecordID')) || "",
                    assItemCode: "a1504",
                    itemCode: "a3304&a3309&a3315&a3317&a3319&a3316&&a3307"
                }],
            }
            $http.post('urlS', this, {
                code: '03070104',
                data: datas,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        itemObj.a3304 = itemObj.a3304 && itemObj.a3304 || res.result.a3304.code
                        itemObj.a3309 = itemObj.a3309 && itemObj.a3309 || res.result.a3309.code
                        itemObj.a3315 = itemObj.a3315 && itemObj.a3315 || res.result.a3315.code
                        itemObj.a3317 = itemObj.a3317 && itemObj.a3317 || res.result.a3317.code
                        itemObj.a3319 = itemObj.a3319 && itemObj.a3319 || res.result.a3319.code
                        itemObj.a3316 = itemObj.a3316 && itemObj.a3316 || res.result.a3316.code
                        itemObj.a3307 = itemObj.a3307 && itemObj.a3307 || res.result.a3307.code
                        //删除后 直接获取 设置年龄默认
                        if (!name) {
                            if (patInfoData && patInfoData.patAge && parseInt(patInfoData.patAge) > 40) {
                                itemObj.a3303 = "a330301"
                            } else {
                                itemObj.a3303 = "a330302"
                            }
                        }
                        //如果获取信息时 没有操作是否骨折 设置默认
                        console.log("a3304", a3304)
                        if (!a3304) {
                            if (res.result.a3304.code == "a330401") {
                                this.setState({
                                    a330401Show: true
                                })
                            } if (res.result.a3304.code == "a330402") {
                                this.setState({
                                    a330401Show: false
                                })
                            }
                        }
                        this.setState({
                            tipObj: res.result,
                            itemObj
                        }, () => {

                        })
                    }
                }
            })
        }
        getInfo = () => {
            let data = {}
            data = {
                params: [{
                    patID: JSON.parse(sessionStorage.getItem('patID')) || "",
                }],
            }
            $http.post('urlS', this, {
                code: '03070028',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        // console.log("res.result[0]",res.result[0])
                        this.setState({
                            patInfoData: res.result[0],
                        })
                    }
                }
            })
        }
        //日期 调查
        onPanelChange = (n, v) => {
            if (!v) {
                if (n == 1) {
                    window.sessionStorage.setItem("noSave", true);
                    this.setState({
                        dateF: "",
                    })
                } else {
                    this.setState({
                        dateT: ""
                    })
                }
            } else {
                if (n == 1) {
                    window.sessionStorage.setItem("noSave", true);
                    this.setState({
                        dateF: moment(v).format("YYYY-MM-DD"),
                    })
                } else {
                    this.setState({
                        dateT: moment(v).format("YYYY-MM-DD"),
                    })
                }
            }

        }
        //日期 骨折时间
        handleChangeDate = (v, name) => {
            if (v) {
                window.sessionStorage.setItem("noSave", true);
                let itemObj = this.state.itemObj
                itemObj[name] = moment(v).format("YYYY-MM-DD")
                this.setState({
                    itemObj,
                })
            }
        }
        //展开/关闭起始时间
        handleOnOpenChangeStart = (status) => {
            if (!status) {
                this.setState({ isTransitionStart: true })
            } else {
                this.setState({ isTransitionStart: false })
            }
        }

        handleChange = (e, name) => {
            if (e.target) {
                if (name) {
                    if (this.state[name + "Value"] !== e.target.value) {
                        window.sessionStorage.setItem("noSave", true);
                    } else {
                        window.sessionStorage.setItem("noSave", false);
                    }
                    let itemObj = this.state.itemObj
                    // let itemObjValue = this.state.itemObjValue
                    itemObj[name] = e.target.value
                    // itemObjValue[name + "note"] = e.target.score
                    this.setState({
                        itemObj,
                        // itemObjValue,
                        [name + 'score']: e.target.score,
                        [name + 'Value']: e.target.value

                    }, () => {
                        //有骨折 需要填写骨折时间 和 部位
                        if (name == "a3304" && e.target.value == "a330401") {
                            this.setState({
                                a330401Show: true
                            })
                        } if (name == "a3304" && e.target.value == "a330402") {
                            itemObj.a330402 = undefined
                            itemObj.a33040101 = ""
                            this.setState({
                                a330401Show: false,
                                itemObj,
                            })
                        }
                    });
                }
            }
        };
        handleInput = (e, name) => {
            if (e.target) {
                if (this.state[name + "Value"] !== e.target.value) {
                    window.sessionStorage.setItem("noSave", true);
                } else {
                    window.sessionStorage.setItem("noSave", false);
                }
                let itemObj = this.state.itemObj
                itemObj[name] = e.target.value
                this.setState({
                    itemObj,
                    // [name + "Value"]: e.target.value
                })

            }
        }
        del = () => {
            const { userData } = this.state
            let data = {}
            data = {
                params: [{
                    userID: userData && userData.userID || "",
                    healthRecordID: this.state.doctorID,
                    assessCatCode: "a33"
                }],
            }
            $http.post('urlS', this, {
                code: '03070081',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        message.success("删除成功")
                        window.sessionStorage.setItem("noSave", false);
                        this.clear()
                        this.props.getPress()
                        this.setState({
                            delStatus: true
                        })
                        this.getTips()
                    }
                }
            })
        }
        clear = (d) => {
            this.props.form.resetFields();
            let itemObj = {
                a3301: "",
                a3302: "",
                a3303: "",
                a3304: "",
                a33040101: "",
                a33040102: "",
                a3305: "",
                a3306: "",
                a3307: "",
                a3308: "",
                a3309: "",
                a3310: "",
                a3311: "",
                a3312: "",
                a3313: "",
                a3314: "",
                a3315: "",
                a3316: "",
                a3317: "",
                a3318: "",
                a3319: "",
            }
            this.setState({
                itemObj,
                collectTime: "",
                a330401Show: false
                // doctorID:""
            }, () => {
            })
            if (d) {
                this.setState({
                    delStatus: true,
                    doctorID: ""
                })
            }
        }
        //获取
        handleGetData = (id) => {
            const { assessData, itemObj, patInfoData } = this.state
            let data = {}
            data = {
                params: [
                    {
                        healthRecordID: id,
                        assessmentCatCode: "a33"
                    }
                ],
            }
            $http.post('urlS', this, {
                code: '03070037',
                data: data,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.props.form.resetFields();

                        if (res.result.doctorID) {
                            this.setState({
                                healthDoctorID: res.result.doctorID
                            })
                        }
                        if (res.result.doctorID && res.result.father) {
                            this.setState({
                                collectTime: res.result.father[0].collectTime,
                            })
                            this.props.form.setFieldsValue({ diseaseID: res.result.father[0].collectUserID, collectDate: moment(res.result.father[0].collectDate), });
                        } else {
                            //清空 
                            this.clear()
                            this.setState({
                                delStatus: true
                            })
                            this.getTips()
                        }
                        if (res.result.father[0].ID) {
                            this.setState({
                                delStatus: false
                            })
                        }
                        if (res.result.father[0].children) {
                            let data = res.result.father[0].children
                            let itemObj = this.state.itemObj
                            // let itemObjValue = this.state.itemObjValue
                            for (let i in data) {
                                if (i.includes("note")) {
                                    // itemObjValue[i] = Number(data[i])
                                } else {
                                    itemObj[i] = data[i]
                                    //   if( itemObj[i]==data){
                                    //        itemObj[i] = data[i]
                                    //   }else{
                                    //     itemObj[i]=""
                                    //   }
                                }
                            }
                            if (itemObj.a3303 == "") {
                                if (patInfoData && patInfoData.patAge && parseInt(patInfoData.patAge) > 40) {
                                    itemObj.a3303 = "a330301"
                                } else {
                                    itemObj.a3303 = "a330302"
                                }
                            }
                            if (itemObj.a3304 == "a330401") {
                                this.setState({
                                    a330401Show: true
                                }, () => {
                                    // itemObj.a33040101 = itemObj.a33040101
                                    this.props.form.setFieldsValue({ a33040102: moment(itemObj.a33040102), a33040101: itemObj.a33040101 });
                                })
                            } else {
                                this.handleClearInput()
                            }
                            this.setState({
                                itemObj,
                                // itemObjValue,
                            }, () => {
                                this.getTips("name", itemObj.a3304)
                            })
                        }

                    } else {

                    }
                }
            })

        }
        setValue = (id) => {
            // console.log("id---------",id)
            this.setState({
                doctorID: id
            }, () => {
                this.handleGetData(id)
            })
        }
        //保存
        handleSave = () => {
            const { userData, assessData, itemObj } = this.state

            this.props.form.validateFields((err, values) => {
                if (!err) {
                    let data = {}
                    let assessItem = []
                    for (let i in itemObj) {
                        let obj = {}
                        obj['assessItemCode'] = i;
                        obj['assessItemValue'] = itemObj[i]
                        // obj['assessNote'] = this.state[i + 'score']
                        assessItem.push(obj)
                    }
                    console.log("assessItem", assessItem)
                    data = {
                        params: [
                            {
                                doctorID: this.state.healthDoctorID || "",//体检记录责任医生 
                                locID: userData && userData.locID || "",
                                hospID: userData && userData.hospID || "",
                                patID: sessionStorage.getItem("patID") ? JSON.parse(sessionStorage.getItem("patID")) : "",
                                healthRecordID: this.state.doctorID && this.state.doctorID || "",
                                assessCat: [
                                    {
                                        assessCatCode: "a33",
                                        collectDate: values.collectDate ? moment(values.collectDate).format('YYYY-MM-DD') : moment(moment()).format('YYYY-MM-DD'),
                                        collectTime: this.state.collectTime || moment(moment()).format('HH:mm:ss'),
                                        collectUserID: values.diseaseID || "",
                                        assessItem,
                                    }
                                ]
                            }
                        ],
                    }
                    $http.post('urlS', this, {
                        code: '03070035',
                        data: data,
                        success: function (res) {
                            if (+res.errorCode === 0) {
                                // if (this.state.doctorID && this.state.doctorID) {
                                //     message.success("更新成功")
                                // } else {
                                //     message.success("保存成功")
                                // }
                                this.setState({
                                    delStatus: false
                                })
                                window.sessionStorage.setItem("healthRecordID", res.result.healthRecordID);
                                window.sessionStorage.setItem("noSave", false);
                                if (!this.state.doctorID) {

                                } this.props.updateList()
                                this.props.getPress()
                                message.success("保存成功")
                                this.handleGetData(res.result.healthRecordID)
                            } else {

                            }
                        }
                    })
                }
            })

        }
        //清空骨折input信息
        handleClearInput = () => {
            let itemObj = this.state.itemObj
            itemObj["a33040101"] = ""
            itemObj["a33040102"] = undefined
            this.props.form.setFieldsValue({ a33040102: undefined, a33040101: "" });
            this.setState({
                a330401Show: false,
                itemObj,
            })
        }
        handleRadio = (e,) => {
            let tag = e.target;
            let arr = tag.id.split("^")
            if (tag.value) {
                if (tag.type === 'radio' && arr[0].toString() === tag.value.toString()) {
                    let itemObj = this.state.itemObj
                    // let itemObjValue = this.state.itemObjValue
                    itemObj[arr[1]] = ""
                    if (arr[1] == "a3304") {
                        this.handleClearInput()
                    }
                    this.setState({
                        itemObj,
                    }, () => {
                    });
                }
            }
        }
        //日期面板打开/关闭
        handleOnOpenChangeData = (status, name) => {
            this.setState({
                [name]: !status
            })
        }
        render() {
            const { getFieldDecorator } = this.props.form;
            const { collArr, diseaseArr, diseaseSubArr, assessData, typeArr, statusArr, columns, widthTotal, tipObj } = this.state;
            var date = new Date();
            let searchColConfig = {
                xs: { span: 24 },
                sm: { span: 12 },
                md: { span: 10 },
                lg: { span: this.props && this.props.modal ? 8 : 6 }
            }
            const mesIcon = <Icon type="exclamation-circle" />
            //疾病
            let diseaseOp = []
            diseaseArr && diseaseArr.map(item => {
                diseaseOp.push(<Option key={item.id} title={item.descripts} onClick={() => window.sessionStorage.setItem("noSave", true)} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)}>{item.descripts}</Option>)
            })
            //疾病症状
            let diseaseSubOp = []
            diseaseSubArr && diseaseSubArr.map(item => {
                diseaseSubOp.push(<Option className="DoctorAdviceFind-optionLeft" key={item.admID} role={item.admStr + '^' + item.admStr} title={item.admStr} value={String(item.admID)}>{item.thisTime == "Y" ? <span style={{ color: "#1999db", marginRight: "4px" }}>本次</span> : ""}{item.admStr}</Option>)
            })
            // console.log("this.props.required",this.props.requireds,"this.state.requid",this.state.requid)
            return (
                <div className="assess-dom psychological-dom">
                    <Row style={{ textAlign: "center" }}>
                        <h2>骨质疏松一分钟问卷</h2>
                    </Row>
                    <Row style={{ position: "relative" }}>
                        <Form>
                            <Col span={4} className="starDataDom" style={{ padding: "0" }}>
                                <FormItem label='调查时间' {...formItemLayoutDataForm}>
                                    {getFieldDecorator('collectDate', {
                                        initialValue: moment(),
                                        rules: [{ required: false, message: '' }],
                                    })(
                                        <DatePicker onChange={(v) => this.onPanelChange(1, v)} style={{ width: '100%' }} placeholder={'调查日期'} disabledDate={(curDate) => {
                                            return curDate && curDate > moment().endOf('day');
                                        }} />
                                    )}
                                </FormItem>
                            </Col>
                            <Col
                                span={6}
                                // style={padding}
                                className="select-item"
                                style={{ marginLeft: "16px" }}
                            >
                                <FormItem {...formItemLayoutPeo} label={this.props.locale && this.props.locale == 'EN' ? 'disease' : '采集人'} >
                                    {getFieldDecorator('diseaseID', {
                                        initialValue: this.state.userData && this.state.userData.userID || undefined,
                                        rules: [{ required: true, message: '请选择采集人' }]
                                    })(
                                        <Select
                                            style={{ width: "100%", textAlign: "left", }}
                                            showSearch={true}
                                            optionFilterProp="role"
                                            allowClear
                                        >
                                            {diseaseOp}
                                        </Select>
                                    )}
                                </FormItem>
                            </Col>
                            <Col span={2} style={{ paddingLeft: "0", position: "absolute", right: "96px" }}>
                                <FormItem  {...formItemLayout}>
                                    {getFieldDecorator('findData', {
                                        initialValue: undefined,
                                        rules: [{ required: false, message: '' }],
                                    })(
                                        <div style={{ display: "flex", marginTop: "4px" }}>
                                            <Popconfirm disabled={this.state.delStatus} title="删除不可恢复，你确定要删除吗?" onConfirm={() => this.del()} >
                                                <Button type="danger" style={{ color: this.state.delStatus ? "#bfbfbf" : "#ffff", cursor: this.state.delStatus ? "not-allowed" : "pointer", background: this.state.delStatus ? "#fff" : "#ff7875", border: this.state.delStatus ? "1px solid #bfbfbf" : "1px solid #ff7875" }}  >删除评估</Button>
                                            </Popconfirm>
                                            {/* <Button style={{ background: "#fff", color: "#1890ff", margin: "0 18px 0 18px" }} type="primary">打印</Button> */}
                                            {/* <Button onClick={this.handleSave} type="primary">{this.state.doctorID && this.state.doctorID ? "更新" : "保存"}</Button> */}
                                            <Button style={{ margin: "0 18px 0 18px" }} onClick={this.handleSave} type="primary">保存</Button>
                                        </div>
                                    )}
                                </FormItem>
                            </Col>
                        </Form>
                    </Row>
                    <p style={{ background: "#f5f4f4", height: "8px", margin: "0" }}>
                    </p>
                    <div className="conent osteop-dom" id="oso-conent" onClick={(e) => this.handleRadio(e)}>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8} >
                                <p>
                                    1、父母曾被诊断有骨质疏松或曾在轻摔后骨折？
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3301")} value={this.state.itemObj.a3301}>
                                    <Radio value={"a330101"} id={this.state.itemObj.a3301 + "^" + "a3301" + "^" + "a3301note" + "^" + "a330101"}>是</Radio>
                                    <Radio value={"a330102"} id={this.state.itemObj.a3301 + "^" + "a3301" + "^" + "a3301note" + "^" + "a33101"}>否</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8} >
                                <p>
                                    2、父母中一人有驼背？
                                </p></Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3302")} value={this.state.itemObj.a3302}>
                                    <Radio value={"a330201"} id={this.state.itemObj.a3302 + "^" + "a3302" + "^" + "a3302note" + "^" + "a330201"}>是</Radio>
                                    <Radio value={"a330202"} id={this.state.itemObj.a3302 + "^" + "a3302" + "^" + "a3302note" + "^" + "a33020"}>否</Radio>
                                </Radio.Group></Col>
                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8} >
                                <p>
                                    3、实际年龄超过40 岁？<span style={{ color: "red" }}>
                                        {"（年龄" + (this.state.patInfoData && this.state.patInfoData.patAge ? this.state.patInfoData.patAge : "--") + "）"}
                                    </span>
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3303")} value={this.state.itemObj.a3303}>
                                    <Radio value={"a330301"} id={this.state.itemObj.a3303 + "^" + "a3303" + "^" + "a3303note" + "^" + "a19001"}>是</Radio>
                                    <Radio value={"a330302"} id={this.state.itemObj.a3303 + "^" + "a3303" + "^" + "a3303note" + "^" + "a190201"}>否</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8} >
                                <p>
                                    4、是否成年后因为轻摔后发生骨折？  <span style={{ color: "red", textIndent: "6px" }}>
                                        {tipObj && tipObj.a3304 ? tipObj.a3304.descripts : ""}
                                    </span>
                                </p>

                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3304")} value={this.state.itemObj.a3304}>
                                    <Radio value={"a330401"} id={this.state.itemObj.a3304 + "^" + "a3304" + "^" + "a3304note" + "^" + "a3304"}>是</Radio>
                                    <Radio value={"a330402"} id={this.state.itemObj.a3304 + "^" + "a3304" + "^" + "a3304note" + "^" + "a190201"}>否</Radio>
                                </Radio.Group>


                            </Col>
                        </Row>
                        <Row style={{ display: (this.state.a330401Show ? "block" : "none"), padding: "0 0 0 22px" }}>
                            <Col span={6} style={{ marginRight: "52px" }}>
                                <FormItem  {...formItemLayoutDate} label="骨折部位" style={{ margin: "0", padding: "0", border: "0" }}>
                                    {getFieldDecorator('a33040101', {
                                        initialValue: undefined,
                                        rules: [{ required: this.state.a330401Show ? true : false, message: '请输入骨折部位' }],
                                    })(
                                        <Input value={this.state.itemObj.a33040101} onChange={(e,) => this.handleInput(e, "a33040101")}></Input>
                                    )}
                                </FormItem>
                            </Col>
                            <Col span={6}>
                                <FormItem  {...formItemLayoutDate} label="发生时间" style={{ margin: "0", padding: "0", border: "0" }}>
                                    {getFieldDecorator('a33040102', {
                                        initialValue: undefined,
                                        rules: [{ required: this.state.a330401Show ? true : false, message: '请选择发生时间' }],
                                    })(
                                        <DatePicker
                                            placeholder={'例:20010101'}
                                            format={this.state.formatType ? 'YYYY-MM-DD' : 'YYYYMMDD'}
                                            separator="-"
                                            onOpenChange={(e) => this.handleOnOpenChangeData(e, "formatType")}
                                            style={{ width: '100%' }} value={this.state.itemObj && this.state.itemObj.a33040102 ? moment(this.state.itemObj.a33040102).format('YYYY-MM-DD') : moment()} onChange={(v) => this.handleChangeDate(v, "a33040102")}
                                            disabledDate={(curDate) => {
                                                return curDate && curDate > moment().endOf('day');
                                            }} />
                                    )}
                                </FormItem>
                            </Col>
                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8} >
                                <p>
                                    5、是否经常摔倒(去年超过一次)，或因为身体较虚弱而担心摔倒？
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3305")} value={this.state.itemObj.a3305}>
                                    <Radio value={"a330501"} id={this.state.itemObj.a3305 + "^" + "a3305" + "^" + "a3305note" + "^" + "a0201"}>是</Radio>
                                    <Radio value={"a330502"} id={this.state.itemObj.a3305 + "^" + "a3305" + "^" + "a3305note" + "^" + "a190201"}>否</Radio>
                                </Radio.Group>
                            </Col>
                        </Row>

                        <Row style={{ display: "flex", alignItems: "center", background: (this.state.patInfoData && this.state.patInfoData.patAge && parseInt(this.state.patInfoData.patAge) > 40 ? "#fff" : "#cccccc30") }}
                            title={this.state.patInfoData && this.state.patInfoData.patAge && parseInt(this.state.patInfoData.patAge) > 40 ? "" : "仅限年龄超过40岁用户回答"}
                        >
                            <Col span={8}  >
                                <p style={{ color: (this.state.patInfoData && this.state.patInfoData.patAge && parseInt(this.state.patInfoData.patAge) > 40 ? "#333" : "#ccc") }}>
                                    6、40岁后的身高是否减少超过3cm以上？
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group
                                    disabled={this.state.patInfoData && this.state.patInfoData.patAge && parseInt(this.state.patInfoData.patAge) > 40 ? false : true}
                                    onChange={(e) => this.handleChange(e, "a3306")} value={this.state.itemObj.a3306}>
                                    <Radio value={"a330601"} id={this.state.itemObj.a3306 + "^" + "a3306" + "^" + "a3306note" + "^" + "a1900"}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patAge && parseInt(this.state.patInfoData.patAge) > 40 ? "#333" : "#ccc") }}>是</span></Radio>
                                    <Radio value={"a330602"} id={this.state.itemObj.a3306 + "^" + "a3306" + "^" + "a3306note" + "^" + "a190"}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patAge && parseInt(this.state.patInfoData.patAge) > 40 ? "#333" : "#ccc") }}>否</span></Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8}   >
                                <p >
                                    7、是否体质量过轻?(BMI值少于19kg/m2）<span style={{ color: "red", textIndent: "6px" }}>
                                        {tipObj && tipObj.a3307 ? tipObj.a3307.descripts : ""}</span>
                                </p>
                            </Col>
                            <Col span={12}>

                                <Radio.Group onChange={(e) => this.handleChange(e, "a3307")} value={this.state.itemObj.a3307}>
                                    <Radio value={"a330701"} id={this.state.itemObj.a3307 + "^" + "a3307" + "^" + "a3307note" + "^" + "a1900"}>是</Radio>
                                    <Radio value={"a330702"} id={this.state.itemObj.a3307 + "^" + "a3307" + "^" + "a3307note" + "^" + "a190"}>否</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8}  >
                                <p>
                                    8、是否曾服用类固醇激素连续超过3个月？
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3308")} value={this.state.itemObj.a3308}>
                                    <Radio value={"a330801"} id={this.state.itemObj.a3308 + "^" + "a3308" + "^" + "a3308note" + "^" + "a100"} score={1}>是</Radio>
                                    <Radio value={"a330802"} id={this.state.itemObj.a3308 + "^" + "a3308" + "^" + "a3308note" + "^" + "a900"} score={2}>否</Radio>

                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8} >
                                <p>
                                    9、 是否患有类风湿关节炎？  <span style={{ color: "red", textIndent: "6px" }}>
                                        {tipObj && tipObj.a3309 ? tipObj.a3309.descripts : ""}
                                    </span>
                                </p>

                            </Col>
                            <Col span={12} >
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3309")} value={this.state.itemObj.a3309}>
                                    <Radio value={"a330901"} id={this.state.itemObj.a3309 + "^" + "a3309" + "^" + "a3309note" + "^" + "a1nineScore900"} score={1}>是</Radio>
                                    <Radio value={"a330902"} id={this.state.itemObj.a3309 + "^" + "a3309" + "^" + "a3309note" + "^" + "a1900"} score={2}>否</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>

                            <Col span={8} >
                                <p>
                                    10、 是否被诊断出有甲亢或是甲旁亢、1?型糖尿病、克罗恩病或乳糜泻等胃肠疾病或营养不良？
                                </p>
                            </Col>
                            <Col span={12}>

                                <Radio.Group onChange={(e) => this.handleChange(e, "a3310")} value={this.state.itemObj.a3310}>
                                    <Radio value={"a331001"} id={this.state.itemObj.a3310 + "^" + "a3310" + "^" + "a3310note" + "^" + "a1nre900"} score={1}>是</Radio>
                                    <Radio value={"a331002"} id={this.state.itemObj.a3310 + "^" + "a3310" + "^" + "a3310note" + "^" + "a1nineScre900"} score={2}>否</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center", background: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#cccccc30" : "#fff") }}
                            title={this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "仅限女性用户回答" : ""}>
                            <Col span={8} >
                                <p style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>
                                    11、 女士回答：是否在45岁或以前就停经？
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group
                                    title={this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "仅限女性用户回答" : ""}
                                    disabled={this.state.patInfoData && this.state.patInfoData.patSexCode != "2"} onChange={(e) => this.handleChange(e, "a3311")} value={this.state.itemObj.a3311}>
                                    <Radio value={"a331101"} id={this.state.itemObj.a3311 + "^" + "a3311" + "^" + "a3311note" + "^" + "a1no900"} score={1}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>是</span></Radio>
                                    <Radio value={"a331102"} id={this.state.itemObj.a3311 + "^" + "a3311" + "^" + "a3311note" + "^" + "a1ninSco900"} score={2}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>否</span></Radio>
                                </Radio.Group>
                            </Col>
                        </Row>
                        <Row style={{ display: "flex", alignItems: "center", background: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#cccccc30" : "#fff") }}
                            title={this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "仅限女性用户回答" : ""}>
                            <Col span={8} >
                                <p style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>
                                    12、 女士回答：除了怀孕、绝经或子宫切除外，是否曾停经超过12个月？
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group
                                    title={this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "仅限女性用户回答" : ""}
                                    disabled={this.state.patInfoData && this.state.patInfoData.patSexCode != "2"} onChange={(e) => this.handleChange(e, "a3312")} value={this.state.itemObj.a3312}>
                                    <Radio value={"a331201"} id={this.state.itemObj.a3312 + "^" + "a3312" + "^" + "a3312note" + "^" + "anSco900"} score={1}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>是</span></Radio>
                                    <Radio value={"a331202"} id={this.state.itemObj.a3312 + "^" + "a3312" + "^" + "a3312note" + "^" + "a1ninSco900"} score={2}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>否</span></Radio>

                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row
                            style={{ display: "flex", alignItems: "center", background: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#cccccc30" : "#fff") }}
                            title={this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "仅限女性用户回答" : ""}
                        >
                            <Col span={8}  >

                                <p style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>
                                    13、女士回答：是否在50岁前切除卵巢又没有服用雌/孕激素补充剂？
                                </p>
                            </Col>
                            <Col span={12}>

                                <Radio.Group
                                    disabled={this.state.patInfoData && this.state.patInfoData.patSexCode != "2"}
                                    onChange={(e) => this.handleChange(e, "a3313")} value={this.state.itemObj.a3313}>
                                    <Radio value={"a331301"} id={this.state.itemObj.a3313 + "^" + "a3313" + "^" + "a3313note" + "^" + "anS900"} score={1}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>是</span></Radio>
                                    <Radio value={"a331302"} id={this.state.itemObj.a3313 + "^" + "a3313" + "^" + "a3313note" + "^" + "an900"} score={2}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "2" ? "#ccc" : "#333") }}>否</span></Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center", background: (this.state.patInfoData && this.state.patInfoData.patSexCode != "1" ? "#cccccc30" : "#fff") }} title={this.state.patInfoData && this.state.patInfoData.patSexCode != "1" ? "仅限男性用户回答" : ""}>
                            <Col span={8}  >

                                <p style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "1" ? "#ccc" : "#333") }}>
                                    14、男性回答：是否出现过阳萎、性欲减退或其他雄激素过低的相关症状？
                                </p>
                            </Col>
                            <Col span={12}>

                                <Radio.Group
                                    disabled={this.state.patInfoData && this.state.patInfoData.patSexCode != "1"}
                                    onChange={(e) => this.handleChange(e, "a3314")} value={this.state.itemObj.a3314}>
                                    <Radio value={"a331401"} id={this.state.itemObj.a3314 + "^" + "a3314" + "^" + "a3314note" + "^" + "anS00"} score={1}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "1" ? "#ccc" : "#333") }}>是</span></Radio>
                                    <Radio value={"a331402"} id={this.state.itemObj.a3314 + "^" + "a3314" + "^" + "a3314note" + "^" + "a900"} score={2}><span style={{ color: (this.state.patInfoData && this.state.patInfoData.patSexCode != "1" ? "#ccc" : "#333") }}>否</span></Radio>

                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8}  >
                                <p>
                                    15、是否经常大量饮酒(每天饮用超过两单位的乙醇，相当于啤酒1斤、葡萄酒3两或烈性酒1两)？ <span style={{ color: "red", textIndent: "6px" }}>
                                        {tipObj && tipObj.a3315 ? tipObj.a3315.descripts : ""}
                                    </span>
                                </p>

                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3315")} value={this.state.itemObj.a3315}>
                                    <Radio value={"a331501"} id={this.state.itemObj.a3315 + "^" + "a3315" + "^" + "a3315note" + "^" + "an00"} score={1}>是</Radio>
                                    <Radio value={"a331502"} id={this.state.itemObj.a3315 + "^" + "a3315" + "^" + "a3315note" + "^" + "anS0"} score={2}>否</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8} >
                                <p>
                                    16、目前习惯吸烟，或曾经吸烟？ <span style={{ color: "red", textIndent: "6px" }}>
                                        {tipObj && tipObj.a3316 ? tipObj.a3316.descripts : ""}
                                    </span>
                                </p>

                            </Col>
                            <Col span={12}>

                                <Radio.Group onChange={(e) => this.handleChange(e, "a3316")} value={this.state.itemObj.a3316}>
                                    <Radio value={"a331601"} id={this.state.itemObj.a3316 + "^" + "a3316" + "^" + "a3316note" + "^" + "asixaValuen00"} score={1}>是</Radio>
                                    <Radio value={"a331602"} id={this.state.itemObj.a3316 + "^" + "a3316" + "^" + "a3316note" + "^" + "asixaValn00"} score={2}>否</Radio>

                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8}  >
                                <p>
                                    17、每天运动量少于30min？(包括做家务、走路和跑步等) <span style={{ color: "red", textIndent: "6px" }}>
                                        {tipObj && tipObj.a3317 ? tipObj.a3317.descripts : ""}
                                    </span>
                                </p>

                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3317")} value={this.state.itemObj.a3317}>
                                    <Radio value={"a331701"} id={this.state.itemObj.a3317 + "^" + "a3317" + "^" + "a3317note" + "^" + "asixaVuen00"} score={1}>是</Radio>
                                    <Radio value={"a331702"} id={this.state.itemObj.a3317 + "^" + "a3317" + "^" + "a3317note" + "^" + "asixaValu00"} score={2}>否</Radio>

                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8} >
                                <p>
                                    18、是否不能食用乳制品，又没有服用钙片？
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3318")} value={this.state.itemObj.a3318}>
                                    <Radio value={"a331801"} id={this.state.itemObj.a3318 + "^" + "a3318" + "^" + "a3318note" + "^" + "asiuen00"} score={1}>是</Radio>
                                    <Radio value={"a331802"} id={this.state.itemObj.a3318 + "^" + "a3318" + "^" + "a3318note" + "^" + "aVuen00"} score={2}>否</Radio>

                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", alignItems: "center" }}>
                            <Col span={8}  >
                                <p>
                                    19、每天从事户外活动时间是否少于10min，又没有服用维生素D？  <span style={{ color: "red", textIndent: "6px" }}>
                                        {tipObj && tipObj.a3319 ? tipObj.a3319.descripts : ""}
                                    </span>
                                </p>

                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a3319")} value={this.state.itemObj.a3319}>
                                    <Radio value={"a331901"} id={this.state.itemObj.a3319 + "^" + "a3319" + "^" + "a3319note" + "^" + "asin00"} score={1}>是</Radio>
                                    <Radio value={"a331902"} id={this.state.itemObj.a3319 + "^" + "a3319" + "^" + "a3319note" + "^" + "uen00"} score={2}>否</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                    </div>
                </div>
            );
        }
    })
export default AssessmentOsteoporosis
