ソースを参照

预问诊数据引用

luolei 5 年 前
コミット
79b5a7c67d
3 ファイル変更40 行追加10 行削除
  1. 14 8
      src/store/async-actions/patInfo.js
  2. 1 1
      src/utils/config.js
  3. 25 1
      src/utils/tools.js

+ 14 - 8
src/store/async-actions/patInfo.js

@@ -20,18 +20,21 @@ const api = {
 export const getPreMsg = (dispatch, getState) => {
     // let baseList = getState();
     // let state = baseList.patInfo.message;
-    json('http://192.168.2.121:5050'+api.getPreMsg, {
+    json(api.getPreMsg, {
         "hospitalCode": getUrlArgObject('hospitalId'),
         "inquiryCode":getUrlArgObject("recordId"),
         "patientCode": getUrlArgObject("patientNo")
     },true).then((res) => {
         const data = res.data;
         if (data.code == 0) {
-            // dispatch({
-            //   type: GET_HOSPITAL_MESSAGE,
-            //   data:data.data.sysSetInfoData||[]
-            // });
-            console.log(data,77777)
+            let result = data.data;
+            let preIcss = {
+              chief:result.chiefComplaint?new Array(result.chiefComplaint):[],
+              current:result.xbs?new Array(result.xbs):[],
+              other:result.qts?new Array(result.qts):[],
+              checkBody:result.supplement?new Array(result.supplement):[]
+            }
+            pushAllDataList(1,'push',preIcss,'preIcss');
         } else {
             console.log(res)
         }
@@ -84,9 +87,12 @@ 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');
+                if(detail.dataJson){
+                  pushAllDataList(detail.sign,'push',detail,'history');
+                }else{
+                  getPreMsg()
+                }
                 dispatch({
                   type:ISREAD
                 });

+ 1 - 1
src/utils/config.js

@@ -1,6 +1,6 @@
 // const host='http://192.168.3.1:5050';//赵
 // const host='http://192.168.3.100:5050';//王峰
-const host='http://192.168.2.236:5050';//后端接口访问地址
+const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.2.121:5050';//后端接口访问地址
 // const host='http://192.168.2.241:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇

+ 25 - 1
src/utils/tools.js

@@ -230,7 +230,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 /**
  * 
  * @param {回读数据} reData 
- * @param {回读数据是历史病历'history',还是模板'template'} type 
+ * @param {回读数据是历史病历'history',还是模板'template',预问诊引用'preIcss'} type 
  * @param {什么操作,回读'push'还是清空'clear'} action 
  * @param {引用的话是保存时候的文本类型,编辑的时候是当前页面设置的文本类型} whichSign 
  */
@@ -289,6 +289,30 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
         });
         storageLocal.remove('emrParam');
        // Notify.success('页面已清空')
+    }else if(type == 'preIcss'){
+      console.log(reData)
+      store.dispatch({type: SET_READ_MODE, readMode: whichSign});
+      store.dispatch({     //主诉文本框
+          type: CLEAR_MAIN_SUIT,
+          data:[],
+          saveText:reData.chief
+      });
+      store.dispatch({
+          type: CLEAR_CURRENT_ILL,
+          data:[],
+          saveText:reData.current
+      });
+      store.dispatch({
+          type: CLEAROTHERHISTORY,
+          data:[],
+          isEmpty:false,
+          saveText:reData.other
+      });
+      store.dispatch({
+          type: SET,
+          isEmpty:false,
+          data:reData.checkBody
+      });
     }else{
         //回读/引用设置回读模式值(主诉-其他史使用)
         store.dispatch({type: SET_READ_MODE, readMode: whichSign});