Browse Source

管理评估出现条件判断,走慢病流程时,诊断中的慢病复诊才显示管理评估,且量表和加入才显示

zhouna 6 years ago
parent
commit
585ff8c08f

+ 7 - 64
src/components/ChronicInfo/index.jsx

@@ -4,14 +4,12 @@ import infoPic from "../../common/images/info-pic.png";
 import chronicPic from "../../common/images/chronic.png";
 import level1 from "../../common/images/级别1.png";
 import printIcon from '@common/images/team.png';
-import manageIcon from '@common/images/manage.png';
 import tableIcon from '@common/images/table.png';
 import allTableIcon from '@common/images/all-table.png';
 import add from '@common/images/add-result.png';
 import added from '@common/images/first.png';
 import checkIcon from '@common/images/check.png';
 import {ComplexModal,ConfirmModal,MiniToast, Radio,CheckBtn} from '@commonComp';
-import AssessResult from '@containers/AssessResult';
 import ScaleTable from '@containers/ScaleTable';
 import Notify from '@commonComp/Notify';
 import {deepClone} from '@utils/tools';
@@ -44,8 +42,6 @@ class ChronicInfo extends React.Component{
       radioVal:{},  //可能结果选择内容
       possible:{},  //可能结果
       formulaParam: {}, //量表计算公式计算入参
-      showRecommend:false,      //显示推荐结果弹窗
-      isRecommendConfirm:false,   //推荐结果确定
       isCalculated:false,     //是否刚计算过,关闭时值与结果对应
       calcuValues:deepClone(props.calcuValues),       //计算公式填的值
     };
@@ -56,14 +52,12 @@ class ChronicInfo extends React.Component{
     this.closeOption = this.closeOption.bind(this);
     this.showTable = this.showTable.bind(this);//显示量表弹窗
     this.closeTable = this.closeTable.bind(this);//关闭量表弹窗
-    this.showAssessFn = this.showAssessFn.bind(this); //开关评估弹窗
     this.close = this.close.bind(this); //关闭量表列表
     this.showFormula = this.showFormula.bind(this); //打开计算公式
     this.closeFormula = this.closeFormula.bind(this); //关闭计算公式
     this.handleAddAssessItem = this.handleAddAssessItem.bind(this);   //加入病例记录
     this.onPrint = this.onPrint.bind(this);
     this.handleForRadio = this.handleForRadio.bind(this);
-    this.showRecommendFn = this.showRecommendFn.bind(this);
     this.handleSaveCalcu = this.handleSaveCalcu.bind(this);     //保存评估修改的计算和可能结果
     this.getAddBtnState = this.getAddBtnState.bind(this);
   }
@@ -160,18 +154,6 @@ class ChronicInfo extends React.Component{
     })
     this.props.hideList({name:'showTable',value:false});
   }
-  showAssessFn(){
-    this.setState({
-      showAssess:!this.state.showAssess,
-      isAssessConfirm:false
-    });
-  }
-  showRecommendFn(){
-    this.setState({
-      isRecommendConfirm:false,
-      showRecommend:!this.state.showRecommend,
-    });
-  }
   showFormula(id){//计算公式
     this.setState({
       formulaId:id,
@@ -194,15 +176,6 @@ class ChronicInfo extends React.Component{
     const {addAssessItem} = this.props;
     addAssessItem(v,pIndex,i);
   }
-  handleSaveRecommend(){
-    this.setState({
-      isRecommendConfirm:true
-    });
-    const that=this;
-    setTimeout(()=>{
-      that.showRecommendFn();
-    });
-  }
   handleInputformula(id,calcuContent,i,e) {
     const {calcuValues} = this.state;
     let obj = deepClone(calcuValues);
@@ -293,8 +266,12 @@ class ChronicInfo extends React.Component{
     }
   }
   getAddBtnState(flag,v,i,j){
-    const {indexs,wholeScaleItems,addScaleItems} = this.props;
+    const {indexs,wholeScaleItems,addScaleItems,chronicMagItem,chronicDesease} = this.props;
     let btn = '';
+    let show = chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name;
+    if(!show){
+      return '';
+    }
     if(flag){     //有结果
       if(j!==undefined){
         btn = indexs[i]&&indexs[i].includes(j)?<span className={style["add-record"]}>
@@ -458,15 +435,12 @@ class ChronicInfo extends React.Component{
     }
   }
   render(){
-    const recFooter =<div className={style['footer']}>
-      <span className={style['okBtn']} onClick={()=>this.handleSaveRecommend()}>确定</span>
-    </div>;
     const scaleFooter = <div className={style['footer']}>
       <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
       <span className={style['okBtn']} onClick={()=>this.closeTable()}>确定</span>
     </div>;
-    const {chronicMagItem,tableList,saveAssessInfos,chronicDesease,formulaResult,showHide} = this.props;
-    const {showAssess,isAssessConfirm,tableName,tableId,parentId,parentIndex,isRecommendConfirm,showRecommend,radioVal,possible} = this.state;
+    const {chronicMagItem,tableList,chronicDesease,formulaResult,showHide} = this.props;
+    const {tableName,tableId,parentId,parentIndex} = this.state;
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>
               <div className={`${style["tips-title"]} ${style["chronic"]}`}>
                 <div className={style["tips-name"]}>
@@ -475,25 +449,9 @@ class ChronicInfo extends React.Component{
                   <span className={style["redTips"]}>(页面信息有更新可能影响评估结果)</span>
                 </div>
                 <div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'block':'none'}}>
-                  <span
-                    className={style["tipsDetails"]}
-                    style={{width:'70px'}}
-                    onClick={this.showAssessFn}
-                  >
-                    管理和评估
-                  </span>
                   <span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.id)}>量表
                   </span>
                 </div>
-                <div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'none':'block'}}>
-                <span
-                  className={style["tipsDetails"]}
-                  style={{width:'70px'}}
-                  onClick={this.showRecommendFn}
-                >
-                    推荐结果
-                  </span>
-                </div>
               </div>
               <div className={style["content"]}> 
                   {this.getDetail()}
@@ -521,21 +479,6 @@ class ChronicInfo extends React.Component{
                       width={820}>
                 <ScaleTable title={tableName} tableId={tableId} parentId={parentId} parentIndex={parentIndex}></ScaleTable>
               </ComplexModal>:''}
-              {showRecommend?<ComplexModal onclose={this.showRecommendFn} footer={recFooter}
-                                        title='推荐结果'
-                                        icon={manageIcon}
-                                        top={20}
-                                        bottom={20}
-                                        width={820}>
-                <AssessResult handleSave={saveAssessInfos}
-                              handleSaveCalcu={this.handleSaveCalcu}
-                              closeAssess={this.showRecommendFn}
-                              isRecommend={true}
-                              showScaleFn={this.showTable.bind(this)}
-                              radioVal={radioVal}
-                              possible={possible}
-                              isAssessConfirm={isRecommendConfirm}></AssessResult>
-              </ComplexModal>:''}
       </div>
   }
 }

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

