浏览代码

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

liucf 6 年之前
父节点
当前提交
9f9c16e6c1

+ 4 - 1
src/components/Advice/Textarea/index.jsx

@@ -30,7 +30,7 @@ class Textarea extends Component {
     return true;
   }
   componentWillReceiveProps(next){
-    const isRead = this.props.isRead;
+    const {isRead, typeConfig} = this.props;
     // if(next.isRead != isRead && next.value!=this.props.value){      //value对比解决复诊不显示bug
     //   next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = next.value 
     //   // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
@@ -39,6 +39,9 @@ class Textarea extends Component {
       next.value ? this.$dom.current.innerText = next.value :  this.$dom.current.innerText = '' 
       // this.$dom.current.innerText?(this.$dom.current.innerText = next.value||''):(this.$dom.current.innerHTML = next.value||'');
     }
+    if(next.typeConfig != typeConfig) {
+      this.$dom.current.innerText = '' 
+    }
   }
   componentDidMount(){
     const {value} = this.props;

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

@@ -66,7 +66,7 @@ class Advice extends Component{
 
   render(){
     const {advice} = this.props.pushMessage;
-    const {isRead, isFirstMainDiag, followUp, hasFollowUp, saveFollowUp} = this.props
+    const {isRead, isFirstMainDiag, followUp, hasFollowUp, saveFollowUp, typeConfig} = this.props
     let scheme = advice.scheme && advice.scheme.map((item, index) => {
       return <p>{item.treatment.map((it,ii) =>{
         return(it.treatmentStr && it.treatmentStr.length > 0 ? 
@@ -101,7 +101,7 @@ class Advice extends Component{
         <div className={style['billing']} > 
             {/* {!advice.adviceInput && <Textarea value='' isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>}
             {advice.adviceInput && <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>} */}
-            <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput} ></Textarea>
+            <Textarea value={advice.adviceInput} isRead={isRead} handleChangeAssistValue={this.handleAdviceInput}  typeConfig={typeConfig}></Textarea>
         </div>
       </ItemBox>
     </div>

+ 23 - 7
src/components/AssessResult/AssessHis/index.jsx

@@ -1,7 +1,8 @@
 import React, { Component } from "react";
 import style from "./index.less";
 import { Radio,ComplexModal} from '@commonComp';
-import arrow from '@common/images/icon_tri_blue.png';
+import arrow from '@common/images/show.png';
+import arrowDown from '@common/images/close.png';
 import loadingIcon from '@common/images/loading.gif';
 import ChooseItem from "../ChooseItem";
 import ScaleItem from "../ScaleItem";
@@ -18,7 +19,8 @@ class AssessResultHis extends Component {
       chartTimeTypes:{},      //图表模块
       tableName:'',
       tableId:'',
-      parentIndex:0
+      parentIndex:0,
+      showAssess:false,     //显示收起数据
     };
     this.showAssessFn = this.showAssessFn.bind(this);
     this.getAssessContent = this.getAssessContent.bind(this);
@@ -32,7 +34,13 @@ class AssessResultHis extends Component {
   }
   showAssessFn(){
     //获取历史评估数据
-    this.props.getAssessHis(this.props.inquiryId);
+    const {showAssess} = this.state;
+    this.setState({
+      showAssess:!showAssess
+    });
+    if(!showAssess){
+      this.props.getAssessHis(this.props.inquiryId);
+    }
   }
   handoutTypes(obj,item,i){
     const {wholeAssess,wholeIndexs,chooseSelecteds,scaleResult,wholeResults} =obj;
@@ -108,9 +116,16 @@ class AssessResultHis extends Component {
       operaSupport: false,
     });
   }
+  componentWillReceiveProps(next){
+    if(next.inquiryId!=this.props.inquiryId){
+      this.setState({
+        showAssess:false
+      });
+    }
+  }
   render() {
     const { loading,isChronic, list,inquiryId } = this.props;
-    const {tableName,tableId,showScale} = this.state;
+    const {tableName,tableId,showScale,showAssess} = this.state;
     const obj = list&&list[inquiryId];
     const scaleFooter = <div className={style['footer']}>
       <span className={style['print']} onClick={this.onPrint}><img src={printIcon} alt=""/>打印</span>
@@ -118,11 +133,12 @@ class AssessResultHis extends Component {
     </div>;
     return <div className={style['assess-cont']}>
       <div className={style['assess-result']}>
-        <p className={style['enter']}>{isChronic?'管理和评估':'推荐'}结果:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a></p>
+        <p className={style['enter']}>{isChronic?'管理和评估':'推荐'}结果:{showAssess?<a onClick={this.showAssessFn}>收起结果<img src={arrowDown} /></a>:<a onClick={this.showAssessFn}>查看结果<img src={arrow} /></a>}</p>
       </div>
-      <div className={style['assess-box']}>
+      <div className={style['assess-box']} style={{display:showAssess?'block':'none'}}>
         {loading?<p className={style['loading']}><img src={loadingIcon} alt='loading...'/></p>:''}
-        {this.getAssessContent()}
+        {/*以下必须做判断再执行getAssessContent,否则再次打开评估历史时图表显示有问题,因为提前渲染*/}
+        {showAssess?this.getAssessContent():''}
       </div>
       {showScale?<ComplexModal onclose={this.showScaleFn} footer={scaleFooter}
                                           title={tableName}

+ 2 - 1
src/components/AssessResult/AssessHis/index.less

@@ -9,7 +9,8 @@
     color: @blue;
     cursor: pointer;
     img{
-      margin-left: 4px;
+      vertical-align: text-top;
+      width: 18px;
     }
   }
 }

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

@@ -63,7 +63,7 @@
     margin: 0 3px -1px;
     cursor: pointer;
     position: absolute;
-    top: -10px;
+    top: -15px;
 }
 .info-flag {
     display: inline-block;

+ 2 - 1
src/containers/AdviceContainer.js

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

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

@@ -20,6 +20,7 @@ export const clearTreat = (state, action) => {
     res.adversReactionList=[];
     res.hasFollowUp = false;
     res.followUp = '';
+    res.followUpList = [];
     return res
 }