import React from 'react'; import style from './index.less'; 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 $ from 'jquery'; /*** 慢病右侧推送模块规则: 慢病--显示慢病名称以及管理和评估 普通病--不显示管理和评估和量表按钮 明细--量表-计算公式-核心指标 controlType:0-radio 1-checkbox 2-text 3-dropdownlist **/ class ChronicInfo extends React.Component{ constructor(props){ super(props); this.state = { show:true, showInfo:false, showOption:false, showTable:false, showAssess:false, //评估弹窗 infoId:null, //静态知识 formulaId:null, //计算公式 optionId:null, //可能结果, isAssessConfirm:false, //是否点击评估弹窗确定按钮 tableName:'' , //点击的量表名称 tableId:null ,//点击的量表id parentId:null , radioVal:{}, //可能结果选择内容 possible:{}, //可能结果 }; this.$content = React.createRef(); this.showInfo = this.showInfo.bind(this); this.closeInfo = this.closeInfo.bind(this); this.showOption = this.showOption.bind(this); 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.handleSaveAssess = this.handleSaveAssess.bind(this); //评估弹窗确定 this.onPrint = this.onPrint.bind(this); } onPrint() { let dom = this.state.showTable?$("#printcontent"):$("#AssistResult"); dom.jqprint({ debug: false, importCSS: true, printContainer: true, operaSupport: false, }); } componentWillReceiveProps() { $(this.$content.current)[0].scrollIntoView(true); } showTableList(id){//量表 const {getTableList,questionId} = this.props; // getTableList(questionId&&questionId.id); if(id){ getTableList(id); } } showInfo(id){//显示静态知识 // 静态知识显示在提示信息里(4-18) const {getInfomation} = this.props; const param = { // id:id, id:40738, type:22, } getInfomation&&getInfomation(param); /*this.setState({ infoId:id })*/ } closeInfo(){//关闭静态知识 this.setState({ infoId:null }) } showOption(id){ this.setState({ optionId:id }) } closeOption(){ this.setState({ optionId:null }) } showTable(it,parentId){ const {formulaResult} = this.props; // 密西根糖尿病周围神经病评分(MDNS) 为例 /*const item = { id:40744, name:'密西根糖尿病周围神经病评分(MDNS)' }*/ const item = { id:it.id, name:it.name } // 判断:store里已经有改该量表就无需重新调接口 // formulaResult this.props.getScaleInfo(item); this.setState({ showTable:true, tableName:it.name, tableId:it.id, parentId:parentId }) } closeTable(){ this.setState({ showTable:false, tableName:'', tableId:null, parentId:null, }) } showAssessFn(){ this.setState({ showAssess:!this.state.showAssess, isAssessConfirm:false }); } close(){ const {hideList} = this.props; hideList&&hideList(); } showFormula(id){//计算公式 this.setState({ formulaId:id }) } closeFormula(){ this.setState({ formulaId:null }) } handleAddAssessItem(v,pIndex,i){ const {addAssessItem} = this.props; addAssessItem(v,pIndex,i); } handleSaveAssess(){ this.setState({ isAssessConfirm:true }); const that=this; setTimeout(()=>{ that.showAssessFn(); }); } handleForRadio(item,parent,pIndex){//计算公式 } confirmFormula(){//计算公式确定 } handleRadio(item,parent,pIndex){//可能结果 let {radioVal} = this.props; this.setState({ radioVal:Object.assign({},radioVal,{[pIndex]:item.detailName}) }) } confirmOption(parent,pIndex){//可能结果确定 const {radioVal,possible} = this.state; this.setState({ possible:Object.assign({},possible,radioVal), radioVal:Object.assign({},possible,radioVal),//不设置radioVal只有最近一次选中的值 optionId:null }) } getDetail(){ const {data,indexs} = this.props; const {showInfo,showOption,infoId,formulaId,optionId,possible,radioVal} = this.state; let list = data&&data.map((v,i)=>{ return

{'患者可能有'+v.name}

{/* {pureText} */} {v.details&&v.details.map((it,j)=>{ if(it.type==1){ return

{'【'+it.content.name+'】'} {indexs[i]&&indexs[i].includes(j)? 已加入 :this.handleAddAssessItem(v,i,j)}> 加入病历记录 }

}else if(it.type==2){ return
计算公式结果: 请选择 {indexs[i]&&indexs[i].includes(j)? 已加入 :this.handleAddAssessItem(v,i,j)}> 加入病历记录 } {it.content.details.map((item,idd)=>{ if(item.controlType==0){//单选 return }else if(item.controlType==1){//多选 }else if(item.controlType==2){//输入框 return }else if(item.controlType==3){//下拉 return } })}
{'请选择'+item.name+':'} {item.details.map((ii,ind)=>{ return
})}
{'请输入'+item.name+':'} {item.uint}
{'请选择'+item.name+':'} {item.details.map((ii,ind)=>{ return
})}
计算
}else if(it.type==3){ return
可能结果: {possible[i]?possible[i]:'请选择'} {indexs[i]&&indexs[i].includes(j)? 已加入 :this.handleAddAssessItem(v,i,j)}> 加入病历记录 }
是否贫血: {it.content.details&&it.content.details.map((lis,ind)=>{ return
})}
} })}
}) return list; } render(){ const footer =
打印 this.handleSaveAssess()}>确定
; const {chronicMagItem,showList,tableList,scaleInfo,data,saveAssessInfos,chronicDesease} = this.props; const {showInfo,showOption,showTable,showAssess,isAssessConfirm,tableName,tableId,parentId} = this.state; //console.log(8989,chronicMagItem,chronicDesease); return

{chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name||'推荐信息'}

(页面信息有更新可能影响评估结果)
管理和评估 this.showTableList(chronicDesease&&chronicDesease.id||chronicMagItem&&chronicMagItem.id)}>量表
{this.getDetail()}
{showTable? :''} {showAssess? :''}
} } export default ChronicInfo;