|
@@ -7,9 +7,11 @@ 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} from '@utils/tools';
|
|
|
+
|
|
|
import {dragBox} from '@utils/drag';
|
|
|
import store from '@store';
|
|
|
import $ from 'jquery';
|
|
@@ -28,6 +30,8 @@ class Operation extends Component {
|
|
|
zIndex:40,
|
|
|
sex:'3',
|
|
|
le:'',
|
|
|
+ deptId:'',//科室id
|
|
|
+ value:''
|
|
|
}
|
|
|
this.showPrint = this.showPrint.bind(this);
|
|
|
this.closePrint = this.closePrint.bind(this);
|
|
@@ -37,6 +41,8 @@ class Operation extends Component {
|
|
|
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() {
|
|
@@ -87,7 +93,6 @@ class Operation extends Component {
|
|
|
oKBg: '#3B9ED0',
|
|
|
msg: <p className={style['msg']}>是否保存该病历?</p>
|
|
|
})
|
|
|
-
|
|
|
this.props.diagShowTmp(true)
|
|
|
}
|
|
|
}
|
|
@@ -151,8 +156,8 @@ class Operation extends Component {
|
|
|
let jsonData = getAllDataList(baseList);
|
|
|
let jsonStr = getAllDataStringList(baseList);
|
|
|
let whichSign = baseList.typeConfig.mode;
|
|
|
- let tmpLis = baseList.tabTemplate.items;
|
|
|
- let flg = isAllClear(jsonStr)
|
|
|
+ let tmpLis = [];
|
|
|
+ let flg = isAllClear(jsonStr);
|
|
|
if(!flg){
|
|
|
Notify.info('模板数据不能为空')
|
|
|
return false
|
|
@@ -160,6 +165,11 @@ class Operation extends Component {
|
|
|
// console.log(jsonStr.chief,'文本')
|
|
|
// console.log(jsonData,'结构') //测试需要用到,不要删了
|
|
|
// console.log(tmpLis,'接口返回的')
|
|
|
+ if(this.props.admin){
|
|
|
+ tmpLis = baseList.tabTemplate.adminItems;
|
|
|
+ }else{
|
|
|
+ tmpLis = baseList.tabTemplate.items;
|
|
|
+ }
|
|
|
for(let i = 0;i <tmpLis.length;i++){
|
|
|
let dataStr = tmpLis[i].preview;
|
|
|
if(
|
|
@@ -180,24 +190,31 @@ class Operation extends Component {
|
|
|
}
|
|
|
changeTitle() {
|
|
|
return <div className={style['box']}>
|
|
|
- <input className={style['ipt']}
|
|
|
- placeholder="请输入模板名称"
|
|
|
- type="text"
|
|
|
- maxLength='30'
|
|
|
- onInput={(e) => {
|
|
|
- this.handleInput(e)
|
|
|
- }}
|
|
|
- onPropertyChange={(e) => { // 兼容ie
|
|
|
- this.handleInput(e)
|
|
|
- }}
|
|
|
- onKeyPress={e => this.keypress(e)}
|
|
|
- />
|
|
|
- <div className={style['line']}></div>
|
|
|
+ {/* <div className={style.titleTip}></div> */}
|
|
|
<div className={style['iptWrap']}>
|
|
|
- <p>请选择模板性别归属(错误引用,显示可能有误)</p>
|
|
|
- <span className={style['commonSex']} id="commonSex" onClick={this.changeRadio.bind(this,1)}><img src={check_right} alt=""/><i style={{color:'#000'}}>通用</i></span>
|
|
|
- <span id="maleSex" onClick={this.changeRadio.bind(this,2)}><img src={check_circle} alt=""/><i>男</i></span>
|
|
|
- <span id="femaleSex" onClick={this.changeRadio.bind(this,3)}><img src={check_circle} alt=""/><i>女</i></span>
|
|
|
+ <div className={style.name}>
|
|
|
+ <span>模版名称:</span>
|
|
|
+ <input className={style['ipt']}
|
|
|
+ placeholder="请输入模板名称"
|
|
|
+ type="text"
|
|
|
+ maxLength='30'
|
|
|
+ onInput={(e) => {
|
|
|
+ this.handleInput(e)
|
|
|
+ }}
|
|
|
+ onPropertyChange={(e) => { // 兼容ie
|
|
|
+ this.handleInput(e)
|
|
|
+ }}
|
|
|
+ onKeyPress={e => this.keypress(e)}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div className={style.male}>
|
|
|
+ <span>性别归属:</span>
|
|
|
+ <span className={style['commonSex']} id="commonSex" onClick={this.changeRadio.bind(this,1)}><img src={check_right} alt=""/><i style={{color:'#000'}}>通用</i></span>
|
|
|
+ <span id="maleSex" onClick={this.changeRadio.bind(this,2)}><img src={check_circle} alt=""/><i>男</i></span>
|
|
|
+ <span id="femaleSex" onClick={this.changeRadio.bind(this,3)}><img src={check_circle} alt=""/><i>女</i></span>
|
|
|
+ <span style={{paddingRight:0,color:'#777777'}}>(注:错误引用,显示可能有误)</span>
|
|
|
+ </div>
|
|
|
+ {/* <p>请选择模板性别归属(错误引用,显示可能有误)</p> */}
|
|
|
</div>
|
|
|
</div>
|
|
|
}
|
|
@@ -229,8 +246,8 @@ class Operation extends Component {
|
|
|
}
|
|
|
}
|
|
|
makeSure() {
|
|
|
- const { save, clear, saveDataAll,diagShowTmp ,chronicMagItem,chronicDesease} = this.props;
|
|
|
- const { type } = this.state;
|
|
|
+ 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: '' })
|
|
@@ -250,8 +267,15 @@ class Operation extends Component {
|
|
|
if (this.state.title.trim() == '') {
|
|
|
Notify.error('请输入模板名称')
|
|
|
return;
|
|
|
+ }else if(admin&&deptId == ''){
|
|
|
+ Notify.error('请选择科室')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(admin){
|
|
|
+ saveDataAlls(title,sex,deptId);
|
|
|
+ }else{
|
|
|
+ saveDataAll(title,sex);
|
|
|
}
|
|
|
- saveDataAll(this.state.title,this.state.sex);
|
|
|
}
|
|
|
}
|
|
|
closeDiagBox(){
|
|
@@ -265,15 +289,16 @@ class Operation extends Component {
|
|
|
this.setState({ title: '' })
|
|
|
}
|
|
|
}
|
|
|
+ setDeptId(id,name){
|
|
|
+ this.props.handleClearValue()
|
|
|
+ this.setState({
|
|
|
+ deptId :id,
|
|
|
+ value:name
|
|
|
+ })
|
|
|
+ }
|
|
|
componentWillReceiveProps(next){//监听滚动事件
|
|
|
const that = this;
|
|
|
if(next.winWidth <= 1024){
|
|
|
- /*$(document).on('scroll',function(){
|
|
|
- let left = -($(document).scrollLeft() - 10) + 'px';
|
|
|
- that.setState({
|
|
|
- le:left
|
|
|
- })
|
|
|
- })*/
|
|
|
$(window).scroll(function(){
|
|
|
let scrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
|
|
|
let left = -(scrollLeft - 10) +'px';
|
|
@@ -283,12 +308,16 @@ class Operation extends Component {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ handleChangeIpt(val){
|
|
|
+ this.setState({
|
|
|
+ value:val
|
|
|
+ })
|
|
|
+ }
|
|
|
render() {
|
|
|
- const { showPrint, closePrint, showPreview, closePreview } = this;
|
|
|
+ const { showPrint, closePrint, showPreview, closePreview,handleChangeIpt } = this;
|
|
|
const { visible, preVisible,diagShow } = this.props.print;
|
|
|
- const {winWidth,cancelDelTag} = this.props;
|
|
|
- const {zIndex,type,le} = this.state;
|
|
|
+ const {winWidth,cancelDelTag,departLis,handleChangeValue,admin} = this.props;
|
|
|
+ const {zIndex,type,le,value} = this.state;
|
|
|
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>
|
|
@@ -306,12 +335,31 @@ class Operation extends Component {
|
|
|
cancel={() => {this.closeDiagBox()}}
|
|
|
okText={this.state.okText}
|
|
|
height={type==3?228:200}
|
|
|
- width={type==3?400:300}
|
|
|
+ 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?<div className={style.department}>
|
|
|
+ <span>科室归属:</span>
|
|
|
+ <Search handleChangeValue={handleChangeValue} handleChangeIpt={handleChangeIpt} value={value} visible={true}>
|
|
|
+ <ul className={style.departLis}>
|
|
|
+ {
|
|
|
+ departLis.map((item,idx)=>{
|
|
|
+ return <li onClick={()=>this.setDeptId(item.id,item.conceptDeptName)}>
|
|
|
+ {item.conceptDeptName}
|
|
|
+ </li>
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </ul>
|
|
|
+ </Search>
|
|
|
+ <span style={{paddingRight:0,color:'#777777'}}>(支持汉字关键字搜索)</span>
|
|
|
+ </div>:null
|
|
|
+ }
|
|
|
</ConfirmModal>
|
|
|
</div>;
|
|
|
}
|