Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/dev/zhangxc' into dev/new1

# Conflicts:
#	src/components/DiagnosticList/index.jsx
#	src/components/Operation/index.jsx
#	src/containers/SpreadDrop.js
#	src/store/actions/otherHistory.js
#	src/store/async-actions/treat.js
#	src/store/types/checkBody.js
zhouna 6 rokov pred
rodič
commit
486a1fbf8b

BIN
src/common/images/Printing.png


BIN
src/common/images/printing.png


+ 6 - 1
src/components/DiagnosticList/index.jsx

@@ -80,13 +80,18 @@ class DiagnosticList extends Component {
         return(
                 <div className={style['diaglist-wrap']}>
                     {list && (list.length > 0) && list.map((item, index) => {
+                        const hasTreat = item.treat && (item.treat.commonTreatment || item.treat.surgeryTreatment || item.treat.treatment.length>0)
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.id} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img src={diagDown}/></span>}
                                     <span className={style['diag-number']} style={{fontWeight:index === 0 ?'bold':'normal'}}>{index === 0 ? '主' : index+1}</span>
                                     <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']} onClick={() =>{this.showTreat(item)}}>治疗方案</span>
+                                    <span className={style['treat']}
+                                          style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'' : '1px solid gray'}}
+                                          onClick={() =>{hasTreat && this.showTreat(item)}}>
+                                          治疗方案
+                                    </span>
                                     <img className={style['diag-del']} src={del_icon} onClick={()=>{this.handleDeleteItem(item.id)}}/>
                         </div>)
                     })}

+ 1 - 1
src/store/actions/checkBody.js

@@ -35,7 +35,7 @@ export function setNumberValue(state,action){
 }
 
 //查体单选下拉选中
-export function setRadioValue(state,action){
+export function setRadioValue(state,action){console.log(221)
   let res = Object.assign({},state);
   const {ikey,id,text} = action;
   let labelInx = getLabelIndex(ikey);

+ 63 - 2
src/store/async-actions/treat.js

@@ -1,5 +1,6 @@
 import { json } from "@utils/ajax";
 import { SET_TREAT } from '@store/types/diagnosticList';
+import { ADD_DIAGNOSTIC} from '@store/types/diagnosticList'; 
 import { SET_DRUG_INFO, SET_TREATMENT, SET_RECOMMEND_BASIC } from '@store/types/treat';
 import {getEMRParams} from  '@utils/tools';
 const api={
@@ -7,6 +8,67 @@ const api={
     textPush:'/api/icss/push/pushText'
 }
 
+export const addDiagnostic = (item) => {
+        return (dispatch, getState) => {
+            const state = getState();
+            let url = api.push;
+            if(+state.typeConfig.confirmType===1){
+                url=api.textPush;
+            }
+            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,
+                "diseaseId":  item.id,
+                "lis": emrData.lis,
+                "other": emrData.other,
+                "pacs": emrData.pacs,
+                "sex": emrData.sex,
+                "symptom": emrData.current + emrData.main,
+                "vital": emrData.vital
+            };
+            
+            json(url, params).then((data) =>{
+                console.log('data', data)
+                if (data.data.data) {
+                    item.treat = data.data.data.treat
+                    return dispatch({
+                        type: ADD_DIAGNOSTIC,
+                        item: item
+                    })
+                } else {
+                    item.treat = null
+                    return dispatch({
+                        type: ADD_DIAGNOSTIC,
+                        item: item
+                    })
+                }
+
+            }).catch((e) =>{
+                console.log(e)
+            })
+        }
+
+}
+
 export const getTreatResult = (item) =>{
     return (dispatch, getState) => {
         const state = getState();
@@ -49,7 +111,7 @@ export const getTreatResult = (item) =>{
             "other": emrData.other,
             "pacs": emrData.pacs,
             "sex": emrData.sex,
-            "symptom": emrData.current||emrData.main,
+            "symptom": emrData.current + emrData.main,
             "vital": emrData.vital
         };
         
@@ -146,7 +208,6 @@ export const getTreatResult = (item) =>{
     
 } 
 export const getInstroduce = (item)=>{
-    // const instroduce = '<p>药品说明1</p><p>药品说明2</p><p>药品说明3</p>'
 
     return (dispatch, getState) =>{
         const url = '/api/icss/introduceInfo/getByQuestionId';