Browse Source

历史病例状态提取

Luolei 6 years ago
parent
commit
441edfced0

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

@@ -34,8 +34,8 @@ class ComplexModal extends Component {
         <div className={`${style['close']} drag-title`} id="dragModalTitle">
           {icon?<img src={icon} />:''}
           {title}
-          <img src={close} onClick={onclose} className={style['closeIcon']}/>
         </div>
+        <img src={close} onClick={onclose} className={style['closeIcon']}/>
         <div className={style["content"]} style = {{width: width?width:'auto'}}>{children}</div>
         <div className={style['footer']} style = {{width: width?width:'auto'}}>{footer}</div>
       </div>

+ 10 - 8
src/common/components/ComplexModal/index.less

@@ -51,14 +51,16 @@
     position: absolute;
     top:0;
     width: 100%;
-    img{
-      vertical-align: text-top;
-    }
-    .closeIcon{
-      float:right;
-      cursor: pointer;
-      margin-top: -5px;
-    }
+  }
+  img{
+    vertical-align: text-top;
+  }
+  .closeIcon{
+    cursor: pointer;
+    position: absolute;
+    top: 14px;
+    right: 10px;
+    z-index: 100;
   }
 }
 

+ 2 - 1
src/common/components/WrapModalContainer/index.jsx

@@ -17,7 +17,8 @@ class WrapModalContainer extends React.Component {
     return ReactDom.createPortal(<div className={style['container']}>
       <div className={style['shade']} onClick={onClose}></div>
       <div className={style['modal']} id="previewWrapper" style={{width:width+'px',marginLeft:(-width/2)+'px',height:height,marginTop:(-height/2)+'px'}}>
-        <div id="previewStatic" className={`${style['close']} drag-title`}>{title}<img src={close} onClick={onClose} /></div>
+        <div id="previewStatic" className={`${style['close']} drag-title`}>{title}</div>
+        <img src={close} onClick={onClose} />
         {children}
       </div>
     </div>,domNode)

+ 7 - 5
src/common/components/WrapModalContainer/index.less

@@ -38,10 +38,12 @@
     top: 0;
     background-color: #fff;
     z-index: 10;
-    img{
-      float:right;
-      cursor: pointer;
-      margin-top: 10px;
-    }
+  }
+  img{
+    cursor: pointer;
+    position: absolute;
+    top: 10px;
+    right: 10px;
+    z-index: 100;
   }
 }

+ 2 - 1
src/components/CopyRight/CopyModalSon/index.jsx

@@ -20,7 +20,8 @@ class DiscontentSon extends Component {
       >
         <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["header"]} drag-title`} id="CopyModalTitle">版本信息</div>
+          <img src={close} onClick={closeCopyModal} />
           <div className={style["now"]}>
             当前版本:{number}
             <span>{date && date.substring(0, 10)}</span>

+ 2 - 1
src/components/CopyRight/DiscontentSon/index.jsx

@@ -20,7 +20,8 @@ class DiscontentSon extends Component {
         >
           <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["header"]} drag-title`} id="DisclatmerTitle">免责声明</div>
+            <img src={close} onClick={closeDisclatmerModal} />
             <div className={style["content"]}>{disclatmerContent}</div>
             <div className={style["btnBox"]}><span  className={style["btn"]} onClick={closeDisclatmerModal}>确定</span></div>
           </div>

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

