Explorar el Código

Merge branch 'ChronicMag' into Chronic-ll

Luolei hace 6 años
padre
commit
bea61cd351
Se han modificado 47 ficheros con 1034 adiciones y 280 borrados
  1. 47 0
      src/common/components/MiniToast/index.jsx
  2. 41 0
      src/common/components/MiniToast/index.less
  3. 3 1
      src/common/components/index.js
  4. 0 0
      src/common/images/added.png
  5. 14 26
      src/components/AssessResult/ChartItem/index.jsx
  6. 2 15
      src/components/AssessResult/ChooseItem/index.jsx
  7. 40 20
      src/components/AssessResult/ScaleItem/index.jsx
  8. 32 10
      src/components/AssessResult/index.jsx
  9. 5 0
      src/components/AssessResult/index.less
  10. 108 86
      src/components/ChronicInfo/index.jsx
  11. 26 1
      src/components/ChronicInfo/index.less
  12. 1 1
      src/components/CopyRight/index.less
  13. 1 1
      src/components/CurrentIll/index.jsx
  14. 91 5
      src/components/MainSuit/index.jsx
  15. 33 0
      src/components/MainSuit/index.less
  16. 2 2
      src/components/PushItems/index.jsx
  17. 14 28
      src/components/ScaleTable/index.jsx
  18. 17 5
      src/components/ScaleTable/index.less
  19. 69 0
      src/components/Treat/AdverseReactions/index.jsx
  20. 27 0
      src/components/Treat/AdverseReactions/index.less
  21. 77 0
      src/components/Treat/LastTreat/LastDrug/index.jsx
  22. 14 0
      src/components/Treat/LastTreat/LastDrug/index.less
  23. 34 0
      src/components/Treat/LastTreat/index.jsx
  24. 27 0
      src/components/Treat/LastTreat/index.less
  25. 5 1
      src/components/Treat/index.jsx
  26. 16 6
      src/containers/AssessResult.js
  27. 17 0
      src/containers/ChronicInfo.js
  28. 2 1
      src/containers/CurrentIll.js
  29. 34 2
      src/containers/MainSuit.js
  30. 9 6
      src/containers/PushItemsContainer.js
  31. 11 9
      src/containers/Treat.js
  32. 28 14
      src/store/actions/currentIll.js
  33. 2 0
      src/store/actions/mainSuit.js
  34. 1 0
      src/store/actions/pushMessage.js
  35. 32 22
      src/store/async-actions/homePage.js
  36. 2 2
      src/store/async-actions/patInfo.js
  37. 22 5
      src/store/reducers/assessResult.js
  38. 4 2
      src/store/reducers/currentIll.js
  39. 2 1
      src/store/reducers/homePage.js
  40. 10 1
      src/store/reducers/mainSuit.js
  41. 76 0
      src/store/reducers/treat.js
  42. 3 1
      src/store/types/assessResult.js
  43. 1 0
      src/store/types/currentIll.js
  44. 4 1
      src/store/types/mainSuit.js
  45. 2 1
      src/utils/ajax.js
  46. 1 1
      src/utils/config.js
  47. 25 3
      src/utils/tools.js

+ 47 - 0
src/common/components/MiniToast/index.jsx

@@ -0,0 +1,47 @@
+import React from 'react';
+import style from './index.less';
+import close from "../../images/close-icon.png";
+/**
+*小弹窗,没有蒙层,例如计算公式结果
+*title:弹窗标题
+*icon:标题旁边的icon,不传不显示
+*children:弹窗内容
+*show:弹窗显示
+*footer:是否显示底部“确定”按钮,默认不显示
+*close:关闭弹窗事件
+*confirm:确定事件
+*使用时,父元素需要加相对定位position: relative;
+*/
+class MiniToast extends React.Component{
+  constructor(props){
+    super(props);
+  }
+
+  close(){
+    const {close} = this.props;
+    close&&close();
+  }
+
+  confirm(){
+    const {confirm} = this.props;
+    confirm&&confirm();
+  }
+
+
+  render(){
+    const {show,title,icon,children,footer} = this.props;
+    return <div className={style["infoBox"]} style={{display:show?'block':'none'}}>
+              <p className={style["infoTitle"]}>
+                {icon?<img src={icon} />:''}
+                {title}
+                <img src={close} onClick={this.close.bind(this)} className={style["closeIcon"]}/>
+              </p>
+              <div className={style["infoCon"]}>{children}</div>
+              <div className={style["infoFoot"]} style={{display:footer?'block':'none'}}>
+                <span onClick={this.confirm.bind(this)}>确定</span>
+              </div>
+            </div>
+  }
+}
+
+export default MiniToast;

+ 41 - 0
src/common/components/MiniToast/index.less

@@ -0,0 +1,41 @@
+.infoBox{
+  position: absolute;
+  top:27px;
+  width: 388px;
+  background: #fff;
+  z-index: 66;
+  border: 1px solid #EAEDF1;
+  box-shadow: 0 5px 10px 0 rgba(0,0,0,0.10);
+  .infoTitle{
+    height: 40px;
+    line-height: 40px;
+    padding-left: 18px;
+    // border-bottom: 1px solid #EAEDF1;
+    background: #DFEAFE;
+    img{
+      vertical-align: text-top;
+    }
+    .closeIcon{
+      // vertical-align: middle;
+      float: right;
+    }
+  }
+  .infoCon{
+    padding: 15px 26px 25px;
+  }
+  .infoFoot{
+    text-align: right;
+    // border-top: 1px solid #EAEDF1;
+    padding: 10px 20px 10px 0;
+    span{
+      color:#3B9ED0;
+      display: inline-block;
+      width: 66px;
+      height: 32px;
+      line-height: 32px;
+      text-align: center;
+      border: 1px solid #3B9ED0;
+      border-radius: 4px;
+    }
+  }
+}

+ 3 - 1
src/common/components/index.js

@@ -22,6 +22,7 @@ import Textarea from "./Textarea";
 import NumberUnitPan from "./NumberUnitPan";
 import Add from "./Add";
 import ComplexModal from "./ComplexModal";
+import MiniToast from "./MiniToast";
 
 module.exports = {
     Banner,
@@ -47,5 +48,6 @@ module.exports = {
     Textarea,
     NumberUnitPan,
     Add,
-    ComplexModal
+    ComplexModal,
+    MiniToast
 };

src/common/images/已加入@2x.png → src/common/images/added.png


+ 14 - 26
src/components/AssessResult/ChartItem/index.jsx

@@ -12,9 +12,6 @@ import config from "@config";
 class ChartItem extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      timeDismen:props.timeTypes
-    };
     this.getContainers = this.getContainers.bind(this);
     this.rangChange = this.rangChange.bind(this);
     this.getXAxisArr = this.getXAxisArr.bind(this);
