Browse Source

Merge branch 'lcq' into newVersion6.0

morphone1995 4 years ago
parent
commit
7ed9af15f9

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

@@ -78,6 +78,7 @@ class BlockEMRCont extends Component {
           {/* 婚育史 */}
           <MarriageHistory></MarriageHistory>
           {/* 月经史 */}
+
           <MenstruationHistory></MenstruationHistory>
           {/* <OtherHistory></OtherHistory> */}
           <CheckBody></CheckBody>

+ 5 - 0
src/components/PushEmbed/index.jsx

@@ -2,6 +2,7 @@ import React,{Component} from 'react';
 import {windowEventHandler,getWindowInnerHeight} from '@utils/tools';
 import {connect} from 'react-redux';
 import {pushPage} from '@utils/config';
+import store from '@store';
 
 class PushEmbed extends Component{
   constructor(props){
@@ -28,8 +29,12 @@ class PushEmbed extends Component{
     }
   }
   render(){
+
     const {width,height,hashNum}=this.state;
     const {mrId} = this.props;
+    let baseList = store.getState();
+    console.log(1111111111111111);
+    // console.log(baseList,'baseList');
     const url = pushPage+"?mrId="+mrId+"&plan=1&data="+hashNum;
     return <iframe id='embedPage' width={width} height={height} src={url} frameborder="0"></iframe>;
   }

+ 1 - 0
src/containers/AssistCheck.js

@@ -79,6 +79,7 @@ function mapDispatchToProps(dispatch, store) {
         },
         //右侧推送
         fetchPushInfos(obj){
+          obj.action = 'pacs'
           //调右侧推送
           dispatch(embedPush(obj));
         },

+ 44 - 8
src/containers/BlockInpContainer.js

@@ -21,17 +21,45 @@ function mapStateToProps(state){
   }
 }
 
-const actionsType={
-  '1':SETTEXTMODEVALUE,
-  '2':SETCURRENTTEXTMODEVALUE,
-  '3':SETOTHERTEXTMODEVALUE,
-  '4':SETCHECKTEXTMODEVALUE,
+const actionsType = {
+  '1': SETTEXTMODEVALUE, // 主述
+  '2': SETCURRENTTEXTMODEVALUE, // 现病史
+  // '3': SETOTHERTEXTMODEVALUE,  // 其他史
+  '4': SETCHECKTEXTMODEVALUE,   // 查体
   '13': SETPASTTEXTMODEVALUE, // 设置既往史
   '14': SETPERSONALTEXTMODEVALUE, // 设置个人史
   '15': SETFAMILYTEXTMODEVALUE, // 设置家族史
   '16': SETMARRIAGETEXTMODEVALUE, // 设置婚育史
   '17': SETMENSTRUATIONTEXTMODEVALUE, // 设置月经史
 };
+
+const formatMode = mode => {
+  switch (mode) {
+    case '0':
+      return 'patientia'; // 非空切非输入状态
+    case '1':
+      return 'chief'; // 主述
+    case '2':
+      return 'symptom'; // 现代史
+    case '4':
+      return 'vital'; // 现代史
+    case '13':
+      return 'other'; //其他史
+    case '14':
+      return 'other'; //其他史
+    case '15':
+      return 'other'; //其他史
+    case '16':
+      return 'other'; //其他史
+    case '17':
+      return 'other'; //其他史
+    default:
+      return 'null';
+  }
+};
+
+
+
 function mapDispatchToProps(dispatch){
   return {
     handleInput(obj){   //自由模式值保存
@@ -42,13 +70,21 @@ function mapDispatchToProps(dispatch){
     },
     handlePush(obj={}){
       const {boxMark,isFocus,state} = obj;
+      // console.log(boxMark, 'boxMark盒子标记');
       const notClear=state?isAllClear(getAllDataStringList(state)):false;
-      if(isFocus&&(boxMark==='1'||boxMark==='2')&&!notClear){
-        dispatch(embedPush({mode:+boxMark+1}));
+      // if(isFocus&&(boxMark==='1'||boxMark==='2')&&!notClear){
+      //   // dispatch(embedPush({mode:+boxMark+1}));
+      //   dispatch(embedPush({ mode: +boxMark + 1, action: formatMode(boxMark) }));
+      //   return;
+      // }
+      if (isFocus && !notClear) {
+        // dispatch(embedPush({mode:+boxMark+1}));
+        dispatch(embedPush({ mode: +boxMark + 1, action: formatMode(boxMark) }));
         return;
       }
       if(!isFocus&&didPushParamChange()) {    //输入的情况
-        dispatch(embedPush({mode:+boxMark+3}));
+        // dispatch(embedPush({mode:+boxMark+3}));
+        dispatch(embedPush({ mode: +boxMark + 100, action: formatMode(boxMark) }));
       }
     }
   }

+ 1 - 0
src/containers/DiagnosticList.js

@@ -108,6 +108,7 @@ function mapDispatchToProps(dispatch) {
         },
         getBilling: (obj) => {
           if (didPushParamChange()) {
+            obj.action ='diag'
             dispatch(embedPush(obj))
           }
         },

+ 1 - 0
src/containers/Inspect.js

@@ -104,6 +104,7 @@ function mapDispatchToProps(dispatch) {
     },
     //右侧推送
     fetchPushInfos(obj) {
+      obj.action = 'lis'
       //调右侧推送
       dispatch(embedPush(obj));
     },

+ 1 - 0
src/containers/NewAdvice.js

@@ -104,6 +104,7 @@ function mapDispatchToProps(dispatch) {
     },
     //右侧推送
     fetchPushInfos(obj) {
+      obj.action = 'doc_advice'
       //调右侧推送
       dispatch(embedPush(obj));
     },

+ 5 - 2
src/store/actions/print.js

@@ -1,3 +1,5 @@
+
+
 export const showPrintPreview=(state,action)=>{
   const res=Object.assign({},state);
   res.visible = true
@@ -39,11 +41,12 @@ export const clearSearchParam=(state,action)=>{
   res.clearSearch = action.data;
   return res;
 };
-
+// 推送保存mrid信息
 export const setMrId=(state,action)=>{
   const res=Object.assign({},state);
   const {update} = res.mrInfo;
   res.mrInfo.update = +update+1;
-  res.mrInfo.mrId = action.data;
+  res.mrInfo.mrId = action.data.data;
+  res.mrInfo.mode = action.data.action;
   return res;
 };

+ 8 - 6
src/store/async-actions/pushMessage.js

@@ -24,17 +24,19 @@ const api={
 
 export const embedPush = (obj) => {      //内嵌页面推送时推送
   return (dispatch, getState) =>{
-    //const state = getState();
-    //console.log(state)
-    const param = getEMRParams();
-    param.mode=obj?obj.mode:-1;
+    console.log(obj,'推送的obj');
+    const param = getEMRParams();   // 获取推送参数
+    param.mode=obj?obj.mode:-1;    // 模式  >100 输入中    < 100  获取
     json(api.setMrInfo,param,true).then((res)=>{
+      // console.log(res,'======推送的结果');
       const data = res.data;
       if(data.code==='0'){
         //存mrId
+        let params = data;
+        params.action = obj.action
         dispatch({
-          type:SET_MR_INFO,
-          data:data.data
+          type: SET_MR_INFO,
+          data: params,
         });
       }
     });

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

@@ -11,7 +11,8 @@ const initState = {
   clearSearch:0,
   mrInfo:{
     update:0,
-    mrId:''
+    mrId:'',
+    mode: ''
   }
 };
 export default function(state = initState, action) {