|
@@ -14,7 +14,8 @@ import {showHistory} from "@store/actions/historyTemplates";
|
|
|
import { SET_READ_MODE } from "@store/types/typeConfig";
|
|
|
import {billing} from '@store/async-actions/pushMessage';
|
|
|
import {getHistempDetail} from '@store/async-actions/historyTemplates';
|
|
|
-
|
|
|
+import del from '../../../common/images/delete_no.png';
|
|
|
+import edit from '../../../common/images/check.png';
|
|
|
|
|
|
class HistoryCaseContainer extends React.Component {
|
|
|
constructor(props){
|
|
@@ -24,38 +25,69 @@ class HistoryCaseContainer extends React.Component {
|
|
|
activeId:'0',
|
|
|
dataStr:[],
|
|
|
dataJson:{},
|
|
|
- visible:false
|
|
|
+ visible:false,
|
|
|
+ delVisible: false,
|
|
|
+ editVisible: false,
|
|
|
+ templateName: '',
|
|
|
+ historyCase: [],
|
|
|
+ currentIndex:0
|
|
|
}
|
|
|
this.handleCaseClick=this.handleCaseClick.bind(this)
|
|
|
this.handleQuoteClick=this.handleQuoteClick.bind(this)
|
|
|
+ this.handleDelQuoteClick = this.handleDelQuoteClick.bind(this)
|
|
|
+ this.handleEditQuoteClick = this.handleEditQuoteClick.bind(this)
|
|
|
this.close = this.close.bind(this);
|
|
|
+ this.closeDel = this.closeDel.bind(this);
|
|
|
+ this.closeEdit = this.closeEdit.bind(this);
|
|
|
this.makeSure = this.makeSure.bind(this);
|
|
|
+ this.makeSureDel = this.makeSureDel.bind(this);
|
|
|
+ this.makeSureEdit = this.makeSureEdit.bind(this);
|
|
|
+ this.handleChange = this.handleChange.bind(this);
|
|
|
+ this.handleSortClick = this.handleSortClick.bind(this);
|
|
|
}
|
|
|
componentDidMount(){
|
|
|
+ // const {items} = this.props
|
|
|
+ // items.forEach(item=>{
|
|
|
+ // item.editShow = false
|
|
|
+ // })
|
|
|
+ // items[0].editShow = true
|
|
|
dragBox('hisWrapMove','closeHis','add')
|
|
|
- this.handleCaseClick(0)
|
|
|
+ setTimeout(() => {
|
|
|
+ this.handleCaseClick(0)
|
|
|
+ }, 50);
|
|
|
this.setState({
|
|
|
- visible:false
|
|
|
+ visible:false,
|
|
|
+ // historyCase: items
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ componentWillReceiveProps(nextProps){
|
|
|
+ const { items } = nextProps
|
|
|
+ this.setState({
|
|
|
+ // historyCase: items
|
|
|
})
|
|
|
}
|
|
|
- handleCaseClick(idx){
|
|
|
- const {items} = this.props;
|
|
|
+
|
|
|
+ // 点击当前的历史病历
|
|
|
+ handleCaseClick(idx) {
|
|
|
+ const { items } = this.props;
|
|
|
let tmpItems = []
|
|
|
$("#hislistLeft li").eq(idx).css({
|
|
|
- background:'#fff'
|
|
|
+ background: '#fff'
|
|
|
}).siblings().css({
|
|
|
- background:'#d2d1d1'
|
|
|
+ background: '#d2d1d1'
|
|
|
})
|
|
|
- if(items.length == 0){
|
|
|
+ if (items.length == 0) {
|
|
|
return
|
|
|
- }else{
|
|
|
- tmpItems=items[idx]
|
|
|
+ } else {
|
|
|
+ tmpItems = items[idx]
|
|
|
}
|
|
|
this.setState({
|
|
|
- activeId:idx,
|
|
|
- activeHis:tmpItems,
|
|
|
- dataStr:tmpItems.detailList||[],
|
|
|
+ activeId: idx,
|
|
|
+ activeHis: tmpItems,
|
|
|
+ dataStr: tmpItems.detailList || [],
|
|
|
// dataJson:JSON.parse(tmpItems.dataJson)||{},
|
|
|
+ currentIndex: idx
|
|
|
})
|
|
|
}
|
|
|
makeSure(){
|
|
@@ -69,6 +101,43 @@ class HistoryCaseContainer extends React.Component {
|
|
|
handleQuoteClick&&handleQuoteClick();
|
|
|
dragBox('hisWrapMove','closeHis','del');
|
|
|
}
|
|
|
+ //确认删除病历
|
|
|
+ makeSureDel(){
|
|
|
+ console.log('确认删除');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 取消删除病历
|
|
|
+ closeDel(){
|
|
|
+ this.setState({
|
|
|
+ delVisible: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 显示删除确认框
|
|
|
+ handleDelQuoteClick(e, val, idx) {
|
|
|
+ this.setState({
|
|
|
+ delVisible: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 确认编辑病历
|
|
|
+ makeSureEdit(){
|
|
|
+ console.log('确认编辑病历');
|
|
|
+ console.log(this.state.templateName,'======');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 取消编辑病历
|
|
|
+ closeEdit() {
|
|
|
+ this.setState({
|
|
|
+ editVisible: false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 显示编辑确认框
|
|
|
+ handleEditQuoteClick(e, val, idx) {
|
|
|
+ this.setState({
|
|
|
+ editVisible: true,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
close(){
|
|
|
this.setState({
|
|
|
visible:false
|
|
@@ -83,10 +152,37 @@ class HistoryCaseContainer extends React.Component {
|
|
|
// dataJson:JSON.parse(val.dataJson)||{},
|
|
|
})
|
|
|
}
|
|
|
+ // 修改模板名称 input的值
|
|
|
+ handleChange(e){
|
|
|
+ this.setState({
|
|
|
+ templateName: e.target.value
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理鼠标移入
|
|
|
+ handleMouseEnter(){
|
|
|
+ // console.log('处理鼠标移入');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理鼠标移除
|
|
|
+ handleMouseLeave(){
|
|
|
+ // console.log('处理鼠标移除');
|
|
|
+ }
|
|
|
+
|
|
|
+ // 排序
|
|
|
+ handleSortClick(){
|
|
|
+ const { items } = this.props;
|
|
|
+ let length = items && items.length
|
|
|
+ let index = length - this.state.currentIndex -1
|
|
|
+ this.props.handleSortClick()
|
|
|
+ this.setState({
|
|
|
+ currentIndex: index
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
render(){
|
|
|
const { items,handleSortClick,showHistoryBox,preInfo } = this.props;
|
|
|
- const { activeHis,visible,dataJson,dataStr } = this.state;
|
|
|
-
|
|
|
+ const { activeHis, visible, dataJson, dataStr, delVisible, editVisible, historyCase, currentIndex } = this.state;
|
|
|
const getAllDataStringList = () =>{ //获取所有模块文本的数据
|
|
|
let jsonDataString = {};
|
|
|
jsonDataString.lis = {};
|
|
@@ -107,25 +203,36 @@ class HistoryCaseContainer extends React.Component {
|
|
|
<div className={styles.mainHistoryLeft}>
|
|
|
<div className={styles.title}>
|
|
|
<span className={styles.his}>历史病历</span>
|
|
|
- <span className={styles.sort} onClick={handleSortClick}>排序 <img src={sort} alt="排序"/></span>
|
|
|
+ <span className={styles.sort} onClick={this.handleSortClick}>排序 <img src={sort} alt="排序"/></span>
|
|
|
</div>
|
|
|
<div className={styles.lists}>
|
|
|
<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} onClick={()=>{this.handleCaseClick(idx)}}>
|
|
|
- <span title={val.diagnose}>{val.diagnose}</span>
|
|
|
+ return <li key={val.id} onClick={() => { this.handleCaseClick(idx) }} onMouseEnter={() => this.handleMouseEnter()} onMouseLeave={() => this.handleMouseLeave()}>
|
|
|
+ <div class={styles.itemLeft}>
|
|
|
+ <span title={val.diagnose}>{val.diagnose}</span>
|
|
|
+ { currentIndex === idx && (<div className={styles.edit} onClick={(e) => { this.handleEditQuoteClick(e, val, idx) }}>
|
|
|
+ <img src={edit} />
|
|
|
+ </div>)}
|
|
|
+ </div>
|
|
|
+ <div class={styles.itemRight}>
|
|
|
+ <div className={styles.del} onClick={(e) => { this.handleDelQuoteClick(e, val, idx) }}>
|
|
|
+ <img src={del} />
|
|
|
+ </div>
|
|
|
+ <button
|
|
|
+ className={styles.quote}
|
|
|
+ onClick={(e) => { this.handleQuoteClick(e, val, idx) }}
|
|
|
+ >引 用</button>
|
|
|
+ </div>
|
|
|
+
|
|
|
{/* <span className={val.id == activeHistory.id?`${styles.time} ${styles.quoteHide}`:styles.time}>{val.inquiryDate}</span>
|
|
|
<button
|
|
|
className={val.id == activeHistory.id?`${styles.quote} ${styles.quoteShow}`:styles.quote}
|
|
|
onClick={(e)=>{handleQuoteClick(e,val)}}
|
|
|
>引 用</button> */}
|
|
|
- <button
|
|
|
- className={styles.quote}
|
|
|
- onClick={(e)=>{this.handleQuoteClick(e,val,idx)}}
|
|
|
- >引 用</button>
|
|
|
- <span className={styles.time}>{val.inquiryDate}</span>
|
|
|
+
|
|
|
+ {/* <span className={styles.time}>{val.inquiryDate}</span> */}
|
|
|
</li>
|
|
|
}):<Empty message={'无历史病历'}></Empty>
|
|
|
}
|
|
@@ -160,6 +267,54 @@ class HistoryCaseContainer extends React.Component {
|
|
|
>
|
|
|
<p className={styles['center']}>确认引用该病历?</p>
|
|
|
</ConfirmModal>
|
|
|
+
|
|
|
+ <ConfirmModal
|
|
|
+ visible={delVisible}
|
|
|
+ confirm={this.makeSureDel}
|
|
|
+ close={this.closeDel}
|
|
|
+ cancel={this.closeDel}
|
|
|
+ okText={"删除"}
|
|
|
+ okBorderColor={'#3B9ED0'}
|
|
|
+ okColor={'#fff'}
|
|
|
+ oKBg={'#3B9ED0'}
|
|
|
+
|
|
|
+ >
|
|
|
+ <p className={styles['center']}>确定删除病历?</p>
|
|
|
+ </ConfirmModal>
|
|
|
+
|
|
|
+ <ConfirmModal
|
|
|
+ visible={editVisible}
|
|
|
+ confirm={this.makeSureEdit}
|
|
|
+ close={this.closeEdit}
|
|
|
+ cancel={this.closeEdit}
|
|
|
+ okText={"保存"}
|
|
|
+ okBorderColor={'#3B9ED0'}
|
|
|
+ okColor={'#fff'}
|
|
|
+ oKBg={'#3B9ED0'}
|
|
|
+ title={'修改模板'}
|
|
|
+ height={200}
|
|
|
+ >
|
|
|
+ {/* <div className={style.name}>
|
|
|
+ <span className={style.leftName}>模板名称:</span>
|
|
|
+ <input className={style['ipt']}
|
|
|
+ autocomplete="off"
|
|
|
+ placeholder="请输入模板名称"
|
|
|
+ type="text"
|
|
|
+ maxLength='20'
|
|
|
+ onInput={(e) => {
|
|
|
+ this.handleInput(e)
|
|
|
+ }}
|
|
|
+ onPropertyChange={(e) => { // 兼容ie
|
|
|
+ this.handleInput(e)
|
|
|
+ }}
|
|
|
+ onKeyPress={e => this.keypress(e)}
|
|
|
+ />
|
|
|
+ </div> */}
|
|
|
+ <div className={styles.outBox}>
|
|
|
+ <span>模板名称:</span>
|
|
|
+ <input type="text" placeholder="请输入模板名称" value={this.state.templateName} onChange={this.handleChange} autocomplete="off"/>
|
|
|
+ </div>
|
|
|
+ </ConfirmModal>
|
|
|
</div>
|
|
|
)
|
|
|
}
|