import React, { Component } from "react"; import style from "./index.less"; import printImg from '@common/images/icon_print_blue.png'; import preview from '@common/images/preview.png'; import saveHistory from '@common/images/saveHistory.png'; import cancelTag from '@common/images/icon_back.png'; import PrintPreviewContainer from '@containers/PrintPreviewContainer'; import PreviewContainer from '@containers/PreviewContainer'; import { ConfirmModal, Notify } from '@commonComp'; import Search from './Search'; import check_circle from './img/check-circle.png'; import check_right from './img/check-right.png'; import {getAllDataList,getAllDataStringList,isAllPartClear,isAllClear,filterDataArr,readyKeepHistory,checkDeptContent} from '@utils/tools'; import {dragBox} from '@utils/drag'; import store from '@store'; import $ from 'jquery'; class Operation extends Component { constructor(props) { super(props) this.state = { title: '', okText: '', borderColor: '', okColor: '', oKBg: '', msg: '', type: '', zIndex:40, sex:'3', le:'', deptId:'',//科室id value:'' } this.showPrint = this.showPrint.bind(this); this.closePrint = this.closePrint.bind(this); this.showPreview = this.showPreview.bind(this); this.closePreview = this.closePreview.bind(this); this.saveAll = this.saveAll.bind(this); this.clearAll = this.clearAll.bind(this); this.saveHis = this.saveHis.bind(this); this.keypress = this.keypress.bind(this); this.setDeptId = this.setDeptId.bind(this); this.handleChangeIpt = this.handleChangeIpt.bind(this); } showPrint() { this.setState({ zIndex:240 }) this.props.showPrintPreview() } closePrint() { this.setState({ zIndex:40 }) this.props.closePrintPreview() dragBox('previewPrintWrapper','previewPrintStatic','del') } showPreview() { this.setState({ zIndex:240 }) this.props.showPreview() } closePreview() { this.setState({ zIndex:40 }) this.props.closePreview() dragBox('previewWrapper','previewStatic','del') } saveAll(type) { let keepState = readyKeepHistory(); if(keepState == 1){ Notify.info('主诉不能为空'); return; }else if(keepState == 2){ Notify.info('诊断不能为空'); return; }else{ this.setState({ type: type, okText: '保存', borderColor: '#3B9ED0', okColor: '#fff', oKBg: '#3B9ED0', msg:

是否保存该病历?

}) this.props.diagShowTmp(true) } } clearAll(type) { let baseList = store.getState(); let jsonData = getAllDataList(baseList); let jsonStr = getAllDataStringList(baseList); let flg = isAllPartClear(jsonData,jsonStr,baseList); const tpVal = $("#templateSearch").val(); //模板是否有搜索条件未清空 const mdVal = $("#medicalInfoSearch").val(); //知识是否有搜索条件未清空 if(flg||tpVal||mdVal){ this.setState({ type: type, okText: '清除', borderColor: 'red', okColor: 'red', oKBg: '#fff', msg:

是否清空所有内容?

}) this.props.diagShowTmp(true) }else{ Notify.info('当前页面数据已清空'); } } onchange(val) { this.setState({ title: val }) } handleInput(e){ let val = (e.target.value).substring(0,30) this.onchange(val) } keypress(event) { let e = event?event:window.event; if (e.keyCode == 13) { this.makeSure() } } saveHis(type) { const { diagShowTmp } = this.props; let baseList = store.getState(); let jsonStr = getAllDataStringList(baseList); let tmpLis = []; let flg = isAllClear(jsonStr); if(!flg){ Notify.info('模板数据不能为空'); return false; } if(!this.props.admin){ tmpLis = baseList.tabTemplate.items; for(let i = 0;i {/*
*/}
模板名称: { this.handleInput(e) }} onPropertyChange={(e) => { // 兼容ie this.handleInput(e) }} onKeyPress={e => this.keypress(e)} />
性别归属: 通用 (注:错误引用,显示可能有误)
{/*

请选择模板性别归属(错误引用,显示可能有误)

*/}
} changeRadio(sex){ if(sex == 1){ $('#commonSex img').attr('src',check_right) $('#maleSex img').attr('src',check_circle) $('#femaleSex img').attr('src',check_circle) $('#commonSex i').css('color','#000') $('#maleSex i').css('color','#6b6969') $('#femaleSex i').css('color','#6b6969') this.setState({sex:'3'}) }else if(sex == 2){ $('#commonSex img').attr('src',check_circle) $('#maleSex img').attr('src',check_right) $('#femaleSex img').attr('src',check_circle) $('#commonSex i').css('color','#6b6969') $('#maleSex i').css('color','#000') $('#femaleSex i').css('color','#6b6969') this.setState({sex:'1'}) }else if(sex == 3){ $('#commonSex img').attr('src',check_circle) $('#maleSex img').attr('src',check_circle) $('#femaleSex img').attr('src',check_right) $('#commonSex i').css('color','#6b6969') $('#maleSex i').css('color','#6b6969') $('#femaleSex i').css('color','#000') this.setState({sex:'2'}) } } makeSure() { const { save, clear, saveDataAll,saveDataAlls,diagShowTmp ,chronicMagItem,chronicDesease,admin} = this.props; const { type,deptId,sex,title } = this.state; if (type == 1) { diagShowTmp(false) this.setState({ title: '' }) save(); } else if (type == 2) { diagShowTmp(false); this.setState({ title: '' }) // 慢病标识 const chronicFlag = chronicMagItem || chronicDesease?true:false; clear(chronicFlag); //更新滚动条 const that = this; setTimeout(function(){ that.context.scrollArea&&that.context.scrollArea.refresh(); }); } else if (type == 3) { if (this.state.title.trim() == '') { Notify.error('请输入模板名称') return; }else if(admin&&deptId == ''){ Notify.error('请选择科室') return; } if(admin){ let baseList = store.getState(); let tmpLis = baseList.tabTemplate.adminItems||[]; let jsonStr = getAllDataStringList(baseList); for(let i = 0;i 打印病历 预览 { this.saveHis(3) }}> 保存病历模板 还原标签 { this.saveAll(1) }}>保存 { this.clearAll(2) }}>清除 {visible?:null} {preVisible?:null} { this.makeSure() }} close={() => { this.closeDiagBox()}} cancel={() => {this.closeDiagBox()}} okText={this.state.okText} height={type==3?228:200} width={type==3?545:300} okBorderColor={this.state.borderColor} okColor={this.state.okColor} oKBg={this.state.oKBg} borderBtm={type==3?'1px solid #f5f5f5':null} title={type==3?'保存病历模板':null} > {this.state.msg} { admin&&type==3?
科室归属: { departLis.length>0&&
    { departLis.map((item,idx)=>{ return
  • this.setDeptId(item.id,item.conceptDeptName)}> {item.conceptDeptName}
  • }) }
}
(支持汉字关键字搜索)
:null }
; } } Operation.contextTypes = { scrollArea: React.PropTypes.object }; export default Operation;