Jelajahi Sumber

Merge branch 'ChronicMag' of http://192.168.2.236:10080/zhouna/newICSS into ChronicMag

zhangxc 6 tahun lalu
induk
melakukan
a04a576e1e
36 mengubah file dengan 1112 tambahan dan 227 penghapusan
  1. 1 0
      src/common/components/MiniToast/index.less
  2. 1 1
      src/common/components/Radio/index.less
  3. 1 1
      src/common/components/Textarea/index.jsx
  4. 16 10
      src/components/AssessResult/ChartItem/index.jsx
  5. 5 16
      src/components/AssessResult/ChooseItem/index.jsx
  6. 7 4
      src/components/AssessResult/ScaleItem/index.jsx
  7. 37 35
      src/components/AssessResult/index.jsx
  8. 115 50
      src/components/ChronicInfo/index.jsx
  9. 15 0
      src/components/ChronicInfo/index.less
  10. 4 4
      src/components/CurrentIll/index.jsx
  11. 2 1
      src/components/DiagnosticItem/index.jsx
  12. 2 1
      src/components/DiagnosticList/index.jsx
  13. 2 1
      src/components/MainSuit/index.jsx
  14. 2 4
      src/components/PreviewBody/index.jsx
  15. 0 14
      src/components/PreviewBody/index.less
  16. 140 21
      src/components/ScaleTable/index.jsx
  17. 65 1
      src/components/ScaleTable/index.less
  18. 1 1
      src/components/Treat/AdverseReactions/index.jsx
  19. 1 1
      src/components/Treat/LastTreat/index.jsx
  20. 18 22
      src/containers/AssessResult.js
  21. 12 3
      src/containers/ChronicInfo.js
  22. 1 1
      src/containers/CurrentIll.js
  23. 7 0
      src/containers/MainSuit.js
  24. 21 0
      src/containers/ScaleTable.js
  25. 19 12
      src/containers/SpreadDrop.js
  26. 506 1
      src/mock/chronicTable.js
  27. 2 2
      src/store/actions/currentIll.js
  28. 8 2
      src/store/actions/mainSuit.js
  29. 50 0
      src/store/async-actions/fetchModules.js
  30. 17 1
      src/store/async-actions/print.js
  31. 5 3
      src/store/async-actions/pushMessage.js
  32. 14 8
      src/store/reducers/assessResult.js
  33. 2 1
      src/store/reducers/mainSuit.js
  34. 10 4
      src/store/reducers/pushMessage.js
  35. 2 1
      src/store/types/assessResult.js
  36. 1 0
      src/store/types/pushMessage.js

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

@@ -36,6 +36,7 @@
       text-align: center;
       border: 1px solid #3B9ED0;
       border-radius: 4px;
+      cursor: pointer;
     }
   }
 }

+ 1 - 1
src/common/components/Radio/index.less

