/**
 * 医嘱信息
 */

import React from 'react';
import {
    Card, Table, Input, Select, Row, Col, Checkbox, Tabs, Steps, Modal,
    DatePicker, Button, Icon, Divider, message, Tree, Pagination
} from 'antd';
import { Util, dayFormat, timeFormat } from 'tools/index';
import { $http } from 'containers/config/https';
import CopyTextModal from './CopyTextModal';
import AddTemplateModal from './AddTemplateModal';
import AddPackageModal from './AddPackageModal';
import ShowConfirmModal from './ShowConfirmModal';
import moment from 'moment';
import '../style/index.less';

const { Step } = Steps;
const Search = Input.Search;
const Option = Select.Option;
const confirm = Modal.confirm;
const { TreeNode } = Tree;

class NewDoctorAdviceStepPage extends React.Component {
    constructor(props) {
        super(props)
        var userData = JSON.parse(sessionStorage.getItem('userData'));
        var recordData = JSON.parse(sessionStorage.getItem('recordData'))
        var titleData = JSON.parse(sessionStorage.getItem('titleData'))
        this.state = {
            dataSource: [],
            total: 0,
            page: 1,
            pageSize: 10,
            current: 2,
            ids: [],
            userData: userData,
            selectData: [],
            recordData: recordData,
            titleData: titleData,
            cannelStatus: false,
            nodeId: [],
            adviceDrData: [],
            indexArray: [],
            visStatus:false
        }
        this.textInput = React.createRef();
    }

    componentDidMount() {
        this.initData()
        this.loadData()
        this.loadTemplateData()
        this.loadPrescriptionFee()
    }

    initData() {
        this.columns = [
            {
                title: '序号',
                dataIndex: 'ordSeqNo1',
                width: 50,
                align: 'center',
                // render: (text, data, index) => <span style={{ width: 50 }}>{index + 1}</span>
                render: (text, data, index) => {
                    return {
                        props: {
                            className: data.ordMinFlag == 'Y' ? 'rowClass' : ''
                        },
                        children: <span style={{ width: 50 }}>{index + 1}</span>
                    }
                }
            }, {
                title: '关联号',
                dataIndex: 'ordLinkSeqNo',
                width: 110,
                align: 'center',
                render: (text, data, index) => {
                    return {
                        props: {
                            className: data.ordOrderDetailID ? 'linkStyle' : ''
                        },
                        children: data.ordID ? <span>{data.ordLinkSeqNo}</span> : <Input on style={{ width: '100px' }}
                            onChange={this.changeOrdLinkInput.bind(this, 'ordLinkSeqNo', index, data)} />
                    }
                }
            },
            //  {
            //     title: '录入时间',
            //     dataIndex: 'ordOrderDate',
            //     width: 180,
            //     align: 'center',
            // }, 
            {
                title: '处方内容',
                dataIndex: 'ordMedItemDesc',
                width: 500,
                align: 'center',
                render: (text, data, index) => {
                    return <span>
                        <span>{data.ordEMFlag == 'Y' ? '【加急】;' : ''}</span>
                        <span>{data.ordSkinTestFlag == 'Y' ? '【皮试】;' : ''}</span>
                        <span>{data.ordSkinTestWayDesc ? `【${data.ordSkinTestWayDesc}】;` : ''}</span>
                        <span>{data.ordNote ? `【${data.ordNote}】;` : ''}</span>
                        <span>{data.ordMedItemDesc?data.ordMedItemDesc:data.ordDesc}</span>&nbsp;&nbsp;
                        <span>{data.ordDurQty}{data.ordDurationDesc}</span>&nbsp;&nbsp;
                        <span>{data.ordQty}{data.ordQtyUomDesc}</span>&nbsp;&nbsp;
                        <span>{data.ordUsageDesc}</span>&nbsp;&nbsp;
                        <span>{(data.ordFrequenceCode?data.ordFrequenceCode:
                            (data.ordFrequenceDesc?data.ordFrequenceDesc:undefined)) || data.ordFreqDesc}</span>&nbsp;&nbsp;
                        <span>{data.ordDurQty}{data.ordDurationDesc}</span>&nbsp;&nbsp;
                        <span>{data.ordRecLocDesc}</span>&nbsp;&nbsp;
                        <span style={{color:'red'}}>{data.errorMessage?`【${data.errorMessage}】;` :''}</span>
                    </span>
                }
            }, {
                title: '状态',
                dataIndex: 'ordBilledDesc',
                width: 120,
                align: 'center',
            }
        ],
            this.sunColumns = [
                {
                    title: '编码',
                    dataIndex: 'medCode',
                    width: 80,
                    align: 'center',
                }, {
                    title: '名称*规格',
                    dataIndex: 'medDesc',
                    width: 180,
                    align: 'center',
                }, {
                    title: '库存',
                    dataIndex: 'medStock',
                    width: 80,
                    align: 'center',
                }, {
                    title: '大类',
                    dataIndex: 'medCatDesc',
                    width: 120,
                    align: 'center',
                }, {
                    title: '子类',
                    dataIndex: 'medSubCatDesc',
                    width: 120,
                    align: 'center',
                }, {
                    title: '供应商',
                    dataIndex: 'medVendorDesc',
                    width: 120,
                    align: 'center',
                }, {
                    title: '产地',
                    dataIndex: '117',
                    width: 120,
                    align: 'center',
                },
            ]
    }
    setRowElement = (record, index) => {
        return {
            onDoubleClick: () => {
                this.rowClick(record, index)
            }
        }
    }

