Browse Source

删除医嘱中回访时间,回访时间其余内容仍要保留1389

zhangxc 6 năm trước cách đây
mục cha
commit
3049090a28

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

@@ -93,7 +93,7 @@ class Advice extends Component{
             {/* {advice.commontreatment && <div className={style['treat-input']}  onInput={this.handleComTreatInput}  contentEditable={true} style = {{outline: 'none'}}></div>} */}
             {<Textarea value={advice.commontreatment} isRead={isRead} handleChangeAssistValue={this.handleComTreatInput} ></Textarea>}
         </div>}
-        {!isFirstMainDiag && followUp &&<div><FollowUp  noHeader="true" textStyle={{padding: '0 10px'}}  setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp></div>}
+        {!isFirstMainDiag && hasFollowUp &&<div><FollowUp  noHeader="true" textStyle={{padding: '0 10px'}}  setFollowUp={saveFollowUp} followUp = {followUp} isRead={isRead}></FollowUp></div>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
           {scheme}

+ 1 - 1
src/containers/AdviceContainer.js

@@ -10,7 +10,7 @@ function mapStateToProps(state) {
         adviceInput: state.pushMessage.advice.adviceInput,
         isFirstMainDiag:  state.treat.isFirstMainDiag,
         followUp: state.pushMessage.advice.followUp,
-        hasFollowUp: state.treat.hasFollowUp,
+        hasFollowUp: state.pushMessage.advice.hasFollowUp,
         typeConfig: state.typeConfig.typeConfig
     })
 }

+ 3 - 0
src/store/actions/pushMessage.js

@@ -292,6 +292,9 @@ export const setAdviceInput = (state, action) => {
 export const saveFollowUp = (state, action) => {
 	const res = JSON.parse(JSON.stringify(state));
 	res.advice.followUp = action.followUp;
+	if(action.hasFollowUp) {
+		res.advice.hasFollowUp = action.hasFollowUp 
+	}
 	return res;
 }
 

+ 9 - 5
src/store/async-actions/treat.js

@@ -247,7 +247,7 @@ function getTreatment(item, dispatch, state,url,params, isChronic) {
             }
             if(followUp) {  
                 const followUpList = state.treat.followUpList
-                if(followUpList) {  //判断之前有没有存过的回访时间,如果有替换掉
+                if(followUpList) {  //判断之前有没有存过的回访时间,如果有替换掉
                     for(let i = 0; i < followUpList.length; i++) {
                         if(item.id == followUpList[i].id) {
                             followUp = followUpList[i].followUp
@@ -396,10 +396,14 @@ export const commonTreatAddToAdvice = () => {
                 type: SET_COMMONTREATMENT,
                 commontreatment: state.treat.treatItem.treat.commonTreatment.text
             })
-            dispatch({
-                type: SAVE_FOLLOW_UP,
-                followUp: state.treat.followUp
-            })
+            if(followUp) {
+                dispatch({
+                    type: SAVE_FOLLOW_UP,
+                    followUp: followUp,
+                    hasFollowUp: true
+                })
+            }
+            
         } else {
             return
         }