Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/ChronicMag' into ChronicMag

zhouna 6 gadi atpakaļ
vecāks
revīzija
3598f0386e

+ 7 - 2
src/common/components/ComplexModal/index.jsx

@@ -3,6 +3,8 @@ import ReactDom from "react-dom";
 import style from "./index.less";
 import Notify from '@commonComp/Notify';
 import close from '@common/images/icon_close.png';
+import { dragBox } from '@utils/tools';
+
 /**
  * title:标题
  * children:弹窗内容
@@ -19,6 +21,9 @@ class ComplexModal extends Component {
   constructor(props) {
     super(props);
   }
+  componentDidMount(){
+    dragBox('complexModalWrap','complexModalTitle')
+  }
 
   render() {
     const { onclose,title,children,footer,shadeClose,icon,width,top,bottom} = this.props;
@@ -27,8 +32,8 @@ class ComplexModal extends Component {
     const domNode = document.getElementById('root');
     return ReactDom.createPortal(<div className={style['container']}>
       <div className={style['shade']} onClick={shadeClose===false?'':onclose}></div>
-      <div className={style['modal']} style={{width: width?width:'auto', marginLeft:marginLeft, top:top?top+'px':'',bottom:bottom?bottom+'px':''}}>
-        <div className={style['close']}>
+      <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">
           {icon?<img src={icon} />:''}
           {title}
           <img src={close} onClick={onclose} className={style['closeIcon']} />

+ 19 - 9
src/common/components/ComplexModal/index.less

@@ -1,18 +1,23 @@
 .container {
   position: relative;
   z-index: 2000;
+  padding-top: 40px;
   .content{
     overflow: auto;
-    position: fixed;
-    bottom: 70px;
-    top: 70px;
+    position: relative;
+    height: 100%;
+    padding-bottom: 30px;
+    // bottom: 70px;
+    // top: 70px;
     // width: 820px;
   }
   .footer{
     // width: 820px;
-    position: fixed;
-    bottom:30px;
+    position: relative;
+    padding:15px 0px;
+    bottom: 0;
     text-align: right;
+    background-color: #fff;
   }
   // @media print {
   //   .close{
@@ -41,15 +46,20 @@
     background: #fff;
     position: fixed;
     left: 50%;
-    //top: 50%;
-    // margin-left: -410px;
-    top: 65px;
-    bottom: 65px;
+    top: 3%;
+    bottom: 3%;
+    height: 94%;
+    overflow: hidden;
+    padding-top: 50px;
+    padding-bottom: 64px;
   }
   .close {
     padding:  15px 15px 15px 20px;
     border-bottom: 1px solid #EAEDF1;
     background: #e5eefe;
+    position: absolute;
+    top:0;
+    width: 100%;
     img{
       vertical-align: text-top;
     }

+ 10 - 0
src/common/less/variables.less

@@ -184,3 +184,13 @@
   border:1px solid @import-color;
   //color: @import-color!important;
 }
+:global(.drag-title) {
+  cursor: move;
+  moz-user-select: -moz-none;
+  -moz-user-select: none;
+  -o-user-select: none;
+  -khtml-user-select: none;
+  -webkit-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}

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

@@ -83,11 +83,11 @@ class Advice extends Component{
 
     return  <div className={`${'mainsuit-box'} ${style['main-suit']}`}>
       <ItemBox title='医嘱' editable={false} border={true} marginTop="10px">
-        {/* <div className={style['billing']}>
+        <div className={style['billing']}>
           {advice.assay && advice.assay.length > 0 || advice.check && advice.check.length > 0 ? <h1>开单项目</h1> : ''}
             {advice.assay && <span className={style['treat-input']}> {advice.assay}</span>}
             {advice.check && <span className={style['treat-input']}> {advice.check}</span>}
-        </div> */}
+        </div>
         {advice.commontreatment && advice.commontreatment.length > 0 &&<div className={style['billing']}  >
           {advice.commontreatment && advice.commontreatment.length > 0 && <h1>一般治疗</h1>}
             {/* {advice.commontreatment && <div className={style['treat-input']}  onInput={this.handleComTreatInput}  contentEditable={true} style = {{outline: 'none'}}></div>} */}

+ 8 - 8
src/components/ChronicInfo/index.jsx

@@ -310,8 +310,8 @@ class ChronicInfo extends React.Component{
                       {v.details&&v.details.map((it,j)=>{
                         if(it.type==1){
                           return <p>
-                                <span className={style["listName"]} onClick={this.showTable.bind(this,it.content,v.id,i)}>
-                                  {'【'+it.content.name+'】'}
+                                <span className={style["listName"]}>
+                                  <i onClick={this.showTable.bind(this,it.content,v.id,i)}>{'【'+it.content.name+'】'}</i>
                                   {formulaResult&&formulaResult[it.content.id]&&formulaResult[it.content.id].pIndex==i?<i>{'结果:'}{formulaResult[it.content.id].calcalculate&&formulaResult[it.content.id].calcalculate.result.value +' '+ formulaResult[it.content.id].calcalculate.result.text}</i>:''}
                                   
                                 </span>
@@ -457,7 +457,7 @@ class ChronicInfo extends React.Component{
     return list;
   }
 
-  render(){console.log('chronic更新')
+  render(){
     const footer = <div className={style['footer']}>
       <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
       <span className={style['okBtn']} onClick={()=>this.handleSaveAssess()}>确定</span>
@@ -505,11 +505,11 @@ class ChronicInfo extends React.Component{
               <ConfirmModal visible={showHide&&showHide.showList} noFooter='true' title='全部量表' close={this.close} titleBg="#DFEAFE" icon={allTableIcon} height={400} width={400}>
                       <ul className={style['toast-cont']}>
                         {tableList&&tableList.map((v,i)=>{
-                          return <li onClick={this.handleListClick.bind(this,v)}>
+                          return <li>
                           <span>
-                            {'【'+v.name+'】'}
+                            <i onClick={this.handleListClick.bind(this,v)}>{'【'+v.name+'】'}</i>
                             {/*{formulaResult&&formulaResult[v.id]?<i>{'结果:'+formulaResult[v.id].text}</i>:''}*/}
-                            {formulaResult&&formulaResult[v.id]?<i>{'结果:'}{formulaResult[v.id].calcalculate&&formulaResult[v.id].calcalculate.result.value+' '+ formulaResult[v.id].calcalculate.result.text}</i>:''}
+                            {formulaResult&&formulaResult[v.id]?<i className={style['res']}>{'结果:'}{formulaResult[v.id].calcalculate&&formulaResult[v.id].calcalculate.result.value+' '+ formulaResult[v.id].calcalculate.result.text}</i>:''}
                           </span>
                           </li>
                         })}
@@ -526,8 +526,8 @@ class ChronicInfo extends React.Component{
               {showAssess?<ComplexModal onclose={this.showAssessFn} footer={footer}
                       title='管理和评估'
                       icon={manageIcon}
-                      top={20}
-                      bottom={20}
+                      top={'3%'}
+                      bottom={'3%'}
                       width={820}>
                 <AssessResult handleSave={saveAssessInfos}
                               handleSaveCalcu={this.handleSaveCalcu}

+ 1 - 1
src/components/ChronicInfo/index.less

@@ -217,7 +217,7 @@
         margin-top: 10px;
         cursor: pointer;
       }
-      i{
+      .res{
         color:#3B9ED0;
         margin-left: 10px;
       }

+ 34 - 0
src/components/CopyRight/CopyModalSon/index.jsx

@@ -0,0 +1,34 @@
+import React, { Component } from "react";
+import style from "../index.less";
+import close from '../../../common/images/icon_close.png'
+import { dragBox } from '@utils/tools';
+
+class DiscontentSon extends Component {
+  constructor(props) {
+    super(props);
+  }
+  componentDidMount(){
+    dragBox('CopyModalWrap','CopyModalTitle')
+  }
+
+  render() {
+    const { closeCopyModal,copyVisible,date,copyContent,number } = this.props;
+
+    return <div
+        className={style["copyModal"]}
+        style={copyVisible ? { display: "block" } : { display: "none" }}
+      >
+        <div className={style["shade"]} onClick={closeCopyModal}/>
+        <div className={style["copyContent"]} id="CopyModalWrap">
+          <div className={`${style["header"]} drag-title`} id="CopyModalTitle">版本信息<img src={close} onClick={closeCopyModal} /></div>
+          <div className={style["now"]}>
+            当前版本:{number}
+            <span>{date && date.substring(0, 10)}</span>
+          </div>
+          <div className={style["content"]}>{copyContent}</div>
+        </div>
+      </div>
+  }
+}
+
+export default DiscontentSon;

+ 31 - 0
src/components/CopyRight/DiscontentSon/index.jsx

@@ -0,0 +1,31 @@
+import React, { Component } from "react";
+import style from "../index.less";
+import close from '../../../common/images/icon_close.png'
+import { dragBox } from '@utils/tools';
+
+class DiscontentSon extends Component {
+  constructor(props) {
+    super(props);
+  }
+  componentDidMount(){
+    dragBox('disContentWrap','DisclatmerTitle')
+  }
+
+  render() {
+    const { closeDisclatmerModal,disVisible,disclatmerContent } = this.props;
+
+    return <div
+          className={style["disModal"]}
+          style={disVisible ? { display: "block" } : { display: "none" }}
+        >
+          <div className={style["shade"]} onClick={closeDisclatmerModal}/>
+          <div className={style["disContent"]} id="disContentWrap">
+            <div className={`${style["header"]} drag-title`} id="DisclatmerTitle">免责声明<img src={close} onClick={closeDisclatmerModal} /></div>
+            <div className={style["content"]}>{disclatmerContent}</div>
+            <div className={style["btnBox"]}><span  className={style["btn"]} onClick={closeDisclatmerModal}>确定</span></div>
+          </div>
+      </div>
+  }
+}
+
+export default DiscontentSon;

+ 7 - 24
src/components/CopyRight/index.jsx

@@ -2,6 +2,8 @@ import React, { Component } from "react";
 import style from "./index.less";
 import close from '../../common/images/icon_close.png'
 import { storageLocal } from "../../utils/tools"
+import DiscontentSon from "./DiscontentSon"
+import CopyModalSon from "./CopyModalSon"
 
 class CopyRight extends Component {
   constructor(props) {
@@ -16,7 +18,6 @@ class CopyRight extends Component {
   }
   componentWillMount() {
     this.props.getDisMessage()
-
   }
   componentDidMount() {
     this.props.getMessage()
@@ -68,15 +69,6 @@ class CopyRight extends Component {
       );
     });
 
-    // const disclatmerContent = disContent.map(item => {
-    //   return (
-    //     <div className={style['message']}>
-    //       {item.title}
-    //       <div dangerouslySetInnerHTML={{__html: item.description}}></div>
-    //     </div>
-    //   );
-    // })
-
     return (
       <div className={style["container"]}>
         <div className={style["copy"]}>
@@ -87,11 +79,11 @@ class CopyRight extends Component {
           {hasNewVersion && <span>new</span>} &copy;<b>朗通医疗</b>
           <div className={style['disclaimer']} onClick={showDisclatmerModal}>免责声明</div>
         </div>
-        {copyVisible && <div
+        {/* {copyVisible && <div
           className={style["copyModal"]}
           style={copyVisible ? { display: "block" } : { display: "none" }}
         >
-          <div className={style["shade"]}  onClick={closeCopyModal}/>
+          <div className={style["shade"]} onClick={closeCopyModal}/>
           <div className={style["copyContent"]}>
             <div className={style["header"]}>版本信息<img src={close} onClick={closeCopyModal} /></div>
             <div className={style["now"]}>
@@ -100,18 +92,9 @@ class CopyRight extends Component {
             </div>
             <div className={style["content"]}>{copyContent}</div>
           </div>
-        </div>}
-       {disVisible && <div
-          className={style["disModal"]}
-          style={disVisible ? { display: "block" } : { display: "none" }}
-        >
-          <div className={style["shade"]} onClick={closeDisclatmerModal}/>
-          <div className={style["disContent"]}>
-            <div className={style["header"]}>免责声明<img src={close} onClick={closeDisclatmerModal} /></div>
-            <div className={style["content"]}>{this.disclatmerContent()}</div>
-            <div className={style["btnBox"]}><span  className={style["btn"]} onClick={closeDisclatmerModal}>确定</span></div>
-          </div>
-        </div>}
+        </div>} */}
+        {copyVisible && <CopyModalSon copyVisible={copyVisible} date={date} closeCopyModal={closeCopyModal} copyContent={copyContent} number={number}></CopyModalSon>}
+        {disVisible && <DiscontentSon closeDisclatmerModal={closeDisclatmerModal} disVisible={disVisible} disclatmerContent={this.disclatmerContent()}></DiscontentSon>}
       </div>
     );
   }

+ 6 - 4
src/components/CopyRight/index.less

@@ -95,9 +95,10 @@
         position: fixed;  
         width: 50%;
         height: 60%;
-        left: 20%;
+        left: 25%;
         background: #fff;
         top: 20%;
+        padding: 40px 0 60px 0;
         img{
           float: right;
           margin: -5px 5px 0px 0px;
@@ -105,7 +106,8 @@
         }
         .header {
           position: absolute;
-          top: -40px;
+          top: 0px;
+          width: 100%;
           height: 40px;
           font-size: 14px;
           padding: 10px 0px 10px 20px;
@@ -129,8 +131,8 @@
           overflow: auto;
         }
         .btnBox {
-          position: absolute;
-          bottom: -60px;
+          position: relative;
+          // bottom: -60px;
           width: 100%;
           height: 60px;
           background: #fff;

+ 2 - 3
src/components/DiagnosticList/index.jsx

@@ -141,7 +141,6 @@ class DiagnosticList extends Component {
         autoFillModules && autoFillModules();
     }
     handleQuoteClick(item, index) {
-        console.log('asadsd', item)
         const { handleQuoteClick } = this.props
         // handleQuoteClick && handleQuoteClick(item)
         this.setState({
@@ -152,7 +151,7 @@ class DiagnosticList extends Component {
         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: '#abcdef'} : ''}>
+                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}
                 </div>
             })}
@@ -169,7 +168,7 @@ class DiagnosticList extends Component {
                 <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['慢病用药内容'].length > 0) || (item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow) 
+                           || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow) 
                         // const hasTreat= true;
                         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>}

+ 9 - 4
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -6,13 +6,16 @@ import sort from "./img/sort.png"
 import close from "./img/close.png";
 import PreviewBody from '@components/PreviewBody';
 import Empty from '@components/Empty'
-
+import { dragBox } from '@utils/tools';
 
 
 class HistoryCaseContainer extends React.Component {
     constructor(props){
         super(props);
     }
+    componentDidMount(){
+      dragBox('hisWrapMove','closeHis')
+    }
     render(){
         const { items,handleCaseClick,handleQuoteClick,handleSortClick,showHistoryBox,activeHistory,preInfo } = this.props;
         let baseList = store.getState();
@@ -36,8 +39,10 @@ class HistoryCaseContainer extends React.Component {
             return jsonDataString;
         }
         return (
-            <div className={styles.mainHistory}>
-                <img className={styles.close} src={close} alt="关闭历史病历" onClick={showHistoryBox}/>
+            <div className={styles.mainHistory} id="hisWrapMove">
+                <div className={`${styles.closeHis} drag-title`} id="closeHis">
+                    <img className={styles.close} src={close} alt="关闭历史病历" onClick={showHistoryBox}/>
+                </div>
                 <div className={styles.mainHistoryLeft}>
                     <div className={styles.title}>
                         <span className={styles.his}>历史病历</span>
@@ -46,7 +51,7 @@ class HistoryCaseContainer extends React.Component {
                     <div className={styles.lists}>
                         <ul>
                             {
-                                items && items.length > 0? items.map((val,idx)=>{
+                                (items && items.length > 0)? items.map((val,idx)=>{
                                     return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{handleCaseClick(e,idx)}}>
                                         <span title={val.diagnose}>{val.diagnose}</span>
                                         {/* <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>

+ 24 - 8
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -1,26 +1,27 @@
 @import "~@less/mixin.less";
 .mainHistory {
     position: fixed;
-    left: 0;
-    top: 0;
-    right: 0;
-    bottom:0;
-    margin: auto;
+    margin-left: -500px;
+    left: 50%;
     width: 1000px;
-    top: 70px;
-    bottom: 70px;
+    top: 7%;  
+    bottom: 7%;
+    height: 86%;
     background-color: #fff;
     z-index: 242;
+    overflow: hidden;
     .close {
         position: absolute;
         top: 0;
         right: 0;
+        cursor: pointer;
     }
     .mainHistoryLeft {
         width: 300px;
         height: 100%;
         background: #d2d1d1;
         position: relative;
+        float: left;
         .title {
             height: 80px;
             line-height: 80px;
@@ -97,6 +98,21 @@
         }
     }
     .mainHistoryRight {
-        margin-left: 300px;
+        // margin-left: 300px;
+        // position: absolute;
+        overflow: auto;
+        height: 100%;
+        padding-top: 40px;
+        // top: 42px;
+
+        float: left;
+    }
+    .closeHis {
+      width: 700px;
+      height: 40px;
+      margin-left: 300px;
+      position: absolute;
+      z-index: 9999;
+      // border-bottom: 1px solid #EAEDF1;
     }
 }

+ 1 - 88
src/components/MainSuit/index.jsx

@@ -35,8 +35,6 @@ class MainSuit extends Component{
       overFlag:false,
       tmpScroll:0,
       tmpTop:0,
-      activeHistory: -1,
-      showHistoryCase:false
     };
     this.toggleEditable = this.toggleEditable.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
@@ -45,11 +43,6 @@ class MainSuit extends Component{
     this.handleChange = this.handleChange.bind(this);
     this.handleClick = this.handleClick.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
-    this.referRecord = this.referRecord.bind(this);
-    this.noReferRecord = this.noReferRecord.bind(this);
-    this.referCase = this.referCase.bind(this);
-    this.closeHistoryCaseModal = this.closeHistoryCaseModal.bind(this);
-    this.handleQuoteClick = this.handleQuoteClick.bind(this);
   }
   componentWillReceiveProps(nextProps){
     this.setState({boxLeft:nextProps.boxLeft})
@@ -280,83 +273,10 @@ class MainSuit extends Component{
       },config.delayTime-200); 
   }
 
-  // 慢病
-  referRecord() {//是否引用历史病例弹窗--是
-    const { chronicDesease,closeHisBox ,autoFillModules} = this.props;
-    const that = this;
-    closeHisBox&&closeHisBox();//关闭
-    initItemList(chronicDesease).then((res)=>{
-      const result = res.data;
-      if(result.code==0 && result.data){
-          store.dispatch(setInitHistory(result.data));
-          that.setState({
-            showHistoryCase:true
-          })
-      }else{
-        Notify.info("暂无历史病例,默认引用通用模板");
-        const timer = setTimeout(function(){
-          autoFillModules && autoFillModules();
-          clearTimeout(timer);
-        },1000)  
-      }
-    })
-    // this.setState({
-    //   showHistoryCase:true
-    // })
-    // store.dispatch(initItemList(chronicDesease));
-  }
-  noReferRecord() {//否
-    const {closeHisBox,autoFillModules} = this.props;
-    closeHisBox&&closeHisBox();
-    autoFillModules && autoFillModules()
-  }
-  referCase() {
-        const { items ,pureSaveChronic} = this.props
-        this.setState({
-          showHistoryCase:false
-        })
-        if (this.state.activeHistory === -1) {
-            return
-        }
-        // let baseList = store.getState(); 
-        let baseObj = items[this.state.activeHistory];
-        pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
-        pureSaveChronic && pureSaveChronic({name:'糖尿病',id:21773}); //储存慢病疾病
-        this.props.getBilling();
-        this.setState({
-            activeHistory: -1
-        })
-    }
-  closeHistoryCaseModal() {//关闭病例列表
-    const {autoFillMoudles} = this.props;
-      this.setState({
-        activeHistory: -1,
-        showHistoryCase:false
-      })
-     // 不引用病例直接分发模板进行填充 
-     autoFillMoudles&&autoFillMoudles();
-  }
-  handleQuoteClick(item, index) {
-      console.log('asadsd', item)
-      this.setState({
-          activeHistory: index
-      })
-  }
-  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: '#abcdef'} : ''}>
-                    <img src={this.state.activeHistory === index ? iconRadioActive : iconRadioDefault}/>{item.diagnose}
-                </div>
-            })}
-        </div>)
-    }
-
 
   render(){
     const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop,showHisBox} = this.props;
-    const {showModule,show,symptom,search,showHistoryCase} = this.state;
+    const {showModule,show,symptom,search} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
     const boxTop1 = datas.length>0?boxTop:45;
@@ -380,13 +300,6 @@ class MainSuit extends Component{
       </ItemBox>
       {/*没有推送结果就不显示*/}
       {symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onSelect={this.handleSearchSelect} left={boxLeft1} top={boxTop1} mainEmpty={datas.length==0?true:false}/>:"")}
-      <ConfirmModal visible={showHisBox} 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>
   }
 }

+ 6 - 4
src/components/Preview/index.jsx

@@ -1,5 +1,5 @@
 import React, { Component } from "react";
-import {getAllDataList,getAllDataStringList} from '@utils/tools';
+import {getAllDataList,getAllDataStringList,dragBox} from '@utils/tools';
 import PreviewBody from '../PreviewBody';
 import store from '@store';
 import style from "./index.less";
@@ -9,7 +9,9 @@ class Preview extends Component {
   constructor(props) {
     super(props)
   }
-
+  componentDidMount(){
+    dragBox('previewWrapper','previewStatic')
+  }
   render() {
     const { onClose, visible,preInfo } = this.props;
     let baseList = store.getState();
@@ -18,8 +20,8 @@ class Preview extends Component {
 
     return <div className={style['container']} style={visible? {display: 'block'}: {display: 'none'}}>
       <div className={style['shade']} onClick={onClose}></div>
-      <div className={style['modal']}>
-        <div className={style['close']}>预览<img src={close} onClick={onClose} /></div>
+      <div className={style['modal']} id="previewWrapper">
+        <div id="previewStatic" className={`${style['close']} drag-title`}>预览<img src={close} onClick={onClose} /></div>
         <PreviewBody
             preInfo={preInfo}
             dataJson={dataJson}

+ 4 - 2
src/components/Preview/index.less

@@ -18,8 +18,10 @@
     position: fixed;
     left: 50%;
     margin-left: -410px;
-    top: 65px;  
-    bottom: 65px;
+    top: 7%;  
+    bottom: 7%;
+    height: 86%;
+    overflow: hidden;
   }
   .close { 
     padding:  15px 15px 15px 20px;

+ 13 - 12
src/components/PreviewBody/index.jsx

@@ -223,20 +223,21 @@ class PreviewBody extends Component {
         </table>
         <p style={{textAlign:'right',marginTop:'15px'}}>医生签名:<span style={{minWidth: '60px',padding: '0 5px 2px 5px',borderBottom: '1px solid #333',}}>{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</span></p>
         {showAssessBtn?<AssessResultHis inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
+        
+        <div onClick={() => { this.surePrint(dataStr) }} style={{
+          display: show ? 'inline-block' : 'none',
+          padding: '10px 20px',
+          float: 'right',
+          marginTop: '22px',
+          background: '#3B9ED0',
+          color: '#fff',
+          borderRadius: '4px',
+          cursor: 'pointer',
+          position: 'absolute',
+          right: '-40px'
+        }}>打印</div>
       </div>
 
-      <div onClick={() => { this.surePrint(dataStr) }} style={{
-        display: show ? 'inline-block' : 'none',
-        padding: '10px 20px',
-        float: 'right',
-        marginTop: '15px',
-        background: '#3B9ED0',
-        color: '#fff',
-        borderRadius: '4px',
-        cursor: 'pointer',
-        position: 'absolute',
-        right: '40px'
-      }}>打印</div>
     </div>
   }
 }

+ 5 - 4
src/components/PreviewBody/index.less

@@ -1,11 +1,12 @@
 @import "~@less/variables.less";
 .content {
-  position: fixed;
-  bottom: 70px;
+  position: relative;
   overflow: auto;
-  top:120px;
+  height: 100%;
+  top:0px;
   width: 820px;
-  padding: 0 0px 60px 0px;
+  padding: 15px 0px 100px 0px;
+  box-sizing: border-box;
   .contents {
     position: relative;
     padding-bottom: 26px;

+ 6 - 3
src/components/PrintPreview/index.jsx

@@ -1,5 +1,5 @@
 import React, { Component } from "react";
-import { getAllDataList, getAllDataStringList,filterDataArr } from '@utils/tools';
+import { getAllDataList, getAllDataStringList,dragBox } from '@utils/tools';
 import style from "./index.less";
 import PreviewBody from "../PreviewBody";
 import store from '@store';
@@ -11,6 +11,9 @@ class PrintPreview extends Component {
     constructor(props) {
         super(props)
     }
+    componentDidMount(){
+      dragBox('previewPrintWrapper','previewPrintStatic')
+    }
     render() {
         const { onClose, visible, preInfo,save } = this.props;
         let baseList = store.getState();
@@ -19,8 +22,8 @@ class PrintPreview extends Component {
 
         return <div className={style['container']} style={visible ? { display: 'block' } : { display: 'none' }}>
             <div className={style['shade']} onClick={onClose}></div>
-            <div className={style['modal']}>
-                <div className={style['close']}>打印<img src={close} onClick={onClose} /></div>
+            <div className={style['modal']} id="previewPrintWrapper">
+                <div id="previewPrintStatic" className={`${style['close']} drag-title`}>打印<img src={close} onClick={onClose} /></div>
                   <PreviewBody
                       preInfo={preInfo}
                       dataJson={dataJson}

+ 4 - 2
src/components/PrintPreview/index.less

@@ -18,8 +18,10 @@
       position: fixed;
       left: 50%;
       margin-left: -410px;
-      top: 65px;  
-      bottom: 65px;
+      top: 7%;  
+      bottom: 7%;
+      height: 86%;
+      overflow: hidden;
     }
     .close { 
       padding:  15px 15px 15px 20px;

+ 12 - 8
src/components/PushItems/DetailsModal/index.jsx

@@ -4,6 +4,7 @@ import NewPortal from './NewPortal'
 import close from "./../img/close.png";
 import $ from "jquery";
 import { imageUrlPrefix } from '@utils/config.js';
+import { dragBox } from '@utils/tools';
 class DetailsModal extends Component {
     constructor(props) {
         super(props);
@@ -12,6 +13,9 @@ class DetailsModal extends Component {
         }
         this.hideTips = this.hideTips.bind(this)
     }
+    componentDidMount(){
+      dragBox('detailsContentWrap','detailsContentTitle')
+    }
     hideTips() {
         const { hideTips } = this.props;
         hideTips && hideTips();
@@ -46,15 +50,14 @@ class DetailsModal extends Component {
         }
     }
     
-    
-
     render() {
         const {showTipsDetails, tipsDetails} = this.props;
         const { currentIndex } = this.state
-        return (<NewPortal visible={showTipsDetails}>
-        <div className={styles['details-wrapper']}>
-           <div className={styles['details-content-wrapper']}>
-                <h1 className={styles['details-content-name']} >{tipsDetails && tipsDetails.tagName} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
+        const domNode = document.getElementById('root');
+        return showTipsDetails && ReactDOM.createPortal(
+          <div className={styles['details-wrapper']}>
+           <div className={styles['details-content-wrapper']} id="detailsContentWrap">
+                <h1 id="detailsContentTitle" className={`${styles['details-content-name']} drag-title`} >{tipsDetails && tipsDetails.tagName} <img className={styles['details-close']} onClick={this.hideTips} src={close} /></h1>
                 <div className={styles['details-content']} id= 'detailsContent' onScroll={this.handleScrollModal.bind(this, tipsDetails)}>
                     {tipsDetails && tipsDetails.introduceDetailList && tipsDetails.introduceDetailList.map((item, index) => {
                         return (<div id={item.title}>
@@ -85,8 +88,9 @@ class DetailsModal extends Component {
            </div>
            <div className={styles['details-mask']} onClick={this.hideTips}>
            </div>
-        </div>
-    </NewPortal>)
+        </div>,
+          domNode
+      )
     }
 }
 

+ 1 - 4
src/components/Treat/DrugTreat/index.jsx

@@ -74,16 +74,13 @@ class DrugTreat extends Component {
         const drugIdList = this.state.drugIdList.split(' ')
         setDrugInfoMore({drugIdList: drugIdList})
         showDrugInfo && showDrugInfo();
-
     }
+    
     showTreatDesc() {
         $('#treatDescBox').css({'display': 'block'});
         $('#treatWrapper').animate({'margin-left': '-471px','left':'50%'}, 300);
         $('#treatDescBox').animate({'width': '260px'}, 500);
-        
     }
-    
-
 
     render(){
         const { treatment,showDrugInfo } = this.props

+ 3 - 1
src/containers/MainSuit.js

@@ -14,6 +14,7 @@ import {Notify} from '@commonComp';
 import {getInitModules} from '@store/async-actions/homePage.js';
 import {CURRENT_CHRONIC} from '@store/types/currentIll';
 import {SET} from '@types/checkBody';
+import {SHOW_REFER_RECORD} from '@store/types/diagnosticList';
 
 function mapStateToProps(state) {//console.log(11,state);
   return {
@@ -203,7 +204,8 @@ function mapDispatchToProps(dispatch) {
         // 模板回来关闭;loading
         dispatch({type:MODI_LOADING,flag:false});
         // 弹窗是否引用历史病例?
-        dispatch({type:SHOW_HISTORY_BOX});
+        // dispatch({type:SHOW_HISTORY_BOX});
+        dispatch({type:SHOW_REFER_RECORD});
 
       },
       pureSaveChronic(item){//引用病例时储存

+ 26 - 26
src/store/actions/pushMessage.js

@@ -201,33 +201,33 @@ export const addBilling = (state, action) => {
 		item.checked = false
 		return item
 	})
-	// res.advice.assay = res.advice.assay || '';
-	// res.advice.check = res.advice.check || '';
-	// for (let i = 0; i < assay.length; i++) {
-	// 	if ( res.advice.assay === '') { //如果最后一个,则不需要逗号
-	// 		res.advice.assay = res.advice.assay + assay[i].name
-	// 	} else {
-	// 		if( i === 0 && res.advice.check !== '') {
-	// 			res.advice.assay = res.advice.assay  +  assay[i].name
-	// 		} else {
-	// 			res.advice.assay = res.advice.assay + ', ' + assay[i].name
-	// 		}
-	// 	}
+	res.advice.assay = res.advice.assay || '';
+	res.advice.check = res.advice.check || '';
+	for (let i = 0; i < assay.length; i++) {
+		if ( res.advice.assay === '') { //如果最后一个,则不需要逗号
+			res.advice.assay = res.advice.assay + assay[i].name
+		} else {
+			if( i === 0 && res.advice.check !== '') {
+				res.advice.assay = res.advice.assay  +  assay[i].name
+			} else {
+				res.advice.assay = res.advice.assay + ', ' + assay[i].name
+			}
+		}
 		
-	// }
-	// for (let i = 0; i < check.length; i++) {
-	// 	if ( res.advice.check === '') { //如果最后一个,则不需要逗号
-	// 		res.advice.check = res.advice.check + check[i].name
-	// 	} else {
-	// 		res.advice.check = res.advice.check + ', '+ check[i].name 
-	// 	}
-	// }
-	// if(res.advice.assay  && res.advice.check !== '') {
-	// 		if(res.advice.assay.substring(res.advice.assay.length-2,res.advice.assay.length-1) !== ',') {
-	// 			res.advice.assay = res.advice.assay + ', '
-	// 		} 
-	// }
-	// res.AdviceStr = getAdviceStr(res.advice)
+	}
+	for (let i = 0; i < check.length; i++) {
+		if ( res.advice.check === '') { //如果最后一个,则不需要逗号
+			res.advice.check = res.advice.check + check[i].name
+		} else {
+			res.advice.check = res.advice.check + ', '+ check[i].name 
+		}
+	}
+	if(res.advice.assay  && res.advice.check !== '') {
+			if(res.advice.assay.substring(res.advice.assay.length-2,res.advice.assay.length-1) !== ',') {
+				res.advice.assay = res.advice.assay + ', '
+			} 
+	}
+	res.AdviceStr = getAdviceStr(res.advice)
 	return res;
 }
 export const clearAllPushMessage = (state, action) => {

+ 3 - 4
src/store/async-actions/homePage.js

@@ -39,10 +39,9 @@ export const getInitModules= (dispatch,getStore)=>{
   const param = {
     age:message.patientAge,
     sexType:message.sex,
-    mouduleType:chronicId?2:(message.hospitalDeptId?1:0),//慢病2  科室1 其他0
-    relationId:chronicId?chronicId:(message.hospitalDeptId?message.hospitalDeptId:0), //慢病id  科室id  其他0
-    // mouduleType:2,
-    // relationId:21773, //慢病id  科室id  其他0
+    mouduleType:chronicId?2:(message.selfDeptId?1:0),//慢病2  科室1 其他0
+    // relationId:chronicId?chronicId:(message.hospitalDeptId?message.hospitalDeptId:0), //慢病id  科室id  其他0
+    relationId:chronicId?chronicId:(message.selfDeptId?message.selfDeptId:0), //慢病id  科室id  其他0
   }
   // return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
   return json(api.getModules,param).then((res) => {

+ 3 - 4
src/store/async-actions/pushMessage.js

@@ -115,9 +115,8 @@ export const getTipsDetails = () => {
 
         //弹窗显示
         const url ='/introduceInfo/getByQuestionId'
-        
         const params = {
-            type: 7,
+            type: state.diagnosticList.clickDiag.type,
             questionId: state.diagnosticList.clickDiag.id,
             position:2
         }
@@ -138,7 +137,7 @@ export const getTableList = (id)=>{
     return (dispatch,getState)=>{
         json(api.getTableList, {disId:id})
         .then((res)=>{
-            if(res.data.code==0){
+            if(res.data.code==0 && res.data.data && res.data.data.length>0){
                 dispatch({
                     type: SET_CHRONIC_TABLELIST,
                     data: res.data.data
@@ -149,7 +148,7 @@ export const getTableList = (id)=>{
                     value:true
                 })
             }else{
-                Notify.info(res.data.msg)
+                Notify.info(res.data.msg||'无关联量表')
             }
         }).catch((e) => {
             console.log(e)

+ 6 - 4
src/utils/tools.js

@@ -772,11 +772,11 @@ function getPageLength(event) {     //兼容ie8获取页面距离左和上的距
   return page;
 }
 function dragBox(domWrap,domDrag){
-  console.log(domWrap,domDrag,'拖拽')
+  // console.log(domWrap,domDrag,'拖拽')
   let drag = document.getElementById(domDrag);//拖拽区域
   let wrap = document.getElementById(domWrap);//被拖拽的元素
   let wrapHeight = wrap.offsetHeight;//被拖拽的元素高度
-  let wrapWidth = wrap.offsetWidth;//被拖拽的元素
+  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;
@@ -797,14 +797,15 @@ function dragBox(domWrap,domDrag){
     // }
     isDrag = false
     return false
-  },drag)
+  },document)
 
   function handleMove(event){      //移动的
     let dragDes = document.getElementById('treatDescBox');//展開区域
     let page = getPageLength(event);
     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
@@ -829,6 +830,7 @@ function dragBox(domWrap,domDrag){
           dragX = maxDragX
         }
       }else{
+        // console.log(width,dragX,maxDragX,wrapWidth)
         if(width-dragX < wrapWidth){    //不能超出右边界
           dragX = maxDragX
         }