Przeglądaj źródła

修改治疗方案(都改为可点击状态,显示跟静态信息相同)

zhangxc 6 lat temu
rodzic
commit
f1ed0b1785

+ 2 - 2
src/components/DiagnosticList/index.jsx

@@ -257,8 +257,8 @@ class DiagnosticList extends Component {
                                     <span className={style['diag-name']} onClick={()=>{this.handleClickDiag(item)}}>{item.name}<span></span></span> 
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}
-                                          style ={hasTreat ? '' : { color: 'gray', cursor: 'text'}}
-                                          onClick={() =>{hasTreat && this.showTreat(item, index)}}>
+                                          // style ={hasTreat ? '' : { color: 'gray', cursor: 'text'}}
+                                          onClick={() =>{this.showTreat(item, index)}}>
                                           治疗方案
                                     </span>
                                     {isChronic?<span className={style['assess']}

+ 1 - 1
src/components/DiagnosticList/index.less

@@ -71,7 +71,7 @@
     width: 72px;
     height: 26px;
     line-height: 26px;
-    color: #3B9ED0;
+    color: #000;
     letter-spacing: 0;
     position: absolute;
     right: 40px;

+ 3 - 2
src/containers/DiagnosticItem.js

@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
 import DiagnosticItem from '@components/DiagnosticItem';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList'; 
 import {  SHOW_SEARCH,  HIDE_SEARCH, SET_SEARCH_VALUE } from '@store/types/diagnosticSearch';
-import { isChronicMag } from'@store/async-actions/diagnosticList.js';
+import { isChronicMag, isAddMainSuit } from'@store/async-actions/diagnosticList.js';
 import { addDiagnostic } from '@store/async-actions/treat';
 import { getSearchResult } from '@store/async-actions/diagnosticSearch';
 import {billing, getConceptDetail} from '../store/async-actions/pushMessage';
@@ -27,7 +27,8 @@ function mapDispatchToProps(dispatch) {
             dispatch({
                 type: GET_DIAGNOSTIC_STR
             });
-            dispatch(addDiagnostic(item))
+            dispatch(isAddMainSuit())
+            // dispatch(addDiagnostic(item))
         },
         showSearch:()=>{
             dispatch({

+ 1 - 1
src/containers/DiagnosticList.js

@@ -83,7 +83,7 @@ function mapDispatchToProps(dispatch) {
         },
         getTreatResult: (item) => {
             // dispatch({type:MODI_LOADING,flag:true});
-            dispatch({type:SHOW_LOADING,flag:true});
+            // dispatch({type:SHOW_LOADING,flag:true});
             dispatch(getTreatResult(item));
         },
         getTips: (item) => {

+ 102 - 89
src/store/async-actions/treat.js

@@ -8,107 +8,107 @@ import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 import { SAVE_FOLLOW_UP } from "@store/types/pushMessage";
 import {MODI_LOADING} from '@store/types/homePage.js';
 import { SHOW_TREAT} from '@store/types/treat.js';
+import Notify from '@commonComp/Notify';
 
 const api={
     pushTreatment:'/push/pushTreatment',
     getConceptDetail:'/conceptDetail/getConceptDetail'
 }
 
-export const addDiagnostic = (item) => {
-        return (dispatch, getState) => {
-            const state = getState();
-            let url = api.pushTreatment;
-            const emrData = getEMRParams();
-            const diagnosticList = state.diagnosticList.diagnosticList;
-            let diag = '';
-            if(diagnosticList) {
-                for (let i = 0; i < diagnosticList.length; i++ ) {
-                    if(i ===0 ) {
-                        diag = diag + diagnosticList[i].name;
-                    } else {
-                        diag = diag + ',' + diagnosticList[i].name;
-                    }
+// export const addDiagnostic = (item) => {
+//         return (dispatch, getState) => {
+//             const state = getState();
+//             let url = api.pushTreatment;
+//             const emrData = getEMRParams();
+//             const diagnosticList = state.diagnosticList.diagnosticList;
+//             let diag = '';
+//             if(diagnosticList) {
+//                 for (let i = 0; i < diagnosticList.length; i++ ) {
+//                     if(i ===0 ) {
+//                         diag = diag + diagnosticList[i].name;
+//                     } else {
+//                         diag = diag + ',' + diagnosticList[i].name;
+//                     }
 
-                }
-            }
-            if (item.type === 1) {
-                diag = diag + ',' + item.name
-            } else {
-                diag = diag + ',' + item.name
-            }
-            const params = {
-                "age": emrData.age,
-                "featureType": "8",
-                "diag": diag,
-                "diseaseName":  item.name,
-                "lis": emrData.lis,
-                "other": emrData.other,
-                "pacs": emrData.pacs,
-                "sex": emrData.sex,
-                "symptom": emrData.current + emrData.main,
-                "vital": emrData.vital,
-                "patientId": emrData.patientId,
-                "hosCode": emrData.hosCode,
-                "adverseReactions": "string",
-                "scaleName": "string",
-            };
-            //判断是否走慢病系统
-            const isChronic = state.diagnosticList.chronicMagItem ||state.mainSuit.chronicDesease;
-            // const isChronic = true
-            if (isChronic) {
-                let chronicList = JSON.parse(storageLocal.get('chronic'));
-                if(!chronicList){
-                    getChronic().then(() =>{
-                    chronicList = JSON.parse(storageLocal.get('chronic'));
-                        for(let i=0; i<chronicList.length; i++){
-                            if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){ //判断某个病是否为慢病
-                                params.disType = 1
-                            }
-                        }
-                        hasTreatment(dispatch, state,item,url,params)
+//                 }
+//             }
+//             if (item.type === 1) {
+//                 diag = diag + ',' + item.name
+//             } else {
+//                 diag = diag + ',' + item.name
+//             }
+//             const params = {
+//                 "age": emrData.age,
+//                 "featureType": "8",
+//                 "diag": diag,
+//                 "diseaseName":  item.name,
+//                 "lis": emrData.lis,
+//                 "other": emrData.other,
+//                 "pacs": emrData.pacs,
+//                 "sex": emrData.sex,
+//                 "symptom": emrData.current + emrData.main,
+//                 "vital": emrData.vital,
+//                 "patientId": emrData.patientId,
+//                 "hosCode": emrData.hosCode,
+//                 "adverseReactions": "string",
+//                 "scaleName": "string",
+//             };
+//             //判断是否走慢病系统
+//             const isChronic = state.diagnosticList.chronicMagItem ||state.mainSuit.chronicDesease;
+//             // const isChronic = true
+//             if (isChronic) {
+//                 let chronicList = JSON.parse(storageLocal.get('chronic'));
+//                 if(!chronicList){
+//                     getChronic().then(() =>{
+//                     chronicList = JSON.parse(storageLocal.get('chronic'));
+//                         for(let i=0; i<chronicList.length; i++){
+//                             if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){ //判断某个病是否为慢病
+//                                 params.disType = 1
+//                             }
+//                         }
+//                         hasTreatment(dispatch, state,item,url,params)
 
-                    });
-                } else {
-                    for(let i=0; i<chronicList.length; i++){
-                        if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
-                            params.disType = 1
-                        }
-                    }
-                    hasTreatment(dispatch, state, item,url,params)
-                }
-            } else {
-                hasTreatment(dispatch, state, item,url,params)
-            }
+//                     });
+//                 } else {
+//                     for(let i=0; i<chronicList.length; i++){
+//                         if(chronicList[i].conceptId==item.conceptId&&chronicList[i].name==item.name){
+//                             params.disType = 1
+//                         }
+//                     }
+//                     hasTreatment(dispatch, state, item,url,params)
+//                 }
+//             } else {
+//                 hasTreatment(dispatch, state, item,url,params)
+//             }
             
             
-        }
+//         }
 
-}
+// }
 
-//判断是否存在治疗方案
-function hasTreatment(dispatch, state,item,url, params) {
-    const itemTreat = JSON.parse(JSON.stringify(item))
-    json(url, params).then((data) =>{
-        if (data.data.data) {
-            itemTreat.treat = data.data.data
-            dispatch({
-                type: ADD_TREAT,
-                item: itemTreat
-            })
-        } else {
-            item.treat = null
-            dispatch({
-                type: ADD_TREAT,
-                item: itemTreat
-            })
-        }
+// //判断是否存在治疗方案
+// function hasTreatment(dispatch, state,item,url, params) {
+//     const itemTreat = JSON.parse(JSON.stringify(item))
+//     json(url, params).then((data) =>{
+//         if (data.data.data) {
+//             itemTreat.treat = data.data.data
+//             dispatch({
+//                 type: ADD_TREAT,
+//                 item: itemTreat
+//             })
+//         } else {
+//             item.treat = null
+//             dispatch({
+//                 type: ADD_TREAT,
+//                 item: itemTreat
+//             })
+//         }
         
-        dispatch(isAddMainSuit())
 
-    }).catch((e) =>{
-        console.log(e)
-    })
-}
+//     }).catch((e) =>{
+//         console.log(e)
+//     })
+// }
 
 export const getTreatResult = (item) =>{
     return (dispatch, getState) => {
@@ -196,14 +196,23 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
     json(url, params).then((data) =>{
         if(data.data.code == '0') {
             // dispatch({type:MODI_LOADING,flag:false});
-            dispatch({type:SHOW_LOADING,flag:false});
-            dispatch({type: SHOW_TREAT})
+            // dispatch({type:SHOW_LOADING,flag:false});
+           
             let treat;
             if(data.data.data) {
                 treat = data.data.data || {}
             }
             if(treat) {
                 let { treatment, commonTreatment, surgeryTreatment, drugHistory, adverseReactions, followUp} = treat
+                if(!(commonTreatment || surgeryTreatment ||
+                    ( treatment &&treatment.length >0 ||
+                        drugHistory&&drugHistory.length >0 || 
+                        adverseReactions&&adverseReactions.length >0 ||
+                        !!followUp ||treatment&&treatment.length >0))) {
+                            Notify.info('提示信息未维护'); 
+                            return
+                } 
+                dispatch({type: SHOW_TREAT})
                 dispatch({
                      type: SET_TREATMENT,
                      treatment: treatment,
@@ -270,7 +279,11 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
                      type: SET_ADVERSE_REACTIONS,
                      adversReactionList: adverseReactions
                  })
+            } else {
+                Notify.info('提示信息未维护');
             }
+        }else {
+            Notify.info('提示信息未维护');
         }
     }).catch((e) =>{
         console.log(e)