ソースを参照

治疗方案页面内容添加到医嘱,定位到医嘱框(498)

zhangxc 5 年 前
コミット
a6effd3f79

+ 1 - 1
src/components/Advice/index.jsx

@@ -81,7 +81,7 @@ class Advice extends Component{
       })}</p>
     })
 
-    return  <div className={`${'mainsuit-box'} ${style['main-suit']}`}>
+    return  <div id="adviceBox" className={`${'mainsuit-box'} ${style['main-suit']}`}>
       <ItemBox title='医嘱' editable={false} border={true} marginTop="10px">
         <div className={style['billing']}>
           {advice.assay && advice.assay.length > 0 || advice.check && advice.check.length > 0 ? <h1>开单项目</h1> : ''}

+ 6 - 1
src/store/actions/pushMessage.js

@@ -87,7 +87,7 @@ export const addScheme = (state, action) => {
   const scheme = res.advice.scheme || [];
   let isRepeat = false; 
   let RepeatIndex;
-  
+  let SelectedDrugNum = 0 	//选中的药品数量
   for (let i = 0; i < treatment.length; i++) {
 		let treatmentStr = '';
 		let drugList = []
@@ -95,11 +95,15 @@ export const addScheme = (state, action) => {
       if(treatment[i].medicitionsList[j].selected) {
 				treatmentStr = treatmentStr + treatment[i].medicitionsList[j].medicitionName + ', '
 				drugList.push({conceptId: treatment[i].medicitionsList[j].conceptId, conceptName: treatment[i].medicitionsList[j].medicitionName })
+				SelectedDrugNum++
 			}
 	}
 	treatment[i].treatmentStr = treatmentStr.substring(0,treatmentStr.length-2)
 	treatment[i].drugList = drugList
   }
+  if(SelectedDrugNum > 0) { //如果有选中的药品,滚动到医嘱框
+	document.getElementById("adviceBox").scrollIntoView(true)
+  }
   treatItem.treatment = treatment;
   for (let i = 0; i < scheme.length; i++) {
     if (scheme[i].name === treatItem.name) {
@@ -156,6 +160,7 @@ export const addScheme = (state, action) => {
 	if (res.advice.scheme) {
 		res.advice.drugList = getDrugList(res.advice.scheme)
 	}
+	
   return res;
 }
 

+ 3 - 0
src/store/async-actions/treat.js

@@ -415,6 +415,9 @@ export const commonTreatAddToAdvice = () => {
                     hasFollowUp: true
                 })
             }
+            if(state.treat.generalTreat.content || followUp) { //如果一般治疗和回访时间存在,定位到医嘱
+                document.getElementById("adviceBox").scrollIntoView(true)
+            }
             
         } else {
             return