|
@@ -1,13 +1,19 @@
|
|
|
import React,{Component} from 'react';
|
|
|
import style from './index.less';
|
|
|
-import {Button,InlineTag,ItemBox,DropDown,DropList,Textarea,Notify} from '@commonComp';
|
|
|
+import {Button,InlineTag,ItemBox,DropDown,DropList,Textarea,Notify,ConfirmModal} from '@commonComp';
|
|
|
import TailInlineTag from '@commonComp/TailInlineTag';
|
|
|
import SearchDrop from '@components/SearchDrop';
|
|
|
import CommonSymptom from '@components/CommonSymptom';
|
|
|
import chooseType from '@containers/eleType.js';
|
|
|
import config from "@config/index";
|
|
|
import {isIE,getPageCoordinate,windowEventHandler,filterDataArr} from "@utils/tools.js"
|
|
|
+import { initItemList } from '@store/async-actions/historyTemplates';
|
|
|
+import tableIcon from '@common/images/table.png';
|
|
|
+import iconRadioDefault from '@common/images/icon-radio-default.png'
|
|
|
+import iconRadioActive from '@common/images/icon-radio-active.png'
|
|
|
+import { pushAllDataList } from '@utils/tools';
|
|
|
import $ from 'jquery';
|
|
|
+import store from '@store';
|
|
|
|
|
|
class MainSuit extends Component{
|
|
|
constructor(props){
|
|
@@ -29,6 +35,9 @@ class MainSuit extends Component{
|
|
|
overFlag:false,
|
|
|
tmpScroll:0,
|
|
|
tmpTop:0,
|
|
|
+ showRecord:false,
|
|
|
+ activeHistory: -1,
|
|
|
+ showHistoryCase:false
|
|
|
};
|
|
|
this.toggleEditable = this.toggleEditable.bind(this);
|
|
|
this.handleFocus = this.handleFocus.bind(this);
|
|
@@ -37,6 +46,11 @@ class MainSuit extends Component{
|
|
|
this.handleChange = this.handleChange.bind(this);
|
|
|
this.handleClick = this.handleClick.bind(this);
|
|
|
this.handleBlur = this.handleBlur.bind(this);
|
|
|
+ this.referRecord = this.referRecord.bind(this);
|
|
|
+ this.noReferRecord = this.noReferRecord.bind(this);
|
|
|
+ this.referCase = this.referCase.bind(this);
|
|
|
+ this.closeHistoryCaseModal = this.closeHistoryCaseModal.bind(this);
|
|
|
+ this.handleQuoteClick = this.handleQuoteClick.bind(this);
|
|
|
}
|
|
|
componentWillReceiveProps(nextProps){
|
|
|
this.setState({boxLeft:nextProps.boxLeft})
|
|
@@ -232,7 +246,7 @@ class MainSuit extends Component{
|
|
|
}
|
|
|
|
|
|
handleBlur(e){//隐藏常见症状下拉、存自由输入的值
|
|
|
- const {freeText,saveText,datas,clearSearch,getSymptomFeature,currentData} = this.props;
|
|
|
+ const {freeText,saveText,datas,clearSearch,getSymptomFeature,currentData,saveChronic} = this.props;
|
|
|
const that = this;
|
|
|
let data = this.state.inpText;
|
|
|
if(!isIE()){
|
|
@@ -241,6 +255,13 @@ class MainSuit extends Component{
|
|
|
}
|
|
|
e.target.innerText?(e.target.innerText=""):(e.target.innerHTML="")
|
|
|
freeText && freeText(data.trim());
|
|
|
+ // 慢病模板获取:精确匹配"糖尿病复诊",储存慢病字段
|
|
|
+ if(data.trim()=='糖尿病复诊'){
|
|
|
+ saveChronic && saveChronic({name:'糖尿病',id:21773});
|
|
|
+ this.setState({
|
|
|
+ showRecord:true
|
|
|
+ })
|
|
|
+ }
|
|
|
}else{
|
|
|
if(datas.length==0){
|
|
|
const ev = e || window.event;
|
|
@@ -259,10 +280,65 @@ class MainSuit extends Component{
|
|
|
},config.delayTime-200);
|
|
|
}
|
|
|
|
|
|
+ // 慢病
|
|
|
+ referRecord() {//是否引用历史病例弹窗
|
|
|
+ const { chronicDesease } = this.props
|
|
|
+ // hideReferRecord && hideReferRecord()
|
|
|
+ // showHistoryCaseModal && showHistoryCaseModal()
|
|
|
+ this.setState({
|
|
|
+ showRecord:false,
|
|
|
+ showHistoryCase:true
|
|
|
+ })
|
|
|
+ store.dispatch(initItemList(chronicDesease));
|
|
|
+ }
|
|
|
+ noReferRecord() {
|
|
|
+ this.setState({
|
|
|
+ showRecord:false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ referCase() {
|
|
|
+ const { items } = this.props
|
|
|
+ this.setState({
|
|
|
+ showHistoryCase:false
|
|
|
+ })
|
|
|
+ if (this.state.activeHistory === -1) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // let baseList = store.getState();
|
|
|
+ let baseObj = items[this.state.activeHistory];
|
|
|
+ pushAllDataList(baseObj.sign,'push',baseObj,'history') //引用
|
|
|
+ this.props.getBilling();
|
|
|
+ this.setState({
|
|
|
+ activeHistory: -1
|
|
|
+ })
|
|
|
+ }
|
|
|
+ closeHistoryCaseModal() {
|
|
|
+ this.setState({
|
|
|
+ activeHistory: -1,
|
|
|
+ showHistoryCase:false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handleQuoteClick(item, index) {
|
|
|
+ console.log('asadsd', item)
|
|
|
+ this.setState({
|
|
|
+ activeHistory: index
|
|
|
+ })
|
|
|
+ }
|
|
|
+ getHistoryCase() {
|
|
|
+ const { items } = this.props
|
|
|
+ return (<div className={style['history-info']}>
|
|
|
+ {items.map((item, index) => {
|
|
|
+ return<div onClick={this.handleQuoteClick.bind(this, item, index)} style={this.state.activeHistory === index ? {color: '#abcdef'} : ''}>
|
|
|
+ <img src={this.state.activeHistory === index ? iconRadioActive : iconRadioDefault}/>{item.diagnose}
|
|
|
+ </div>
|
|
|
+ })}
|
|
|
+ </div>)
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
render(){
|
|
|
const {type,CommonSymptoms,searchData,fetchPushInfos,isRead,totalHide,handleInput,fuzhen,saveText,editClear,datas,commSymHide,boxLeft,boxTop} = this.props;
|
|
|
- const {showModule,show,symptom,search} = this.state;
|
|
|
+ const {showModule,show,symptom,search,showRecord,showHistoryCase} = this.state;
|
|
|
const symptomFlag = CommonSymptoms.length>0 ? true : false;
|
|
|
const searchFlag = searchData.length>0 ? true : false;
|
|
|
const boxTop1 = datas.length>0?boxTop:45;
|
|
@@ -286,6 +362,13 @@ class MainSuit extends Component{
|
|
|
</ItemBox>
|
|
|
{/*没有推送结果就不显示*/}
|
|
|
{symptomFlag && !searchFlag ? <CommonSymptom data={CommonSymptoms} show={!totalHide&&symptom} onSelect={this.handleSelect} /> : ( searchFlag ? <SearchDrop data={searchData} show={!commSymHide} onSelect={this.handleSearchSelect} left={boxLeft1} top={boxTop1} mainEmpty={datas.length==0?true:false}/>:"")}
|
|
|
+ <ConfirmModal visible={showRecord} okText='是' cancelText='否' confirm={this.referRecord} cancel={this.noReferRecord} close={this.noReferRecord}>
|
|
|
+ <div className={style['confirm-info']}>是否引用往期病历</div>
|
|
|
+ </ConfirmModal>
|
|
|
+ <ConfirmModal visible={showHistoryCase} noFooter='true' title='请选择历史病历' close={this.closeHistoryCaseModal} titleBg="#DFEAFE" icon={tableIcon} height={300}>
|
|
|
+ {this.getHistoryCase()}
|
|
|
+ <div className={style['confirm-history']}><span className={style['confirm-history-btn']} onClick={this.referCase}>确定</span></div>
|
|
|
+ </ConfirmModal>
|
|
|
</div>
|
|
|
}
|
|
|
}
|