@@ -1,5 +1,5 @@
 .radio{
-  max-width: 120px;
+  // max-width: 120px;
   height: 35px;
   line-height: 35px;
   cursor: pointer;

+ 1 - 1
src/common/components/Textarea/index.jsx

@@ -23,7 +23,7 @@ class Textarea extends Component {
   handleFocus(){            //初始显示props中的值,focus已经显示输入的值,避免值更新闪烁
     const {handleFocus,fuzhen,handleInput,isChronic} = this.props;
     handleFocus&&handleFocus();         //其他史、查体获取数据的方法
-    if(fuzhen&&!isChronic&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
+    if(fuzhen&& !isChronic.name&&!(this.$dom.current.innerText?this.$dom.current.innerText:this.$dom.current.innerHTML)){
       const text = config.currentText.replace("(**)",fuzhen);
       this.$dom.current.innerText?(this.$dom.current.innerText = text):(this.$dom.current.innerHTML = text);
       handleInput&&handleInput({text});

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

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

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

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

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

@@ -8,9 +8,7 @@ import deleteIcon from '@common/images/delete.png';
 class ScaleItem extends Component {
   constructor(props) {
     super(props);
-    this.state={
-      supplement:''
-    };
+    this.$area = React.createRef();
     this.getItems = this.getItems.bind(this);
     this.getDetailItems = this.getDetailItems.bind(this);
   }
@@ -43,6 +41,11 @@ class ScaleItem extends Component {
       return this.getDetailItems(it,i);
     });
   }
+  componentDidMount(){
+    if(this.props.text){
+      this.$area.current.value = this.props.text;
+    }
+  }
   render() {
     const {title,handleInp} = this.props;
     return <div className={style['assess-item']}>
@@ -53,7 +56,7 @@ class ScaleItem extends Component {
             this.getItems()
           }
           <li>
-            <textarea className={style['edit-row']} name="supplement" rows="6" placeholder='评估描述' onInput={(e)=>handleInp(e.target.value)}></textarea>
+            <textarea className={style['edit-row']} ref={this.$area} name="supplement" rows="6" placeholder='评估描述' onBlur={(e)=>handleInp(e.target.value)}></textarea>
           </li>
         </ul>
       </div>

+ 37 - 35
src/components/AssessResult/index.jsx

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

File diff ditekan karena terlalu besar
+ 115 - 50
src/components/ChronicInfo/index.jsx


+ 15 - 0
src/components/ChronicInfo/index.less

@@ -128,6 +128,7 @@
       }
       .blue{
         color:#3B9ED0;
+        cursor: pointer;
       }
       .mainList{
         .listBtn{
@@ -245,3 +246,17 @@
         margin-right: 20px;
       }
     }
+  .chooseItem{
+    display: inline-block;
+    margin-right: 10px;
+  }
+  .forMulBtn{
+    height: 32px;
+    line-height: 32px;
+    text-align: center;
+    color: #fff;
+    background: #DBDBDB;
+    border-radius: 4px;
+    cursor: auto;
+    margin-top: 15px;
+  }

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

@@ -56,12 +56,11 @@ class CurrentIll extends Component{
       })
     }else {
       let num = moduleNum.num;//主诉使用了几个模板
-      // if(editClear && data.length==0){//第一次聚焦去设置现病史的data
-      if(data.length==0 && !isChronic){
-        // setData && setData({useEmpty,num,mainData,mainIds});
+        // isChronic为一个对象
+      if(data.length==0 && !isChronic.name ){
         clearTimeout(setDataTimer);
         setDataTimer = setTimeout(function(){//延时,等待主诉失焦数据返回
-          setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});
+            setData && setData({num,mainData,mainIds,symptomFeature:symptomFeature.featureData,isChronic});   
         },200)  
         this.setState({
           setDataTimer
@@ -71,6 +70,7 @@ class CurrentIll extends Component{
           showMoudle:true,
           forbidInput:false,
           boxEditable:false,
+          setDataTimer
       })
       changeEditIll(false)
       /*const showTimer = setTimeout(function(){

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

@@ -36,7 +36,8 @@ class DiagnosticItem extends Component{
     }
     chooseDiagodal(item) {
         const { diagnosticList,getTips } = this.props;
-        getTips && getTips(item);
+        // getTips && getTips(item);
+        getTips && getTips({id:item.id,type:7});
         for (let i = 0; i < diagnosticList.length; i++) {
             if(diagnosticList[i].id === item.id && diagnosticList[i].name === item.name) {
                 Notify.info('该诊断已存在');

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

@@ -88,7 +88,8 @@ class DiagnosticList extends Component {
     } 
     handleClickDiag(item) {
         const { getTips } = this.props;
-        getTips && getTips(item);
+        // getTips && getTips(item);
+        getTips && getTips({id:item.id,type:7});
     }
     referRecord() {
         const { hideReferRecord, showHistoryCaseModal ,chronicMagItem} = this.props

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

@@ -297,7 +297,7 @@ class MainSuit extends Component{
     autoFillMoudles && autoFillMoudles()
   }
   referCase() {
-        const { items } = this.props
+        const { items ,pureSaveChronic} = this.props
         this.setState({
           showHistoryCase:false
         })
@@ -307,6 +307,7 @@ class MainSuit extends Component{
         // let baseList = store.getState(); 
         let baseObj = items[this.state.activeHistory];
         pushAllDataList(baseObj.sign,'push',baseObj,'history')       //引用
+        pureSaveChronic && pureSaveChronic({name:'糖尿病',id:21773}); //储存慢病疾病
         this.props.getBilling();
         this.setState({
             activeHistory: -1

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

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

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

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

+ 140 - 21
src/components/ScaleTable/index.jsx

@@ -1,36 +1,132 @@
 import React from 'react';
 import style from './index.less';
 import mocks from '../../mock/chronicTable.js'
-import Information from '../Information'
+import { Radio,CheckBtn } from '@commonComp';
+ import Information from '../Information'
 /**
 *量表 具体信息页面
-*title:量表标题
-*data:量表内容
+*title:量表标题/scaleName
+*data:量表内容:scaleName量表标题,calculate量表计算结果,group分组,
+*
+*
 **/
 class ScaleTable extends React.Component{
   constructor(props){
     super(props);
-    this.handleChange = this.handleChange.bind(this);
+    this.state={
+      // originData:props.data && data[1].content|| [],
+      originData:{},
+      selecteds:{}
+    }
+  }
+  handleRadio(name,value){
+    const {selecteds,originData} = this.state;
+    const content = originData && originData[1].content;//表格内容
+    const datas = content && JSON.parse(content);//console.log(1111,originData,datas);
+    this.setState({
+      selecteds:Object.assign({},selecteds,{[name]:value})
+    })
+  }
+  handleCheckbox(name,value){
+    let {selecteds} = this.state;
+    selecteds[name]?selecteds[name]:selecteds[name]=[];
+    const index = selecteds[name].findIndex((i)=>i==value);
+    if(index!=-1){
+      selecteds[name].splice(index,1);
+    }else{
+      selecteds[name].push(value);
+    }
+    this.setState({
+      selecteds:selecteds
+    });
   }
 
-  handleChange(event){
-    console.log(event.target.value);
+  handleFormula(data){
+    const {tableId,getResult,parentId} = this.props; 
+    const params = {
+      type:1,
+      content:data, //选择后的数据--字符串形式
+      id:parentId,
+      scaleId:tableId,
+    }
+    // console.log("调计算接口");
+    // getResult&&getResult(params);
+  }
+  componentWillReceiveProps(nextProps){ 
+    const {tableId} = this.props;
+    if(JSON.stringify(nextProps.scaleInfo) !== '{}'){
+      this.setState({
+        originData:nextProps.scaleInfo[tableId]
+      })
+    }
+  }
+
+  getContent(){
+    const datas = mocks.newData;
+    let {selecteds} = this.state;
+    let content =  datas&&datas.group.map((v,i)=>{
+                return <div className={style['group']}>
+                  <p className={style['groupName']}>{v.groupName}</p>
+                  {v.rows&&v.rows.map((it,ind)=>{
+                    return <div>
+                      {it.row.map((item,index)=>{
+                        if(item.controltype==0){
+                          return <div className={style['block']}>
+                              <p className={style['miniName']}>{item.name}</p>
+                              {item.details&&item.details.map((vv,ii)=>{
+                                return <div className={style['item']}>
+                                      <Radio label={vv.detailName}
+                                         isSelect={selecteds[item.name]==vv.detailName}
+                                         handleClick={this.handleRadio.bind(this,item.name,vv.detailName)}>
+                                      </Radio>
+                                      {vv.state==1?<span style={{color:'#3B9ED0'}}>(智能推荐)</span>:''}
+                                  </div>
+                              })}
+                              
+                            </div>
+                          }else{
+                            return <div className={style['block']}>
+                                <p className={style['miniName']}>{item.name}</p>
+                                  {item.details&&item.details.map((vv,ii)=>{
+                                    return <CheckBtn value={vv.detailName}
+                                                    label={vv.detailName}
+                                                    isSelect={selecteds[v.name]&&selecteds[item.name].includes(vv.detailName)}
+                                                    handleClick={this.handleCheckbox.bind(this,item.name,vv.detailName)}>
+                                          </CheckBtn>
+                                    {vv.state==1?<span style={{color:'#3B9ED0'}}>(智能推荐)</span>:''}
+                                  })}
+                            </div>
+                          }
+                        
+                      })}
+                    </div>
+                  })}
+                  {v.groupCalculate.isShow=='1(1-显示计算结果,0-不显示计算结果)'?<p className={style['subTotal']}>
+                    <span>计分</span>
+                    <span>{v.groupCalculate.result.value}</span>
+                  </p>:''}  
+                </div>
+              })
+    return content;
   }
 
   render(){
-    const {data,title} = this.props;
+    const {title,scaleInfo,tableId} = this.props;
+    const data = scaleInfo[tableId];
+    let {selecteds} = this.state;
     const content = data && data[1].content;//表格内容
     const preContent = data && data[0].content;//表前文字
     const footContent = data && data[2].content; //表后文字
-    const datas = content && JSON.parse(content);
-
+    // const datas = content && JSON.parse(content);
+    const datas = mocks.newData;
     return <div className={style['tableBox']} id="printcontent">
             <div className={style['printShow']}>
               <Information></Information>
             </div> 
-            <h1>{title}</h1>
+            {/*<h1>{title}</h1>*/}
+            <h1>{datas.scaleName}</h1>
             <div dangerouslySetInnerHTML={{__html:preContent}} className={style['textlh']}></div>
-            <table className={style['table']}>
+            {/*<table className={style['table']}>
               <thead>
                 <tr>
                   {datas&&datas.title.map((v,i)=>{
@@ -43,14 +139,26 @@ class ScaleTable extends React.Component{
                     return <tr>
                     <td>{v.name}</td>
                     <td>
-                      {v.details.map((it,index)=>{
-                        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>
-                          </label>
-                        </td>
-                      })}
+                      {v.controltype==0?v.details.map((it,index)=>{
+                          return <td className={style['block']}>
+                            <Radio label={it.detailName}
+                                   id={it.id}
+                                   isSelect={selecteds[v.name]==it.detailName}
+                                   handleClick={this.handleRadio.bind(this,v.name,it.detailName)}>
+                            </Radio>
+                            {it.state==1?<span style={{color:'#3B9ED0'}}>(智能推荐)</span>:''}
+                          </td>
+                        }):v.details.map((it,index)=>{
+                          return <td className={style['block']}>
+                              <CheckBtn id={it.detailName}
+                                        value={it.detailName}
+                                        label={it.detailName}
+                                        isSelect={selecteds[v.name]&&selecteds[v.name].includes(it.detailName)}
+                                        handleClick={this.handleCheckbox.bind(this,v.name,it.detailName)}>
+                              </CheckBtn>
+                            </td>
+                        })
+                    }
                     </td>
                     <td>
                       {v.details.map((it,index)=>{
@@ -63,10 +171,21 @@ class ScaleTable extends React.Component{
               </tbody>
               <tfoot>
                 <tr>
-                  <td colspan="4" className={style['sum']}>总计:</td>
+                  <td colspan="4" className={style['sum']}>
+                  总计:<i>95</i>
+                  <span className={style['formulaBtn']} onClick={this.handleFormula.bind(this,datas)}>计算</span>
+                  </td>
                 </tr>
               </tfoot>
-            </table>
+            </table>*/}
+            <div className={style['textContent']}>
+              {this.getContent()}
+              <div className={style['total']}>
+                <span>总分:</span>
+                <span>{datas.calculate.result.value||'54' +'分'}</span>
+                <span className={style['totalBtn']}>得分</span>
+              </div>
+            </div>
             <div dangerouslySetInnerHTML={{__html:footContent}} className={style['textlh']}></div>
           </div>
   }

+ 65 - 1
src/components/ScaleTable/index.less

@@ -11,7 +11,7 @@
 }
 .table{
   width: 100%;
-  margin: 10px 0 10px;
+  margin: 10px 0;
   border-top: 10px solid #D8D8D8;
   border-bottom: 10px solid #D8D8D8;
   tr{
@@ -32,6 +32,25 @@
   }
   .sum{
     text-align: right;
+    i{
+      display: inline-block;
+      min-width: 30px;
+      border-bottom: 1px solid #979797;
+      text-align: center;
+    }
+    .formulaBtn{
+      display: inline-block;
+      width: 50px;
+      height: 30px;
+      line-height: 30px;
+      text-align: center;
+      color:#fff;
+      background: #3B9ED0;
+      border-radius: 4px;
+      margin-left: 10px;
+      cursor: pointer;
+      font-weight: normal;
+    }
   }
   .block{
     display: block;
@@ -45,6 +64,51 @@ strong{
     line-height: 22px;
   }
 }
+.textContent{
+  margin: 40px 0 30px;
+  .group{
+    border-bottom: 4px solid #EBEBEB;
+    // margin-bottom: 25px;
+    margin-top: 25px;
+    .item{
+      display: inline-block;
+      margin-right: 24px;
+    }
+    .miniName{
+      margin-top: 25px;
+    }
+  }
+  .groupName{
+    font-size: 14px;
+    font-weight: bold;
+    color:#000;
+    margin: 25px 0;
+  }
+  .subTotal{
+    height: 49px;
+    line-height: 49px;
+    border-top: 1px solid #EBEBEB;
+    text-align: right;
+  }
+  .total{
+    height: 72px;
+    line-height: 72px;
+    border-bottom: 10px solid #EBEBEB;
+    text-align: right;
+    .totalBtn{
+      display: inline-block;
+      width: 64px;
+      height: 32px;
+      line-height: 32px;
+      color:#3B9ED0;
+      border: 1px solid #3B9ED0;
+      border-radius: 4px;
+      margin-left: 40px;
+      text-align: center;
+      cursor: auto;
+    }
+  }
+}
 .printShow {
   display: none;
 }

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

@@ -39,4 +39,4 @@ class AdverseReactions extends Component {
 
 }
 
-export default AdverseReactions;
+export default AdverseReactions;

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

@@ -30,4 +30,4 @@ class LastTreat extends Component {
 
 }
 
-export default LastTreat;
+export default LastTreat;

+ 18 - 22
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,REMOVE_ASSESS_ITEMS} from '@types/assessResult';
+import {SET_ASSESS_DATA,SET_INDEX_DATA,SET_INDEX_SUB_TYPE,REMOVE_ASSESS_ITEMS,CLEAR_INDEX_DATA} from '@types/assessResult';
 import store from '@store';
 
 /***
@@ -17,18 +17,20 @@ import store from '@store';
  *
  * ***/
 
-function mapStateToProps(state) {//console.log(state)
+function mapStateToProps(state) {
   const {assessResult} = state;
   return {
     data:assessResult.data,
     indexData:assessResult.indexData,
     saveIndexData:assessResult.saveIndexData,
     saveData:assessResult.saveData,
-    update:assessResult.update,
-    update1:assessResult.update1,
-    timeTypes:assessResult.indexTimeTypes,
-    wholeAssessData:assessResult.wholeAssess,
-    wholeIndexs:assessResult.wholeIndexs
+    update:assessResult.update,     //评估数据更新
+    update1:assessResult.update1,       //加入记录更新
+    timeTypes:assessResult.indexTimeTypes,    //图表切换的维度
+    wholeAssessData:assessResult.wholeAssess,   //评估内容
+    wholeIndexs:assessResult.wholeIndexs,      //已加入评估记录的推送项
+    chooseSelecteds:assessResult.chooseSelecteds,    //已选中的选项
+    wholeAssessText:assessResult.wholeAssessText,     //整体评估补充说明
   }
 }
 
@@ -47,20 +49,7 @@ function mapDispatchToProps(dispatch) {
       });
     },
     getIndexData(param){
-      const state=store.getState();
-      const {range,rangeType,index} = param;
-      const indexData = state.assessResult.indexData;
-      const obj = indexData[range[0]+range[range.length-1]];
-
-      if(index!=undefined&&obj&&Object.keys(obj).length!=0){      //该维度已获取过数据
-        //console.log(obj,rangeType,index);
-        /*dispatch({
-          type:SET_INDEX_SUB_TYPE,
-          index,
-          rangeType
-        });*/
-        return ;
-      }
+      const {range,rangeType,index,pindex,getNew} = param;
       dispatch(getIndexData(range)).then((res)=>{
         if(res.data.code=='0'){
           dispatch({
@@ -68,13 +57,20 @@ function mapDispatchToProps(dispatch) {
             data:parseChartData(res.data.data),
             range,
             index,
-            rangeType
+            rangeType,
+            pindex,
+            getNew
           });
         }
       }).catch(error=>{
         console.log(error);
       });
     },
+    clearChartData(){
+      dispatch({
+        type:CLEAR_INDEX_DATA
+      })
+    }
     /*removeAssessResult(pIndex,i){
       dispatch({
         type:REMOVE_ASSESS_ITEMS,

+ 12 - 3
src/containers/ChronicInfo.js

@@ -1,8 +1,10 @@
 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 {getTableList,getScaleInfo,getTips} from '../store/async-actions/pushMessage';
 import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA} from "@types/assessResult";
+import {saveMessage} from "../store/async-actions/print";
+import {saveClickNum} from '@store/async-actions/homePage';
 
 function mapStateToProps(state){
   return{
@@ -10,9 +12,10 @@ function mapStateToProps(state){
     questionId: state.diagnosticList.clickDiag,
     tableList: state.pushMessage.tableList,
     showList: state.pushMessage.showList,
-    scaleInfo: state.pushMessage.scaleInfo,//量表明细
+    scaleInfo: state.pushMessage.scaleInfo,//量表内容
     chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
-    update:state.assessResult.update1
+    update:state.assessResult.update1,
+    formulaResult:state.pushMessage.formulaResult //量表信息
   }
 }
 
@@ -41,6 +44,12 @@ function mapDispatchToProps(dispatch){
     //保存管理评估
     saveAssessInfos(obj){
       dispatch(Object.assign({},obj,{type:SET_SAVE_ASSESS_DATA}));
+      dispatch(saveClickNum);
+      dispatch(() => saveMessage())
+    },
+    // 获取量表静态知识
+    getInfomation(item){
+      dispatch(getTips(item));
     }
   }
 }

+ 1 - 1
src/containers/CurrentIll.js

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

+ 7 - 0
src/containers/MainSuit.js

@@ -207,6 +207,13 @@ function mapDispatchToProps(dispatch) {
         dispatch({type:SHOW_HISTORY_BOX});
 
       },
+      pureSaveChronic(item){//引用病例时储存
+        // 存慢病
+        dispatch({
+          type:SAVE_CHRONIC,
+          data:item
+        })
+      },
       closeHisBox(){
         dispatch({type:HIDE_HISTORY_BOX})
       },

+ 21 - 0
src/containers/ScaleTable.js

@@ -0,0 +1,21 @@
+import {connect} from 'react-redux';
+import ScaleTable from '@components/ScaleTable';
+import {getFormulaResult} from '@store/async-actions/fetchModules.js'
+
+function mapStateToProps (state){
+  return {
+    scaleInfo: state.pushMessage.scaleInfo,//量表内容
+    formulaResult:state.pushMessage.formulaResult //计算结果
+  }
+}
+
+function mapDispatchToProps (dispatch){
+  return {
+    getResult(obj){//计算结果
+      dispatch(getFormulaResult(obj));
+    }
+  }
+}
+
+const ScaleTableContainer = connect(mapStateToProps,mapDispatchToProps)(ScaleTable);
+export default ScaleTableContainer;

+ 19 - 12
src/containers/SpreadDrop.js

@@ -154,18 +154,25 @@ function currentIll(dispatch,store,params){
   fetchModules(ids).then((res)=>{
     if(+res.data.code===0){
       const list = res.data.data;
-      existsId.map((i)=>{
-        // has.push(...list[i].questionMapping);
-        has.push(list[i]);
-      });
-      withsId.map((i)=>{
-        // wes.push(...list[i].questionMapping);
-        wes.push(list[i]);
-      });
-      dispatch({
-        type: CURRENT_CONFIRM,
-        data: {exists:has,withs:wes,nones:nones,ikey,ban,noneIds}
-      });
+      if(list&&list.length>0){
+        existsId.map((i)=>{
+          // has.push(...list[i].questionMapping);
+          has.push(list[i]);
+        });
+        withsId.map((i)=>{
+          // wes.push(...list[i].questionMapping);
+          wes.push(list[i]);
+        });
+        dispatch({
+          type: CURRENT_CONFIRM,
+          data: {exists:has,withs:wes,nones:nones,ikey,ban,noneIds}
+        });
+      }else{
+        dispatch({
+          type: CURRENT_CONFIRM,
+          data: {exists,withs,nones,ikey,ban,noneIds}
+        });
+      }
       dispatch({    //自由文本标签数据更新
         type:ISREAD
       });

+ 506 - 1
src/mock/chronicTable.js

@@ -84,5 +84,510 @@ module.exports = {
             ]
         }
     ]
-  }
+  },
+  newData:{
+    "scaleType":"1(1-评分量表)",
+    "scaleName":"危重病人APACHE II评分表",
+    "calculate":{
+        "result":{
+            "value":"",
+            "unit":"",
+            "text":""
+        },
+        "formula":"sum(分值*系数+常数)",
+        "range":[
+
+        ]
+    },
+    "group":[
+        {
+            "groupName":"A.年龄",
+            "title":{
+                "columns":[
+                    {
+                        "name":"指标名称",
+                        "column":"name"
+                    },
+                    {
+                        "name":"指标范围",
+                        "column":"detailName"
+                    },
+                    {
+                        "name":"得分",
+                        "column":"score"
+                    }
+                ],
+                "isShow":"1(1-标题展示,0-标题不展示)"
+            },
+            "groupCalculate":{
+                "result":{
+                    "value":"",
+                    "unit":"",
+                    "text":""
+                },
+                "isShow":"1(1-显示计算结果,0-不显示计算结果)"
+            },
+            "rows":[
+                {
+                    "mutex":"0(0-非互斥,1-互斥)",
+                    "required":"1(1-必填项,0-选填项)",
+                    "row":[
+                        {
+                            "coefficent":1,
+                            "constant":0,
+                            "details":[
+                                {
+                                    "detailName":"≤44",
+                                    "score":"0.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"45-54",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"55-64",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"65-74",
+                                    "score":"5.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"年龄",
+                            "controltype":0
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "groupName":" B.有严重器官系统功能不全或免疫损害",
+            "title":{
+                "columns":[
+                    {
+                        "name":"指标名称",
+                        "column":"name"
+                    },
+                    {
+                        "name":"指标范围",
+                        "column":"detailName"
+                    },
+                    {
+                        "name":"得分",
+                        "column":"score"
+                    }
+                ],
+                "isShow":"0"
+            },
+            "groupCalculate":{
+                "result":{
+                    "value":"",
+                    "unit":"",
+                    "text":""
+                },
+                "isShow":"1(1-显示计算结果,0-不显示计算结果)"
+            },
+            "rows":[
+                {
+                    "mutex":"0",
+                    "required":"1",
+                    "row":[
+                        {
+                            "coefficent":1,
+                            "constant":0,
+                            "details":[
+                                {
+                                    "detailName":"非手术或择期手术后",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"不能手术或急诊手术后",
+                                    "score":"5.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"无上述情况",
+                                    "score":"0.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"有严重器官系统功能不全或免疫损害",
+                            "controltype":0
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "groupName":" C. GCS评分",
+            "title":{
+                "columns":[
+                    {
+                        "name":"指标名称",
+                        "column":"name"
+                    },
+                    {
+                        "name":"指标选项",
+                        "column":"detailName"
+                    },
+                    {
+                        "name":"得分",
+                        "column":"score"
+                    }
+                ],
+                "isShow":"0"
+            },
+            "groupCalculate":{
+                "result":{
+                    "value":"",
+                    "unit":"",
+                    "text":""
+                },
+                "isShow":"1(1-显示计算结果,0-不显示计算结果)"
+            },
+            "rows":[
+                {
+                    "mutex":"0",
+                    "required":"1",
+                    "row":[
+                        {
+                            "coefficent":-1,
+                            "constant":5,
+                            "details":[
+                                {
+                                    "detailName":"自动睁眼",
+                                    "score":"4.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"呼唤睁眼",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"刺疼睁眼",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"不能睁眼",
+                                    "score":"1.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"1.睁眼反应",
+                            "controltype":0
+                        }
+                    ]
+                },
+                {
+                    "mutex":"0",
+                    "required":"1",
+                    "row":[
+                        {
+                            "coefficent":-1,
+                            "constant":5,
+                            "details":[
+                                {
+                                    "detailName":"回答切题",
+                                    "score":"5.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"回答不切题",
+                                    "score":"4.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"答非所问",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"只能发音",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"不能言语",
+                                    "score":"1.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"2.语言反应",
+                            "controltype":0
+                        }
+                    ]
+                },
+                {
+                    "mutex":"0",
+                    "required":"1",
+                    "row":[
+                        {
+                            "coefficent":-1,
+                            "constant":5,
+                            "details":[
+                                {
+                                    "detailName":"按吩咐动作",
+                                    "score":"6.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"刺疼能定位",
+                                    "score":"5.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"刺疼能躲避",
+                                    "score":"4.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"刺疼肢体屈曲",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"刺疼肢体伸展",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"不能活动",
+                                    "score":"1.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"3.运动反应",
+                            "controltype":0
+                        }
+                    ]
+                }
+            ]
+        },
+        {
+            "groupName":" D.生理指标",
+            "title":{
+                "columns":[
+                    {
+                        "name":"指标名称",
+                        "column":"name"
+                    },
+                    {
+                        "name":"指标范围",
+                        "column":"detailName"
+                    },
+                    {
+                        "name":"得分",
+                        "column":"score"
+                    }
+                ],
+                "isShow":"0"
+            },
+            "groupCalculate":{
+                "result":{
+                    "value":"",
+                    "unit":"",
+                    "text":""
+                },
+                "isShow":"1(1-显示计算结果,0-不显示计算结果)"
+            },
+            "rows":[
+                {
+                    "mutex":"0",
+                    "required":"1",
+                    "row":[
+                        {
+                            "coefficent":1,
+                            "constant":0,
+                            "details":[
+                                {
+                                    "detailName":"≥41",
+                                    "score":"4.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"39-40.9",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"38.5-38.9",
+                                    "score":"1.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"36-38.4",
+                                    "score":"0.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"34-35.9",
+                                    "score":"1.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"32-33.9",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"30-31.9",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"≤29.9",
+                                    "score":"4.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"1.体温(腋下℃)",
+                            "controltype":0
+                        }
+                    ]
+                },
+                {
+                    "mutex":"0",
+                    "required":"0",
+                    "row":[
+                        {
+                            "coefficent":1,
+                            "constant":0,
+                            "details":[
+                                {
+                                    "detailName":">70",
+                                    "score":"0.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"61-70",
+                                    "score":"1.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"55-60",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"<55",
+                                    "score":"4.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"PaO2(mmHg)(FiO2<50%)",
+                            "controltype":0
+                        },
+                        {
+                            "coefficent":1,
+                            "constant":0,
+                            "details":[
+                                {
+                                    "detailName":"≥500",
+                                    "score":"4.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"350-499",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"200-349",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"<200",
+                                    "score":"0.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"A-aDO2(FiO2>50%)",
+                            "controltype":0
+                        }
+                    ]
+                },
+                {
+                    "mutex":"0",
+                    "required":"1",
+                    "row":[
+                        {
+                            "coefficent":2,
+                            "constant":0,
+                            "details":[
+                                {
+                                    "detailName":"≥3.5",
+                                    "score":"4.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"2-3.4",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"1.5-1.9",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"0.6-1.4",
+                                    "score":"0.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"<0.6",
+                                    "score":"2.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"9.血清肌酐(mg/dL)-急性肾功能衰竭",
+                            "controltype":0
+                        },
+                        {
+                            "coefficent":1,
+                            "constant":0,
+                            "details":[
+                                {
+                                    "detailName":"≥3.5",
+                                    "score":"4.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"2-3.4",
+                                    "score":"3.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"1.5-1.9",
+                                    "score":"2.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"0.6-1.4",
+                                    "score":"0.0",
+                                    "state":"0"
+                                },
+                                {
+                                    "detailName":"<0.6",
+                                    "score":"2.0",
+                                    "state":"0"
+                                }
+                            ],
+                            "name":"9.血清肌酐(mg/dL)",
+                            "controltype":0
+                        }
+                    ]
+                }
+            ]
+        }
+    ]
+}
 }

+ 2 - 2
src/store/actions/currentIll.js

@@ -382,7 +382,7 @@ export const confirm = (state,action) =>{
   let res = Object.assign({},state);
   let length1 = res.data.length;
   let arr = JSON.parse(JSON.stringify(res.data));
-  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;
+  const {nones,exists,withs,ikey,exclusion,excluName,ban,noneIds} = action.data;console.log(111,action)
   let existsId = exists && exists.length>0?getIds(exists):[];
   let withsId = withs && withs.length>0?getIds(withs):[];
   res.symptomIds = res.symptomIds.concat(existsId,withsId,noneIds);//搜索去重
@@ -403,7 +403,7 @@ export const confirm = (state,action) =>{
   if(withs && withs.length>0){
     // for(let i in withs){
     for(let i=0;i<withs.length; i++){
-      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));
+      withsArr.splice(parseInt(ikey)+length,0,banText,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(withs[i].name+','):(withs[i].name)),...(withs[i].questionMapping&&withs[i].questionMapping.length>0?withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;}):[]));
       /*withsArr.splice(parseInt(ikey)+length,0,getLabel(withs[i].id,withs[i].questionMapping && withs[i].questionMapping.length==0?(ban.name+withs[i].name+','):(ban.name+withs[i].name)),...(withs[i].questionMapping && withs[i].questionMapping.filter((item)=>{return item.symptomType==0||item.symptomType==2;})));*/
     }
   }

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

@@ -149,7 +149,13 @@ export const insertMain = (state,action) => {
         inserIndx = i;
       }
     })
-  data.splice(inserIndx-1,1,...obj);
+  // data.splice(inserIndx-1,1,...obj);
+  if(data[inserIndx-1]&&data[inserIndx-1].tagType==8&& !data[inserIndx-1].name){
+    data.splice(inserIndx-1,1,...obj);
+  }else{
+    data.splice(inserIndx-1,0,...obj);
+  }
+  
   // data[inserIndx-1] = text;//替换空标签
   res.data = data;
   res.saveText = [];//将手动输入的值清掉
@@ -677,7 +683,7 @@ export const clearMainSuit = (state,action)=>{//回读和清除
   if(action.symptomFeature !== undefined){//清除分词数据
     res.symptomFeature.featureData = action.symptomFeature;
   }
-  console.log(res,action);
+  //console.log(res,action);
   return res;
 }
 

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

@@ -7,6 +7,7 @@ import {getEMRParams,didPushParamChange} from '@utils/tools.js';
 import {Notify} from '@commonComp';
 import {billing} from '@store/async-actions/pushMessage';
 import {SETOTHERHISTORY,ISREAD} from "../types/homePage";
+import {SAVE_TABLE_RESULT} from "../types/pushMessage";
 import config from "@config/index";
 
 const api={
@@ -19,6 +20,8 @@ const api={
   getSymptomFeature:'/feature/getSymptomFeature',
   getAssess:'/evaluationModuleMapping/getEvaluationModules',    //获取管理评估-慢病
   getIndexData:'/indexData/getIndexDatas',    //获取指标数据-图表-慢病
+  getFormulaResult:'/push/calculate',  // 计算接口
+  getAssessHis:'/inquiryInfo/getEvaluations',   //历史评估记录
 };
 
 export const getFeature = (item)=>{
@@ -237,6 +240,16 @@ export function getAssessData(){
   }
 }
 
+//慢病-获取管理评估历史单条记录
+export function getAssessHis(id){
+  return (dispatch,getStore)=>{
+    const param = {
+      inquiryId:id,
+    };
+    return json(api.getAssessHis,param);
+  }
+}
+//获取评估中图表数据
 export function getIndexData(range){
   return (dispatch,getStore)=>{
     const {patInfo} = getStore();
@@ -248,4 +261,41 @@ export function getIndexData(range){
     };
     return json(api.getIndexData,param);
   }
+}
+
+// 计算接口
+export const getFormulaResult = (item)=>{
+  // type:1-量表 11-计算公式
+  const type = item.type;
+  const id = item.id;//计算量表的id
+  let param;
+  if(type==1){
+    param = {
+      type:type,
+      scale:item.content
+    }
+  }else if(type==11){
+    param = {
+      type:type,
+      formula:item.content
+    }
+  }
+  return (dispatch) => {
+    json(api.getFormulaResult,param).then((res)=>{
+      if(+res.data.code==0){
+        dispatch({
+          type:SAVE_TABLE_RESULT,
+          id:id, //外层疾病id
+          data:{
+            data:item.content, //量表内容
+            // id:item.scaleId,  //量表id
+            type:type,
+            result:res.data.data, //计算结果
+          }
+        })
+      }else{
+        console.log(res.msg)
+      }
+    })
+  }
 }

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

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

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

@@ -7,7 +7,7 @@ import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
 const api={
   push:'/push/pushInner',
   textPush:'/push/pushText',
-  getTableList:'/scale/getList' //获取量表列表
+  getTableList:'/scale/getList', //获取量表列表
 }
 
 //获取右侧推送信息
@@ -23,6 +23,7 @@ export const billing = (mdata) => {
     age: emrData.age,
     // featureType: "4,5,6,7,22",
     featureType: "22",
+    // featureType: "4,5,6,22",
     diag: emrData.dis,
     lis: emrData.lis,
     other: emrData.other,
@@ -90,7 +91,7 @@ export const getTips = (diagItem) =>{
         const url = '/introduceInfo/getByQuestionId';
         const params = {
             questionId: diagItem.id,
-            type: 7,
+            type: diagItem.type,
             position: 1
         }
         json(url, params)
@@ -169,7 +170,8 @@ export const getScaleInfo = (it)=>{
             if(result.code==0){
                 dispatch({
                     type: SET_SCALE_INFO,
-                    data: result.data.scale
+                    data: result.data.scale,
+                    table:it
                 })
             }
         }).catch((e) => {

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

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

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

@@ -26,7 +26,8 @@ const initState = {
   symptomFeature:{//分词
     featureData:[],
     refresh:false //用于数据更新
-  }
+  },
+  chronicDesease:{} //慢病
 }
 
 export default function(state=initState,action){

+ 10 - 4
src/store/reducers/pushMessage.js

@@ -1,4 +1,4 @@
-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,HIDE_TABLE_LIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS} from '../types/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,HIDE_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';
 
 const initState = {
@@ -18,7 +18,9 @@ const initState = {
   },
   AdviceStr: '',
   tmpFlg:'',
-  tableList:[]
+  tableList:[],
+  formulaResult:{},
+  scaleInfo:{}
 };
 export default function(state = initState, action) {
   let res = Object.assign({},state);
@@ -67,8 +69,12 @@ export default function(state = initState, action) {
     case SET_CHRONIC_PUSHS:
       res.chronicPushItems = action.data;
       return res;
-    case SET_SCALE_INFO://量表明细
-      res.scaleInfo = action.data;
+    case SET_SCALE_INFO://量表内容
+      // res.scaleInfo = action.data;
+      res.scaleInfo = Object.assign({},res.scaleInfo,{[action.table.id]:action.data});;
+      return res;
+    case SAVE_TABLE_RESULT://量表计算结果
+      res.formulaResult = Object.assign({},res.formulaResult,{[action.id]:action.data});
       return res;
     default:
       return state;

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

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

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

@@ -20,5 +20,6 @@ export const SHOW_TABLE_LIST = 'SHOW_TABLE_LIST' ; //显示量表列表
 export const HIDE_TABLE_LIST = 'HIDE_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' ; //量表计算结果