|
@@ -1,7 +1,7 @@
|
|
|
import React, { Component } from "react";
|
|
|
import style from "./index.less";
|
|
|
import Select from './Select/index'
|
|
|
-import {timesYMDTime} from '@utils/tools';
|
|
|
+import { timesYMDTime, timestampToTime} from '@utils/tools';
|
|
|
import config from '@config/index';
|
|
|
import Notify from '@commonComp/Notify';
|
|
|
import { getHospitalInfo } from '@store/async-actions/historyTemplates';
|
|
@@ -43,7 +43,8 @@ class PatInfo extends Component {
|
|
|
{
|
|
|
label: 'systemTime',
|
|
|
id: 'systemTime',
|
|
|
- value: timesYMDTime(new Date().getTime()),
|
|
|
+ // value: timesYMDTime(new Date().getTime()),
|
|
|
+ value: timestampToTime(new Date().getTime()),
|
|
|
title: '就诊时间',
|
|
|
maxlength: 100
|
|
|
},
|
|
@@ -101,7 +102,16 @@ class PatInfo extends Component {
|
|
|
return item.id === e.target.id
|
|
|
})
|
|
|
if (patientItem.id === 'patientAge'){
|
|
|
- patientItem.value = e.target.value.replace(/[^\d]+/, '')
|
|
|
+ let temp = Math.round(e.target.value.replace(/[^\d\.]+/, ''))
|
|
|
+ if (isNaN(temp)){
|
|
|
+ patientItem.value = 50
|
|
|
+ Notify.info('请输入正确的年龄')
|
|
|
+ return
|
|
|
+ }else {
|
|
|
+ patientItem.value = temp
|
|
|
+ }
|
|
|
+
|
|
|
+ // patientItem.value = e.target.value.replace(/[^\d\.]+/, '') //小数四舍五入_楼超强2020914
|
|
|
} else {
|
|
|
patientItem.value = e.target.value;
|
|
|
}
|
|
@@ -168,7 +178,7 @@ class PatInfo extends Component {
|
|
|
></Select>
|
|
|
)}
|
|
|
{item.id === 'patientAge' && (<input id={item.id} type="text" autocomplete="off" maxlength={11} value={item.value} onChange={this.handleChange} onFocus={this.inputOnFocus}/>)}
|
|
|
- {item.id === 'systemTime' && (<input id={item.id} type="text" autocomplete="off" disabled value={item.value} onChange={this.handleChange} onFocus={this.inputOnFocus}/>)}
|
|
|
+ {item.id === 'systemTime' && (<input id={item.id} type="text" autocomplete="off" disabled value={item.value.split(' ')[0]} onChange={this.handleChange} onFocus={this.inputOnFocus}/>)}
|
|
|
{item.id !== 'patientAge' && item.id !== 'patientSex' && item.id !== 'systemTime' && (<input id={item.id} type="text" maxlength={item.maxlength} autocomplete="off" value={item.value} onChange={this.handleChange} onFocus={this.inputOnFocus}/>) }
|
|
|
</div>
|
|
|
)
|