liucf 6 vuotta sitten
vanhempi
commit
71f88df10c

+ 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}

+ 16 - 10
src/components/AssessResult/ChartItem/index.jsx

@@ -67,13 +67,17 @@ class ChartItem extends Component {
       return str;
     }
   }
-  rangChange(type,index){
-    const {initFn,handleChange} = this.props;
+  rangChange(type,i){
+    const {initFn,handleChange,data,pindex} = this.props;
     const times = this.getXAxisArr(type);
-    const range = [times[0],times[times.length-1]];
+    const startTime=times[0];
+    const endTime=times[times.length-1];
+    const range = [startTime,endTime];
     const temp=this.props.timeTypes;
-    initFn&&initFn({range,rangeType:type,index});
-    handleChange(Object.assign(temp,{[index]:type}));
+    if(!data[startTime+endTime]){
+      initFn&&initFn({range,rangeType:type,index:i,pindex,getNew:false});
+    }
+    handleChange&&handleChange(Object.assign(temp,{[i]:type}));
   }
   getContainers(){
     const timeTypes = this.props.timeTypes;
@@ -86,11 +90,13 @@ class ChartItem extends Component {
     return arr;
   }
   componentDidMount(){
-    const {initFn} = this.props;
+    const {initFn,data,pindex} = this.props;
     const type = config.chartDismen;
     const times = this.getXAxisArr(config.chartDismen);
-    const range = [times[0],times[times.length-1]];
-    initFn&&initFn({range,rangeType:type});
+    const startTime=times[0];
+    const endTime=times[times.length-1];
+    const range = [startTime,endTime];
+    initFn&&initFn({range,rangeType:type,pindex,getNew:true});
   }
   render() {
     const {title} = this.props;
@@ -211,7 +217,7 @@ class Chart extends Component{
     this.drawChart();
   }
   render(){
-    const {type} = this.props;
+    const {type,index} = this.props;
     return <div className={style['cont']}>
               <div className={style['time-range']}>
                 <span className={type=='year'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("year")}>近一年</span>
@@ -219,7 +225,7 @@ class Chart extends Component{
                 <span className={type=='month'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("month")}>近一个月</span>
                 <span className={type=='week'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("week")}>近一周</span>
               </div>
-              <div className={style["chart-box"]} id={'chart'+this.props.index}></div>
+              <div className={style["chart-box"]} id={'chart'+index}></div>
             </div>;
   }
 }

+ 5 - 16
src/components/AssessResult/ChooseItem/index.jsx

@@ -11,22 +11,15 @@ class ChooseItem extends Component {
     super(props);
     this.state = {
       saveData:null,
-      selecteds:{},
     };
   }
 
   handleRadio(name,value){
-    const {selecteds} = this.state;
-    const {handleChange} = this.props;
-    this.setState({
-      selecteds:Object.assign({},selecteds,{[name]:value})
-    });
-    handleChange&&handleChange(Object.assign({},selecteds,{[name]:value}));     //不能用this.state.selecteds,因为state更新不是即时的
-
+    const {handleChange,selecteds} = this.props;
+    handleChange&&handleChange(Object.assign({},selecteds,{[name]:value}));
   }
   handleCheckbox(name,value){
-    let {selecteds} = this.state;
-    const {handleChange} = this.props;
+    const {handleChange,selecteds} = this.props;
     selecteds[name]?selecteds[name]:selecteds[name]=[];
     const index = selecteds[name].findIndex((i)=>i==value);
     if(index!=-1){
@@ -34,14 +27,10 @@ class ChooseItem extends Component {
     }else{
       selecteds[name].push(value);
     }
-    this.setState({
-      selecteds:selecteds
-    });
     handleChange&&handleChange(selecteds);
   }
   render() {
-    const {title,data} = this.props;
-    const {selecteds} = this.state;
+    const {title,data,selecteds} = this.props;
     return <div className={style['assess-item']}>
         <h2>{title}</h2>
         <div className={style['item-content']}>
@@ -55,7 +44,7 @@ class ChooseItem extends Component {
                       return <div className={style['choose-item']}>
                                 <Radio label={i.detailName}
                                        value={i.detailName}
-                                       isSelect={selecteds[it.name]==i.detailName}
+                                       isSelect={selecteds&&selecteds[it.name]==i.detailName}
                                        handleClick={this.handleRadio.bind(this,it.name,i.detailName)}></Radio>
                                 {i.state?<i>(智能推荐)</i>:''}
                               </div>;

+ 198 - 7
src/components/AssessResult/ScaleItem/index.jsx

@@ -1,6 +1,14 @@
 import React, { Component } from "react";
 import style from "../index.less";
 import deleteIcon from '@common/images/delete.png';
+import tableIcon from '@common/images/table.png';
+import printIcon from '@common/images/team.png';
+import allTableIcon from '@common/images/all-table.png';
+import level1 from "@common/images/级别1.png";
+import checkIcon from '@common/images/check.png';
+import {ComplexModal,MiniToast,Radio} from '@commonComp';
+import ScaleTable from '@containers/ScaleTable';
+import $ from "jquery";
 /**
  * 来源于页面选择
  *
@@ -8,23 +16,162 @@ import deleteIcon from '@common/images/delete.png';
 class ScaleItem extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      supplement:''
+    this.$area = React.createRef();
+    this.state = {
+      scaleId:'',
+      scaleName:'',
+      parentId:'',
+      showScale:false,
+      optionId:'',
+      possible:{},
+      radioVal:{},
+      formulaId:''
     };
     this.getItems = this.getItems.bind(this);
     this.getDetailItems = this.getDetailItems.bind(this);
+    this.showScaleFn = this.showScaleFn.bind(this);
+    this.closeScaleFn = this.closeScaleFn.bind(this);
+    this.showOption = this.showOption.bind(this);
+    this.closeOption = this.closeOption.bind(this);
+    this.closeFormula = this.closeFormula.bind(this);
+    this.onPrint = this.onPrint.bind(this);
+  }
+  showOption(id){
+    this.setState({
+      optionId:id
+    })
+  }
+  closeOption(){
+    this.setState({
+      optionId:null
+    })
+  }
+  confirmOption(parent,pIndex){
+    const {radioVal,possible} = this.state;
+    this.setState({
+      possible:Object.assign({},possible,radioVal),
+      radioVal:Object.assign({},possible,radioVal),//不设置radioVal只有最近一次选中的值
+      optionId:null
+    })
+  }
+  handleRadio(item,parent,pIndex){
+    let {radioVal} = this.props;
+    this.setState({
+      radioVal:Object.assign({},radioVal,{[pIndex]:item.detailName})
+    })
+  }
+  handleForRadio(){
+
+  }
+  showFormula(id){
+    this.setState({
+      formulaId:id
+    })
+  }
+  confirmFormula(){
+
+  }
+  closeFormula(){
+    this.setState({
+      formulaId:null
+    })
   }
   getDetailItems(item,i){
     let arr = [],temp='';
     const {indexs} = this.props;
+    const {optionId,radioVal,possible,formulaId} = this.state;
     item.details.map((it,j)=>{
       if(indexs[i]&&indexs[i].includes(j)){
         if(it.type==1){     //量表
-          temp =<span className={style['scale']}>【{it.content.name}】</span>;
+          temp =<span className={style['scale']} onClick={()=>this.showScaleFn(it.content.name,it.content.id,item.id)}>【{it.content.name}】</span>;
         }else if(it.type==2){      //计算公式
-          temp = <span>计算公式</span>
+          temp = <div className={style['results']}>
+                    <span>计算公式:</span>
+                    <span className={style["blue"]} onClick={this.showFormula.bind(this,item.id)}>请选择</span>
+                    <img src={level1} />
+                    <MiniToast title={it.content.name}
+                               icon={allTableIcon}
+                               show={formulaId&&formulaId==item.id?true:false}
+                               close={this.closeFormula}
+                               confirm={this.confirmFormula.bind(this,item,i)}
+                               footer="true">
+                      <table>
+                        {it.content.details.map((item,idd)=>{
+                          if(item.controlType==0){//单选
+                            return <tr>
+                              <td>
+                                <span>{'请选择'+item.name+':'}</span>
+                              </td>
+                              <td>
+                                {item.details.map((ii,ind)=>{
+                                  return <div className={style["chooseItem"]}>
+                                    <Radio label={ii.detailName}
+                                           isSelect={radioVal[i]==ii.detailName}
+                                           handleClick={this.handleForRadio.bind(this,ii,item,i)}>
+                                    </Radio>
+                                  </div>
+                                })}
+                              </td>
+                            </tr>
+                          }else if(item.controlType==1){//多选
+
+                          }else if(item.controlType==2){//输入框
+                            return <tr>
+                              <td>
+                                <span>{'请输入'+item.name+':'}</span>
+                              </td>
+                              <td>
+                                <input type="text" placeholder="请输入"/>
+                              </td>
+
+                            </tr>
+                          }else if(item.controlType==3){//下拉
+                            return <tr>
+                              <td>
+                                <span>{'请选择'+item.name+':'}</span>
+                              </td>
+                              <td>
+                                {item.details.map((ii,ind)=>{
+                                  return <div className={style["chooseItem"]}>
+                                    <Radio label={ii.detailName}
+                                           isSelect={radioVal[i]==ii.detailName}
+                                           handleClick={this.handleForRadio.bind(this,ii,item,i)}>
+                                    </Radio>
+                                  </div>
+                                })}
+                              </td>
+
+                            </tr>
+                          }
+                        })}
+                      </table>
+                      <div className={style["forMulBtn"]}>计算</div>
+                    </MiniToast>
+                </div>
         }else if(it.type==3){
-          temp = <span>可能结果</span>
+          temp = <div className={style['results']}>
+                    <span>可能结果:</span>
+                    <span onClick={this.showOption.bind(this,item.id)} className={style["blue"]}>{possible[i]?possible[i]:'请选择'}</span>
+                    <img src={level1} />
+                    <MiniToast title='结果选择'
+                         icon={checkIcon}
+                         show={optionId&&optionId==item.id?true:false}
+                         close={this.closeOption}
+                         confirm={this.confirmOption.bind(this,item,i)}
+                         footer="true">
+                        <div className={style["infoOption"]}>
+                          <span>是否贫血:</span>
+                          {it.content.details&&it.content.details.map((lis,ind)=>{
+                            return <div className={style["chooseItem"]}>
+                              <Radio label={lis.detailName}
+                                     isSelect={radioVal[i]==lis.detailName}
+                                     handleClick={this.handleRadio.bind(this,lis,item,i)}>
+                              </Radio>
+                            </div>
+                          })}
+                        </div>
+                    </MiniToast>
+                  </div>;
         }
         arr.push(<li>
           <span>{item.name}:</span>
@@ -43,8 +190,44 @@ class ScaleItem extends Component {
       return this.getDetailItems(it,i);
     });
   }
+  showScaleFn(name,id,pid){
+    const {getScaleData,scaleInfo} = this.props;
+    this.setState({
+      scaleId:id,
+      scaleName:name,
+      parentId:pid,
+      showScale:true
+    });
+    if(!scaleInfo[id]){
+      getScaleData&&getScaleData({id,name});
+    }
+  }
+  closeScaleFn(){
+    this.setState({
+      showScale:false
+    })
+  }
+  onPrint() {
+    let dom = this.state.showTable?$("#printcontent"):$("#AssistResult");
+    dom.jqprint({
+      debug: false,
+      importCSS: true,
+      printContainer: true,
+      operaSupport: false,
+    });
+  }
+  componentDidMount(){
+    if(this.props.text){
+      this.$area.current.value = this.props.text;
+    }
+  }
   render() {
-    const {title,handleInp} = this.props;
+    const {title,handleInp,scaleInfo} = this.props;
+    const {scaleName,scaleId,parentId,showScale} = this.state;
+    const footer = <div className={style['footer']}>
+      <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
+      <span className={style['okBtn']} onClick={()=>{}}>确定</span>
+    </div>;
     return <div className={style['assess-item']}>
       <h2>{title}</h2>
       <div className={style['item-content']}>
@@ -53,10 +236,18 @@ class ScaleItem extends Component {
             this.getItems()
           }
           <li>
-            <textarea className={style['edit-row']} name="supplement" rows="6" placeholder='评估描述' onInput={(e)=>handleInp(e.target.value)}></textarea>
+            <textarea className={style['edit-row']} ref={this.$area} name="supplement" rows="6" placeholder='评估描述' onBlur={(e)=>handleInp(e.target.value)}></textarea>
           </li>
         </ul>
       </div>
+      {showScale?<ComplexModal onclose={this.closeScaleFn} footer={footer}
+                               title={scaleName}
+                               icon={tableIcon}
+                               top={20}
+                               bottom={20}
+                               width={820}>
+        <ScaleTable data={scaleInfo[scaleId]} title={scaleName} tableId={scaleId} parentId={parentId}></ScaleTable>
+      </ComplexModal>:''}
     </div>;
   }
 }

+ 51 - 36
src/components/AssessResult/index.jsx

@@ -1,73 +1,88 @@
 import React, { Component } from "react";
 import style from "./index.less";
 import { Radio } from '@commonComp';
-import Notify from '@commonComp/Notify';
 import ChooseItem from "./ChooseItem";
 import ScaleItem from "./ScaleItem";
 import Information from '../Information'
 import ChartItem from "./ChartItem";
-import $ from "jquery";
 
 class AssessResult extends Component {
   constructor(props) {
     super(props);
-    this.state = {
-      chooseSelecteds: {},     //大数据选择模块
-      chartTimeTypes: {},      //图表模块
-      wholeAssessItems: props.wholeIndexs,     //整体评估模块
-      wholeAssessText: props.wholeText || ''     //整体评估补充说明
+    const chooseSelecteds = JSON.parse(JSON.stringify(props.chooseSelecteds));
+    const wholeIndexs = JSON.parse(JSON.stringify(props.wholeIndexs));      //深度复制,Object.assgin为浅复制,下下级会同源
+    this.state={
+      chooseSelecteds:chooseSelecteds,     //大数据选择模块
+      chartTimeTypes:{},      //图表模块
+      wholeAssessItems:wholeIndexs,     //整体评估模块
+      wholeAssessText:props.wholeAssessText||''     //整体评估补充说明
     }
     this.handleChooseChange = this.handleChooseChange.bind(this);
     this.handleScaleDel = this.handleScaleDel.bind(this);
     this.handleScaleText = this.handleScaleText.bind(this);
   }
-  componentWillMount() {
+  componentWillMount(){
     //获取评估
     this.props.getAssess();
   }
-  handleScaleText(text) {
-    this.setState({
-      wholeAssessText: text
-    })
+  handleScaleText(text){
+      this.setState({
+        wholeAssessText:text
+      })
   }
-  handleScaleDel(i, j) {
-    const items = Object.assign({}, this.state.wholeAssessItems);
-    const inx = items[i].findIndex(x => x == j);
-    items[i].splice(inx, 1);
+  handleScaleDel(i,j){
+    const items = Object.assign({},this.state.wholeAssessItems);
+    const inx = items[i].findIndex(x=>x==j);
+    items[i].splice(inx,1);
     this.setState({
       wholeAssessItems: items
     });
   }
-  handleChooseChange(i, selects) {
-    const { chooseSelecteds } = this.state;
+  handleChooseChange(i,selects){
+    const {chooseSelecteds} = this.state;
     this.setState({
-      chooseSelecteds: Object.assign(chooseSelecteds, { [i]: selects })
+      chooseSelecteds: Object.assign(chooseSelecteds,{[i]:selects})
     });
   }
-  handleChartChange(i, selects) {
-    const { chartTimeTypes } = this.state;
+  handleChartChange(i,selects){
+    const {chartTimeTypes} = this.state;
     this.setState({
-      chartTimeTypes: Object.assign(chartTimeTypes, { [i]: selects })
+      chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
     });
   }
-  componentWillUnmount() {
+  componentWillUnmount(){
     //点确定关闭弹窗时把参数传到父组件去
-    const { handleSave, isAssessConfirm } = this.props;
-    isAssessConfirm && handleSave(this.state);
+    const {handleSave,isAssessConfirm,clearChartData} = this.props;
+    clearChartData&&clearChartData();
+    isAssessConfirm&&handleSave(this.state);
   }
-  handoutTypes(item, i) {
-    const { getIndexData, indexData, timeTypes, wholeAssessData, wholeIndexs } = this.props;
-    //console.log(indexData)
+  handoutTypes(item,i){
+    const {getIndexData,indexData,timeTypes,wholeAssessData,scaleInfo,getScaleInfo} =this.props;
+    const {chooseSelecteds,wholeAssessItems,wholeAssessText,chartTimeTypes} = this.state;
     const chartData = indexData;
-    const name = item.regionName + ":";
-    const list = item.data && item.data.rows;
-    switch (+item.regionType) {
+    const name = item.regionName+":";
+    const list = item.data&&item.data.rows;
+    switch (+item.regionType){
       case 0:     //数据来源与右侧手动添加
-        return <ScaleItem title={name} data={wholeAssessData} handleRemove={this.handleScaleDel} handleInp={this.handleScaleText} indexs={this.state.wholeAssessItems}></ScaleItem>;
+        return <ScaleItem title={name}
+                          data={wholeAssessData}
+                          handleRemove={this.handleScaleDel}
+                          handleInp={this.handleScaleText}
+                          text={wholeAssessText}
+                          indexs={wholeAssessItems}
+                          scaleInfo={scaleInfo}
+                          getScaleData={getScaleInfo}></ScaleItem>;
       case 1:     //数据来源于大数据
-        return <ChooseItem title={name} data={list} handleChange={this.handleChooseChange.bind(this, i)}></ChooseItem>;
-      case 10:    //数据来源于后台
-        return <ChartItem title={name} data={chartData || {}} timeTypes={timeTypes} initFn={getIndexData} handleChange={this.handleChartChange.bind(this, i)}></ChartItem>;
+        return <ChooseItem title={name}
+                           data={list}
+                           handleChange={this.handleChooseChange.bind(this,i)}
+                           selecteds={chooseSelecteds[i]} ></ChooseItem>;
+      case 10:   //数据来源于后台
+        return <ChartItem title={name}
+                          data={chartData||{}}
+                          timeTypes={JSON.stringify(chartTimeTypes)=='{}'?timeTypes&&timeTypes[i]:chartTimeTypes[i]}
+                          pindex={i} initFn={getIndexData}
+                          handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
       default:
         return '';
     }
@@ -77,7 +92,7 @@ class AssessResult extends Component {
     return <div className={style['assess-cont']} id="AssistResult">
       <div className={style['printShow']}>
         <Information></Information>
-      </div> 
+      </div>
       {data && data.map((it, i) => {
         return this.handoutTypes(it, i);
       })}

+ 49 - 0
src/components/AssessResult/index.less

@@ -37,10 +37,24 @@
     .row{
       display: inline-block;
     }
+    .results{
+      position: relative;
+    }
+    .chooseItem{
+      display: inline-block;
+      margin-right: 10px;
+    }
     .scale{
       color: @blue;
       cursor: pointer;
     }
+    .blue{
+      color:#3B9ED0;
+      cursor: pointer;
+    }
+    .blue + img{
+      vertical-align: middle;
+    }
     .recommend{
       max-width: 200px;
       float: right;
@@ -93,6 +107,41 @@
 .printShow {
   display: none;
 }
+.footer{
+  .print{
+    width: 111px;
+    height: 34px;
+    line-height: 34px;
+    outline: none;
+    border-radius: 4px;
+    /*color: #3B9ED0;*/
+    border: 0 none;
+    cursor: pointer;
+    background: #fff;
+    margin-right: 20px;
+    img{
+      width: 20px;
+      vertical-align: middle;
+      margin-right: 4px;
+    }
+  }
+  .okBtn{
+    width: 80px;
+    height: 34px;
+    line-height: 32px;
+    text-align: center;
+    outline: none;
+    border-radius: 4px;
+    cursor: pointer;
+    border: 1px solid #3B9ED0;
+    box-sizing: border-box;
+    margin-left: 20px;
+    background: #3B9ED0;
+    color: #fff;
+    float: right;
+    margin-right: 20px;
+  }
+}
 @media print {
   .printShow {
     display: block;

+ 2 - 5
src/components/ChronicInfo/index.jsx

@@ -3,20 +3,16 @@ import style from './index.less';
 import infoPic from "../../common/images/info-pic.png";
 import chronicPic from "../../common/images/chronic.png";
 import level1 from "../../common/images/级别1.png";
-import close from "../../common/images/close-icon.png";
 import printIcon from '@common/images/team.png';
 import manageIcon from '@common/images/manage.png';
-import allIcon from '@common/images/all-table.png';
 import tableIcon from '@common/images/table.png';
 import allTableIcon from '@common/images/all-table.png';
 import add from '@common/images/add-result.png';
 import added from '@common/images/first.png';
 import checkIcon from '@common/images/check.png';
-import {ComplexModal,ConfirmModal,MiniToast} from '@commonComp';
+import {ComplexModal,ConfirmModal,MiniToast, Radio,CheckBtn} from '@commonComp';
 import AssessResult from '@containers/AssessResult';
 import ScaleTable from '@containers/ScaleTable';
-// import ScaleTable from '../ScaleTable';
-import { Radio,CheckBtn } from '@commonComp';
 import $ from 'jquery';
 
 /***
@@ -351,6 +347,7 @@ class ChronicInfo extends React.Component{
     </div>;
     const {chronicMagItem,showList,tableList,scaleInfo,data,saveAssessInfos,chronicDesease} = this.props;
     const {showInfo,showOption,showTable,showAssess,isAssessConfirm,tableName,tableId,parentId} = this.state;
+    //console.log(8989,chronicMagItem,chronicDesease);
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>
               <div className={`${style["tips-title"]} ${style["chronic"]}`}>
                 <div className={style["tips-name"]}>

+ 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,
         })

+ 2 - 4
src/components/PreviewBody/index.jsx

@@ -4,7 +4,7 @@ import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@u
 import Notify from '@commonComp/Notify';
 import Information from '../Information';
 import $ from "jquery";
-import arrow from '@common/images/icon_tri_blue.png';
+// import AssessResultHis from '@containers/AssessResultHis'
 
 // import "@utils/jqprint";
 
@@ -224,9 +224,7 @@ class PreviewBody extends Component {
           </tr>
         </table>
         <p style={{textAlign:'right',marginTop:'15px'}}>医生签名:<span style={{minWidth: '60px',padding: '0 5px 2px 5px',borderBottom: '1px solid #333',}}>{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</span></p>
-        <div className={style['assess-result']}>
-          <p className={style['enter']}>管理和评估结果:<a>查看结果<img src={arrow} /></a></p>
-        </div>
+        {/*<AssessResultHis inquiryId={baseObj&&baseObj.inquiryCode}></AssessResultHis>*/}
       </div>
 
       <div onClick={() => { this.surePrint(dataStr) }} style={{

+ 0 - 14
src/components/PreviewBody/index.less

@@ -45,18 +45,4 @@ table{
   tr td:first-child{
     width: 31%;
   }
-}
-.assess-result{
-  border-top: 1px #e2e4e6 solid;
-  margin-top:50px;
-  .enter{
-    margin-top: 15px;
-  }
-  a{
-    color: @blue;
-    cursor: pointer;
-    img{
-      margin-left: 4px;
-    }
-  }
 }

+ 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
+            })
+        },
     }
 }
 

+ 28 - 25
src/containers/AssessResult.js

@@ -2,10 +2,11 @@ import React from 'react';
 import {connect} from 'react-redux';
 import AssessResult from '@components/AssessResult';
 import {ISREAD} from '@store/types/homePage.js';
-import {billing} from '@store/async-actions/pushMessage';
+import {billing,getScaleInfo} from '@store/async-actions/pushMessage';
 import {getAssessData,getIndexData} from '@store/async-actions/fetchModules';
-import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_INDEX_SUB_TYPE,REMOVE_ASSESS_ITEMS} from '@types/assessResult';
+import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_INDEX_SUB_TYPE,REMOVE_ASSESS_ITEMS,CLEAR_INDEX_DATA} from '@types/assessResult';
 import store from '@store';
