zhangxc 6 lat temu
rodzic
commit
729195f888

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

@@ -22,6 +22,9 @@ class DiagnosticList extends Component {
         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);
     }
 
     componentWillReceiveProps(nextprops) {
@@ -78,18 +81,33 @@ class DiagnosticList extends Component {
         getTips && getTips(item);
     }
     referRecord() {
-        const { hideReferRecord } = this.props
+        const { hideReferRecord, showHistoryCaseModal } = this.props
         hideReferRecord && hideReferRecord()
+        showHistoryCaseModal && showHistoryCaseModal()
+
     }
     noReferRecord() {
         const { hideReferRecord } = this.props
         hideReferRecord && hideReferRecord()
     }
+    referCase() {
+        const { hideHistoryCaseModal } = this.props
+        hideHistoryCaseModal && hideHistoryCaseModal()
+    }
+    closeHistoryCaseModal() {
+        const { hideHistoryCaseModal } = this.props
+        hideHistoryCaseModal && hideHistoryCaseModal()
+    }
+    getHistoryCase() {
+        return (<div className={style['history-info']}>
+
+        </div>)
+    }
     
     
 
     render(){
-        const { list, treatment, showReferRecord } = this.props
+        const { list, treatment, showReferRecord, showHistoryCase } = this.props
         const { visible, treatTitle } = this.state
         const lastIndex = list.length -1;
         return(
@@ -123,6 +141,10 @@ class DiagnosticList extends Component {
                     <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}>
+                        {this.getHistoryCase}
+                        <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
+                    </ConfirmModal>
                 </div>
                
             

+ 13 - 0
src/components/DiagnosticList/index.less

@@ -108,4 +108,17 @@
     line-height: 16px;
     text-align: center;
     padding: 10px 30px;
+}
+.confirm-history {
+    height: 50px;
+    position: relative;
+}
+.confirm-history-btn {
+    border: 1px solid #000;
+    padding: 5px 10px;
+    position: absolute;
+    right: 15px;
+}
+.history-info {
+
 }

+ 13 - 1
src/containers/DiagnosticList.js

@@ -1,7 +1,7 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
-import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD } from '@store/types/diagnosticList'; 
+import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE } from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
 import { SHOW_TREAT } from '../store/types/treat';
 import {billing, getTips} from '../store/async-actions/pushMessage';
@@ -15,6 +15,7 @@ function mapStateToProps(state) {
         isFirst: state.diagnosticList.isFirst,
         diagnosticStr: state.diagnosticList.diagnosticStr,
         showReferRecord: state.diagnosticList.showReferRecord,
+        showHistoryCase: state.diagnosticList.showHistoryCase,
     }
 }
 
@@ -68,7 +69,18 @@ function mapDispatchToProps(dispatch) {
             dispatch({
                 type: HIDE_REFER_RECORD
             })
+        },
+        showHistoryCaseModal: ()=> {
+            dispatch({
+                type: SHOW_HISTORY_CASE
+            })
+        },
+        hideHistoryCaseModal: ()=> {
+            dispatch({
+                type: HIDE_HISTORY_CASE
+            })
         }
+        
     }
 }
 

+ 11 - 0
src/store/actions/diagnosticList.js

@@ -99,4 +99,15 @@ export const hideReferRecord = (state, action) => {
     const res = Object.assign({}, state);
     res.showReferRecord = false
     return res;
+}
+
+export const showHistoryCase = (state, action) => {
+    const res = Object.assign({}, state);
+    res.showHistoryCase = true
+    return res;
+}
+export const hideHistoryCase = (state, action) => {
+    const res = Object.assign({}, state);
+    res.showHistoryCase = false
+    return res;
 }

+ 7 - 2
src/store/reducers/diagnosticList.js

@@ -1,7 +1,8 @@
 import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, SET_TREAT, GET_DIAGNOSTIC_STR, SET_DIAG_TO_MAINSUIT, 
-            GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG ,CLEAR_DIAGNOSE, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD, HIDE_REFER_RECORD} from '../types/diagnosticList';
+            GET_IS_FIRST,CLEAR_ALL_DIAG, SET_CLICK_DIAG ,CLEAR_DIAGNOSE, SET_CHRONIC_MAG_ITEM, SHOW_REFER_RECORD, HIDE_REFER_RECORD, 
+            SHOW_HISTORY_CASE,  HIDE_HISTORY_CASE} from '../types/diagnosticList';
 import { addDiagnostic,  delDiagnostic, upDiagnostic, downDiagnostic, setTreat, getDiagnosticStr, setDiagToMainSuit, 
-        getIsFirst,clearAllDiag, setClickDiag, setChronicMagItem, showReferRecord, hideReferRecord} from '../actions/diagnosticList';
+        getIsFirst,clearAllDiag, setClickDiag, setChronicMagItem, showReferRecord, hideReferRecord, showHistoryCase, hideHistoryCase} from '../actions/diagnosticList';
 
 const initState = {
     isFirst: true,
@@ -66,6 +67,10 @@ export default function (state=initState, action) {
             return showReferRecord(state, action);
         case HIDE_REFER_RECORD: 
         return hideReferRecord(state, action);
+        case SHOW_HISTORY_CASE: 
+            return showHistoryCase(state, action);
+        case HIDE_HISTORY_CASE: 
+        return hideHistoryCase(state, action);
         case CLEAR_DIAGNOSE: 
             res.mainSuitStr = "";
             return res;

+ 2 - 0
src/store/types/diagnosticList.js

@@ -13,5 +13,7 @@ export const CLEAR_DIAGNOSE = 'CLEAR_DIAGNOSE' //
 export const SET_CHRONIC_MAG_ITEM = 'SET_CHRONIC_MAG_ITEM'  //设置慢病信息
 export const SHOW_REFER_RECORD = 'SHOW_REFER_RECORD'  //显示引用历史病历弹窗
 export const HIDE_REFER_RECORD = 'HIDE_REFER_RECORD'  //隐藏引用历史病历弹窗
+export const SHOW_HISTORY_CASE = 'SHOW_HISTORY_CASE'  //显示历史病历列表弹窗
+export const HIDE_HISTORY_CASE = 'HIDE_HISTORY_CASE'  //隐藏历史病历列表弹窗