|
@@ -8,14 +8,16 @@ import PreviewBody from '@components/PreviewBody';
|
|
|
import Empty from '@components/Empty'
|
|
|
import { pushAllDataList,didPushParamChange } from '@utils/tools';
|
|
|
import { dragBox } from '@utils/drag';
|
|
|
+import { initItemList, setInitHistory } from '@store/async-actions/historyTemplates';
|
|
|
import $ from 'jquery';
|
|
|
import { ConfirmModal } from '@commonComp';
|
|
|
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 { getHistempDetail, asyncUpdateByIdUsNames, asyncCancelTemplateInfos} from '@store/async-actions/historyTemplates';
|
|
|
import del from '../../../common/images/delete_no.png';
|
|
|
import edit from '../../../common/images/check.png';
|
|
|
+import Notify from '@commonComp/Notify';
|
|
|
|
|
|
class HistoryCaseContainer extends React.Component {
|
|
|
constructor(props){
|
|
@@ -28,9 +30,11 @@ class HistoryCaseContainer extends React.Component {
|
|
|
visible:false,
|
|
|
delVisible: false,
|
|
|
editVisible: false,
|
|
|
- templateName: '',
|
|
|
+ templateName: '', // 病历名称
|
|
|
historyCase: [],
|
|
|
- currentIndex:0
|
|
|
+ currentIndex:0,
|
|
|
+ delId: '', //删除病历id
|
|
|
+ editId: '', //编辑病历id
|
|
|
}
|
|
|
this.handleCaseClick=this.handleCaseClick.bind(this)
|
|
|
this.handleQuoteClick=this.handleQuoteClick.bind(this)
|
|
@@ -46,14 +50,14 @@ class HistoryCaseContainer extends React.Component {
|
|
|
this.handleSortClick = this.handleSortClick.bind(this);
|
|
|
}
|
|
|
componentDidMount(){
|
|
|
- // const {items} = this.props
|
|
|
+ const {items} = this.props
|
|
|
// items.forEach(item=>{
|
|
|
// item.editShow = false
|
|
|
// })
|
|
|
// items[0].editShow = true
|
|
|
dragBox('hisWrapMove','closeHis','add')
|
|
|
setTimeout(() => {
|
|
|
- this.handleCaseClick(0)
|
|
|
+ this.handleCaseClick(0, items[0])
|
|
|
}, 50);
|
|
|
this.setState({
|
|
|
visible:false,
|
|
@@ -68,8 +72,21 @@ class HistoryCaseContainer extends React.Component {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ // 获取列表数据
|
|
|
+ getTemplatePageAlls() {
|
|
|
+ initItemList().then(res => {
|
|
|
+ const result = res.data
|
|
|
+ if (result.code == 0 && result.data) {
|
|
|
+ store.dispatch(setInitHistory(result.data));
|
|
|
+ } else {
|
|
|
+ Notify.info("暂无历史病历");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 点击当前的历史病历
|
|
|
- handleCaseClick(idx) {
|
|
|
+ handleCaseClick(idx,val) {
|
|
|
const { items } = this.props;
|
|
|
let tmpItems = []
|
|
|
$("#hislistLeft li").eq(idx).css({
|
|
@@ -103,7 +120,20 @@ class HistoryCaseContainer extends React.Component {
|
|
|
}
|
|
|
//确认删除病历
|
|
|
makeSureDel(){
|
|
|
- console.log('确认删除');
|
|
|
+ const { delId } = this.state
|
|
|
+ store.dispatch(asyncCancelTemplateInfos(delId)).then(res => {
|
|
|
+ if (res.data.code === '0') {
|
|
|
+ Notify.success('病历删除成功');
|
|
|
+ this.setState({
|
|
|
+ delVisible: false
|
|
|
+ })
|
|
|
+ // 重新渲染列表
|
|
|
+ this.getTemplatePageAlls()
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ Notify.info(err.msg);
|
|
|
+ })
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// 取消删除病历
|
|
@@ -116,25 +146,40 @@ class HistoryCaseContainer extends React.Component {
|
|
|
handleDelQuoteClick(e, val, idx) {
|
|
|
this.setState({
|
|
|
delVisible: true,
|
|
|
+ delId: val.id
|
|
|
})
|
|
|
}
|
|
|
|
|
|
// 确认编辑病历
|
|
|
makeSureEdit(){
|
|
|
- console.log('确认编辑病历');
|
|
|
- console.log(this.state.templateName,'======');
|
|
|
+ const { editId, templateName} = this.state
|
|
|
+ store.dispatch(asyncUpdateByIdUsNames(editId, templateName)).then(res=>{
|
|
|
+ if (res.data.code === '0'){
|
|
|
+ Notify.success('病历修改成功');
|
|
|
+ this.setState({
|
|
|
+ editVisible : false
|
|
|
+ })
|
|
|
+ // 重新渲染列表
|
|
|
+ this.getTemplatePageAlls()
|
|
|
+ }
|
|
|
+ }).catch(err =>{
|
|
|
+ Notify.info(err.msg);
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
// 取消编辑病历
|
|
|
closeEdit() {
|
|
|
this.setState({
|
|
|
- editVisible: false
|
|
|
+ editVisible: false,
|
|
|
+ templateName: ''
|
|
|
})
|
|
|
}
|
|
|
// 显示编辑确认框
|
|
|
handleEditQuoteClick(e, val, idx) {
|
|
|
this.setState({
|
|
|
editVisible: true,
|
|
|
+ editId: val.id,
|
|
|
+ templateName: ''
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -182,7 +227,11 @@ class HistoryCaseContainer extends React.Component {
|
|
|
|
|
|
render(){
|
|
|
const { items,handleSortClick,showHistoryBox,preInfo } = this.props;
|
|
|
+
|
|
|
const { activeHis, visible, dataJson, dataStr, delVisible, editVisible, historyCase, currentIndex } = this.state;
|
|
|
+
|
|
|
+ console.log(dataStr,'dataStr');
|
|
|
+
|
|
|
const getAllDataStringList = () =>{ //获取所有模块文本的数据
|
|
|
let jsonDataString = {};
|
|
|
jsonDataString.lis = {};
|
|
@@ -203,15 +252,15 @@ class HistoryCaseContainer extends React.Component {
|
|
|
<div className={styles.mainHistoryLeft}>
|
|
|
<div className={styles.title}>
|
|
|
<span className={styles.his}>历史病历</span>
|
|
|
- <span className={styles.sort} onClick={this.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)=>{
|
|
|
// 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) }} onMouseEnter={() => this.handleMouseEnter()} onMouseLeave={() => this.handleMouseLeave()}>
|
|
|
+ return <li key={val.id} onClick={() => { this.handleCaseClick(idx, val) }} onMouseEnter={() => this.handleMouseEnter()} onMouseLeave={() => this.handleMouseLeave()}>
|
|
|
<div class={styles.itemLeft}>
|
|
|
- <span title={val.diagnose}>{val.diagnose}</span>
|
|
|
+ <span title={val.name}>{val.name}</span>
|
|
|
{ currentIndex === idx && (<div className={styles.edit} onClick={(e) => { this.handleEditQuoteClick(e, val, idx) }}>
|
|
|
<img src={edit} />
|
|
|
</div>)}
|
|
@@ -239,7 +288,7 @@ class HistoryCaseContainer extends React.Component {
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div className={styles.mainHistoryRight}>
|
|
|
+ {/* <div className={styles.mainHistoryRight}>
|
|
|
{
|
|
|
activeHis == undefined || JSON.stringify(activeHis) == "{}" ? null :
|
|
|
<PreviewBody
|
|
@@ -253,7 +302,7 @@ class HistoryCaseContainer extends React.Component {
|
|
|
showAssessBtn={true}
|
|
|
></PreviewBody>
|
|
|
}
|
|
|
- </div>
|
|
|
+ </div> */}
|
|
|
|
|
|
<ConfirmModal
|
|
|
visible={visible}
|
|
@@ -291,7 +340,7 @@ class HistoryCaseContainer extends React.Component {
|
|
|
okBorderColor={'#3B9ED0'}
|
|
|
okColor={'#fff'}
|
|
|
oKBg={'#3B9ED0'}
|
|
|
- title={'修改模板'}
|
|
|
+ title={'编辑病历名称'}
|
|
|
height={200}
|
|
|
>
|
|
|
{/* <div className={style.name}>
|
|
@@ -311,8 +360,8 @@ class HistoryCaseContainer extends React.Component {
|
|
|
/>
|
|
|
</div> */}
|
|
|
<div className={styles.outBox}>
|
|
|
- <span>模板名称:</span>
|
|
|
- <input type="text" placeholder="请输入模板名称" value={this.state.templateName} onChange={this.handleChange} autocomplete="off"/>
|
|
|
+ <span>病历名称:</span>
|
|
|
+ <input type="text" placeholder="请输入病历名称" value={this.state.templateName} onChange={this.handleChange} autocomplete="off"/>
|
|
|
</div>
|
|
|
</ConfirmModal>
|
|
|
</div>
|