Browse Source

量表数据处理,前端计算结果并储存

liucf 6 years ago
parent
commit
251d20c792

+ 42 - 31
src/components/ChronicInfo/index.jsx

@@ -30,7 +30,6 @@ class ChronicInfo extends React.Component{
       show:true,
       showInfo:false,
       showOption:false,
-      showTable:false,
       showAssess:false,      //评估弹窗
       infoId:null,  //静态知识
       formulaId:null, //计算公式
@@ -60,7 +59,8 @@ class ChronicInfo extends React.Component{
   }
 
   onPrint() {
-    let dom = this.state.showTable?$("#printcontent"):$("#AssistResult");
+    const {showHide} = this.props;
+    let dom = showHide&&showHide.showTable?$("#printcontent"):$("#AssistResult");
     dom.jqprint({
       debug: false,
       importCSS: true,
@@ -72,13 +72,22 @@ class ChronicInfo extends React.Component{
     $(this.$content.current)[0].scrollIntoView(true);
   }
   
-  showTableList(id){//量表
+  showTableList(id){//量表按钮
     const {getTableList,questionId} = this.props;
     // getTableList(questionId&&questionId.id);
     if(id){
       getTableList(id);
     }
   }
+  close(){//关闭量表列表
+    const {hideList} = this.props;
+    hideList&&hideList({name:'showList',value:false});
+  }
+  handleListClick(item){//量表列表单项点击
+    this.showTable(item,null);
+    this.close()
+  }
+
   showInfo(id){//显示静态知识
     // 静态知识显示在提示信息里(4-18)
     const {getInfomation} = this.props;
@@ -109,25 +118,19 @@ class ChronicInfo extends React.Component{
   }
   showTable(it,parentId){
     const {formulaResult,scaleInfo} = this.props;
-    // 密西根糖尿病周围神经病评分(MDNS) 为例
-    /*const item = {
-      id:40744,
-      name:'密西根糖尿病周围神经病评分(MDNS)'
-    }*/
+    // 密西根糖尿病周围神经病评分(MDNS) 为例 id:40744
     const item = {
       id:it.id,
       name:it.name
     }
     // 判断:store里已经有该量表就无需重新调接口
     if(scaleInfo&&scaleInfo[it.id]){
-
+      this.props.hideList({name:'showTable',value:true});
     }else{
-      // formulaResult
       this.props.getScaleInfo(item);
     }
     
     this.setState({
-      showTable:true,
       tableName:it.name,
       tableId:it.id,
       parentId:parentId
@@ -135,11 +138,11 @@ class ChronicInfo extends React.Component{
   }
   closeTable(){
     this.setState({
-      showTable:false,
       tableName:'',
       tableId:null,
       parentId:null,
     })
+    this.props.hideList({name:'showTable',value:false});
   }
   showAssessFn(){
     this.setState({
@@ -147,10 +150,7 @@ class ChronicInfo extends React.Component{
       isAssessConfirm:false
     });
   }
-  close(){
-    const {hideList} = this.props;
-    hideList&&hideList();
-  }
+  
   showFormula(id){//计算公式
     this.setState({
       formulaId:id
@@ -197,7 +197,7 @@ class ChronicInfo extends React.Component{
     
   }
   getDetail(){
-    const {data,indexs} = this.props;
+    const {data,indexs,scaleInfo,formulaResult} = this.props;
     const {showInfo,showOption,infoId,formulaId,optionId,possible,radioVal} = this.state;
     let list = data&&data.map((v,i)=>{
                     return <div className={style["list"]}>
@@ -215,7 +215,11 @@ class ChronicInfo extends React.Component{
                       {v.details&&v.details.map((it,j)=>{
                         if(it.type==1){
                           return <p>
-                                <span className={style["listName"]} onClick={this.showTable.bind(this,it.content,v.id)}>{'【'+it.content.name+'】'}</span>
+                                <span className={style["listName"]} onClick={this.showTable.bind(this,it.content,v.id)}>
+                                  {'【'+it.content.name+'】'}
+                                  {formulaResult&&formulaResult[it.content.id]?<i>{'结果:'+ formulaResult[it.content.id].text}</i>:''}
+                                  
+                                </span>
                                 {indexs[i]&&indexs[i].includes(j)?<span className={style["addResult"]}>
                                   <img src={added} />
                                   已加入
@@ -227,9 +231,11 @@ class ChronicInfo extends React.Component{
                               </p>
                         }else if(it.type==2){
                           return <div className={style["marTop"]}>
-                            <span>计算公式结果:</span>
-                            <span className={style["blue"]} onClick={this.showFormula.bind(this,v.id)}>请选择</span>
-                            <img src={level1} />
+                            <span className={style["limit"]}>
+                              计算公式结果:
+                              <i className={style["blue"]} onClick={this.showFormula.bind(this,v.id)}>请选择</i>
+                              <img src={level1} />
+                            </span>
                             {indexs[i]&&indexs[i].includes(j)?<span className={style["addResult"]}>
                                   <img src={added} />
                                   已加入
@@ -299,9 +305,11 @@ class ChronicInfo extends React.Component{
                           </div>
                         }else if(it.type==3){
                           return <div className={style["marTop"]}>
-                            <span>可能结果:</span>
-                            <span onClick={this.showOption.bind(this,v.id)} className={style["blue"]}>{possible[i]?possible[i]:'请选择'}</span>
-                            <img src={level1} />
+                            <span className={style["limit"]}>
+                              可能结果:
+                              <i onClick={this.showOption.bind(this,v.id)} className={style["blue"]}>{possible[i]?possible[i]:'请选择'}</i>
+                              <img src={level1} />
+                            </span>
                             {indexs[i]&&indexs[i].includes(j)?<span className={style["addResult"]}>
                                   <img src={added} />
                                   已加入
@@ -345,8 +353,8 @@ class ChronicInfo extends React.Component{
       <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
       <span className={style['okBtn']} onClick={()=>this.closeTable()}>确定</span>
     </div>;
-    const {chronicMagItem,showList,tableList,scaleInfo,data,saveAssessInfos,chronicDesease} = this.props;
-    const {showInfo,showOption,showTable,showAssess,isAssessConfirm,tableName,tableId,parentId} = this.state;
+    const {chronicMagItem,showList,tableList,scaleInfo,data,saveAssessInfos,chronicDesease,formulaResult,showHide} = this.props;
+    const {showInfo,showOption,showAssess,isAssessConfirm,tableName,tableId,parentId} = this.state;
     //console.log(8989,chronicMagItem,chronicDesease);
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>
               <div className={`${style["tips-title"]} ${style["chronic"]}`}>
@@ -370,22 +378,25 @@ class ChronicInfo extends React.Component{
               <div className={style["content"]}> 
                   {this.getDetail()}
               </div>
-              <ConfirmModal visible={showList} noFooter='true' title='全部量表' close={this.close} titleBg="#DFEAFE" icon={allTableIcon} height={300}>
+              <ConfirmModal visible={showHide&&showHide.showList} noFooter='true' title='全部量表' close={this.close} titleBg="#DFEAFE" icon={allTableIcon} height={400} width={400}>
                       <ul className={style['toast-cont']}>
                         {tableList&&tableList.map((v,i)=>{
-                          return <li>
-                          <span>{'【'+v.name+'】'}</span>
+                          return <li onClick={this.handleListClick.bind(this,v)}>
+                          <span>
+                            {'【'+v.name+'】'}
+                            {formulaResult&&formulaResult[v.id]?<i>{'结果:'+formulaResult[v.id].text}</i>:''}
+                          </span>
                           </li>
                         })}
                       </ul>
               </ConfirmModal>
-              {showTable?<ComplexModal onclose={this.closeTable} footer={scaleFooter}
+              {showHide&&showHide.showTable?<ComplexModal onclose={this.closeTable} footer={scaleFooter}
                       title={tableName}
                       icon={tableIcon}
                       top={20}
                       bottom={20}
                       width={820}>
-                <ScaleTable data={scaleInfo} title={tableName} tableId={tableId} parentId={parentId}></ScaleTable>
+                <ScaleTable title={tableName} tableId={tableId} parentId={parentId}></ScaleTable>
               </ComplexModal>:''}
               {showAssess?<ComplexModal onclose={this.showAssessFn} footer={footer}
                       title='管理和评估'

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

@@ -68,6 +68,8 @@
         .listName{
           color:#3B9ED0;
           cursor: pointer;
+          display: inline-block;
+          width: 73%;
         }
         .listResult,.addResult{
           float: right;
@@ -122,6 +124,10 @@
       .marTop{
         margin-top: 10px;
         position: relative;
+        .limit{
+          display: inline-block;
+          width: 72%;
+        }
         img{
           vertical-align: middle;
         }
@@ -210,6 +216,10 @@
         margin-top: 10px;
         cursor: pointer;
       }
+      i{
+        color:#3B9ED0;
+        margin-left: 10px;
+      }
     }
     .footer{
       .print{

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

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

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

@@ -116,7 +116,7 @@ class ScaleTable extends React.Component{
   }
 
   handleFormula(data){//得分计算
-    const {tableId,getResult,parentId} = this.props; 
+    const {tableId,getResult,parentId,scaleInfo} = this.props; 
     const {originData,valueData,score} = this.state; 
     this.setState({
       start:true
@@ -134,7 +134,7 @@ class ScaleTable extends React.Component{
       }
     }
     if(unfinish){
-      Notify.info("请填写完整后再计算得分");
+      Notify.info("请先将量表内容选择完整");
       return
     }
     // 前端计算分数
@@ -145,21 +145,39 @@ class ScaleTable extends React.Component{
     this.setState({
       totalScore:totalScore
     })
+    const range = valueData&&valueData.calculate?valueData.calculate.range:'';
+    let resultText;
+    if(range){
+      for(let k=0; k<range.length; k++){
+        if(parseFloat(range[k].min) < totalScore && totalScore > parseFloat(range[k].max)){
+          resultText = range[k].text;
+        }
+      }
+    }
+    const result = {
+      score:totalScore,
+      text:resultText
+    }
+
     const params = {
       type:1,
       content:JSON.stringify(valueData), //选择后的数据--字符串形式
       id:parentId,
       scaleId:tableId,
-    }    
-    // 后台计算接口
-    getResult&&getResult(params);
+    } 
+    // 替换表格内容
+    let allDatas = JSON.parse(JSON.stringify(scaleInfo[tableId])) ;
+     allDatas[1].content = JSON.stringify(valueData);
+    // 计算接口
+    getResult&&getResult({params,allDatas,result});
   }
   componentWillReceiveProps(nextProps){ 
     const {tableId} = this.props;
     if(JSON.stringify(nextProps.scaleInfo) !== '{}'){
       this.setState({
         originData:mocks.newData,
-        valueData:nextProps.scaleInfo[tableId].length?mocks.newData:JSON.parse(nextProps.scaleInfo[tableId].content),
+        // valueData:nextProps.scaleInfo[tableId].length?mocks.newData:JSON.parse(nextProps.scaleInfo[tableId].content),
+        valueData:JSON.parse(nextProps.scaleInfo[tableId][1].content),
       })
     }
   }
@@ -168,22 +186,23 @@ class ScaleTable extends React.Component{
     if(scaleInfo&&scaleInfo[tableId]){
       this.setState({
         // originData:mocks.newData,
-        valueData:scaleInfo[tableId].length?mocks.newData:JSON.parse(scaleInfo[tableId].content)
+        // valueData:scaleInfo[tableId].length?mocks.newData:JSON.parse(scaleInfo[tableId].content)
+        valueData:JSON.parse(scaleInfo[tableId][1].content)
       })
     }
     
   }
   getContent(){ 
     let {selecteds,originData,valueData,start} = this.state;
-    // const datas = mocks.newData;
-    const datas = valueData&&valueData.group?valueData:mocks.newData;
+    // const datas = valueData&&valueData.group?valueData:mocks.newData;
+    const datas = valueData&&valueData.group?valueData:'';
     let content =  datas&&datas.group&&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){
+                        if(item.controlType==0){
                           return <div className={style['block']} style={{border:it.required==1&&!item.isSelect&&start?'1px solid #f00':'none'}}>
                               <p className={style['miniName']}>{item.name}</p>
                               {item.details&&item.details.map((vv,ii)=>{
@@ -201,12 +220,14 @@ class ScaleTable extends React.Component{
                             return <div className={style['block']}>
                                 <p className={style['miniName']}>{item.name}</p>
                                   {item.details&&item.details.map((vv,ii)=>{
-                                    return <CheckBtn value={vv.detailName}
+                                    return <div className={style['item']}>
+                                    <CheckBtn value={vv.detailName}
                                                     label={vv.detailName}
                                                     isSelect={vv.select==1||selecteds[item.name]&&selecteds[item.name].includes(vv.detailName)}
                                                     handleClick={this.handleCheckbox.bind(this,v.groupName,item.name,vv)}>
                                           </CheckBtn>
                                     {vv.state==1?<span style={{color:'#3B9ED0'}}>(智能推荐)</span>:''}
+                                    </div>
                                   })}
                             </div>
                           }
@@ -224,28 +245,29 @@ class ScaleTable extends React.Component{
   }
 
   render(){
-    const {title,scaleInfo,tableId} = this.props;
+    const {title,scaleInfo,tableId,formulaResult} = this.props;
     const data = scaleInfo[tableId];
     let {selecteds,originData,totalScore} = 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 preContent = '';
-    const footContent ='';
-    const datas = mocks.newData;
+    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 scaleResult = formulaResult&&formulaResult[tableId]; //量表计算结果
+    // const preContent = '';
+    // const footContent ='';
+    // const datas = mocks.newData;
     return <div className={style['tableBox']} id="printcontent">
             <div className={style['printShow']}>
               <Information></Information>
             </div> 
             {/*<h1>{title}</h1>*/}
-            <h1>{datas.scaleName}</h1>
+            <h1>{datas?datas.scaleName:''}</h1>
             <div dangerouslySetInnerHTML={{__html:preContent}} className={style['textlh']}></div>
             <div className={style['textContent']}>
               {this.getContent()}
               <div className={style['total']}>
                 <span>总分:</span>
-                <span>{datas.calculate.result.value||totalScore||'54分'}</span>
+                <span>{scaleResult&&scaleResult.score||totalScore||''}</span>
                 <span className={style['totalBtn']} onClick={this.handleFormula.bind(this)}>得分</span>
               </div>
             </div>

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

@@ -69,7 +69,7 @@ strong{
   margin: 40px 0 30px;
   .group{
     border-bottom: 4px solid #EBEBEB;
-    // margin-bottom: 25px;
+    padding-bottom: 10px;
     margin-top: 25px;
     .item{
       display: inline-block;

+ 9 - 4
src/containers/ChronicInfo.js

@@ -1,6 +1,6 @@
 import {connect} from 'react-redux';
 import ChronicInfo from '../components/ChronicInfo';
-import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
+import {SHOW_TABLE_LIST} from '@store/types/pushMessage';
 import {getTableList,getScaleInfo,getTips} from '../store/async-actions/pushMessage';
 import {ADD_ASSESS_ITEMS,SET_SAVE_ASSESS_DATA} from "@types/assessResult";
 import {saveMessage} from "../store/async-actions/print";
@@ -12,6 +12,7 @@ function mapStateToProps(state){
     questionId: state.diagnosticList.clickDiag,
     tableList: state.pushMessage.tableList,
     showList: state.pushMessage.showList,
+    showHide: state.pushMessage.showHide,
     scaleInfo: state.pushMessage.scaleInfo,//量表内容
     chronicDesease:state.mainSuit.chronicDesease,//主诉存的慢病
     update:state.assessResult.update1,
@@ -23,10 +24,14 @@ function mapDispatchToProps(dispatch){
   return {
     getTableList(id){
       dispatch(getTableList(id))
-      dispatch({type:SHOW_TABLE_LIST})
+      // dispatch({type:SHOW_TABLE_LIST})
     },
-    hideList(){
-      dispatch({type:HIDE_TABLE_LIST})
+    hideList(item){
+      dispatch({
+        type:SHOW_TABLE_LIST,
+        name:item.name,
+        value:item.value
+      })
     },
     getScaleInfo(item){
       dispatch(getScaleInfo(item))

+ 2 - 9
src/containers/PushItemsContainer.js

@@ -1,9 +1,9 @@
 import React from 'react';
 import {connect} from 'react-redux';
 import PushItems from '../components/PushItems'
-import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS,SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
+import {CHANGE_ASSAY, CHANGE_CHECK, ADD_BILLING, SHOW_TIPS_DETAILS, HIDE_TIPS_DETAILS,SHOW_TABLE_LIST} from '@store/types/pushMessage';
 import { ADD_DIAGNOSTIC, GET_DIAGNOSTIC_STR } from '@store/types/diagnosticList';
-import {billing, getTips, getTipsDetails,getTableList} from '../store/async-actions/pushMessage';
+import {billing, getTips, getTipsDetails} from '../store/async-actions/pushMessage';
 import { isAddMainSuit } from '@store/async-actions/diagnosticList';
 
 function mapStateToProps(state) {
@@ -63,13 +63,6 @@ function mapDispatchToProps(dispatch) {
             dispatch({
                 type: HIDE_TIPS_DETAILS
             })
-        },
-        getTableList(id){
-            dispatch(getTableList(id))
-            dispatch({type:SHOW_TABLE_LIST})
-        },
-        hideList(){
-            dispatch({type:HIDE_TABLE_LIST})
         }
     }
 }

+ 13 - 5
src/containers/ScaleTable.js

@@ -1,9 +1,9 @@
 import {connect} from 'react-redux';
 import ScaleTable from '@components/ScaleTable';
 import {getFormulaResult} from '@store/async-actions/fetchModules.js';
-import {SET_SCALE_INFO} from '@store/types/pushMessage';
+import {SET_SCALE_INFO,SAVE_TABLE_RESULT} from '@store/types/pushMessage';
 
-function mapStateToProps (state){
+function mapStateToProps (state){//console.log(state);
   return {
     scaleInfo: state.pushMessage.scaleInfo,//量表内容
     formulaResult:state.pushMessage.formulaResult //计算结果
@@ -13,12 +13,20 @@ function mapStateToProps (state){
 function mapDispatchToProps (dispatch){
   return {
     getResult(obj){//计算结果
-      // dispatch(getFormulaResult(obj));
+      const {params,allDatas,result} = obj;
+      // dispatch(getFormulaResult(obj.params));
       dispatch({
         type:SET_SCALE_INFO,
-        data:obj,
-        id:obj.scaleId
+        data:allDatas,
+        id:params.scaleId //量表id
       })
+      if(result&&result.text){
+        dispatch({
+          type:SAVE_TABLE_RESULT,
+          id:params.scaleId,  
+          data:result
+        })
+      }
     }
   }
 }

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

@@ -285,7 +285,8 @@ export const getFormulaResult = (item)=>{
       if(+res.data.code==0){
         dispatch({
           type:SAVE_TABLE_RESULT,
-          id:id, //外层疾病id
+          // id:id, //外层疾病id
+          id:item.scaleId,  //量表id
           data:{
             data:item.content, //量表内容
             // id:item.scaleId,  //量表id

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

@@ -1,8 +1,9 @@
 import { get, post, json } from "@utils/ajax";
-import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS ,SET_CHRONIC_TABLELIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS} from '../types/pushMessage';
+import { BILLING_ADVICE, SET_TIPS, SET_TIPS_DETAILS ,SET_CHRONIC_TABLELIST,SET_SCALE_INFO,SET_CHRONIC_PUSHS,SHOW_TABLE_LIST} from '../types/pushMessage';
 import { SET_CLICK_DIAG } from '../types/diagnosticList';
 import {storageLocal,getEMRParams} from '@utils/tools';
 import {SET_IMPORT_CHECKBODY_LABEL} from "../types/checkBody";
+import { Notify} from '@commonComp';
 
 const api={
   push:'/push/pushInner',
@@ -143,6 +144,13 @@ export const getTableList = (id)=>{
                     type: SET_CHRONIC_TABLELIST,
                     data: res.data.data
                 })
+                dispatch({
+                    type:SHOW_TABLE_LIST,
+                    name:'showList',
+                    value:true
+                })
+            }else{
+                Notify.info(res.data.msg)
             }
         }).catch((e) => {
             console.log(e)
@@ -173,6 +181,13 @@ export const getScaleInfo = (it)=>{
                     data: result.data.scale,
                     id:it.id
                 })
+                dispatch({
+                    type:SHOW_TABLE_LIST,
+                    name:'showTable',
+                    value:true
+                })
+            }else{
+                Notify.info(result.msg)
             }
         }).catch((e) => {
             console.log(e)

+ 7 - 9
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,SAVE_TABLE_RESULT} 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,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 = {
@@ -20,7 +20,8 @@ const initState = {
   tmpFlg:'',
   tableList:[],
   formulaResult:{},
-  scaleInfo:{}
+  scaleInfo:{},
+  showHide:{}
 };
 export default function(state = initState, action) {
   let res = Object.assign({},state);
@@ -60,20 +61,17 @@ export default function(state = initState, action) {
     case SET_CHRONIC_TABLELIST://量表列表数据
       res.tableList = action.data;
       return res;
-    case SHOW_TABLE_LIST://显示量表列表数据
-      res.showList = true;
-      return res;
-    case HIDE_TABLE_LIST://隐藏量表列表数据
-      res.showList = false;
+    case SHOW_TABLE_LIST://显示、隐藏量表列表
+      // res.showList = true;
+      res.showHide = Object.assign({},res.showHide,{[action.name]:action.value});
       return res;
     case SET_CHRONIC_PUSHS:
       res.chronicPushItems = action.data;
       return res;
     case SET_SCALE_INFO://量表内容-量表id
-      // res.scaleInfo = action.data;
       res.scaleInfo = Object.assign({},res.scaleInfo,{[action.id]:action.data});
       return res;
-    case SAVE_TABLE_RESULT://量表计算结果-外层疾病id
+    case SAVE_TABLE_RESULT://量表计算结果-量表id
       res.formulaResult = Object.assign({},res.formulaResult,{[action.id]:action.data});
       return res;
     default:

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

@@ -17,7 +17,6 @@ export const SET_COMMONTREATMENT = 'SET_COMMONTREATMENT';    //设置常见治
 export const SET_ADVICE_INPUT = 'SET_ADVICE_INPUT' ; //设置医嘱自由输入内容
 export const SET_CHRONIC_TABLELIST = 'SET_CHRONIC_TABLELIST' ; //设置量表列表
 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' ; //量表计算结果