|
@@ -6,7 +6,6 @@ import saveHistory from '@common/images/saveHistory.png';
|
|
|
import PrintPreviewContainer from '@containers/PrintPreviewContainer';
|
|
|
import PreviewContainer from '@containers/PreviewContainer';
|
|
|
import { ConfirmModal, Notify } from '@commonComp';
|
|
|
-import { changeVisible } from '@store/actions/tabTemplate';
|
|
|
import {getAllDataList,getAllDataStringList} from '@utils/tools';
|
|
|
import { initItemList } from '@store/async-actions/tabTemplate';
|
|
|
import store from '@store';
|
|
@@ -144,21 +143,22 @@ class Operation extends Component {
|
|
|
title: val
|
|
|
})
|
|
|
}
|
|
|
- keypress(e) {
|
|
|
+ keypress(event) {
|
|
|
+ let e = event?event:window.event;
|
|
|
if (e.keyCode == 13) {
|
|
|
- this.makeSure()
|
|
|
- store.dispatch(changeVisible(false))
|
|
|
+ // this.makeSure()
|
|
|
+ // store.dispatch(changeVisible(false))
|
|
|
}
|
|
|
}
|
|
|
saveHis(type) {
|
|
|
+ const { diagShowTmp } = this.props;
|
|
|
let baseList = store.getState();
|
|
|
+ let flg = this.getAllData();
|
|
|
if(baseList.tabTemplate.items.length == 0){
|
|
|
store.dispatch(initItemList()); //获取模板列表
|
|
|
}
|
|
|
- let flg = this.getAllData();
|
|
|
if(flg){
|
|
|
this.setState({
|
|
|
- visible: true,
|
|
|
title: '',
|
|
|
type: type,
|
|
|
okText: '保存',
|
|
@@ -167,6 +167,7 @@ class Operation extends Component {
|
|
|
oKBg: '#3B9ED0',
|
|
|
msg: this.changeTitle()
|
|
|
})
|
|
|
+ diagShowTmp(true)
|
|
|
}
|
|
|
}
|
|
|
getAllData(){
|
|
@@ -185,7 +186,7 @@ class Operation extends Component {
|
|
|
}
|
|
|
if (
|
|
|
JSON.stringify(jsonData.advice) == '{}' &&
|
|
|
- jsonData.chief.length < 1 &&
|
|
|
+ (jsonData.chief.length < 1 && jsonStr.chief == '[]') &&
|
|
|
jsonData.diag.length < 1 &&
|
|
|
jsonData.vital.length < 1 &&
|
|
|
jsonData.other.length < 1 &&
|
|
@@ -249,7 +250,7 @@ class Operation extends Component {
|
|
|
</div>
|
|
|
}
|
|
|
makeSure() {
|
|
|
- const { save, clear, saveDataAll } = this.props;
|
|
|
+ const { save, clear, saveDataAll,diagShowTmp } = this.props;
|
|
|
const { type } = this.state;
|
|
|
if (type == 1) {
|
|
|
this.setState({ visible: false, title: '' })
|
|
@@ -262,15 +263,15 @@ class Operation extends Component {
|
|
|
Notify.error('请输入模板名称')
|
|
|
return;
|
|
|
}
|
|
|
+ // diagShowTmp(false)
|
|
|
saveDataAll(this.state.title);
|
|
|
- this.setState({ visible: false, title: '' });
|
|
|
}
|
|
|
}
|
|
|
render() {
|
|
|
const { showPrint, closePrint, showPreview, closePreview } = this;
|
|
|
- const { visible, preVisible } = this.props.print;
|
|
|
+ const { visible, preVisible,diagShow } = this.props.print;
|
|
|
+ const { diagShowTmp } = this.props;
|
|
|
const {zIndex} = this.state;
|
|
|
-
|
|
|
return <div className={style['container']} style={{zIndex:zIndex}}>
|
|
|
<button className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</button>
|
|
|
<button className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</button>
|
|
@@ -282,8 +283,20 @@ class Operation extends Component {
|
|
|
<ConfirmModal
|
|
|
visible={this.state.visible}
|
|
|
confirm={() => { this.makeSure() }}
|
|
|
- close={() => { this.setState({ visible: false, title: '' }) }}
|
|
|
- cancel={() => { this.setState({ visible: false, title: '' }) }}
|
|
|
+ close={() => {this.setState({ visible: false, title: '' }) }}
|
|
|
+ cancel={() => {this.setState({ visible: false, title: '' }) }}
|
|
|
+ okText={this.state.okText}
|
|
|
+ okBorderColor={this.state.borderColor}
|
|
|
+ okColor={this.state.okColor}
|
|
|
+ oKBg={this.state.oKBg}
|
|
|
+ >
|
|
|
+ {this.state.msg}
|
|
|
+ </ConfirmModal>
|
|
|
+ <ConfirmModal
|
|
|
+ visible={diagShow}
|
|
|
+ confirm={() => { this.makeSure() }}
|
|
|
+ close={() => { diagShowTmp(false); this.setState({ title: '' }) }}
|
|
|
+ cancel={() => { diagShowTmp(false); this.setState({ title: '' }) }}
|
|
|
okText={this.state.okText}
|
|
|
okBorderColor={this.state.borderColor}
|
|
|
okColor={this.state.okColor}
|