Luolei 6 lat temu
rodzic
commit
9f91346e73

+ 1 - 1
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -56,7 +56,7 @@ class HistoryCaseContainer extends React.Component {
                                         >引 用</button> */}
                                         <button 
                                             className={styles.quote} 
-                                            onClick={(e)=>{handleQuoteClick(e,val)}}
+                                            onClick={(e)=>{handleQuoteClick(e,val,idx)}}
                                         >引 用</button>
                                         <span className={styles.time}>{val.inquiryDate}</span>
                                     </li>

+ 2 - 2
src/components/HistoryCaseContainer/HistoryList/index.less

@@ -19,7 +19,7 @@
     .mainHistoryLeft {
         width: 300px;
         height: 100%;
-        background: #F1F1F1;
+        background: #d2d1d1;
         position: relative;
         .title {
             height: 80px;
@@ -29,7 +29,7 @@
             top: 0;
             left: 0;
             width: 100%;
-            background: #F1F1F1;
+            background: #d2d1d1;
         }
         .his {
             font-size: 18px;

+ 1 - 0
src/components/TemplateItems/TemplateItem/index.jsx

@@ -74,6 +74,7 @@ class TemplateItem extends React.Component {
                     isOpen: false
                 });
             });
+            console.log($(this.content).parent().siblings().find('.content'))
             return;
         }
         $(this.content).slideDown(() => {

+ 2 - 1
src/containers/HistoryCases.js

@@ -24,9 +24,10 @@ function mapDispatchToProps(dispatch) {
             e.stopPropagation();
             dispatch(activeHistory(val))
         },
-        handleQuoteClick(e,data){
+        handleQuoteClick(e,data,idx){
             e.stopPropagation();
             dispatch(keepPushData(data,'his'))      //历史病历引用
+            dispatch(activeHistory(idx))
             dispatch(visibleHistory(true))
         },
         handleSortClick(){

+ 1 - 1
src/containers/OtherHistory.js

@@ -9,7 +9,7 @@ import {fullfillText} from '@common/js/func';
 import {didPushParamChange} from '@utils/tools.js';
 import {ISREAD} from "../store/types/homePage";
 
-function mapStateToProps(state){ console.log(state)
+function mapStateToProps(state){ 
   const {otherHistory,homePage,typeConfig,mainSuit} = state;
   const hasMain = mainSuit.saveText.join('')||mainSuit.data.length;
   return {

+ 4 - 9
src/store/async-actions/homePage.js

@@ -7,7 +7,6 @@ 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 { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
   getModules:'/api/icss/moduleInfo/getAll',
@@ -58,9 +57,6 @@ export const getInitModules= (dispatch,getStore)=>{
           saveEmpty:initSaveText.currentEmpty,
         });
         dispatch(getOtherHisRecord());          //获取其他史最近记录
-        if(state.tabTemplate.items.length == 0){
-          dispatch(initItemList());         //模板列表没有就获取模板列表
-        }
         initHis(dispatch)
       }else{
         initHis(dispatch)
@@ -72,11 +68,10 @@ export const getInitModules= (dispatch,getStore)=>{
 
 export const initHis = (dispatch)=> {
     let timer = setInterval(()=>{
-        let baseDate = store.getState().patInfo.message;
-        //console.log(baseDate)
-        if(JSON.stringify(baseDate) != '{}') {
-            dispatch(initHistoryDetails(baseDate));
-            clearInterval(timer)
+        let baseDate = store.getState();
+        if(JSON.stringify(baseDate.patInfo.message) != '{}') {
+          dispatch(initHistoryDetails(baseDate.patInfo.message));
+          clearInterval(timer)
         }
     },500)
 }

+ 11 - 7
src/store/async-actions/patInfo.js

@@ -6,6 +6,7 @@ import {getUrlArgObject,pushAllDataList} from '@utils/tools';
 import {getInitModules} from '@store/async-actions/homePage.js';
 import store from '@store'
 import {ISREAD} from "../types/homePage";
+import { initItemList } from '@store/async-actions/tabTemplate';
 
 const api = {
     getPatInfo: '/api/icss/patientInfo/getTopPatientInfo',
@@ -20,6 +21,7 @@ export const initPersonInfo = (dispatch, getState) => {
         const data = res.data;
         if (data.code == 0) {
             dispatch(getInfos(data.data));
+            console.log(data.data)
             getPatientMessage(dispatch, getState);
         } else {
             console.log(res)
@@ -47,16 +49,14 @@ export const initHistoryDetails = (dispatch) => {
                   type:ISREAD
                 });
                 // 设置初始模式
-                if(detail.sign == 1){
+                if(detail.sign == 1 || detail.sign == 0){
                     dispatch({
                         type: CONFIRM_TYPE,
-                        confirmType: 1
-                    })
-                }else if(detail.sign == 0){
-                    dispatch({
-                        type: CONFIRM_TYPE,
-                        confirmType: 0
+                        confirmType: detail.sign
                     })
+                    if(baseList.tabTemplate.items.length == 0){
+                      dispatch(initItemList());        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+                    }
                 }
             } else {
                 console.log(res)
@@ -68,6 +68,7 @@ export const initHistoryDetails = (dispatch) => {
 export const getPatientMessage = (dispatch, getState) => {
   const state = getState();
   const urlDatas = state.getInfoByUuid;
+  console.log(urlDatas)
   const params = {
     hospitalCode:urlDatas.hospitalId,
     hospitalDeptCode: urlDatas.deptNo,
@@ -94,5 +95,8 @@ export const getPatientMessage = (dispatch, getState) => {
         type: CONFIRM_TYPE,
         confirmType:data1.modeValue
       });
+      if(state.tabTemplate.items.length == 0){
+        dispatch(initItemList(data1.modeValue));        //模板列表没有就获取模板列表用于保存时做数据对比是否保存过
+      }
     })
 };

+ 1 - 0
src/store/async-actions/tabTemplate.js

@@ -18,6 +18,7 @@ export const initItemList = (type) => { //初始化数据
   let baseList = store.getState();
   let whichSign = baseList.typeConfig.typeConfig;
   let state = baseList.patInfo.message;
+
   return (dispatch) => {
     axios.json('/api/icss/templateInfo/getByDoctorIdTemplates', {
       "doctorId": state.doctorId,

+ 1 - 1
src/store/reducers/getInfoByUuid.js

@@ -17,4 +17,4 @@ export default (state = initPersonList, action) => {
         return newState;
     }
     return state;
-}
+}