ソースを参照

合并远程分支

liucf 6 年 前
コミット
338aea6757
42 ファイル変更512 行追加147 行削除
  1. 1 0
      src/components/AddAssistCheck/index.less
  2. 89 0
      src/components/AssessResult/AssessHis/index.jsx
  3. 32 0
      src/components/AssessResult/AssessHis/index.less
  4. 15 9
      src/components/AssessResult/ChartItem/index.jsx
  5. 3 1
      src/components/AssessResult/ChooseItem/index.jsx
  6. 8 4
      src/components/AssessResult/ScaleItem/index.jsx
  7. 5 2
      src/components/AssessResult/index.jsx
  8. 8 4
      src/components/AssessResult/index.less
  9. 11 5
      src/components/ChronicInfo/index.jsx
  10. 1 1
      src/components/CurrentIll/index.jsx
  11. 3 2
      src/components/DiagnosticList/index.jsx
  12. 1 0
      src/components/HistoryCaseContainer/HistoryList/index.jsx
  13. 2 1
      src/components/MainSuit/index.jsx
  14. 3 3
      src/components/PatInfo/index.jsx
  15. 9 1
      src/components/PatInfo/index.less
  16. 4 6
      src/components/PreviewBody/index.jsx
  17. 0 1
      src/components/Treat/AdverseReactions/index.jsx
  18. 0 0
      src/components/Treat/DrugHistory/LastDrug/index.jsx
  19. 0 0
      src/components/Treat/DrugHistory/LastDrug/index.less
  20. 33 0
      src/components/Treat/DrugHistory/index.jsx
  21. 0 0
      src/components/Treat/DrugHistory/index.less
  22. 0 33
      src/components/Treat/LastTreat/index.jsx
  23. BIN
      src/components/Treat/img/adverseReaction.png
  24. BIN
      src/components/Treat/img/followUp.png
  25. 21 5
      src/components/Treat/index.jsx
  26. 1 1
      src/containers/AdviceContainer.js
  27. 104 0
      src/containers/AssessResultHis.js
  28. 2 2
      src/containers/Treat.js
  29. 1 1
      src/store/actions/diagnosticList.js
  30. 40 5
      src/store/actions/pushMessage.js
  31. 2 0
      src/store/actions/treat.js
  32. 1 1
      src/store/async-actions/historyTemplates.js
  33. 1 0
      src/store/async-actions/print.js
  34. 2 3
      src/store/async-actions/pushMessage.js
  35. 16 5
      src/store/async-actions/treat.js
  36. 3 1
      src/store/index.js
  37. 15 0
      src/store/reducers/assessResultHis.js
  38. 12 3
      src/store/reducers/pushMessage.js
  39. 3 3
      src/store/reducers/treat.js
  40. 2 0
      src/store/types/assessResultHis.js
  41. 2 0
      src/store/types/pushMessage.js
  42. 56 44
      src/utils/tools.js

+ 1 - 0
src/components/AddAssistCheck/index.less

@@ -37,6 +37,7 @@
         padding: 10px;
         box-sizing: border-box;
         position: relative;
