Luolei 6 years ago
parent
commit
1ed52ce1a6

+ 6 - 6
src/common/components/ComplexModal/index.jsx

@@ -2,7 +2,7 @@ import React, { Component } from "react";
 import ReactDom from "react-dom";
 import style from "./index.less";
 import close from '@common/images/icon_close.png';
-import { dragBox } from '@utils/tools';
+import { dragBox } from '@utils/drag';
 /**
  * title:标题
  * children:弹窗内容
@@ -20,7 +20,7 @@ class ComplexModal extends Component {
     super(props);
   }
   componentDidMount(){
-    // dragBox('complexModalWrap','complexModalTitle','complexModalWrapMove')
+    dragBox('add')
   }
 
   render() {
@@ -28,13 +28,13 @@ class ComplexModal extends Component {
     const marginLeft = width? -parseInt(width)/2 : '';
     //const marginTop = height? -parseInt(height)/2: '';
     const domNode = document.getElementById('root');
-    return ReactDom.createPortal(<div className={style['container']} id="complexModalWrapMove">
+    return ReactDom.createPortal(<div className={style['container']}>
       <div className={style['shade']} onClick={shadeClose===false?'':onclose}></div>
-      <div id="complexModalWrap" className={style['modal']} style={{width: width?width:'auto', marginLeft:marginLeft, top:top?top+'px':'',bottom:bottom?bottom+'px':''}}>
-        <div className={`${style['close']} drag-title`} id="complexModalTitle">
+      <div id="dragModalWrap" className={style['modal']} style={{width: width?width:'auto', marginLeft:marginLeft, top:top?top+'px':'',bottom:bottom?bottom+'px':''}}>
+        <div className={`${style['close']} drag-title`} id="dragModalTitle">
           {icon?<img src={icon} />:''}
           {title}
-          <img src={close} onClick={onclose} className={style['closeIcon']} />
+          <img src={close} onClick={onclose} className={style['closeIcon']} id="closeclose"/>
         </div>
         <div className={style["content"]} style = {{width: width?width:'auto'}}>{children}</div>
         <div className={style['footer']} style = {{width: width?width:'auto'}}>{footer}</div>

+ 283 - 283
src/components/DiagnosticList/index.jsx

@@ -5,12 +5,12 @@ import del_on from './img/delete-on.png'
 import diagUp from './img/diagUp.png'
 import diagDown from './img/diagDown.png'
 import manageIcon from '@common/images/manage.png';
-import {ConfirmModal, Message,ComplexModal,Footer} from '@commonComp';
+import { ConfirmModal, Message, ComplexModal, Footer } from '@commonComp';
 import Notify from '@commonComp/Notify';
 import Treat from '@containers/Treat'
 import store from '@store';
-import { initItemList ,setInitHistory} from '@store/async-actions/historyTemplates';
-import { pushAllDataList,inspectAndAssist ,deepClone} from '@utils/tools';
+import { initItemList, setInitHistory } from '@store/async-actions/historyTemplates';
+import { pushAllDataList, inspectAndAssist, deepClone } from '@utils/tools';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
 import AssessResult from '@containers/AssessResult';
@@ -19,301 +19,301 @@ import { CONFIRM_TYPE } from "@store/types/typeConfig";
 import $ from "jquery";
 
 class DiagnosticList extends Component {
-    constructor(props) {
-        super(props);
-        this.state = {
-            visible: false,
-            delItem: {},
-            treatTitle: '',
-            activeHistory: -1,
-            sign:-1,
-            showAssess:false,
-            assessId:'',
-            disName:'',
-            isAssessConfirm:false,
-            radioVal:{},  //可能结果选择内容
-            possible:{},  //可能结果
-            hasOndel: false
-        }
-        this.deleteItem = this.deleteItem.bind(this);
-        this.cancel = this.cancel.bind(this);
-        this.close = this.close.bind(this);
-        this.showTreat = this.showTreat.bind(this);
-        this.handleClickDiag = this.handleClickDiag.bind(this);
-        this.referRecord = this.referRecord.bind(this);
-        this.noReferRecord = this.noReferRecord.bind(this);
-        this.getHistoryCase = this.getHistoryCase.bind(this);
-        this.closeHistoryCaseModal = this.closeHistoryCaseModal.bind(this);
-        this.referCase = this.referCase.bind(this);
-        this.handleSaveAssess = this.handleSaveAssess.bind(this);       //评估弹窗确定
-        this.handleSavePossible = this.handleSavePossible.bind(this);
-        this.onPrint = this.onPrint.bind(this);
-    }
-    onPrint() {
-      let dom = $("#AssistResult");
-      dom.jqprint({
-        debug: false,
-        importCSS: true,
-        printContainer: true,
-        operaSupport: false,
-      });
-    }
-    upDiagnostic(index) {
-        const { upDiagnostic } = this.props;
-        upDiagnostic && upDiagnostic(index)
-    }
-    downDiagnostic(index) {
-        const { downDiagnostic } = this.props;
-        downDiagnostic && downDiagnostic(index)
-    }
-    deleteItem() {
-        const { delItem } = this.state;
-        const { delDiagnostic, delReact,delFollowUp } = this.props;
-        delDiagnostic && delDiagnostic(delItem);
-        delReact && delReact(delItem);
-        delFollowUp && delFollowUp(delItem);
-        this.setState({
-            visible: false,
-        })
-        Notify.success('删除成功')
-    }
-    cancel() {
-        this.setState({
-            visible: false
-        })
-    }
-    close() {
-        this.setState({
-            visible: false
-        })
-    }
-    handleDeleteItem(item) {
-        this.setState({
-            visible: true,
-            delItem: item,
-        })
-    }
-    showTreat(item, index) {
-        // item.treatIndex = index
-        const  { showTreat, getTreatResult } = this.props;
-        getTreatResult && getTreatResult(item);
-        // showTreat && showTreat();//添加loading,移到async-actions中
-        this.setState({
-            treatTitle: item.name
-        })
-    } 
-    handleClickDiag(item) {
-        const { getTips } = this.props;
-        // getTips && getTips(item);
-        getTips && getTips({id:item.id,type:7});
-    }
-    referRecord() {
-        const { hideReferRecord, showHistoryCaseModal ,chronicMagItem,hisTemplates,autoFillModules,typeConfig} = this.props
-        hideReferRecord && hideReferRecord()
-        // showHistoryCaseModal && showHistoryCaseModal()
-        // store.dispatch(initItemList(chronicMagItem))
-        initItemList(chronicMagItem).then((res)=>{
-            const result = res.data;
-            if(result.code==0 && result.data){
-              store.dispatch(setInitHistory(result.data));
-              showHistoryCaseModal && showHistoryCaseModal();
-            }else{
-              if(typeConfig==0){
-                Notify.info("暂无历史病历,已默认展示慢病相关内容");
-                const timer = setTimeout(function(){
-                  autoFillModules && autoFillModules();
-                  clearTimeout(timer);
-                },1000) //需求要求延时
-              }
-            }
-        })
-    }
-    noReferRecord() {
-        const { hideReferRecord ,autoFillModules,typeConfig} = this.props
-        hideReferRecord && hideReferRecord();
-        if(typeConfig==0){//智能推送模式才自动填充
-            autoFillModules&&autoFillModules();
-        }
-        
-    }
-    referCase() {
-        const { hideHistoryCaseModal, items ,autoFillModules,typeConfig} = this.props
-        const {sign} = this.state;
-        hideHistoryCaseModal && hideHistoryCaseModal()
-        if (this.state.activeHistory === -1 && typeConfig==0) {//没有选择历史病例直接点确定
-            Notify.info("未选择历史病历,已默认展示慢病相关内容");
-              const timer = setTimeout(function(){
-                autoFillModules && autoFillModules();
-                clearTimeout(timer);
-              },1000)
-            return
-        }
-        let baseList = store.getState();
-        
-        let baseObj = items[this.state.activeHistory];
-        // 切换模式
-        if(sign != typeConfig){
-          store.dispatch({type: CONFIRM_TYPE, confirmType: baseObj.sign});
-        }
-        pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
-        this.props.getBilling();
-        this.setState({
-            activeHistory: -1,
-            sign:-1
-        })
+  constructor(props) {
+    super(props);
+    this.state = {
+      visible: false,
+      delItem: {},
+      treatTitle: '',
+      activeHistory: -1,
+      sign: -1,
+      showAssess: false,
+      assessId: '',
+      disName: '',
+      isAssessConfirm: false,
+      radioVal: {},  //可能结果选择内容
+      possible: {},  //可能结果
+      hasOndel: false
     }
-    closeHistoryCaseModal() {
-        const { hideHistoryCaseModal ,autoFillModules,typeConfig} = this.props
-        this.setState({
-            activeHistory: -1,
-            sign:-1
-        })
-        hideHistoryCaseModal && hideHistoryCaseModal()
-        if(typeConfig==0){//智能推送模式才自动填充
-            autoFillModules&&autoFillModules();
+    this.deleteItem = this.deleteItem.bind(this);
+    this.cancel = this.cancel.bind(this);
+    this.close = this.close.bind(this);
+    this.showTreat = this.showTreat.bind(this);
+    this.handleClickDiag = this.handleClickDiag.bind(this);
+    this.referRecord = this.referRecord.bind(this);
+    this.noReferRecord = this.noReferRecord.bind(this);
+    this.getHistoryCase = this.getHistoryCase.bind(this);
+    this.closeHistoryCaseModal = this.closeHistoryCaseModal.bind(this);
+    this.referCase = this.referCase.bind(this);
+    this.handleSaveAssess = this.handleSaveAssess.bind(this);       //评估弹窗确定
+    this.handleSavePossible = this.handleSavePossible.bind(this);
+    this.onPrint = this.onPrint.bind(this);
+  }
+  onPrint() {
+    let dom = $("#AssistResult");
+    dom.jqprint({
+      debug: false,
+      importCSS: true,
+      printContainer: true,
+      operaSupport: false,
+    });
+  }
+  upDiagnostic(index) {
+    const { upDiagnostic } = this.props;
+    upDiagnostic && upDiagnostic(index)
+  }
+  downDiagnostic(index) {
+    const { downDiagnostic } = this.props;
+    downDiagnostic && downDiagnostic(index)
+  }
+  deleteItem() {
+    const { delItem } = this.state;
+    const { delDiagnostic, delReact, delFollowUp } = this.props;
+    delDiagnostic && delDiagnostic(delItem);
+    delReact && delReact(delItem);
+    delFollowUp && delFollowUp(delItem);
+    this.setState({
+      visible: false,
+    })
+    Notify.success('删除成功')
+  }
+  cancel() {
+    this.setState({
+      visible: false
+    })
+  }
+  close() {
+    this.setState({
+      visible: false
+    })
+  }
+  handleDeleteItem(item) {
+    this.setState({
+      visible: true,
+      delItem: item,
+    })
+  }
+  showTreat(item, index) {
+    // item.treatIndex = index
+    const { showTreat, getTreatResult } = this.props;
+    getTreatResult && getTreatResult(item);
+    // showTreat && showTreat();//添加loading,移到async-actions中
+    this.setState({
+      treatTitle: item.name
+    })
+  }
+  handleClickDiag(item) {
+    const { getTips } = this.props;
+    // getTips && getTips(item);
+    getTips && getTips({ id: item.id, type: 7 });
+  }
+  referRecord() {
+    const { hideReferRecord, showHistoryCaseModal, chronicMagItem, hisTemplates, autoFillModules, typeConfig } = this.props
+    hideReferRecord && hideReferRecord()
+    // showHistoryCaseModal && showHistoryCaseModal()
+    // store.dispatch(initItemList(chronicMagItem))
+    initItemList(chronicMagItem).then((res) => {
+      const result = res.data;
+      if (result.code == 0 && result.data) {
+        store.dispatch(setInitHistory(result.data));
+        showHistoryCaseModal && showHistoryCaseModal();
+      } else {
+        if (typeConfig == 0) {
+          Notify.info("暂无历史病历,已默认展示慢病相关内容");
+          const timer = setTimeout(function () {
+            autoFillModules && autoFillModules();
+            clearTimeout(timer);
+          }, 1000) //需求要求延时
         }
+      }
+    })
+  }
+  noReferRecord() {
+    const { hideReferRecord, autoFillModules, typeConfig } = this.props
+    hideReferRecord && hideReferRecord();
+    if (typeConfig == 0) {//智能推送模式才自动填充
+      autoFillModules && autoFillModules();
     }
-    handleQuoteClick(item, index) {
-        const { handleQuoteClick } = this.props
-        // handleQuoteClick && handleQuoteClick(item)
-        this.setState({
-            activeHistory: index,
-            sign:item.sign
-        })
-    }
-    getHistoryCase() {
-        const { items } = this.props
-        return (<div className={style['history-info']}>
-            {items.map((item, index) => {
-                return<div onClick={this.handleQuoteClick.bind(this, item, index)} style={this.state.activeHistory === index ? {color: '#3B9ED0'} : ''}>
-                    <img src={this.state.activeHistory === index ? iconRadioActive : iconRadioDefault}/>{item.diagnose + '(' + item.inquiryDate + ')'}
-                </div>
-            })}
-        </div>)
+
+  }
+  referCase() {
+    const { hideHistoryCaseModal, items, autoFillModules, typeConfig } = this.props
+    const { sign } = this.state;
+    hideHistoryCaseModal && hideHistoryCaseModal()
+    if (this.state.activeHistory === -1 && typeConfig == 0) {//没有选择历史病例直接点确定
+      Notify.info("未选择历史病历,已默认展示慢病相关内容");
+      const timer = setTimeout(function () {
+        autoFillModules && autoFillModules();
+        clearTimeout(timer);
+      }, 1000)
+      return
     }
-    showAssessFn(item){
-        if(item&&item.id){         //显示评估弹窗
-          this.setState({
-            showAssess:true,
-            isAssessConfirm:false,
-            assessId:item.id,
-            disName:item.name
-          });
-        }else{          //关闭评估弹窗
-            this.setState({
-              showAssess:false,
-              isAssessConfirm:false,
-            });
-        }
+    let baseList = store.getState();
+
+    let baseObj = items[this.state.activeHistory];
+    // 切换模式
+    if (sign != typeConfig) {
+      store.dispatch({ type: CONFIRM_TYPE, confirmType: baseObj.sign });
     }
-    handleSavePossible(obj){
-      this.setState({
-        possible:Object.assign({},obj.possible),
-        radioVal:Object.assign({},obj.radioVal),//不设置radioVal只有最近一次选中的值
-      })
+    pushAllDataList(baseObj.sign, 'push', baseObj, 'history')       //引用
+    this.props.getBilling();
+    this.setState({
+      activeHistory: -1,
+      sign: -1
+    })
+  }
+  closeHistoryCaseModal() {
+    const { hideHistoryCaseModal, autoFillModules, typeConfig } = this.props
+    this.setState({
+      activeHistory: -1,
+      sign: -1
+    })
+    hideHistoryCaseModal && hideHistoryCaseModal()
+    if (typeConfig == 0) {//智能推送模式才自动填充
+      autoFillModules && autoFillModules();
     }
-    handleSaveAssess(){
+  }
+  handleQuoteClick(item, index) {
+    const { handleQuoteClick } = this.props
+    // handleQuoteClick && handleQuoteClick(item)
+    this.setState({
+      activeHistory: index,
+      sign: item.sign
+    })
+  }
+  getHistoryCase() {
+    const { items } = this.props
+    return (<div className={style['history-info']}>
+      {items.map((item, index) => {
+        return <div onClick={this.handleQuoteClick.bind(this, item, index)} style={this.state.activeHistory === index ? { color: '#3B9ED0' } : ''}>
+          <img src={this.state.activeHistory === index ? iconRadioActive : iconRadioDefault} />{item.diagnose + '(' + item.inquiryDate + ')'}
+        </div>
+      })}
+    </div>)
+  }
+  showAssessFn(item) {
+    if (item && item.id) {         //显示评估弹窗
       this.setState({
-        isAssessConfirm:true
+        showAssess: true,
+        isAssessConfirm: false,
+        assessId: item.id,
+        disName: item.name
       });
-      const that=this;
-      setTimeout(()=>{
-        that.setState({
-          showAssess:false
-        });
+    } else {          //关闭评估弹窗
+      this.setState({
+        showAssess: false,
+        isAssessConfirm: false,
       });
     }
-    componentWillReceiveProps(nextprops) {
-      if (this.props.diagnosticStr != nextprops.diagnosticStr) {
-        this.props.getBilling();
-      }
-      if(deepClone(nextprops.wholeResults)!=deepClone(this.props.wholeResults)){
-          this.setState({
-            radioVal:Object.assign({},nextprops.wholeResults.radioVal),
-            possible:Object.assign({},nextprops.wholeResults.possible),
-          })
-      }
-    }
-    handleEnterDel() {
-      this.setState({
-        hasOndel: true
-      })
+  }
+  handleSavePossible(obj) {
+    this.setState({
+      possible: Object.assign({}, obj.possible),
+      radioVal: Object.assign({}, obj.radioVal),//不设置radioVal只有最近一次选中的值
+    })
+  }
+  handleSaveAssess() {
+    this.setState({
+      isAssessConfirm: true
+    });
+    const that = this;
+    setTimeout(() => {
+      that.setState({
+        showAssess: false
+      });
+    });
+  }
+  componentWillReceiveProps(nextprops) {
+    if (this.props.diagnosticStr != nextprops.diagnosticStr) {
+      this.props.getBilling();
     }
-    handleLeaveDel() {
+    if (deepClone(nextprops.wholeResults) != deepClone(this.props.wholeResults)) {
       this.setState({
-        hasOndel: false
+        radioVal: Object.assign({}, nextprops.wholeResults.radioVal),
+        possible: Object.assign({}, nextprops.wholeResults.possible),
       })
     }
-    render(){
-        const { list, treatment, showReferRecord, showHistoryCase ,chronicMagItem} = this.props;
-        const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible,assessId,disName, hasOndel} = this.state;
-        const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
-        const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
-        let isChronic = false;      //是否要显示管理评估
-        const footer = <Footer print={true}
-                               footText="确定"
-                               handlePrint={this.onPrint}
-                               handleConfirm={this.handleSaveAssess}/>;
-        return(
-                <div className={style['diaglist-wrap']}>
-                    {list && (list.length > 0) && list.map((item, index) => {
-                        const hasTreat = item.treat && (item.treat.commonTreatment.content || item.treat.surgeryTreatment.content || item.treat.treatment.length>0 ||(item.adverseReactions&&item.adverseReactions.length > 0)
-                           || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow)
-                        isChronic = chronicLine&&item.type==2&&chronicList.findIndex((it)=>it.id==item.id)!=-1;
-                        return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.id} >
-                                    {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
-                                    {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}
-                                    <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '1' : index+1}</span>
-                                    <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
-                                    {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
-                                    <span className={style['treat']}
-                                          style ={hasTreat ? '' : { color: 'gray', cursor: 'text'}}
-                                          onClick={() =>{hasTreat && this.showTreat(item, index)}}>
-                                          治疗方案
+  }
+  handleEnterDel() {
+    this.setState({
+      hasOndel: true
+    })
+  }
+  handleLeaveDel() {
+    this.setState({
+      hasOndel: false
+    })
+  }
+  render() {
+    const { list, treatment, showReferRecord, showHistoryCase, chronicMagItem } = this.props;
+    const { visible, treatTitle, showAssess, isAssessConfirm, radioVal, possible, assessId, disName, hasOndel } = this.state;
+    const chronicList = JSON.parse(localStorage.getItem('chronic') || null);
+    const chronicLine = chronicMagItem && chronicMagItem.name;     //当前是否走的慢病流程
+    let isChronic = false;      //是否要显示管理评估
+    const footer = <Footer print={true}
+      footText="确定"
+      handlePrint={this.onPrint}
+      handleConfirm={this.handleSaveAssess} />;
+    return (
+      <div className={style['diaglist-wrap']}>
+        {list && (list.length > 0) && list.map((item, index) => {
+          const hasTreat = item.treat && (item.treat.commonTreatment.content || item.treat.surgeryTreatment.content || item.treat.treatment.length > 0 || (item.adverseReactions && item.adverseReactions.length > 0)
+            || (item.drugHistory && item.drugHistory['慢病用药内容'] && item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory && item.drugHistory['普通病用药内容'] && item.drugHistory['普通病用药内容'].length > 0) || item.follow)
+          isChronic = chronicLine && item.type == 2 && chronicList.findIndex((it) => it.id == item.id) != -1;
+          return (<div draggable={true} className={style['diag-box'] + ' clearfix'} key={item.id} >
+            {index === 0 ? '' : <span className={style['diag-up']} onClick={() => { this.upDiagnostic(index) }}><img className={style["diag-up"]} src={diagUp} /></span>}
+            {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => { this.downDiagnostic(index) }} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown} /></span>}
+            <span className={style['diag-number']} style={{ fontWeight: index === 0 ? 'bold' : 'normal' }}>{index === 0 ? '1' : index + 1}</span>
+            <span className={style['diag-name']} onClick={() => { this.handleClickDiag(item) }}>{item.name}<span></span></span>
+            {item.type === 1 ? <span className={style['diag-first']}>初诊</span> : <span className={style['diag-second']}> 复诊</span>}
+            <span className={style['treat']}
+              style={hasTreat ? '' : { color: 'gray', cursor: 'text' }}
+              onClick={() => { hasTreat && this.showTreat(item, index) }}>
+              治疗方案
                                     </span>
-                                    {isChronic?<span className={style['assess']}
-                                          onClick={this.showAssessFn.bind(this,item)}>
-                                        管理评估
-                                    </span>:''}
-                                    <img className={style['diag-del']} src={hasOndel ? del_on : del_icon} onMouseEnter={this.handleEnterDel.bind(this)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={()=>{this.handleDeleteItem(item)}}/>
-                        </div>)
-                    })}
-                     {treatment&&<Treat title={treatTitle}></Treat>}
-                     {showAssess?<ComplexModal onclose={this.showAssessFn.bind(this)} footer={footer}
-                                               title='管理和评估'
-                                               icon={manageIcon}
-                                               top={'3%'}
-                                               bottom={'3%'}
-                                               width={820}>
-                       <AssessResult handleSavePossible={this.handleSavePossible}
-                                     closeAssess={this.showAssessFn.bind(this)}
-                                     disId={assessId}
-                                     disName={disName}
-                                     radioVal={radioVal}
-                                     possible={possible}
-                                     isAssessConfirm={isAssessConfirm}
-                                     ></AssessResult>
-                      </ComplexModal>:''}
-                    <ConfirmModal visible={visible}
-                                  okText='删除' 
-                                  cancelText='取消' 
-                                  confirm={this.deleteItem}  
-                                  cancel={this.cancel}
-                                  close={this.close}
-                                  >
-                                  <div className={style['del-msg']}>是否删除该诊断?</div> 
-                    </ConfirmModal>
-                    <ConfirmModal visible={showReferRecord} okText='是' cancelText='否' confirm={this.referRecord}  cancel={this.noReferRecord} close={this.noReferRecord}>
-                        <div className={style['confirm-info']}>是否引用往期病历</div> 
-                    </ConfirmModal>
-                    <ConfirmModal visible={showHistoryCase} noFooter='true' title='请选择历史病历' close={this.closeHistoryCaseModal} titleBg="#DFEAFE" icon={tableIcon} height={300}>
-                        {this.getHistoryCase()}
-                        <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
-                    </ConfirmModal>
-                </div>
-               
-        )
-    }
+            {isChronic ? <span className={style['assess']}
+              onClick={this.showAssessFn.bind(this, item)}>
+              管理评估
+                                    </span> : ''}
+            <img className={style['diag-del']} src={hasOndel ? del_on : del_icon} onMouseEnter={this.handleEnterDel.bind(this)} onMouseLeave={this.handleLeaveDel.bind(this)} onClick={() => { this.handleDeleteItem(item) }} />
+          </div>)
+        })}
+        {treatment && <Treat title={treatTitle}></Treat>}
+        {showAssess ? <ComplexModal onclose={this.showAssessFn.bind(this)} footer={footer}
+          title='管理和评估'
+          icon={manageIcon}
+          top={'3%'}
+          bottom={'3%'}
+          width={820}>
+          <AssessResult handleSavePossible={this.handleSavePossible}
+            closeAssess={this.showAssessFn.bind(this)}
+            disId={assessId}
+            disName={disName}
+            radioVal={radioVal}
+            possible={possible}
+            isAssessConfirm={isAssessConfirm}
+          ></AssessResult>
+        </ComplexModal> : ''}
+        <ConfirmModal visible={visible}
+          okText='删除'
+          cancelText='取消'
+          confirm={this.deleteItem}
+          cancel={this.cancel}
+          close={this.close}
+        >
+          <div className={style['del-msg']}>是否删除该诊断?</div>
+        </ConfirmModal>
+        <ConfirmModal visible={showReferRecord} okText='是' cancelText='否' confirm={this.referRecord} cancel={this.noReferRecord} close={this.noReferRecord}>
+          <div className={style['confirm-info']}>是否引用往期病历</div>
+        </ConfirmModal>
+        <ConfirmModal visible={showHistoryCase} noFooter='true' title='请选择历史病历' close={this.closeHistoryCaseModal} titleBg="#DFEAFE" icon={tableIcon} height={300}>
+          {this.getHistoryCase()}
+          <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
+        </ConfirmModal>
+      </div>
+
+    )
+  }
 }
 
 export default DiagnosticList;

+ 1 - 1
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -14,7 +14,7 @@ class HistoryCaseContainer extends React.Component {
         super(props);
     }
     componentDidMount(){
-      dragBox('hisWrapMove','closeHis')
+      // dragBox('hisWrapMove','closeHis')
     }
     render(){
         const { items,handleCaseClick,handleQuoteClick,handleSortClick,showHistoryBox,activeHistory,preInfo } = this.props;

+ 1 - 1
src/components/Preview/index.jsx

@@ -10,7 +10,7 @@ class Preview extends Component {
     super(props)
   }
   componentDidMount(){
-    dragBox('previewWrapper','previewStatic')
+    // dragBox('previewWrapper','previewStatic')
   }
   render() {
     const { onClose, visible,preInfo } = this.props;

+ 1 - 1
src/components/PrintPreview/index.jsx

@@ -12,7 +12,7 @@ class PrintPreview extends Component {
         super(props)
     }
     componentDidMount(){
-      dragBox('previewPrintWrapper','previewPrintStatic')
+      // dragBox('previewPrintWrapper','previewPrintStatic')
     }
     render() {
         const { onClose, visible, preInfo,save } = this.props;

+ 2 - 0
src/components/PushItems/index.jsx

@@ -61,6 +61,7 @@ class PushItems extends Component {
       name: '',
       questionId: '',
       showType: 1,
+      uniqueName:''
     }
     let obj1 = {  //添加辅检
       name: '',
@@ -81,6 +82,7 @@ class PushItems extends Component {
         tmpObj.questionId = checkedAssay[i].id
         tmpObj.name = checkedAssay[i].name
         tmpObj.details = tmpDetail
+        tmpObj.uniqueName = checkedAssay[i].uniqueName||''
         assayArr.push(tmpObj)
       }
       store.dispatch(addLabel(assayArr))

+ 2 - 2
src/components/ScaleTable/index.jsx

@@ -191,7 +191,7 @@ class ScaleTable extends React.Component{
   componentDidMount(){
     const {tableId,scaleInfo} = this.props;
     if(scaleInfo&&scaleInfo[tableId]){
-      let scale = this.filterScale(scaleInfo[tableId]);console.log(22,JSON.parse(scale.content));
+      let scale = this.filterScale(scaleInfo[tableId]);
       this.setState({
         // valueData:JSON.parse(scaleInfo[tableId][1].content)
         valueData:scale.content?JSON.parse(scale.content):{}
@@ -230,7 +230,7 @@ class ScaleTable extends React.Component{
     let {selecteds,valueData,start,scaleResult1} = this.state;
     const {tableId,formulaResult} = this.props;
     const scaleResult = scaleResult1 || formulaResult&&formulaResult[tableId]; //量表计算结果
-    const datas = valueData&&valueData.group?valueData:'';console.log(666,datas);
+    const datas = valueData&&valueData.group?valueData:'';
     let content =  datas&&datas.group&&datas.group.map((v,i)=>{
                 return <div className={style['group']}>
                   <p className={style['groupName']}>{v.groupName}</p>

+ 7 - 6
src/components/Treat/index.jsx

@@ -6,7 +6,6 @@ import DrugHistory from './DrugHistory/index.jsx';
 import FollowUp from './FollowUp/index.jsx';
 import AdverseReactions from './AdverseReactions/index.jsx';
 import TreatDesc from '@components/TreatDesc'
-import {dragBox,windowRemoveEventHandler} from '@utils/tools'
 import DrugInfo from '@components/TreatDesc/DrugInfo';
 import Notify from '@commonComp/Notify'
 import close from './img/close.png';
@@ -16,6 +15,7 @@ import followUpIcon from './img/followUp.png';
 import drugIcon from './img/drug.png';
 import adverseReactionIcon from './img/adverseReaction.png';
 import $ from "jquery";
+import {dragBox} from '@utils/drag';
 
 class Treat extends Component {
     constructor(props){
@@ -29,7 +29,8 @@ class Treat extends Component {
         this.setTreatBox = this.setTreatBox.bind(this);
     }
     componentDidMount(){
-      dragBox('treatWrapper','dragTreatTitle')
+      // dragBox('treatWrapper','dragTreatTitle')
+      dragBox('add','drugWrapper')
     }
     
     hideTreat() {
@@ -38,7 +39,7 @@ class Treat extends Component {
         clearTreat && clearTreat();
         hideTreat && hideTreat();
         hideDrugInfo && hideDrugInfo();
-        // windowRemoveEventHandler('mousemove',handleMove,document)
+        dragBox('del')
     }
     handlePrescription() {
         Notify.info('该功能即将上线,敬请期待。', 2000)
@@ -57,7 +58,7 @@ class Treat extends Component {
     }
    
     setTreatBox(){
-      $('#treatWrapper').css({'z-index': 302});
+      $('#dragModalWrap').css({'z-index': 302});
       $('#drugWrapper').css({'z-index': 301});
     }
     render(){
@@ -69,9 +70,9 @@ class Treat extends Component {
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
                 </div>
-                <div id="treatWrapper" className={style['treat-box']}  onselectstart="return false">
+                <div id="dragModalWrap" className={style['treat-box']}  onselectstart="return false">
                     <img className={style.close} onClick={this.hideTreat} src={close}/>
-                    <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
+                    <div onMouseDown={this.setTreatBox} id="dragModalTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>

+ 5 - 4
src/components/TreatDesc/DrugInfo/index.jsx

@@ -2,7 +2,7 @@ import React, { Component } from 'react';
 import style from './index.less';
 import close from './../img/close.png';
 import $ from "jquery";
-import {dragBox} from '@utils/tools'
+import {dragBox} from '@utils/drag'
 
 
 class DrugInfo extends Component {
@@ -15,7 +15,8 @@ class DrugInfo extends Component {
         this.setDragBox = this.setDragBox.bind(this)
     }
     componentDidMount(){
-      dragBox('drugWrapper','drugTitle')
+      // dragBox('drugWrapper','drugTitle')
+      dragBox('add')
     }
     handleClickMenu(index, item, drugDesc) {
         const that = this
@@ -47,7 +48,7 @@ class DrugInfo extends Component {
         }
     }
     setDragBox(){
-      $('#treatWrapper').css({'z-index': 301});
+      $('#dragModalWrap').css({'z-index': 301});
       $('#drugWrapper').css({'z-index': 302});
     }
     render() {
@@ -55,7 +56,7 @@ class DrugInfo extends Component {
         const { currentIndex } = this.state
         return (<div className={style['drug-info-wrapper']} id="drugWrapper">
                 <img src={close} onClick={hideDrugInfo} className={style['close-drug-desc']}/>
-                <h3 onMouseDown={this.setDragBox} id="drugTitle" className={style['drug-title']}>{drugInfo.tagType == 8 ? drugInfo.title+'说明书' : drugInfo.tagType == 10 ? drugInfo.title+ '说明': ''}</h3>
+                <h3 onMouseDown={this.setDragBox} id="dragModalTitle" className={style['drug-title']}>{drugInfo.tagType == 8 ? drugInfo.title+'说明书' : drugInfo.tagType == 10 ? drugInfo.title+ '说明': ''}</h3>
                 { drugInfo && drugInfo.drugDesc.length > 0 && <div className={style['drug-desc-wrapper']} id='drugDesc' onScroll={this.handleScrollModal.bind(this,  drugInfo.drugDesc)}>
                     <div className={style['drug-title1']} >{drugInfo.tagType == 8 ? drugInfo.title+'说明书' : drugInfo.tagType == 10 ? drugInfo.title+ '说明': ''}</div>
                     {drugInfo.drugDesc.map((item, index) =>{

+ 4 - 0
src/containers/ChronicInfo.js

@@ -8,6 +8,7 @@ import {saveClickNum} from '@store/async-actions/homePage';
 import { getFormulaResult } from '@store/async-actions/fetchModules'
 import {deepClone} from '@utils/tools';
 import Notify from '@commonComp/Notify';
+import {dragBox} from '@utils/drag';
 
 function mapStateToProps(state){
   const {pushMessage,assessResult} = state;
@@ -43,6 +44,9 @@ function mapDispatchToProps(dispatch){
         value:param.value,
         item:item?Object.assign({},item):undefined
       })
+      if(!param.value){
+        dragBox('del')
+      }
     },
     getScaleInfo(item){
       dispatch(getScaleInfo(item))

+ 1 - 0
src/containers/Treat.js

@@ -69,6 +69,7 @@ function mapDispatchToProps(dispatch) {
             })
         },
         hideDrugInfo: () =>{
+            
             dispatch({
                 type: CLEAR_DRUG_INFO
             })

+ 3 - 2
src/store/actions/inspect.js

@@ -15,9 +15,10 @@ export const addLabel = (lis) => ({          //右侧开单
     type:ADD_LABEL,
     lis
 })
-export const resetLabel = (list) => ({          //搜索后点击选中的结果重组
+export const resetLabel = (list,uniqueName) => ({          //搜索后点击选中的结果重组
     type:RESET_LABEL,
-    list
+    list,
+    uniqueName
 })
 
 export const fillActived = (id,idx) => ({

+ 3 - 3
src/store/async-actions/inspect.js

@@ -36,15 +36,15 @@ export const getSublableList = (id,idx) => {
         .then((res)=>{
             const data = res.data.data;
             if (data.controlType == 0) {
-                dispatch(resetLabel(data.questionMapping,idx));
+                dispatch(resetLabel(data.questionMapping,data.uniqueName||''));
             }else if(data.controlType == 1){
                 let arr = [];
                 arr[0] = data;
-                dispatch(resetLabel(arr,idx));
+                dispatch(resetLabel(arr));
             }else if(data.controlType == 6) {
                 let arr =[];
                 arr[0] = data;
-                dispatch(resetLabel(arr,idx));
+                dispatch(resetLabel(arr));
             } 
         })
     }

+ 2 - 1
src/store/reducers/inspect.js

@@ -11,7 +11,7 @@ import {
     DEL_EXCEL_LIST,
     ADD_LABEL
 } from '../types/inspect';
-import store from '@store'
+import store from '@store';
 import {dateParser} from '@utils/tools.js';
 
 const initSearchList = {
@@ -63,6 +63,7 @@ export default (state = initSearchList, action) => {
         const newState = Object.assign({}, state);
         const tempArr = newState.labelList;
         tempArr[tempArr.length-1].details = action.list;
+        tempArr[tempArr.length-1].uniqueName = action.uniqueName;
         return newState;
     } 
     if (action.type == ADD_LABEL) {             //右侧推送的化验辅检项,点击开单放到左侧化验辅检的位置上

+ 90 - 88
src/utils/drag.js

@@ -1,100 +1,102 @@
+/**
+ * 弹窗页面同一时间只能渲染一个,可拖拽元素的id都一样'dragModalWrap','dragModalTitle'
+ * 保证能在关闭的时候移除move事件
+ */
 import $ from 'jquery';