@@ -192,8 +192,22 @@ class DiagnosticList extends Component {
             });
         }
     }
-    showTable(){
+    showTable(it,parentId,parentIndex){
+      // 密西根糖尿病周围神经病评分(MDNS), id:40744
+      const item = {
+        id:it.id,
+        name:it.name
+      };
+      this.props.hideList({name:'showTable',value:true});
 
+      this.setState({
+        tableName:it.name,
+        tableId:it.id,
+        parentId:parentId,
+        parentIndex:parentIndex,
+        formulaId:null, //关闭计算公式和可能结果弹窗
+        optionId:null
+      })
     }
     handleListClick(){
 
@@ -227,9 +241,10 @@ class DiagnosticList extends Component {
       }
     }
     render(){
-        const { list, treatment, showReferRecord, showHistoryCase ,saveAssessInfos} = this.props;
+        const { list, treatment, showReferRecord, showHistoryCase ,saveAssessInfos,chronicMagItem} = this.props;
         const { visible, treatTitle ,showAssess, isAssessConfirm, radioVal, possible} = this.state;
         const chronicList = JSON.parse(localStorage.getItem('chronic')||null);
+        const chronicLine = chronicMagItem&&chronicMagItem.name;     //当前是否走的慢病流程
         let isChronic = false;      //是否要显示管理评估
         const footer = <div className={style['footer']}>
           <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
@@ -240,7 +255,7 @@ class DiagnosticList extends Component {
                     {list && (list.length > 0) && list.map((item, index) => {
                         const hasTreat = item.treat && (item.treat.commonTreatment.content || item.treat.surgeryTreatment.content || item.treat.treatment.length>0 ||(item.adverseReactions&&item.adverseReactions.length > 0)
                            || (item.drugHistory && item.drugHistory['慢病用药内容'] &&  item.drugHistory['慢病用药内容'].length > 0) || (item.drugHistory &&item.drugHistory['普通病用药内容'] &&  item.drugHistory['普通病用药内容'].length > 0) ||item.follow)
-                        isChronic = item.type==2&&chronicList.findIndex((it)=>it.id==item.id)!=-1;
+                        isChronic = chronicLine&&item.type==2&&chronicList.findIndex((it)=>it.id==item.id)!=-1;
                         return (<div draggable={true} className={style['diag-box'] + ' clearfix'}  key={item.id} >
                                     {index === 0 ? '' : <span className={style['diag-up']} onClick={() => {this.upDiagnostic(index)}}><img className={style["diag-up"]} src={diagUp}/></span>}
                                     {list.length === 1 ? '' : index !== 0 ? '' : <span onClick={() => {this.downDiagnostic(index)}} className={style['diag-down']}><img className={style["diag-down"]} src={diagDown}/></span>}

+ 11 - 1
src/containers/DiagnosticList.js

@@ -14,9 +14,11 @@ import {MODI_LOADING} from '@store/types/homePage.js';
 import {saveMessage} from "../store/async-actions/print";
 import {SET_SAVE_ASSESS_DATA} from "@types/assessResult";
 import {saveClickNum} from '@store/async-actions/homePage';
+import {SHOW_TABLE_LIST,HIDE_TABLE_LIST} from '@store/types/pushMessage';
+
 
 function mapStateToProps(state) {
-    const {diagnosticList,assessResult} = state;
+    const {diagnosticList,assessResult,pushMessage } = state;
     let diagnC = diagnosticList.chronicMagItem;
     return {
         list: diagnosticList.diagnosticList,
@@ -29,6 +31,7 @@ function mapStateToProps(state) {
         chronicMagItem: diagnC&&diagnC.name?diagnC:state.mainSuit.chronicDesease,
         typeConfig: state.typeConfig.typeConfig,
         wholeResults:assessResult.wholeResults,
+        scaleInfo: pushMessage.scaleInfo,//量表内容
     }
 }
 
@@ -124,6 +127,13 @@ function mapDispatchToProps(dispatch) {
             }
           }
         },
+        hideList(item){
+          dispatch({
+            type:SHOW_TABLE_LIST,
+            name:item.name,
+            value:item.value
+          })
+        },
     }
 }