import React, { Component } from "react";
import style from "./index.less";
import { Radio,ComplexModal,Notify} from '@commonComp';
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";
import ChartItem from "../ChartItem";
import printIcon from '@common/images/team.png';
import tableIcon from '@common/images/table.png';
import ScaleTableHis from '@components/ScaleTableHis';
import $ from "jquery";
class AssessResultHis extends Component {
constructor(props) {
super(props);
this.state={
chartTimeTypes:{}, //图表模块
tableName:'',
tableId:'',
parentIndex:0,
showAssess:false, //显示收起数据
};
this.showAssessFn = this.showAssessFn.bind(this);
this.getAssessContent = this.getAssessContent.bind(this);
this.showScaleFn = this.showScaleFn.bind(this);
}
handleChartChange(i,selects){
const {chartTimeTypes} = this.state;
this.setState({
chartTimeTypes:Object.assign(chartTimeTypes,{[i]:selects})
});
}
showAssessFn(){
//获取历史评估数据
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,wholeAssessText,calcuResult,calcuValues,scaleItems} =obj;
const {getIndexData,inquiryDate,indexData,timeTypes,indexNames} = this.props;
const {chartTimeTypes} = this.state;
const name = item.regionName+":";
const list = item.data&&item.data.rows;
switch (+item.regionType){
case 0: //数据来源与右侧手动添加
return
没有历史评估记录!
:''; } } showScaleFn(item,pid){ const { list,inquiryId } = this.props; const obj = list&&list[inquiryId]; if(item&&item.id&&!(obj.scaleInfo&&obj.scaleInfo[item.id])){ Notify.info("未保存该量表数据"); return ; } if(item){ this.setState({ tableName:item.name, tableId:item.id, showScale:!this.state.showScale }); }else{ this.setState({ showScale:!this.state.showScale }); } } onPrint(){ let dom = $("#printcontent"); dom.jqprint({ debug: false, importCSS: true, printContainer: true, operaSupport: false, }); } componentWillReceiveProps(next){ if(next.inquiryId!=this.props.inquiryId||!next.showHistoryCases){ this.setState({ showAssess:false }); } } render() { const { loading,isChronic, list,inquiryId } = this.props; const {tableName,tableId,showScale,showAssess} = this.state; const obj = list&&list[inquiryId]; const scaleFooter =