-import { getWindowInnerHeight,getWindowInnerWidth,getPageCoordinate } from './tools'
+import {
+  getWindowInnerHeight,
+  getWindowInnerWidth,
+  getPageCoordinate
+} from './tools'
+
+let width = '',//屏幕宽度
+  height = '', //屏幕高度
+  mouseX = 0, //鼠标距离页面左侧
+  mouseY = 0,//鼠标距离页面上部
+  dragX = 0,//鼠标可拖拽到左边的最大距离(元素定位左侧距离)
+  dragY = 0,//鼠标可拖拽到上边的最大距离(元素定位上边距离)
+  isDrag = false,//元素是否处于拖拽中
+  addPart = null;//展开区域,这个展开的宽度应当是固定宽度了
 /**
  * 
- * @param {被拖动的元素} domWrap 
- * @param {可拖动的区域} domDrag 
- * @param {鼠标滑动监听的区域} dragMove 
- * @param {拖动元素/清除拖动事件监听} type 
+ * @param {事件对象} event 
+ * @param {被拖动的元素} dragModalWrap 
+ * @param {可拖动的区域} dragModalTitle 
  */
-
-function dragBox(domWrap,domDrag,dragMove){
-  // console.log(domWrap,domDrag,'拖拽')
-  let drag = $("#"+domDrag);
-  let wrap = $("#"+domWrap);
-  let wrapHeight = wrap.height();//被拖拽的元素高度
-  let wrapWidth = wrap.width();//被拖拽的元素宽度
-  let width = getWindowInnerHeight();//屏幕宽度
-  let height = getWindowInnerWidth();//屏幕高度
-  let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-  // windowEventHandler('mousedown',function(event){    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-  //   let page = getPageCoordinate(event,'0');
-  //   mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
-  //   mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
-  //   isDrag = true
-  //   // isMove = false
-  // },drag)
-  drag.on('mousedown',function(event){
-    let page = getPageCoordinate(event,'0');
-    mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
-    mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
-    isDrag = true
-  })
-  $(document).on('mousemove',handleMove)
-  $(document).on('mouseup',function(){
-    isDrag = false
-    return false
-  })
-  // windowEventHandler('mousemove',handleMove,document)
-  // windowEventHandler('mouseup',()=>{
-  //   // if(isMove){ //有move就设置位置没有移动就不处理
-  //   //   console.log(dragX)
-  //   //   wrap.style.left = dragX + 'px'
-  //   //   wrap.style.top = dragY + 'px'
-  //   // }
-  //   isDrag = false
-  //   return false
-  // },document)
-
-  function handleMove(event){      //移动的
-    console.log(99)
-    let dragDes = document.getElementById('treatDescBox');//展開区域
-    let page = getPageCoordinate(event,'0');
-    let maxDragX = 0,dragDesWidth = 0;
-    let maxDragY = height - wrapHeight;//最大可拖拽y方向距离
-    wrapHeight = wrap.offsetHeight;
-    wrapWidth = wrap.offsetWidth;
-    if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
-      if(dragDes != null){
-        dragDesWidth = dragDes.offsetWidth
-      }else{
-        dragDesWidth = 0
-      }
-      maxDragX = width - wrapWidth - dragDesWidth
-    }else{
-      maxDragX = width - wrapWidth
+function handleMove(event) {
+  let wrap = $("#dragModalWrap"); //被拖拽的元素
+  let dragDes = $("#"+addPart); //展開区域
+  console.log(addPart,dragDes[0])
+  let page = getPageCoordinate(event, '0');//获取鼠标位置
+  let maxDragX = 0,dragDesWidth = 0;
+  let wrapHeight = wrap[0].offsetHeight;//直接用.height()获取的高度不准确
+  let wrapWidth = wrap[0].offsetWidth;
+  let maxDragY = height - wrapHeight; //最大可拖拽y方向距离
+  if (dragDes[0]) { //存在就有类似治疗方案的弹窗,最大可推拽x方向距离
+    dragDesWidth = dragDes[0].offsetWidth//展开元素的宽度
+    maxDragX = width - wrapWidth - dragDesWidth
+  } else {
+    maxDragX = width - wrapWidth
+  }
+  if (isDrag) {
+    dragX = page.boxLeft - mouseX //鼠标可拖拽到左边的最大距离
+    dragY = page.boxTop - mouseY //鼠标可拖拽到上边的最大距离
+    if (dragX < 0) { //不能超出左边界
+      dragX = 0
     }
-    if(isDrag){
-      dragX = page.boxLeft - mouseX          //鼠标可拖拽到左边的最大距离
-      dragY = page.boxTop - mouseY          //鼠标可拖拽到上边的最大距离
-      if(dragX < 0){      //不能超出左边界
-        dragX = 0
-      }
-      if(dragY < 0){      //不能超出上边界
-        dragY = 0
-      }
-      if(domDrag == 'dragTreatTitle'){
-        if(width-dragX-dragDesWidth < wrapWidth){    //不能超出右边界
-          dragX = maxDragX
-        }
-      }else{
-        // console.log(width,dragX,maxDragX,wrapWidth)
-        if(width-dragX < wrapWidth){    //不能超出右边界
-          dragX = maxDragX
-        }
+    if (dragY < 0) { //不能超出上边界
+      dragY = 0
+    }
+    if (dragDes[0]) {
+      if (width - dragX - dragDesWidth < wrapWidth) { //不能超出右边界
+        dragX = maxDragX
       }
-      if(height-dragY < wrapHeight){     //不能超出下边界
-        dragY = maxDragY
+    } else {
+      if (width - dragX < wrapWidth) { //不能超出右边界
+        dragX = maxDragX
       }
-      // isMove = true
-      wrap.style.left = dragX + 'px'
-      wrap.style.marginLeft = 0 + 'px'
-      wrap.style.top = dragY + 'px'
     }
+    if (height - dragY < wrapHeight) { //不能超出下边界
+      dragY = maxDragY
+    }
+    // isMove = true
+    wrap.css({
+      left: dragX + 'px',
+      marginLeft: 0 + 'px',
+      top: dragY + 'px'
+    })
+  }
+}
+/**
+ * 鼠标弹起弹窗不在跟随鼠标移动
+ */
+function handleUp(){
+  isDrag = false
+  return
+}
+/**
+ * @param {拖动元素/清除拖动事件监听} type add:添加事件监听  del:移除事件监听
+ * @param {展开元素id} addDom 
+ */
+function dragBox(type,addDom) {
+  let drag = $("#dragModalTitle"); //拖拽区域
+  let wrap = $("#dragModalWrap"); //被拖拽的元素
+  width = getWindowInnerWidth(); 
+  height = getWindowInnerHeight();
+  addPart = addDom||null;
+  if (type === 'del') {
+    $(document).off('mousemove', handleMove)
+    $(document).off('mouseup', handleUp)
+  } else {
+    drag.on('mousedown', function (event) {
+      let page = getPageCoordinate(event, '0');
+      mouseX = page.boxLeft - wrap.offset().left; //鼠标到拖拽元素的左边界的距离
+      mouseY = page.boxTop - wrap.offset().top; //鼠标到拖拽元素的上边界的距离
+      isDrag = true
+    })
+    $(document).on('mousemove', handleMove)
+    $(document).on('mouseup', handleUp)
   }
-  setTimeout(() => {
-    // windowRemoveEventHandler('mousemove',handleMove,document)
-  }, 6000);
 }
 
 module.exports = {

+ 67 - 48
src/utils/tools.js

@@ -738,6 +738,10 @@ function normalVal(min,max){
       return null;
   }
 }
+/**
+ * 
+ * @param {弹窗显示位置是否往下设置} stic 
+ */
 function getPageCoordinate(event,stic){//获取鼠标点击的位置
     let e = event || window.event;
     var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
@@ -760,57 +764,34 @@ function timestampToTime(timestamp) {     //excel导入2019年5月1日会转换
   var s = date.getSeconds();
   return Y+M+D+h+m+s;
 }
-function dragBox(domWrap,domDrag,dragMove){
+function dragBox(domWrap,domDrag,type){
   // console.log(domWrap,domDrag,'拖拽')
-  let drag = document.getElementById(domDrag);//拖拽区域
-  let wrap = document.getElementById(domWrap);//被拖拽的元素
-  let move = document.getElementById(dragMove);//被拖拽的元素
-  let wrapHeight = wrap.offsetHeight;//被拖拽的元素高度
-  let wrapWidth = wrap.offsetWidth;//被拖拽的元素宽度
-  let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
-  let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
-  let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-  // $(drag).mousedown(()=>{
-  //   let page = getPageCoordinate(event,'0');
-  //   mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
-  //   mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
-  //   isDrag = true
-  // })
-  // $(move).mouseup(()=>{
-  //   console.log('mouseup')
-  //   isDrag = false
-  //   return false
-  // })
-  // $(move).mousemove(handleMove)
-  windowEventHandler('mousedown',function(event){    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-    let page = getPageCoordinate(event,'0');
-    mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
-    mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
-    isDrag = true
-    // isMove = false
-  },drag)
-  windowEventHandler('mousemove',handleMove,document)
-  windowEventHandler('mouseup',()=>{
-    // if(isMove){ //有move就设置位置没有移动就不处理
-    //   console.log(dragX)
-    //   wrap.style.left = dragX + 'px'
-    //   wrap.style.top = dragY + 'px'
-    // }
-    isDrag = false
-    return false
-  },dragMove)
 
+  // let drag = document.getElementById(domDrag);//拖拽区域
+  // let wrap = document.getElementById(domWrap);//被拖拽的元素
+  // let wrapHeight = wrap.offsetHeight;//被拖拽的元素高度
+  // let wrapWidth = wrap.offsetWidth;//被拖拽的元素宽度
+  // let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
+  // let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
+
+  let drag = $("#"+domDrag);//拖拽区域
+  let wrap = $("#"+domWrap);//被拖拽的元素
+  let wrapHeight = wrap[0].offsetHeight;//被拖拽的元素高度
+  let wrapWidth = wrap[0].offsetWidth;//被拖拽的元素宽度
+  let width = getWindowInnerWidth();//屏幕宽度
+  let height = getWindowInnerHeight();//屏幕高度
+  let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
   function handleMove(event){      //移动的
-    // console.log('move')
-    let dragDes = document.getElementById('treatDescBox');//展開区域
+    console.log('move')
+    let dragDes = $('#treatDescBox');//展開区域
     let page = getPageCoordinate(event,'0');
     let maxDragX = 0,dragDesWidth = 0;
+    wrapHeight = wrap[0].offsetHeight;
+    wrapWidth = wrap[0].offsetWidth;
     let maxDragY = height - wrapHeight;//最大可拖拽y方向距离
-    wrapHeight = wrap.offsetHeight;
-    wrapWidth = wrap.offsetWidth;
     if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
       if(dragDes != null){
-        dragDesWidth = dragDes.offsetWidth
+        dragDesWidth = dragDes[0].offsetWidth
       }else{
         dragDesWidth = 0
       }
@@ -841,14 +822,50 @@ function dragBox(domWrap,domDrag,dragMove){
         dragY = maxDragY
       }
       // isMove = true
-      wrap.style.left = dragX + 'px'
-      wrap.style.marginLeft = 0 + 'px'
-      wrap.style.top = dragY + 'px'
+      wrap.css({
+        left:dragX + 'px',
+        marginLeft:0 + 'px',
+        top:dragY + 'px'
+      })
     }
   }
-  setTimeout(() => {
+  if(type === 'del'){
+    console.log(123)
     // windowRemoveEventHandler('mousemove',handleMove,document)
-  }, 2000);
+    $(document).off('mousemove',handleMove)
+    return
+  }else{
+    drag.on('mousedown',function(event){
+      let page = getPageCoordinate(event,'0');
+      mouseX = page.boxLeft - wrap.offset().left;      //鼠标到拖拽元素的左边界的距离
+      mouseY = page.boxTop - wrap.offset().top;       //鼠标到拖拽元素的上边界的距离
+      isDrag = true
+    })
+    $(document).on('mousemove',handleMove)
+    $(document).on('mouseup',function(){
+      isDrag = false
+      return false
+    })
+    // windowEventHandler('mousedown',function(event){    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
+    //   console.log('mousedown')
+    //   let page = getPageCoordinate(event,'0');
+    //   mouseX = page.boxLeft - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
+    //   mouseY = page.boxTop - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
+    //   isDrag = true
+    //   // isMove = false
+    // },drag)
+    // windowEventHandler('mousemove',handleMove,document)
+    // windowEventHandler('mouseup',()=>{
+    //   console.log('mouseup')
+    //   // if(isMove){ //有move就设置位置没有移动就不处理
+    //   //   console.log(dragX)
+    //   //   wrap.style.left = dragX + 'px'
+    //   //   wrap.style.top = dragY + 'px'
+    //   // }
+    //   isDrag = false
+    //   return false
+    // },document)
+  }
 }
 
 function getCurrentDate(){
@@ -881,6 +898,7 @@ function inspectAndAssist(){
       name: '',
       questionId: '',
       showType: 1,
+      uniqueName:''
     }
     if (tmpInspect[i].controlType == 0) {
       tmpDetail = tmpInspect[i].questionMapping
@@ -890,6 +908,7 @@ function inspectAndAssist(){
     tmpObj.questionId = tmpInspect[i].id
     tmpObj.name = tmpInspect[i].name
     tmpObj.details = tmpDetail
+    tmpObj.uniqueName = tmpInspect[i].uniqueName || ''
     assayArr.push(tmpObj)
   }
   for(let i = 0;i < tmpAssist.length;i++){//辅检数据处理