liucf пре 6 година
родитељ
комит
c4f0a84b85

+ 16 - 0
src/components/DiagnosticItem/index.jsx

@@ -2,6 +2,8 @@ import React, { Component } from 'react';
 import style from './index.less';
 import {ConfirmModal} from '@commonComp';
 import Notify from '@commonComp/Notify';
+import {getChronic} from '@store/async-actions/homePage.js';
+import {storageLocal} from '@utils/tools';
 
 class DiagnosticItem extends Component{
     constructor(props){
@@ -53,6 +55,20 @@ class DiagnosticItem extends Component{
                         return
                     }
                 }
+                // 从缓存取慢病列表
+                let chronicList = JSON.parse(storageLocal.get('chronic'));
+                if(!chronicList){
+                    getChronic();
+                    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("是慢病!")
+                    }
+                }
                 addDiagnostic&&addDiagnostic(item);
                 clearInput&&clearInput();
                 hideSearch&&hideSearch()

+ 6 - 2
src/modules/HomePage/index.jsx

@@ -6,7 +6,7 @@ import BodyContainer from "@components/BodyContainer";
 
 import {HIDEDROP,SETMINSCREEN} from '@store/types/homePage.js';
 import style from './index.less';
-/*import {getInitModules} from '@store/async-actions/homePage.js';*/
+import {getInitModules,getChronic} from '@store/async-actions/homePage.js';
 import { getUrlArgObject } from "@utils/tools";
 import $ from 'jquery';
 import loading from '@common/images/loading.gif';
@@ -19,7 +19,8 @@ class HomePage extends Component {
     }
     
     componentDidMount(){
-        const {setWindow} = this.props;
+        const {setWindow,getChronicList} = this.props;
+        getChronicList&&getChronicList();//获取慢病列表
        /* clearTimeout(this.state.timer);
         const that = this;
         const timer = setTimeout(function(){//解决患者信息在获取模板之后的问题
@@ -73,6 +74,9 @@ const mapDispatchToProps = function (dispatch) {
                 type:SETMINSCREEN,
                 obj:obj
             })
+        },
+        getChronicList(){
+            dispatch(getChronic)
         }
     }
 };

+ 25 - 2
src/store/async-actions/homePage.js

@@ -7,10 +7,12 @@ import store from '@store';
 import {fullfillText} from '@common/js/func';
 import {getOtherHisRecord,getInitData} from '@store/async-actions/fetchModules.js';
 import {initHistoryDetails} from '@store/async-actions/patInfo';
+import {storageLocal} from '@utils/tools';
 
 const api = {
   getModules:'/api/icss/moduleInfo/getAll',
-  clickCount:'/api/icss/buriedSomeStatistical/saveBuriedSomeStatisticals' //埋点统计
+  clickCount:'/api/icss/buriedSomeStatistical/saveBuriedSomeStatisticals', //埋点统计
+  getChronic:'/api/icss/disType/getDisType' //慢病列表
 };
 
 function modulesParseJson(data){
@@ -27,7 +29,14 @@ function modulesParseJson(data){
 export const getInitModules= (dispatch,getStore)=>{
   const state = getStore();
   const {message} = state.patInfo;
-  return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
+  const param = {
+    age:message.patientAge,
+    sexType:message.sex,
+    mouduleType:1,//慢病2  科室1 其他0
+    relationId:message.hospitalDeptId, //慢病id  科室id  其他0
+  }
+  // return json(api.getModules,{age:message.patientAge,sexType:message.sex}).then((res) => {
+  return json(api.getModules,param).then((res) => {
       dispatch(initHistoryDetails(message));      //历史病历回读
       if (res.data.code == '0') {
         const newObj = modulesParseJson(res.data.data);
@@ -85,4 +94,18 @@ export const saveClickNum = (dispatch,getState)=>{
       console.log("埋点请求失败",res);
     } 
   }) 
+}
+
+// 请求慢病列表
+export const getChronic = (dispatch,getState)=>{
+ return json(api.getChronic,{}).then((res) => {
+    const result = res.data;
+    if (result.code == '0') {
+      console.log("请求成功",result);
+      const chronic = JSON.stringify(result.data.chronic);
+      storageLocal.set('chronic',chronic);
+    }else{
+      console.log("请求失败",res);
+    } 
+  }) 
 }

+ 2 - 1
src/store/async-actions/mainSuit.js

@@ -18,7 +18,8 @@ export const getCommSymptoms = ()=>{//获取常见症状
     const params = {
       'deptId':deptCode,
       'age':message.patientAge,
-      'sexType':message.sex
+      'sexType':message.sex,
+      'type':1
     };
     json(api.getCommSymptoms,params).then((res)=>{
         let result = res.data;

+ 1 - 0
src/utils/config.js

@@ -1,6 +1,7 @@
 // const host='http://192.168.3.100:5050';//王峰
 // const host='http://192.168.2.241:5050';//后端接口访问地址
 const host='http://192.168.2.236:5050';//后端接口访问地址
+// const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
 // const host='http://192.168.3.117:8080'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://