Browse Source

获取模板接口入参调整

liucf 6 years atrás
parent
commit
d3506eeeb2
2 changed files with 11 additions and 6 deletions
  1. 3 1
      src/components/DiagnosticItem/index.jsx
  2. 8 5
      src/store/async-actions/homePage.js

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

@@ -62,10 +62,12 @@ class DiagnosticItem extends Component{
                     chronicList = JSON.parse(storageLocal.get('chronic'));
                 }
                 console.log(999,chronicList)
+                // 判断是否为慢病复诊 且页面为空 才走慢病流程
                 for(let i=0; i<chronicList.length; i++){
                     if(chronicList[i].id==item.id&&chronicList[i].name==item.name){
                         //弹窗提示 “是否引用往期病例”?--往期病例接口、弹窗、引用
-                        // 是--引用   否--走慢病流程
+                        // 是--引用   
+                        //否--判断页面是否为空--空->走慢病流程,获取慢病模板;
                         console.log("是慢病!")
                     }
                 }

+ 8 - 5
src/store/async-actions/homePage.js

@@ -26,14 +26,17 @@ function modulesParseJson(data){
   return {json,saveTextJson,moduleName};
 }
 
-export const getInitModules= (dispatch,getStore)=>{
-  const state = getStore();
-  const {message} = state.patInfo;
+// export const getInitModules= (dispatch,getStore)=>{
+//   const state = getStore();
+//   const {message} = state.patInfo;
+export const getInitModules= (chronicId)=>{
+  const {patInfo} = store.getState();
+  const {message} = patInfo;
   const param = {
     age:message.patientAge,
     sexType:message.sex,
-    mouduleType:1,//慢病2  科室1 其他0
-    relationId:message.hospitalDeptId, //慢病id  科室id  其他0
+    mouduleType:chronicId?2:(message.hospitalDeptId?1:0),//慢病2  科室1 其他0
+    relationId:chronicId?chronicId:(message.hospitalDeptId?message.hospitalDeptId:0), //慢病id  科室id  其他0
   }
   // return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
   return json(api.getModules,param).then((res) => {