luolei 5 lat temu
rodzic
commit
b5153b254b
2 zmienionych plików z 26 dodań i 3 usunięć
  1. 24 1
      src/store/async-actions/patInfo.js
  2. 2 2
      src/utils/ajax.js

+ 24 - 1
src/store/async-actions/patInfo.js

@@ -12,9 +12,31 @@ import config from '@config/index';
 const api = {
     getPatInfo: '/patientInfo/getTopPatientInfo',
     getPatBaseInfo: '/patientInfo/getPatientInfo',
-    getHospitalInfo:'/hospitalInfo/getHospitalInfo'
+    getHospitalInfo:'/hospitalInfo/getHospitalInfo',
+    getPreMsg:'/api/prec/inquiryInfo/getInquiryDetail'
 };
 
+//获取预问诊信息
+export const getPreMsg = (dispatch, getState) => {
+    // let baseList = getState();
+    // let state = baseList.patInfo.message;
+    json('http://192.168.2.121:5050'+api.getPreMsg, {
+        "hospitalCode": getUrlArgObject('hospitalId'),
+        "inquiryCode": "7",
+        "patientCode": getUrlArgObject("recordId")
+    },true).then((res) => {
+        const data = res.data;
+        if (data.code == 0) {
+            // dispatch({
+            //   type: GET_HOSPITAL_MESSAGE,
+            //   data:data.data.sysSetInfoData||[]
+            // });
+            console.log(data,77777)
+        } else {
+            console.log(res)
+        }
+    })
+}
 //获取医院id
 export const initHospitalInfo = (dispatch, getState) => {
     let baseList = getState();
@@ -62,6 +84,7 @@ export const initHistoryDetails = (dispatch) => {
         }).then((res) => {
             const data = res.data;
             if (data.code == 0) {
+                getPreMsg()
                 const detail = data.data;
                 pushAllDataList(detail.sign,'push',detail,'history');
                 dispatch({

+ 2 - 2
src/utils/ajax.js

@@ -64,11 +64,11 @@ const post=(url,data)=>{
 };
 
 //json传参
-const json=(url,data)=>{
+const json=(url,data,spec)=>{
   //兼容ie8,axios在ie8下content-type设置不成功且会把headers置为null
   return axios({
     method:'post',
-    url:url.indexOf('http:')!=-1?url:qhost+url,
+    url:url.indexOf('http:')!=-1?url:(spec?host+url:qhost+url),
     data
   });/*new Promise((resolve,reject)=>{
     $.ajax({