@@ -59,16 +59,20 @@
         height: 60%;
         padding: 80px 0 40px;
         img{
-          float: right;
-          margin: -5px 5px 0px 0px;
           cursor: pointer;
+          position: absolute;
+          right: 10px;
+          top: 7px;
+          z-index: 100;
         }
         .header {
           position: absolute;
           width: 100%;
           top: 0;
           font-size: 14px;
-          padding: 10px 0px 10px 10px;
+          height: 40px;
+          line-height: 40px;
+          padding: 0 20px;
           border-bottom: 1px solid #EAEDF1;
         }
         .now{
@@ -101,17 +105,20 @@
         top: 20%;
         padding: 40px 0 60px 0;
         img{
-          float: right;
-          margin: -5px 5px 0px 0px;
           cursor: pointer;
+          position: absolute;
+          right: 10px;
+          top: 7px;
+          z-index: 100;
         }
         .header {
           position: absolute;
           top: 0px;
           width: 100%;
           height: 40px;
+          line-height: 40px;
           font-size: 14px;
-          padding: 10px 0px 10px 20px;
+          padding: 0 20px;
           background: #fff;
           width: 100% ;
           border-bottom: 1px solid #EAEDF1;

+ 89 - 16
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -6,30 +6,89 @@ import sort from "./img/sort.png"
 import close from "./img/close.png";
 import PreviewBody from '@components/PreviewBody';
 import Empty from '@components/Empty'
+import { pushAllDataList,didPushParamChange } from '@utils/tools';
 import { dragBox } from '@utils/drag';
+import $ from 'jquery';
+import { ConfirmModal } from '@commonComp';
+import {showHistory} from "@store/actions/historyTemplates";
+import { CONFIRM_TYPE } from "@store/types/typeConfig";
+import {billing} from '@store/async-actions/pushMessage';
 
 
 class HistoryCaseContainer extends React.Component {
     constructor(props){
         super(props);
+        this.state = {
+          activeHis:{},//预览数据
+          activeId:'0',
+          dataStr:[],
+          dataJson:{},
+          visible:false
+        }
         this.handleCaseClick=this.handleCaseClick.bind(this)
+        this.handleQuoteClick=this.handleQuoteClick.bind(this)
+        this.close = this.close.bind(this);
+        this.makeSure = this.makeSure.bind(this);
     }
     componentDidMount(){
       dragBox('hisWrapMove','closeHis','add')
+      this.handleCaseClick(0)
+      this.setState({
+        visible:false
+      })
     }
-    handleCaseClick(e,idx){ 
-      const {handleCaseClick} = this.props
-      handleCaseClick&&handleCaseClick(e,idx)
+    handleCaseClick(idx){
+      const {items} = this.props;
+      let tmpItems = []
+      $("#hislistLeft li").eq(idx).css({
+        background:'#fff'
+      }).siblings().css({
+        background:'#d2d1d1'
+      })
+      if(items.length == 0){
+        return
+      }else{
+        tmpItems=items[idx]
+      }
+      console.log(tmpItems)
+      this.setState({
+        activeId:idx,
+        activeHis:tmpItems,
+        dataStr:tmpItems.detailList||[],
+        dataJson:JSON.parse(tmpItems.dataJson)||{},
+      })
     }
-    render(){
-        const { items,handleCaseClick,handleQuoteClick,handleSortClick,showHistoryBox,activeHistory,preInfo } = this.props;
-        let baseList = store.getState();
-        let baseObj = baseList.historyTemplates.activeHistory;
-        let dataJson,dataStr;
-        if(baseObj){
-            dataJson = JSON.stringify(baseObj) == "{}" ? {} : JSON.parse(baseList.historyTemplates.activeHistory.dataJson);
-            dataStr = JSON.stringify(baseObj) == "{}" ? [] : baseObj.detailList;
+    makeSure(){
+        const {activeHis} = this.state
+        this.setState({visible:false})
+        store.dispatch(showHistory(false))
+        store.dispatch({type: CONFIRM_TYPE, confirmType: activeHis.sign});
+        pushAllDataList(activeHis.sign,'push',activeHis,'history')       //引用
+        if(didPushParamChange()){
+          store.dispatch(billing())
         }
+        const {handleQuoteClick} = this.props
+        handleQuoteClick&&handleQuoteClick()
+        dragBox('hisWrapMove','closeHis','del')
+    }
+    close(){
+      this.setState({
+        visible:false
+      })
+    }
+    handleQuoteClick(e,val,idx){
+      this.setState({
+        visible:true,
+        activeId:idx,
+        activeHis:val,
+        dataStr:val.detailList||[],
+        dataJson:JSON.parse(val.dataJson)||{},
+      })
+    }
+    render(){
+        const { items,handleSortClick,showHistoryBox,preInfo } = this.props;
+        const { activeHis,visible,dataJson,dataStr } = this.state;
+        
         const getAllDataStringList = () =>{           //获取所有模块文本的数据
             let jsonDataString = {};
             jsonDataString.lis = {};
@@ -53,10 +112,11 @@ class HistoryCaseContainer extends React.Component {
                         <span className={styles.sort} onClick={handleSortClick}>排序 <img src={sort} alt="排序"/></span>
                     </div>
                     <div className={styles.lists}>
-                        <ul>
+                        <ul id="hislistLeft">
                             {
                                 (items && items.length > 0)? items.map((val,idx)=>{
-                                    return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{this.handleCaseClick(e,idx)}}>
+                                    // return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{this.handleCaseClick(e,idx)}}>
+                                    return <li key={val.id} onClick={()=>{this.handleCaseClick(idx)}}>
                                         <span title={val.diagnose}>{val.diagnose}</span>
                                         {/* <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
                                         <button 
@@ -65,7 +125,7 @@ class HistoryCaseContainer extends React.Component {
                                         >引 用</button> */}
                                         <button 
                                             className={styles.quote} 
-                                            onClick={(e)=>{handleQuoteClick(e,val,idx)}}
+                                            onClick={(e)=>{this.handleQuoteClick(e,val,idx)}}
                                         >引 用</button>
                                         <span className={styles.time}>{val.inquiryDate}</span>
                                     </li>
@@ -76,12 +136,12 @@ class HistoryCaseContainer extends React.Component {
                 </div>
                 <div className={styles.mainHistoryRight}>
                     {
-                        baseObj == undefined || JSON.stringify(baseObj) == "{}" ? null :
+                        activeHis == undefined || JSON.stringify(activeHis) == "{}" ? null :
                         <PreviewBody
                             preInfo={preInfo}
                             showHistoryCases={this.props.showHistoryCases}
                             dataJson={dataJson}
-                            baseObj={baseObj}
+                            baseObj={activeHis}
                             dataStr={dataStr.length > 0?getAllDataStringList(dataStr):[]}
                             show={false}
                             flg={true}
@@ -89,6 +149,19 @@ class HistoryCaseContainer extends React.Component {
                         ></PreviewBody>
                     }
                 </div>
+                
+                <ConfirmModal
+                    visible={visible}
+                    confirm={this.makeSure}
+                    close={this.close}
+                    cancel={this.close}
+                    okText={"引用"}
+                    okBorderColor={'#3B9ED0'}
+                    okColor={'#fff'}
+                    oKBg={'#3B9ED0'}
+                >
+                    <p className={styles['center']}>确认引用该病历?</p>
+                </ConfirmModal>
             </div>
         )
     }

+ 7 - 1
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -116,4 +116,10 @@
       z-index: 9998;
       // border-bottom: 1px solid #EAEDF1;
     }
-}
+}
+.center {
+  text-align: center;
+  font-size: 16px;
+  padding-top: 10px;
+  padding-bottom: 50px;
+}

+ 0 - 36
src/components/HistoryCaseContainer/index.jsx

@@ -2,36 +2,12 @@ import React from 'react';
 import styles from './index.less';
 import ReactDom from "react-dom";
 import HistoryList from "./HistoryList";
-import {initItemList} from "@store/async-actions/historyTemplates";
-import {visibleHistory,showHistory} from "@store/actions/historyTemplates";
-import store from '@store';
-import { ConfirmModal } from '@commonComp';
-import { pushAllDataList,didPushParamChange } from '@utils/tools';
-import { CONFIRM_TYPE } from "@store/types/typeConfig";
-import {billing} from '@store/async-actions/pushMessage';
-import { dragBox } from '@utils/drag';
 
 class HistoryCaseContainer extends React.Component {
     constructor(props){
         super(props);
-        this.close = this.close.bind(this);
         this.showHistoryBox = this.showHistoryBox.bind(this);
     }
-    makeSure(){
-        let baseList = store.getState();
-        let baseObj = baseList.historyTemplates.activeHistory;
-        store.dispatch(visibleHistory(false))
-        store.dispatch(showHistory(false))
-        store.dispatch({type: CONFIRM_TYPE, confirmType: baseObj.sign});
-        pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
-        if(didPushParamChange()){
-          store.dispatch(billing())
-        }
-        dragBox('hisWrapMove','closeHis','del')
-    }
-    close(){
-      store.dispatch(visibleHistory(false));
-    }
     showHistoryBox(){   
       const {showHistoryBox} = this.props
       showHistoryBox&&showHistoryBox()
@@ -52,18 +28,6 @@ class HistoryCaseContainer extends React.Component {
                     handleSortClick={handleSortClick}
                     preInfo={preInfo}
                 ></HistoryList>
-                <ConfirmModal
-                    visible={visible}
-                    confirm={this.makeSure}
-                    close={this.close}
-                    cancel={this.close}
-                    okText={"引用"}
-                    okBorderColor={'#3B9ED0'}
-                    okColor={'#fff'}
-                    oKBg={'#3B9ED0'}
-                >
-                    <p className={styles['center']}>确认引用该病历?</p>
-                </ConfirmModal>
             </div>:null
         ,domNode)
     }

+ 0 - 1
src/components/Inspect/index.jsx

@@ -215,7 +215,6 @@ class Inspect extends React.Component {
           <div className={this.getStyle()} style={{ display: hospitalMsg.import_way_lis == 0 ? 'none' : 'block' }}>
             {/* <button disabled={ieVersion&&ieVersion>9?true:false}onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>导入化验结果</button>
             <input accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel" type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} /> */}
-
             {/* {0没有,1本地,2医院,3本地和医院} */}
             {
               hospitalMsg.import_way_lis == 1 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>

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

@@ -22,7 +22,8 @@ class Preview extends Component {
     return <div className={style['container']}>
       <div className={style['shade']} onClick={onClose}></div>
       <div className={style['modal']} id="previewWrapper">
-        <div id="previewStatic" className={`${style['close']} drag-title`}>预览<img src={close} onClick={onClose} /></div>
+        <div id="previewStatic" className={`${style['close']} drag-title`}>预览</div>
+        <img src={close} onClick={onClose} />
         <PreviewBody
             preInfo={preInfo}
             dataJson={dataJson}

+ 7 - 5
src/components/Preview/index.less

@@ -32,10 +32,12 @@
     position: absolute;
     width: 100%;
     top: 0;
-    img{
-      float:right;
-      cursor: pointer;
-      margin-top: 10px;
-    }
+  }
+  img{
+    cursor: pointer;
+    position: absolute;
+    right: 10px;
+    top: 10px;
+    z-index: 100;
   }
 }

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

@@ -24,7 +24,8 @@ class PrintPreview extends Component {
         return <div className={style['container']}>
             <div className={style['shade']} onClick={onClose}></div>
             <div className={style['modal']} id="previewPrintWrapper">
-                <div id="previewPrintStatic" className={`${style['close']} drag-title`}>打印<img src={close} onClick={onClose} /></div>
+                <div id="previewPrintStatic" className={`${style['close']} drag-title`}>打印</div>
+                <img src={close} onClick={onClose} />
                   <PreviewBody
                       preInfo={preInfo}
                       dataJson={dataJson}

+ 7 - 5
src/components/PrintPreview/index.less

@@ -32,11 +32,13 @@
       position: absolute;
       width: 100%;
       top: 0;
-      img{
-        float:right;
-        cursor: pointer;
-        margin-top: 10px;
-      }
+    }
+    img{
+      cursor: pointer;
+      position: absolute;
+      top: 10px;
+      right: 10px;
+      z-index: 100;
     }
     .button {
         position: fixed;

+ 1 - 1
src/containers/HistoryCases.js

@@ -27,7 +27,7 @@ function mapDispatchToProps(dispatch) {
             dispatch(activeHistory(val))
         },
         handleQuoteClick(e,data,idx){
-            e.stopPropagation();
+            // e.stopPropagation();
             dispatch(keepPushData(data,'his'))      //历史病历引用
             dispatch(activeHistory(idx))
             dispatch(visibleHistory(true))

+ 2 - 2
src/store/reducers/historyTemplates.js

@@ -8,9 +8,9 @@ import {
 
 
 const initHistoryList = {
-    showHistoryCases: false,     //历史病历显示隐藏
+    showHistoryCases: false,//历史病历显示隐藏
     visible:false,
-    activeHistory:{},     //需要显示的病例
+    activeHistory:{},//需要显示的病例
     items: []
 }