Procházet zdrojové kódy

merge from 'origin'

zhangxc před 6 roky
rodič
revize
46a9137ea2

+ 0 - 1
src/components/Advice/index.jsx

@@ -93,7 +93,6 @@ class Advice extends Component{
             {/* {advice.commontreatment && <div className={style['treat-input']}  onInput={this.handleComTreatInput}  contentEditable={true} style = {{outline: 'none'}}></div>} */}
             {<Textarea value={advice.commontreatment} isRead={isRead} handleChangeAssistValue={this.handleComTreatInput} ></Textarea>}
         </div>}
-        {console.log('followUp',followUp)}
         {!isFirstMainDiag && <FollowUp  noTitle="true"   setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
         {advice.scheme && advice.scheme.length > 0 &&<div contentEditable='false' className={style['scheme']}>
           {advice.scheme && advice.scheme.length > 0  && <h1>治疗方案</h1>}

+ 12 - 17
src/components/AssessResult/AssessHis/index.jsx

@@ -11,24 +11,11 @@ class AssessResultHis extends Component {
   constructor(props) {
     super(props);
     this.state={
-      chooseSelecteds:props.chooseSelecteds,     //大数据选择模块
       chartTimeTypes:{},      //图表模块
-      wholeAssessItems:props.wholeIndexs,     //整体评估模块
-      wholeAssessText:props.wholeText||''     //整体评估补充说明
     };
     this.showAssessFn = this.showAssessFn.bind(this);
     this.getAssessContent = this.getAssessContent.bind(this);
   }
-  /*componentWillMount(){
-    //获取评估
-    this.props.getAssessHis(this.props.inquiryId);
-  }*/
-  /*componentWillReceiveProps(next){
-    const {inquiryId,getAssessHis} = this.props;
-    if(next.inquiryId!=inquiryId){
-      getAssessHis&&getAssessHis(next.inquiryId);
-    }
-  }*/
   handleChartChange(i,selects){
     const {chartTimeTypes} = this.state;
     this.setState({
@@ -40,8 +27,9 @@ class AssessResultHis extends Component {
     this.props.getAssessHis(this.props.inquiryId);
   }
   handoutTypes(obj,item,i){
-    const {indexTimeTypes,wholeAssess,wholeIndexs,chooseSelecteds} =obj;
-    const {getIndexData,inquiryDate,indexData,inquiryId} = this.props;
+    const {wholeAssess,wholeIndexs,chooseSelecteds} =obj;
+    const {getIndexData,inquiryDate,indexData,inquiryId,timeTypes} = this.props;
+    const {chartTimeTypes} = this.state;
     const name = item.regionName+":";
     const list = item.data&&item.data.rows;
     switch (+item.regionType){
@@ -52,10 +40,10 @@ class AssessResultHis extends Component {
       case 10:    //数据来源于后台
         return <ChartItem title={name}
                           data={indexData||{}}
-                          timeTypes={indexTimeTypes}
+                          timeTypes={JSON.stringify(chartTimeTypes||{})=='{}'?timeTypes&&timeTypes[i]:chartTimeTypes[i]}
                           initFn={getIndexData}
                           endDate={inquiryDate}
-                          inquiryId={inquiryId}
+                          pindex={i}
                           handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
       default:
         return '';
@@ -73,6 +61,13 @@ class AssessResultHis extends Component {
       return data===null||(data&&data.length==0)?<p className={style['no-data']}>没有历史评估记录!</p>:'';
     }
   }
+  /*componentDidMount(){
+    const indexTimeTypes = JSON.parse(JSON.stringify(this.props.indexTimeTypes));
+    console.log(indexTimeTypes)
+    this.setState({
+      chartTimeTypes:indexTimeTypes
+    });
+  }*/
   render() {
     const { list,inquiryId,loading } = this.props;
     const data = list&&list[inquiryId]&&list[inquiryId].data;

+ 6 - 5
src/components/AssessResult/ChartItem/index.jsx

@@ -84,9 +84,10 @@ class ChartItem extends Component {
     const timeTypes = this.props.timeTypes;
     const range = this.getXAxisArr(config.chartDismen);
     const obj = this.props.data[range[0]+range[range.length-1]];
+    const {endDate} = this.props;
     let arr = [];
     for(let i in obj){
-      arr.push(<Chart data={obj[i]} inquiryId={this.props.inquiryId||''} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
+      arr.push(<Chart data={obj[i]} endDate={endDate} type={timeTypes&&timeTypes[i]} index={i} getXAxisArr={this.getXAxisArr} handleRangeChange={this.rangChange}/>)
     }
     return arr;
   }
@@ -125,9 +126,9 @@ class Chart extends Component{
     this.timeSwitch = this.timeSwitch.bind(this);
   }
   drawChart(){
-    const {index,data,getXAxisArr,type,inquiryId} = this.props;
+    const {index,data,getXAxisArr,type,endDate} = this.props;
     const xAxis = getXAxisArr(type);
-    const id = 'chart'+inquiryId+index;
+    const id = endDate?'chart'+endDate+index:'chart'+index;
     let series = [],names=[],inx=-1;
     let myChart = echarts.init(document.getElementById(id));
 
@@ -222,7 +223,7 @@ class Chart extends Component{
     this.drawChart();
   }
   render(){
-    const {type,index,inquiryId} = this.props;
+    const {type,index,endDate} = 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>
@@ -230,7 +231,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'+inquiryId+index}></div>
+              <div className={style["chart-box"]} id={endDate?'chart'+endDate+index:'chart'+index}></div>
             </div>;
   }
 }

+ 2 - 2
src/components/AssessResult/ScaleItem/index.jsx

@@ -23,8 +23,8 @@ class ScaleItem extends Component {
       parentId:'',
       showScale:false,
       optionId:'',
-      possible:{},
-      radioVal:{},
+      possible:props.possible||{},
+      radioVal:props.radioVal||{},
       formulaId:''
     };
     this.getItems = this.getItems.bind(this);

+ 6 - 3
src/components/AssessResult/index.jsx

@@ -57,8 +57,8 @@ class AssessResult extends Component {
     isAssessConfirm&&handleSave(this.state);
   }
   handoutTypes(item,i){
-    const {getIndexData,indexData,timeTypes,wholeAssessData,scaleInfo,getScaleInfo} =this.props;
-    const {chooseSelecteds,wholeAssessItems,wholeAssessText,chartTimeTypes} = this.state;
+    const {getIndexData,indexData,timeTypes,wholeAssessData,scaleInfo,getScaleInfo,possible,radioVal} =this.props;
+    const {chooseSelecteds,wholeAssessItems,wholeAssessText,chartTimeTypes} = this.state;console.log(possible)
     const chartData = indexData;
     const name = item.regionName+":";
     const list = item.data&&item.data.rows;
@@ -71,6 +71,8 @@ class AssessResult extends Component {
                           text={wholeAssessText}
                           indexs={wholeAssessItems}
                           scaleInfo={scaleInfo}
+                          possible={possible}
+                          radioVal={radioVal}
                           getScaleData={getScaleInfo}></ScaleItem>;
       case 1:     //数据来源于大数据
         return <ChooseItem title={name}
@@ -81,7 +83,8 @@ class AssessResult extends Component {
         return <ChartItem title={name}
                           data={chartData||{}}
                           timeTypes={JSON.stringify(chartTimeTypes)=='{}'?timeTypes&&timeTypes[i]:chartTimeTypes[i]}
-                          pindex={i} initFn={getIndexData}
+                          pindex={i}
+                          initFn={getIndexData}
                           handleChange={this.handleChartChange.bind(this,i)}></ChartItem>;
       default:
         return '';

+ 5 - 2
src/components/ChronicInfo/index.jsx

@@ -340,7 +340,7 @@ class ChronicInfo extends React.Component{
       <span className={style['okBtn']} onClick={()=>this.handleSaveAssess()}>确定</span>
     </div>;
     const {chronicMagItem,showList,tableList,scaleInfo,data,saveAssessInfos,chronicDesease} = this.props;
-    const {showInfo,showOption,showTable,showAssess,isAssessConfirm,tableName,tableId,parentId} = this.state;
+    const {showInfo,showOption,showTable,showAssess,isAssessConfirm,tableName,tableId,parentId,possible,radioVal} = this.state;
     //console.log(8989,chronicMagItem,chronicDesease);
     return <div className={style["tips"]} style={{marginBottom:'15px'}}>
               <div className={`${style["tips-title"]} ${style["chronic"]}`}>
@@ -387,7 +387,10 @@ class ChronicInfo extends React.Component{
                       top={20}
                       bottom={20}
                       width={820}>
-                <AssessResult handleSave={saveAssessInfos} isAssessConfirm={isAssessConfirm}></AssessResult>
+                <AssessResult handleSave={saveAssessInfos}
+                              isAssessConfirm={isAssessConfirm}
+                              possible={possible}
+                              radioVal={radioVal}></AssessResult>
               </ComplexModal>:''}
       </div>
   }

+ 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});   

+ 1 - 0
src/components/HistoryCaseContainer/HistoryList/index.jsx

@@ -75,6 +75,7 @@ class HistoryCaseContainer extends React.Component {
                             dataStr={dataStr.length > 0?getAllDataStringList(dataStr):[]}
                             show={false}
                             flg={true}
+                            showAssessBtn={true}
                         ></PreviewBody>
                     }
                 </div>

+ 3 - 3
src/components/PatInfo/index.jsx

@@ -15,16 +15,16 @@ class PatInfo extends Component {
     const {sizeFlag} = this.props;
      return <table className={sizeFlag?`${style["table"]} ${style["newSize"]}`:style["table"]}>
       <tr>
-        <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`}>卡号:{message.patientIdNo && message.patientIdNo}</td>
+        <td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`} title={'卡号:' + (message.patientIdNo && message.patientIdNo)}>卡号:{message.patientIdNo && message.patientIdNo}</td>
         <td key='2' className={`${style.tdBorderB} ${style.tdBorderR}`} title={sizeFlag&&message.patientName&&message.patientName.length>3?message.patientName:''}>姓名:{sizeFlag&&message.patientName && message.patientName.length>3?message.patientName.slice(0,3)+'...':message.patientName}</td>
         <td key='3' className={`${style.tdBorderB} ${style.tdBorderR}`}>年龄:{message.patientAge && message.patientAge}</td>
         <td key='4' className={`${style.tdBorderB} ${style.tdBorderR}`}>性别:{message.patientSex && message.patientSex}</td>
       </tr>
       <tr>
-        <td key='5' className={`${style.tdBorderR}`} style={{whiteSpace: 'nowrap'}}>就诊时间:{message.systemTime&&message.systemTime.substring(0, 10)}</td>
+        <td key='5' className={`${style.tdBorderR}`} style={{whiteSpace: 'nowrap'}} title={'就诊时间:'+(message.systemTime&&message.systemTime.substring(0, 10))}>就诊时间:{message.systemTime&&message.systemTime.substring(0, 10)}</td>
         <td key='6' className={`${style.tdBorderR}`}>科室:{message.hospitalDeptName && message.hospitalDeptName}</td>
         <td key='7' className={`${style.tdBorderR}`} title={sizeFlag&&message.doctorName&&message.doctorName.length>3?message.doctorName:''}>医生:{sizeFlag&&message.doctorName && message.doctorName.length>3?message.doctorName.slice(0,3)+'...':message.doctorName}</td>
-        <td key='8' className={`${style.tdBorderR}`}>门诊号:{message.recordId && message.recordId}</td>
+        <td key='8' className={`${style.tdBorderR}`} title={'门诊号:'+(message.recordId && message.recordId)}>门诊号:{message.recordId && message.recordId}</td>
       </tr>
     </table>;
   }

+ 9 - 1
src/components/PatInfo/index.less

@@ -12,10 +12,18 @@
     white-space: nowrap;
   }
   .tdBorderB {
-      border-bottom: 1px solid @person-table-color;
+    border-bottom: 1px solid @person-table-color;
+    max-width: 180px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
   }
   .tdBorderR {
     border-right: 1px solid @person-table-color;
+    max-width: 180px;
+    overflow: hidden;
+    white-space: nowrap;
+    text-overflow: ellipsis;
   }
 }
 .newSize{

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

@@ -73,7 +73,7 @@ class PreviewBody extends Component {
     }
   }
   render() {
-    const { show, preInfo, dataJson, dataStr, baseObj, flg } = this.props;
+    const { show, preInfo, dataJson, dataStr, baseObj, flg ,showAssessBtn} = this.props;
     const other_yjs = filterOtherDataArr(JSON.parse(dataStr.other),dataJson.other);
     const noData = JSON.stringify(preInfo) == '{}';
     return <div className={style['content']} style={{ width: flg ? '700' : '820' }}>
@@ -222,7 +222,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>
-        <AssessResultHis inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>
+        {showAssessBtn?<AssessResultHis inquiryId={baseObj&&baseObj.id} inquiryDate={baseObj&&baseObj.inquiryDate}></AssessResultHis>:""}
       </div>
 
       <div onClick={() => { this.surePrint(dataStr) }} style={{

+ 8 - 25
src/containers/AssessResultHis.js

@@ -4,7 +4,7 @@ import AssessResultHis from '@components/AssessResult/AssessHis';
 import {ISREAD} from '@store/types/homePage.js';
 import {billing} from '@store/async-actions/pushMessage';
 import {getAssessHis,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} from '@types/assessResult';
 import {SET_ASSESS_HISTORY_DATA,SET_ASSESS_HISTORY_LOADING} from '@types/assessResultHis';
 import store from '@store';
 
@@ -23,7 +23,8 @@ function mapStateToProps(state) {
   return {
     list:assessResultHis,    //已获取到的历史评估列表
     indexData:assessResult.indexData,
-    //loading:assessResultHis.loading,
+    loading:assessResultHis.loading,
+    timeTypes:assessResult.indexTimeTypes,    //图表切换的维度
     /*data:assessResultHis.data,
     timeTypes:assessResultHis.indexTimeTypes,    //图表切换的维度
     wholeAssessData:assessResultHis.wholeAssess,   //评估内容
@@ -61,21 +62,8 @@ function mapDispatchToProps(dispatch) {
         console.log(error);
       });
     },
-    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 ;
-      }
+    getIndexData(param){        //获取评估图表数据
+      const {range,rangeType,index,pindex,getNew} = param;
       dispatch(getIndexData(range)).then((res)=>{
         if(res.data.code=='0'){
           dispatch({
@@ -83,20 +71,15 @@ function mapDispatchToProps(dispatch) {
             data:parseChartData(res.data.data),
             range,
             index,
-            rangeType
+            rangeType,
+            pindex,
+            getNew
           });
         }
       }).catch(error=>{
         console.log(error);
       });
     },
-    /*removeAssessResult(pIndex,i){
-      dispatch({
-        type:REMOVE_ASSESS_ITEMS,
-        pIndex,
-        index:i
-      });
-    }*/
   }
 }