|
@@ -9,6 +9,7 @@ import {ISREAD,MODI_LOADING,SETPRE,SETPREDATA,SETADMIN} from "../types/homePage"
|
|
|
import { initItemList } from '@store/async-actions/tabTemplate';
|
|
|
import config from '@config/index';
|
|
|
import {Notify} from '@commonComp';
|
|
|
+import {SHOW_LOADING} from '@store/types/copyRight.js';
|
|
|
|
|
|
const api = {
|
|
|
getPatInfo: '/patientInfo/getTopPatientInfo',
|
|
@@ -176,6 +177,7 @@ export async function getPatientMessage(dispatch, getState){
|
|
|
patientCode:urlDatas.patientNo,
|
|
|
recordId:urlDatas.recordId
|
|
|
};
|
|
|
+
|
|
|
let res1 = await json(api.getPatInfo, params);
|
|
|
/*console.log(res1);
|
|
|
console.log(1);*/
|
|
@@ -185,12 +187,28 @@ export async function getPatientMessage(dispatch, getState){
|
|
|
let data1 = {},data2 = {};
|
|
|
if(res1.data.code=='0'){
|
|
|
data1 = res1.data.data;
|
|
|
- getDoctorConfig(data1.doctorId,dispatch);
|
|
|
+ data1.doctorId&&getDoctorConfig(data1.doctorId,dispatch);
|
|
|
+ }else{
|
|
|
+ dispatch({type:MODI_LOADING,flag:false});
|
|
|
+ dispatch({type:SHOW_LOADING,flag:true,text:res1.data.msg,lType:'warning'});
|
|
|
+ return;
|
|
|
}
|
|
|
if(res2.data.code=='0'){
|
|
|
data2 = res2.data.data;
|
|
|
+ }else{
|
|
|
+ dispatch({type:MODI_LOADING,flag:false});
|
|
|
+ dispatch({type:SHOW_LOADING,flag:true,text:res1.data.msg,lType:'warning'});
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ //患者或医生信息有误,禁止操作
|
|
|
+ if(Object.keys(data1).length>0&&Object.keys(data2).length>0&&data1.doctorId){
|
|
|
+ dispatch({type:SHOW_LOADING,flag:false});
|
|
|
+ }else{
|
|
|
+ dispatch({type:MODI_LOADING,flag:false});
|
|
|
+ dispatch({type:SHOW_LOADING,flag:true,text:"未获取到医生id",lType:'warning'});
|
|
|
+ return;
|
|
|
}
|
|
|
- getAdminCheckout(data1.doctorId,data1.hospitalId,dispatch)
|
|
|
+ getAdminCheckout(data1.doctorId,data1.hospitalId,dispatch);
|
|
|
dispatch({
|
|
|
type: GET_PATIENT_MESSAGE,
|
|
|
data:Object.assign(data1,data2)
|