|
@@ -10,6 +10,7 @@ import allIcon from '@common/images/all-table.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} from '@commonComp';
|
|
|
import AssessResult from '@containers/AssessResult';
|
|
@@ -34,7 +35,7 @@ class ChronicInfo extends React.Component{
|
|
|
infoId:null, //静态知识
|
|
|
formulaId:null, //计算公式
|
|
|
optionId:null, //可能结果,
|
|
|
- assessInfos:{}, //评估内容
|
|
|
+ isAssessConfirm:false, //是否点击评估弹窗确定按钮
|
|
|
};
|
|
|
this.showInfo = this.showInfo.bind(this);
|
|
|
this.closeInfo = this.closeInfo.bind(this);
|
|
@@ -47,7 +48,7 @@ class ChronicInfo extends React.Component{
|
|
|
this.showFormula = this.showFormula.bind(this); //打开计算公式
|
|
|
this.closeFormula = this.closeFormula.bind(this); //关闭计算公式
|
|
|
this.handleAddAssessItem = this.handleAddAssessItem.bind(this); //加入病例记录
|
|
|
- this.handleAssessChange = this.handleAssessChange.bind(this);
|
|
|
+ this.handleSaveAssess = this.handleSaveAssess.bind(this); //评估弹窗确定
|
|
|
}
|
|
|
showTableList(id){//量表
|
|
|
const {getTableList,questionId} = this.props;
|
|
@@ -94,7 +95,8 @@ class ChronicInfo extends React.Component{
|
|
|
}
|
|
|
showAssessFn(){
|
|
|
this.setState({
|
|
|
- showAssess:!this.state.showAssess
|
|
|
+ showAssess:!this.state.showAssess,
|
|
|
+ isAssessConfirm:false
|
|
|
});
|
|
|
}
|
|
|
close(){
|
|
@@ -111,20 +113,22 @@ class ChronicInfo extends React.Component{
|
|
|
formulaId:null
|
|
|
})
|
|
|
}
|
|
|
- handleAssessChange(i,infos){ //整体评估操作内容变动
|
|
|
- console.log(i,infos)
|
|
|
- let obj = this.state.assessInfos;
|
|
|
- obj[i]=infos;
|
|
|
- this.setState({
|
|
|
- assessInfos:obj
|
|
|
- })
|
|
|
- }
|
|
|
handleAddAssessItem(v,pIndex,i){
|
|
|
const {addAssessItem} = this.props;
|
|
|
addAssessItem(v,pIndex,i);
|
|
|
}
|
|
|
+ handleSaveAssess(){
|
|
|
+ this.setState({
|
|
|
+ isAssessConfirm:true
|
|
|
+ });
|
|
|
+ const that=this;
|
|
|
+ setTimeout(()=>{
|
|
|
+ that.showAssessFn();
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
getDetail(){
|
|
|
- const {data} = this.props;
|
|
|
+ const {data,indexs} = this.props;
|
|
|
const {showInfo,showOption,infoId,formulaId,optionId} = this.state;
|
|
|
let list = data&&data.map((v,i)=>{
|
|
|
return <div className={style["list"]}>
|
|
@@ -147,20 +151,28 @@ class ChronicInfo extends React.Component{
|
|
|
if(it.type==1){
|
|
|
return <p>
|
|
|
<span className={style["listName"]} onClick={this.showTable.bind(this,it.content)}>{'【'+it.content.name+'】'}</span>
|
|
|
- <span className={style["listResult"]} onClick={()=>this.handleAddAssessItem(v,j,i)}>
|
|
|
+ {indexs[i]&&indexs[i].includes(j)?<span className={style["addResult"]}>
|
|
|
+ <img src={added} />
|
|
|
+ 已加入
|
|
|
+ </span>:<span className={style["listResult"]} onClick={()=>this.handleAddAssessItem(v,i,j)}>
|
|
|
<img src={add} />
|
|
|
加入病历记录
|
|
|
</span>
|
|
|
+ }
|
|
|
</p>
|
|
|
}else if(it.type==2){
|
|
|
return <div className={style["marTop"]}>
|
|
|
<span>计算公式结果:</span>
|
|
|
<span className={style["blue"]} onClick={this.showFormula.bind(this,v.id)}>请选择</span>
|
|
|
<img src={level1} />
|
|
|
- <span className={style["listResult"]}>
|
|
|
- <img src={add} />
|
|
|
- 加入病历记录
|
|
|
- </span>
|
|
|
+ {indexs[i]&&indexs[i].includes(j)?<span className={style["addResult"]}>
|
|
|
+ <img src={added} />
|
|
|
+ 已加入
|
|
|
+ </span>:<span className={style["listResult"]} onClick={()=>this.handleAddAssessItem(v,i,j)}>
|
|
|
+ <img src={add} />
|
|
|
+ 加入病历记录
|
|
|
+ </span>
|
|
|
+ }
|
|
|
<div className={style["infoBox"]} style={{display:formulaId&&formulaId==v.id?'block':'none'}}>
|
|
|
<p className={style["infoTitle"]}>
|
|
|
<img src={allTableIcon} />
|
|
@@ -205,10 +217,14 @@ class ChronicInfo extends React.Component{
|
|
|
<span>可能结果:</span>
|
|
|
<span onClick={this.showOption.bind(this,v.id)} className={style["blue"]}>请选择</span>
|
|
|
<img src={level1} />
|
|
|
- <span className={style["listResult"]}>
|
|
|
- <img src={add} />
|
|
|
- 加入病历记录
|
|
|
- </span>
|
|
|
+ {indexs[i]&&indexs[i].includes(j)?<span className={style["addResult"]}>
|
|
|
+ <img src={added} />
|
|
|
+ 已加入
|
|
|
+ </span>:<span className={style["listResult"]} onClick={()=>this.handleAddAssessItem(v,i,j)}>
|
|
|
+ <img src={add} />
|
|
|
+ 加入病历记录
|
|
|
+ </span>
|
|
|
+ }
|
|
|
<div className={`${style["infoBox"]} ${style["mainBox"]}`} style={{display:optionId&&optionId==v.id?'block':'none'}}>
|
|
|
<p className={style["infoTitle"]}>
|
|
|
<img src={checkIcon} />
|
|
@@ -240,11 +256,11 @@ class ChronicInfo extends React.Component{
|
|
|
return list;
|
|
|
}
|
|
|
render(){
|
|
|
- const {chronicMagItem,showList,tableList,scaleInfo,data,saveAssessInfos} = this.props;
|
|
|
- const {showInfo,showOption,showTable,showAssess,assessInfos} = this.state;
|
|
|
+ const {chronicMagItem,showList,tableList,scaleInfo,saveAssessInfos} = this.props;
|
|
|
+ const {showInfo,showOption,showTable,showAssess,isAssessConfirm} = this.state;
|
|
|
const footer = <div className={style['footer']}>
|
|
|
<span className={style['print']}><img src={printIcon} alt=""/>打印</span>
|
|
|
- <span className={style['okBtn']} onClick={()=>saveAssessInfos(assessInfos)}>确定</span>
|
|
|
+ <span className={style['okBtn']} onClick={()=>this.handleSaveAssess()}>确定</span>
|
|
|
</div>;
|
|
|
return <div className={style["tips"]} style={{marginBottom:'15px'}}>
|
|
|
<div className={`${style["tips-title"]} ${style["chronic"]}`}>
|
|
@@ -295,7 +311,7 @@ class ChronicInfo extends React.Component{
|
|
|
top={20}
|
|
|
bottom={20}
|
|
|
width={820}>
|
|
|
- <AssessResult handleChange={this.handleAssessChange}></AssessResult>
|
|
|
+ <AssessResult handleSave={saveAssessInfos} isAssessConfirm={isAssessConfirm}></AssessResult>
|
|
|
</ComplexModal>:''}
|
|
|
</div>
|
|
|
}
|