|
@@ -10,7 +10,6 @@ class PatInfo extends Component {
|
|
|
super(props)
|
|
|
this.state = {
|
|
|
show:false,
|
|
|
- cover:true,
|
|
|
name:'',
|
|
|
sex:'',
|
|
|
age:'',
|
|
@@ -35,12 +34,6 @@ class PatInfo extends Component {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- componentWillReceiveProps(nextProps){
|
|
|
- const {patientName,sex,patientAge} = nextProps.patInfo.message;
|
|
|
- if(!patientName&&!sex&&!patientAge){
|
|
|
- this.setState({cover:true})
|
|
|
- }
|
|
|
- }
|
|
|
handleName(e){
|
|
|
let value = e.target.value
|
|
|
const { setParams } = this.props;
|
|
@@ -66,8 +59,6 @@ class PatInfo extends Component {
|
|
|
this.checkValue(value.trim())
|
|
|
const { setParams } = this.props;
|
|
|
setParams({patientAge:value.trim()})
|
|
|
-
|
|
|
-
|
|
|
this.setState({
|
|
|
age:value.trim()
|
|
|
},()=>{
|
|
@@ -78,7 +69,8 @@ class PatInfo extends Component {
|
|
|
const { setParams } = this.props;
|
|
|
setParams({sex:value,patientSex:value==1?'男':value==2?'女':''})
|
|
|
this.setState({
|
|
|
- show:false,sex:value
|
|
|
+ show:false,
|
|
|
+ sex:value
|
|
|
},()=>{
|
|
|
this.watchData()
|
|
|
})
|
|
@@ -88,10 +80,10 @@ class PatInfo extends Component {
|
|
|
this.setState({show:!show})
|
|
|
}
|
|
|
watchData(){
|
|
|
- const {name,age,sex} = this.state
|
|
|
- const {handlePush,getInitModule} = this.props
|
|
|
- let allow = this.checkValue(age)
|
|
|
- if(name&&sex&&age&&allow){
|
|
|
+ const {handlePush,getInitModule,changeCover,patInfo} = this.props
|
|
|
+ const {patientName,sex,patientAge} = patInfo.message
|
|
|
+ let allow = this.checkValue(patientAge)
|
|
|
+ if(patientName&&sex&&patientAge&&allow){
|
|
|
let stimer = this.state.timer
|
|
|
clearTimeout(stimer);
|
|
|
let timer = setTimeout(function(){
|
|
@@ -101,10 +93,10 @@ class PatInfo extends Component {
|
|
|
this.setState({
|
|
|
timer
|
|
|
});
|
|
|
- this.setState({cover:false})
|
|
|
+ changeCover(false)
|
|
|
getInitModule()
|
|
|
}else{
|
|
|
- this.setState({cover:true})
|
|
|
+ changeCover(true)
|
|
|
}
|
|
|
}
|
|
|
checkMsg(){
|
|
@@ -123,8 +115,8 @@ class PatInfo extends Component {
|
|
|
}
|
|
|
}
|
|
|
render(){
|
|
|
- const {message} = this.props.patInfo;
|
|
|
- const {show,cover,reg} = this.state;
|
|
|
+ const {message,cover} = this.props.patInfo;
|
|
|
+ const {show,reg} = this.state;
|
|
|
return <table className={style["table"]}>
|
|
|
{/* <tr>
|
|
|
<td key='1' className={`${style.tdBorderB} ${style.tdBorderR}`} title={'卡号:' + (message.patientIdNo||'')}>卡号:{message.patientIdNo}</td>
|
|
@@ -141,11 +133,11 @@ class PatInfo extends Component {
|
|
|
<tr>
|
|
|
<td key='1' className={`${style.tdBorderB} ${style.tdBorderR} ${style.tdBorderOne}`}>
|
|
|
<span className={style['title']}>姓名:</span>
|
|
|
- <input type="text" placeholder="请输入" className={style['name']} onChange={(e)=>this.handleName(e)} value={message.patientName}/>
|
|
|
+ <input type="text" placeholder="请输入" className={style['name']} onInput={(e)=>this.handleName(e)} value={message.patientName}/>
|
|
|
</td>
|
|
|
<td key='3' className={`${style.tdBorderB} ${style.tdBorderR} ${style.tdBorderTwo}`}>
|
|
|
<span className={style['title']}>年龄:</span>
|
|
|
- <input type="text" className={style['age']} style={{"borderColor":reg?'#FF545B':'#E6E6E6'}} placeholder="请输入" onChange={(e)=>this.handleAge(e)} value={message.patientAge}/>
|
|
|
+ <input type="text" className={style['age']} style={{"borderColor":reg?'#FF545B':'#E6E6E6'}} placeholder="请输入" onInput={(e)=>this.handleAge(e)} value={message.patientAge}/>
|
|
|
<i style={{color:reg?'#FF545B':'#999999',display:reg?'block':'none'}}>* 请输入1-150以内的整数</i>
|
|
|
</td>
|
|
|
<td key='2' className={`${style.tdBorderB} ${style.tdBorderR} ${style.tdBorderThree}`}>
|