@@ -71,17 +68,15 @@ class ChartItem extends Component {
     }
   }
   rangChange(type,index){
-    const {initFn} = this.props;
+    const {initFn,handleChange} = this.props;
     const times = this.getXAxisArr(type);
     const range = [times[0],times[times.length-1]];
-    const temp=this.state.timeDismen;
-    this.setState({
-      timeDismen:Object.assign(temp,{[index]:type})
-    });
+    const temp=this.props.timeTypes;
     initFn&&initFn({range,rangeType:type,index});
+    handleChange(Object.assign(temp,{[index]:type}));
   }
   getContainers(){
-    const timeTypes = this.state.timeDismen;
+    const timeTypes = this.props.timeTypes;
     const range = this.getXAxisArr(config.chartDismen);
     const obj = this.props.data[range[0]+range[range.length-1]];
     let arr = [];
@@ -113,7 +108,7 @@ class Chart extends Component{
     super(props);
     this.state={
       chartObj:null,
-      timeRange:'year',
+      //timeRange:'year',
       week:props.getXAxisArr('week'),
       month:props.getXAxisArr('month'),
       sixMonth:props.getXAxisArr('sixMonth'),
@@ -127,12 +122,8 @@ class Chart extends Component{
     const xAxis = getXAxisArr(type);
     const id = 'chart'+index;
     let series = [],names=[],inx=-1;
-    let myChart = echarts.init(document.getElementById(id));//this.state['chartObj'+index];
-    /*if(!myChart){
-      this.setState({
-        ['chartObj'+index]:echarts.init(document.getElementById(id))
-      });
-    }*/
+    let myChart = echarts.init(document.getElementById(id));
+
     const interval = {
       week:24,
       month:4,
@@ -142,7 +133,6 @@ class Chart extends Component{
     data&&data.map((it)=>{
       let values=new Array();
       let name='';
-      //values[24]=10;
       it&&it.creatTime.map((x,i)=>{
         inx=xAxis.findIndex((a)=>{
           name=type=='week'?x.substr(0,13):x.substr(0,10);
@@ -208,11 +198,9 @@ class Chart extends Component{
   }
   timeSwitch(type){
     const {handleRangeChange,index} = this.props;
-    this.setState({
-      timeRange:type
-    });
+
     handleRangeChange&&handleRangeChange(type,index);
-    //
+
     const that=this;
     setTimeout(()=>{
       that.drawChart();
@@ -223,13 +211,13 @@ class Chart extends Component{
     this.drawChart();
   }
   render(){
-    const {timeRange} = this.state;
+    const {type} = this.props;
     return <div className={style['cont']}>
               <div className={style['time-range']}>
-                <span className={timeRange=='year'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("year")}>近一年</span>
-                <span className={timeRange=='sixMonth'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("sixMonth")}>近六个月</span>
-                <span className={timeRange=='month'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("month")}>近一个月</span>
-                <span className={timeRange=='week'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("week")}>近一周</span>
+                <span className={type=='year'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("year")}>近一年</span>
+                <span className={type=='sixMonth'?style['range']+" "+style['on']:style['range']} onClick={()=>this.timeSwitch("sixMonth")}>近六个月</span>
+                <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>;

+ 2 - 15
src/components/AssessResult/ChooseItem/index.jsx

@@ -13,15 +13,8 @@ class ChooseItem extends Component {
       saveData:null,
       selecteds:{},
     };
-    //this.setInitState = this.setInitState.bind(this);
   }
-  /*setInitState(){
-    if(this.state.saveData){
-      this.setState({
-        saveData:this.props.data
-      });
-    }
-  }*/
+
   handleRadio(name,value){
     const {selecteds} = this.state;
     const {handleChange} = this.props;
@@ -29,13 +22,7 @@ class ChooseItem extends Component {
       selecteds:Object.assign({},selecteds,{[name]:value})
     });
     handleChange&&handleChange(Object.assign({},selecteds,{[name]:value}));     //不能用this.state.selecteds,因为state更新不是即时的
-    /*const list = item.details.map((it)=>{
-      if(it.detailName==value){
-        return Object.assign(it,{isSelected:true});
-      }else{
-        return Object.assign(it,{isSelected:false});
-      }
-    });*/
+
   }
   handleCheckbox(name,value){
     let {selecteds} = this.state;

+ 40 - 20
src/components/AssessResult/ScaleItem/index.jsx

@@ -7,33 +7,53 @@ import deleteIcon from '@common/images/delete.png';
  * **/
 class ScaleItem extends Component {
   constructor(props) {
-    super(props)
+    super(props);
+    this.state={
+      supplement:''
+    };
+    this.getItems = this.getItems.bind(this);
+    this.getDetailItems = this.getDetailItems.bind(this);
+  }
+  getDetailItems(item,i){
+    let arr = [],temp='';
+    const {indexs} = this.props;
+    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>;
+        }else if(it.type==2){      //计算公式
+          temp = <span>计算公式</span>
+        }else if(it.type==3){
+          temp = <span>可能结果</span>
+        }
+        arr.push(<li>
+          <span>{item.name}:</span>
+          <div className={style['row']}>{temp}</div>
+          <div className={style["recommend"]} onClick={()=>this.props.handleRemove(i,j)}>
+            <img src={deleteIcon} />
+          </div>
+        </li>);
+      }
+    });
+    return arr;
+  }
+  getItems(){
+    const { data } = this.props;
+    return data.map((it,i)=>{
+      return this.getDetailItems(it,i);
+    });
   }
   render() {
-    const {title,data  } = this.props;
+    const {title,handleInp} = this.props;
     return <div className={style['assess-item']}>
       <h2>{title}</h2>
       <div className={style['item-content']}>
         <ul>
+          {
+            this.getItems()
+          }
           <li>
-            <span>糖尿病周围神经病变:</span>
-            <div className={style['row']}>
-              正常
-            </div>
-            <div className={style["recommend"]}>
-              <img src={deleteIcon} />
-            </div>
-          </li>
-          <li>
-            <span>肾功能不全:</span>
-            <div className={style['row']}>
-            </div>
-            <div className={style["recommend"]}>
-              <img src={deleteIcon} />
-            </div>
-          </li>
-          <li>
-            <textarea className={style['edit-row']} name="supplement" id="" rows="6" placeholder='评估描述'></textarea>
+            <textarea className={style['edit-row']} name="supplement" rows="6" placeholder='评估描述' onInput={(e)=>handleInp(e.target.value)}></textarea>
           </li>
         </ul>
       </div>

+ 32 - 10
src/components/AssessResult/index.jsx

@@ -10,40 +10,62 @@ class AssessResult extends Component {
   constructor(props) {
     super(props);
     this.state={
-      chooseSelecteds:{}
+      chooseSelecteds:{},     //大数据选择模块
+      chartTimeTypes:{},      //图表模块
+      wholeAssessItems:props.wholeIndexs,     //整体评估模块
+      wholeAssessText:props.wholeText||''     //整体评估补充说明
     }
-    //this.handleChooseChange = this.handleChooseChange.bind(this);
+    this.handleChooseChange = this.handleChooseChange.bind(this);
+    this.handleScaleDel = this.handleScaleDel.bind(this);
+    this.handleScaleText = this.handleScaleText.bind(this);
   }
   componentWillMount(){
     //获取评估
     this.props.getAssess();
   }
-  handleScaleDel(){
-
+  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);
+    this.setState({
+      wholeAssessItems: items
+    });
   }
   handleChooseChange(i,selects){
     const {chooseSelecteds} = this.state;
     this.setState({
       chooseSelecteds: Object.assign(chooseSelecteds,{[i]:selects})
     });
-    console.log(this.state.chooseSelecteds)
   }
-  handleChartChange(){
-
+  handleChartChange(i,selects){
+    const {chartTimeTypes} = this.state;
+    this.setState({
+      chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
+    });
+  }
+  componentWillUnmount(){
+    //点确定关闭弹窗时把参数传到父组件去
+    const {handleSave,isAssessConfirm} = this.props;
+    isAssessConfirm&&handleSave(this.state);
   }
   handoutTypes(item,i){
-    const {getIndexData,indexData,timeTypes} =this.props;
+    const {getIndexData,indexData,timeTypes,wholeAssessData,wholeIndexs} =this.props;
     //console.log(indexData)
     const chartData = indexData;
     const name = item.regionName+":";
     const list = item.data&&item.data.rows;
     switch (+item.regionType){
       case 0:     //数据来源与右侧手动添加
-        return <ScaleItem title={name} data={list} handleChange={this.handleScaleDel}></ScaleItem>;
+        return <ScaleItem title={name} data={wholeAssessData} handleRemove={this.handleScaleDel} handleInp={this.handleScaleText} indexs={this.state.wholeAssessItems}></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}></ChartItem>;
+        return <ChartItem title={name} data={chartData||{}} timeTypes={timeTypes} initFn={getIndexData} handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
       default:
         return '';
     }

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

@@ -37,10 +37,15 @@
     .row{
       display: inline-block;
     }
+    .scale{
+      color: @blue;
+      cursor: pointer;
+    }
     .recommend{
       max-width: 200px;
       float: right;
       color: #929292;
+      cursor: pointer;
     }
   }
   .edit-row{

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 108 - 86
src/components/ChronicInfo/index.jsx


+ 26 - 1
src/components/ChronicInfo/index.less

@@ -69,8 +69,9 @@
           color:#3B9ED0;
           cursor: pointer;
         }
-        .listResult{
+        .listResult,.addResult{
           float: right;
+          cursor: pointer;
           display: inline-block;
           width: 99px;
           height: 26px;
@@ -85,6 +86,12 @@
             margin:-3px 3px 0 0;
           }
         }
+        .addResult{
+          color: #3B9ED0;
+          text-align: left;
+          padding-left: 5px;
+          cursor: default;
+        }
         .infoBox{
           position: absolute;
           top:27px;
@@ -160,6 +167,24 @@
           }
         }
       }
+      .infoOption{
+        padding: 20px 0;
+      }
+      .infoConBtn{
+        text-align: right;
+        border-top: 1px solid #EAEDF1;
+        padding-top: 10px;
+        span{
+          color:#3B9ED0;
+          display: inline-block;
+          width: 66px;
+          height: 32px;
+          line-height: 32px;
+          text-align: center;
+          border: 1px solid #3B9ED0;
+          border-radius: 4px;
+        }
+      }
       .list:last-child{
         border-bottom:none;
       }

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

@@ -2,7 +2,7 @@
   position: absolute;
   bottom: 0px;      //页面布局
   z-index: 40;
-  width: 418px;
+  width: 450px;
   .disTips{
     padding: 10px 20px 0px 20px;
     font-size: 10px;

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

@@ -57,7 +57,7 @@ class CurrentIll extends Component{
     }else {
       let num = moduleNum.num;//主诉使用了几个模板
       // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
-      if(data.length==0){
+      if(data.length==0 && !isChronic){
         // setData && setData({useEmpty,num,mainData,mainIds});
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回

+ 91 - 5
src/components/MainSuit/index.jsx

@@ -1,13 +1,19 @@
 import React,{Component} from 'react';
 import style from './index.less';
-import {Button,InlineTag,ItemBox,DropDown,DropList,Textarea,Notify} from '@commonComp';
+import {Button,InlineTag,ItemBox,DropDown,DropList,Textarea,Notify,ConfirmModal} from '@commonComp';
 import TailInlineTag from '@commonComp/TailInlineTag';
 import SearchDrop from '@components/SearchDrop';
 import CommonSymptom from '@components/CommonSymptom';
 import chooseType from '@containers/eleType.js';
 import config from "@config/index";
-import {isIE,getPageCoordinate,windowEventHandler,filterDataArr} from "@utils/tools.js"
+import {isIE,getPageCoordinate,windowEventHandler,filterDataArr,getAllDataList,getAllDataStringList,ifOtherClear} from "@utils/tools.js"
+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 $ from 'jquery';
+import store from '@store';
 
 class MainSuit extends Component{
   constructor(props){
@@ -29,6 +35,8 @@ class MainSuit extends Component{
       overFlag:false,
       tmpScroll:0,
       tmpTop:0,
+      activeHistory: -1,
+      showHistoryCase:false
     };
     this.toggleEditable = this.toggleEditable.bind(this);
     this.handleFocus = this.handleFocus.bind(this);
@@ -37,6 +45,11 @@ class MainSuit extends Component{
     this.handleChange = this.handleChange.bind(this);
     this.handleClick = this.handleClick.bind(this);
     this.handleBlur = this.handleBlur.bind(this);
+    this.referRecord = this.referRecord.bind(this);
+    this.noReferRecord = this.noReferRecord.bind(this);
+    this.referCase = this.referCase.bind(this);
+    this.closeHistoryCaseModal = this.closeHistoryCaseModal.bind(this);
+    this.handleQuoteClick = this.handleQuoteClick.bind(this);
   }
   componentWillReceiveProps(nextProps){
     this.setState({boxLeft:nextProps.boxLeft})
@@ -232,7 +245,7 @@ class MainSuit extends Component{
   }
 
   handleBlur(e){//隐藏常见症状下拉、存自由输入的值
-    const {freeText,saveText,datas,clearSearch,getSymptomFeature,currentData} = this.props;
+    const {freeText,saveText,datas,clearSearch,getSymptomFeature,currentData,saveChronic} = this.props;
     const that = this;
     let data = this.state.inpText;
     if(!isIE()){
@@ -241,6 +254,15 @@ class MainSuit extends Component{
       } 
       e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
       freeText && freeText(data.trim());
+      // 慢病模板获取:精确匹配"糖尿病复诊",储存慢病字段
+      // 页面有模板数据 就不在请求
+      let baseList = store.getState();
+      let jsonData = getAllDataList(baseList);
+      let jsonStr = getAllDataStringList(baseList);
+      let flg = ifOtherClear(jsonData,jsonStr,baseList);//除主诉外 其他是否为空
+      if(data.trim()=='糖尿病复诊' && !flg){
+        saveChronic && saveChronic({name:'糖尿病',id:21773});
+      }
     }else{
       if(datas.length==0){
         const ev = e || window.event;
@@ -259,10 +281,67 @@ class MainSuit extends Component{
       },config.delayTime-200); 
   }
 
+  // 慢病
+  referRecord() {//是否引用历史病例弹窗--是
+    const { chronicDesease,closeHisBox } = this.props
+    closeHisBox&&closeHisBox();//关闭
+    this.setState({
+      showHistoryCase:true
+    })
+    store.dispatch(initItemList(chronicDesease));
+  }
+  noReferRecord() {//否
+    const {closeHisBox,autoFillMoudles} = this.props;
+    closeHisBox&&closeHisBox();
+    // 不引用病例 -直接分发模板进行填充
+    autoFillMoudles && autoFillMoudles()
+  }
+  referCase() {
+        const { items } = this.props
+        this.setState({
+          showHistoryCase:false
+        })
+        if (this.state.activeHistory === -1) {
+            return
+        }
+        // let baseList = store.getState(); 
+        let baseObj = items[this.state.activeHistory];
+        pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
+        this.props.getBilling();
+        this.setState({
+            activeHistory: -1
+        })
+    }
+  closeHistoryCaseModal() {//关闭病例列表
+    const {autoFillMoudles} = this.props;
+      this.setState({
+        activeHistory: -1,
+        showHistoryCase:false
+      })
+     // 不引用病例直接分发模板进行填充 
+     autoFillMoudles&&autoFillMoudles();
+  }
+  handleQuoteClick(item, index) {
+      console.log('asadsd', item)
+      this.setState({
+          activeHistory: index
+      })
+  }
+  getHistoryCase() {
+        const { items } = this.props
+        return (<div className={style['history-info']}>
+            {items.map((item, index) => {
+                return<div onClick={this.handleQuoteClick.bind(this, item, index)} style={this.state.activeHistory === index ? {color: '#abcdef'} : ''}>
+                    <img src={this.state.activeHistory === index ? iconRadioActive : iconRadioDefault}/>{item.diagnose}
+                </div>
+            })}
+        </div>)
+    }
+
 
   render(){
-    const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop} = this.props;
-    const {showModule,show,symptom,search} = this.state;
+    const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop,showHisBox} = this.props;
+    const {showModule,show,symptom,search,showHistoryCase} = this.state;
     const symptomFlag = CommonSymptoms.length>0 ? true : false;
     const searchFlag = searchData.length>0 ? true : false;
     const boxTop1 = datas.length>0?boxTop:45;
@@ -286,6 +365,13 @@ class MainSuit extends Component{
       </ItemBox>
       {/*没有推送结果就不显示*/}
       {symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onSelect={this.handleSearchSelect} left={boxLeft1} top={boxTop1} mainEmpty={datas.length==0?true:false}/>:"")}
+      <ConfirmModal visible={showHisBox} okText='是' cancelText='否' confirm={this.referRecord}  cancel={this.noReferRecord} close={this.noReferRecord}>
+          <div className={style['confirm-info']}>是否引用往期病历</div> 
+      </ConfirmModal>
+      <ConfirmModal visible={showHistoryCase} noFooter='true' title='请选择历史病历' close={this.closeHistoryCaseModal} titleBg="#DFEAFE" icon={tableIcon} height={300}>
+        {this.getHistoryCase()}
+        <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
+    </ConfirmModal>
     </div>
   }
 }

+ 33 - 0
src/components/MainSuit/index.less

@@ -22,4 +22,37 @@
             border: 1px solid red !important;
         }
     }
+}
+.confirm-info {
+    height: 70px;
+    font-size: 16px;
+    line-height: 16px;
+    text-align: center;
+    padding: 10px 30px;
+}
+.history-info {
+    height: 185px;
+    overflow-y: auto;
+    padding: 15px;
+    >div{
+        line-height: 26px;
+        img{
+            vertical-align: middle;
+            margin-right: 5px;
+        }
+    }
+}
+.confirm-history-btn {
+    position: absolute;
+    right: 15px;
+    // bottom: 10px;
+    display: inline-block;
+    width: 66px;
+    height: 32px;
+    line-height: 32px;
+    text-align: center;
+    color: #3B9ED0;
+    border: 1px solid #3B9ED0;
+    border-radius: 4px;
+    cursor: pointer;
 }

+ 2 - 2
src/components/PushItems/index.jsx

@@ -145,7 +145,7 @@ class PushItems extends Component {
       tips,
       tmpFlg,
     } = this.props.pushMessage;
-    const { tipsDiscalimer,chronicPushItems} = this.props;
+    const { tipsDiscalimer,chronicPushItems,wholeIndexs} = this.props;
     const { moreAssay, moreCheck ,show} = this.state;
     const {
       showMore,
@@ -407,7 +407,7 @@ class PushItems extends Component {
                 )}
               </div>
             </div>
-            {chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}
+            {chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems} indexs={wholeIndexs}></ChronicInfo>:''}
             <div className={style["tips"]}>
               <h1>
                 <img src={tipsImg} />

+ 14 - 28
src/components/ScaleTable/index.jsx

@@ -1,8 +1,12 @@
 import React from 'react';
 import style from './index.less';
 import mocks from '../../mock/chronicTable.js'
-
-// 量表 具体信息页面
+ 
+/**
+*量表 具体信息页面
+*title:量表标题
+*data:量表内容
+**/
 class ScaleTable extends React.Component{
   constructor(props){
     super(props);
@@ -14,14 +18,15 @@ class ScaleTable extends React.Component{
   }
 
   render(){
-    const {data} = this.props;
-    const content = data && data[1].content;
+    const {data,title} = this.props;
+    const content = data && data[1].content;//表格内容
+    const preContent = data && data[0].content;//表前文字
+    const footContent = data && data[2].content; //表后文字
     const datas = content && JSON.parse(content);
-    console.log(5555,datas);
 
     return <div className={style['tableBox']}>
-            <h1>密西根糖尿病神经筛查表(MDNS)</h1>
-            <p>MDNS可与MNSI联合应用以确定是否存在周围神经病变,在一段时间内对患者进行评分可以评估疾病的进展情况。</p>
+            <h1>{title}</h1>
+            <div dangerouslySetInnerHTML={{__html:preContent}} className={style['textlh']}></div>
             <table className={style['table']}>
               <thead>
                 <tr>
@@ -36,12 +41,10 @@ class ScaleTable extends React.Component{
                     <td>{v.name}</td>
                     <td>
                       {v.details.map((it,index)=>{
-                        /*return <td style={{display:'block'}}>{it.detailName}</td>*/
                         return <td className={style['block']}>
                           <label>
                             <input type="radio" name={v.name} value={it.score} onChange={this.handleChange}/>{it.detailName}
-                            {/*<span style={{display:+it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>*/}
-                            <span style={{display:it.detailName=='正常'?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
+                            <span style={{display:it.state==1?'inline':'none',color:'#3B9ED0'}}>(智能推荐)</span>
                           </label>
                         </td>
                       })}
@@ -61,24 +64,7 @@ class ScaleTable extends React.Component{
                 </tr>
               </tfoot>
             </table>
-            <div>
-              <p>
-                1. 计算方法:<br/>
-              感觉损伤得分=左右两侧感觉检查项目的分数之和<br/>
-              肌力得分=左右两侧肌力检查项目的分数之和<br/>
-              反射得分=左右两侧反射检查项目的分数之和<br/>
-              体格检查得分=感觉损伤得分+肌力得分+反射得分
-              </p>
-              <p>
-                2. 临床体格检查部分:<br/>
-              最低得分0  最高得分46, 分数越高,周围神经病越重
-              </p>
-              {datas&&datas.calculate.range.map((v,i)=>{
-                return <p>
-                  <span>{v.min}~{v.max}</span>&nbsp;<span>{v.text}</span>
-                </p>
-              })}
-            </div>
+            <div dangerouslySetInnerHTML={{__html:footContent}} className={style['textlh']}></div>
           </div>
   }
 }

+ 17 - 5
src/components/ScaleTable/index.less

@@ -14,11 +14,6 @@
   margin: 10px 0 10px;
   border-top: 10px solid #D8D8D8;
   border-bottom: 10px solid #D8D8D8;
-  thead,tfoot{
-    tr{
-      height: 54px;
-    }
-  }
   tr{
     border-bottom: 1px solid #979797;
     td{
@@ -26,10 +21,27 @@
       padding: 7px 0;
     }
   }
+  thead,tfoot{
+    tr{
+      height: 54px;
+    }
+    td{
+      color:#000;
+      font-weight: bold;
+    }
+  }
   .sum{
     text-align: right;
   }
   .block{
     display: block;
   }
+}
+strong{
+  font-weight: bold;
+}
+.textlh{
+  p{
+    line-height: 22px;
+  }
 }

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

@@ -0,0 +1,69 @@
+import React, { Component } from 'react';
+import style from './index.less';
+import info2 from './../img/info2.png';
+import info3 from './../img/info3.png';
+import $ from "jquery";
+
+class AdverseReactions extends Component {
+    constructor(props){
+        super(props);
+        this.state = {
+            currentIndex: -1
+        }
+        this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this);
+        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this);
+        this.setDrugInfo = this.setDrugInfo.bind(this);
+    }
+    handleMouseEnterDrug(index, item) {
+        const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
+        const imgLeft = drugNameWidth/2-8
+        $('#'+item.medicitionName).find('img').css('left', imgLeft)
+        this.setState({
+            currentIndex: index,
+        })
+    }
+    handleMouseLeaveDrug() {
+        this.setState({
+            currentIndex: -1, 
+        })
+    }
+    handleMouseEnterImg() {
+        this.setState({
+            hasEnterImg: true
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            hasEnterImg: false
+        })
+    }
+    setDrugInfo(item) {
+        const { setDrugInfo } = this.props;
+        setDrugInfo && setDrugInfo(item);
+    }
+
+
+    render() {
+        const { icon, titleStyle,titleBg, filter, title, showDrugInfo, setDrugInfo, adversReactionList } = this.props
+        return(
+            <div className={style['last-treat-wrapper']}>
+                { console.log('adversReactionList', adversReactionList) }
+                <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>
+                {adversReactionList.map((item, index) => {
+                    return (<div key={item.id}><span>{item.tagName}:</span>
+                        {item.details.map((item, index) => {
+                            return <span key={item.name}>
+                                <input type="checkbox" checked={item.checked} id={item.name} onChange={()=>{console.log('change')}}/>
+                                <label for={item.name}> {item.name} </label>
+                            </span>
+                        })}
+                    </div>)
+                })}
+            </div>
+        )
+    }
+
+}
+
+export default AdverseReactions;

+ 27 - 0
src/components/Treat/AdverseReactions/index.less

@@ -0,0 +1,27 @@
+.last-treat-wrapper {
+    position: relative;
+    padding: 10px 0 0 0;
+}
+.last-treat-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);";
+}
+.last-treat-title {
+    position: absolute;
+    width: 100%;
+    top: 10px;
+    height: 36px;
+    line-height: 36px;
+    font-weight: bold;
+}
+.last-treat-icon {
+    width: 16px;
+    float: left;
+    margin: 10px;
+}
+
+

+ 77 - 0
src/components/Treat/LastTreat/LastDrug/index.jsx

@@ -0,0 +1,77 @@
+import React, { Component } from 'react';
+import style from './index.less';
+import info2 from './../../img/info2.png';
+import info3 from './../../img/info3.png';
+import $ from "jquery";
+
+class LastDrug extends Component {
+    constructor(props){
+        super(props);
+        this.state = {
+            currentIndex: -1
+        }
+        this.handleMouseLeaveDrug = this.handleMouseLeaveDrug.bind(this);
+        this.handleMouseLeaveImg = this.handleMouseLeaveImg.bind(this);
+        this.setDrugInfo = this.setDrugInfo.bind(this);
+    }
+    handleMouseEnterDrug(index, item) {
+        const drugNameWidth = parseInt($('#'+item.medicitionName)[0].offsetWidth)
+        const imgLeft = drugNameWidth/2-8
+        $('#'+item.medicitionName).find('img').css('left', imgLeft)
+        this.setState({
+            currentIndex: index,
+        })
+    }
+    handleMouseLeaveDrug() {
+        this.setState({
+            currentIndex: -1, 
+        })
+    }
+    handleMouseEnterImg() {
+        this.setState({
+            hasEnterImg: true
+        })
+    }
+    handleMouseLeaveImg() {
+        this.setState({
+            hasEnterImg: false
+        })
+    }
+    setDrugInfo(item) {
+        const { setDrugInfo } = this.props;
+        setDrugInfo && setDrugInfo(item);
+    }
+
+
+    render() {
+        const { icon, titleStyle,titleBg, filter, title, lastDrugList, showDrugInfo } = this.props
+        const  { currentIndex, hasEnterImg } = this.state
+        return(
+             <div className={style['last-common-box']}>
+                <div className={style['last-common-title']}>{title}</div>
+                <div className={style['last-common-list']}>
+                    {lastDrugList.map((item, index) => {
+                        return<span
+                            onMouseEnter={this.handleMouseEnterDrug.bind(this, index, item)}
+                            onMouseLeave = {this.handleMouseLeaveDrug}
+                            id={item.medicitionName}
+                            className={style['last-common-warpper']}
+                            > 
+                            {item.medicitionName} 
+                            {<img className={style['info-img']}  
+                                style ={currentIndex === index  ? {display: "inline-block"} : {display: "none"}}
+                                src={currentIndex === index ?(hasEnterImg ? info3 : info2 ): info2} 
+                                onMouseEnter={this.handleMouseEnterImg.bind(this)}
+                                onMouseLeave = {this.handleMouseLeaveImg}
+                                onClick={() =>{this.setDrugInfo(item);showDrugInfo();}}/>}
+                            {index == lastDrugList.length-1 ?  '' : <span>,</span>}
+                        </span>
+                    })}
+                </div>
+            </div>
+        )
+    }
+
+}
+
+export default LastDrug;

+ 14 - 0
src/components/Treat/LastTreat/LastDrug/index.less

@@ -0,0 +1,14 @@
+.last-common-title {
+    height: 30px;
+    line-height: 30px;
+}
+.last-common-warpper {
+    position: relative;
+    margin: 0 20px 0 0
+}
+.info-img {
+    position: absolute;
+    width: 15px;
+    position: absolute;
+    top: -15px;
+}

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

@@ -0,0 +1,34 @@
+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']}>
+                {console.log('lasttreatTreat', lastTreat)}
+                <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;

+ 27 - 0
src/components/Treat/LastTreat/index.less

@@ -0,0 +1,27 @@
+.last-treat-wrapper {
+    position: relative;
+    padding: 10px 0 0 0;
+}
+.last-treat-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);";
+}
+.last-treat-title {
+    position: absolute;
+    width: 100%;
+    top: 10px;
+    height: 36px;
+    line-height: 36px;
+    font-weight: bold;
+}
+.last-treat-icon {
+    width: 16px;
+    float: left;
+    margin: 10px;
+}
+
+

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

@@ -2,6 +2,8 @@ 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 AdverseReactions from './AdverseReactions/index.jsx';
 import TreatDesc from '@components/TreatDesc'
 import {dragBox,windowRemoveEventHandler} from '@utils/tools'
 import DrugInfo from '@components/TreatDesc/DrugInfo';
@@ -51,7 +53,7 @@ class Treat extends Component {
       $('#drugWrapper').css({'z-index': 301});
     }
     render(){
-        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
+        const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, lastTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore, adversReactionList} = this.props;
         const { zIndex,show } = this.state
         return(
             <div   className={style['treat-wrapper']}>
@@ -63,6 +65,8 @@ class Treat extends Component {
 
                     <div className={style['treat-inner-box']}>
                         <GeneralTreat icon={generalIcon} title='一般治疗'   generalTreat={generalTreat}></GeneralTreat>
+                        {/* <LastTreat icon={generalIcon} title='上次用药情况' lastTreat={lastTreat}  showDrugInfo = {showDrugInfo} setDrugInfo={ setDrugInfo }></LastTreat>
+                        <AdverseReactions icon={generalIcon} title='不良反应' adversReactionList = {adversReactionList}></AdverseReactions> */}
                         <DrugTreat treatment={ treatment } 
                                 selectDrug={selectDrug} 
                                 setOtherRecommend={ setOtherRecommend } 

+ 16 - 6
src/containers/AssessResult.js

@@ -4,7 +4,7 @@ import AssessResult from '@components/AssessResult';
 import {ISREAD} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {getAssessData,getIndexData} from '@store/async-actions/fetchModules';
-import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_INDEX_SUB_TYPE} from '@types/assessResult';
+import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_INDEX_SUB_TYPE,REMOVE_ASSESS_ITEMS} from '@types/assessResult';
 import store from '@store';
 
 /***
@@ -17,8 +17,7 @@ import store from '@store';
  *
  * ***/
 
-function mapStateToProps(state) {
-  //console.log(state)
+function mapStateToProps(state) {console.log(state)
   const {assessResult} = state;
   return {
     data:assessResult.data,
@@ -26,7 +25,10 @@ function mapStateToProps(state) {
     saveIndexData:assessResult.saveIndexData,
     saveData:assessResult.saveData,
     update:assessResult.update,
-    timeTypes:assessResult.indexTimeTypes
+    update1:assessResult.update1,
+    timeTypes:assessResult.indexTimeTypes,
+    wholeAssessData:assessResult.wholeAssess,
+    wholeIndexs:assessResult.wholeIndexs
   }
 }
 
@@ -49,7 +51,8 @@ function mapDispatchToProps(dispatch) {
       const {range,rangeType,index} = param;
       const indexData = state.assessResult.indexData;
       const obj = indexData[range[0]+range[range.length-1]];
-      if(obj&&Object.keys(obj).length!=0){      //该维度已获取过数据
+
+      if(index!=undefined&&obj&&Object.keys(obj).length!=0){      //该维度已获取过数据
         //console.log(obj,rangeType,index);
         /*dispatch({
           type:SET_INDEX_SUB_TYPE,
@@ -71,7 +74,14 @@ function mapDispatchToProps(dispatch) {
       }).catch(error=>{
         console.log(error);
       });
-    }
+    },
+    /*removeAssessResult(pIndex,i){
+      dispatch({
+        type:REMOVE_ASSESS_ITEMS,
+        pIndex,
+        index:i
+      });
+    }*/
   }
 }
 

+ 17 - 0
src/containers/ChronicInfo.js

@@ -2,6 +2,7 @@ import {connect} from 'react-redux';
 import ChronicInfo from '../components/ChronicInfo';
 import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
 import {getTableList,getScaleInfo} from '../store/async-actions/pushMessage';
+import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA} from "@types/assessResult";
 
 function mapStateToProps(state){
   return{
@@ -10,6 +11,8 @@ function mapStateToProps(state){
     tableList: state.pushMessage.tableList,
     showList: state.pushMessage.showList,
     scaleInfo: state.pushMessage.scaleInfo,//量表明细
+    chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
+    update:state.assessResult.update1
   }
 }
 
@@ -24,6 +27,20 @@ function mapDispatchToProps(dispatch){
     },
     getScaleInfo(item){
       dispatch(getScaleInfo(item))
+    },
+    addAssessItem(row,pIndex,i){         //加入评估记录
+      let obj = Object.assign({},row);
+      //obj.details[i].add=true;
+      dispatch({
+        type:ADD_ASSESS_ITEMS,
+        data:obj,
+        index:pIndex,
+        subIndex:i
+      })
+    },
+    //保存管理评估
+    saveAssessInfos(obj){
+      dispatch(Object.assign({},obj,{type:SET_SAVE_ASSESS_DATA}));
     }
   }
 }

+ 2 - 1
src/containers/CurrentIll.js

@@ -42,7 +42,8 @@ function mapStateToProps(state) { //console.log(111,state);
         boxTop:state.homePage.boxTop,
         boxLeft:state.homePage.boxLeft,
         allModules:state.homePage.allModules,
-        isChronic:!!state.diagnosticList.chronicMagItem
+        // isChronic:!!state.diagnosticList.chronicMagItem,
+        isChronic:!!state.mainSuit.chronicDesease,
 
     }
 }

+ 34 - 2
src/containers/MainSuit.js

@@ -1,8 +1,8 @@
 import React from 'react';
 import { connect } from 'react-redux';
 import MainSuit from '@components/MainSuit';
-import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE} from '@store/types/mainSuit';
-import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION} from '@store/types/homePage.js';
+import {CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,CLEAR_SEARCH,SET_SEARCH,SAVE_FREE,SET_DATA,INSERT_SEARCH,SETTEXTMODEVALUE,SET_FEATURE,SAVE_CHRONIC,SHOW_HISTORY_BOX,HIDE_HISTORY_BOX} from '@store/types/mainSuit';
+import {RESET,CLICKCOUNT,ISREAD,SEARCH_DROP_LOCATION,MODI_LOADING} from '@store/types/homePage.js';
 import {getCommSymptoms,getCommSymptomPush} from '@store/async-actions/mainSuit.js'
 import {SET_MAIN_SUIT} from '@store/types/fillInfo';
 import {CLEAR_DIAGNOSE} from '@store/types/diagnosticList';
@@ -11,6 +11,8 @@ import {billing} from '@store/async-actions/pushMessage';
 import {filterArr,didPushParamChange,filterDataArr} from '@utils/tools.js';
 import config from '@config/index.js';
 import {Notify} from '@commonComp';
+import {getInitModules} from '@store/async-actions/homePage.js';
+import {CURRENT_CHRONIC} from '@store/types/currentIll'
 
 function mapStateToProps(state) {//console.log(11,state);
   return {
@@ -38,6 +40,9 @@ function mapStateToProps(state) {//console.log(11,state);
     boxLeft:state.homePage.boxLeft,
     currentData:state.currentIll.data,
     allModules:state.homePage.allModules,
+    chronicDesease:state.mainSuit.chronicDesease,
+    items:state.historyTemplates.items,
+    showHisBox:state.mainSuit.showHisBox,
   }
 }
 
@@ -182,6 +187,33 @@ function mapDispatchToProps(dispatch) {
             data:data
           })
         }
+      },
+      async saveChronic(item){//储存慢病信息
+        // 页面已有数据不再请求
+        
+        // loading
+        dispatch({type:MODI_LOADING,flag:true});
+        // 存慢病
+        dispatch({
+          type:SAVE_CHRONIC,
+          data:item
+        })
+        // 取模板
+        await dispatch(getInitModules);
+        // 模板回来关闭;loading
+        dispatch({type:MODI_LOADING,flag:false});
+        // 弹窗是否引用历史病例?
+        dispatch({type:SHOW_HISTORY_BOX});
+
+      },
+      closeHisBox(){
+        dispatch({type:HIDE_HISTORY_BOX})
+      },
+      getBilling: () => {
+        dispatch(billing())
+      },
+      autoFillMoudles(){//自动填充模板
+        dispatch({type:CURRENT_CHRONIC})//现病史
       }
     }
 }

+ 9 - 6
src/containers/PushItemsContainer.js

@@ -7,14 +7,17 @@ import {billing, getTips, getTipsDetails,getTableList} from '../store/async-acti
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
 function mapStateToProps(state) {
+  const {pushMessage,diagnosticList} = state;
         return {
-        pushMessage: state.pushMessage,
+        pushMessage: pushMessage,
         tipsDiscalimer:  state.copyRight.disContent,
-        chronicMagItem: state.diagnosticList.chronicMagItem,
-        questionId: state.diagnosticList.clickDiag,
-        tableList: state.pushMessage.tableList,
-        showList: state.pushMessage.showList,
-        chronicPushItems: state.pushMessage.chronicPushItems,
+        chronicMagItem: diagnosticList.chronicMagItem,
+        questionId: diagnosticList.clickDiag,
+        tableList: pushMessage.tableList,
+        showList: pushMessage.showList,
+        chronicPushItems: pushMessage.chronicPushItems,
+        wholeIndexs:state.assessResult.wholeIndexs,
+        update:state.assessResult.update1
     }
 }
 

+ 11 - 9
src/containers/Treat.js

@@ -8,16 +8,18 @@ import { showDrugInfo } from '../store/actions/treat';
 
 
 function mapStateToProps(state){
-    const { treat } = state;
+    const { treatment, generalTreat, surgeryTreat, lastTreat, adversReactionList, treatDesc, drugInfo, showDrugInfo, treatItem , drugInfoList} = state.treat;
     return {
-        treatment: treat.treatment,
-        generalTreat: treat.generalTreat,
-        surgeryTreat: treat.surgeryTreat,
-        treatDesc: treat.treatDesc,
-        drugInfo: treat.drugInfo,
-        showDrug: treat.showDrugInfo,
-        treatItem: treat.treatItem,
-        drugInfoList: treat.drugInfoList,   //药品说明书列表(查询多个药品说明书)
+        treatment: treatment,
+        generalTreat: generalTreat,
+        surgeryTreat: surgeryTreat,
+        lastTreat: lastTreat,
+        adversReactionList: adversReactionList,
+        treatDesc: treatDesc,
+        drugInfo: drugInfo,
+        showDrug: showDrugInfo,
+        treatItem: treatItem,
+        drugInfoList: drugInfoList,   //药品说明书列表(查询多个药品说明书)
 
     }
 }

+ 28 - 14
src/store/actions/currentIll.js

@@ -25,20 +25,25 @@ export const setModule = (state,action)=>{
   const originalSonData = action.processModule;
   let spreadLabels=[];
   let sonSpreadLabels=[];//子模板
-  for(let i=0; i<originalData.length;i++){
-    if(originalData[i].tagType==4){
-      spreadLabels.push(...originalData[i].questionMapping);
-    }else{
-      spreadLabels.push(originalData[i]);
+  if(originalData&&originalData.length>0){
+    for(let i=0; i<originalData.length;i++){
+      if(originalData[i].tagType==4){
+        spreadLabels.push(...originalData[i].questionMapping);
+      }else{
+        spreadLabels.push(originalData[i]);
+      }
     }
   }
-  for(let j=0; j<originalSonData.length;j++){
-    if(originalSonData[j].tagType==4){
-      sonSpreadLabels.push(...originalSonData[j].questionMapping);
-    }else{
-      sonSpreadLabels.push(originalSonData[j]);
+  if(originalSonData&&originalSonData.length>0){
+    for(let j=0; j<originalSonData.length;j++){
+      if(originalSonData[j].tagType==4){
+        sonSpreadLabels.push(...originalSonData[j].questionMapping);
+      }else{
+        sonSpreadLabels.push(originalSonData[j]);
+      }
     }
   }
+  
   // res.moduleData = action.data;
   // res.processModule = action.processModule;//病程变化模板
   res.moduleData = spreadLabels;
@@ -88,6 +93,16 @@ function addPos(data,num){
   return newData;
 }
 
+//慢病填充模板
+export const fillChronicModule = (state,action)=>{
+  let res = Object.assign({},state);
+  let moduleData = JSON.parse(JSON.stringify(res.moduleData));//现病史模板
+  res.data = fullfillText(moduleData).newArr;
+  res.saveText = fullfillText(res.data).saveText;
+  res.update=Math.random();
+  return res;
+}
+
 //聚焦时设置 现病史模板
 export const setData = (state,action) =>{
   let res = Object.assign({},state);
@@ -120,18 +135,17 @@ export const setData = (state,action) =>{
   
 
   // 是慢病,暂且使用现病史慢病模板,不区分空模板
-  if(isChronic){
+  /*if(isChronic){
     res.data = fullfillText(moduleData).newArr;
     res.saveText = fullfillText(res.data).saveText;
     res.update=Math.random();
     return res;
-  }
+  }*/
 
   /****************************************/
   // 是否使用空模板:num=0时判断mainIds,num>=1,截取第一病程遍历是否有症状exist
   if(num==0){
-    // useEmpty = mainIds.length>0 ? false:true;
-    useEmpty = mainIds.length==0 && !symptomFeature || symptomFeature.length==0? true:false;
+    useEmpty = mainIds.length>0 ? false:true;
     mainData = mainModleData;
   }else{
     // 模板也分词时得加上分词结果的判断

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

@@ -667,6 +667,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   // res.saveText = fullfillText(action.data).saveText;//解决删除data里的值保存,回读后页面上有内容saveText里没有的情况
   res.selecteds = action.selecteds?action.selecteds:[];
   res.mainIds = action.mainIds;
+  res.chronicDesease = action.chronicDesease;//慢病疾病字段
   if(action.editClear){
     res.editClear = action.editClear;
   }
@@ -676,6 +677,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   if(action.symptomFeature !== undefined){//清除分词数据
     res.symptomFeature.featureData = action.symptomFeature;
   }
+  console.log(res,action);
   return res;
 }
 

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

@@ -222,6 +222,7 @@ export const clearAllPushMessage = (state, action) => {
 	res.determine = [];
 	res.assay = [];
 	res.check = [];
+  res.chronicPushItems = [];//量表
 	return res;
 }
 

+ 32 - 22
src/store/async-actions/homePage.js

@@ -32,7 +32,9 @@ export const getInitModules= (dispatch,getStore)=>{
   const state = getStore();
   const {message} = state.patInfo;
   const {allModules} = state.homePage;
-  const chronicMagItem = state.diagnosticList.chronicMagItem;
+  // const chronicMagItem = state.diagnosticList.chronicMagItem;
+  // const chronicId = chronicMagItem?chronicMagItem.id:'';//诊断为慢病复诊时储存慢病信息到store
+  const chronicMagItem = state.mainSuit.chronicDesease;
   const chronicId = chronicMagItem?chronicMagItem.id:'';//诊断为慢病复诊时储存慢病信息到store
   const param = {
     age:message.patientAge,
@@ -62,27 +64,35 @@ export const getInitModules= (dispatch,getStore)=>{
           type: SETINITDATA,
           data: initData
         });
-        dispatch({
-          type:SET_MAINSUIT,
-          // data:fullfillText(initData.mainSuit).newArr,
-          // addSymptom:fullfillText(initData.addSymptom).newArr,
-          data:initData.mainSuit,
-          addSymptom:initData.addSymptom,
-          addModuleName:initModuleName.addSymptom,//模板名称
-		      // save:initSaveText.mainSuit
-        });
-        dispatch({
-          type:SET_CURRENT,
-          data:formatContinueDots(initData.current),
-          save:initSaveText.current,
-          // processModule:formatContinueDots(initData.process),//病程变化
-          // processModuleName:initModuleName.process,//病程变化模板名称
-          processModule:[],//病程变化
-          processModuleName:'',//病程变化模板名称
-          saveProcess:initSaveText.process,
-          emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
-          saveEmpty:initSaveText.currentEmpty,
-        });
+        if(!chronicId){//普通病
+          dispatch({
+            type:SET_MAINSUIT,
+            data:fullfillText(initData.mainSuit).newArr,
+            addSymptom:fullfillText(initData.addSymptom).newArr,
+            // addModuleName:initModuleName.addSymptom,//模板名称
+            save:initSaveText.mainSuit
+          });
+          dispatch({
+            type:SET_CURRENT,
+            data:formatContinueDots(initData.current),
+            save:initSaveText.current,
+            processModule:formatContinueDots(initData.process),//病程变化
+            processModuleName:initModuleName.process,//病程变化模板名称
+            saveProcess:initSaveText.process,
+            emptyData:formatContinueDots(initData.currentEmpty),//现病史空模板
+            saveEmpty:initSaveText.currentEmpty,
+          });
+        }else{//慢病--没有主诉模板
+          dispatch({
+            type:SET_CURRENT,
+            data:formatContinueDots(initData.current),
+            save:initSaveText.current,
+            processModule:formatContinueDots(initData.process),//病程变化
+            processModuleName:initModuleName.process,//病程变化模板名称
+            // saveProcess:initSaveText.process,
+          });
+        }
+
         dispatch(getOtherHisRecord());          //获取其他史最近记录
       }
     })

+ 2 - 2
src/store/async-actions/patInfo.js

@@ -60,9 +60,9 @@ export const initHistoryDetails = (dispatch) => {
                 }else{
                   dispatch(initItemList(baseList.typeConfig.typeConfig))
                 }
-                dispatch({type:MODI_LOADING});
+                dispatch({type:MODI_LOADING,flag:false});
             } else {
-                dispatch({type:MODI_LOADING});
+                dispatch({type:MODI_LOADING,flag:false});
                 console.log(res)
             }
         })

+ 22 - 5
src/store/reducers/assessResult.js

@@ -1,12 +1,14 @@
-import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_SAVE_ASSESS_DATA,SET_INDEX_SUB_TYPE} from '@types/assessResult';
+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 config from "@config";
 
 const init = {
   data:[],        //评估模块数据
   indexData:{},     //评估图表数据
-  saveData:[],      //保存的评估数据-点确定时保存
-  saveIndexData:{},    //保存的评估图表数据-点确定时保存
   indexTimeTypes:{},    //单个图表选中的维度
+  wholeAssess:[],     //整体评估数据
+  wholeIndexs:{},     //已加入的评估数据的index,加入按钮状态用
+  wholeAssessText:'',   //整体评估补充说明
+  chooseSelecteds:{},   //选项勾选状态
 };
 export default (state=init,action)=>{
   const res = Object.assign({},state);
@@ -34,8 +36,23 @@ export default (state=init,action)=>{
       res.update = Math.random();   //对象更新
       return res;
     case SET_SAVE_ASSESS_DATA:
-      res.saveData = action.data;
-      res.saveIndexData = action.indexData;
+      res.wholeIndexs = action.wholeAssessItems;
+      //res.indexTimeTypes = action.chartTimeTypes;
+      res.wholeAssessText = action.wholeAssessText;
+      res.chooseSelecteds = action.chooseSelecteds;
+      return res;
+    //case CLEAR_ASSESS_DATA:
+    case ADD_ASSESS_ITEMS:
+      res.wholeAssess[action.index] = action.data;
+      let arr = res.wholeIndexs[action.index];
+      res.wholeIndexs[action.index] = arr?[...arr,action.subIndex]:[action.subIndex];
+      res.update1 = Math.random();   //对象更新,与其他字段名不同因为绑定在pushItems,避免不必要的渲染
+      return res;
+    case REMOVE_ASSESS_ITEMS:
+      const {index,pIndex} = action;
+      const temp =[...res.wholeIndexs[pIndex]];
+      res.wholeIndexs[pIndex].splice(temp.findIndex((i)=>i==index),1);
+      //res.wholeAssess[pIndex].details[index].add=false;
       return res;
     default:
       return res;

+ 4 - 2
src/store/reducers/currentIll.js

@@ -2,10 +2,10 @@
 import {SET_CURRENT,CURRENT_CONFIRM,INSERT_PROCESS,SET_CURRENT_DATA,SET_LABEL_MODULE,SETMAINCHECKBOX,
   CURRENT_RADIO,CURRENT_NUMBER,CURRENT_TEXT_LABEL,CLEAR_CURRENT_ILL,SETTEXTMODEVALUE,CURRENT_GET_BIGDATAPUSH,CURRENT_CLEAR,
   SET_CURRENT_SEARCH,SETCURRENTTEXT,CURRENT_FOCUS_INDEX,SELECT_SEARCHDATA,CLEAR_CURRENT_EDIT,CURRENTADDLABELITEM,
-  SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE} from '../types/currentIll';
+  SETCURRENTINPUT,DEL_CURRENT,CURRENT_TEXT_LABEL_NUMBER,REMOVE_CURR_ID,CURRENT_MUL,DEL_CURRENT_LABLE,SET_RADIO_INPUT_VALUE,CURRENT_CHRONIC} from '../types/currentIll';
 import {confirm,insertProcess,setData,setCheckBox,setRadioValue,setNumberValue,changeLabelVal,clearCurrentIll,
   setTextModeValue,setModule,bigDataSymptom,setCheckText,insertLabelData,clearCurrentEdit,addLabelItem,setInputLabel,
-  backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,setRadioInputValue} from '../actions/currentIll';
+  backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,setRadioInputValue,fillChronicModule} from '../actions/currentIll';
 
 const initState = {
   moduleData:[],
@@ -79,6 +79,8 @@ export default function(state=initState,action){
       return delSingleLable(state,action);
     case SET_RADIO_INPUT_VALUE:
       return setRadioInputValue(state,action);
+    case CURRENT_CHRONIC:
+      return fillChronicModule(state,action);
     default:
       return state;
   }

+ 2 - 1
src/store/reducers/homePage.js

@@ -64,7 +64,8 @@ export default function (state=initState,action) {
       res.windowHeight = action.obj.height;
       return res;
     case MODI_LOADING:
-      res.loadingFlag = false;
+      // res.loadingFlag = false;
+      res.loadingFlag = action.flag;
       return res;
     case SEARCH_DROP_LOCATION:
       return searchDropLocation(state,action);

+ 10 - 1
src/store/reducers/mainSuit.js

@@ -2,7 +2,7 @@ import {COMM_SYMPTOMS,CLEAR_COMSYMPTOMS,SHOW_TAIL,INSERT_MAIN,
   SET_SEARCH,CLEAR_SEARCH,GET_BIGDATAPUSH,SET_MAINSUIT,MIX_CONFIRM,NUMBER_SELECT,
   RADIO_SELECT,COMM_CONFIRM,CHANGE_LABELVAL,SAVE_FREE,CLEAR_MAIN_SUIT,SET_DATA,
   INSERT_SEARCH,MAIN_FOCUS_INDEX,SETTEXTMODEVALUE,SETMAINTEXT,MAINADDLABELITEM,SETMAININPUT,DEL_MAIN,CHANGE_LABELVAL_NUMBER,
-  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL} from '../types/mainSuit'
+  REMOVE_MAIN_ID,MAINSUIT_MUL,DEL_MAIN_LABLE,SET_FEATURE,SET_MS_RADIO_INPUT_VAL,SAVE_CHRONIC,SHOW_HISTORY_BOX,HIDE_HISTORY_BOX} from '../types/mainSuit'
 import {getCommSymptoms,handleTailClick,insertMain,setSearch,getBigSymptom,setMainMoudle,confirm,
   setNumberValue,setRadioValue,commConfirm,changeLabelVal,saveFreeVal,clearMainSuit,insertSearch,setTextModeValue,setCheckText,
   addLabelItem,setInputLabel,backspaceText,changeNumLabelVal,removeId,multipleComfirn,delSingleLable,
@@ -99,6 +99,15 @@ export default function(state=initState,action){
       return getSymptomFeature(state,action);
     case SET_MS_RADIO_INPUT_VAL:
       return setRadioInputValue(state,action);
+    case SAVE_CHRONIC:
+      res.chronicDesease = action.data;
+      return res;
+    case SHOW_HISTORY_BOX://显示是否引用历史病例弹窗
+      res.showHisBox = true;
+      return res;
+    case HIDE_HISTORY_BOX://关闭
+      res.showHisBox = false;
+      return res;
     default:
       return state;
   }

+ 76 - 0
src/store/reducers/treat.js

@@ -68,6 +68,82 @@ const initState = {
     //         ]
     //     }
     // ],
+    lastTreat: {
+        commonDisMedica: [
+            {
+                medicitionName: '泮托拉唑',
+                id: 145
+            },
+            {
+                medicitionName: '奥美拉唑',
+                id: 341
+            }
+        ],
+        chronicDisMedica: [
+            {
+                medicitionName: '兰索拉唑',
+                id: 342
+            },
+            {
+                medicitionName: '山莨菪碱',
+                id: 344
+            }
+        ],
+    },
+    adversReactionList:[
+        {
+            id: 40772,
+            name: '低血糖反应',
+            tagName: '低血糖反应',
+            showInfo: '0',
+            controlType: 2,
+            details: [
+                {
+                    name: "无",
+                    value: 0
+                },
+                {
+                    name: "偶尔",
+                    value: 0
+                },
+                {
+                    name: "频",
+                    value: 0
+                }
+            ]
+
+        },
+        {
+            id: 40773,
+            name: '胃肠道不良反应',
+            tagName: '胃肠道不良反应',
+            showInfo: '0',
+            controlType: 2,
+            details: [
+                {
+                    name: "腹胀 ",
+                    value: 0
+                },
+                {
+                    name: "厌食",
+                    value: 0
+                },
+                {
+                    name: "嗳气",
+                    value: 0
+                },
+                {
+                    name: "恶心",
+                    value: 0
+                },
+                {
+                    name: "呕吐",
+                    value: 0
+                }
+            ]
+
+        }
+    ],
     treatDesc:{
         title: '药品推荐',
     }

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

@@ -1,4 +1,6 @@
 export const SET_ASSESS_DATA = 'SET_ASSESS_DATA';     //推送的评估弹窗内容
 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 SET_INDEX_SUB_TYPE = 'SET_INDEX_SUB_TYPE';   //保存单个图表时间维度
+export const ADD_ASSESS_ITEMS = 'ADD_ASSESS_ITEMS';     //加入评估
+export const REMOVE_ASSESS_ITEMS = 'REMOVE_ASSESS_ITEMS';  //整体评估删除

+ 1 - 0
src/store/types/currentIll.js

@@ -26,4 +26,5 @@ export const REMOVE_CURR_ID = 'REMOVE_CURR_ID';     //删除后移除id
 export const CURRENT_MUL = 'CURRENT_MUL';     //单列多选
 export const DEL_CURRENT_LABLE = 'DEL_CURRENT_LABLE';     //
 export const SET_RADIO_INPUT_VALUE = 'SET_RADIO_INPUT_VALUE';
+export const CURRENT_CHRONIC = 'CURRENT_CHRONIC';//慢病填充模板
 

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

@@ -27,4 +27,7 @@ export const REMOVE_MAIN_ID = 'REMOVE_MAIN_ID';     //移除id
 export const MAINSUIT_MUL = 'MAINSUIT_MUL';     //单列多选
 export const DEL_MAIN_LABLE = 'DEL_MAIN_LABLE';     
 export const SET_FEATURE = 'SET_FEATURE';  //主诉分词
-export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL'
+export const SET_MS_RADIO_INPUT_VAL = 'SET_MS_RADIO_INPUT_VAL';
+export const SAVE_CHRONIC = 'SAVE_CHRONIC'; //储存慢病信息
+export const SHOW_HISTORY_BOX = 'SHOW_HISTORY_BOX'; //是否引用历史病例弹窗
+export const HIDE_HISTORY_BOX = 'HIDE_HISTORY_BOX'; //关闭是否引用历史病例弹窗

+ 2 - 1
src/utils/ajax.js

@@ -5,7 +5,8 @@ $.support.cors = true;
 const axios=require('axios');
 const qs=require('querystring');
 const isLocal = window.location.hostname.indexOf('localhost')!=-1;
-const qhost = isLocal?host+prefix:prefix;
+// const qhost = isLocal?host+prefix:prefix;
+const qhost = isLocal?host+prefix:host+prefix;
 axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
 //axios.defaults.baseURL = host;       //默认地址
 // axios.defaults.timeout = 60000;       //请求超时

+ 1 - 1
src/utils/config.js

@@ -4,7 +4,7 @@
 const host='http://192.168.2.236:5050';//后端接口访问地址
 // const host='http://192.168.3.11:5050';//王宇
 //const host='http://192.168.2.164:8080';
-// const host='http://192.168.3.117:8080'; //周铁刚
+// const host='http://192.168.3.117:5050'; //周铁刚
 // const newIcssVisitUrl = '223.93.170.82:13000';    //icss服务访问地址(跳转目的地),不能加http://
 const imageUrlPrefix = 'http://192.168.2.241:82'
 module.exports={

+ 25 - 3
src/utils/tools.js

@@ -241,7 +241,7 @@ const getAllDataStringList =(baseList) =>{           //获取所有模块文本
 const pushAllDataList =(whichSign,action,reData,type) =>{           //回读清空所有的数据
     if(action == 'clear'){     //清空
       const block = Object.assign(JSON.parse(config.textLabel),{full:true});//空白时保留一个自由文本标签
-      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],clearAction:true,symptomFeature:[]});
+      store.dispatch({type: CLEAR_MAIN_SUIT,data:[],saveText:[],selecteds:[],editClear:true,mainIds:[],clearAction:true,symptomFeature:[],chronicDesease:{}});
         store.dispatch({type: CLEAR_CURRENT_ILL,data:[],saveText:[],selecteds:[],editClear:true,symptomIds:[]});
         store.dispatch({type: CLEAROTHERHISTORY,data:[block],isEmpty:true,saveText:[],selecteds:[],editClear:true,yjs_1:'',yjs_2:'',yjs_3:'',yjs_4:''});
         store.dispatch({type: CLEARCHECKBODY,data:[block],isEmpty:true,saveText:[],selecteds:[]});
@@ -586,7 +586,8 @@ function trimDots(str){
 
 //标签间连续标点只保留一个,保留前面一个
 function formatContinueDots(data){
-  let arr=data.filter((it,i)=>{
+  let arr=[];
+  arr=data&&data.filter((it,i)=>{
     if(i==0||(it.name&&(it.name.match(config.punctuationReg))||(data[i-1].name&&data[i-1].name.match(config.punctuationReg)))){
       return it;
     }
@@ -693,6 +694,26 @@ function isAllClear(jsonData,jsonStr,baseList){
     return true;
   }
 }
+//判断除主诉外页面数据是否为空--慢病模板
+function ifOtherClear(jsonData,jsonStr,baseList){
+  if (      //结构化和文本数据都为空
+    JSON.stringify(jsonData.advice) == '{}' &&
+    jsonData.present.length < 1 &&
+    (jsonData.other.length > 0 ? baseList.otherHistory.isEmpty : true) &&
+    (jsonData.vital.length > 0 ? baseList.checkBody.isEmpty : true) &&
+    jsonData.diag.length < 1 &&
+    jsonData.pacs.length < 1 &&
+    jsonData.lis.labelList.length < 1 &&
+    jsonData.lis.getExcelDataList.length < 1 &&
+    filterDataArr(JSON.parse(jsonStr.present)) == '' &&
+    filterDataArr(JSON.parse(jsonStr.other)) == '' &&           //这里都是filterDataArr不是filterArr,要去符号的
+    filterDataArr(JSON.parse(jsonStr.vital)) == ''
+  ) {
+    return false;
+  }else{
+    return true;
+  }
+}
 function normalVal(min,max){
   if((min-0) && (max-0)){
       return `正常值: (${min}~${max})`
@@ -907,5 +928,6 @@ module.exports = {
     dragBox,
     formatContinueDots,
     inspectAndAssist,
-    getCurrentDate
+    getCurrentDate,
+    ifOtherClear
 };