|
@@ -1,6 +1,6 @@
|
|
import React from 'react';
|
|
import React from 'react';
|
|
import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
|
|
import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
|
|
-import { deepClone,normalVal } from '@utils/tools';
|
|
|
|
|
|
+import { deepClone,normalVal,timestampToTime,filterDataArr } from '@utils/tools';
|
|
import styles from './index.less';
|
|
import styles from './index.less';
|
|
import date1 from './img/date1.png';
|
|
import date1 from './img/date1.png';
|
|
import date2 from './img/date2.png';
|
|
import date2 from './img/date2.png';
|
|
@@ -131,7 +131,7 @@ class Inspect extends React.Component {
|
|
this.setState({dateTime:date})
|
|
this.setState({dateTime:date})
|
|
return date;
|
|
return date;
|
|
}
|
|
}
|
|
- changeActivePart(idx,val){
|
|
|
|
|
|
+ changeActivePart(idx,val,clear){
|
|
let nums = this.state.num;
|
|
let nums = this.state.num;
|
|
let fillActive;
|
|
let fillActive;
|
|
if(nums == 0){
|
|
if(nums == 0){
|
|
@@ -142,22 +142,33 @@ class Inspect extends React.Component {
|
|
++nums;
|
|
++nums;
|
|
this.setState({num:nums});
|
|
this.setState({num:nums});
|
|
let tempArr = deepClone(fillActive);
|
|
let tempArr = deepClone(fillActive);
|
|
- let tempNumPlus = 0;
|
|
|
|
- for (let i = 0; i < tempArr.details.length; i++) {
|
|
|
|
- if (i == idx) {
|
|
|
|
- tempArr.details[i].value = val
|
|
|
|
- }
|
|
|
|
- if(tempArr.details[i].value != undefined && tempArr.details[i].value != ''){
|
|
|
|
- tempArr.show = true;
|
|
|
|
- }else{
|
|
|
|
- ++tempNumPlus;
|
|
|
|
- if(tempNumPlus == tempArr.details.length){
|
|
|
|
- tempArr.show = false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ if(clear){ //点击清空按钮,至清初输入的数字
|
|
|
|
+ for (let i = 0; i < tempArr.details.length; i++) {
|
|
|
|
+ tempArr.details[i].value = ''
|
|
|
|
+ tempArr.show = false;
|
|
|
|
+ }
|
|
|
|
+ tempArr.time = this.getCurrentDate();
|
|
|
|
+ this.setState({currentData:tempArr})
|
|
|
|
+ return;
|
|
|
|
+ }else{
|
|
|
|
+ let tempNumPlus = 0;
|
|
|
|
+ for (let i = 0; i < tempArr.details.length; i++) {
|
|
|
|
+ if (i == idx) {
|
|
|
|
+ tempArr.details[i].value = val
|
|
|
|
+ }
|
|
|
|
+ if(tempArr.details[i].value != undefined && tempArr.details[i].value != ''){
|
|
|
|
+ tempArr.show = true;
|
|
|
|
+ }else{
|
|
|
|
+ ++tempNumPlus;
|
|
|
|
+ if(tempNumPlus == tempArr.details.length){
|
|
|
|
+ tempArr.show = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tempArr.time = this.state.dateTime;
|
|
|
|
+ this.setState({currentData:tempArr})
|
|
}
|
|
}
|
|
- tempArr.time = this.state.dateTime;
|
|
|
|
- this.setState({currentData:tempArr})
|
|
|
|
}
|
|
}
|
|
getItemList(){ //填写单展示
|
|
getItemList(){ //填写单展示
|
|
let number = this.state.num;
|
|
let number = this.state.num;
|
|
@@ -242,6 +253,18 @@ class Inspect extends React.Component {
|
|
return <td style={{width:'20%'}}><span className={(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue?"red":''):''}>{val.value}</span> { val.labelSuffix}</td>
|
|
return <td style={{width:'20%'}}><span className={(val.value - 0).toString() == 'NaN'?"red":(val.maxValue || val.minValue) ? (val.value > val.maxValue || val.value < val.minValue?"red":''):''}>{val.value}</span> { val.labelSuffix}</td>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ toTime(time){
|
|
|
|
+ let tmpTim = time.split(',').join('')-0
|
|
|
|
+ if(time && tmpTim.toString() != 'NaN'){
|
|
|
|
+ let date = new Date('1900-01-01');
|
|
|
|
+ let dateTim = date.getTime();
|
|
|
|
+ let times = (tmpTim-2)*24*60*60*1000;
|
|
|
|
+ let result = timestampToTime(dateTim+times).split(' ')[0]
|
|
|
|
+ return result;
|
|
|
|
+ }else{
|
|
|
|
+ return time;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
render() {
|
|
render() {
|
|
const { handleChangeValue, list, labelList,delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive,getExcelDataList,handleCloseExcel,handlePush } = this.props;
|
|
const { handleChangeValue, list, labelList,delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive,getExcelDataList,handleCloseExcel,handlePush } = this.props;
|
|
const {toastText,visible} = this.state;
|
|
const {toastText,visible} = this.state;
|
|
@@ -269,7 +292,7 @@ class Inspect extends React.Component {
|
|
<td style={{width:'25%'}}>
|
|
<td style={{width:'25%'}}>
|
|
{normalVal(value.min,value.max)}
|
|
{normalVal(value.min,value.max)}
|
|
</td>
|
|
</td>
|
|
- <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+value.time}</td>
|
|
|
|
|
|
+ <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+this.toTime(value.time)}</td>
|
|
</tr>
|
|
</tr>
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -290,7 +313,7 @@ class Inspect extends React.Component {
|
|
// 标签,血常规。。
|
|
// 标签,血常规。。
|
|
item.show ?
|
|
item.show ?
|
|
<p className={styles.staticTagActive}>
|
|
<p className={styles.staticTagActive}>
|
|
- <span data-flg="current" style={{color:"#333"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</span>
|
|
|
|
|
|
+ <span data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</span>
|
|
</p>:
|
|
</p>:
|
|
<p>
|
|
<p>
|
|
<i data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</i>
|
|
<i data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</i>
|
|
@@ -321,9 +344,10 @@ class Inspect extends React.Component {
|
|
<InspectCommon
|
|
<InspectCommon
|
|
showFill={this.state.showFill}
|
|
showFill={this.state.showFill}
|
|
handleClear={(e)=>{
|
|
handleClear={(e)=>{
|
|
- handleClear(e,idx)
|
|
|
|
|
|
+ // handleClear(e,idx)
|
|
|
|
+ this.changeActivePart('','',true)
|
|
this.setState({
|
|
this.setState({
|
|
- currentData:fillActive
|
|
|
|
|
|
+ // currentData:fillActive
|
|
})
|
|
})
|
|
}}
|
|
}}
|
|
handleConfirm={(e)=>{
|
|
handleConfirm={(e)=>{
|