/*
 * Creator:     ML
 * CreatDate:   2019-10-12
 * descripts：门诊挂号评估单配置
 * */
import React from 'react';
import { Form, Row, Col, Input, Select, Button, message, Checkbox, Tabs, Divider, AutoComplete } from 'antd';
import { $http } from '../../containers/config/https';
import { Util, } from 'tools/index';
import './css/index.less';
import { $loadTemplate } from '../lodop/Common/Print.js';
const { TabPane } = Tabs;
const { TextArea } = Input;
const Option = Select.Option;

const ConfigOutReg = Form.create()(
  class ConfigOutReg extends React.Component {
    cacheOriginData = {};
    constructor() {
      super()
      var userData = JSON.parse(sessionStorage.getItem('userData'));
      this.state = {
        checked: true,
        DetailTabs: [],//评估单明细tabs
        fieldNum: 1,//每行显示字段 针对布局
        activeKey: '1',
        fieldArr: [],
        regValuationFormID: "",
        titleData: {},
        userData: userData,
        medchild: [], // 检查医嘱
        assmentSheetData: []
      }
    }

    componentDidMount() {
      this.getDetailTabs()
      this.loadPatient()
    }

    loadPatient() {
      let patientData = JSON.parse(sessionStorage.getItem('patientData'));
      // let userData = JSON.parse(sessionStorage.getItem('userData'))
      var params = {
        params: [{
          admID: this.props.admID,
        }]
      }
      $http.post('urlDeault', this, {
        code: "03100075",
        data: params,
        success: function (res) {
          if (res.errorCode == '0') {
            sessionStorage.setItem('titleData', JSON.stringify(res.result))
            this.setState({
              titleData: res.result,
            })
          }
        }
      });
    }

    //获取评估单明细列表
    getDetailTabs = () => {
      let data = {}
      data = {
        params: [{
          userID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).userID : "",
          hospID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).hospID : "",
          locID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).locID : "",
          // admID: "27195",//患者就诊id
          admID: this.props.admID,
        }],
      }
      $http.post('urlS', this, {
        code: '03040032',
        data: data,
        success: function (res) {
          if (+res.errorCode === 0 && res.result) {
            this.setState({
              DetailTabs: res.result,
              medchild: res.medchild,
            }, () => {
              if (res.result && res.result.length > 0) {
                res.result && res.result.map((item, i) => {
                  item.field && item.field.map((items, index) => {
                    if (item.id == res.result[0].id) {
                      this.setState({
                        fieldArr: item.field,
                        assmentSheetData: res.result,
                        regValuationFormID: item.regValuationFormID,
                        // activeKey: res.result[0].id
                        activeKey: !Util.isEmpty(res.result) ? res.result[0].id : ''
                      })
                      return
                    }
                  })
                })
              }
            })
          }
        }
      })
    }

    //评估单明细 信息填写
    changeItem = (e, filedItemID) => {
      const { DetailTabs, activeKey } = this.state
      DetailTabs && DetailTabs.map((item, i) => {
        item.field && item.field.map((items, index) => {
          if (item.id == activeKey) {
            if (filedItemID == items.regValuationDetailID) {
              item.field[index].fileValue = e.target.value
            }
            this.setState({
              fieldArr: item.field,
              regValuationFormID: item.regValuationFormID
            })
            return
          }
        })
      })
    }

    //保存
    handleOk = () => {
      // const { DetailTabs, activeKey, fieldArr, regValuationFormID } = this.state
      // this.props.form.validateFields((err, values) => {
      //   if (!err) {
      //     var arr = []
      //     for (let i in values) {
      //       let o = {};
      //       o[i] = values[i];
      //       o.value = values[i];
      //       o.id = i;
      //       arr.push(o)
      //     }
      //     console.log("values", values, "arr", arr)
      //     fieldArr && fieldArr.map((item, i) => {
      //       arr && arr.map((items, index) => {
      //         if (item.fileID == items.id) {
      //           item.fileValue = items.value
      //           // item.value = items.value
      //         }
      //       })
      //     })
      //     this.setState({
      //       fieldArr,
      //     }, () => {
      //       console.log("fieldArr", fieldArr)
      //       let data = {}
      //       data = {
      //         params: [{
      //           userID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).userID : "",
      //           // admID: "27195",//患者就诊id
      //           admID: this.props.admID,
      //           id: regValuationFormID,//患者评估单id regValuationFormID
      //           regValuationID: this.state.activeKey,//评估单id
      //           files: fieldArr,
      //         }],
      //       }
      //       $http.post('urlS', this, {
      //         code: '03040030',
      //         data: data,
      //         success: function (res) {
      //           if (+res.errorCode === 0 && res.result) {
      //             if (regValuationFormID && regValuationFormID) {
      //               message.success("更新成功")
      //               this.getDetailTabs()
      //             } else {
      //               message.success("保存成功")
      //               this.getDetailTabs()
      //             }
      //           } else {
      //             // message.warning("保存失败")
      //           }
      //         }
      //       })
      //     })

      //   }
      // })
      var { assmentSheetData, medchild } = this.state;
      var sourceOption = []
      var fieldData = []
      var sources = {}
      sources.admID = this.props.admID;
      sources.userID = this.state.userData.userID
      for (var i = 0; i < assmentSheetData.length; i++) {
        if (this.state.activeKey == assmentSheetData[i].id) {
          fieldData = assmentSheetData[i].field
          sources = {
            userID: this.state.userData.userID,
            admID: this.props.admID,
            id: assmentSheetData[i].regValuationFormID,
            regValuationID: assmentSheetData[i].id,
          }
        }
      }

      for (var j = 0; j < fieldData.length; j++) {
        sourceOption.push({
          regValuationFormDetailID: fieldData[j].regValuationFormDetailID,
          fileID: fieldData[j].fileID,
          fileValue: (typeof fieldData[j].value === 'object') && fieldData[j].value.constructor == Array ? fieldData[j].value[0] : fieldData[j].value,
        })
      }

      /**
       * @ByShizi: 检查医嘱
       * Create 2021-05-07
       * */
      medchild = medchild && medchild.filter(item => item.value === 'Y');
      var data = {
        params: [{
          ...sources,
          files: sourceOption,
          medchild
        }]
      }
      $http.post('urlDeault', this, {
        code: "03040030",
        data,
        success: function (res) {
          if (res.errorCode == '0') {
            message.success('保存成功！')
            var templateresult = res.templateresult
            if ((templateresult != "") && (JSON.parse(sessionStorage.userData).hospCode === 'H10')) {
              this.print(templateresult)
            }
            this.getDetailTabs()
            var { clearModal } = this.props;
            clearModal && clearModal()
          }
        }
      });
    }

    //删除
    handleCanel = () => {
      let data = {}
      data = {
        params: [{
          userID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).userID : "",
          hospID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).hospID : "",
          groupID: sessionStorage.userData ? JSON.parse(sessionStorage.userData).groupID : "",
          // userID: "60",
          // hospID:"1",
          // groupID:"231",
          // admID: "27195",
          admID: this.props.admID,
          id: [this.state.regValuationFormID],
        }],
      }
      $http.post('urlS', this, {
        code: '03040031',
        data: data,
        success: function (res) {
          if (+res.errorCode === 0) {
            message.success("删除成功")
            this.props.form.resetFields()
            this.getDetailTabs()
          } else {
            // message.warning("删除失败,请重试")
          }
        }
      })
    }
    // 打印导诊单
    print = (templateresult) => {
      if (templateresult && templateresult.length > 0) {
        templateresult.map((item, i) => {
          $loadTemplate(item.template, item.printStr);
        })
      }
    }
    //切换标题头
    callbackKey = (key) => {
      this.setState({ activeKey: key })
      this.props.form.resetFields();
      const { DetailTabs, activeKey } = this.state
      DetailTabs && DetailTabs.map((item, i) => {
        item.field && item.field.map((items, index) => {
          if (item.id == key) {
            this.setState({
              fieldArr: item.field,
              regValuationFormID: item.regValuationFormID
            })
            return
          }
        })
      })
    }

    getFormItem = (fieldItem, key) => {
      let { languageSize } = this.state;
      const { getFieldDecorator } = this.props.form;
      let detailInfo = this.state.detailInfo ? this.state.detailInfo : {};
      let userInfo = this.state.userInfo ? this.state.userInfo : {};
      var code = detailInfo[fieldItem.cureItemDesc] ? detailInfo[fieldItem.cureItemDesc] : userInfo[fieldItem.cureItemDesc] ? userInfo[fieldItem.cureItemDesc] : '';
      var type = fieldItem.fieldTypeCode;
      var ReadOnlyFlag = fieldItem.readOnly;
      var disabled = false;
      if (ReadOnlyFlag === "Y") disabled = true;
      if (type === "Input" || type == 'InputNumber') {
        return (
          {
            ...getFieldDecorator(fieldItem.fileID, {
              initialValue: fieldItem.value ? fieldItem.value : (fieldItem.defaultID ? fieldItem.defaultID : undefined),
              rules: [{
                required: fieldItem.evaluationRequired && fieldItem.evaluationRequired == "Y" ? true : false,
                message: '请输入' + fieldItem.descripts
              }
              ],
            })(<Input
              type={type == 'InputNumber' ? "number" : false}
              allowClear={!disabled}
              disabled={disabled}
              ref={key == 0 ? (input) => this.input = input : ''}
              style={{ width: '100%' }}
            // placeholder={disabled ? '' : languageSize.EnterSequenceinputTips ? (languageSize.EnterSequenceinputTips.descripts +' ' +fieldItem.desc):('请输入'+ fieldItem.desc)}
            //     onKeyDown={(e)=>{if(!disabled){
            //     this.FieldOnKeyDown(e,fieldItem.cureItemDesc)
            // }}}
            />)
          }
        )
      } else if (type === "Radio") {
        return (
          {
            ...getFieldDecorator(fieldItem.fileID, {
              initialValue: fieldItem.value ? fieldItem.value : (fieldItem.defaultID ? fieldItem.defaultID : undefined),
              valuePropName: 'checked',
              rules: [{ required: fieldItem.evaluationRequired && fieldItem.evaluationRequired == "Y" ? true : false, }],
              normalize: (value, prevValue) => {
                return value
              }
            })(<Switch disabled={disabled} checkedChildren="是" unCheckedChildren="否" />)
          }
        )
      }
      else if (type === "CheckBox") {
        return (
          {
            ...getFieldDecorator(fieldItem.fileID, {
              initialValue: fieldItem.value == "true" ? true : (fieldItem.defaultID ? fieldItem.defaultID : false),
              valuePropName: 'checked',
              rules: [{
                required: fieldItem.evaluationRequired && fieldItem.evaluationRequired == "Y" ? true : false,
                message: '请选择' + fieldItem.descripts
              }],

              normalize: (value, prevValue) => {
                return value
              }
            })(
              <Checkbox ></Checkbox>
            )
          }
        )
      }
      // else if(type==="DatePicker"){
      //     var date=""
      //     if(fieldItem.cureItemDesc==="StartDate"){
      //         date=code ? moment(code, 'YYYY-MM-DD') : moment(new Date(), 'YYYY-MM-DD')
      //     }else{
      //         date=code ? moment(code, 'YYYY-MM-DD') : null
      //     }
      //     return (
      //         {...getFieldDecorator(fieldItem.cureItemDesc, {
      //                 initialValue:date,
      //                 rules:  [{ required: fieldItem.evaluationRequired == "Y" ? true : false,message: languageSize.EnterSequencepleaseChoose ? (languageSize.EnterSequencepleaseChoose.descripts+' '+fieldItem.desc):('请选择'+fieldItem.desc)}],
      //             })(<DatePicker
      //                 style={{width: '100%'}}
      //                 disabled={disabled}
      //                 format="YYYY-MM-DD"
      //                 placeholder={disabled ? "" : languageSize.EnterSequencepleaseChoose ? (languageSize.EnterSequencepleaseChoose.descripts+' '+fieldItem.desc):('请选择'+fieldItem.desc)}
      //                 onChange={(e, dateString)=>{
      //                     if(dateString  && this.props.form.getFieldValue('stockDesc')){
      //                         this.TimeOnKeyDown(e,fieldItem.cureItemDesc,type ,dateString)
      //                     }
      //                 } }
      //             />)
      //         }
      //     )
      // }
      else if (type === "Select" || type === "SelectBox") {
        return this.GetSelectOther(fieldItem, detailInfo, type);
      } else if (type === "Text" || type === "text") {
        return (
          {
            ...getFieldDecorator(fieldItem.fileID, {
              initialValue: fieldItem.value ? fieldItem.value : (fieldItem.defaultID ? fieldItem.defaultID : undefined),
              rules: [{
                required: fieldItem.evaluationRequired && fieldItem.evaluationRequired == "Y" ? true : false,
                message: '请输入' + fieldItem.descripts
              }
              ],
              // anguageSize.EnterSequenceinputTips ? (languageSize.EnterSequenceinputTips.descripts+' '+fieldItem.desc):('请输入'+fieldItem.desc)
            })(<TextArea rows={1} style={{ width: '100%' }}
            // placeholder={} 
            />
            )
          }
        )
      } else {
        return (
          {
            ...getFieldDecorator(fieldItem.fileID, {
              initialValue: fieldItem.value ? fieldItem.value : '',
              rules: [{
                required: fieldItem.evaluationRequired && fieldItem.evaluationRequired == "Y" ? true : false,
                message: '请输入' + fieldItem.descripts
              }
              ]
              ,
            })(<Input type={type == 'InputNumber' ? "number" : false}
              disabled={disabled}
            //  placeholder={languageSize.EnterSequenceinputTips ? (languageSize.EnterSequenceinputTips.descripts+' '+fieldItem.desc):('请输入'+fieldItem.desc)}
            />)
          }
        )
      }
    }

    GetSelectOther = (fieldItem, detailInfo, type) => {
      let { languageSize } = this.state;
      const selectData = this.props.SelectData;
      const { getFieldDecorator } = this.props.form;
      let userInfo = this.state.userInfo ? this.state.userInfo : {};
      var code = "";
      var ReadOnlyFlag = fieldItem.readOnly;
      var disabled = false;
      if (ReadOnlyFlag === "Y") disabled = true;
      return (
        {
          ...getFieldDecorator(fieldItem.fileID, {
            initialValue: fieldItem.value ? fieldItem.value : (fieldItem.defaultID ? fieldItem.defaultID : undefined),
            rules: [{
              required: fieldItem.evaluationRequired && fieldItem.evaluationRequired == "Y" ? true : false,
              message: '请选择' + fieldItem.descripts
              //  message: languageSize.EnterSequencepleaseChoose ? (languageSize.EnterSequencepleaseChoose.descripts+' '+fieldItem.desc):('请选择'+fieldItem.desc)
            }
            ],
            normalize: (value, prevValue) => {
              if (+value === 0) {
                value = ""
              }
              return value
            }
          })(

            <Select
              allowClear
              showSearch
              optionFilterProp="seatchprop"
              disabled={disabled}
              filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
              style={{ width: '100%' }}
              // placeholder={disabled ? '' :languageSize.EnterSequencepleaseChoose ? (languageSize.EnterSequencepleaseChoose.descripts+' '+fieldItem.desc):('请选择'+fieldItem.desc)}
              onChange={this.changeUnit}
            >
              {fieldItem.cureItemDesc == 'unit' ? detailInfo.unit ?
                detailInfo.unit && detailInfo.unit.length > 0 && detailInfo.unit.map((g) => {
                  return <Option key={g.id} value={g.id}>{g.descripts}</Option>
                })
                :
                userInfo.unit ? userInfo.unit.length > 0 && userInfo.unit.map((v) => {
                  return <Option key={v.id} value={v.id}>{v.descripts}</Option>
                }) :
                  this.state.unitData.length > 0 && this.state.unitData.map((g) => {
                    return <Option key={g.id} value={g.id}>{g.descripts}</Option>
                  })
                :
                fieldItem.fieldDataList && fieldItem.fieldDataList.length && fieldItem.fieldDataList.map(d => { return <Option key={d.id} value={d.id} seatchprop={d.Desc}>{d.descripts}</Option> })
              }
            </Select>
          )
        }
      );
    };

    /**新评估单渲染 */
    //渲染门诊挂号评估单数据
    loadSheetData() {
      var { assmentSheetData } = this.state;
      var assmentSheetOption = [];
      var listData = [];
      assmentSheetData && assmentSheetData.map((item, index) => {
        listData = item.field
        assmentSheetOption.push(<TabPane key={item.id} value={item.id} tab={item.title}>
          <div style={{ maxHeight: '450px', overflow: 'auto' }}>
            {listData && listData.map((data, code) => {
              return <Col key={code} span={10} style={{ marginLeft: 10, display: 'flex', marginTop: 10 }}>
                <div style={{ width: '40%', textAlign: 'right', marginTop: 5 }}>{data.descripts}：</div>
                {data.fieldTypeCode == 'Select' ? (
                  data.code === "OD" || data.code === "OS" || data.code === "ODIOP" || data.code === "OSIOP" || data.code === "ODOstiole" || data.code === "OSOstiole" ? ( // 默认为下拉标签
                    // <Select style={{ width: '58%' }} mode="tags" placeholder='请选择'
                    //   filterOption={(input, option) =>
                    //     option.props.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
                    //   }
                    //   value={data.value || undefined} onChange={(e) => this.handleChangeCommonSelect(data, e, "tags")}>
                    //   {
                    //     data && 'fieldDataList' in data && Array.isArray(data.fieldDataList) && data.fieldDataList.map((source, ids) => {
                    //       return <Option key={ids} value={source.descripts}>{source.descripts}</Option>
                    //     })
                    //   }
                    // </Select>
                    <AutoComplete
                      allowClear
                      placeholder="请选择"
                      style={{ width: '58%' }}
                      defaultActiveFirstOption={false}
                      dataSource={React.$SelectOptions(data?.fieldDataList || [], 'descripts')}
                      value={Array.isArray(data.value) && data.value.length > 0 ? data.value[0] : [data.value || undefined]}
                      onChange={(e) => this.handleChangeCommonSelect(data, e)}
                    >
                    </AutoComplete>
                  ) : ( // 正常下拉框
                    < Select style={{ width: '58%' }} allowClear showSearch placeholder='请选择'
                      filterOption={(input, option) =>
                        option.props.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
                      }
                      value={data.value || undefined} onChange={(e) => this.handleChangeCommonSelect(data, e)}>
                      {
                        data && 'fieldDataList' in data && Array.isArray(data.fieldDataList) && data.fieldDataList.map((source, ids) => {
                          return <Option key={ids} value={source.descripts}>{source.descripts}</Option>
                        })
                      }
                    </Select>
                  )
                ) : (data.fieldTypeCode == 'SelectTags' ? (
                  <AutoComplete
                    allowClear
                    placeholder="请选择"
                    style={{ width: '58%' }}
                    defaultActiveFirstOption={false}
                    dataSource={React.$SelectOptions(data?.fieldDataList || [], 'descripts')}
                    value={Array.isArray(data.value) && data.value.length > 0 ? data.value[0] : [data.value || undefined]}
                    onChange={(e) => this.handleChangeCommonSelect(data, e)}
                  >
                  </AutoComplete>
                  // <Select style={{ width: '58%' }} mode="tags" placeholder='请选择'
                  //   filterOption={(input, option) =>
                  //     option.props.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
                  //   }
                  //   value={data.value || undefined} onChange={(e) => this.handleChangeCommonSelect(data, e, "tags")}>
                  //   {
                  //     data && 'fieldDataList' in data && Array.isArray(data.fieldDataList) && data.fieldDataList.map((source, ids) => {
                  //       return <Option key={ids} value={source.descripts}>{source.descripts}</Option>
                  //     })
                  //   }
                  // </Select>
                ) : (
                  <Input style={{ width: '58%' }} value={data.value || undefined} placeholder='请输入' onChange={this.changeCommonInput.bind(this, data)} />
                ))}
              </Col>
            })}
          </div>
        </TabPane >)
      })
      return assmentSheetOption
    }

    handleCheckoutChange = (data, e) => {
      data['value'] = e.target.checked ? 'Y' : 'N'
      this.setState({})
    }

    handleChangeCommonSelect = (data, e, type) => {
      if (type === "tags") {
        let newValue = [];
        if (e && e.length > 0) {
          newValue.push(e[e.length - 1]);
        }
        data['value'] = newValue;
      } else {
        data['value'] = e;
      }
      this.setState({})
    }

    changeCommonInput(data, e) {
      data['value'] = e.target.value
      this.setState({})
    }

    render() {
      let { medchild } = this.state;
      let windowHost = window.location && window.location.origin ? window.location.origin : (window.location && window.location.protocol ? (window.location.protocol + '//' + window.location.hostname) : "");
      let patientUrl = !Util.isEmpty(this.state.titleData) ? this.state.titleData.patImage : ''
      var patientImg = patientUrl ? (patientUrl.indexOf("http") !== -1 ? patientUrl : windowHost + patientUrl) : '';
      return (
        <div className="configOutRegDom">
          <div>
            <div>
              <div style={{ borderRight: '1px solid #EEEEEE', height: '96px', display: 'flex', }}>
                {!Util.isEmpty(patientUrl) ? <img className='splice-patient-img' src={patientImg} style={{ width: '90px', height: 110 }} /> : <div className={this.state.titleData && this.state.titleData.patSexCode == '1' ?
                  'splice-boy' : (this.state.titleData && this.state.titleData.patSexCode == '2' ? 'splice-girl' : 'splice-other')}></div>}
                <div style={{ height: '96px', borderRight: '1px solid #EEEEEE' }}></div>
                {!Util.isEmpty(this.state.titleData) ? <div style={{ fontSize: '16px' }}>
                  {/* <div style={{ padding: '10px 0 0 20px' }}></div> */}
                  <div style={{ padding: '14px 0 0 20px' }}>
                    <span style={{ cursor: 'pointer' }}>
                      <span>姓名：</span> {this.state.titleData ? <span style={{ color: '#333333', fontWeight: 'bold', }}>{this.state.titleData.patName}</span> || '--' : '--'}</span>
                  </div>
                  <div style={{ padding: '10px 0 0 20px', marginTop: "10px" }}>
                    <span><span>科室名称：</span>{this.state.titleData ? <span style={{ color: '#333333', fontWeight: 'bold', }}>{this.state.titleData.locDesc}</span> || '--' : '--'}</span><Divider type="vertical" />
                    <span><span>医生姓名：</span>{this.state.titleData ? <span style={{ color: '#333333', fontWeight: 'bold', }}>{this.state.titleData.doctorName}</span> || '--' : '--'}</span><Divider type="vertical" />
                    <span><span >就诊号：</span>{this.state.titleData ? <span style={{ color: '#333333', fontWeight: 'bold', }}>{this.state.titleData.admNo}</span> || '--' : '--'}</span><Divider type="vertical" />
                    <span><span>分诊状态：</span>{this.state.titleData ? <span style={{ color: '#333333', fontWeight: 'bold', }}>{this.state.titleData.curStatus}</span> || '--' : '--'}</span>
                  </div>
                </div> : <span style={{ color: '#999999', lineHeight: '96px', marginLeft: '20%' }}>暂无相关数据～</span>}
              </div>
              {
                !Util.isEmpty(this.state.titleData) ? (
                  <div>
                    <Tabs className="cor-tabs" activeKey={this.state.activeKey} size='small' forceRender={true} tabPosition={top} onChange={this.callbackKey}>
                      {this.loadSheetData()}
                    </Tabs>
                    {/* 检查医嘱 */}
                    <div style={{ display: medchild && Array.isArray(medchild) && medchild.length > 0 ? 'block' : 'none' }}>
                      <Col span={24} style={{ marginTop: '20px' }}>
                        <div style={{ width: '100%', borderBottom: '1px solid #e8e8e8', padding: '8px 16px', color: '#40a9ff', fontWeight: 'normal' }}>
                          检查医嘱
                        </div>
                      </Col>
                      {medchild && medchild.map((medItem, medIndex) => {
                        return (
                          <Col key={medIndex} span={9} style={{ marginLeft: 46, display: 'flex', marginTop: 10 }}>
                            <Checkbox disabled={medItem.disabled === 'Y' ? true : false} checked={medItem.value === 'Y' ? true : false} onChange={(e) => this.handleCheckoutChange(medItem, e)}>{medItem.medItemDesc}</Checkbox>
                          </Col>
                        )
                      })}
                    </div>
                    <Col span={24} style={{ textAlign: "center", padding: '12px 0' }}>
                      <Button type="danger" style={{ marginRight: "18px" }} onClick={this.handleCanel}>删除</Button>
                      <Button type="primary" onClick={this.handleOk}>保存</Button>
                    </Col>
                  </div>
                ) : (
                  <Row style={{ textAlign: 'left', color: '#bfbfbf', padding: '20px' }}>
                    请选择门诊病人,再进行操作
                  </Row>
                )
              }
            </div>
          </div>
        </div>
      )
    }
  }
)

export default ConfigOutReg;