+import {SET_SCALE_INFO} from "../store/types/pushMessage";
 
 /***
  * 管理评估逻辑:
@@ -17,24 +18,28 @@ import store from '@store';
  *
  * ***/
 
-function mapStateToProps(state) {//console.log(state)
+function mapStateToProps(state) {
   const {assessResult} = state;
   return {
     data:assessResult.data,
     indexData:assessResult.indexData,
     saveIndexData:assessResult.saveIndexData,
     saveData:assessResult.saveData,
-    update:assessResult.update,
-    update1:assessResult.update1,
-    timeTypes:assessResult.indexTimeTypes,
-    wholeAssessData:assessResult.wholeAssess,
-    wholeIndexs:assessResult.wholeIndexs
+    update:assessResult.update,     //评估数据更新
+    update1:assessResult.update1,       //加入记录更新
+    timeTypes:assessResult.indexTimeTypes,    //图表切换的维度
+    wholeAssessData:assessResult.wholeAssess,   //评估内容
+    wholeIndexs:assessResult.wholeIndexs,      //已加入评估记录的推送项
+    chooseSelecteds:assessResult.chooseSelecteds,    //已选中的选项
+    wholeAssessText:assessResult.wholeAssessText,     //整体评估补充说明
+    scaleInfo: state.pushMessage.scaleInfo,//量表内容
+    scaleUpdate:state.pushMessage.scaleUpdate,
   }
 }
 
 function mapDispatchToProps(dispatch) {
   return {
-    getAssess(){
+    getAssess(){        //获取评估内容数据
       dispatch(getAssessData()).then((res)=>{
         if(res.data.code=='0'){
           dispatch({
@@ -46,21 +51,8 @@ function mapDispatchToProps(dispatch) {
         console.log(error);
       });
     },
-    getIndexData(param){
-      const state=store.getState();
-      const {range,rangeType,index} = param;
-      const indexData = state.assessResult.indexData;
-      const obj = indexData[range[0]+range[range.length-1]];
-
-      if(index!=undefined&&obj&&Object.keys(obj).length!=0){      //该维度已获取过数据
-        //console.log(obj,rangeType,index);
-        /*dispatch({
-          type:SET_INDEX_SUB_TYPE,
-          index,
-          rangeType
-        });*/
-        return ;
-      }
+    getIndexData(param){        //获取评估图表数据
+      const {range,rangeType,index,pindex,getNew} = param;
       dispatch(getIndexData(range)).then((res)=>{
         if(res.data.code=='0'){
           dispatch({
@@ -68,13 +60,24 @@ function mapDispatchToProps(dispatch) {
             data:parseChartData(res.data.data),
             range,
             index,
-            rangeType
+            rangeType,
+            pindex,
+            getNew
           });
         }
       }).catch(error=>{
         console.log(error);
       });
     },
+    clearChartData(){   //清除评估图表数据
+      dispatch({
+        type:CLEAR_INDEX_DATA
+      })
+    },
+    getScaleInfo(it){         //获取量表内容
+      dispatch(getScaleInfo(it))
+
+    },
     /*removeAssessResult(pIndex,i){
       dispatch({
         type:REMOVE_ASSESS_ITEMS,

+ 5 - 1
src/containers/ChronicInfo.js

@@ -3,8 +3,10 @@ import ChronicInfo from '../components/ChronicInfo';
 import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
 import {getTableList,getScaleInfo,getTips} from '../store/async-actions/pushMessage';
 import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA} from "@types/assessResult";
+import {saveMessage} from "../store/async-actions/print";
+import {saveClickNum} from '@store/async-actions/homePage';
 
-function mapStateToProps(state){//console.log(999,state)
+function mapStateToProps(state){
   return{
     chronicMagItem: state.diagnosticList.chronicMagItem,
     questionId: state.diagnosticList.clickDiag,
@@ -42,6 +44,8 @@ function mapDispatchToProps(dispatch){
     //保存管理评估
     saveAssessInfos(obj){
       dispatch(Object.assign({},obj,{type:SET_SAVE_ASSESS_DATA}));
+      dispatch(saveClickNum);
+      dispatch(() => saveMessage())
     },
     // 获取量表静态知识
     getInfomation(item){

+ 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;
+}

+ 11 - 0
src/store/async-actions/fetchModules.js

@@ -21,6 +21,7 @@ const api={
   getAssess:'/evaluationModuleMapping/getEvaluationModules',    //获取管理评估-慢病
   getIndexData:'/indexData/getIndexDatas',    //获取指标数据-图表-慢病
   getFormulaResult:'/push/calculate',  // 计算接口
+  getAssessHis:'/inquiryInfo/getEvaluations',   //历史评估记录
 };
 
 export const getFeature = (item)=>{
@@ -239,6 +240,16 @@ export function getAssessData(){
   }
 }
 
+//慢病-获取管理评估历史单条记录
+export function getAssessHis(id){
+  return (dispatch,getStore)=>{
+    const param = {
+      inquiryId:id,
+    };
+    return json(api.getAssessHis,param);
+  }
+}
+//获取评估中图表数据
 export function getIndexData(range){
   return (dispatch,getStore)=>{
     const {patInfo} = getStore();

+ 17 - 1
src/store/async-actions/print.js

@@ -18,7 +18,11 @@ export const saveMessage = (bool) => {
     let jsonData = getAllDataList(baseList);
     const lisData = baseList.inspect.pushItem;
     const lisArr = transferIndexData(lisData);
-    //transferIndexData(lisData);
+    const evaluation={
+      htmlContent:JSON.stringify(getEvaluations(baseList.assessResult)),
+      //scaleList:[]
+    };//getEvaluation();
+    console.log(baseList)
     // console.log(jsonStr.diag,'保存历史病历')
     json('/inquiryInfo/saveInquiry', {
         "doctorId": state.doctorId,
@@ -27,6 +31,7 @@ export const saveMessage = (bool) => {
         "patientId": state.patientId,         //患者id              
         "dataJson": JSON.stringify(getAllDataList(baseList)),
         "indexData":lisArr,
+        "inquiryEvaluation":evaluation,
         "detailList": [{
             "content": jsonStr.chief,
             "contentValue":filterDataArr(JSON.parse(jsonStr.chief)),
@@ -123,6 +128,17 @@ function transferIndexData(data) {
    return arr;
 }
 
+function getEvaluations(base){
+    return {
+      data:base.data,
+      chooseSelecteds:base.chooseSelecteds,
+      indexTimeTypes:base.indexTimeTypes,
+      wholeAssess:base.wholeAssess,
+      wholeAssessText:base.wholeAssessText,
+      wholeIndexs:base.wholeIndexs
+    };
+}
+
 export const clearMessages = () => {
     let baseList = store.getState();
     let whichSign = baseList.typeConfig.typeConfig;

+ 1 - 2
src/store/async-actions/pushMessage.js

@@ -24,7 +24,6 @@ export const billing = (mdata) => {
     // featureType: "4,5,6,7,22",
     featureType: "22",
     // featureType: "4,5,6,22",
-    // featureType: "4,5,6,22",
     diag: emrData.dis,
     lis: emrData.lis,
     other: emrData.other,
@@ -116,7 +115,7 @@ export const getTipsDetails = () => {
 
         //弹窗显示
         const url ='/introduceInfo/getByQuestionId'
-        console.log(123,state.diagnosticList.clickDiag)
+        
         const params = {
             type: 7,
             questionId: state.diagnosticList.clickDiag.id,

+ 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

+ 14 - 8
src/store/reducers/assessResult.js

@@ -1,4 +1,4 @@
-import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_SAVE_ASSESS_DATA,SET_INDEX_SUB_TYPE,ADD_ASSESS_ITEMS,REMOVE_ASSESS_ITEMS} from '@types/assessResult';
+import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_SAVE_ASSESS_DATA,SET_INDEX_SUB_TYPE,ADD_ASSESS_ITEMS,REMOVE_ASSESS_ITEMS,CLEAR_INDEX_DATA} from '@types/assessResult';
 import config from "@config";
 
 const init = {
@@ -12,7 +12,7 @@ const init = {
 };
 export default (state=init,action)=>{
   const res = Object.assign({},state);
-  const {data,range,index,rangeType} = action;
+  const {data,range,index,rangeType,pindex,getNew} = action;
   switch (action.type){
     case SET_ASSESS_DATA:
       res.data = action.data;
@@ -20,14 +20,20 @@ export default (state=init,action)=>{
     case SET_INDEX_DATA:
       res.indexData[range[0]+range[1]] = data;
       Object.keys(data).map((i)=>{
-        if(i===index){
-          res.indexTimeTypes[i]=rangeType;
+        if(getNew){
+          res.indexTimeTypes[pindex]=Object.assign({},res.indexTimeTypes[pindex],{[i]:config.chartDismen});
         }else{
-          res.indexTimeTypes[i]=config.chartDismen;
+          if(i===index){
+            res.indexTimeTypes[pindex][i]=rangeType;
+          }
         }
       });
       res.update = Math.random();   //对象更新
       return res;
+    case CLEAR_INDEX_DATA:      //删除图表数据,因为图表数据为记录,需实时更新
+      res.indexData = {};
+      res.indexTimeTypes = {};
+      return res;
     case SET_INDEX_SUB_TYPE:
       if(!index){
         return res;
@@ -36,10 +42,10 @@ export default (state=init,action)=>{
       res.update = Math.random();   //对象更新
       return res;
     case SET_SAVE_ASSESS_DATA:
-      res.wholeIndexs = action.wholeAssessItems;
+      res.wholeIndexs = action.wholeAssessItems||{};
       //res.indexTimeTypes = action.chartTimeTypes;
-      res.wholeAssessText = action.wholeAssessText;
-      res.chooseSelecteds = action.chooseSelecteds;
+      res.wholeAssessText = action.wholeAssessText||'';
+      res.chooseSelecteds = action.chooseSelecteds||{};
       return res;
     //case CLEAR_ASSESS_DATA:
     case ADD_ASSESS_ITEMS:

+ 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
     }

+ 2 - 1
src/store/types/assessResult.js

@@ -3,4 +3,5 @@ export const SET_INDEX_DATA = 'SET_INDEX_DATA';       //评估图表数据
 export const SET_SAVE_ASSESS_DATA = 'SET_SAVE_ASSESS_DATA';  //保存的评估弹窗数据
 export const SET_INDEX_SUB_TYPE = 'SET_INDEX_SUB_TYPE';   //保存单个图表时间维度
 export const ADD_ASSESS_ITEMS = 'ADD_ASSESS_ITEMS';     //加入评估
-export const REMOVE_ASSESS_ITEMS = 'REMOVE_ASSESS_ITEMS';  //整体评估删除
+export const REMOVE_ASSESS_ITEMS = 'REMOVE_ASSESS_ITEMS';  //整体评估删除
+export const CLEAR_INDEX_DATA = 'CLEAR_INDEX_DATA';     //删除图表数据

+ 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'    //设置所有回访时间