Ver código fonte

提示信息不存在时添加提示

zhangxc 6 anos atrás
pai
commit
1692fa299f

+ 3 - 3
src/components/DiagnosticItem/index.jsx

@@ -42,9 +42,9 @@ class DiagnosticItem extends Component{
     chooseDiagodal(item) {
         const { diagnosticList,getTips, type } = this.props;
         // getTips && getTips(item);
-        if (type == 'search') {
-            getTips && getTips({id:item.id,type:7});
-        }
+        // if (type == 'search') {  //现在搜索点击也不展示提示信息
+        //     getTips && getTips({id:item.id,type:7});
+        // }
         for (let i = 0; i < diagnosticList.length; i++) {
             if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
                 Notify.info('该诊断已存在');

+ 12 - 6
src/store/async-actions/assistCheck.js

@@ -2,7 +2,7 @@ import axios from '@utils/ajax';
 import store from '@store';
 import { searchList } from '../actions/assistCheck';
 import { SET_TIPS } from '../types/pushMessage';
-
+import { Notify} from '@commonComp';
 
 export const getSearchList = (val) => {
     if(val.trim() == ''){
@@ -34,11 +34,17 @@ export const getInstroduce = (id,name)=>{    //获取辅检的提示信息
         position: 1
     })
     .then((data)=>{
-        dispatch({
-          type: SET_TIPS,
-          tips: data.data.data,
-          tmpFlg:'midPart'
-      })          
+        if(data.data.code == 0) {
+            dispatch({
+                type: SET_TIPS,
+                tips: data.data.data,
+                tmpFlg:'midPart'
+            }) 
+        } else {
+            Notify.info(data.data.msg||'暂无提示信息')
+        }
+
+                 
     }).catch((e) => {
         console.log(e)
     })

+ 10 - 5
src/store/async-actions/inspect.js

@@ -3,6 +3,7 @@ import store from '@store';
 
 import { searchList,resetLabel } from '../actions/inspect';
 import { SET_TIPS } from '../types/pushMessage';
+import { Notify} from '@commonComp';
 
 export const getSearchList = (val) => {
     if(val.trim() == ''){
@@ -71,11 +72,15 @@ export const getInstroduce = (id,name,type)=>{    //获取化验的提示信息
   return (dispatch, getState) =>{
     axios.json(url, param)
     .then((data)=>{
-        dispatch({
-          type: SET_TIPS,
-          tips: data.data.data,
-          tmpFlg:'midPart'
-        })          
+      if(data.data.code == 0) {
+          dispatch({
+              type: SET_TIPS,
+              tips: data.data.data,
+              tmpFlg:'midPart'
+          }) 
+      } else {
+          Notify.info(data.data.msg||'暂无提示信息')
+      }        
     }).catch((e) => {
         console.log(e)
     })

+ 9 - 4
src/store/async-actions/pushMessage.js

@@ -110,10 +110,15 @@ export const billing = (mdata,boxMark) => {
         }
         json(url, params)
         .then((data)=>{
-                dispatch({
-                    type: SET_TIPS,
-                    tips: data.data.data
-                })
+                if(data.data.code == 0) {
+                    dispatch({
+                        type: SET_TIPS,
+                        tips: data.data.data
+                    })
+                } else {
+                    Notify.info(data.data.msg||'暂无提示信息')
+                }
+                
         }).catch((e) => {
             console.log(e)
         })