luolei 4 anni fa
parent
commit
75b55b8b05

+ 15 - 10
src/store/async-actions/assistCheck.js

@@ -1,6 +1,7 @@
 import axios from '@utils/ajax';
 import store from '@store';
 import { searchList } from '../actions/assistCheck';
+import {  Notify } from '@commonComp';
 
 export const getSearchList = (val) => {
     if(val.trim() == ''){
@@ -17,16 +18,20 @@ export const getSearchList = (val) => {
             "type": '3'
         })
         .then((res)=>{
-            const data = res.data.data;let curDate=[];
-            let arr = data.pacsNames;
-                for (var key in arr) {
-                    let obj = {}
-                    obj['uniqueName'] = arr[key];
-                    obj['detailName'] = arr[key];
-                    obj['name'] = arr[key];
-                    curDate.push(obj)
-                }
-            dispatch(searchList(curDate,val.trim()));
+            if(res.data.code==0){
+                const data = res.data.data;let curDate=[];
+                let arr = data.pacsNames;
+                    for (var key in arr) {
+                        let obj = {}
+                        obj['uniqueName'] = arr[key];
+                        obj['detailName'] = arr[key];
+                        obj['name'] = arr[key];
+                        curDate.push(obj)
+                    }
+                dispatch(searchList(curDate,val.trim()));
+            }else{
+                Notify.error(res.data.msg)
+            }
         })
     }
 };

+ 21 - 17
src/store/async-actions/diagnosticSearch.js

@@ -1,7 +1,7 @@
 import { json } from "@utils/ajax";
 import { GET_SEARCH_RESULT } from '@store/types/diagnosticSearch';
 import { GET_SEARCH } from '@store/types/emergencyHis';
-
+import {  Notify } from '@commonComp';
 
 export const getSearchList = (val,flag) => {
     if(val.trim() == ''){
@@ -34,24 +34,28 @@ export const getSearchList = (val,flag) => {
             "sex": 1
         })
         .then((res)=>{
-            const data = res.data.data;let curDate=[];
-            let arr = data.diseaseNames;
-                for (var key in arr) {
-                    let obj = {}
-                    obj['name'] = arr[key];
-                    obj['conceptId'] = '';
-                    curDate.push(obj)
+            if(res.data.code==0){
+                const data = res.data.data;let curDate=[];
+                let arr = data.diseaseNames;
+                    for (var key in arr) {
+                        let obj = {}
+                        obj['name'] = arr[key];
+                        obj['conceptId'] = '';
+                        curDate.push(obj)
+                    }
+                if(flag){ 
+                    dispatch({
+                        type: GET_SEARCH,
+                        searchResult: curDate
+                    })
+                }else{
+                    dispatch({
+                        type: GET_SEARCH_RESULT,
+                        searchResult: curDate
+                    })
                 }
-            if(flag){ 
-                dispatch({
-                    type: GET_SEARCH,
-                    searchResult: curDate
-                })
             }else{
-                dispatch({
-                    type: GET_SEARCH_RESULT,
-                    searchResult: curDate
-                })
+                Notify.error(res.data.msg)
             }
         })
     }

+ 19 - 14
src/store/async-actions/inspect.js

@@ -1,5 +1,6 @@
 import axios from '@utils/ajax';
 import store from '@store';
+import {  Notify } from '@commonComp';
 
 import { searchList,resetLabel } from '../actions/inspect';
 
@@ -19,22 +20,26 @@ export const getSearchList = (val) => {
             "type": type
         })
         .then((res)=>{
-            const data = res.data.data;let curDate=[];
-            if(type==2){
-                curDate = data.lisDetailNames
-            }else{
-                let arr = data.lisNames,tmp=[];
-                for (var key in arr) {
-                    let obj = {}
-                    obj['uniqueName'] = arr[key];
-                    obj['detailName'] = arr[key];
-                    obj['name'] = arr[key];
-                    obj['flg'] = 1;
-                    tmp.push(obj)
+            if(res.data.code==0){
+                const data = res.data.data;let curDate=[];
+                if(type==2){
+                    curDate = data.lisDetailNames
+                }else{
+                    let arr = data.lisNames,tmp=[];
+                    for (var key in arr) {
+                        let obj = {}
+                        obj['uniqueName'] = arr[key];
+                        obj['detailName'] = arr[key];
+                        obj['name'] = arr[key];
+                        obj['flg'] = 1;
+                        tmp.push(obj)
+                    }
+                    curDate=tmp
                 }
-                curDate=tmp
+                dispatch(searchList(curDate,val.trim()));
+            }else{
+                Notify.error(res.data.msg)
             }
-            dispatch(searchList(curDate,val.trim()));
         })
     }
 };

+ 23 - 18
src/store/async-actions/newAdvice.js

@@ -1,6 +1,7 @@
 import axios from '@utils/ajax';
 import store from '@store';
 import { searchList,resetLabel } from '../actions/newAdvice';
+import {  Notify } from '@commonComp';
 
 export const getSearchList = (val) => {
     if(val.trim() == ''){
@@ -17,27 +18,31 @@ export const getSearchList = (val) => {
             "type": type
         })
         .then((res)=>{
-            const data = res.data.data;let curDate=[];
-            if(type==2){
-                curDate = data.lisDetailNames
-            }else{
-                let arr = data.lisNames,tmp=[];
-                for (var key in arr) {
+            if(res.data.code==0){
+                const data = res.data.data;let curDate=[];
+                if(type==2){
+                    curDate = data.lisDetailNames
+                }else{
+                    let arr = data.lisNames,tmp=[];
+                    for (var key in arr) {
+                        let obj = {}
+                        obj['uniqueName'] = arr[key];
+                        obj['detailName'] = arr[key];
+                        obj['name'] = arr[key];
+                        obj['flg'] = 1;
+                        tmp.push(obj)
+                    }
                     let obj = {}
-                    obj['uniqueName'] = arr[key];
-                    obj['detailName'] = arr[key];
-                    obj['name'] = arr[key];
-                    obj['flg'] = 1;
-                    tmp.push(obj)
+                        obj['flg'] = type==5?2:1;
+                        obj['name'] = '手术';
+                        obj['uniqueName'] = '手术';
+                        tmp.push(obj)
+                    curDate=tmp
                 }
-                let obj = {}
-                    obj['flg'] = type==5?2:1;
-                    obj['name'] = '手术';
-                    obj['uniqueName'] = '手术';
-                    tmp.push(obj)
-                curDate=tmp
+                dispatch(searchList(curDate,val.trim()));
+            }else{
+                Notify.success(res.data.msg)
             }
-            dispatch(searchList(curDate,val.trim()));
         })
     }
 };