zhangxc %!s(int64=6) %!d(string=hai) anos
pai
achega
bd0704243c

+ 3 - 4
src/components/Advice/index.jsx

@@ -2,6 +2,7 @@ import React,{Component} from 'react';
 import style from './index.less';
 import {ItemBox} from '@commonComp';
 import Textarea from './Textarea';
+import FollowUp from '@components/Treat/FollowUp'
 
 class Advice extends Component{
   constructor(props){
@@ -65,10 +66,7 @@ class Advice extends Component{
 
   render(){
     const {advice} = this.props.pushMessage;
-    const {isRead} = this.props
-
-    
-
+    const {isRead, isFirstMainDiag, followUp, hasFollowUp, setFollowUp} = this.props
     let scheme = advice.scheme && advice.scheme.map((item, index) => {
       return <p>{item.treatment.map((it,ii) =>{
         return(it.treatmentStr && it.treatmentStr.length > 0 ? 
@@ -95,6 +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  noTitle="true"   setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}
           {scheme}

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

@@ -12,6 +12,7 @@ import { pushAllDataList } from '@utils/tools';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
 import tableIcon from '@common/images/table.png';
+import { delFollowUp } from '../../store/actions/treat';
 
 class DiagnosticList extends Component {
     constructor(props) {
@@ -51,9 +52,10 @@ class DiagnosticList extends Component {
     }
     deleteItem() {
         const { delItem } = this.state;
-        const { delDiagnostic, delReact } = this.props;
+        const { delDiagnostic, delReact,delFollowUp } = this.props;
         delDiagnostic && delDiagnostic(delItem);
         delReact && delReact(delItem)
+        delFollowUp && delFollowUp(delItem)
         this.setState({
             visible: false,
         })

+ 66 - 0
src/components/Treat/FollowUp/Textarea/index.jsx

@@ -0,0 +1,66 @@
+import React, { Component } from "react";
+import style from "./index.less";
+import config from '@config/index';
+import $ from 'jquery';
+
+class Textarea extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      timer:null,
+      val:'报告描述或意见'
+    };
+    this.textInput = React.createRef();
+    this.$dom = React.createRef();
+    this.$domW = React.createRef();
+    this.handleInput = this.handleInput.bind(this);
+  }
+  handleInput(e){
+    e.stopPropagation();
+    const {handleInputFollowUp,idx,handlePush} = this.props;
+    const text = e.target.innerText || e.target.innerHTML;
+    handleInputFollowUp&&handleInputFollowUp(text);
+   
+  }
+  shouldComponentUpdate(next){
+    if(JSON.stringify(next) == JSON.stringify(this.props)){
+      return false;
+    }
+    return true;
+  }
+  componentWillReceiveProps(next){
+    const isRead = this.props.isRead;
+    // if(next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
+    //   next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = next.value 
+    //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
+    // }
+    if(next.isRead != isRead && next.value || next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
+      next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = '' 
+      // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
+    }
+  }
+  componentDidMount(){
+    const {value} = this.props;
+    if(value && value.trim()){
+      this.$dom.current.innerText = value
+      // this.$dom.current.focus()
+      // this.$dom.current.innerText ? (this.$dom.current.innerText = value) : (this.$dom.current.innerHTML = value)
+    //   this.$dom.current.nextSibling.innerText?(this.$dom.current.nextSibling.innerText = ''):(this.$dom.current.nextSibling.innerHTML = '')
+    }
+  }
+ 
+  render() {
+    return (
+      <span>
+        <span 
+            className = {style['follow-up-box']}
+            contenteditable={true}
+            ref={this.$dom}
+            onInput={this.handleInput}
+            onKeyUp={this.handleInput}
+        ></span>
+      </span>
+    );
+  }
+}
+export default Textarea;

+ 8 - 0
src/components/Treat/FollowUp/Textarea/index.less

@@ -0,0 +1,8 @@
+.follow-up-box {
+    outline: none;
+    border-bottom: 1px solid #000;
+    display: inline-block;
+    min-width: 30px;
+    text-align: center;
+    margin-right: 5px;
+}

+ 36 - 0
src/components/Treat/FollowUp/index.jsx

@@ -0,0 +1,36 @@
+import React, { Component } from 'react';
+import style from './index.less';
+import Textarea from './Textarea';
+
+class FollowUp extends Component {
+    constructor(props){
+        super(props);
+        this.handleInputFollowUp = this.handleInputFollowUp.bind(this);
+
+    }
+
+    handleInputFollowUp(followUp) {
+        const { setFollowUp } = this.props
+        // const followUp = e.target.innerText || e.target.innerHTML;
+        setFollowUp && setFollowUp(followUp)
+    }
+
+    render() {
+        const { icon, titleStyle,titleBg, filter, title, followUp, isRead, noTitle } = this.props
+        return(
+            <div className={style['general-wrapper']}>
+                {noTitle? '': <div>
+                    <div className={style['general-title-box']} style={titleStyle}></div>
+                    <div className={style['general-title']} ><img className={style['general-icon']} src={icon}/>{title}</div>
+                </div>}
+                
+                <div>回访时间: 
+                    <Textarea value={followUp} handleInputFollowUp={this.handleInputFollowUp} isRead={isRead}></Textarea>后回访,不适随诊
+                </div>
+            </div>
+        )
+    }
+
+}
+
+export default FollowUp;

+ 26 - 0
src/components/Treat/FollowUp/index.less

@@ -0,0 +1,26 @@
+.general-wrapper {
+    position: relative;
+    padding: 10px 0 0 0;
+}
+.general-title-box {
+    height: 36px;
+    line-height: 36px;
+    background: rgb(47,199,156);
+    opacity: 0.1;
+    filter:alpha(opacity=10);
+    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(opacity=10);";
+}
+.general-title {
+    position: absolute;
+    width: 100%;
+    top: 10px;
+    height: 36px;
+    line-height: 36px;
+    font-weight: bold;
+}
+.general-icon {
+    width: 16px;
+    float: left;
+    margin: 10px;
+}
+

+ 1 - 1
src/components/Treat/GeneralTreat/index.jsx

@@ -9,7 +9,7 @@ class GeneralTreat extends Component {
     render() {
         const { icon, titleStyle,titleBg, filter, title, generalTreat } = this.props
         return(
-            generalTreat.content && generalTreat.content.length > 0 && <div className={style['general-wrapper']}>
+            generalTreat && generalTreat.content && generalTreat.content.length > 0 && <div className={style['general-wrapper']}>
                 <div className={style['general-title-box']} style={titleStyle}></div>
                 <div className={style['general-title']} ><img className={style['general-icon']} src={icon}/>{title}</div>
                 <div className={style['general-item']} dangerouslySetInnerHTML={{__html: generalTreat.content}}>

+ 16 - 4
src/components/Treat/index.jsx

@@ -3,6 +3,7 @@ import style from './index.less';
 import GeneralTreat from './GeneralTreat/index.jsx';
 import DrugTreat from './DrugTreat/index.jsx';
 import LastTreat from './LastTreat/index.jsx';
+import FollowUp from './FollowUp/index.jsx';
 import AdverseReactions from './AdverseReactions/index.jsx';
 import TreatDesc from '@components/TreatDesc'
 import {dragBox,windowRemoveEventHandler} from '@utils/tools'
@@ -39,24 +40,27 @@ class Treat extends Component {
         Notify.info('该功能即将上线,敬请期待。', 2000)
     }
     handleDetermine() {
-        const { title, treatment, advice, treatItem, adversReactionList, saveAllAdverseReaction } = this.props
+        const { title, treatment, advice, treatItem, adversReactionList, saveAllAdverseReaction, setAllFollowUp } = this.props
         const { addScheme } = this.props
         addScheme && addScheme(title, treatment);
-        saveAllAdverseReaction && saveAllAdverseReaction(treatItem)
+        saveAllAdverseReaction && saveAllAdverseReaction(treatItem);
+        setAllFollowUp && setAllFollowUp(treatItem)
         this.hideTreat()
     }
     showDrugInfo() {
         const {  showDrugInfo } = this.props;
         showDrugInfo && showDrugInfo();
     }
+   
     setTreatBox(){
       $('#treatWrapper').css({'z-index': 302});
       $('#drugWrapper').css({'z-index': 301});
     }
     render(){
-        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, lastTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore, adversReactionList, changeReact} = this.props;
+        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, lastTreat, 
+                selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo,
+                title, drugInfoList, hideDrugInfoMore, adversReactionList, changeReact, followUp, setFollowUp, isRead, hasFollowUp} = this.props;
         const { zIndex,show } = this.state
-        {console.log('adversReactionListadversReactionList11', adversReactionList)}
         return(
             <div   className={style['treat-wrapper']}>
                 <div className={style['treat-mask']} onClick={this.hideTreat}>
@@ -67,6 +71,14 @@ class Treat extends Component {
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
+                        {hasFollowUp && <FollowUp icon={generalIcon} title='回访时间'   setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
+                        {/* 回访时间 */}
+                        {/* {followUp && <div>回访时间: 
+                            <span  className={style['follow-up-box']}
+                                    contentEditable='true'
+                                    onInput = {this.handleInputFollowUp}>
+                                {followUp}</span>后回访,不适随诊
+                        </div>} */}
                         { lastTreat && lastTreat.chronicDisMedica &&lastTreat. chronicDisMedica.length > 0 && lastTreat.commonDisMedica && lastTreat.commonDisMedica.length > 0 &&<LastTreat icon={generalIcon} title='上次用药情况' lastTreat={lastTreat}  showDrugInfo = {showDrugInfo} setDrugInfo={ setDrugInfo }></LastTreat>}
                         {adversReactionList&&adversReactionList.length>0&&<AdverseReactions icon={generalIcon} title='不良反应' adversReactionList = {adversReactionList} changeReact = {changeReact}></AdverseReactions>}
                         <DrugTreat treatment={ treatment } 

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

@@ -107,4 +107,4 @@
     background: #3B9ED0;
     border-radius: 4px;
     color: #fff;
-}
+}

+ 11 - 1
src/containers/AdviceContainer.js

@@ -2,12 +2,16 @@ import React from 'react';
 import {connect} from 'react-redux';
 import Advice from '../components/Advice'
 import { SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, SET_COMMONTREATMENT ,SET_ADVICE_INPUT} from '@store/types/pushMessage';
+import { SET_FOLLOW_UP } from '@store/types/treat.js';
 
 function mapStateToProps(state) {
     return ({
         pushMessage: state.pushMessage,
         isRead:state.homePage.isRead,
-        adviceInput: state.pushMessage.advice.adviceInput
+        adviceInput: state.pushMessage.advice.adviceInput,
+        isFirstMainDiag:  state.treat.isFirstMainDiag,
+        followUp: state.treat.followUp,
+        hasFollowUp: state.treat.hasFollowUp
     })
 }
 
@@ -45,6 +49,12 @@ function mapDispatchToProps(dispatch) {
                 adviceInput: text,
             })
         },
+        setFollowUp: (followUp) => {
+            dispatch({
+                type: SET_FOLLOW_UP,
+                followUp: followUp
+            })
+        },
     }
 }
 

+ 7 - 1
src/containers/DiagnosticList.js

@@ -3,7 +3,7 @@ import { connect } from 'react-redux';
 import DiagnosticList from '@components/DiagnosticList';
 import { ADD_DIAGNOSTIC,  DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE } from '@store/types/diagnosticList'; 
 import { getTreatResult } from '@store/async-actions/treat';
-import { SHOW_TREAT, DEL_REACT } from '@store/types/treat.js';
+import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
 import {billing, getTips} from '../store/async-actions/pushMessage';
 import {keepPushData} from '@store/actions/tabTemplate';
 import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
@@ -41,6 +41,12 @@ function mapDispatchToProps(dispatch) {
                 item: item
             })
         },
+        delFollowUp:(delItem) => {
+            dispatch({
+                type: DEL_FOLLOW_UP,
+                delItem: delItem
+            })
+        },
         upDiagnostic: (index, id) => {
             dispatch({
                 type: UP_DIAGNOSTIC,

+ 18 - 4
src/containers/Treat.js

@@ -1,14 +1,14 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import Treat from '@components/Treat';
-import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, CHANGE_REACT,  DEL_REACT } from '@store/types/treat.js';
-import { getInstroduce, getRecommendBasic, getInstroduceMore, commonTreatAddToAdvice, saveAllAdverseReactions } from '@store/async-actions/treat';
+import { SELECT_DRUG, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, CHANGE_REACT,  DEL_REACT, SET_FOLLOW_UP } from '@store/types/treat.js';
+import { getInstroduce, getRecommendBasic, getInstroduceMore, commonTreatAddToAdvice, saveAllAdverseReactions, setAllFollowUp } from '@store/async-actions/treat';
 import { ADD_SCHEME } from '@store/types/pushMessage.js'
 import { showDrugInfo } from '../store/actions/treat';
 
 
 function mapStateToProps(state){
-    const { treatment, generalTreat, surgeryTreat, lastTreat, adversReactionList, treatDesc, drugInfo, showDrugInfo, treatItem , drugInfoList} = state.treat;
+    const { treatment, generalTreat, surgeryTreat, lastTreat, adversReactionList, treatDesc, drugInfo, showDrugInfo, treatItem , drugInfoList, followUp, hasFollowUp} = state.treat;
     return {
         treatment: treatment,
         generalTreat: generalTreat,
@@ -20,6 +20,10 @@ function mapStateToProps(state){
         showDrug: showDrugInfo,
         treatItem: treatItem,
         drugInfoList: drugInfoList,   //药品说明书列表(查询多个药品说明书)
+        followUp: followUp,
+        hasFollowUp: hasFollowUp,
+        isRead:state.homePage.isRead,
+        
 
     }
 }
@@ -80,14 +84,24 @@ function mapDispatchToProps(dispatch) {
             })
             dispatch(commonTreatAddToAdvice())
         },
+        //保存所有诊断的不良反应
         saveAllAdverseReaction: (item) => {
             dispatch(saveAllAdverseReactions(item))
         },
-        
+        //保存全部回访时间
+        setAllFollowUp: (item) => {
+            dispatch(setAllFollowUp(item))
+        },
         //查询多条药品说明数据(添加数据用)
         setDrugInfoMore:(drugIdList) => {
             dispatch(getInstroduceMore(drugIdList));
         },
+        setFollowUp: (followUp) => {
+            dispatch({
+                type: SET_FOLLOW_UP,
+                followUp: followUp
+            })
+        },
         hideDrugInfoMore: () =>{
             dispatch({
                 type: HIDE_DRUG_INFO

+ 42 - 2
src/store/actions/treat.js

@@ -17,6 +17,7 @@ export const clearTreat = (state, action) => {
     res.surgeryTreat = '';
     res.treatment = [];
     res.adversReactionList=[];
+    res.hasFollowUp = false;
     return res
 }
 
@@ -154,7 +155,7 @@ export const changeReact=(state,action)=>{
 // 删除该疾病不良反应
 export const delReact = (state, action) => {
     const res = JSON.parse(JSON.stringify(state));
-    let allAdversReactionList = res.allAdversReactionList
+    let allAdversReactionList = res.allAdversReactionList;
     for( let i = 0; i < allAdversReactionList.length; i++) {
         if (action.item.id == allAdversReactionList[i].id) {
             allAdversReactionList.splice(i, 1)
@@ -162,4 +163,43 @@ export const delReact = (state, action) => {
     }
     res.allAdversReactionList = allAdversReactionList;
     return res;
-}
+}
+
+// 设置回访时间
+export const setFollwUp = (state, action) => {
+    const res = Object.assign({}, state);
+    res.followUp = action.followUp;
+    if(action.hasFollowUp && (action.hasFollowUp.toString() == 'true' || action.hasFollowUp.toString() == 'false')  ) {
+        res.hasFollowUp = action.hasFollowUp;
+    }
+    return res;
+}
+
+export const setAllFollowUp = (state, action) => {
+    const res = JSON.parse(JSON.stringify(state));
+    let followUpList = res.followUpList
+    let hasfollowUp = false
+    for( let i = 0; i < followUpList.length; i++) {
+        if (action.followUp.id == followUpList[i].id) {
+            followUpList[i] = action.followUp
+            hasfollowUp = true
+        } 
+    }
+    if(!hasfollowUp) {
+        followUpList.push(action.followUp)
+    }
+    res.followUpList = followUpList;
+    return res;
+}
+
+export const delFollowUp = (state, action) => {
+    const res = JSON.parse(JSON.stringify(state));
+    let followUpList = res.followUpList;
+    for( let i = 0; i < followUpList.length; i++) {
+        if (action.delItem.id == followUpList[i].id) {
+            followUpList.splice(i, 1)
+        } 
+    }
+    res.followUpList = followUpList;
+    return res;
+}

+ 48 - 6
src/store/async-actions/treat.js

@@ -2,7 +2,7 @@ import { json } from "@utils/ajax";
 import { SET_TREAT } from '@store/types/diagnosticList';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR} from '@store/types/diagnosticList';
 import { SET_COMMONTREATMENT } from '@store/types/pushMessage'
-import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST, IS_FIRST_MAIN_DIAG, SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS } from '@store/types/treat';
+import { SET_DRUG_INFO, SET_TREATMENT, SET_TREAT_INFO, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST, IS_FIRST_MAIN_DIAG, SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS, SET_FOLLOW_UP, DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP } from '@store/types/treat';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
@@ -80,6 +80,7 @@ export const addDiagnostic = (item) => {
 
 }
 
+//判断是否存在治疗方案
 function hasTreatment(dispatch, state,item,url, params) {
     json(url, params).then((data) =>{
         if (data.data.data) {
@@ -185,6 +186,7 @@ export const getTreatResult = (item) =>{
     
 } 
 
+//获取治疗方案
 function getTreatment(item, dispatch, state,url,params) {
     json(url, params).then((data) =>{
         let treat;
@@ -192,12 +194,12 @@ function getTreatment(item, dispatch, state,url,params) {
              treat = data.data.data.treat || {}
         }
         if(treat) {
-           let adverseReactions = treat.adverseReactions
+           let { treatment, commonTreatment, surgeryTreatment, adverseReactions, followUp} = treat
            dispatch({
                 type: SET_TREATMENT,
-                treatment: treat.treatment,
-                generalTreat: treat.commonTreatment,
-                surgeryTreat: treat.surgeryTreatment,
+                treatment: treatment,
+                generalTreat: commonTreatment,
+                surgeryTreat: surgeryTreatment,
             })
             if (adverseReactions) { //如何之前存过不良反应,则替换成之前的不良反应
                 const allAdversReactionList = state.treat.allAdversReactionList
@@ -207,7 +209,6 @@ function getTreatment(item, dispatch, state,url,params) {
                             for (let j = 0; j < adverseReactions.length; j++) { //判断不良反应是否有相同的不良反应,如果有,替换
                                 for(let z = 0; z < allAdversReactionList[i].adversReactionList.length; z++) {
                                     if(adverseReactions[j].id == allAdversReactionList[i].adversReactionList[z].id) {
-                                        
                                         adverseReactions[j] = allAdversReactionList[i].adversReactionList[z]
                                     }
                                 }
@@ -219,10 +220,33 @@ function getTreatment(item, dispatch, state,url,params) {
             } else {
                 adverseReactions = []
             }
+            followUp = '2周';
+            if(followUp) {  
+                const followUpList = state.treat.followUpList
+                if(followUpList) {  //判断之前有没有报存过的回访时间,如果有替换掉
+                    for(let i = 0; i < followUpList.length; i++) {
+                        if(item.id == followUpList[i].id) {
+                            followUp = followUpList[i].followUp
+                        }
+                    }
+                }
+                dispatch({
+                    type: SET_FOLLOW_UP,
+                    // followUp: treat.followUp,
+                    followUp: followUp,
+                    hasFollowUp: true
+                })
+            } else {
+                dispatch({
+                    type: DEL_FOLLOW_UP,
+                    delItem: item,
+                })
+            }
             dispatch({
                 type: SET_ADVERSE_REACTIONS,
                 adversReactionList: adverseReactions
             })
+           
         }
         
 }).catch((e) =>{
@@ -230,6 +254,7 @@ function getTreatment(item, dispatch, state,url,params) {
 })
 }
 
+//保存全部不良反应
 export const saveAllAdverseReactions = (item) => {
     return (dispatch, getState) => {
         const state = getState()
@@ -244,6 +269,22 @@ export const saveAllAdverseReactions = (item) => {
     }
 }
 
+
+//保存全部诊断的回访时间
+export const setAllFollowUp = (item) => {
+    return (dispatch, getState) => {
+        const state = getState()
+        const followUp = state.treat.followUp
+        dispatch({
+            type: SET_ALL_FOLLOW_UP,
+            followUp: {
+                'id': item.id,
+                'followUp': followUp
+            }
+        })
+    }
+}
+
 export const getInstroduce = (item)=>{
 
     return (dispatch, getState) =>{
@@ -320,6 +361,7 @@ export const  getInstroduceMore = (drugIdList) =>{
 export const commonTreatAddToAdvice = () => {
     return (dispatch, getState) => {
         const state = getState();
+        const followUp = state.treat.followUp
         if(state.treat.treatItem.id === state.diagnosticList.diagnosticList[0].id && state.treat.isFirstMainDiag) {
             dispatch({
                 type: IS_FIRST_MAIN_DIAG

+ 10 - 2
src/store/reducers/treat.js

@@ -1,5 +1,5 @@
-import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG,CLEAR_FIRST_MAIN_DIAG ,SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS,CHANGE_REACT, DEL_REACT } from '../types/treat'
-import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag, clearFirstMainDiag, setAdverseReactions, setALLAdverseReactions, changeReact ,delReact } from '../actions/treat'
+import { SELECT_DRUG, SET_TREAT_INFO, SET_OTHER_DRUG, SET_DRUG_INFO, CLEAR_DRUG_INFO,SHOW_TREAT, HIDE_TREAT, CLEAR_TREAT, SHOW_DRUG_INFO, HIDE_DRUG_INFO, SET_GENERAL_TREAT, SET_TREATMENT, SET_SURGERY_TREAT, SET_RECOMMEND_BASIC, SET_DRUG_INFO_LIST,IS_FIRST_MAIN_DIAG,CLEAR_FIRST_MAIN_DIAG ,SET_ADVERSE_REACTIONS, SET_ALL_ADVERSE_REACTIONS,CHANGE_REACT, DEL_REACT, SET_FOLLOW_UP, DEL_FOLLOW_UP, SET_ALL_FOLLOW_UP } from '../types/treat'
+import { selectDrug, setTreatInfo, setOtherDrug, setDrugInfo, clearDrugInfo, showTreat, hideTreat, clearTreat, showDrugInfo, hideDrugInfo, setTreatment, setGeneralTreat, setSurgeryTreat, setRecommendBasic, setDrugInfoList, isFirstMainDiag, clearFirstMainDiag, setAdverseReactions, setALLAdverseReactions, changeReact ,delReact, setFollwUp, delFollowUp, setAllFollowUp } from '../actions/treat'
 const initState = {
     show: false, //治疗方案显示隐藏
     showDrugInfo: false, //药品信息显示隐藏
@@ -168,6 +168,8 @@ const initState = {
 
         // }
     ],
+    // followUp: '2周',
+    followUpList: [],
     allAdversReactionList:[],
     treatDesc:{
         title: '药品推荐',
@@ -311,6 +313,12 @@ export default function(state=initState, action){
             return changeReact(state, action);
         case DEL_REACT:
             return delReact(state, action);
+        case SET_FOLLOW_UP:
+            return setFollwUp(state, action);
+        case DEL_FOLLOW_UP:
+            return delFollowUp(state, action);
+        case SET_ALL_FOLLOW_UP: 
+            return setAllFollowUp(state, action);
         default:
             return state
     }

+ 4 - 1
src/store/types/treat.js

@@ -18,4 +18,7 @@ export const CLEAR_FIRST_MAIN_DIAG = 'CLEAR_FIRST_MAIN_DIAG' //回读清空是
 export const SET_ADVERSE_REACTIONS = 'SET_ADVERSE_REACTIONS'    //设置不良反应
 export const SET_ALL_ADVERSE_REACTIONS = 'SET_ALL_ADVERSE_REACTIONS'    //设置所有不良反应
 export const CHANGE_REACT = 'CHANGE_REACT'  //改变不良反应状态
-export const DEL_REACT = 'DEL_REACT'  //改变不良反应状态
+export const DEL_REACT = 'DEL_REACT'  //删除不良反应
+export const SET_FOLLOW_UP = 'SET_FOLLOW_UP'    //设置回访时间
+export const DEL_FOLLOW_UP = 'DEL_FOLLOW_UP'    //删除回访时间
+export const SET_ALL_FOLLOW_UP = 'SET_ALL_FOLLOW_UP'    //设置所有回访时间