/*
 * Creator:     ML
 * CreatDate:   2020-04-08
 * descripts：  ADC评分
 * */
import React from 'react';
import moment from 'moment';
import store from 'store';
import { dayFormat } from 'tools/index';
import { Form, Col, Select, Icon, Tooltip, Button, Row, TimePicker, DatePicker, Radio, message, Table, Popconfirm, Checkbox } from 'antd';
import { $http } from 'containers/config/https';
//组件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 formItemLayouts = {
    labelCol: { span: 3 },
    wrapperCol: { span: 24 }
}
const AssessmentADC = Form.create()(
    class AssessmentADC extends React.Component {
        constructor(props) {
            super(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,
                patInfoData: {},
                total: 0,
                ageTips: false,
                cTips: false,
                delStatus: true,
                doctor: "",
                itemObj: {
                    a270101: "",
                    a270102: "",
                    a270103: "",
                    a270201: "",
                    a270202: "",
                    a270203: "",
                    a2703: "",
                    a270401: "",
                    a270402: "",
                },
                itemObjValue: {
                    a270101note: "",
                    a270102note: "",
                    a270103note: "",
                    a270201note: "",
                    a270202note: "",
                    a270203note: "",
                    a2703note: "",
                    a270401note: "",
                    a270402note: "",
                }
            };
        }

        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.onRef(this)
            const { userData } = this.state
            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
                        })
                    }
                }
            })
            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) {
                        this.setState({
                            patInfoData: res.result[0],
                        })
                    }
                }
            })
            document.getElementById('adc-conent').style.height = store.getState().tableHeight.y - 118 + 'px';
        }
        //日期
        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 })
            }
        }
        total() {
            let total = 0
            let itemObjValue = this.state.itemObjValue
            let itemValue = Object.values(itemObjValue)
            itemValue.map(item => total += Number(item))
            // var arr = []
            // for (let i in itemObjValue) {
            //     let o = {};
            //     o[i] = itemObjValue[i]; //即添加了key值也赋了value值 o[i] 相当于o.name 此时i为变量
            //     arr.push(o)
            // }
            // console.log(arr,"arr---")
            // for (let i in arr) {
            //     if (i.includes("note")) {
            //         total+=Number(i)
            //     } else {

            //     }
            // }
            this.setState({
                total
            })
        }
        handleChange = (e, name) => {
            if (e.target) {
                if (name) {
                    if (this.state[name + "score"] !== 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

                    }, () => {
                        this.total()
                    });
                }
            }
        };
        setValue = (id) => {
            this.setState({
                doctorID: id
            }, () => {
                this.handleGetData(id)
            })
        }
        del = () => {
            const { userData } = this.state
            let data = {}
            data = {
                params: [{
                    userID: userData && userData.userID || "",
                    healthRecordID: this.state.doctorID,
                    assessCatCode: "a27"
                }],
            }
            $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.setState({
                            delStatus: true
                        })
                    }
                }
            })
        }
        clear = (d) => {
            if (d) {
                this.setState({
                    delStatus: true,
                    doctorID: ""
                })
            }
            this.props.form.resetFields();
            let itemObj = {
                a270101: "",
                a270102: "",
                a270103: "",
                a270201: "",
                a270202: "",
                a270203: "",
                a270401: "",
                a270402: "",
            };
            let itemObjValue = {
                a270101note: "",
                a270102note: "",
                a270103note: "",
                a270201note: "",
                a270202note: "",
                a270203note: "",
                a270401note: "",
                a270402note: "",
            }
            this.setState({
                itemObj,
                itemObjValue,
                total: 0,
                collectTime: ""
            })
        }
        //获取
        handleGetData = (id) => {
            const { assessData, itemObj } = this.state
            let data = {}
            data = {
                params: [
                    {
                        healthRecordID: id,
                        assessmentCatCode: "a27"
                    }
                ],
            }
            $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, identifyUserID: res.result.father[0].identifyUserID, 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 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]
                                }
                            }
                            this.setState({
                                itemObj,
                                itemObjValue,
                                total: Number(res.result.father[0].assessmentCatScore)
                            }, () => {
                            })
                        }
                    } else {

                    }
                }
            })
        }
        //保存
        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)
                    }
                    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: "a27",
                                        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 || "",
                                        identifyUserID: values.identifyUserID || "",
                                        score: this.state.total,
                                        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("保存成功")
                                // }
                                window.sessionStorage.setItem("healthRecordID", res.result.healthRecordID);
                                window.sessionStorage.setItem("noSave", false);
                                if (!this.state.doctorID) {

                                } this.props.updateHeathList()
                                this.setState({
                                    delStatus: false
                                })
                                message.success("保存成功")
                                this.handleGetData(res.result.healthRecordID)
                            } else {

                            }
                        }
                    })
                }
            })

        }
        handleShow = (name) => {
            let obj = {
                "ageTips": () => this.setState({ ageTips: !this.state.ageTips }),
                "cTips": () => this.setState({ cTips: !this.state.cTips }),
            }
            if (obj[name]) {
                obj[name]()
            }

        }
        tipsShow = (name) => {
            this.handleShow(name)
        }
        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]] = ""
                    itemObjValue[arr[2]] = ""
                    // if(arr[2].indexOf("note") != -1){
                    //         // itemObjValue[arr[2]]=""
                    //     }

                    this.setState({
                        itemObj,
                        itemObjValue,
                    }, () => {
                        this.total()
                    });
                }
            }

        }
        render() {
            const { getFieldDecorator } = this.props.form;
            const { patInfoData, diseaseArr, assessData, } = this.state;
            const ageColumns = [
                {
                    align: "center",
                    title: '年龄',
                    dataIndex: 'ageValue',
                    key: '0',
                    width: 120
                }, {
                    align: "center",
                    title: '得分',
                    dataIndex: 'score',
                    key: '1',
                    width: 120
                },
            ];
            const ageData = [
                {
                    ageValue: "65-69岁",
                    score: "5",
                    key: "0"
                }, {
                    ageValue: "70-74岁",
                    score: "10",
                    key: "1"
                }, {
                    ageValue: "75-79岁",
                    score: "15",
                    key: "0"
                }, {
                    ageValue: "80-84岁",
                    score: "20",
                    key: "1"
                }, {
                    ageValue: "85-89岁",
                    score: "25",
                    key: "1"
                }, {
                    ageValue: "90-94岁",
                    score: "30",
                    key: "1"
                }, {
                    ageValue: "95-99岁",
                    score: "40",
                    key: "1"
                }, {
                    ageValue: ">=100岁",
                    score: "50",
                    key: "1"
                },
            ]
            const cpColumns = [
                {
                    align: "center",
                    title: '级别',
                    dataIndex: 'level',
                    key: '0',
                    width: 120
                }, {
                    align: "center",
                    title: '具体特征',
                    dataIndex: 'more',
                    key: '1',
                    width: 120
                }, {
                    align: "center",
                    title: '范围',
                    dataIndex: 'to',
                    key: '2',
                    width: 320
                }, {
                    align: "center",
                    title: '得分',
                    dataIndex: 'score',
                    key: '3',
                    width: 120
                },
            ];
            const cpData = [
                {
                    level: "1级",
                    more: "高风险复杂状况",
                    to: "1.长者入院风险评分≥4分；2.合并3种不同系统慢性病，且至少有1种以上并发症；3.独居伴生活部分不能自理，或有跌倒、低血糖、糖尿病足、压疮、听力、视力障碍等；4.绝对卧床或生活完全不能自理；5.特殊患者：心功能3级以上、COPDIII级以上、呼吸衰竭、老年痴呆、帕金森中晚期、中风合并偏瘫、失语、吞咽障碍等、临终患者、中重度焦虑、抑郁等心理疾患长者。",
                    score: "20分",
                    key: "0"
                }, {
                    level: "2级",
                    more: "慢性病合并并发症或需康复",
                    to: "长者入院风险评分2-3分；慢性病合并1 种并发症；慢性病首次确诊慢性病或老年躯体功能下降需康复指导使用特殊药物：胺碘酮、华法林、胰岛素等服药种类≥5种反复发生跌倒、压疮、低血糖等患者轻度焦虑、抑郁长者。",
                    score: "10分",
                    key: "1"
                }, {
                    level: "3级",
                    more: "慢性病病情稳定或偶发症状，绝大多数情况良好",
                    to: "①长者入院风险评分0-1分；②慢性病病情稳定，无合并症",
                    score: "5分",
                    key: "2"
                },
            ]
            //采集人
            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>)
            })
            return (
                <div className="assess-dom mmse-dom adc-dom">
                    <Row style={{ textAlign: "center" }}>
                        <h2>ADC评分</h2>
                    </Row>
                    <Row style={{ color: "#bfbfbf", marginBottom: "12px" }}>
                        请根据一年的体验和感觉回答以下问题：
                    </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={3} style={{ paddingLeft: "5px", paddingRight: "0px" }}>
                                <Form.Item {...formItemLayoutCenter}>
                                    <Col>
                                        {getFieldDecorator('collectTime', {
                                            initialValue: moment(),
                                        })(
                                            <TimePicker style={{ width: '100%' }} separator=":" showToday format={this.state.isTransitionStart ? 'HH:mm:ss' : 'HHmmss'} onOpenChange={this.handleOnOpenChangeStart} placeholder="调查时间" />
                                        )}
                                    </Col>
                                </Form.Item>
                            </Col> */}
                            <Col span={2} style={{ paddingLeft: "5px", paddingRight: "0px", textAlign: "center" }}>
                                <Form.Item {...formItemLayoutCenter}>
                                    <Col>
                                        {getFieldDecorator('fraction', {
                                            initialValue: undefined,
                                        })(
                                            <div>
                                                <span>总分:</span><span style={{ color: "#096dd9", fontSize: "22px", margin: "0 6px" }}>{this.state.total}</span>
                                            </div>
                                        )}
                                    </Col>
                                </Form.Item>
                            </Col>
                            <Col span={6} style={padding} className="select-item">
                                <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: "6px", margin: "8px 0" }}>
                    </p>
                    <div className="conent" id="adc-conent" onClick={(e) => this.handleRadio(e)}>
                        <Row style={{ position: "relative" }}>
                            <strong> A评分</strong>
                            <span style={{ marginRight: "10px", cursor: "pointer" }} onClick={() => this.tipsShow("ageTips")}>
                                <span className="why">?</span>
                                <span style={{ color: "#faad14" }}>评分说明</span>
                            </span>
                            <span style={{ margin: "0 12px" }}>患者年龄:<strong>{patInfoData && patInfoData.patAge || "--"}</strong></span>
                            <span>（75 ~ 79 岁）</span>
                            <span className="right">A评分
                                <span>{patInfoData && parseInt(patInfoData.patAge) >= 100 ? 50
                                    : patInfoData && parseInt(patInfoData.patAge) >= 65 && patInfoData && parseInt(patInfoData.patAge) <= 69 ? 5
                                        : patInfoData && parseInt(patInfoData.patAge) >= 70 && patInfoData && parseInt(patInfoData.patAge) <= 74 ? 10
                                            : patInfoData && parseInt(patInfoData.patAge) >= 75 && patInfoData && parseInt(patInfoData.patAge) <= 79 ? 15
                                                : patInfoData && parseInt(patInfoData.patAge) >= 80 && patInfoData && parseInt(patInfoData.patAge) <= 84 ? 20
                                                    : patInfoData && parseInt(patInfoData.patAge) >= 85 && patInfoData && parseInt(patInfoData.patAge) <= 89 ? 25
                                                        : patInfoData && parseInt(patInfoData.patAge) >= 90 && patInfoData && parseInt(patInfoData.patAge) <= 94 ? 30
                                                            : patInfoData && parseInt(patInfoData.patAge) >= 95 && patInfoData && parseInt(patInfoData.patAge) <= 99 ? 40
                                                                : 0}</span>
                            </span>
                            <Table
                                columns={ageColumns}
                                pagination={false}
                                dataSource={ageData}
                                bordered
                                className="clearBackground"
                                style={{
                                    position: "absolute",
                                    top: "10px",
                                    left: "126px",
                                    background: "#ffff",
                                    zIndex: 1,
                                    padding: 0,
                                    display: this.state.ageTips ? "block" : "none"
                                }}
                            />
                        </Row>
                        <Row>
                            <strong> D评分</strong>
                            <span className="right">D评分<span>{this.state.total}</span></span>
                        </Row>
                        <Row>
                            <h2>（一）心血管系统</h2>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={3}>
                                    <p>
                                        高血压
                                    </p></Col>
                                <Col span={14}>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270101")} value={this.state.itemObj.a270101}>
                                        <Radio value={"a27010101"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a190101"} score="0">高血压低危组（0分）</Radio>
                                        <Radio value={"a27010102"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a19001"} score="1">中危组（1分）</Radio>
                                        <Radio value={"a27010103"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a10101"} score="2">高危组（2分）</Radio>
                                        <Radio value={"a27010104"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a101"} score="3">很高危组（3分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={3}>
                                    <p>
                                        冠心病
                                    </p></Col>
                                <Col span={14}>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270102")} value={this.state.itemObj.a270102}>
                                        <Radio value={"a27010201"} id={this.state.itemObj.a270102 + "^" + "a270102" + "^" + "a270102note" + "^" + "a101"} score="3">可疑冠心病（3分）</Radio>
                                        <Radio value={"a27010202"} id={this.state.itemObj.a270102 + "^" + "a270102" + "^" + "a270102note" + "^" + "a1901"} score="3">冠心病（3分）</Radio>
                                        <Radio value={"a27010203"} id={this.state.itemObj.a270102 + "^" + "a270102" + "^" + "a270102note" + "^" + "a101"} score="4">有并发症或PCI术后（4分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={3}>
                                    <p>
                                        其他
                                    </p></Col>
                                <Col span={14}>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270103")} value={this.state.itemObj.a270103}>
                                        <Radio value={"a27010301"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a01"} score="3">心房颤动（3分）</Radio>
                                        <Radio value={"a27010302"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a1"} score="3">起搏器植入（3分）</Radio>
                                        <Radio value={"a27010303"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "1"} score="3">人工瓣膜植入（3分）</Radio>
                                        <Radio value={"a27010304"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a"} score="3">下肢动脉闭塞症（3分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                        </Row>
                        <Row>
                            <h2>（二）内分泌代谢系统</h2>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={4}>
                                    <p>
                                        糖尿病
                                    </p></Col>
                                <Col>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270201")} value={this.state.itemObj.a270201}>
                                        <Radio value={"a27020101"} id={this.state.itemObj.a270201 + "^" + "a270201" + "^" + "a270201note" + "^" + "a01"} score="3">1/2型（3分）</Radio>
                                        <Radio value={"a27020102"} id={this.state.itemObj.a270201 + "^" + "a270201" + "^" + "a270201note" + "^" + "a101"} score="4">有并发症（4分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={4}>
                                    <p>
                                        高尿酸
                                    </p></Col>
                                <Col>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270202")} value={this.state.itemObj.a270202}>
                                        <Radio value={"a27020201"} id={this.state.itemObj.a270202 + "^" + "a270202" + "^" + "a270202note" + "^" + "a1"} score="2">高尿酸血症（2分）</Radio>
                                        <Radio value={"a27020202"} id={this.state.itemObj.a270202 + "^" + "a270202" + "^" + "a270202note" + "^" + "a01"} score="3">既往有痛风发作（3分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={4}>
                                    <p>
                                        甲状腺功能
                                    </p></Col>
                                <Col>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270203")} value={this.state.itemObj.a270203}>
                                        <Radio value={"a27020301"} id={this.state.itemObj.a270203 + "^" + "a270203" + "^" + "a270203note" + "^" + "a01"} score="2">甲状腺功能疾病（2分）</Radio>
                                        <Radio value={"a27020302"} id={this.state.itemObj.a270203 + "^" + "a270203" + "^" + "a270203note" + "^" + "a1"} score="3">目前需药物干预（3分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                        </Row>
                        <Row>
                            <h2>（三）骨关节疾病</h2>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Radio.Group onChange={(e) => this.handleChange(e, "a2703")} value={this.state.itemObj.a2703}>
                                    <Radio value={"a270301"} id={this.state.itemObj.a2703 + "^" + "a2703" + "^" + "a2703note" + "^" + "a001"} score="2">潜在骨质疏松风险（2分）</Radio>
                                    <Radio value={"a270302"} id={this.state.itemObj.a2703 + "^" + "a2703" + "^" + "a2703note" + "^" + "a00001"} score="3">确诊骨质疏松或已发生过脆性骨折（3分）</Radio>
                                    <Radio value={"a270303"} id={this.state.itemObj.a2703 + "^" + "a2703" + "^" + "a2703note" + "^" + "a0001"} score="3">退行性关节疾病症状明显患者（3分）</Radio>
                                </Radio.Group>
                            </Row>
                        </Row>
                        <Row>
                            <h2>（四）呼吸系统</h2>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={5} style={{ width: "11%" }}>
                                    <p>
                                        慢性阻塞性肺炎
                                    </p></Col>
                                <Col>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270401")} value={this.state.itemObj.a270401}>
                                        <Radio value={"a27040101"} id={this.state.itemObj.a270401 + "^" + "a270401" + "^" + "a270401note" + "^" + "a01"} score="1">Ⅰ级（1分</Radio>
                                        <Radio value={"a27040102"} id={this.state.itemObj.a270401 + "^" + "a270401" + "^" + "a270401note" + "^" + "a001"} score="2">Ⅱ级（2分）</Radio>
                                        <Radio value={"a27040103"} id={this.state.itemObj.a270401 + "^" + "a270401" + "^" + "a270401note" + "^" + "a0001"} score="3">Ⅲ级（3分）</Radio>
                                        <Radio value={"a27040104"} id={this.state.itemObj.a270401 + "^" + "a270401" + "^" + "a270401note" + "^" + "a000001"} score="4">Ⅳ级（4分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={5} style={{ width: "11%" }}>
                                    <p>
                                        其他
                                    </p></Col>
                                <Col>   <Radio.Group onChange={(e) => this.handleChange(e, "a270402")} value={this.state.itemObj.a270402}>
                                    <Radio value={"a27040201"} id={this.state.itemObj.a270402 + "^" + "a270402" + "^" + "a270402note" + "^" + "a01"} score="3">支气管哮喘（3分）</Radio>
                                </Radio.Group></Col>
                            </Row>
                        </Row>
                        <Row>
                            <h2>（五）泌尿系统</h2>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={4}>
                                    <p>
                                        慢性肾脏病
                                    </p></Col>
                                <Col span={14}>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270101")} value={this.state.itemObj.a270101}>
                                        <Radio value={"a27010101"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a190101"} score="0">Ⅰ期（0分）</Radio>
                                        <Radio value={"a27010102"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a19001"} score="1">Ⅱ期（1分）</Radio>
                                        <Radio value={"a27010103"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a10101"} score="2">Ⅲ期（2分）</Radio>
                                        <Radio value={"a27010104"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a101"} score="3">Ⅳ期（3分）</Radio>
                                        <Radio value={"a27010104"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a101"} score="4">V期（4分分</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={4}>
                                    <p>
                                        其他
                                    </p></Col>
                                <Col span={20}>
                                    <Checkbox.Group onChange={(e) => this.handleChange(e, "a270103")} value={this.state.itemObj.a270103}>
                                        <Checkbox value={"a27010301"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a01"} score="3">泌尿系统结石（2分）</Checkbox>
                                        <Checkbox value={"a27010302"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a1"} score="3">反复泌尿系统感染（发作{'>'}=3次/年）（2分）</Checkbox>
                                        <Checkbox value={"a27010303"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "1"} score="3">目前存在尿失禁、尿储留问题（3分）</Checkbox>

                                    </Checkbox.Group></Col>
                            </Row>
                        </Row>
                        <Row>
                            <h2>（六）神经系统、精神心理</h2>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={5} style={{ width: "12%" }}>
                                    <p>
                                        脑卒中
                                    </p></Col>
                                <Col span={14}>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270101")} value={this.state.itemObj.a270101}>
                                        <Radio value={"a27010101"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a190101"} score="4">脑卒中后3个月内（4分）</Radio>
                                        <Radio value={"a27010102"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a19001"} score="3">脑卒中后3-6个月内（3分）</Radio>
                                        <Radio value={"a27010103"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a10101"} score="2">脑卒中后6-12个月内（2分）</Radio>
                                        <Radio value={"a27010104"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a101"} score="1">脑卒中1年内（1分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={5} style={{ width: "12%" }}>
                                    <p>
                                        认知功能障碍
                                    </p></Col>
                                <Col span={20}>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270101")} value={this.state.itemObj.a270101}>
                                        <Radio value={"a27010101"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a190101"} score="3">MMSE{"<="}20（3分）</Radio>
                                        <Radio value={"a27010102"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a19001"} score="2">21{"<="}MMSE{"<="}27（2分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={5} style={{ width: "12%" }}>
                                    <p>
                                        焦虑抑郁状态
                                    </p></Col>
                                <Col span={14}>
                                    <Radio.Group onChange={(e) => this.handleChange(e, "a270101")} value={this.state.itemObj.a270101}>
                                        <Radio value={"a27010101"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a190101"} score="2">8{"<="}HADS{"<="}10（2分）</Radio>
                                        <Radio value={"a27010102"} id={this.state.itemObj.a270101 + "^" + "a270101" + "^" + "a270101note" + "^" + "a19001"} score="2">11{"<="}HADS{"<="}21（3分）</Radio>
                                    </Radio.Group></Col>
                            </Row>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={5} style={{ width: "12%" }}>
                                    <p>
                                        其他
                                    </p></Col>
                                <Col span={14}>
                                    <Checkbox.Group onChange={(e) => this.handleChange(e, "a270103")} value={this.state.itemObj.a270103}>
                                        <Checkbox value={"a27010301"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a01"} score="3">帕金森综合征（3分）</Checkbox>
                                        <Checkbox value={"a27010302"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a1"} score="3">严重睡眠障碍（3分）</Checkbox>
                                    </Checkbox.Group></Col>
                            </Row>
                        </Row>
                        <Row>
                            <h2>(七)消化系统</h2>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={14}>
                                    <Checkbox.Group onChange={(e) => this.handleChange(e, "a270103")} value={this.state.itemObj.a270103}>
                                        <Checkbox value={"a27010301"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a01"} score="3">功能性消化不良（3分）</Checkbox>
                                        <Checkbox value={"a27010302"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a1"} score="3">便秘（3分）</Checkbox>
                                    </Checkbox.Group></Col>
                            </Row>
                        </Row>
                        <Row>
                            <h2>（八）风湿免疫系统</h2>
                            <Row style={{ display: "flex", paddingBottom: "0" }}>
                                <Col span={14}>
                                    <Checkbox.Group onChange={(e) => this.handleChange(e, "a270103")} value={this.state.itemObj.a270103}>
                                        <Checkbox value={"a27010301"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a01"} score="3">类风湿关节炎（3分）</Checkbox>
                                        <Checkbox value={"a27010302"} id={this.state.itemObj.a270103 + "^" + "a270103" + "^" + "a270103note" + "^" + "a1"} score="3">任何活动性需要药物干预的风湿免疫系统疾病（3分）</Checkbox>
                                    </Checkbox.Group></Col>
                            </Row>
                        </Row>
                        <Row style={{ position: "relative" }}>
                            <strong> C评分</strong>
                            <span style={{ marginRight: "10px", cursor: "pointer" }} onClick={() => this.tipsShow("cTips")}>
                                <span className="why">?</span>
                                <span style={{ color: "#faad14" }}>评分说明</span>
                            </span>
                            <span style={{ marginLeft: "36px" }}>患者护理级别：<span>无</span></span>
                            <Table
                                columns={cpColumns}
                                pagination={false}
                                dataSource={cpData}
                                bordered
                                className="clearBackground"
                                style={{
                                    position: "absolute",
                                    top: "-330px",
                                    left: "126px",
                                    background: "#ffff",
                                    zIndex: 1,
                                    padding: 0,
                                    display: this.state.cTips ? "block" : "none"
                                }}
                            />
                        </Row>

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