/*
 * Creator:     ML
 * CreatDate:   2020-04-08
 * descripts：   FRAX评分 (原骨质疏松)
 * */
import React from 'react';
import moment from 'moment';
import store from "store";
import { Form, Col, Select, Icon, Tooltip, Button, Row, TimePicker, DatePicker, Radio, message, Input, Popconfirm, Checkbox } from 'antd';
import { $http } from 'containers/config/https';
import { Util, dayFormat } from 'tools/index';
//组件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 formItemLayoutCenter = {
    labelCol: { span: 2 },
    wrapperCol: { span: 24 },
}
const AssessmentFRAX = Form.create()(
    class AssessmentFRAX 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,
                tipObj: {},
                checkboxOne: [],
                input4Value: "",
                noTip: true,
                patInfoData: {}
            };
        }

        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.onFRAX(this)
            const { userData } = this.state
            document.getElementById('frax-conent').style.height = store.getState().tableHeight.y - 12 + 'px';
            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],
                        })
                    }
                }
            })
            let datas = {}
            datas = {
                params: [{
                    hospID: userData && userData.hospID || "",
                }],
            }
            $http.post('urlS', this, {
                code: '03070033',
                data: datas,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            diseaseArr: res.result.data
                        })
                    }
                }
            })
        }
        getTips = () => {
            let datas = {}
            datas = {
                params: [{
                    healthRecordID: JSON.parse(sessionStorage.getItem('healthRecordID')) || "",
                    assItemCode: "a1504",
                    itemCode: "a2201&a2202"
                }],
            }
            $http.post('urlS', this, {
                code: '03070104',
                data: datas,
                success: function (res) {
                    if (+res.errorCode === 0) {
                        this.setState({
                            tipObj: res.result
                        })
                        console.log("this.sate.input2Value", this.state.input2Value)
                        if (!this.state.input2Value) {
                            this.setState({
                                input2Value: res.result.a2201.descripts
                            })
                        } if (!this.state.input3Value) {
                            this.setState({
                                input3Value: res.result.a2202.descripts
                            })
                        }
                    }
                }
            })
        }
        //日期
        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"),
                    })
                }
            }

        }
        //展开/关闭起始时间
        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);
                    }
                    this.setState({
                        [name + "Value"]: e.target.value,
                        // [name + "Score"]: e.target.score,
                    });
                }
            }
        };
        //输入
        handleInput = (e, name) => {
            if (e.target) {
                window.sessionStorage.setItem("noSave", true);
                this.setState({
                    [name + "Value"]: e.target.value,
                }, () => {
                    if (this.state.input4Value.length == 0) {
                        this.setState({
                            noTip: true
                        })
                    } else {
                        this.setState({
                            noTip: false
                        })
                    }
                })

            }
        }
        del = () => {
            const { userData } = this.state
            let data = {}
            data = {
                params: [{
                    userID: userData && userData.userID || "",
                    healthRecordID: this.state.doctorID,
                    assessCatCode: "a22"
                }],
            }
            $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
                        })
                    }
                }
            })
        }
        clear = (d) => {
            this.props.form.resetFields();
            this.setState({
                oneValue: "",
                oneScore: 0,
                twoValue: "",
                twoScore: 0,
                threeValue: "",
                threeScore: 0,
                fourValue: "",
                fourScore: 0,
                fiveValue: "",
                fiveScore: 0,
                sixValue: 0,
                serValue: "",
                serScore: 0,
                eigValue: "",
                eigScore: 0,
                nineValue: "",
                nineScore: 0,
                zeroaValue: "",
                zeroaScore: 0,
                oneaValue: "",
                oneaScore: 0,
                twoaValue: "",
                twoaScore: 0,
                input1Value: "",
                input2Value: "",
                input3Value: "",
                input4Value: "",
                input5Value: "",
                total: 0,
                collectTime: "",
                tipObj: {},
                checkboxOne: [""],
                noTip: true
                // doctorID:""
            })
            if (d) {
                this.setState({
                    delStatus: true,
                    doctorID: ""
                })
            }
        }
        //获取
        handleGetData = (id) => {
            const { assessData } = this.state
            let data = {}
            data = {
                params: [
                    {
                        healthRecordID: id || "",
                        assessmentCatCode: "a22"
                    }
                ],
            }
            $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
                            })
                        }
                        if (res.result.father[0].ID) {
                            this.setState({
                                delStatus: false
                            })
                        }
                        if (res.result.father[0].children) {
                            let data = res.result.father[0].children
                            let e = data.a2216 || " & "
                            let f = e.split("&")
                            this.setState({
                                checkboxOne: f,
                                oneValue: data.a2201,
                                oneScore: Number(data.a2201note),
                                twoValue: data.a2202,
                                twoScore: Number(data.a2202note),
                                threeValue: data.a2203,
                                threeScore: Number(data.a2203note),
                                input2Value: data.a2204,
                                input2Score: Number(data.a2204note),
                                input3Value: data.a2205,
                                input3Score: Number(data.a2205note),
                                sixValue: data.a2206,
                                sixScore: Number(data.a2206note),
                                serValue: data.a2207,
                                serScore: Number(data.a2207note),
                                eigValue: data.a2208,
                                eigScore: Number(data.a2208note),
                                nineValue: data.a2209,
                                nineScore: Number(data.a2209note),
                                zeroaValue: data.a2210,
                                zeroaScore: Number(data.a2210note),
                                oneaValue: data.a2211,
                                oneaScore: Number(data.a2211note),
                                twoaValue: data.a2212,
                                twoaScore: Number(data.a2212note),
                                BMID: data.a2213,
                                input4Value: data.a2214,
                                noTip: data.a2214 && data.a2214.length > 0 ? false : true,
                                input5Value: data.a2215,
                            })
                            this.props.form.setFieldsValue({ BMID: data.a2213 })
                        }
                    } else {

                    }
                }
            })
            setTimeout(() => {
                this.getTips()
            }, 500)
        }

        //公共下拉框选择
        handleSelectChange(name, e) {
            var id = '';
            if (e) {
                id = e.substring(e.indexOf('^') + 1)
            }
            this.setState({
                [name]: id
            }, () => {
                // console.log("---",this.state.BMID)
            })
        }
        setValue = (id) => {
            this.setState({
                doctorID: id
            }, () => {
                this.handleGetData(id)

            })
        }
        //保存
        handleSave = () => {
            const { userData, assessData, checkboxOne } = this.state
            this.props.form.validateFields((err, values) => {
                if (!err) {
                    let c = checkboxOne
                    let d = c.join("&")
                    let data = {}
                    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 || "",
                                assessCat: [
                                    {
                                        assessCatCode: "a22",
                                        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: [
                                            {
                                                assessItemCode: "a2201",
                                                assessItemValue: this.state.oneValue,
                                                assessNote: this.state.oneScore,
                                            },
                                            {
                                                assessItemCode: "a2202",
                                                assessItemValue: this.state.twoValue,
                                                assessNote: this.state.twoScore,
                                            }, {
                                                assessItemCode: "a2203",
                                                assessItemValue: this.state.threeValue,
                                                assessNote: this.state.threeScore,
                                            }, {
                                                assessItemCode: "a2204",
                                                assessItemValue: this.state.input2Value,
                                                assessNote: "",
                                            }, {
                                                assessItemCode: "a2205",
                                                assessItemValue: this.state.input3Value,
                                                assessNote: "",
                                            }, {
                                                assessItemCode: "a2206",
                                                assessItemValue: this.state.sixValue,
                                                assessNote: this.state.sixScore,
                                            }, {
                                                assessItemCode: "a2207",
                                                assessItemValue: this.state.serValue,
                                                assessNote: this.state.serScore,
                                            }, {
                                                assessItemCode: "a2208",
                                                assessItemValue: this.state.eigValue,
                                                assessNote: this.state.eigScore,
                                            }, {
                                                assessItemCode: "a2209",
                                                assessItemValue: this.state.nineValue,
                                                assessNote: this.state.nineScore,
                                            }, {
                                                assessItemCode: "a2210",
                                                assessItemValue: this.state.zeroaValue,
                                                assessNote: this.state.zeroaScore,
                                            }, {
                                                assessItemCode: "a2211",
                                                assessItemValue: this.state.oneaValue,
                                                assessNote: this.state.oneaScore,
                                            }, {
                                                assessItemCode: "a2212",
                                                assessItemValue: this.state.twoaValue,
                                                assessNote: this.state.twoaScore,
                                            }, {
                                                assessItemCode: "a2213",
                                                assessItemValue: this.props.form.getFieldValue("BMID") || "",
                                                assessNote: "",
                                            }, {
                                                assessItemCode: "a2214",
                                                assessItemValue: this.state.input4Value,
                                                assessNote: "",
                                            }, {
                                                assessItemCode: "a2215",
                                                assessItemValue: this.state.input5Value,
                                                assessNote: "",
                                            }, {
                                                assessItemCode: "a2216",
                                                assessItemValue: d,
                                                // assessNote: "",
                                            },
                                        ]
                                    }
                                ]
                            }
                        ],
                    }
                    $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 {

                            }
                        }
                    })
                }
            })

        }
        handleRadio = (e,) => {
            let tag = e.target;
            let arr = tag.id.split("^")
            if (tag.value) {
                if (tag.type === 'radio' && arr[0].toString() === tag.value.toString()) {
                    this.setState({
                        [arr[1]]: '',
                        [arr[2]]: 0,
                    }, () => {
                        // this.handleTotal()
                    });
                }
            }

        }
        //多选框事件
        handleChangeOne = (e) => {
            if (e[e.length - 1] != "a221603") {
                let newArr = []
                e && e.map((i, s) => {
                    if (i == "a221603") {
                        newArr = e.splice(s + 1)
                        this.setState({
                            checkboxOne: newArr
                        })
                    } else {
                        this.setState({
                            checkboxOne: e
                        })
                    }
                })
            } else if (e.includes("a221603")) {
                let arr = []
                arr.push(e[e.length - 1])
                this.setState({
                    checkboxOne: arr
                })
            } else {
                this.setState({
                    checkboxOne: e
                })
            }
        }
        render() {
            const { getFieldDecorator } = this.props.form;
            const { diseaseArr, assessData, patInfoData, tipObj } = this.state;

            let searchColConfig = {
                xs: { span: 24 },
                sm: { span: 12 },
                md: { span: 10 },
                lg: { span: 6 }
            }
            let bmdArr = [
                {
                    descripts: "超声骨密度",
                    id: "a221301",
                    descriptsSPCode: "CSGMD"
                }, {
                    descripts: "GE—Lunar",
                    id: "a221302",
                    descriptsSPCode: "GELUNAR"

                }, {
                    descripts: "Hologic",
                    id: "a221303",
                    descriptsSPCode: "Hologic"
                }, {
                    descripts: "Mindways QCT",
                    id: "a221304",
                    descriptsSPCode: "MindwaysQCT"
                }
            ]
            //采集人
            let diseaseOp = []
            diseaseArr && diseaseArr.map(item => {
                diseaseOp.push(<Option key={item.id} onClick={() => window.sessionStorage.setItem("noSave", true)} title={item.descripts} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)}>{item.descripts}</Option>)
            })
            let bmdOp = []
            bmdArr && bmdArr.map(item => {
                bmdOp.push(<Option key={item.id} onClick={() => window.sessionStorage.setItem("noSave", true)} title={item.descripts} role={item.descripts + '^' + item.descriptsSPCode} value={String(item.id)}>{item.descripts}</Option>)
            })

            //查询类型 searchArr 
            let searchArr = [
                {
                    id: "reg",
                    descripts: "a机型",
                    descriptsSPCode: "01",
                }, {
                    id: "book",
                    descripts: "b机型",
                    descriptsSPCode: "02",
                },
            ]
            //查询类型
            let searchOp = []
            searchArr && searchArr.map(item => {
                searchOp.push(<Option key={item.id} value={item.id}>{item.descripts}</Option>)
            })
            return (
                <div className="assess-dom psychological-dom oso-dom">
                    <Row style={{ textAlign: "center" }}>
                        <h2>FRAX评分</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" id="frax-conent" onClick={(e) => this.handleRadio(e)}>
                        <Row>
                            <Col span={8} style={{ height: 35, lineHeight: '35px', textAlign: 'center' }}>
                                <div style={{ display: 'flex' }}>
                                    <div style={{ fontSize: '16px', color: 'black', fontWeight: 'bold' }}>年龄：</div>
                                    <div style={{ width: '60%', borderBottom: '1px solid #e8e8e8' }}>
                                        {patInfoData && patInfoData.patAge || "--"}
                                    </div>
                                </div>
                            </Col>
                            <Col span={8} style={{ height: 35, lineHeight: '35px', textAlign: 'center' }}>
                                <div style={{ display: 'flex' }}>
                                    <div style={{ fontSize: '16px', color: 'black', fontWeight: 'bold' }}>出生日期：</div>
                                    <div style={{ width: '60%', borderBottom: '1px solid #e8e8e8' }}>
                                        {patInfoData && patInfoData.patBirthDateTime || "--"}
                                    </div>
                                </div>
                            </Col>
                            <Col span={8} style={{ height: 35, lineHeight: '35px', textAlign: 'center' }}>
                                <div style={{ display: 'flex' }}>
                                    <div style={{ fontSize: '16px', color: 'black', fontWeight: 'bold' }}>性别：</div>
                                    <div style={{ width: '60%', borderBottom: '1px solid #e8e8e8' }}>
                                        {patInfoData && patInfoData.patSexDesc || "--"}
                                    </div>
                                </div>
                            </Col>
                        </Row>

                        <div style={{ marginTop: 5, height: store.getState().tableHeight.y - 110, overflow: 'auto' }}>
                            <Col className="new-dom" span={20} style={{ borderLeft: "1px solid #e8e8e8", borderRight: "1px solid #e8e8e8" }}>
                                <div className='card-title-style'>
                                    <div className="title-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8' }}>
                                        <span>指标</span>
                                    </div>
                                    <div className="title-dom" style={{ width: '35%', float: 'right' }}>
                                        <span>选项/值</span>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>体重(kg)</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Input type="number" value={this.state.input2Value} onChange={(e) => this.handleInput(e, "input2")} ></Input>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>身高(cm)</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Input type="number" value={this.state.input3Value} onChange={(e) => this.handleInput(e, "input3")} ></Input>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>既往骨折史</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Radio.Group onChange={(e) => this.handleChange(e, "six")} value={this.state.sixValue}>
                                            <Radio value={"a220601"} id={this.state.sixValue + "^" + "sixValue" + "^" + "sixScore" + "^" + "a1901"}>无</Radio>
                                            <Radio value={"a220602"} id={this.state.sixValue + "^" + "sixValue" + "^" + "sixScore" + "^" + "a19001"}>是</Radio>
                                        </Radio.Group>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>父母髋骨骨折</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Radio.Group onChange={(e) => this.handleChange(e, "ser")} value={this.state.serValue}>
                                            <Radio value={"a220701"} id={this.state.serValue + "^" + "serValue" + "^" + "serScore" + "^" + "a90"}>无</Radio>
                                            <Radio value={"a220702"} id={this.state.serValue + "^" + "serValue" + "^" + "serScore" + "^" + "a900"}>是</Radio>
                                        </Radio.Group>
                                    </div>
                                </div>
                                <div className='card-title-style3' >
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10, height: 88, }}>
                                        <span>目前抽烟行为</span>
                                        <p style={{ marginTop: "-8px", color: "red", textIndent: "6px" }}>
                                            {tipObj.a2208 && tipObj.a2208.descripts || ""}
                                        </p>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10, height: 88, lineHeight: "88px" }}>
                                        <Radio.Group style={{ lineHeight: "54px" }} onChange={(e) => this.handleChange(e, "eig")} value={this.state.eigValue}>
                                            <Radio value={"a220801"} id={this.state.eigValue + "^" + "eigValue" + "^" + "eigScore" + "^" + "a10"}>无</Radio>
                                            <Radio value={"a220802"} id={this.state.eigValue + "^" + "eigValue" + "^" + "eigScore" + "^" + "a100"}>是</Radio>
                                        </Radio.Group>
                                    </div>
                                    {/* <div style={{ marginTop: "-8px", color: "red", textIndent: "6px",position:"absolute",right:"0" }}>
                                            {tipObj.a2208}
                                    </div> */}
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>糖皮质激素的使用</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Radio.Group onChange={(e) => this.handleChange(e, "nine")} value={this.state.nineValue}>
                                            <Radio value={"a220901"} id={this.state.nineValue + "^" + "nineValue" + "^" + "nineScore" + "^" + "a1nineScore900"}>无</Radio>
                                            <Radio value={"a220902"} id={this.state.nineValue + "^" + "nineValue" + "^" + "nineScore" + "^" + "a1nineSco900"}>是</Radio>
                                        </Radio.Group>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>类风湿关节炎</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Radio.Group onChange={(e) => this.handleChange(e, "zeroa")} value={this.state.zeroaValue}>
                                            <Radio value={"a221001"} id={this.state.zeroaValue + "^" + "zeroaValue" + "^" + "zeroScore" + "^" + "a1nre900"} >无</Radio>
                                            <Radio value={"a221002"} id={this.state.zeroaValue + "^" + "zeroaValue" + "^" + "zeroScore" + "^" + "a1nre90"} >是</Radio>
                                        </Radio.Group>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10, height: "99px" }}>
                                        <span>继发性骨质疏松症（1型糖尿病、成骨不全症、长期未治疗的甲状腺功能亢进症、性腺功能减退症、早绝经小于45岁、慢性营养不良或吸收不良、慢性肝病）</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10, height: "99px" }}>
                                        <Radio.Group style={{ lineHeight: "99px" }} onChange={(e) => this.handleChange(e, "onea")} value={this.state.oneaValue}>
                                            <Radio value={"a221101"} id={this.state.oneaValue + "^" + "oneaValue" + "^" + "oneaScore" + "^" + "a1ne900"}>无</Radio>
                                            <Radio value={"a221102"} id={this.state.oneaValue + "^" + "oneaValue" + "^" + "oneaScore" + "^" + "a1nre900"}>是</Radio>
                                        </Radio.Group>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10, height: "128px" }}>
                                        <span>每日酒精摄取量达3个单位或以上（相当于啤酒855ml，葡萄酒120ml，烈性酒90ml）</span>
                                        <p style={{ marginTop: "-8px", color: "red", textIndent: "6px" }}>
                                            {tipObj.a2212 && tipObj.a2212.descripts || ""}
                                        </p>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10, height: "128px" }}>
                                        <Radio.Group style={{ lineHeight: "98px" }} onChange={(e) => this.handleChange(e, "twoa")} value={this.state.twoaValue}>
                                            <Radio value={"a221201"} id={this.state.twoaValue + "^" + "twoaValue" + "^" + "twoaScore" + "^" + "anSc00"}>无</Radio>
                                            <Radio value={"a221202"} id={this.state.twoaValue + "^" + "twoaValue" + "^" + "twoaScore" + "^" + "anSco900"}>是</Radio>
                                        </Radio.Group>
                                    </div>
                                </div>
                                <div className='card-title-style3 borderBMID'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10, height: 68, lineHeight: "68px" }}>
                                        <span>骨密度（BMD）机型</span>
                                    </div>
                                    <Col
                                        span={6}
                                        // style={padding}
                                        className="select-item"
                                        style={{ margin: "0px 0 0 0px", width: "35%" }}
                                    >
                                        <FormItem {...formItemLayoutPeo}  >
                                            {getFieldDecorator('BMID', {
                                            })(
                                                <Select
                                                    style={{ width: "120%", marginLeft: "10px", textAlign: "left", }}
                                                    showSearch={true}
                                                    optionFilterProp="role"
                                                    allowClear
                                                >
                                                    {bmdOp}
                                                </Select>
                                            )}
                                        </FormItem>
                                    </Col>
                                    {/* <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Select
                                            style={{ width: "96%", textAlign: "left", }}
                                            optionFilterProp="role"
                                            allowClear
                                            showSearch
                                            getPopupContainer={triggerNode => triggerNode.parentNode}
                                            filterOption={(input, option) =>
                                                option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                                || option.props.code.toLowerCase().indexOf(input.toLowerCase()) >= 0
                                            }
                                            onChange={this.handleSelectChange.bind(this, 'BMID')}>
                                            {bmdOp}
                                        </Select>
                                    </div> */}
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>骨密疏松检查结果(T值)</span>
                                        <span style={{ marginLeft: "4px", color: "red" }}>
                                            {
                                                this.state.noTip || this.state.input4Value > -1 ? " " : this.state.input4Value > -2.5 && this.state.input4Value <= -1 ? "骨量低下" : this.state.input4Value <= 2.5 ? "骨质疏松症" : ""
                                            }
                                        </span>
                                        {/* <span style={{ marginRight: "10px", cursor: "pointer" }} onClick={() => this.tipsShow("cTips")}>
                                        <span className="why">?</span>
                                        <span style={{ color: "#faad14" }}>阈值说明</span>
                                        </span> */}
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Input value={this.state.input4Value} placeholder="请输入" type="Number" onChange={(e) => this.handleInput(e, "input4")} ></Input>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>骨密度评分</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Input value={this.state.input5Value} placeholder="请输入" onChange={(e) => this.handleInput(e, "input5")} ></Input>
                                    </div>
                                </div>
                                <div className='card-title-style3'>
                                    <div className="item-dom" style={{ width: '65%', float: 'left', borderRight: '1px solid #e8e8e8', paddingLeft: 10 }}>
                                        <span>骨关节炎评估:是否有骨关节疼痛?</span>
                                    </div>
                                    <div className="item-dom" style={{ width: '35%', float: 'right', paddingLeft: 10 }}>
                                        <Checkbox.Group onChange={(e) => this.handleChangeOne(e)} value={this.state.checkboxOne}>
                                            <Checkbox id={this.state.threeaValue + "^" + "threeaValue" + "^" + "oneScore" + "^" + "threea01"} value={"a221601"}>颈肩周炎</Checkbox>
                                            <Checkbox id={this.state.threeaValue + "^" + "threeaValue" + "^" + "oneScore" + "^" + "threea02"} value={"a221602"}>腰椎间盘突出等</Checkbox>
                                            <Checkbox id={this.state.threeaValue + "^" + "threeaValue" + "^" + "oneScore" + "^" + "threea03"} value={"a221603"}>无</Checkbox>
                                        </Checkbox.Group>
                                    </div>
                                </div>
                            </Col>
                        </div>
                        {/* <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={2}>
                                <p>
                                    1、年龄
                                </p>
                            </Col>
                            <Col span={12}>
                                <span>{patInfoData && patInfoData.patAge || "--"}</span>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={2}>
                                <p>
                                    2、出生日期
                                </p>
                            </Col>
                            <Col span={12}>
                                <span>{patInfoData && patInfoData.patBirthDateTime || "--"}</span>
                            </Col>
                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={2}>
                                <p>
                                    3、性别
                                </p>
                            </Col>
                            <Col span={12}>
                                <span>{patInfoData && patInfoData.patSexDesc || "--"}</span>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    4、体重（kg）
                                </p>
                            </Col>
                            <Col span={2}>
                                <Input type="number" value={this.state.input2Value} onChange={(e) => this.handleInput(e, "input2")} ></Input>
                            </Col>
                        </Row>

                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    5、身高(cm)
                                </p>
                            </Col>
                            <Col span={2}>
                                <Input type="number" value={this.state.input3Value} onChange={(e) => this.handleInput(e, "input3")} ></Input>
                            </Col>
                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    6、既往骨折史
                                </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "six")} value={this.state.sixValue}>
                                    <Radio value={"a220601"} id={this.state.sixValue + "^" + "sixValue" + "^" + "sixScore" + "^" + "a1901"}>无</Radio>
                                    <Radio value={"a220602"} id={this.state.sixValue + "^" + "sixValue" + "^" + "sixScore" + "^" + "a19001"}>是</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    7、父母髋骨骨折
                        </p></Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "ser")} value={this.state.serValue}>
                                    <Radio value={"a220701"} id={this.state.serValue + "^" + "serValue" + "^" + "serScore" + "^" + "a90"}>无</Radio>
                                    <Radio value={"a220702"} id={this.state.serValue + "^" + "serValue" + "^" + "serScore" + "^" + "a900"}>是</Radio>
                                </Radio.Group></Col>
                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    8、目前抽烟行为
                        </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "eig")} value={this.state.eigValue}>
                                    <Radio value={"a220801"} id={this.state.eigValue + "^" + "eigValue" + "^" + "eigScore" + "^" + "a10"}>无</Radio>
                                    <Radio value={"a220802"} id={this.state.eigValue + "^" + "eigValue" + "^" + "eigScore" + "^" + "a100"}>是</Radio>
                                </Radio.Group>
                            </Col>

                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    9、肾上腺皮质激素服用
                                 </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "nine")} value={this.state.nineValue}>
                                    <Radio value={"a220901"} id={this.state.nineValue + "^" + "nineValue" + "^" + "nineScore" + "^" + "a1nineScore900"}>无</Radio>
                                    <Radio value={"a220902"} id={this.state.nineValue + "^" + "nineValue" + "^" + "nineScore" + "^" + "a1nineSco900"}>是</Radio>
                                </Radio.Group>
                            </Col>
                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    10、风湿性关节炎
                                 </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "zeroa")} value={this.state.zeroaValue}>
                                    <Radio value={"a221001"} id={this.state.zeroaValue + "^" + "zeroaValue" + "^" + "zeroScore" + "^" + "a1nre900"} >无</Radio>
                                    <Radio value={"a221002"} id={this.state.zeroaValue + "^" + "zeroaValue" + "^" + "zeroScore" + "^" + "a1nre90"} >是</Radio>
                                </Radio.Group>
                            </Col>
                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    11、继发性骨质疏松症
                                 </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "onea")} value={this.state.oneaValue}>
                                    <Radio value={"a221101"} id={this.state.oneaValue + "^" + "oneaValue" + "^" + "oneaScore" + "^" + "a1ne900"}>无</Radio>
                                    <Radio value={"a221102"} id={this.state.oneaValue + "^" + "oneaValue" + "^" + "oneaScore" + "^" + "a1nre900"}>是</Radio>
                                </Radio.Group>
                            </Col>
                        </Row>
                        <Row style={{ display: "flex", paddingBottom: "0" }}>
                            <Col span={5}>
                                <p>
                                    12、每日酒精摄取量达3个单位或以上
                                 </p>
                            </Col>
                            <Col span={12}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "twoa")} value={this.state.twoaValue}>
                                    <Radio value={"a221201"} id={this.state.twoaValue + "^" + "twoaValue" + "^" + "twoaScore" + "^" + "anSc00"}>无</Radio>
                                    <Radio value={"a221202"} id={this.state.twoaValue + "^" + "twoaValue" + "^" + "twoaScore" + "^" + "anSco900"}>是</Radio>
                                </Radio.Group>
                            </Col>
                        </Row>
                        <Row style={{ paddingBottom: "10px" }}>
                            <p>
                                13、  骨密度（BMD）
                                 </p>
                            <Col {...searchColConfig} style={{ display: "flex", alignItems: "center", paddingLeft: "22px" }}>
                                <p style={{ margin: "0 0 0 12px", width: "198px",textAlign:"center"}}>BMD机型</p>
                                <Input value={this.state.input1Value} placeholder="请输入" onChange={(e) => this.handleInput(e, "input1")} ></Input>
                            </Col>
                        </Row> */}

                    </div>
                </div>
            );
        }
    })
export default AssessmentFRAX