+        clear: both;
         .pointerFinger {
             width: 222px;
             position: absolute;

+ 89 - 0
src/components/AssessResult/AssessHis/index.jsx

@@ -0,0 +1,89 @@
+import React, { Component } from "react";
+import style from "./index.less";
+import { Radio} from '@commonComp';
+import arrow from '@common/images/icon_tri_blue.png';
+import loadingIcon from '@common/images/loading.gif';
+import ChooseItem from "../ChooseItem";
+import ScaleItem from "../ScaleItem";
+import ChartItem from "../ChartItem";
+
+class AssessResultHis extends Component {
+  constructor(props) {
+    super(props);
+    this.state={
+      chartTimeTypes:{},      //图表模块
+    };
+    this.showAssessFn = this.showAssessFn.bind(this);
+    this.getAssessContent = this.getAssessContent.bind(this);
+  }
+  handleChartChange(i,selects){
+    const {chartTimeTypes} = this.state;
+    this.setState({
+      chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
+    });
+  }
+  showAssessFn(){
+    //获取历史评估数据
+    this.props.getAssessHis(this.props.inquiryId);
+  }
+  handoutTypes(obj,item,i){
+    const {wholeAssess,wholeIndexs,chooseSelecteds} =obj;
+    const {getIndexData,inquiryDate,indexData,inquiryId,timeTypes} = this.props;
+    const {chartTimeTypes} = this.state;
+    const name = item.regionName+":";
+    const list = item.data&&item.data.rows;
+    switch (+item.regionType){
+      case 0:     //数据来源与右侧手动添加
+        return <ScaleItem title={name} data={wholeAssess} indexs={wholeIndexs} disabled={true}></ScaleItem>;
+      case 1:     //数据来源于大数据
+        return <ChooseItem title={name} data={list} selecteds={chooseSelecteds&&chooseSelecteds[i]} disabled={true}></ChooseItem>;
+      case 10:    //数据来源于后台
+        return <ChartItem title={name}
+                          data={indexData||{}}
+                          timeTypes={JSON.stringify(chartTimeTypes||{})=='{}'?timeTypes&&timeTypes[i]:chartTimeTypes[i]}
+                          initFn={getIndexData}
+                          endDate={inquiryDate}
+                          pindex={i}
+                          handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
+      default:
+        return '';
+    }
+  }
+  getAssessContent(){
+    const { list,inquiryId } = this.props;
+    const obj = list&&list[inquiryId];
+    const data = obj&&obj.data;
+    if(data&&data.length>0){
+      return data.map((it,i)=>{
+        return this.handoutTypes(obj,it,i);
+      });
+    }else{
+      return data===null||(data&&data.length==0)?<p className={style['no-data']}>没有历史评估记录!</p>:'';
+    }
+  }
+  /*componentDidMount(){
+    const indexTimeTypes = JSON.parse(JSON.stringify(this.props.indexTimeTypes));
+    console.log(indexTimeTypes)
+    this.setState({
+      chartTimeTypes:indexTimeTypes
+    });
+  }*/
+  render() {
+    const { list,inquiryId,loading } = this.props;
+    const data = list&&list[inquiryId]&&list[inquiryId].data;
+    return <div className={style['assess-cont']}>
+      <div className={style['assess-result']}>
+        <p className={style['enter']}>管理和评估结果:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a></p>
+      </div>
+      <div className={style['assess-box']}>
+        {loading?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
+        {/*{data?data.map((it,i)=>{
+          return this.handoutTypes(it,i);
+        }):data===null?<p className={style['no-data']}>没有历史评估记录!</p>:''}*/}
+        {this.getAssessContent()}
+      </div>
+    </div>;
+  }
+}
+
+export default AssessResultHis;

+ 32 - 0
src/components/AssessResult/AssessHis/index.less

@@ -0,0 +1,32 @@
+@import "~@less/variables.less";
+.assess-result{
+  border-top: 1px #e2e4e6 solid;
+  margin-top:50px;
+  .enter{
+    margin-top: 15px;
+  }
+  a{
+    color: @blue;
+    cursor: pointer;
+    img{
+      margin-left: 4px;
+    }
+  }
+}
+.assess-box{
+  margin: 20px 0 0 -15px;
+}
+.no-data{
+  text-align: center;
+  font-size: 20px;
+  color: @placeholder-color;
+  margin-top: 26px;
+  font-weight: bold;
+}
+.loading{
+  margin-top: 20px;
+  text-align: center;
+  img{
+    width: 30px;
+  }
+}

+ 15 - 9
src/components/AssessResult/ChartItem/index.jsx

@@ -17,7 +17,8 @@ class ChartItem extends Component {
     this.getXAxisArr = this.getXAxisArr.bind(this);
   }
   getXAxisArr(type){
-    let now = new Date().getTime();
+    const endDate = this.props.endDate;
+    let now = endDate?new Date(endDate).getTime():new Date().getTime();
     let arr = [],temp=0;
     //近一周
     switch(type){
@@ -83,14 +84,15 @@ class ChartItem extends Component {
     const timeTypes = this.props.timeTypes;
     const range = this.getXAxisArr(config.chartDismen);
     const obj = this.props.data[range[0]+range[range.length-1]];
+    const {endDate} = this.props;
     let arr = [];
     for(let i in obj){
-      arr.push(<Chart data={obj[i]} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
+      arr.push(<Chart data={obj[i]} endDate={endDate} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
     }
     return arr;
   }
   componentDidMount(){
-    const {initFn,data,pindex} = this.props;
+    const {initFn,pindex} = this.props;
     const type = config.chartDismen;
     const times = this.getXAxisArr(config.chartDismen);
     const startTime=times[0];
@@ -124,9 +126,9 @@ class Chart extends Component{
     this.timeSwitch = this.timeSwitch.bind(this);
   }
   drawChart(){
-    const {index,data,getXAxisArr,type} = this.props;
+    const {index,data,getXAxisArr,type,endDate} = this.props;
     const xAxis = getXAxisArr(type);
-    const id = 'chart'+index;
+    const id = endDate?'chart'+endDate+index:'chart'+index;
     let series = [],names=[],inx=-1;
     let myChart = echarts.init(document.getElementById(id));
 
@@ -162,7 +164,11 @@ class Chart extends Component{
         trigger: 'axis'
       },
       legend: {
-        data:names
+        data:names,
+        bottom:210
+      },
+      grid:{
+        top:80
       },
       xAxis: {
         type: 'category',
@@ -182,7 +188,7 @@ class Chart extends Component{
           show:true,
           showMaxLabel:true,
           interval:interval[type],
-          rotate:45,
+          rotate:65,
           fontSize:10
         }
       },
@@ -217,7 +223,7 @@ class Chart extends Component{
     this.drawChart();
   }
   render(){
-    const {type,index} = this.props;
+    const {type,index,endDate} = 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>
@@ -225,7 +231,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'+index}></div>
+              <div className={style["chart-box"]} id={endDate?'chart'+endDate+index:'chart'+index}></div>
             </div>;
   }
 }

+ 3 - 1
src/components/AssessResult/ChooseItem/index.jsx

@@ -30,7 +30,7 @@ class ChooseItem extends Component {
     handleChange&&handleChange(selecteds);
   }
   render() {
-    const {title,data,selecteds} = this.props;
+    const {title,data,selecteds,disabled} = this.props;
     return <div className={style['assess-item']}>
         <h2>{title}</h2>
         <div className={style['item-content']}>
@@ -44,6 +44,7 @@ class ChooseItem extends Component {
                       return <div className={style['choose-item']}>
                                 <Radio label={i.detailName}
                                        value={i.detailName}
+                                       disabled={disabled}
                                        isSelect={selecteds&&selecteds[it.name]==i.detailName}
                                        handleClick={this.handleRadio.bind(this,it.name,i.detailName)}></Radio>
                                 {i.state?<i>(智能推荐)</i>:''}
@@ -53,6 +54,7 @@ class ChooseItem extends Component {
                                 <CheckBtn id={i.detailName}
                                           value={i.detailName}
                                           label={i.detailName}
+                                          disabled={disabled}
                                           isSelect={selecteds[it.name]&&selecteds[it.name].includes(i.detailName)}
                                           handleClick={this.handleCheckbox.bind(this,it.name,i.detailName)}/>
                                 {i.state?<i>(智能推荐)</i>:''}

+ 8 - 4
src/components/AssessResult/ScaleItem/index.jsx

@@ -23,8 +23,8 @@ class ScaleItem extends Component {
       parentId:'',
       showScale:false,
       optionId:'',
-      possible:{},
-      radioVal:{},
+      possible:props.possible||{},
+      radioVal:props.radioVal||{},
       formulaId:''
     };
     this.getItems = this.getItems.bind(this);
@@ -222,7 +222,7 @@ class ScaleItem extends Component {
     }
   }
   render() {
-    const {title,handleInp,scaleInfo} = this.props;
+    const {title,handleInp,scaleInfo,disabled} = 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>
@@ -236,7 +236,11 @@ class ScaleItem extends Component {
             this.getItems()
           }
           <li>
-            <textarea className={style['edit-row']} ref={this.$area} name="supplement" rows="6" placeholder='评估描述' onBlur={(e)=>handleInp(e.target.value)}></textarea>
+            <textarea className={style['edit-row']}
+                      ref={this.$area}
+                      name="supplement"
+                      rows="6"
+                      placeholder='评估描述' onBlur={disabled?null:(e)=>handleInp(e.target.value)} disabled={disabled}></textarea>
           </li>
         </ul>
       </div>

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

@@ -57,7 +57,7 @@ class AssessResult extends Component {
     isAssessConfirm&&handleSave(this.state);
   }
   handoutTypes(item,i){
-    const {getIndexData,indexData,timeTypes,wholeAssessData,scaleInfo,getScaleInfo} =this.props;
+    const {getIndexData,indexData,timeTypes,wholeAssessData,scaleInfo,getScaleInfo,possible,radioVal} =this.props;
     const {chooseSelecteds,wholeAssessItems,wholeAssessText,chartTimeTypes} = this.state;
     const chartData = indexData;
     const name = item.regionName+":";
@@ -71,6 +71,8 @@ class AssessResult extends Component {
                           text={wholeAssessText}
                           indexs={wholeAssessItems}
                           scaleInfo={scaleInfo}
+                          possible={possible}
+                          radioVal={radioVal}
                           getScaleData={getScaleInfo}></ScaleItem>;
       case 1:     //数据来源于大数据
         return <ChooseItem title={name}
@@ -81,7 +83,8 @@ class AssessResult extends Component {
         return <ChartItem title={name}
                           data={chartData||{}}
                           timeTypes={JSON.stringify(chartTimeTypes)=='{}'?timeTypes&&timeTypes[i]:chartTimeTypes[i]}
-                          pindex={i} initFn={getIndexData}
+                          pindex={i}
+                          initFn={getIndexData}
                           handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
       default:
         return '';

+ 8 - 4
src/components/AssessResult/index.less

@@ -70,6 +70,7 @@
   }
   .cont{
     display: inline-block;
+    min-width: 302px;
     width: 49%;
     height: 250px;
     margin-bottom: 20px;
@@ -80,20 +81,23 @@
     }
   }
   .cont:nth-child(odd){
-    margin-right: 2%;
+    /*margin-right: 2%;*/
   }
   .time-range{
     position: absolute;
-    top: 26px;
+    bottom: 180px;
+    /*top: 26px;*/
     z-index: 2;
-    margin-left: 18px;
+    width: 100%;
+    text-align: center;
+    /*margin-left: 18px;*/
     .range{
       display: inline-block;
       border:1px #DFDFDF solid;
       border-radius: 10px;
       background: #fff;
       padding: 5px 10px;
-      margin-right: 15px;
+      margin-right: 10px;
       font-size: 12px;
       cursor: pointer;
       &.on{

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

@@ -276,7 +276,10 @@ class ChronicInfo extends React.Component{
                                           <span>{'请输入'+item.name+':'}</span>
                                         </td>
                                         <td>
-                                          <input type="text" placeholder="请输入"/>
+                                          <input type="text" placeholder="请输入" value={item.value}/>
+                                        </td>
+                                        <td>
+                                          <span>{item.uint}</span>
                                         </td>
                                         
                                       </tr>
@@ -289,9 +292,9 @@ class ChronicInfo extends React.Component{
                                           {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,v,i)}>
-                                                      </Radio>
+                                                            isSelect={radioVal[i]==ii.detailName}
+                                                            handleClick={this.handleForRadio.bind(this,ii,v,i)}>
+                                                    </Radio>
                                                   </div>
                                           })}
                                         </td>
@@ -404,7 +407,10 @@ class ChronicInfo extends React.Component{
                       top={20}
                       bottom={20}
                       width={820}>
-                <AssessResult handleSave={saveAssessInfos} isAssessConfirm={isAssessConfirm}></AssessResult>
+                <AssessResult handleSave={saveAssessInfos}
+                              isAssessConfirm={isAssessConfirm}
+                              possible={possible}
+                              radioVal={radioVal}></AssessResult>
               </ComplexModal>:''}
       </div>
   }

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

@@ -57,7 +57,7 @@ class CurrentIll extends Component{
     }else {
       let num = moduleNum.num;//主诉使用了几个模板
         // isChronic为一个对象
-      if(data.length==0 && !isChronic|| !isChronic.name ){
+      if(data.length==0 && !isChronic || !isChronic.name ){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
             setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});   

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

@@ -8,7 +8,7 @@ import Notify from '@commonComp/Notify';
 import Treat from '@containers/Treat'
 import store from '@store';
 import { initItemList } from '@store/async-actions/historyTemplates';
-import { pushAllDataList } from '@utils/tools';
+import { pushAllDataList,inspectAndAssist } 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';
@@ -101,6 +101,7 @@ class DiagnosticList extends Component {
     noReferRecord() {
         const { hideReferRecord } = this.props
         hideReferRecord && hideReferRecord()
+        inspectAndAssist()//化验辅检模板
     }
     referCase() {
         const { hideHistoryCaseModal, items } = this.props
@@ -164,7 +165,7 @@ class DiagnosticList extends Component {
                                     {item.type === 1 ? <span className={style['diag-first']}>初诊</span> :<span className={style['diag-second']}> 复诊</span>}
                                     <span className={style['treat']}
                                         //   style ={{ color: hasTreat ?'' : 'gray', border: hasTreat ?'1px solid #3B9ED0' : '1px solid gray', cursor: hasTreat ? '' : 'text'}}
-                                          style ={hasTreat ? '' : { color: 'gray', border: '1px solid gray', cursor: 'auto'}}
+                                          style ={hasTreat ? '' : { color: 'gray', border: '1px solid gray', cursor: 'text'}}
                                           onClick={() =>{hasTreat && this.showTreat(item, index)}}>
                                           治疗方案
                                     </span>

+ 1 - 0
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -75,6 +75,7 @@ class HistoryCaseContainer extends React.Component {
                             dataStr={dataStr.length > 0?getAllDataStringList(dataStr):[]}
                             show={false}
                             flg={true}
+                            showAssessBtn={true}
                         ></PreviewBody>
                     }
                 </div>

+ 2 - 1
src/components/MainSuit/index.jsx

@@ -11,7 +11,7 @@ import { initItemList } from '@store/async-actions/historyTemplates';
 import tableIcon from '@common/images/table.png';
 import iconRadioDefault from '@common/images/icon-radio-default.png'
 import iconRadioActive from '@common/images/icon-radio-active.png'
-import { pushAllDataList } from '@utils/tools';
+import { pushAllDataList,inspectAndAssist } from '@utils/tools';
 import $ from 'jquery';
 import store from '@store';
 
@@ -295,6 +295,7 @@ class MainSuit extends Component{
     closeHisBox&&closeHisBox();
     // 不引用病例 -直接分发模板进行填充
     autoFillMoudles && autoFillMoudles()
+    inspectAndAssist()//化验辅检模板
   }
   referCase() {
         const { items ,pureSaveChronic} = this.props

+ 3 - 3
src/components/PatInfo/index.jsx

@@ -15,16 +15,16 @@ class PatInfo extends Component {
     const {sizeFlag} = this.props;
      return <table className={sizeFlag?`${style["table"]} ${style["newSize"]}`:style["table"]}>
       <tr>
-        <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`}>卡号:{message.patientIdNo && message.patientIdNo}</td>
+        <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`} title={'卡号:' + (message.patientIdNo && message.patientIdNo)}>卡号:{message.patientIdNo && message.patientIdNo}</td>
         <td key='2' className={`${style.tdBorderB} ${style.tdBorderR}`} title={sizeFlag&&message.patientName&&message.patientName.length>3?message.patientName:''}>姓名:{sizeFlag&&message.patientName && message.patientName.length>3?message.patientName.slice(0,3)+'...':message.patientName}</td>
         <td key='3' className={`${style.tdBorderB} ${style.tdBorderR}`}>年龄:{message.patientAge && message.patientAge}</td>
         <td key='4' className={`${style.tdBorderB} ${style.tdBorderR}`}>性别:{message.patientSex && message.patientSex}</td>
       </tr>
       <tr>
-        <td key='5' className={`${style.tdBorderR}`} style={{whiteSpace: 'nowrap'}}>就诊时间:{message.systemTime&&message.systemTime.substring(0, 10)}</td>
+        <td key='5' className={`${style.tdBorderR}`} style={{whiteSpace: 'nowrap'}} title={'就诊时间:'+(message.systemTime&&message.systemTime.substring(0, 10))}>就诊时间:{message.systemTime&&message.systemTime.substring(0, 10)}</td>
         <td key='6' className={`${style.tdBorderR}`}>科室:{message.hospitalDeptName && message.hospitalDeptName}</td>
         <td key='7' className={`${style.tdBorderR}`} title={sizeFlag&&message.doctorName&&message.doctorName.length>3?message.doctorName:''}>医生:{sizeFlag&&message.doctorName && message.doctorName.length>3?message.doctorName.slice(0,3)+'...':message.doctorName}</td>
-        <td key='8' className={`${style.tdBorderR}`}>门诊号:{message.recordId && message.recordId}</td>
+        <td key='8' className={`${style.tdBorderR}`} title={'门诊号:'+(message.recordId && message.recordId)}>门诊号:{message.recordId && message.recordId}</td>
       </tr>
     </table>;
   }

+ 9 - 1
src/components/PatInfo/index.less

@@ -12,10 +12,18 @@
     white-space: nowrap;
   }
   .tdBorderB {
-      border-bottom: 1px solid @person-table-color;
+    border-bottom: 1px solid @person-table-color;
+    max-width: 180px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
   }
   .tdBorderR {
     border-right: 1px solid @person-table-color;
+    max-width: 180px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
   }
 }
 .newSize{

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

@@ -4,9 +4,7 @@ import { normalVal, filterDataArr, filterOtherDataArr,timestampToTime } from '@u
 import Notify from '@commonComp/Notify';
 import Information from '../Information';
 import $ from "jquery";
-// import AssessResultHis from '@containers/AssessResultHis'
-
-// import "@utils/jqprint";
+import AssessResultHis from '@containers/AssessResultHis'
 
 class PreviewBody extends Component {
   constructor(props) {
@@ -75,11 +73,11 @@ class PreviewBody extends Component {
     }
   }
   render() {
-    const { show, preInfo, dataJson, dataStr, baseObj, flg } = this.props;
+    const { show, preInfo, dataJson, dataStr, baseObj, flg ,showAssessBtn} = this.props;
     const other_yjs = filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other);
     const noData = JSON.stringify(preInfo) == '{}';
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
-      <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "600px" }}>
+      <div className={style['contents']} id="content" style={{ margin: "0 auto", maxWidth: "620px" }}>
         <Information baseObj={baseObj} preInfo={preInfo}></Information>
         <table className={style['infos']}>
           <tr className={style['patInfoFst']}>
@@ -224,7 +222,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>
-        {/*<AssessResultHis inquiryId={baseObj&&baseObj.inquiryCode}></AssessResultHis>*/}
+        {showAssessBtn?<AssessResultHis inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
       </div>
 
       <div onClick={() => { this.surePrint(dataStr) }} style={{

+ 0 - 1
src/components/Treat/AdverseReactions/index.jsx

@@ -10,7 +10,6 @@ class AdverseReactions extends Component {
       
     }
     changeReact(it, index) {
-        console.log('itttttttt', it, index)
         this.props.changeReact(it, index);
     }
 

src/components/Treat/LastTreat/LastDrug/index.jsx → src/components/Treat/DrugHistory/LastDrug/index.jsx


src/components/Treat/LastTreat/LastDrug/index.less → src/components/Treat/DrugHistory/LastDrug/index.less


+ 33 - 0
src/components/Treat/DrugHistory/index.jsx

@@ -0,0 +1,33 @@
+import React, { Component } from 'react';
+import style from './index.less';
+import LastDrug from './LastDrug/index.jsx';
+import info2 from './../img/info2.png';
+import info3 from './../img/info3.png';
+import $ from "jquery";
+
+class DrugHistory extends Component {
+    constructor(props){
+        super(props);
+        this.state = {
+            currentIndex: -1    
+        }
+    }
+   
+
+    render() {
+        const { icon, titleStyle,titleBg, filter, title, drugHistory, showDrugInfo, setDrugInfo } = this.props
+        console.log('1111111111111111')
+        return(
+            (drugHistory['慢病用药内容'] && drugHistory['慢病用药内容'].length > 0 || drugHistory['普通病用药内容'] && drugHistory['普通病用药内容'].length > 0) &&
+            <div className={style['last-treat-wrapper']}>
+                <div className={style['last-treat-title-box']} style={titleStyle}></div>
+                <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
+                {drugHistory['慢病用药内容'].length > 0 && <LastDrug title='普通病用药内容' lastDrugList = {drugHistory['慢病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
+                {drugHistory['普通病用药内容'].length > 0 && <LastDrug title='慢病用药内容' lastDrugList = {drugHistory['普通病用药内容']}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
+            </div>
+        )
+    }
+
+}
+
+export default DrugHistory;

src/components/Treat/LastTreat/index.less → src/components/Treat/DrugHistory/index.less


+ 0 - 33
src/components/Treat/LastTreat/index.jsx

@@ -1,33 +0,0 @@
-import React, { Component } from 'react';
-import style from './index.less';
-import LastDrug from './LastDrug/index.jsx';
-import info2 from './../img/info2.png';
-import info3 from './../img/info3.png';
-import $ from "jquery";
-
-class LastTreat extends Component {
-    constructor(props){
-        super(props);
-        this.state = {
-            currentIndex: -1
-        }
-    }
-   
-
-    render() {
-        const { icon, titleStyle,titleBg, filter, title, lastTreat, showDrugInfo, setDrugInfo } = this.props
-        const { chronicDisMedica, commonDisMedica } = lastTreat
-        return(
-            chronicDisMedica && chronicDisMedica.length > 0 && commonDisMedica && commonDisMedica.length > 0 &&
-            <div className={style['last-treat-wrapper']}>
-                <div className={style['last-treat-title-box']} style={titleStyle}></div>
-                <div className={style['last-treat-title']} ><img className={style['last-treat-icon']} src={icon}/>{title}</div>
-                {commonDisMedica.length > 0 && <LastDrug title='普通病用药内容' lastDrugList = {commonDisMedica}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
-                {chronicDisMedica.length > 0 && <LastDrug title='慢病用药内容' lastDrugList = {chronicDisMedica}  showDrugInfo={showDrugInfo} setDrugInfo={setDrugInfo}></LastDrug>}
-            </div>
-        )
-    }
-
-}
-
-export default LastTreat;

BIN
src/components/Treat/img/adverseReaction.png


BIN
src/components/Treat/img/followUp.png


+ 21 - 5
src/components/Treat/index.jsx

@@ -2,7 +2,7 @@ import React,{ Component } from 'react';
 import style from './index.less';
 import GeneralTreat from './GeneralTreat/index.jsx';
 import DrugTreat from './DrugTreat/index.jsx';
-import LastTreat from './LastTreat/index.jsx';
+import DrugHistory from './DrugHistory/index.jsx';
 import FollowUp from './FollowUp/index.jsx';
 import AdverseReactions from './AdverseReactions/index.jsx';
 import TreatDesc from '@components/TreatDesc'
@@ -12,6 +12,9 @@ import Notify from '@commonComp/Notify'
 import close from './img/close.png';
 import generalIcon from './img/general.png';
 import surgicalIcon from './img/surgical.png';
+import followUpIcon from './img/followUp.png';
+import drugIcon from './img/drug.png';
+import adverseReactionIcon from './img/adverseReaction.png';
 import $ from "jquery";
 
 class Treat extends Component {
@@ -31,6 +34,7 @@ class Treat extends Component {
     
     hideTreat() {
         const { hideTreat,clearTreat, hideDrugInfo } = this.props;
+        
         clearTreat && clearTreat();
         hideTreat && hideTreat();
         hideDrugInfo && hideDrugInfo();
@@ -57,7 +61,7 @@ class Treat extends Component {
       $('#drugWrapper').css({'z-index': 301});
     }
     render(){
-        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, lastTreat, 
+        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, drugHistory, 
                 selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo,
                 title, drugInfoList, hideDrugInfoMore, adversReactionList, changeReact, followUp, setFollowUp, isRead, hasFollowUp} = this.props;
         const { zIndex,show } = this.state
@@ -71,7 +75,7 @@ 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>}
+                        {hasFollowUp && <FollowUp icon={followUpIcon} title='回访时间'   setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
                         {/* 回访时间 */}
                         {/* {followUp && <div>回访时间: 
                             <span  className={style['follow-up-box']}
@@ -79,8 +83,20 @@ class Treat extends Component {
                                     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>}
+                        {console.log('222222', drugHistory)}
+                        { drugHistory && (drugHistory['慢病用药内容'] && drugHistory['慢病用药内容'].length > 0 || drugHistory['普通病用药内容'] && drugHistory['普通病用药内容'].length > 0) &&<DrugHistory icon={drugIcon} 
+                            titleStyle={{background:'#EAF7FA',opacity:'1', filter:'alpha(opacity=100);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=100);'}}
+                            title='上次用药情况' 
+                            drugHistory={drugHistory}  
+                            showDrugInfo = {showDrugInfo} 
+                            setDrugInfo={ setDrugInfo }>
+                        </DrugHistory>}
+                        {adversReactionList&&adversReactionList.length>0&&<AdverseReactions icon={adverseReactionIcon} 
+                            titleStyle={{background:'#C72F2F',opacity:'0.1', filter:'alpha(opacity=10);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=10);'}} 
+                            title='不良反应' 
+                            adversReactionList = {adversReactionList} 
+                            changeReact = {changeReact}>
+                        </AdverseReactions>}
                         <DrugTreat treatment={ treatment } 
                                 selectDrug={selectDrug} 
                                 setOtherRecommend={ setOtherRecommend } 

+ 1 - 1
src/containers/AdviceContainer.js

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

+ 104 - 0
src/containers/AssessResultHis.js

@@ -0,0 +1,104 @@
+import React from 'react';
+import {connect} from 'react-redux';
+import AssessResultHis from '@components/AssessResult/AssessHis';
+import {ISREAD} from '@store/types/homePage.js';
+import {billing} from '@store/async-actions/pushMessage';
+import {getAssessHis,getIndexData} from '@store/async-actions/fetchModules';
+import {SET_ASSESS_DATA,SET_INDEX_DATA} from '@types/assessResult';
+import {SET_ASSESS_HISTORY_DATA,SET_ASSESS_HISTORY_LOADING} from '@types/assessResultHis';
+import store from '@store';
+
+/***
+ * 管理评估逻辑:
+ * 根据推送弹窗显示“智能推荐”,首次无选中项
+ * 评估内容项接口返回,其中整体评估为右侧操作加入
+ * 点确定等同于页面病例保存按钮(同时保存页面数据和评估结果)
+ * 点确定后再次打开,保留上次操作结果(页面清空,引用除外),
+ * 但推荐选项按最新推送显示
+ *
+ * ***/
+
+function mapStateToProps(state) {
+  const {assessResultHis,assessResult} = state;
+  return {
+    list:assessResultHis,    //已获取到的历史评估列表
+    indexData:assessResult.indexData,
+    loading:assessResultHis.loading,
+    timeTypes:assessResult.indexTimeTypes,    //图表切换的维度
+    /*data:assessResultHis.data,
+    timeTypes:assessResultHis.indexTimeTypes,    //图表切换的维度
+    wholeAssessData:assessResultHis.wholeAssess,   //评估内容
+    wholeIndexs:assessResultHis.wholeIndexs,      //已加入评估记录的推送项
+    chooseSelecteds:assessResultHis.chooseSelecteds,    //已选中的选项
+    wholeAssessText:assessResultHis.wholeAssessText,     //整体评估补充说明*/
+  }
+}
+
+function mapDispatchToProps(dispatch) {
+  return {
+    getAssessHis(id){
+      dispatch({
+        type:SET_ASSESS_HISTORY_LOADING,
+        flag:true
+      });
+      dispatch(getAssessHis(id)).then((res)=>{
+        if(res.data.code=='0'){
+          const data = res.data.data[0]&&res.data.data[0].htmlContent;
+          dispatch({
+            type:SET_ASSESS_HISTORY_DATA,
+            id:id,
+            data:JSON.parse(data||null)
+          });
+        }
+        dispatch({
+          type:SET_ASSESS_HISTORY_LOADING,
+          flag:false
+        });
+      }).catch(error=>{
+        dispatch({
+          type:SET_ASSESS_HISTORY_LOADING,
+          flag:false
+        });
+        console.log(error);
+      });
+    },
+    getIndexData(param){        //获取评估图表数据
+      const {range,rangeType,index,pindex,getNew} = param;
+      dispatch(getIndexData(range)).then((res)=>{
+        if(res.data.code=='0'){
+          dispatch({
+            type:SET_INDEX_DATA,
+            data:parseChartData(res.data.data),
+            range,
+            index,
+            rangeType,
+            pindex,
+            getNew
+          });
+        }
+      }).catch(error=>{
+        console.log(error);
+      });
+    },
+  }
+}
+
+function parseChartData(indexData){
+  let arr=[],obj={},temp={};
+  let nameArr=[],nameObj={};  //暂弃
+  if(!indexData){
+    return [];
+  }
+  indexData.itemIndexData.map((it)=>{
+    temp=indexData.indexConfigData.find((i)=>{return it.itemName==i.indexUnique});
+    arr=obj[temp.orderNo]||[];
+    nameArr=nameObj[temp.orderNo]||[];
+    obj[temp.orderNo]=[...arr,it];
+    nameObj[temp.orderNo]=[...nameArr,it.itemName];
+  });
+  //nameObj,obj;
+  return obj;
+}
+const AssessResultHisContainer = connect(mapStateToProps, mapDispatchToProps)(AssessResultHis);
+
+export default AssessResultHisContainer;

+ 2 - 2
src/containers/Treat.js

@@ -8,12 +8,12 @@ import { showDrugInfo } from '../store/actions/treat';
 
 
 function mapStateToProps(state){
-    const { treatment, generalTreat, surgeryTreat, lastTreat, adversReactionList, treatDesc, drugInfo, showDrugInfo, treatItem , drugInfoList, followUp, hasFollowUp} = state.treat;
+    const { treatment, generalTreat, surgeryTreat, drugHistory, adversReactionList, treatDesc, drugInfo, showDrugInfo, treatItem , drugInfoList, followUp, hasFollowUp} = state.treat;
     return {
         treatment: treatment,
         generalTreat: generalTreat,
         surgeryTreat: surgeryTreat,
-        lastTreat: lastTreat,
+        drugHistory: drugHistory,
         adversReactionList: adversReactionList,
         treatDesc: treatDesc,
         drugInfo: drugInfo,

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

@@ -74,7 +74,7 @@ export const clearAllDiag = (state, action) => {
     res.diagnosticStr = action.saveText
     res.mainSuitStr = action.mainSuitStr
     res.diagnosticStrNoType = action.saveText
-    res.chronicMagItem = ''
+    res.chronicMagItem = action.chronicMagItem
     return res;
 }
 

+ 40 - 5
src/store/actions/pushMessage.js

@@ -48,7 +48,6 @@ function getAdviceStr(advice) {
 			} else {
 				AdviceStr = AdviceStr.substring(1, AdviceStr.length) + ', ' + scheme[i].treatment[j].treatmentStr
 			}
-			
 		}
 	}
 	if(commontreatment)  { 
@@ -71,13 +70,16 @@ export const addScheme = (state, action) => {
   let RepeatIndex;
   
   for (let i = 0; i < treatment.length; i++) {
-    let treatmentStr = '';
+		let treatmentStr = '';
+		let drugList = []
     for (let j = 0; j < treatment[i].medicitionsList.length; j++) {
       if(treatment[i].medicitionsList[j].selected) {
 				treatmentStr = treatmentStr + treatment[i].medicitionsList[j].medicitionName + ', '
+				drugList.push({questionId: treatment[i].medicitionsList[j].id, tagName: treatment[i].medicitionsList[j].medicitionName })
 			}
 	}
 	treatment[i].treatmentStr = treatmentStr.substring(0,treatmentStr.length-2)
+	treatment[i].drugList = drugList
   }
   treatItem.treatment = treatment;
   for (let i = 0; i < scheme.length; i++) {
@@ -85,7 +87,6 @@ export const addScheme = (state, action) => {
       isRepeat = true
     }
 	}
-	
   //判断医嘱中是否包含该诊断
   scheme.map((item, index) => {
     if(item.name === treatItem.name) {
@@ -105,6 +106,8 @@ export const addScheme = (state, action) => {
 						} else {
 							scheme[RepeatIndex].treatment[i].treatmentStr = scheme[RepeatIndex].treatment[i].treatmentStr + '' + treatment[j].medicitionsList[z].medicitionName
 						}
+						scheme[RepeatIndex].treatment[i].drugList.push({questionId: treatment[j].medicitionsList[z].id, tagName: treatment[j].medicitionsList[z].medicitionName })
+
 					}
 				}
 			}
@@ -130,10 +133,26 @@ export const addScheme = (state, action) => {
 		}
      
   }
-  res.AdviceStr = getAdviceStr(res.advice)
+	res.AdviceStr = getAdviceStr(res.advice)
+	if (res.advice.scheme) {
+		res.advice.drugList = getDrugList(res.advice.scheme)
+	}
   return res;
 }
 
+//获取开单到医嘱的药品列表
+function getDrugList(scheme) {
+	const drugList = [];
+	for(let i = 0 ;  i < scheme.length; i++) {
+		for(let j = 0; j <scheme[i].treatment.length; j++ ) {
+			for (let z = 0; z < scheme[i].treatment[j].drugList.length; z++) {
+				drugList.push(scheme[i].treatment[j].drugList[z]);
+			}
+		}
+	}
+	return drugList
+}
+
 //设置提示信息
 export const setTips = (state, action) => {
   const res = Object.assign({}, state)
@@ -222,7 +241,8 @@ export const clearAllPushMessage = (state, action) => {
 	res.determine = [];
 	res.assay = [];
 	res.check = [];
-  res.chronicPushItems = [];//量表
+	res.chronicPushItems = [];//量表
+	res.drugList = []; //开单药品列表
 	return res;
 }
 
@@ -251,4 +271,19 @@ export const setAdviceInput = (state, action) => {
 	res.advice.adviceInput = action.adviceInput;
 	res.AdviceStr = getAdviceStr(res.advice)
 	return res;
+}
+
+//保存回访时间
+export const saveFollowUp = (state, action) => {
+	const res = JSON.parse(JSON.stringify(state));
+	res.advice.followUp = action.followUp;
+	return res;
+}
+
+
+//删除回访时间
+export const delFollowUp = (state, action) => {
+	const res = JSON.parse(JSON.stringify(state));
+	res.advice.follow = '';
+	return res;
 }

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

@@ -15,6 +15,7 @@ export const clearTreat = (state, action) => {
     const res = Object.assign({}, state);
     res.generalTreat = '';
     res.surgeryTreat = '';
+    res.drugHistory = {};
     res.treatment = [];
     res.adversReactionList=[];
     res.hasFollowUp = false;
@@ -26,6 +27,7 @@ export const setTreatment = (state, action) => {
     res.treatment = action.treatment;
     res.generalTreat = action.generalTreat;
     res.surgeryTreat = action.surgeryTreat;
+    res.drugHistory= action.drugHistory
     return res
 }
 

+ 1 - 1
src/store/async-actions/historyTemplates.js

@@ -10,7 +10,7 @@ export const initItemList = (item) => {
     const param = {
       "hospitalId": state.hospitalId,
       "patientId": state.patientId,
-      "disName":item?item.name : 'bbb',
+      "disName":item?item.name : 'dis',
       "disType":item?1:0
     }
     return (dispatch) => {

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

@@ -68,6 +68,7 @@ export const saveMessage = (bool) => {
         "sign": whichSign, //类型0结构化 1文本
         "diagnose": (jsonData.diag.length > 0 ? jsonData.diag[0].name : ''), //诊断
         "inquiryCode": state.recordId, //就诊序列号
+        "drugList":baseList.pushMessage.advice.drugList || [],//药品列表
         // "regVisitedState": 0,      //就诊状态
         // "type": 0,
     }).then((res) => {

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

@@ -22,9 +22,8 @@ export const billing = (mdata) => {
   const emrData = getEMRParams();
   const params = {
     age: emrData.age,
-    // featureType: "4,5,6,7,22",
-    featureType: "22",
-    // featureType: "4,5,6,22",
+    featureType: "4,5,6,7,22",
+    // featureType: "22",
     diag: emrData.dis,
     lis: emrData.lis,
     other: emrData.other,

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

@@ -5,6 +5,7 @@ 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, 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';
+import { SAVE_FOLLOW_UP } from "@store/types/pushMessage";
 
 const api={
     push:'/push/pushInner',
@@ -46,10 +47,12 @@ export const addDiagnostic = (item) => {
                 "pacs": emrData.pacs,
                 "sex": emrData.sex,
                 "symptom": emrData.current + emrData.main,
-                "vital": emrData.vital
+                "vital": emrData.vital,
+                "patientId": emrData.patientId,
             };
             //判断是否走慢病系统
-            const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
+            // const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
+            const isChronic = true
             if (isChronic) {
                 let chronicList = JSON.parse(storageLocal.get('chronic'));
                 if(!chronicList){
@@ -141,7 +144,8 @@ export const getTreatResult = (item) =>{
             "pacs": emrData.pacs,
             "sex": emrData.sex,
             "symptom": emrData.current + emrData.main,
-            "vital": emrData.vital
+            "vital": emrData.vital,
+            "patientId": emrData.patientId,
         };
         // const params = {
         //         "age": 20,
@@ -156,7 +160,8 @@ export const getTreatResult = (item) =>{
         //         "symptom": "恶心,呕吐",
         //         "vital": ""
         // }
-        const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
+        // const isChronic = state.diagnosticList.chronicMagItem && state.diagnosticList.chronicMagItem.name||state.mainSuit.chronicDesease && state.mainSuit.chronicDesease.name;
+        const isChronic = true
         if (isChronic) {
             let chronicList = JSON.parse(storageLocal.get('chronic'));
             if(!chronicList){
@@ -194,12 +199,13 @@ function getTreatment(item, dispatch, state,url,params) {
              treat = data.data.data.treat || {}
         }
         if(treat) {
-           let { treatment, commonTreatment, surgeryTreatment, adverseReactions, followUp} = treat
+           let { treatment, commonTreatment, surgeryTreatment, drugHistory, adverseReactions, followUp} = treat
            dispatch({
                 type: SET_TREATMENT,
                 treatment: treatment,
                 generalTreat: commonTreatment,
                 surgeryTreat: surgeryTreatment,
+                drugHistory: drugHistory,
             })
             if (adverseReactions) { //如何之前存过不良反应,则替换成之前的不良反应
                 const allAdversReactionList = state.treat.allAdversReactionList
@@ -370,6 +376,11 @@ export const commonTreatAddToAdvice = () => {
                 type: SET_COMMONTREATMENT,
                 commontreatment: state.treat.treatItem.treat.commonTreatment.text
             })
+            console.log('state.treat.followUp', state.treat.followUp)
+            dispatch({
+                type: SAVE_FOLLOW_UP,
+                followUp: state.treat.followUp
+            })
         } else {
             return
         }

+ 3 - 1
src/store/index.js

@@ -29,6 +29,7 @@ import getInfoByUuid from './reducers/getInfoByUuid';
 import treat from './reducers/treat';
 import currentIll from './reducers/currentIll';
 import assessResult from './reducers/assessResult';
+import assessResultHis from './reducers/assessResultHis';
 
 
 const composeEnhancers =
@@ -64,7 +65,8 @@ const rootReducer = combineReducers({
     getInfoByUuid,
 	checkBody,
     currentIll,
-  assessResult
+  assessResult,
+  assessResultHis
 });
 
 export default createStore(rootReducer, enhancer);

+ 15 - 0
src/store/reducers/assessResultHis.js

@@ -0,0 +1,15 @@
+import {SET_ASSESS_HISTORY_DATA,SET_ASSESS_HISTORY_LOADING} from '@types/assessResultHis';
+
+export default (state={},action)=>{
+  const res = Object.assign({},state);
+  switch (action.type){
+    case SET_ASSESS_HISTORY_DATA:
+      res[action.id] = action.data;
+      return res;
+    case SET_ASSESS_HISTORY_LOADING:
+      res.loading = action.flag;
+      return res;
+    default:
+      return res;
+  }
+}

+ 12 - 3
src/store/reducers/pushMessage.js

@@ -1,5 +1,11 @@
-import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,SAVE_TABLE_RESULT} from '../types/pushMessage';
-import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, setCommontreatment, isFirstMainDiag, setAdviceInput } from '../actions/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, BILLING_ADVICE, ADD_SCHEME, SET_TIPS,  SET_TIPS_DETAILS, 
+        SET_CHANGE_ADVICE_TREATMENT, SET_CHANGE_ADVICE_ASSAY, SET_CHANGE_ADVICE_CHECK, ADD_BILLING,
+        CLEAR_ALL_PUSH_MESSAGE,SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS, SET_COMMONTREATMENT, IS_FIRST_MAIN_DIAG, 
+        SET_ADVICE_INPUT ,SET_CHRONIC_TABLELIST,SHOW_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,
+        SAVE_TABLE_RESULT, SAVE_FOLLOW_UP, DEL_FOLLOW_UP} from '../types/pushMessage';
+import {changeAssay, changeCheck, setAdvice, addScheme, setTips, setTipsDetails, setChangeAdviceTreatment, 
+        setChangeAdviceAssay, setChangeAdviceCheck, addBilling, clearAllPushMessage, showTipsDetails, hideTipsDetails, 
+        setCommontreatment, isFirstMainDiag, setAdviceInput, saveFollowUp, delFollowUp } from '../actions/pushMessage';
 
 const initState = {
   vigilant: [],
@@ -58,11 +64,14 @@ export default function(state = initState, action) {
       return isFirstMainDiag(state, action);
     case SET_ADVICE_INPUT:
       return setAdviceInput(state, action);
+    case SAVE_FOLLOW_UP: 
+      return saveFollowUp(state, action);
+    case DEL_FOLLOW_UP: 
+      return delFollowUp(state, action);
     case SET_CHRONIC_TABLELIST://量表列表数据
       res.tableList = action.data;
       return res;
     case SHOW_TABLE_LIST://显示、隐藏量表列表
-      // res.showList = true;
       res.showHide = Object.assign({},res.showHide,{[action.name]:action.value});
       return res;
     case SET_CHRONIC_PUSHS:

+ 3 - 3
src/store/reducers/treat.js

@@ -68,8 +68,8 @@ const initState = {
     //         ]
     //     }
     // ],
-    lastTreat: {
-        // commonDisMedica: [
+    drugHistory: {
+        // '慢病用药内容': [
         //     {
         //         medicitionName: '泮托拉唑',
         //         id: 145
@@ -79,7 +79,7 @@ const initState = {
         //         id: 341
         //     }
         // ],
-        // chronicDisMedica: [
+        // '普通病用药内容': [
         //     {
         //         medicitionName: '兰索拉唑',
         //         id: 342

+ 2 - 0
src/store/types/assessResultHis.js

@@ -0,0 +1,2 @@
+export const SET_ASSESS_HISTORY_DATA = 'SET_ASSESS_HISTORY_DATA';
+export const SET_ASSESS_HISTORY_LOADING = 'SET_ASSESS_HISTORY_LOADING';

+ 2 - 0
src/store/types/pushMessage.js

@@ -20,5 +20,7 @@ export const SHOW_TABLE_LIST = 'SHOW_TABLE_LIST' ; //显示量表列表
 export const SET_CHRONIC_PUSHS ='SET_CHRONIC_PUSHS'; //右侧慢病量表评估推送模块数据
 export const SET_SCALE_INFO = 'SET_SCALE_INFO' ; //量表明细
 export const SAVE_TABLE_RESULT = 'SAVE_TABLE_RESULT' ; //量表计算结果
+export const SAVE_FOLLOW_UP = 'SAVE_FOLLOW_UP'  //保存回访时间
+export const DEL_FOLLOW_UP = 'DEL_FOLLOW_UP'  //保存回访时间
 
 

+ 56 - 44
src/utils/tools.js

@@ -187,6 +187,8 @@ const getAllDataList =(baseList) =>{           //获取所有模块结构化的
     jsonData.checkBodySelecteds = baseList.checkBody.selecteds;      //主诉选中状态保存
     jsonData.addItems = baseList.homePage.addItems||{};
     jsonData.mainsuitIds = baseList.mainSuit.mainIds;      //主诉去重
+    jsonData.mainChronicDesease = baseList.mainSuit.chronicDesease;      //主诉慢病{}
+    jsonData.diagChronicMagItem = baseList.diagnosticList.chronicMagItem;      //诊断慢病{}
     jsonData.currentIds = baseList.currentIll.symptomIds;      //现病史去重
     jsonData.isFirstMainDiag = baseList.treat.isFirstMainDiag;      //治疗方案
     // console.log(jsonData,'结构化数据获取')
@@ -256,6 +258,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
             data:[],
             saveText:'',
             mainSuitStr: '',
+            chronicMagItem:{}
         });
         store.dispatch({
             type: CLEAR_ALL_PUSH_MESSAGE,
@@ -283,6 +286,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     selecteds:dataJson.mainSuitSelecteds?dataJson.mainSuitSelecteds:[],
                     saveText:JSON.parse(dataJsonStr.chief),
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
+                    chronicDesease:dataJson.mainChronicDesease,
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
@@ -320,7 +324,8 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEAR_ALL_DIAG,
                     data:dataJson.diag,
-                    saveText:dataJsonStr.diag
+                    saveText:dataJsonStr.diag,
+                    chronicMagItem:dataJson.diagChronicMagItem
                 });
                 store.dispatch({
                     type: CLEAR_ALL_PUSH_MESSAGE,
@@ -348,6 +353,7 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                     selecteds:dataJson.mainSuitSelecteds?dataJson.mainSuitSelecteds:[],
                     saveText:dataJsonStr[0].content ? JSON.parse(dataJsonStr[0].content) :[],
                     mainIds:dataJson.mainsuitIds?dataJson.mainsuitIds:[],
+                    chronicDesease:dataJson.mainChronicDesease,
                 });
                 store.dispatch({
                     type: CLEAR_CURRENT_ILL,
@@ -388,7 +394,8 @@ const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清
                 store.dispatch({
                     type: CLEAR_ALL_DIAG,
                     data:dataJson.diag,
-                    saveText:dataJsonStr[6].content ? dataJsonStr[6].content:''
+                    saveText:dataJsonStr[6].content ? dataJsonStr[6].content:'',
+                    chronicMagItem:dataJson.diagChronicMagItem
                 });
                 store.dispatch({
                     type: CLEAR_ALL_PUSH_MESSAGE,
@@ -648,7 +655,8 @@ function getEMRParams(){
     diseaeId = [];
   const age = message.patientAge;
   const sex = message.sex;
-  return {main,current,other,vital,lis,pacs,dis,advice,diseaeId,sex,age};
+  const patientId = message.patientId //病人id,取上次用药
+  return {main,current,other,vital,lis,pacs,dis,advice,diseaeId,sex,age, patientId};
 };
 
 function didPushParamChange(){
@@ -764,36 +772,48 @@ function getPageLength(event) {     //兼容ie8获取页面距离左和上的距
   return page;
 }
 function dragBox(domWrap,domDrag){
+  console.log(domWrap,domDrag,'拖拽')
   let drag = document.getElementById(domDrag);//拖拽区域
   let wrap = document.getElementById(domWrap);//被拖拽的元素
+  let wrapHeight = wrap.offsetHeight;//被拖拽的元素高度
+  let wrapWidth = wrap.offsetWidth;//被拖拽的元素高度
   let width = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;//屏幕宽度
   let height = window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;//屏幕高度
   let mouseX = 0,mouseY = 0,dragX = 0,dragY = 0,isDrag = false,isMove = false;
-  windowEventHandler('mousedown',(event)=>{    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
-    let wrap = document.getElementById(domWrap);
+  windowEventHandler('mousedown',function(event){    //鼠标位置获取,计算点击位置到拖拽元素左边的距离
     let page = getPageLength(event);
-    drag = document.getElementById(domDrag);
     mouseX = page.pageX - wrap.offsetLeft      //鼠标到拖拽元素的左边界的距离
     mouseY = page.pageY - wrap.offsetTop       //鼠标到拖拽元素的上边界的距离
     isDrag = true
-    isMove = false
+    // isMove = false
   },drag)
   // windowEventHandler('mousemove',handleMove,document)
-  windowEventHandler('mousemove',(event)=>{      //移动的
+  windowEventHandler('mousemove',handleMove,document)
+  windowEventHandler('mouseup',()=>{
+    // if(isMove){ //有move就设置位置没有移动就不处理
+    //   console.log(dragX)
+    //   wrap.style.left = dragX + 'px'
+    //   wrap.style.top = dragY + 'px'
+    // }
+    isDrag = false
+    return false
+  },drag)
+
+  function handleMove(event){      //移动的
     let dragDes = document.getElementById('treatDescBox');//展開区域
     let page = getPageLength(event);
     let maxDragX = 0,dragDesWidth = 0;
-    let maxDragY = height - wrap.offsetHeight;//最大可拖拽y方向距离
-
+    let maxDragY = height - wrapHeight;//最大可拖拽y方向距离
+  
     if(domDrag == 'dragTreatTitle'){//最大可推拽x方向距离
       if(dragDes != null){
         dragDesWidth = dragDes.offsetWidth
       }else{
         dragDesWidth = 0
       }
-      maxDragX = width - wrap.offsetWidth - dragDesWidth
+      maxDragX = width - wrapWidth - dragDesWidth
     }else{
-      maxDragX = width - wrap.offsetWidth
+      maxDragX = width - wrapWidth
     }
     if(isDrag){
       dragX = page.pageX - mouseX          //鼠标可拖拽到左边的最大距离
@@ -805,36 +825,25 @@ function dragBox(domWrap,domDrag){
         dragY = 0
       }
       if(domDrag == 'dragTreatTitle'){
-        if(width-dragX-dragDesWidth < wrap.offsetWidth){    //不能超出右边界
+        if(width-dragX-dragDesWidth < wrapWidth){    //不能超出右边界
           dragX = maxDragX
         }
       }else{
-        if(width-dragX < wrap.offsetWidth){    //不能超出右边界
+        if(width-dragX < wrapWidth){    //不能超出右边界
           dragX = maxDragX
         }
       }
-      if(height-dragY < wrap.offsetHeight){     //不能超出下边界
+      if(height-dragY < wrapHeight){     //不能超出下边界
         dragY = maxDragY
       }
-      isMove = true
+      // isMove = true
       wrap.style.left = dragX + 'px'
       wrap.style.marginLeft = 0 + 'px'
       wrap.style.top = dragY + 'px'
     }
-  },document)
-  windowEventHandler('mouseup',()=>{
-    // if(isMove){ //有move就设置位置没有移动就不处理
-      // console.log(dragX)
-      // wrap.style.left = dragX + 'px'
-      // wrap.style.top = dragY + 'px'
-    // }
-    isDrag = false
-    return false
-  },document)
+  }
 }
-// function handleMove(event,mouseX){
-//     console.log(event)
-// }
+
 function getCurrentDate(){
   let myDate = new Date();
   let year = myDate.getFullYear();       //获取完整的年份(4位,1970-????)
@@ -844,20 +853,10 @@ function getCurrentDate(){
   return date;
 }
 function inspectAndAssist(){
-  let obj = {   //添加化验
-    details: [],
-    name: '',
-    questionId: '',
-    showType: 1,
-  }
-  let obj1 = {  //添加辅检
-    name: '',
-    questionId: '',
-    showType: 1,
-    time:getCurrentDate(),
-    value:''
-  }
   const state = store.getState();
+  let mainType = state.typeConfig.typeConfig
+  if(mainType == 1){return}//文本模式不放化验辅检的模板
+
   let tmpAll = state.homePage.allModules;
   let tmpInspected = state.inspect.labelList;
   let tmpAssisted = state.assistCheck.assistLabel;
@@ -872,7 +871,13 @@ function inspectAndAssist(){
     }
   }
   for(let i = 0;i < tmpInspect.length;i++){//化验数据处理
-    let tmpObj = JSON.parse(JSON.stringify(obj));
+    let tmpObj = {   //添加化验
+      details: [],
+      name: '',
+      questionId: '',
+      showType: 1,
+    }
+    // let tmpObj = JSON.parse(JSON.stringify(obj));
     if (tmpInspect[i].controlType == 0) {
       tmpDetail = tmpInspect[i].questionMapping
     }else if(tmpInspect[i].controlType == 1 || tmpInspect[i].controlType == 6){
@@ -884,7 +889,14 @@ function inspectAndAssist(){
     assayArr.push(tmpObj)
   }
   for(let i = 0;i < tmpAssist.length;i++){//辅检数据处理
-    let tmpObj = JSON.parse(JSON.stringify(obj1));
+    let tmpObj = {  //添加辅检
+      name: '',
+      questionId: '',
+      showType: 1,
+      time:getCurrentDate(),
+      value:''
+    }
+    // let tmpObj = JSON.parse(JSON.stringify(obj1));
     tmpObj.questionId = tmpAssist[i].id
     tmpObj.name = tmpAssist[i].name
     checkArr.push(tmpObj)