|
@@ -43,9 +43,15 @@ class ChronicInfo extends React.Component{
|
|
|
isCalculated:false, //是否刚计算过,关闭时值与结果对应
|
|
|
calcuValues:deepClone(props.calcuValues), //计算公式填的值
|
|
|
hasEnterImg: false, //是否移入info
|
|
|
- currentIndex: -1 //当前index
|
|
|
+ currentIndex: -1, //当前index
|
|
|
+ comfirnFlag:false,
|
|
|
+ flag:true,
|
|
|
+ ff:false,
|
|
|
+ timer:null,
|
|
|
+ scaleParam:{}, //加入病例需要的参数
|
|
|
};
|
|
|
-
|
|
|
+ this.$result = React.createRef();
|
|
|
+ this.$content = React.createRef();
|
|
|
this.$content = React.createRef();
|
|
|
this.showInfo = this.showInfo.bind(this);
|
|
|
this.closeInfo = this.closeInfo.bind(this);
|
|
@@ -53,15 +59,16 @@ class ChronicInfo extends React.Component{
|
|
|
this.closeOption = this.closeOption.bind(this);
|
|
|
this.showTable = this.showTable.bind(this);//显示量表弹窗
|
|
|
this.closeTable = this.closeTable.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.handleSaveCalcu = this.handleSaveCalcu.bind(this); //保存评估修改的计算和可能结果
|
|
|
- this.getAddBtnState = this.getAddBtnState.bind(this);
|
|
|
this.slideToggle = this.slideToggle.bind(this);
|
|
|
+ this.resetComfirnFlag = this.resetComfirnFlag.bind(this);
|
|
|
+ this.slideToggle = this.slideToggle.bind(this);
|
|
|
+ this.comfirnTable = this.comfirnTable.bind(this);
|
|
|
+ this.unscroeClose = this.unscroeClose.bind(this);
|
|
|
}
|
|
|
|
|
|
onPrint() {
|
|
@@ -74,22 +81,6 @@ class ChronicInfo extends React.Component{
|
|
|
operaSupport: false,
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- showTableList(name){//量表按钮
|
|
|
- const {getTableList} = this.props;
|
|
|
- if(name){
|
|
|
- getTableList(name);
|
|
|
- }
|
|
|
- }
|
|
|
- close(){//关闭量表列表
|
|
|
- const {hideList} = this.props;
|
|
|
- hideList&&hideList({name:'showList',value:false});
|
|
|
- }
|
|
|
- handleListClick(item){//量表列表单项点击
|
|
|
- this.showTable(item,null);
|
|
|
- //this.close()
|
|
|
- }
|
|
|
-
|
|
|
showInfo(item){
|
|
|
// 静态知识显示在提示信息里(4-18)
|
|
|
const {getInfomation} = this.props;
|
|
@@ -127,7 +118,7 @@ class ChronicInfo extends React.Component{
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
- showTable(it){
|
|
|
+ showTable(it,v,i,j){
|
|
|
const {scaleInfo} = this.props;
|
|
|
// 密西根糖尿病周围神经病评分(MDNS), id:40744
|
|
|
const item = {
|
|
@@ -143,12 +134,56 @@ class ChronicInfo extends React.Component{
|
|
|
|
|
|
this.setState({
|
|
|
formulaId:null, //关闭计算公式和可能结果弹窗
|
|
|
- optionId:null
|
|
|
+ optionId:null,
|
|
|
+ scaleParam:{
|
|
|
+ v,i,j
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
- closeTable(){
|
|
|
+ // 量表明细-关闭,isClose是否是点击关闭按钮
|
|
|
+ closeTable(isClose){
|
|
|
+ const {scaleParam} = this.state;
|
|
|
+ const {showHide} = this.props;
|
|
|
+ if(!showHide.isPop){
|
|
|
+ //量表结果,判断需要计算并且dom中有值才能加入病例记录
|
|
|
+ const res = this.$result.current&&this.$result.current.innerText;
|
|
|
+ if(!isClose&&(this.$result.current&&!res)){
|
|
|
+ Notify.info("请先计算量表结果!");
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ this.handleAddAssessItem(scaleParam.v,scaleParam.i,scaleParam.j);
|
|
|
+ }
|
|
|
this.props.hideList({name:'showTable',value:false});
|
|
|
}
|
|
|
+ // 非计分量表确定-延时关闭->量表存值
|
|
|
+ unscroeClose(){
|
|
|
+ let {timer} = this.state;
|
|
|
+ this.setState({
|
|
|
+ ff:true
|
|
|
+ })
|
|
|
+ clearTimeout(timer)
|
|
|
+ let _timer = setTimeout(()=>{
|
|
|
+ this.closeTable();
|
|
|
+ },200)
|
|
|
+ this.setState({
|
|
|
+ timer:_timer
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 量表明细-确定
|
|
|
+ comfirnTable(){
|
|
|
+ const {flag} = this.state;
|
|
|
+ this.setState({
|
|
|
+ comfirnFlag:true,
|
|
|
+ flag:!flag //触发更新
|
|
|
+ })
|
|
|
+ }
|
|
|
+ resetComfirnFlag(){
|
|
|
+ this.setState({
|
|
|
+ comfirnFlag:false,
|
|
|
+ ff:false
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
showFormula(id){//计算公式
|
|
|
this.setState({
|
|
|
formulaId:id,
|
|
@@ -173,9 +208,17 @@ class ChronicInfo extends React.Component{
|
|
|
});
|
|
|
}
|
|
|
handleAddAssessItem(v,pIndex,i){
|
|
|
- const {addAssessItem} = this.props;
|
|
|
+ const {addAssessItem,showHide,addScaleItems,scaleInfo} = this.props;
|
|
|
+ if(!v){
|
|
|
+ addScaleItems(scaleInfo[showHide.id],showHide.id);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
addAssessItem(v,pIndex,i);
|
|
|
}
|
|
|
+ addFormula(it,v,pIndex,i){
|
|
|
+ this.closeFormula(it);
|
|
|
+ this.handleAddAssessItem(v,pIndex,i);
|
|
|
+ }
|
|
|
handleReg(e){ //只能输入数字
|
|
|
const hasDot = e.target.value.indexOf('.')!=-1;
|
|
|
const key = e.key;
|
|
@@ -222,7 +265,7 @@ class ChronicInfo extends React.Component{
|
|
|
radioVal:Object.assign({},radioVal,{[parent.conceptId]:item.detailName})
|
|
|
})
|
|
|
}
|
|
|
- confirmOption(parent,pIndex){//可能结果确定
|
|
|
+ confirmOption(parent,pIndex,i){//可能结果确定
|
|
|
const {radioVal,possible} = this.state;
|
|
|
const {savePossibleResult} = this.props;
|
|
|
this.setState({
|
|
@@ -231,6 +274,8 @@ class ChronicInfo extends React.Component{
|
|
|
optionId:null,
|
|
|
});
|
|
|
savePossibleResult&&savePossibleResult({possible:Object.assign({},possible,radioVal),radioVal:Object.assign({},possible,radioVal)})
|
|
|
+ this.handleAddAssessItem(parent,pIndex,i);
|
|
|
+
|
|
|
}
|
|
|
handleSaveCalcu(obj){
|
|
|
this.setState({
|
|
@@ -276,43 +321,6 @@ class ChronicInfo extends React.Component{
|
|
|
Notify.info('请填写计算公式内容')
|
|
|
}
|
|
|
}
|
|
|
- getAddBtnState(flag,v,i,j){
|
|
|
- const {indexs,wholeScaleItems,addScaleItems,chronicMagItem,chronicDesease,addedScaleIds} = this.props;
|
|
|
- let btn = '',reCheck=false;
|
|
|
- let show = chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name;
|
|
|
- if(!show){
|
|
|
- return '';
|
|
|
- }
|
|
|
- if(flag){ //有结果
|
|
|
- if(j!==undefined){
|
|
|
- reCheck = addedScaleIds.includes(v.details[j].content.id); //列表中是否加入同一量表
|
|
|
- btn = (indexs[i]&&indexs[i].includes(j))||reCheck?<span className={style["add-record"]}>
|
|
|
- <img src={added} />
|
|
|
- 已加入
|
|
|
- </span>:<span className={style["listResult"]} onClick={()=>this.handleAddAssessItem(v,i,j)}>
|
|
|
- <img src={add} />
|
|
|
- 加入病历记录
|
|
|
- </span>;
|
|
|
- }else{
|
|
|
- reCheck = addedScaleIds.includes(v.id); //推送中是否加入同一量表
|
|
|
- btn = (wholeScaleItems&&wholeScaleItems[i])||reCheck?<span className={style["add-record"]}>
|
|
|
- <img src={added} />
|
|
|
- 已加入
|
|
|
- </span>:<span className={style["listResult"]} onClick={()=>addScaleItems(v,i)}>
|
|
|
- <img src={add} />
|
|
|
- 加入病历记录
|
|
|
- </span>;
|
|
|
- }
|
|
|
-
|
|
|
- }else{
|
|
|
- btn = <span className={style["disable-add"]}>
|
|
|
- <img src={add} />
|
|
|
- 加入病历记录
|
|
|
- </span>;
|
|
|
- }
|
|
|
-
|
|
|
- return btn;
|
|
|
- }
|
|
|
handleMouseEnterDrug(index) {
|
|
|
this.setState({
|
|
|
currentIndex: index,
|
|
@@ -333,6 +341,7 @@ class ChronicInfo extends React.Component{
|
|
|
hasEnterImg: false
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
getDetail(){
|
|
|
const {data,formulaResult,calcuResult,indexs} = this.props;
|
|
|
const {formulaId,optionId,possible,radioVal,calcuValues,currentIndex,hasEnterImg} = this.state;
|
|
@@ -358,22 +367,13 @@ class ChronicInfo extends React.Component{
|
|
|
|
|
|
:
|
|
|
</p>:''}
|
|
|
- {/*<MiniToast title='静态知识'
|
|
|
- icon={allTableIcon}
|
|
|
- show={infoId&&infoId==v.id?true:false}
|
|
|
- close={this.closeInfo}>
|
|
|
- {pureText}
|
|
|
- </MiniToast>*/}
|
|
|
{v.details&&v.details.map((it,j)=>{
|
|
|
if(it.type==1){
|
|
|
return <p>
|
|
|
<span className={style["listName"]}>
|
|
|
- <i onClick={this.showTable.bind(this,it.content,v.conceptId,i)}>{'【'+it.content.name+'】'}</i>
|
|
|
+ <i onClick={this.showTable.bind(this,it.content,v,i,j)}>{'【'+it.content.name+'】'}</i>
|
|
|
{formulaResult&&formulaResult[it.content.conceptId]?<i>{'结果:'}{formulaResult[it.content.conceptId].calcalculate&&formulaResult[it.content.conceptId].calcalculate.result.value +' '+ formulaResult[it.content.conceptId].calcalculate.result.text}</i>:''}
|
|
|
</span>
|
|
|
- {
|
|
|
- this.getAddBtnState(formulaResult&&formulaResult[it.content.conceptId],v,i,j)
|
|
|
- }
|
|
|
</p>
|
|
|
}else if(it.type==2){
|
|
|
const cres = calcuResult&&calcuResult[v.conceptId]||it.content.result;
|
|
@@ -385,16 +385,13 @@ class ChronicInfo extends React.Component{
|
|
|
<i className={style["blue"]} onClick={this.showFormula.bind(this,v.conceptId)}>{result?result:'请选择'}</i>
|
|
|
<img src={level1} />
|
|
|
</span>
|
|
|
- {
|
|
|
- this.getAddBtnState(result,v,i,j)
|
|
|
- }
|
|
|
{formulaId&&formulaId==v.conceptId&&<MiniToast title={it.content.name}
|
|
|
icon={allTableIcon}
|
|
|
- confirmText='关闭'
|
|
|
+ confirmText='加入病例记录'
|
|
|
show={formulaId&&formulaId==v.conceptId?true:false}
|
|
|
close={this.closeFormula.bind(this,it)}
|
|
|
- confirm={this.closeFormula.bind(this,it)}
|
|
|
- footer="true">
|
|
|
+ confirm={this.addFormula.bind(this,it,v,i,j)}
|
|
|
+ footer={result?true:false}>
|
|
|
<table>
|
|
|
{details.map((item,idd)=>{
|
|
|
if(item.controlType==0){//单选
|
|
@@ -452,15 +449,13 @@ class ChronicInfo extends React.Component{
|
|
|
<i onClick={this.showOption.bind(this,v.conceptId)} className={style["blue"]}>{possible[v.conceptId]?possible[v.conceptId]:'请选择'}</i>
|
|
|
<img src={level1} />
|
|
|
</span>
|
|
|
- {
|
|
|
- this.getAddBtnState(possible[v.conceptId],v,i,j)
|
|
|
- }
|
|
|
<MiniToast title='结果选择'
|
|
|
icon={checkIcon}
|
|
|
+ confirmText='加入病例记录'
|
|
|
show={optionId&&optionId==v.conceptId?true:false}
|
|
|
close={this.closeOption}
|
|
|
- confirm={this.confirmOption.bind(this,v,i)}
|
|
|
- footer="true">
|
|
|
+ confirm={this.confirmOption.bind(this,v,i,j)}
|
|
|
+ footer={radioVal[v.conceptId]?true:false}>
|
|
|
<div className={style["infoOption"]}>
|
|
|
<span>{it.content.name?it.content.name+':':''}</span>
|
|
|
{it.content.details&&it.content.details.map((lis,ind)=>{
|
|
@@ -500,11 +495,12 @@ class ChronicInfo extends React.Component{
|
|
|
toggleSlide&&toggleSlide(!slideUp);
|
|
|
}
|
|
|
render(){
|
|
|
+ const {comfirnFlag,flag,ff} = this.state;
|
|
|
+ const {chronicMagItem,chronicDesease,formulaResult,showHide,slideUp} = this.props;
|
|
|
const scaleFooter = <Footer print={true}
|
|
|
- footText="确定"
|
|
|
+ footText={showHide.isPop?"确定":"加入病例记录"}
|
|
|
handlePrint={this.onPrint}
|
|
|
- handleConfirm={this.closeTable}/>;
|
|
|
- const {chronicMagItem,tableList,chronicDesease,formulaResult,showHide,slideUp} = this.props;
|
|
|
+ handleConfirm={()=>{this.comfirnTable()}}/>;
|
|
|
return <div className={style["tips"]} style={{marginBottom:'15px'}}>
|
|
|
<div className={`${style["tips-title"]} ${style["chronic"]}`}>
|
|
|
<div className={style["tips-name"]}>
|
|
@@ -515,36 +511,26 @@ class ChronicInfo extends React.Component{
|
|
|
<div className={style['toggle-btn']}>
|
|
|
<img src={slideUp?down:up} alt="展开/收起" onClick={this.slideToggle}/>
|
|
|
</div>
|
|
|
- {/*<div className={style["tips-btn"]} style={{display:chronicMagItem&&chronicMagItem.name||chronicDesease&&chronicDesease.name?'block':'none'}}>
|
|
|
- <span className={style["tipsDetails"]} onClick={() => this.showTableList(chronicDesease&&chronicDesease.name||chronicMagItem&&chronicMagItem.name)}>量表
|
|
|
- </span>
|
|
|
- </div>*/}
|
|
|
</div>
|
|
|
<div className={style["content"]} ref={this.$content}>
|
|
|
{this.getDetail()}
|
|
|
</div>
|
|
|
- {/*<ConfirmModal visible={showHide&&showHide.showList} noFooter='true' title='全部量表' close={this.close} titleBg="#DFEAFE" icon={allTableIcon} height={450} width={450}>
|
|
|
- <ul className={style['toast-cont']}>
|
|
|
- {tableList&&tableList.map((v,i)=>{
|
|
|
- return <li>
|
|
|
- <span className={style["scaleName"]}>
|
|
|
- <i onClick={this.handleListClick.bind(this,v)}>{'【'+v.name+'】'}</i>
|
|
|
- {formulaResult&&formulaResult[v.conceptId]?<i className={style['res']}>{'结果:'}{formulaResult[v.conceptId].calcalculate&&formulaResult[v.conceptId].calcalculate.result.value+' '+ (formulaResult[v.conceptId].calcalculate.result.text?formulaResult[v.conceptId].calcalculate.result.text:'')}</i>:''}
|
|
|
- </span>
|
|
|
- {
|
|
|
- this.getAddBtnState(formulaResult&&formulaResult[v.conceptId],v,i)
|
|
|
- }
|
|
|
- </li>
|
|
|
- })}
|
|
|
- </ul>
|
|
|
- </ConfirmModal>*/}
|
|
|
- {showHide&&showHide.showTable?<ComplexModal onclose={this.closeTable} footer={scaleFooter}
|
|
|
+ {showHide&&showHide.showTable?<ComplexModal onclose={()=>this.closeTable(true)} footer={scaleFooter}
|
|
|
title={showHide.name}
|
|
|
icon={tableIcon}
|
|
|
top={20}
|
|
|
bottom={20}
|
|
|
width={820}>
|
|
|
- <ScaleTable title={showHide.name} tableId={showHide.id}></ScaleTable>
|
|
|
+ <ScaleTable title={showHide.name}
|
|
|
+ tableId={showHide.id}
|
|
|
+ comfirnFlag={comfirnFlag}
|
|
|
+ flag={flag}
|
|
|
+ flagT={ff}
|
|
|
+ resetFlag={this.resetComfirnFlag}
|
|
|
+ unscroeClose={this.unscroeClose}
|
|
|
+ closeTable={this.closeTable}
|
|
|
+ resRef={this.$result}
|
|
|
+ ></ScaleTable>
|
|
|
</ComplexModal>:''}
|
|
|
</div>
|
|
|
}
|