Selaa lähdekoodia

页面没有内容时,不调质控接口(2955)

zhangxc 5 vuotta sitten
vanhempi
commit
63b100fc26
1 muutettua tiedostoa jossa 32 lisäystä ja 21 poistoa
  1. 32 21
      src/store/async-actions/pushMessage.js

+ 32 - 21
src/store/async-actions/pushMessage.js

@@ -3,19 +3,21 @@ import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS ,SET_CHRONIC_TABLELIST,SET_S
   SET_CHRONIC_PUSHS,SHOW_TABLE_LIST, SHOW_TIPS_DETAILS,TOGGLE_CHRONIC_INFO, SET_MR_ANALYSE} from '@store/types/pushMessage';
 import { SET_DRUG_INFO, SHOW_DRUG_INFO } from '@store/types/treat';
 import { SET_CLICK_DIAG } from '../types/diagnosticList';
-import {storageLocal,getEMRParams, getMRInfo} from '@utils/tools';
+import {storageLocal,getEMRParams, getMRInfo,getAllDataStringList,isAllClear} from '@utils/tools';
 import {getBigPush} from '@utils/utils';
 import {SET_IMPORT_CHECKBODY_LABEL,PRESET} from "../types/checkBody";
 import dataLis from '@components/EmergencyProcedure/emergency';
 import  Notify from '@commonComp/Notify';
 import {pregetCheckbodyData} from '@store/async-actions/fetchModules';
 import {tabChange} from '@store/actions/tabTemplate';
+
 const api={
   getTableList:'/scale/getList', //获取量表列表
   getTableInfo:'/scale/getContent', //获取量表明细
   getConceptDetail:'/conceptDetail/getConceptDetail', //获取静态提示信息
   getMRAnalyse: '/mrqc/analyse' //病历质控
 }
+import store from '@store';
 
 
 //获取右侧推送信息
@@ -295,26 +297,35 @@ export const getScaleInfo = (it)=>{
 
 // 病历质控
 export const getMRAnalyse = () => {
-  return (dispatch, getState) => {
-    const param = getMRInfo()
-    json(api.getMRAnalyse, param)
-    .then((res) =>{
-        const data = res.data;
-        if(data.code == '0') {
-          dispatch({
-            type: SET_MR_ANALYSE,
-            MRAnalyseResult: data.data.warning
-          })
-        } else {
-          dispatch({
-            type: SET_MR_ANALYSE,
-            MRAnalyseResult: []
-          })
-        }
-        
-    }).catch((e) => {
-      console.log(e)
-    })
+  let baseList = store.getState();
+  let jsonStr = getAllDataStringList(baseList);
+  let flg = isAllClear(jsonStr);
+  if(!flg) {
+    return
+  } else {
+    return (dispatch, getState) => {
+      const param = getMRInfo()
+      json(api.getMRAnalyse, param)
+      .then((res) =>{
+          const data = res.data;
+          if(data.code == '0') {
+            dispatch({
+              type: SET_MR_ANALYSE,
+              MRAnalyseResult: data.data.warning
+            })
+          } else {
+            dispatch({
+              type: SET_MR_ANALYSE,
+              MRAnalyseResult: []
+            })
+          }
+          
+      }).catch((e) => {
+        console.log(e)
+      })
+    }
+
   }
+  
 }