|
@@ -6,30 +6,89 @@ import sort from "./img/sort.png"
|
|
import close from "./img/close.png";
|
|
import close from "./img/close.png";
|
|
import PreviewBody from '@components/PreviewBody';
|
|
import PreviewBody from '@components/PreviewBody';
|
|
import Empty from '@components/Empty'
|
|
import Empty from '@components/Empty'
|
|
|
|
+import { pushAllDataList,didPushParamChange } from '@utils/tools';
|
|
import { dragBox } from '@utils/drag';
|
|
import { dragBox } from '@utils/drag';
|
|
|
|
+import $ from 'jquery';
|
|
|
|
+import { ConfirmModal } from '@commonComp';
|
|
|
|
+import {showHistory} from "@store/actions/historyTemplates";
|
|
|
|
+import { CONFIRM_TYPE } from "@store/types/typeConfig";
|
|
|
|
+import {billing} from '@store/async-actions/pushMessage';
|
|
|
|
|
|
|
|
|
|
class HistoryCaseContainer extends React.Component {
|
|
class HistoryCaseContainer extends React.Component {
|
|
constructor(props){
|
|
constructor(props){
|
|
super(props);
|
|
super(props);
|
|
|
|
+ this.state = {
|
|
|
|
+ activeHis:{},//预览数据
|
|
|
|
+ activeId:'0',
|
|
|
|
+ dataStr:[],
|
|
|
|
+ dataJson:{},
|
|
|
|
+ visible:false
|
|
|
|
+ }
|
|
this.handleCaseClick=this.handleCaseClick.bind(this)
|
|
this.handleCaseClick=this.handleCaseClick.bind(this)
|
|
|
|
+ this.handleQuoteClick=this.handleQuoteClick.bind(this)
|
|
|
|
+ this.close = this.close.bind(this);
|
|
|
|
+ this.makeSure = this.makeSure.bind(this);
|
|
}
|
|
}
|
|
componentDidMount(){
|
|
componentDidMount(){
|
|
dragBox('hisWrapMove','closeHis','add')
|
|
dragBox('hisWrapMove','closeHis','add')
|
|
|
|
+ this.handleCaseClick(0)
|
|
|
|
+ this.setState({
|
|
|
|
+ visible:false
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- handleCaseClick(e,idx){
|
|
|
|
- const {handleCaseClick} = this.props
|
|
|
|
- handleCaseClick&&handleCaseClick(e,idx)
|
|
|
|
|
|
+ handleCaseClick(idx){
|
|
|
|
+ const {items} = this.props;
|
|
|
|
+ let tmpItems = []
|
|
|
|
+ $("#hislistLeft li").eq(idx).css({
|
|
|
|
+ background:'#fff'
|
|
|
|
+ }).siblings().css({
|
|
|
|
+ background:'#d2d1d1'
|
|
|
|
+ })
|
|
|
|
+ if(items.length == 0){
|
|
|
|
+ return
|
|
|
|
+ }else{
|
|
|
|
+ tmpItems=items[idx]
|
|
|
|
+ }
|
|
|
|
+ console.log(tmpItems)
|
|
|
|
+ this.setState({
|
|
|
|
+ activeId:idx,
|
|
|
|
+ activeHis:tmpItems,
|
|
|
|
+ dataStr:tmpItems.detailList||[],
|
|
|
|
+ dataJson:JSON.parse(tmpItems.dataJson)||{},
|
|
|
|
+ })
|
|
}
|
|
}
|
|
- render(){
|
|
|
|
- const { items,handleCaseClick,handleQuoteClick,handleSortClick,showHistoryBox,activeHistory,preInfo } = this.props;
|
|
|
|
- let baseList = store.getState();
|
|
|
|
- let baseObj = baseList.historyTemplates.activeHistory;
|
|
|
|
- let dataJson,dataStr;
|
|
|
|
- if(baseObj){
|
|
|
|
- dataJson = JSON.stringify(baseObj) == "{}" ? {} : JSON.parse(baseList.historyTemplates.activeHistory.dataJson);
|
|
|
|
- dataStr = JSON.stringify(baseObj) == "{}" ? [] : baseObj.detailList;
|
|
|
|
|
|
+ makeSure(){
|
|
|
|
+ const {activeHis} = this.state
|
|
|
|
+ this.setState({visible:false})
|
|
|
|
+ store.dispatch(showHistory(false))
|
|
|
|
+ store.dispatch({type: CONFIRM_TYPE, confirmType: activeHis.sign});
|
|
|
|
+ pushAllDataList(activeHis.sign,'push',activeHis,'history') //引用
|
|
|
|
+ if(didPushParamChange()){
|
|
|
|
+ store.dispatch(billing())
|
|
}
|
|
}
|
|
|
|
+ const {handleQuoteClick} = this.props
|
|
|
|
+ handleQuoteClick&&handleQuoteClick()
|
|
|
|
+ dragBox('hisWrapMove','closeHis','del')
|
|
|
|
+ }
|
|
|
|
+ close(){
|
|
|
|
+ this.setState({
|
|
|
|
+ visible:false
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ handleQuoteClick(e,val,idx){
|
|
|
|
+ this.setState({
|
|
|
|
+ visible:true,
|
|
|
|
+ activeId:idx,
|
|
|
|
+ activeHis:val,
|
|
|
|
+ dataStr:val.detailList||[],
|
|
|
|
+ dataJson:JSON.parse(val.dataJson)||{},
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ render(){
|
|
|
|
+ const { items,handleSortClick,showHistoryBox,preInfo } = this.props;
|
|
|
|
+ const { activeHis,visible,dataJson,dataStr } = this.state;
|
|
|
|
+
|
|
const getAllDataStringList = () =>{ //获取所有模块文本的数据
|
|
const getAllDataStringList = () =>{ //获取所有模块文本的数据
|
|
let jsonDataString = {};
|
|
let jsonDataString = {};
|
|
jsonDataString.lis = {};
|
|
jsonDataString.lis = {};
|
|
@@ -53,10 +112,11 @@ class HistoryCaseContainer extends React.Component {
|
|
<span className={styles.sort} onClick={handleSortClick}>排序 <img src={sort} alt="排序"/></span>
|
|
<span className={styles.sort} onClick={handleSortClick}>排序 <img src={sort} alt="排序"/></span>
|
|
</div>
|
|
</div>
|
|
<div className={styles.lists}>
|
|
<div className={styles.lists}>
|
|
- <ul>
|
|
|
|
|
|
+ <ul id="hislistLeft">
|
|
{
|
|
{
|
|
(items && items.length > 0)? items.map((val,idx)=>{
|
|
(items && items.length > 0)? items.map((val,idx)=>{
|
|
- return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{this.handleCaseClick(e,idx)}}>
|
|
|
|
|
|
+ // return <li key={val.id} className={val.id == activeHistory.id?styles.bgc:''} onClick={(e)=>{this.handleCaseClick(e,idx)}}>
|
|
|
|
+ return <li key={val.id} onClick={()=>{this.handleCaseClick(idx)}}>
|
|
<span title={val.diagnose}>{val.diagnose}</span>
|
|
<span title={val.diagnose}>{val.diagnose}</span>
|
|
{/* <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
|
|
{/* <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
|
|
<button
|
|
<button
|
|
@@ -65,7 +125,7 @@ class HistoryCaseContainer extends React.Component {
|
|
>引 用</button> */}
|
|
>引 用</button> */}
|
|
<button
|
|
<button
|
|
className={styles.quote}
|
|
className={styles.quote}
|
|
- onClick={(e)=>{handleQuoteClick(e,val,idx)}}
|
|
|
|
|
|
+ onClick={(e)=>{this.handleQuoteClick(e,val,idx)}}
|
|
>引 用</button>
|
|
>引 用</button>
|
|
<span className={styles.time}>{val.inquiryDate}</span>
|
|
<span className={styles.time}>{val.inquiryDate}</span>
|
|
</li>
|
|
</li>
|
|
@@ -76,12 +136,12 @@ class HistoryCaseContainer extends React.Component {
|
|
</div>
|
|
</div>
|
|
<div className={styles.mainHistoryRight}>
|
|
<div className={styles.mainHistoryRight}>
|
|
{
|
|
{
|
|
- baseObj == undefined || JSON.stringify(baseObj) == "{}" ? null :
|
|
|
|
|
|
+ activeHis == undefined || JSON.stringify(activeHis) == "{}" ? null :
|
|
<PreviewBody
|
|
<PreviewBody
|
|
preInfo={preInfo}
|
|
preInfo={preInfo}
|
|
showHistoryCases={this.props.showHistoryCases}
|
|
showHistoryCases={this.props.showHistoryCases}
|
|
dataJson={dataJson}
|
|
dataJson={dataJson}
|
|
- baseObj={baseObj}
|
|
|
|
|
|
+ baseObj={activeHis}
|
|
dataStr={dataStr.length > 0?getAllDataStringList(dataStr):[]}
|
|
dataStr={dataStr.length > 0?getAllDataStringList(dataStr):[]}
|
|
show={false}
|
|
show={false}
|
|
flg={true}
|
|
flg={true}
|
|
@@ -89,6 +149,19 @@ class HistoryCaseContainer extends React.Component {
|
|
></PreviewBody>
|
|
></PreviewBody>
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ <ConfirmModal
|
|
|
|
+ visible={visible}
|
|
|
|
+ confirm={this.makeSure}
|
|
|
|
+ close={this.close}
|
|
|
|
+ cancel={this.close}
|
|
|
|
+ okText={"引用"}
|
|
|
|
+ okBorderColor={'#3B9ED0'}
|
|
|
|
+ okColor={'#fff'}
|
|
|
|
+ oKBg={'#3B9ED0'}
|
|
|
|
+ >
|
|
|
|
+ <p className={styles['center']}>确认引用该病历?</p>
|
|
|
|
+ </ConfirmModal>
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|