Forráskód Böngészése

引用历史病历时切换相应模式

liucf 6 éve
szülő
commit
ae5da2b44f
1 módosított fájl, 14 hozzáadás és 6 törlés
  1. 14 6
      src/components/DiagnosticList/index.jsx

+ 14 - 6
src/components/DiagnosticList/index.jsx

@@ -13,6 +13,7 @@ import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
 import tableIcon from '@common/images/table.png';
 import { delFollowUp } from '../../store/actions/treat';
+import { CONFIRM_TYPE } from "@store/types/typeConfig";
 
 class DiagnosticList extends Component {
     constructor(props) {
@@ -21,7 +22,8 @@ class DiagnosticList extends Component {
             visible: false,
             delItem: {},
             treatTitle: '',
-            activeHistory: -1
+            activeHistory: -1,
+            sign:-1
         }
         this.deleteItem = this.deleteItem.bind(this);
         this.cancel = this.cancel.bind(this);
@@ -122,6 +124,7 @@ class DiagnosticList extends Component {
     }
     referCase() {
         const { hideHistoryCaseModal, items ,autoFillModules,typeConfig} = this.props
+        const {sign} = this.state;
         hideHistoryCaseModal && hideHistoryCaseModal()
         if (this.state.activeHistory === -1 && typeConfig==0) {//没有选择历史病例直接点确定
             Notify.info("未选择历史病历,已默认展示慢病相关内容");
@@ -134,18 +137,22 @@ class DiagnosticList extends Component {
         let baseList = store.getState();
         
         let baseObj = items[this.state.activeHistory];
-  
-        // store.dispatch({type: CONFIRM_TYPE, confirmType: baseObj.sign});
+        // 切换模式
+        if(sign != typeConfig){
+          store.dispatch({type: CONFIRM_TYPE, confirmType: baseObj.sign});
+        }
         pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
         this.props.getBilling();
         this.setState({
-            activeHistory: -1
+            activeHistory: -1,
+            sign:-1
         })
     }
     closeHistoryCaseModal() {
         const { hideHistoryCaseModal ,autoFillModules,typeConfig} = this.props
         this.setState({
-            activeHistory: -1
+            activeHistory: -1,
+            sign:-1
         })
         hideHistoryCaseModal && hideHistoryCaseModal()
         if(typeConfig==0){//智能推送模式才自动填充
@@ -156,7 +163,8 @@ class DiagnosticList extends Component {
         const { handleQuoteClick } = this.props
         // handleQuoteClick && handleQuoteClick(item)
         this.setState({
-            activeHistory: index
+            activeHistory: index,
+            sign:item.sign
         })
     }
     getHistoryCase() {