      //获取处方费用
      loadPrescriptionFee(){
        var params = {
            params: [{
                admID: this.state.recordData ? this.state.recordData.patAdmID : '',
            }],

        }
        $http.post('urlDeault', this, {
            code: "03050044",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({
                        prescriptionFee:res.totalAmt
                    })
                }
            }
        });
    }


    loadData(page, pageSize) {
        var params = {
            params: [{
                admID: this.state.recordData ? this.state.recordData.patAdmID : '',
            }],
            pagination: [{
                pageSize: this.state.pageSize,
                currentPage: page
            }]

        }
        $http.post('urlDeault', this, {
            code: "03050022",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({
                        dataSource: res.result.data
                    })
                }
            }
        });
    }

    loadTemplateData() {
        var params = {
            params: [{
                input: this.state.templateInput,
                noCheckDetailFlag: 'Y'
            }],
        }
        $http.post('urlDeault', this, {
            code: "03050023",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({
                        templateData: res.result
                    })
                }
            }
        });
    }

    onSearchTemplate(e) {
        if (e.keyCode == '13') {
            var params = {
                params: [{
                    input: this.state.templateInput,
                    noCheckDetailFlag: 'Y'
                }],
            }
            $http.post('urlDeault', this, {
                code: "03050023",
                data: params,
                success: function (res) {
                    if (res.errorCode == '0') {
                        this.setState({
                            templateData: res.result
                        })
                    }
                }
            });
        }
    }

    loadTempTableData(status, record, data) {
        this.addMechansim('clear')
        var { dataSource } = this.state;
        this.state.dataSource.push({ tabIndex: this.state.dataSource.length + 1 });
        this.setState({ groupStatus: false, indexTable: this.state.dataSource.length - 1 }, () => {
            setTimeout(() => {
                this.loadTableData(status, record, data)
            }, 100);
        })
    }

    //点击复选框
    checkTreeNode(e, data) {
        this.setState({
            nodeId: e
        })
    }

    //批量添加模版
    batchAddTemplate() {
        this.addMechansim('clear')
        var { nodeId } = this.state;
        var obj = {}
        if (nodeId.length < 1) {
            message.error('请选择你需要添加的模版')
            return
        }

        if (nodeId.length > 1) {
            this.loadBatchTemplateData()
        } else {//单条数据处理
            this.loadTableData('batch', nodeId[0], '')
            this.state.dataSource.push({ tabIndex: this.state.dataSource.length + 1 })
            this.setState({ groupStatus: false, indexTable: this.state.dataSource.length - 1, colStatus: false })
        }
    }

    //批量加载医嘱数据
    loadBatchTemplateData() {
        var date = new Date();
        var { nodeId } = this.state;
        var arr = []
        for (var i = 0; i < nodeId.length; i++) {
            arr.push({
                medID: nodeId[i],
                admID: this.state.recordData ? this.state.recordData.patAdmID : '',
            })
        }
        var params = {
            params: arr
        }
        $http.post('urlDeault', this, {
            code: "03050020",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({//确认医嘱弹框
                        isShowConfirmModal: true,
                        confirmData: res.confirmData,
                        errorData: res.errorData,
                        adviceDrData: res.data,
                        colStatus: false
                    })
                }
            }
        });
    }

    //加载医嘱模版
    loadTemplate() {
        var templateTree = []
        this.state.templateData && this.state.templateData.map((item, index) => {
            templateTree.push(<TreeNode title={item.title} key={index + 'i'}>
                {this.loadSunTemplate(item.data)}
            </TreeNode>)
        })
        return templateTree
    }

    loadSunTemplate(data) {
        var sunData = []
        data && data.map((item, index) => {
            // if(item.data) {
            sunData.push(<TreeNode title={item.title} nodeId={item.ordTempletDetailItemID}
                disabled={this.state.title && this.state.titleData.depDoctorFlag =='N'?true:false}
                key={item.ordTempletDetailItemID || item.id || index}>
                {this.loadSunTemplate(item.data)}
            </TreeNode>)
            // }
        })
        return sunData
    }

    rowClick(record, index) {
        this.setState({
            visible: false,
            rowData: record.medDesc,
            ordSpecID: record.ordSpecID,
            selectData: [],
            visStatus:false
        }, () => {
            this.loadTableData('', record, index)
        })
    }

    //获取列表行数据
    loadTableData(status, record, data) {
        var that = this;
        var date = new Date();
        var params = {
            params: [{
                medID: status == 'temp' ? data.props.nodeId : (status == 'batch' ? record : record.medID),
                admID: this.state.recordData ? this.state.recordData.patAdmID : '',
            }]
        }
        $http.post('urlDeault', this, {
            code: "03050020",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    if (res.confirmData.length > 0) {
                        confirm({
                            title: '确认医嘱',
                            content: res.confirmData[0].errorMessage,
                            onOk() {
                                if (status && status !== 'click') {
                                    that.state.dataSource[that.state.dataSource.length - 1]['ordMedItemDesc'] = res.data[0].defaultData.ordDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordDose'] = res.data[0].defaultData.ordDose,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordUsageDesc'] = res.data[0].defaultData.ordUsageDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordDoseUnitID'] = res.data[0].defaultData.ordDoseUnitID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordDoseUnitDesc'] = res.data[0].defaultData.ordDoseUnitDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordFreqID'] = res.data[0].defaultData.ordFreqID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordUsageID'] = res.data[0].defaultData.ordUsageID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordDurQty'] = res.data[0].defaultData.ordDurQty,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordDurationID'] = res.data[0].defaultData.ordDurationID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordDurationDesc'] = res.data[0].defaultData.ordDurationDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordQty'] = res.data[0].defaultData.ordQty,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordQtyUomID'] = res.data[0].defaultData.ordQtyUomID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordQtyUomDesc'] = res.data[0].defaultData.ordQtyUomDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordPrice'] = res.data[0].defaultData.ordPrice,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordSkinTestFlag'] = res.data[0].defaultData.ordSkinTestFlag,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordEMFlag'] = res.data[0].defaultData.ordEMFlag,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordSkinTestWayID'] = that.state.ordSkinTestWayID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordSkinTestWayDesc'] = that.state.ordSkinTestWayDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordRecLocID'] = res.data[0].defaultData.ordRecLocID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordRecLocDesc'] = res.data[0].defaultData.ordRecLocDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordPriorityID'] = res.data[0].defaultData.ordPriorityID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordPriorityDesc'] = res.data[0].defaultData.ordPriorityDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordAdmReasonID'] = res.data[0].defaultData.ordAdmReasonID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordAdmReasonDesc'] = res.data[0].defaultData.ordAdmReasonDesc,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordFrequenceDesc'] = res.data[0].defaultData.ordFreqCode,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordSeqNo'] = parseInt(that.state.dataSource.length - 1) + 1,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordDate'] = moment(date).format(dayFormat),
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordTime'] = moment(date).format(timeFormat),
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordStartDate'] = moment(date).format(dayFormat),
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordStartTime'] = moment(date).format(timeFormat),
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordNote'] = res.data[0].defaultData.ordNote,
                                        that.state.dataSource[that.state.dataSource.length - 1]['medID'] = res.data[0].defaultData.medID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordTypeCode'] = res.data[0].defaultData.ordTypeCode,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordSpecID'] = res.data[0].defaultData.ordSpecID,
                                        that.state.dataSource[that.state.dataSource.length - 1]['ordSpecDesc'] = res.data[0].defaultData.ordSpecDesc
                                }

                                that.setState({
                                    // tableData: (status == 'click' || Util.isEmpty(status)) ? res.data[0].defaultData : '',
                                    // tableData: (status == 'click' || Util.isEmpty(status)) ? record : '',
                                    tableData: status == 'click' ? record : (Util.isEmpty(status) ? res.data[0].defaultData : ''),
                                    doseUnitList: res.data[0].dataList.doseUnitList,//剂量单位
                                    durationList: res.data[0].dataList.durationList,//疗程单位
                                    qtyUnitList: res.data[0].dataList.qtyUnitList,//数量单位
                                    recLocList: res.data[0].dataList.recLocList,//接收科室
                                    frequenceList: res.data[0].dataList.frequenceList,//频次
                                    usageList: res.data[0].dataList.usageList,//用法
                                    skinTestWayList: res.data[0].dataList.skinTestWayList,//皮试备注
                                    priorityList: res.data[0].dataList.priorityList,//优先级
                                    admReasonList: res.data[0].dataList.admReasonList,
                                    specList: res.data[0].dataList.specList,//标本
                                })
                            },
                            onCancel() {
                                console.log('Cancel');
                            },
                        });
                    } else {
                        if (status && status !== 'click') {
                            this.state.dataSource[this.state.dataSource.length - 1]['ordMedItemDesc'] = res.data[0].defaultData.ordDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordDose'] = res.data[0].defaultData.ordDose,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordUsageDesc'] = res.data[0].defaultData.ordUsageDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordDoseUnitID'] = res.data[0].defaultData.ordDoseUnitID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordDoseUnitDesc'] = res.data[0].defaultData.ordDoseUnitDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordFreqID'] = res.data[0].defaultData.ordFreqID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordUsageID'] = res.data[0].defaultData.ordUsageID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordDurQty'] = res.data[0].defaultData.ordDurQty,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordDurationID'] = res.data[0].defaultData.ordDurationID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordDurationDesc'] = res.data[0].defaultData.ordDurationDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordQty'] = res.data[0].defaultData.ordQty,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordQtyUomID'] = res.data[0].defaultData.ordQtyUomID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordQtyUomDesc'] = res.data[0].defaultData.ordQtyUomDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordPrice'] = res.data[0].defaultData.ordPrice,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordSkinTestFlag'] = res.data[0].defaultData.ordSkinTestFlag,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordEMFlag'] = res.data[0].defaultData.ordEMFlag,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordSkinTestWayID'] = this.state.ordSkinTestWayID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordSkinTestWayDesc'] = this.state.ordSkinTestWayDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordRecLocID'] = res.data[0].defaultData.ordRecLocID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordRecLocDesc'] = res.data[0].defaultData.ordRecLocDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordPriorityID'] = res.data[0].defaultData.ordPriorityID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordPriorityDesc'] = res.data[0].defaultData.ordPriorityDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordAdmReasonID'] = res.data[0].defaultData.ordAdmReasonID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordAdmReasonDesc'] = res.data[0].defaultData.ordAdmReasonDesc,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordFrequenceDesc'] = res.data[0].defaultData.ordFreqCode,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordSeqNo'] = parseInt(this.state.dataSource.length - 1) + 1,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordDate'] = moment(date).format(dayFormat),
                                this.state.dataSource[this.state.dataSource.length - 1]['ordTime'] = moment(date).format(timeFormat),
                                this.state.dataSource[this.state.dataSource.length - 1]['ordStartDate'] = moment(date).format(dayFormat),
                                this.state.dataSource[this.state.dataSource.length - 1]['ordStartTime'] = moment(date).format(timeFormat),
                                this.state.dataSource[this.state.dataSource.length - 1]['ordNote'] = res.data[0].defaultData.ordNote,
                                this.state.dataSource[this.state.dataSource.length - 1]['medID'] = res.data[0].defaultData.medID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordTypeCode'] = res.data[0].defaultData.ordTypeCode,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordSpecID'] = res.data[0].defaultData.ordSpecID,
                                this.state.dataSource[this.state.dataSource.length - 1]['ordSpecDesc'] = res.data[0].defaultData.ordSpecDesc

                        }
                        this.setState({
                            // tableData: (status == 'click' || Util.isEmpty(status)) ? res.data[0].defaultData : '',
                            // tableData: (status == 'click' || Util.isEmpty(status)) ? record : '',
                            tableData: status == 'click' ? record : (Util.isEmpty(status) ? res.data[0].defaultData : ''),
                            doseUnitList: res.data[0].dataList.doseUnitList,//剂量单位
                            durationList: res.data[0].dataList.durationList,//疗程单位
                            qtyUnitList: res.data[0].dataList.qtyUnitList,//数量单位
                            recLocList: res.data[0].dataList.recLocList,//接收科室
                            frequenceList: res.data[0].dataList.frequenceList,//频次
                            usageList: res.data[0].dataList.usageList,//用法
                            skinTestWayList: res.data[0].dataList.skinTestWayList,//皮试备注
                            priorityList: res.data[0].dataList.priorityList,//优先级
                            admReasonList: res.data[0].dataList.admReasonList,
                            specList: res.data[0].dataList.specList,//标本
                        })
                    }
                }
            }
        });
    }

    //关联号相关逻辑
    changeOrdLinkInput(name, index, data, e) {
        var { dataSource } = this.state;
        var value = e.target.value;
        for (var i = 0; i < dataSource.length; i++) {
            if (dataSource[i].tabIndex-1 == index) {
                this.state.dataSource[index][name] = value,
                    this.state.dataSource[index]['ordLinkStatus'] = true
            }
            // else{
            //     this.state.dataSource[index][name] = value,
            //     this.state.dataSource[index]['ordLinkStatus'] = false
            // }
        }
        this.setState({ inputIndex: index })
    }

    //当前组件内，所有的下拉，针对index进行赋值
    changeCommonSelect(name, code, e) {
        var id = '', desc = '',freCode = '';
        if (e) {
            id = e.substring(0, e.indexOf('^'))
            desc = e.substring(e.indexOf('^') + 1)
            freCode = e.substring(0, e.indexOf('-'))
        }
        this.setState({
            [name]: id,
            [code]: desc,
            freCode:freCode

        })
    }

    changeCheckBox(name, e) {
        this.setState({
            [name]: e.target.checked ? 'Y' : 'N'
        })
    }


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

    handleSearch(value) {
        this.setState({
            changeValue: value,
            visible:true,
            colStatus:''
        })
        if (value.length >= 2) {
            this.loadSelectData(value, '', '')
        }
        // else {
        //     this.setState({
        //         selectData: []
        //     })
        // }
    }

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

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

    loadSelectData(value, page, pageSize) {
        var params = {
            params: [{
                admID: this.state.recordData ? this.state.recordData.patAdmID : '',
                searchCode: value ? value : this.state.changeValue,
                logonLocID: this.state.userData.locID,
                userID: this.state.userData.userID,
                groupID: this.state.userData.groupID,
                hospID: this.state.userData.hospID,
            }],
            pagination: [{
                pageSize: this.state.pageSize,
                currentPage: page
            }]

        }
        $http.post('urlDeault', this, {
            code: "03050019",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({
                        selectData: res.result.data,
                        total: res.result.totalCount
                    })
                }
            }
        });
    }

    //鼠标移动添加样式
    addMouseOverStyle(name, e) {
        this.setState({
            addMouseStyle: true,
            indexStyle: name
        })
    }
    addMouseLeaveStyle() {
        this.setState({
            addMouseStyle: false,
            indexStyle: ''
        })
    }

    //开始分组
    handleStartGroup() {
        var { dataSource, ids } = this.state;
        //先setState一个标识值，表示分组
        if (Util.isEmpty(ids)) {
            message.error('请选择您需要分组的医嘱项')
            return
        }
        if (ids.length == 1) {
            message.error('请选择两条及以上数据进行分组')
            return
        }
        this.setState({
            groupStatus: true
        })
        for (var i = 0; i < dataSource.length; i++) {
            for (var j = 0; j < ids.length; j++) {
                if (ids[j] == dataSource[i].ordID) {
                    message.error('已插入的数据不能用于分组，请重新选择！')
                    return
                }
            }
        }
        //使用冒泡排序，将选中的id进行排序，取最小的数值作为分组置灰标识
        for (var i = 0; i < ids.length - 1; i++) {
            for (var j = 0; j < ids.length - i - 1; j++) {
                if (ids[j] > ids[j + 1]) {
                    var temp = ids[j];
                    ids[j] = ids[j + 1];
                    ids[j + 1] = temp;
                }
            }
            this.state.dataSource[ids[0]]['identity'] = '1'
        }
    }

    //取消分组
    handleCannelGroup() {
        var { dataSource } = this.state;
        for (var i = 0; i < dataSource.length; i++) {
            this.state.dataSource[this.state.inputIndex]['ordLinkStatus'] = false
        }
        this.setState({
            groupStatus: false,
            cannelStatus: true
        })
    }

    onSelectChange(ids) {
        this.setState({
            ids
        })
    }

    //根据正选和反选，向对应数据增加一个标识，处理反选下拉依旧置灰问题
    onSelect(data, flag) {
        if (flag) {
            data['checkIdenty'] = ''
        } else {
            data['checkIdenty'] = '1'
        }
        this.setState({})
    }
    //插入医嘱
    insertDoctorAdvice() {
        var { dataSource, ids } = this.state;
        var temp = []
        //将默认数据过滤掉，只传新添加的数据
        for (var i = 0; i < dataSource.length; i++) {
            if (Util.isEmpty(dataSource[i].ordID)) {
                temp.push(dataSource[i])
            }
            if (Util.isEmpty(dataSource[i].identity) && this.state.groupStatus) {
                this.state.dataSource[i].ordLinkSeqNo = ids[0] + 1
            }
        }
        // for (var i = 0; i < temp.length; i++) {
        //     if (temp[i].ordTypeCode == 'D') {//医嘱为药品时
        //         if (Util.isEmpty(temp[i].ordFreqID)) {
        //             message.error('频次不能为空');
        //             return
        //         }
        //         if (Util.isEmpty(temp[i].ordDose)) {
        //             message.error('剂量不能为空');
        //             return
        //         }
        //         if (Util.isEmpty(temp[i].ordDoseUnitID)) {
        //             message.error('剂量单位不能为空');
        //             return
        //         }
        //         if (Util.isEmpty(temp[i].ordQty)) {
        //             message.error('数量不能为空');
        //             return
        //         }
        //         if (Util.isEmpty(temp[i].ordQtyUomID)) {
        //             message.error('数量单位不能为空');
        //             return
        //         }
        //         if (Util.isEmpty(temp[i].ordDurQty)) {
        //             message.error('疗程数量不能为空');
        //             return
        //         }
        //         if (Util.isEmpty(temp[i].ordDurationID)) {
        //             message.error('疗程单位不能为空');
        //             return
        //         }
        //         if (!Util.isEmpty(temp[i].ordSkinTestFlag) && temp[i].ordSkinTestFlag == 'Y'
        //             && Util.isEmpty(temp[i].ordSkinTestWayID)) {
        //             message.error('皮试备注不能为空');
        //             return
        //         }
        //     }
        // }
        var params = {
            params: [
                {
                    admID: this.state.recordData ? this.state.recordData.patAdmID : '',
                    locID: this.state.userData.locID,
                    docID: this.state.userData.userID,
                    userID: this.state.userData.userID,
                    hospID: this.state.userData.hospID,
                    orders: temp,
                    ordSpecID: this.state.ordSpecID
                }
            ]
        }
        $http.post('urlDeault', this, {
            code: "03050001",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    this.setState({
                        groupStatus: false
                    })
                    message.success('插入医嘱成功！')
                    this.loadData(1)
                    this.loadPrescriptionFee()
                }else{
                    var errorList = res.errorMessageList;
                    var {dataSource} = this.state;
                    for(var i=0;i<dataSource.length;i++) {
                        for(var j=0;j<errorList.length;j++) {
                            if(dataSource[i].ordSeqNo == errorList[j].ordSeqNo){
                                this.state.dataSource[i]['errorMessage'] = errorList[j].errorMessage
                                this.setState({})
                            }
                        }
                    }
                }
            }
        });
    }

    //添加处方信息，设置一个焦点,并且讲所有数据清空
    addMechansim(name, e) {
        if (Util.isEmpty(name)) {
            this.textInput.current.focus()
        }
        this.setState({
            tableData: '',
            colStatus: name == 'clear' ? true : false,
            ordPrice: '',
            ordDose: '',
            ordDoseUnitID: '',
            ordUsageID: '',
            ordFreqID: '',
            ordDurQty: '',
            ordDurationID: '',
            ordQtyUomID: '',
            ordSkinTestWayID: '',
            ordEMFlag: '',
            ordSkinTestFlag: '',
            ordNote: '',
            ordRecLocID: '',
            ordAdmReasonID: '',
            ordPriorityID: '',
            ordSpecID: '',
            changeValue: '',
            ordQty:''
        })
    }

    //提交医嘱录入
    addDataSource() {
        var date = new Date();
        var { dataSource, tableData } = this.state;
        //加入添加限制，只有录入了医嘱信息之后才能再次添加
        for (var i = 0; i < dataSource.length; i++) {
            if (Util.isEmpty(tableData)) {
                message.error('请先录入医嘱信息再添加！')
                return
            }
        }
        // if (Util.isEmpty(this.state.ordFreqID) && Util.isEmpty(tableData.ordFreqID)) {
        //     message.error('频次不能为空');
        //     return
        // }
        // if (Util.isEmpty(this.state.ordDose) && Util.isEmpty(tableData.ordDose)) {
        //     message.error('剂量不能为空');
        //     return
        // }
        // if (Util.isEmpty(this.state.ordDoseUnitID) && Util.isEmpty(tableData.ordDoseUnitID)) {
        //     message.error('剂量单位不能为空');
        //     return
        // }
        // if (Util.isEmpty(this.state.ordQty) && Util.isEmpty(tableData.ordQty)) {
        //     message.error('数量不能为空');
        //     return
        // }
        // if (Util.isEmpty(this.state.ordQtyUomID) && Util.isEmpty(tableData.ordQtyUomID)) {
        //     message.error('数量单位不能为空');
        //     return
        // }
        // if (Util.isEmpty(this.state.ordDurQty) && Util.isEmpty(tableData.ordDurQty)) {
        //     message.error('疗程数量不能为空');
        //     return
        // }
        // if (Util.isEmpty(this.state.ordDurationID) && Util.isEmpty(tableData.ordDurationID)) {
        //     message.error('疗程单位不能为空');
        //     return
        // }
        // if (!Util.isEmpty(this.state.ordSkinTestFlag) && tableData.ordSkinTestFlag == 'Y'
        //     && Util.isEmpty(tableData.ordSkinTestWayID)) {
        //     message.error('已勾选皮试，皮试备注不能为空');
        //     return
        // }
        if (this.state.colStatus) {

        } else {
            this.state.dataSource.push({ tabIndex: this.state.dataSource.length + 1 })
        }
        var newCode = 0;
        if (this.state.doubleIndex) {
            newCode = this.state.doubleIndex
        } else {
            newCode = this.state.dataSource.length - 1
        }

        this.state.dataSource[newCode]['ordMedItemDesc'] = tableData.ordMedItemDesc,
        this.state.dataSource[newCode]['ordDesc'] = tableData.ordDesc,
            this.state.dataSource[newCode]['ordDose'] = this.state.ordDose ? this.state.ordDose : tableData.ordDose,
            this.state.dataSource[newCode]['ordDoseUnitID'] = this.state.ordDoseUnitID ? this.state.ordDoseUnitID : tableData.ordDoseUnitID,
            this.state.dataSource[newCode]['ordDoseUnitDesc'] = this.state.ordDoseUnitDesc ? this.state.ordDoseUnitDesc : tableData.ordDoseUnitDesc,
            this.state.dataSource[newCode]['ordFreqID'] = this.state.ordFreqID ? this.state.ordFreqID : tableData.ordFreqID,
            this.state.dataSource[newCode]['ordUsageID'] = this.state.ordUsageID ? this.state.ordUsageID : tableData.ordUsageID,
            this.state.dataSource[newCode]['ordUsageDesc'] = this.state.ordUsageDesc ? this.state.ordUsageDesc : tableData.ordUsageDesc,
            this.state.dataSource[newCode]['ordDurQty'] = this.state.ordDurQty ? this.state.ordDurQty : tableData.ordDurQty,
            this.state.dataSource[newCode]['ordDurationID'] = this.state.ordDurationID ? this.state.ordDurationID : tableData.ordDurationID,
            this.state.dataSource[newCode]['ordDurationDesc'] = this.state.ordDurationDesc ? this.state.ordDurationDesc : tableData.ordDurationDesc,
            this.state.dataSource[newCode]['ordQty'] = this.state.ordQty ? this.state.ordQty : tableData.ordQty,
            this.state.dataSource[newCode]['ordQtyUomID'] = this.state.ordQtyUomID ? this.state.ordQtyUomID : tableData.ordQtyUomID,
            this.state.dataSource[newCode]['ordQtyUomDesc'] = this.state.ordQtyUomDesc ? this.state.ordQtyUomDesc : tableData.ordQtyUomDesc,
            this.state.dataSource[newCode]['ordPrice'] = this.state.ordPrice ? this.state.ordPrice : tableData.ordPrice,
            this.state.dataSource[newCode]['ordSkinTestFlag'] = this.state.ordSkinTestFlag ? this.state.ordSkinTestFlag : tableData.ordSkinTestFlag,
            this.state.dataSource[newCode]['ordEMFlag'] = this.state.ordEMFlag ? this.state.ordEMFlag : tableData.ordEMFlag,
            this.state.dataSource[newCode]['ordSkinTestWayID'] = this.state.ordSkinTestWayID,
            this.state.dataSource[newCode]['ordSkinTestWayDesc'] = this.state.ordSkinTestWayDesc,
            this.state.dataSource[newCode]['ordRecLocID'] = this.state.ordRecLocID ? this.state.ordRecLocID : tableData.ordRecLocID,
            this.state.dataSource[newCode]['ordRecLocDesc'] = this.state.ordRecLocDesc ? this.state.ordRecLocDesc : tableData.ordRecLocDesc,
            this.state.dataSource[newCode]['ordPriorityID'] = this.state.ordPriorityID ? this.state.ordPriorityID : tableData.ordPriorityID,
            this.state.dataSource[newCode]['ordPriorityDesc'] = this.state.ordPriorityDesc ? this.state.ordPriorityDesc : tableData.ordPriorityDesc,
            this.state.dataSource[newCode]['ordAdmReasonID'] = this.state.ordAdmReasonID ? this.state.ordAdmReasonID : tableData.ordAdmReasonID,
            this.state.dataSource[newCode]['ordAdmReasonDesc'] = this.state.ordAdmReasonDesc ? this.state.ordAdmReasonDesc : tableData.ordAdmReasonDesc,
            this.state.dataSource[newCode]['ordFrequenceDesc'] = this.state.freCode ? this.state.freCode : tableData.ordFreqCode,
            // this.state.dataSource[newCode]['ordFreCode'] = this.state.ordFreqDesc ? this.state.freCode : tableData.ordFreqCode,
            this.state.dataSource[newCode]['ordSeqNo'] = parseInt(newCode) + 1,
            this.state.dataSource[newCode]['ordDate'] = moment(date).format(dayFormat),
            this.state.dataSource[newCode]['ordTime'] = moment(date).format(timeFormat),
            this.state.dataSource[newCode]['ordStartDate'] = moment(date).format(dayFormat),
            this.state.dataSource[newCode]['ordStartTime'] = moment(date).format(timeFormat),
            this.state.dataSource[newCode]['ordNote'] = this.state.ordNote ? this.state.ordNote : tableData.ordNote,
            this.state.dataSource[newCode]['medID'] = tableData.medID,
            this.state.dataSource[newCode]['ordTypeCode'] = tableData.ordTypeCode,
            this.state.dataSource[newCode]['ordSpecID'] = this.state.ordSpecID ? this.state.ordSpecID : tableData.ordSpecID,
            this.state.dataSource[newCode]['ordSpecDesc'] = this.state.ordSpecDesc ? this.state.ordSpecDesc : tableData.ordSpecDesc,
            this.setState({
                doubleIndex: '', tableData: '',
                ordPrice: '',
                ordDose: '',
                ordDoseUnitID: '',
                ordUsageID: '',
                ordFreqID: '',
                ordDurQty: '',
                ordDurationID: '',
                ordQtyUomID: '',
                ordSkinTestWayID: '',
                ordEMFlag: '',
                ordSkinTestFlag: '',
                ordNote: '',
                ordRecLocID: '',
                ordAdmReasonID: '',
                ordPriorityID: '',
                ordSpecID: '',
                changeValue:'',
                ordQty:''
            })
    }

    //删除历史模版数据
    loadDeleteTemplate() {
        var { ids } = this.state;
        var code = []
        for (var i = 0; i < ids.length; i++) {
            if (typeof (ids[i]) == 'string') {
                code.push(ids[i])
            }
        }
        var params = {
            params: [{
                ordID: code
            }],
        }
        $http.post('urlDeault', this, {
            code: "03050038",
            data: params,
            success: function (res) {
                if (res.errorCode == '0') {
                    message.success('删除成功')
                    this.loadData(1)
                }
            }
        });
    }

    //删除
    delMechansim() {
        var { dataSource, ids } = this.state;
        if (ids.length < 1) {
            message.error('请选择你需要删除的数据')
            return
        }
        for (var i = 0; i < ids.length; i++) {
            for (var j = 0; j < dataSource.length; j++) {
                if (typeof (ids[i]) == 'string' && dataSource[j].ordID == ids[i]) {
                    this.loadDeleteTemplate()
                } else {
                    if (dataSource[j].tabIndex && ids[i] == dataSource[j].tabIndex) {
                        this.state.dataSource.splice(j, 1);
                    }
                }
            }
        }
        this.setState({ ids: [] })
    }

    //上移
    handleUpSort() {
        var keys = this.state.ids
        var data = this.state.dataSource
        var newKeys = []
        var temp = []
        for (var i = 0; i < data.length; i++) {
            for (var j = 0; j < keys.length; j++) {
                if (data[i].ordID == keys[j]) {
                    message.error('已插入的医嘱无法移动，请重新选择')
                    return
                }
            }
            if (!Util.isEmpty(data[i].ordID)) {
                temp.push(data[i])
            }
        }
        keys = keys.sort(function (m, n) {
            if (m < n) return -1
            else if (m > n) return 1
            else return 0
        });
        for (var i = 0; i < keys.length; i++) {
            if (keys[i]-1 === 1) {
                newKeys.push(keys[i])
                continue
            }
            // if (keys[i] > temp.length) {
                var curRowData = data[keys[i]-1]
                var curRowKey = curRowData.tabIndex
                var upRowData = data[keys[i] - 2]
                var upRowKey = upRowData.tabIndex
                upRowData.tabIndex = curRowKey
                curRowData.tabIndex = upRowKey
    
                data[keys[i]-1] = upRowData
                data[keys[i] - 2] = curRowData
                newKeys.push(keys[i]-1)
                if(Util.isEmpty(data[keys[i] -2].tabIndex)){
                    return
                }
            // } else {
            //     newKeys.push(keys[i])
            // }
        }
        this.setState(
            {
                dataSource: data,
                ids: newKeys
            }
        )

    }

    handleDownSort() {
        var keys = this.state.ids
        var data = this.state.dataSource
        for (var i = 0; i < data.length; i++) {
            for (var j = 0; j < keys.length; j++) {
                if (data[i].ordID == keys[j]) {
                    message.error('已插入的医嘱无法移动，请重新选择')
                    return
                }
            }
        }
        var newKeys = []
        keys = keys.sort(function (m, n) {
            if (m < n) return -1
            else if (m > n) return 1
            else return 0
        });
        for (var i = keys.length - 1; i >= 0; i--) {
            if (keys[i] === data.length) {
                newKeys.push(keys[i])
                continue
            }
            // var curRowData = data[keys[i]]
            // var upRowData = data[keys[i] + 1]
            // data[keys[i]] = upRowData
            // data[keys[i] + 1] = curRowData
            // newKeys.push(keys[i] + 1)
            var curRowData=data[keys[i]-1]
            var upRowData=data[keys[i]]
            var curRowKey=curRowData.tabIndex
            var upRowKey=upRowData.tabIndex
            upRowData.tabIndex=curRowKey
            curRowData.tabIndex=upRowKey
            data[keys[i]-1]=upRowData
            data[keys[i]]=curRowData
            newKeys.push(keys[i]+1)
        }
        this.setState(
            {
                dataSource: data,
                ids: newKeys
            }
        )
    }

    changeData(e) {
        this.setState({
            new: true,
            date: moment(e).format('YYYY-MM-DD')
        })
    }

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

    //获取引用弹框
    showCopyTextModal() {
        this.setState({
            isCopyTextModal: true
        })
    }

    onCopyText() {

    }

    //添加模版
    addTemplateModal() {
        this.setState({
            isAddTemplateModal: true
        })
    }

    onAddTemplateMOdal() {

    }

    //添加套餐
    addPackageModal() {
        this.setState({
            isAddPackageModal: true
        })
    }

    onAddPackageModal() {

    }

    //多选模版，确认错误弹框
    confirmAdviceModal(data) {
        var that = this;
        var date = new Date();
        var validData = [], textData = [];
        var { adviceDrData, dataSource, nodeId, confirmData } = this.state;

        var result = [];
        //取两个数组的不同数据
        for (var i = 0; i < adviceDrData.length; i++) {
            var obj = adviceDrData[i];
            var num = obj.indexId;
            var isExist = false;
            for (var j = 0; j < confirmData.length; j++) {
                var aj = confirmData[j];
                var n = aj.indexId;
                if (n == num) {
                    isExist = true;
                    break;
                }
            }
            if (!isExist) {
                result.push(obj);
            }
        }
        var userCode = []
        for (var i = 0; i < adviceDrData.length; i++) {
            var obj = adviceDrData[i];
            var num = obj.indexId;
            var isExist = false;
            for (var j = 0; j < data.length; j++) {
                var aj = data[j];
                var n = aj.indexId;
                if (n == num) {
                    textData.push(obj)
                    isExist = true;
                    break;
                }
            }
            if (!isExist) {
                userCode.push(obj);
            }
        }
        validData = result.concat(textData)
        for (var i = 0; i < validData.length; i++) {
            this.state.dataSource.push({ tabIndex: this.state.dataSource.length + 1 })
            this.state.indexArray.push({ index: this.state.dataSource.length - 1, indexId: validData[i].indexId })
            this.setState({ groupStatus: false })
        }
        //冒泡排序，用来处理关联排序问题
        for (var i = 0; i < validData.length - 1; i++) {
            for (var j = 0; j < validData.length - i - 1; j++) {
                if (validData[j].indexId > validData[j + 1].indexId) {
                    var temp = validData[j].indexId
                    validData[j].indexId = validData[j + 1].indexId
                    validData[j + 1].indexId = temp
                }
            }
        }
        var { indexArray } = this.state;
        for (var i = 0; i < validData.length; i++) {
            for (var j = 0; j < indexArray.length; j++) {
                if (indexArray[j].index && indexArray[j].indexId == validData[i].indexId) {
                    that.state.dataSource[indexArray[j].index]['ordMedItemDesc'] = validData[i].defaultData.ordDesc,
                        that.state.dataSource[indexArray[j].index]['ordDose'] = validData[i].defaultData.ordDose,
                        that.state.dataSource[indexArray[j].index]['ordDoseUnitID'] = validData[i].defaultData.ordDoseUnitID,
                        that.state.dataSource[indexArray[j].index]['ordDoseUnitDesc,'] = validData[i].defaultData.ordDoseUnitDesc,
                        that.state.dataSource[indexArray[j].index]['ordFreqID'] = validData[i].defaultData.ordFreqID,
                        that.state.dataSource[indexArray[j].index]['ordFreqDesc'] = validData[i].defaultData.ordFreqCode,
                        that.state.dataSource[indexArray[j].index]['ordUsageID'] = validData[i].defaultData.ordUsageID,
                        that.state.dataSource[indexArray[j].index]['ordDurQty'] = validData[i].defaultData.ordDurQty,
                        that.state.dataSource[indexArray[j].index]['ordDurationID'] = validData[i].defaultData.ordDurationID,
                        that.state.dataSource[indexArray[j].index]['ordDurationDesc'] = validData[i].defaultData.ordDurationDesc,
                        that.state.dataSource[indexArray[j].index]['ordQty'] = validData[i].defaultData.ordQty,
                        that.state.dataSource[indexArray[j].index]['ordQtyUomID'] = validData[i].defaultData.ordQtyUomID,
                        that.state.dataSource[indexArray[j].index]['ordQtyUomDesc'] = validData[i].defaultData.ordQtyUomDesc,
                        that.state.dataSource[indexArray[j].index]['ordPrice'] = validData[i].defaultData.ordPrice,
                        that.state.dataSource[indexArray[j].index]['ordSkinTestFlag'] = validData[i].defaultData.ordSkinTestFlag,
                        that.state.dataSource[indexArray[j].index]['ordEMFlag'] = validData[i].defaultData.ordEMFlag,
                        that.state.dataSource[indexArray[j].index]['ordSkinTestWayID'] = validData[i].defaultData.ordSkinTestWayID,
                        that.state.dataSource[indexArray[j].index]['ordRecLocID'] = validData[i].defaultData.ordRecLocID,
                        that.state.dataSource[indexArray[j].index]['ordRecLocDesc'] = validData[i].defaultData.ordRecLocDesc,
                        that.state.dataSource[indexArray[j].index]['ordPriorityID'] = validData[i].defaultData.ordPriorityID,
                        that.state.dataSource[indexArray[j].index]['ordPriorityDesc'] = validData[i].defaultData.ordPriorityDesc,
                        that.state.dataSource[indexArray[j].index]['medDesca'] = validData[i].defaultData.ordDesca,
                        that.state.dataSource[indexArray[j].index]['ordAdmReasonID'] = validData[i].defaultData.ordAdmReasonID,
                        that.state.dataSource[indexArray[j].index]['ordAdmReasonDesc'] = validData[i].defaultData.ordAdmReasonDesc,
                        that.state.dataSource[indexArray[j].index]['ordSeqNo'] = parseInt(indexArray[j].index) + 1,
                        that.state.dataSource[indexArray[j].index]['ordDate'] = moment(date).format(dayFormat),
                        that.state.dataSource[indexArray[j].index]['ordTime'] = moment(date).format(timeFormat),
                        that.state.dataSource[indexArray[j].index]['ordStartDate'] = moment(date).format(dayFormat),
                        that.state.dataSource[indexArray[j].index]['ordStartTime'] = moment(date).format(timeFormat),
                        that.state.dataSource[indexArray[j].index]['ordNote'] = validData[i].defaultData.ordNote,
                        that.state.dataSource[indexArray[j].index]['medID'] = validData[i].defaultData.medID,
                        that.state.dataSource[indexArray[j].index]['ordTypeCode'] = validData[i].defaultData.ordTypeCode,
                        that.state.dataSource[indexArray[j].index]['ordSpecID'] = validData[i].defaultData.ordSpecID,
                        that.state.dataSource[indexArray[j].index]['ordSpecDesc'] = validData[i].defaultData.ordSpecDesc,
                        that.setState({
                            doseUnitList: validData[i].dataList.doseUnitList,//剂量单位
                            durationList: validData[i].dataList.durationList,//疗程单位
                            qtyUnitList: validData[i].dataList.qtyUnitList,//数量单位
                            recLocList: validData[i].dataList.recLocList,//接收科室
                            frequenceList: validData[i].dataList.frequenceList,//频次
                            usageList: validData[i].dataList.usageList,//用法
                            skinTestWayList: validData[i].dataList.skinTestWayList,//皮试备注
                            priorityList: validData[i].dataList.priorityList,//优先级
                            admReasonList: validData[i].dataList.admReasonList,
                            specList: validData[i].dataList.specList,//标本
                        })
                }
            }
        }
        this.hideModal('isShowConfirmModal')
    }

    //点击保存，回传current，渲染步骤进度
    saveDiagnosisMsg() {
        var { saveDiagnosisMsg } = this.props;
        saveDiagnosisMsg && saveDiagnosisMsg(3)
    }

    //双击表格行
    setRowClick = (record, index) => {
        return {
            onDoubleClick: () => {
                if (record.ordID) {
                    message.error('已插入的历史数据无法进行修改，请重新选择')
                    return
                }
                this.setState({
                    rowIndex: record.tabIndex,
                    colStatus: true,
                    doubleIndex: index
                }, () => {
                    this.addMechansim('clear')
                    this.loadTableData('click', record, '')
                });
            },
        };
    }

    //点击行，渲染当前行样式 
    setRowClassName = (record) => {
        if (Util.isEmpty(record.redID) && record.tabIndex) {
            return record.tabIndex === this.state.rowIndex ? 'clickRowStyle' : '';
        } else {
            return record.ordBilledCode == 'P' ? 'rowClassStyle' : ''
        }
    }

    render() {
        const { ids } = this.state;
        const rowSelection = {
            ids,
            onChange: this.onSelectChange.bind(this),
            onSelect: this.onSelect.bind(this),
            selectedRowKeys: ids
        }
        //计量单位
        var doseUnitListOption = []
        this.state.doseUnitList && this.state.doseUnitList.map((item, index) => {
            doseUnitListOption.push(<Option key={index} value={item.doseUnitID + '^' + item.doseUnitDesc}>{item.doseUnitDesc}</Option>)
        })

        //频次
        var frequenceListOption = []
        this.state.frequenceList && this.state.frequenceList.map((item, index) => {
            frequenceListOption.push(<Option key={index} value={item.code +'-'+item.id + '^' + item.descripts}>{item.descripts}</Option>)
        })

        //用法
        var usageListOption = []
        this.state.usageList && this.state.usageList.map((item, index) => {
            usageListOption.push(<Option key={index} value={item.id + '^' + item.descripts}>{item.descripts}</Option>)
        })

        //疗程单位
        var durationListOption = []
        this.state.durationList && this.state.durationList.map((item, index) => {
            durationListOption.push(<Option key={index} value={item.id + '^' + item.descripts}>{item.descripts}</Option>)
        })

        //数量单位
        var qtyUnitListOption = []
        this.state.qtyUnitList && this.state.qtyUnitList.map((item, index) => {
            qtyUnitListOption.push(<Option key={index} value={item.unitID + '^' + item.unitDesc}>{item.unitDesc}</Option>)
        })

        //皮试备注
        var skinTextWayListOption = []
        this.state.skinTestWayList && this.state.skinTestWayList.map((item, index) => {
            skinTextWayListOption.push(<Option key={index} value={item.id + '^' + item.descripts}>{item.descripts}</Option>)
        })

        //执行科室
        var recLocListOption = []
        this.state.recLocList && this.state.recLocList.map((item, index) => {
            recLocListOption.push(<Option key={index} value={item.recLocID + '^' + item.recLocDesc}>{item.recLocDesc}</Option>)
        })

        //医嘱优先级
        var priorityListOption = []
        this.state.priorityList && this.state.priorityList.map((item, index) => {
            priorityListOption.push(<Option key={index} value={item.id + '^' + item.descripts}>{item.descripts}</Option>)
        })

        //结算类型
        var admReasonListOption = []
        this.state.admReasonList && this.state.admReasonList.map((item, index) => {
            admReasonListOption.push(<Option key={index} value={item.id + '^' + item.descripts}>{item.descripts}</Option>)
        })
        const dateFormatList = ['YYYYMMDD', 'YYYY-MM-DD'];
        //标本
        var specListOption = []
        this.state.specList && this.state.specList.map((item, index) => {
            specListOption.push(<Option key={index} value={item.id + '^' + item.descripts}>{item.descripts}</Option>)
        })
        return <div className='doctor-step-body'>
            {/**引用弹框 */}
            <CopyTextModal isShow={this.state.isCopyTextModal}
                onSubmit={this.onCopyText.bind(this)}
                onHide={this.hideModal.bind(this, 'isCopyTextModal')}>
            </CopyTextModal>
            {/**添加模版 */}
            <AddTemplateModal isShow={this.state.isAddTemplateModal}
                onSubmit={this.onAddTemplateMOdal.bind(this)}
                onHide={this.hideModal.bind(this, 'isAddTemplateModal')}>
            </AddTemplateModal>
            {/**添加套餐 */}
            <AddPackageModal isShow={this.state.isAddPackageModal}
                onSubmit={this.onAddPackageModal.bind(this)}
                onHide={this.hideModal.bind(this, 'isAddPackageModal')}>
            </AddPackageModal>

            {/**确认医嘱弹框 */}
            <ShowConfirmModal isShow={this.state.isShowConfirmModal}
                confirmData={this.state.confirmData}
                errorData={this.state.errorData}
                onSubmit={this.confirmAdviceModal.bind(this)}
                onHide={this.hideModal.bind(this, 'isShowConfirmModal')}>
            </ShowConfirmModal>
            <Card style={{ float: 'left', width: '20%', height: '600px', overflow: 'auto' }} title={<span>医嘱模版</span>}
                extra={<div onClick={this.batchAddTemplate.bind(this)} className='batch-add-temp'><Icon type='plus-circle' />批量添加</div>}>
                <Input placeholder='输入模版/套餐名称按回车键查询' onChange={Util.commonInputChange.bind(this, 'templateInput')}
                    onKeyDown={this.onSearchTemplate.bind(this)} />
                {this.state.templateData && this.state.templateData.length > 0 ?
                    <Tree checkable defaultExpandAll={true} defaultExpandedKeys={['1']}
                        checkedKeys={this.state.nodeId}
                        onCheck={this.checkTreeNode.bind(this)}
                        onDoubleClick={this.loadTempTableData.bind(this, 'temp')}>
                        {this.loadTemplate()}
                    </Tree> :
                    <div style={{ marginLeft: '25%', marginTop: 40 }}>
                        <span style={{ color: 'red', fontSize: '16px' }}>暂无模版数据</span></div>}
                {/* <div onClick={this.batchAddTemplate.bind(this)} className='batch-add-temp'><Icon type='plus-circle' />批量添加模版</div> */}
            </Card>
            <Card style={{ float: 'right', width: '79%' }}>
                <div style={{ display: 'flex' }}>
                    <div style={{ cursor: 'pointer' }} className={this.state.indexStyle == '1' ? 'mouse-add-Style' : ''}
                        onClick={this.addMechansim.bind(this, '')}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '1')}>
                        <Icon type='plus-circle' style={{ marginLeft: '6px' }} />
                        <div>添加</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} className={this.state.indexStyle == '2' ? 'mouse-add-Style' : ''}
                        onClick={this.delMechansim.bind(this)}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '2')}>
                        <Icon type='delete' style={{ marginLeft: '6px' }} />
                        <div>删除</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} className={this.state.indexStyle == '3' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onClick={this.handleUpSort.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '3')}>
                        <Icon type='up-circle' style={{ marginLeft: '6px' }} />
                        <div>上移</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} className={this.state.indexStyle == '4' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onClick={this.handleDownSort.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '4')}>
                        <Icon type='down-circle' style={{ marginLeft: '6px' }} />
                        <div>下移</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} className={this.state.indexStyle == '5' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onClick={this.handleStartGroup.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '5')}>
                        <Icon type='file-add' style={{ marginLeft: '15px' }} />
                        <div>开始分组</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} className={this.state.indexStyle == '6' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onClick={this.handleCannelGroup.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '6')}>
                        <Icon type='file-excel' style={{ marginLeft: '15px' }} />
                        <div>取消分组</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} onClick={this.showCopyTextModal.bind(this)}
                        className={this.state.indexStyle == '7' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '7')}>
                        <Icon type='copy' style={{ marginLeft: '6px' }} />
                        <div>引用</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} onClick={this.addTemplateModal.bind(this)}
                        className={this.state.indexStyle == '8' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '8')}>
                        <Icon type='plus-square' style={{ marginLeft: '15px' }} />
                        <div>添加模版</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} onClick={this.addPackageModal.bind(this)}
                        className={this.state.indexStyle == '9' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '9')}>
                        <Icon type='menu-unfold' style={{ marginLeft: '15px' }} />
                        <div>添加套餐</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} className={this.state.indexStyle == '10' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '10')}>
                        <Icon type='profile' style={{ marginLeft: '15px' }} />
                        <div>常用方法</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} className={this.state.indexStyle == '11' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onClick={this.saveDiagnosisMsg.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '11')}>
                        <Icon type='setting' style={{ marginLeft: '15px' }} />
                        <div>下一步</div>
                    </div>
                    <div style={{ cursor: 'pointer', marginLeft: 10 }} className={this.state.indexStyle == '12' ? 'mouse-add-Style' : ''}
                        onMouseLeave={this.addMouseLeaveStyle.bind(this)}
                        onClick={this.insertDoctorAdvice.bind(this)}
                        onMouseOver={this.addMouseOverStyle.bind(this, '12')}>
                        <Icon type='save' style={{ marginLeft: '6px' }} />
                        <div>保存</div>
                    </div>

                    <div style={{ marginLeft: '9%' }}>
                        <div><span style={{ color: 'red' }}>未收费处方金额：{this.state.prescriptionFee?this.state.prescriptionFee + '元':0}</span></div>
                        <div><span style={{ color: 'red' }}>当前处方总金额:</span></div>
                    </div>

                    <div style={{ display: 'flex', marginLeft: '9%' }}>
                        <Button><Icon type='pay-circle' />卡消费</Button>
                        <Button style={{ marginLeft: 10 }}>草药录入</Button>
                        <Button style={{ marginLeft: 10 }}>申请单</Button>
                    </div>
                </div>

                <Table columns={this.columns}
                    style={{ height: 400 }}
                    dataSource={this.state.dataSource}
                    loadData={this.loadData.bind(this)}
                    rowSelection={rowSelection}
                    onRow={this.setRowClick}
                    rowClassName={this.setRowClassName}
                    scroll={{ y: 300 }}
                    bordered
                    title={() => {
                        return <span>处方提示信息</span>
                    }}
                    rowKey={(data) => {
                        return data.ordID || data.tabIndex
                    }}
                    pagination={false}></Table>

                <div style={{ marginTop: 10 }}>
                    <div style={{ background: '#64A982' }}><span style={{ marginLeft: 10, color: 'white', fontSize: 16 }}>医嘱录入</span></div>
                    <Col style={{ marginTop: 5 }}>
                        <span>项目名称及规格：<Select style={{ width: '280px' }} showSearch allowClear
                            defaultActiveFirstOption={false}
                            disabled={this.state.titleData && this.state.titleData.depDoctorFlag == 'N'?true:false}
                            ref={this.textInput}
                            value={this.state.tableData ? (this.state.tableData.ordMedItemDesc || this.state.tableData.ordDesc)
                                : this.state.changeValue}
                            showArrow={false}
                            filterOption={false}
                            onSearch={this.handleSearch.bind(this)}
                            onDropdownVisibleChange={this.handleFocusInput.bind(this)}
                            notFoundContent={null}
                            dropdownRender={(menuNode, props) => {
                                return (<div onMouseLeave={() => {
                                    this.setState({
                                        visStatus: false,
                                    })
                                }} onMouseEnter={() => { this.setState({ visStatus: true }) }}>
                                    <Table
                                        dataSource={this.state.selectData}
                                        rowKey={(record) => record.medID}
                                        // onMouseLeave={() => { this.setState({ visible: false }) }}
                                        // onMouseEnter={() => { this.setState({ visible: true }) }}
                                        columns={this.sunColumns}
                                        rowClassName={(data) => {
                                            return data.ordBilledCode == 'P' ? 'rowClassStyle' : ''
                                        }}
                                        bordered
                                        pagination={false}
                                        onRow={(record, index) => {
                                            return {
                                                onDoubleClick: this.rowClick.bind(this, record, index)
                                            }
                                        }}
                                    ></Table>
                                    <Pagination
                                        size="small"
                                        showQuickJumper
                                        showSizeChanger
                                        defaultCurrent={1}
                                        current={this.state.page}
                                        total={this.state.total}
                                        onShowSizeChange={this.changePageSize.bind(this)}
                                        onChange={this.onChange.bind(this)}
                                        style={{ textAlign: "right", marginTop: '13px' }}
                                    />
                                </div>
                                );
                            }}
                            dropdownMatchSelectWidth={false}
                            dropdownStyle={{ width: '800px', height: 300, overflow: 'auto' }}
                            open={this.state.visible || this.state.visStatus}
                            ></Select>
                        </span>

                        <span style={{ marginLeft: 10 }}>单价：<Input style={{ width: 120 }}
                            value={this.state.ordPrice ? this.state.ordPrice :
                                (this.state.tableData ? this.state.tableData.ordPrice : undefined)}
                            onChange={Util.commonInputChange.bind(this, 'ordPrice')} />
                        </span>

                        {this.state.tableData && (this.state.tableData.ordTypeCode == 'E' ||
                            this.state.tableData.ordTypeCode == 'L') ? null :
                            <span style={{ marginLeft: 10 }}>剂量：<Input style={{ width: 120 }}
                                value={this.state.ordDose ? this.state.ordDose :
                                    (this.state.tableData ? this.state.tableData.ordDose : undefined)}
                                onChange={Util.commonInputChange.bind(this, 'ordDose')} />
                                <Select style={{ width: 120, marginLeft: 5 }}
                                    value={this.state.ordDoseUnitID ? this.state.ordDoseUnitDesc :
                                        (this.state.tableData ? this.state.tableData.ordDoseUnitDesc : undefined)}
                                    onChange={this.changeCommonSelect.bind(this, 'ordDoseUnitID', 'ordDoseUnitDesc')}>
                                    {doseUnitListOption}
                                </Select></span>}
                        {this.state.tableData && (this.state.tableData.ordTypeCode == 'E' ||
                            this.state.tableData.ordTypeCode == 'L') ? null :
                            <span style={{ marginLeft: 10 }}>用法：<Select style={{ width: 120 }}
                                firstActiveValue={this.state.ordUsageID ? (this.state.ordUsageID + '^' + this.state.ordUsageDesc) :
                                    (this.state.tableData ? this.state.tableData.ordUsageID + '^' + this.state.tableData.ordUsageDesc : undefined)}
                                defaultActiveFirstOption={false}
                                value={this.state.ordUsageID ? this.state.ordUsageDesc :
                                    (this.state.tableData ? this.state.tableData.ordUsageDesc : undefined)}
                                onChange={this.changeCommonSelect.bind(this, 'ordUsageID', 'ordUsageDesc')}>{usageListOption}</Select></span>}

                        {this.state.tableData && (this.state.tableData.ordTypeCode == 'E' ||
                            this.state.tableData.ordTypeCode == 'L') ? null :
                            <span style={{ marginLeft: 10 }}>频次：<Select style={{ width: 120 }}
                                defaultActiveFirstOption={false}
                                firstActiveValue={this.state.ordFreqID ? (this.state.ordFreqID + '^' + this.state.ordFreqDesc) :
                                    (this.state.tableData ? this.state.tableData.ordFreqID + '^' +
                                        (this.state.tableData.ordFreqCode || this.state.tableData.ordFrequenceDesc) : undefined)}
                                value={this.state.ordFreqID ? this.state.ordFreqDesc :
                                    (this.state.tableData ? (this.state.tableData.ordFreqDesc || this.state.tableData.ordFrequenceDesc) : undefined)}
                                onChange={this.changeCommonSelect.bind(this, 'ordFreqID', 'ordFreqDesc')}>
                                {frequenceListOption}
                            </Select></span>}

                        {this.state.tableData && (this.state.tableData.ordTypeCode == 'E' ||
                            this.state.tableData.ordTypeCode == 'L') ? null :
                            <span style={{ marginLeft: 10 }}>疗程：<Input style={{ width: 120 }}
                                onChange={Util.commonInputChange.bind(this, 'ordDurQty')}
                                value={this.state.ordDurQty ? this.state.ordDurQty :
                                    (this.state.tableData ? this.state.tableData.ordDurQty : undefined)} />
                                <Select style={{ width: 120, marginLeft: 5 }}
                                    value={this.state.ordDurationID ? this.state.ordDurationDesc :
                                        (this.state.tableData ? this.state.tableData.ordDurationDesc : undefined)}
                                    onChange={this.changeCommonSelect.bind(this, 'ordDurationID', 'ordDurationDesc')}>
                                    {durationListOption}
                                </Select></span>}

                        <span style={{ marginLeft: 10 }}>数量：<Input style={{ width: 120 }}
                            onChange={Util.commonInputChange.bind(this, 'ordQty')}
                            value={this.state.ordQty ? this.state.ordQty :
                                (this.state.tableData ? this.state.tableData.ordQty : undefined)} />
                            <Select style={{ width: 120, marginLeft: 5 }}
                                value={this.state.ordQtyUomID ? this.state.ordQtyUomDesc :
                                    (this.state.tableData ? this.state.tableData.ordQtyUomDesc : undefined)}
                                onChange={this.changeCommonSelect.bind(this, 'ordQtyUomID', 'ordQtyUomDesc')}>
                                {qtyUnitListOption}
                            </Select></span>

                        {this.state.tableData && (this.state.tableData.ordTypeCode == 'E' ||
                            this.state.tableData.ordTypeCode == 'L') ? null :
                            <span style={{ marginLeft: 10 }}>皮试备注：<Select style={{ width: 150 }}
                                value={this.state.ordSkinTestWayID ? this.state.ordSkinTestWayDesc :
                                    (this.state.tableData ? this.state.tableData.ordSkinTestWayID : undefined)}
                                onChange={this.changeCommonSelect.bind(this, 'ordSkinTestWayID', 'ordSkinTestWayDesc')}>
                                {skinTextWayListOption}
                            </Select></span>}

                        {this.state.tableData && (this.state.tableData.ordTypeCode == 'D' || this.state.tableData.ordTypeCode == 'E' ||
                            this.state.tableData.ordTypeCode == 'O' || this.state.tableData.ordTypeCode == 'M') ? null :
                            <span style={{ marginLeft: 10 }}><Checkbox
                                // checked={this.state.ordEMFlag == 'Y' ? true :
                                //     (this.state.tableData ? (this.state.tableData.ordEMFlag == 'Y' ? true : false) : false)}
                                onChange={this.changeCheckBox.bind(this, 'ordEMFlag')} />加急</span>}
                        {this.state.tableData && (this.state.tableData.ordTypeCode == 'E' ||
                            this.state.tableData.ordTypeCode == 'L') ? null :
                            <span style={{ marginLeft: 10 }}><Checkbox
                                onChange={this.changeCheckBox.bind(this, 'ordSkinTestFlag')}
                                checked={this.state.ordSkinTestFlag == 'Y' ? true :
                                    (this.state.tableData ? (this.state.tableData.ordSkinTestFlag == 'Y' ? true : false) : false)} />皮试</span>}
                    </Col>
                    <Col style={{ marginTop: 5 }}>
                        <span style={{ marginLeft: 10 }}>备注：<Input style={{ width: 150 }}
                            value={this.state.ordNote ? this.state.ordNote :
                                (this.state.tableData ? this.state.tableData.ordNote : undefined)}
                            onChange={Util.commonInputChange.bind(this, 'ordNote')} /></span>

                        <span style={{ marginLeft: 10 }}>执行科室：<Select style={{ width: 150 }}
                            value={this.state.ordRecLocID ? this.state.ordRecLocDesc :
                                (this.state.tableData ? this.state.tableData.ordRecLocDesc : undefined)}
                            onChange={this.changeCommonSelect.bind(this, 'ordRecLocID', 'ordRecLocDesc')}>
                            {recLocListOption}
                        </Select></span>

                        <span style={{ marginLeft: 10 }}>结算类型：<Select style={{ width: 150 }}
                            value={this.state.ordAdmReasonID ? this.state.ordAdmReasonDesc :
                                (this.state.tableData ? this.state.tableData.ordAdmReasonDesc : undefined)}
                            onChange={this.changeCommonSelect.bind(this, 'ordAdmReasonID', 'ordAdmReasonDesc')}>
                            {admReasonListOption}
                        </Select></span>

                        <span style={{ marginLeft: 10 }}>医嘱优先级：<Select style={{ width: 150 }}
                            value={this.state.ordPriorityID ? this.state.ordPriorityDesc :
                                (this.state.tableData ? this.state.tableData.ordPriorityDesc : undefined)}
                            onChange={this.changeCommonSelect.bind(this, 'ordPriorityID', 'ordPriorityDesc')}>
                            {priorityListOption}
                        </Select></span>

                        {this.state.tableData && (this.state.tableData.ordTypeCode == 'D' || this.state.tableData.ordTypeCode == 'E' ||
                            this.state.tableData.ordTypeCode == 'O' || this.state.tableData.ordTypeCode == 'M' || this.state.tableData.ordTypeCode == 'L') ? null :
                            <span style={{ marginLeft: 10 }}>标本：<Select style={{ width: 150 }}
                                value={this.state.ordSpecID ? this.state.ordSpecDesc :
                                    (this.state.tableData ? this.state.tableData.ordSpecDesc : undefined)}
                                onChange={this.changeCommonSelect.bind(this, 'ordSpecID', 'ordSpecDesc')}>
                                {specListOption}
                            </Select></span>}

                        {/* <span style={{ marginLeft: 10 }}>录入时间：<DatePicker onChange={this.changeData.bind(this)}  format={this.state.new?'YYYY-MM-DD':'YYYYMMDD'} /></span> */}
                        <Button type='primary' style={{ marginLeft: 10 }} onClick={this.addDataSource.bind(this)}>提交</Button>
                        <Button type='primary' style={{ marginLeft: 10 }} onClick={this.addMechansim.bind(this, 'clear')}>清空</Button>
                    </Col>
                </div>
            </Card>
        </div>
    }

}
export default NewDoctorAdviceStepPage;