|
@@ -43,6 +43,8 @@ class Operation extends Component {
|
|
|
folderId:'',//选中文件夹名称
|
|
|
folderListShow:false, //文件夹列表展示
|
|
|
medicalName: '', //保存病历名称
|
|
|
+ showValit: false, // 显示校验的文字
|
|
|
+ saveVisible: false //保存病历模态框
|
|
|
}
|
|
|
this.showPrint = this.showPrint.bind(this);
|
|
|
this.closePrint = this.closePrint.bind(this);
|
|
@@ -63,9 +65,44 @@ class Operation extends Component {
|
|
|
this.spellFst = this.spellFst.bind(this);
|
|
|
this.hideFolderList = this.hideFolderList.bind(this)
|
|
|
this.handleMedicalChange = this.handleMedicalChange.bind(this)
|
|
|
+
|
|
|
+
|
|
|
+ this.makeSureSave = this.makeSureSave.bind(this);
|
|
|
+ this.closeSave = this.closeSave.bind(this);
|
|
|
this.$inp = React.createRef()
|
|
|
}
|
|
|
|
|
|
+ // 保存病历 _lcq
|
|
|
+ makeSureSave(){
|
|
|
+ if (this.state.medicalName.trim() === '') {
|
|
|
+ // Notify.info('请输入病历名称')
|
|
|
+ this.setState({
|
|
|
+ showValit: true
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // // 清除store中 medicalName的值
|
|
|
+ // const { clearmedicalName } = this.props
|
|
|
+ // clearmedicalName && clearmedicalName()
|
|
|
+ // diagShowTmp(false)
|
|
|
+ // this.setState({ title: '' })
|
|
|
+ this.setState({
|
|
|
+ medicalName: '',
|
|
|
+ saveVisible: false,
|
|
|
+ })
|
|
|
+ this.props.save();
|
|
|
+ }
|
|
|
+
|
|
|
+ // 取消编辑病历
|
|
|
+ closeSave() {
|
|
|
+ this.setState({
|
|
|
+ saveVisible: false,
|
|
|
+ showValit:false,
|
|
|
+ medicalName: ''
|
|
|
+ // templateName: ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
showPrint() {
|
|
|
this.setState({
|
|
|
zIndex:240
|
|
@@ -127,36 +164,27 @@ class Operation extends Component {
|
|
|
Notify.info('门诊号不能为空');
|
|
|
return;
|
|
|
}
|
|
|
- // }else if(keepState == 2){
|
|
|
- // Notify.info('诊断不能为空');
|
|
|
- // return;
|
|
|
- // }else{
|
|
|
- // this.setState({
|
|
|
- // type: type,
|
|
|
- // okText: '保存',
|
|
|
- // borderColor: '#3B9ED0',
|
|
|
- // okColor: '#fff',
|
|
|
- // oKBg: '#3B9ED0',
|
|
|
- // msg: <p className={style['msg']}>是否保存该病历?</p>
|
|
|
- // })
|
|
|
- // this.props.diagShowTmp(true)
|
|
|
- // }
|
|
|
- // 清除store中 medicalName的值
|
|
|
- const { clearmedicalName} = this.props
|
|
|
- clearmedicalName && clearmedicalName()
|
|
|
- this.setState({
|
|
|
- type: type,
|
|
|
- okText: '保存',
|
|
|
- borderColor: '#3B9ED0',
|
|
|
- okColor: '#fff',
|
|
|
- oKBg: '#3B9ED0',
|
|
|
- // msg: <p className={style['msg']}>是否保存该病历?</p>
|
|
|
- msg: <div className={style.outBox}><span>病历名称:</span><input type="text" placeholder="请输入病历名称" value={this.state.medicalName} onChange={this.handleMedicalChange} autocomplete="off" /></div>
|
|
|
+
|
|
|
+ // this.setState({
|
|
|
+ // type: type,
|
|
|
+ // okText: '保存',
|
|
|
+ // borderColor: '#3B9ED0',
|
|
|
+ // okColor: '#fff',
|
|
|
+ // oKBg: '#3B9ED0',
|
|
|
+ // msg: <div className={style.outBox}><div><span>病历名称:</span><input type="text" placeholder="请输入病历名称" value={this.state.medicalName} onChange={this.handleMedicalChange} autocomplete="off" /> </div></div>
|
|
|
+ // })
|
|
|
+ // this.props.diagShowTmp(true)
|
|
|
+ this.setState({
|
|
|
+ saveVisible: true
|
|
|
})
|
|
|
- this.props.diagShowTmp(true)
|
|
|
}
|
|
|
|
|
|
handleMedicalChange(e){
|
|
|
+ if (e.target.value.length > 0) {
|
|
|
+ this.setState({
|
|
|
+ showValit: false
|
|
|
+ })
|
|
|
+ }
|
|
|
const { setmedicalName} = this.props
|
|
|
this.setState({
|
|
|
medicalName: e.target.value
|
|
@@ -354,18 +382,26 @@ class Operation extends Component {
|
|
|
const { type,deptId,sex,title,fstName,folderId,folderNameVal } = this.state;
|
|
|
// console.log(type,'======type');
|
|
|
if (type == 1) {
|
|
|
- if (this.state.medicalName === '') {
|
|
|
- Notify.info('请输入病历名称')
|
|
|
- return
|
|
|
- }
|
|
|
- diagShowTmp(false)
|
|
|
- this.setState({ title: '' })
|
|
|
- if (type == 1) {
|
|
|
- this.setState({
|
|
|
- medicalName: ''
|
|
|
- })
|
|
|
- }
|
|
|
- save();
|
|
|
+ // if (this.state.medicalName === '') {
|
|
|
+ // Notify.info('请输入病历名称')
|
|
|
+ // this.setState({
|
|
|
+ // showValit: true
|
|
|
+ // },()=>{
|
|
|
+ // // console.log(this.state.showValit,'-=-=-=-');
|
|
|
+ // })
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // // 清除store中 medicalName的值
|
|
|
+ // const { clearmedicalName } = this.props
|
|
|
+ // clearmedicalName && clearmedicalName()
|
|
|
+ // diagShowTmp(false)
|
|
|
+ // this.setState({ title: '' })
|
|
|
+ // if (type == 1) {
|
|
|
+ // this.setState({
|
|
|
+ // medicalName: ''
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // save();
|
|
|
} else if (type == 2) {
|
|
|
// type === 2 清除数据
|
|
|
diagShowTmp(false);
|
|
@@ -507,6 +543,7 @@ class Operation extends Component {
|
|
|
const {winWidth,cancelDelTag,departLis,handleChangeValue,admin,floderListAdmin,folderModalShow,
|
|
|
floderModal,folderOrderShow,folderOrder,adminItems,patInfo,saveOrderFolder,hideLabel} = this.props;
|
|
|
const {zIndex,type,le,value,folder,folderListShow} = this.state;
|
|
|
+ // console.log(this.state.showValit,this.state.msg,'====================');
|
|
|
return <div className={style['container']} style={{left:le}}>
|
|
|
{/*<span className={style['button']} onClick={showPrint}><img src={printImg} /> 打印病历</span>*/}
|
|
|
{/* <span className={style['preButton']} onClick={showPreview}><img src={preview} /> 预览</span> */}
|
|
@@ -516,6 +553,28 @@ class Operation extends Component {
|
|
|
<span className={winWidth<=1082?`${style['clearButton']} ${style['saveButton']} ${style['minstyle']}`:`${style['clearButton']} ${style['saveButton']}`} onClick={() => { this.clearAll(2) }}>清除</span>
|
|
|
{visible?<PrintPreviewContainer visible={visible} onClose={closePrint} />:null}
|
|
|
{preVisible?<PreviewContainer visible={preVisible} onClose={closePreview} />:null}
|
|
|
+
|
|
|
+ {<ConfirmModal
|
|
|
+ visible={this.state.saveVisible}
|
|
|
+ confirm={this.makeSureSave}
|
|
|
+ close={this.closeSave}
|
|
|
+ cancel={this.closeSave}
|
|
|
+ okText={"保存"}
|
|
|
+ okBorderColor={'#3B9ED0'}
|
|
|
+ okColor={'#fff'}
|
|
|
+ oKBg={'#3B9ED0'}
|
|
|
+ title={'保存病历'}
|
|
|
+ height={200}
|
|
|
+ >
|
|
|
+ <div className={style.outBox}>
|
|
|
+ <div className={style.innerInp}>
|
|
|
+ <span>病历名称:</span>
|
|
|
+ <input type="text" placeholder="请输入病历名称" value={this.state.medicalName} onChange={this.handleMedicalChange} autocomplete="off" />
|
|
|
+ </div>
|
|
|
+ {this.state.showValit ? (<div className={style.valit}>请输入病历名称</div>) : null}
|
|
|
+ </div>
|
|
|
+ </ConfirmModal>}
|
|
|
+
|
|
|
{<ConfirmModal
|
|
|
visible={diagShow} //改为全局控制
|
|
|
confirm={() => { this.makeSure() }}
|
|
@@ -581,7 +640,12 @@ class Operation extends Component {
|
|
|
</div>
|
|
|
</div>:null
|
|
|
}
|
|
|
- </ConfirmModal>}
|
|
|
+ </ConfirmModal>
|
|
|
+ }
|
|
|
+ {/* 保存病历 */}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
<FolderName
|
|
|
folderModalShow={folderModalShow}
|
|
|
floderModal={floderModal}
|