Explorar el Código

预问诊信息获取失败处理

luolei hace 5 años
padre
commit
a0d16b96ce

+ 6 - 4
src/modules/HomePage/index.jsx

@@ -4,6 +4,7 @@ import BannerContainer from '@containers/TypeConfigContainer';
 //  引入组件
 import BodyContainer from "@components/BodyContainer";
 import {ConfirmModal} from '@commonComp';
+import store from '@store';
 
 import {HIDEDROP,SETMINSCREEN,SETSYSTEMCONFIG,SETPRE} from '@store/types/homePage.js';
 import {CLEAR_SEARCH} from '@types/mainSuit';
@@ -13,7 +14,7 @@ import {CHECKBODY_CLEAR} from '@types/checkBody';
 import style from './index.less';
 import {getInitModules,getChronic,getSystemConfig} from '@store/async-actions/homePage.js';
 import {getPreMsg} from '@store/async-actions/patInfo.js';
-import { getUrlArgObject,parseNameVal } from "@utils/tools";
+import { getUrlArgObject,parseNameVal,pushAllDataList } from "@utils/tools";
 import $ from 'jquery';
 import loading from '@common/images/loading.gif';
 class HomePage extends Component {
@@ -90,9 +91,10 @@ const mapStateToProps = function (state) {
   }
 };
 const mapDispatchToProps = function (dispatch) {
-    return {
-      referRecord(){
-        getPreMsg(dispatch)
+  return {
+    referRecord(){
+        pushAllDataList(1,'push',store.getState().homePage.preData,'preIcss');
+        dispatch({type:SETPRE,show:false});
       },
       noReferRecord(){
         dispatch({type:SETPRE,show:false});

+ 8 - 5
src/store/async-actions/patInfo.js

@@ -5,9 +5,10 @@ import {getInfos} from '@store/actions/getInfoByUuid';
 import {getUrlArgObject,pushAllDataList} from '@utils/tools';
 import {getInitModules,getCommonList} from '@store/async-actions/homePage.js';
 import store from '@store'
-import {ISREAD,MODI_LOADING,SETPRE} from "../types/homePage";
+import {ISREAD,MODI_LOADING,SETPRE,SETPREDATA} from "../types/homePage";
 import { initItemList } from '@store/async-actions/tabTemplate';
 import config from '@config/index';
+import {Notify} from '@commonComp';
 
 const api = {
     getPatInfo: '/patientInfo/getTopPatientInfo',
@@ -34,10 +35,10 @@ export const getPreMsg = (dispatch, getState) => {
               other:result.qts?new Array(result.qts):[],
               checkBody:result.supplement?result.supplement:''
             }
-            pushAllDataList(1,'push',preIcss,'preIcss');
-            dispatch({type:SETPRE,show:false});
+            dispatch({type:SETPRE,show:true});
+            dispatch({type:SETPREDATA,preData:preIcss});
         } else {
-            console.log(res)
+            // console.log(res)
         }
     })
 }
@@ -93,7 +94,9 @@ export const initHistoryDetails = (dispatch) => {
                   pushAllDataList(detail.sign,'push',detail,'history');
                 }else{
                   let pre = baseList.homePage.sysConfig.connect_prec;
-                  (pre==1)&&dispatch({type:SETPRE,show:true});
+                  getPreMsg(dispatch)
+                  // (pre==1)&&dispatch({type:SETPRE,show:true});
+
                 }
                 dispatch({
                   type:ISREAD

+ 5 - 2
src/store/reducers/homePage.js

@@ -1,4 +1,4 @@
-import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,
+import {HIDE,RESET,SETINITDATA,SETDROPSHOW,SETADDITEMINIT,SETT0EDIT,SETREADDITEMS,SETPREDATA,
   HIDEDROP,CLICKCOUNT,ISREAD,SETOTHERHISTORY,SETMINSCREEN,MODI_LOADING,GET_INSPECT_LIST,GET_ASSIST_LIST,SETALLMODULES,SETSYSTEMCONFIG,SETPRE} from '../types/homePage.js';
 import {showDrop,setAddItemInit,setLabelToEdit,confirmHide,clickNum,getInspectList,getAssistList} from '../actions/homePage.js';
 
@@ -17,7 +17,8 @@ const initState = {
   assistList:[],
   inspectList:[],
   sysConfig:{},
-  showPre:false
+  showPre:false,
+  preData:{}
 };
 
 export default function (state=initState,action) {
@@ -76,6 +77,8 @@ export default function (state=initState,action) {
       return res;
     case SETPRE:
       res.showPre = action.show;
+    case SETPREDATA:
+      res.preData = action.preData;
     default:
       return res;
   }

+ 1 - 0
src/store/types/homePage.js

@@ -17,3 +17,4 @@ export const GET_INSPECT_LIST = 'GET_INSPECT_LIST';    //化验
 export const SETALLMODULES = 'SETALLMODULES';    //储存所有模板数据
 export const SETSYSTEMCONFIG = 'SETSYSTEMCONFIG';   //设置配置数据
 export const SETPRE = 'SETPRE';   //设置预问诊引用弹窗
+export const SETPREDATA = 'SETPREDATA';   //设置预问诊数据暂存