|
@@ -1,10 +1,13 @@
|
|
|
import React from 'react';
|
|
|
import { SearchOption, InspectCommon, Calendar ,Notify,ConfirmModal,Add} from '@commonComp';
|
|
|
-import { deepClone,normalVal,timestampToTime,filterDataArr } from '@utils/tools';
|
|
|
+import SlideExcel from './SlideExcel';
|
|
|
+import SlideSelect from './SlideSelect';
|
|
|
+import { deepClone } from '@utils/tools';
|
|
|
import styles from './index.less';
|
|
|
import date1 from './img/date1.png';
|
|
|
-import date2 from './img/date2.png';
|
|
|
import close from './img/close.png';
|
|
|
+import slideUp from "@common/images/slide-up.png";
|
|
|
+import slideDown from "@common/images/slide-down.png";
|
|
|
import store from '@store';
|
|
|
import $ from 'jquery';
|
|
|
class Inspect extends React.Component {
|
|
@@ -22,7 +25,8 @@ class Inspect extends React.Component {
|
|
|
toastText:'',
|
|
|
visible:false,
|
|
|
type:null,
|
|
|
- id:null
|
|
|
+ id:null,
|
|
|
+ tmpIds:[], //内层外层
|
|
|
}
|
|
|
this.handleChangeDate = this.handleChangeDate.bind(this)
|
|
|
this.handleShowDate = this.handleShowDate.bind(this)
|
|
@@ -34,6 +38,9 @@ class Inspect extends React.Component {
|
|
|
this.delConfirm = this.delConfirm.bind(this)
|
|
|
this.handleCancel = this.handleCancel.bind(this)
|
|
|
this.handleSearchShow = this.handleSearchShow.bind(this)
|
|
|
+ this.changeShowFill = this.changeShowFill.bind(this)
|
|
|
+ this.handleFillShow = this.handleFillShow.bind(this)
|
|
|
+ this.handleDelClick = this.handleDelClick.bind(this)
|
|
|
}
|
|
|
delConfirm(){//弹窗确定
|
|
|
const{delPartItem,handleCloseExcel,handlePush} = this.props;
|
|
@@ -97,6 +104,9 @@ class Inspect extends React.Component {
|
|
|
this.setState({num:0})
|
|
|
}
|
|
|
}
|
|
|
+ changeShowFill(){
|
|
|
+ this.setState({showFill:false})
|
|
|
+ }
|
|
|
handleChangeDate(info) {
|
|
|
let date = info.year+'-'+(info.month<10?'0'+info.month:info.month)+'-'+(info.day<10?'0'+info.day:info.day);
|
|
|
this.setState({dateTime:date,date:false})
|
|
@@ -253,21 +263,9 @@ 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>
|
|
|
}
|
|
|
}
|
|
|
- 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() {
|
|
|
const { handleChangeValue, list, labelList,delPartItem, handleLabelSub, handleClear, handleConfirm, fillActive,getExcelDataList,handleCloseExcel,handlePush } = this.props;
|
|
|
- const {toastText,visible} = this.state;
|
|
|
+ const {toastText,visible,tmpId,tmpIdx} = this.state;
|
|
|
return (
|
|
|
<div className={styles.wrapper}>
|
|
|
<div className={styles.check}>
|
|
@@ -279,25 +277,12 @@ class Inspect extends React.Component {
|
|
|
<img className={styles.close} src={close} alt="关闭导入excel数据" onClick={()=>{this.handleDelClick(2,id)}}/>
|
|
|
{
|
|
|
items.lisExcelRes.map((item,idx)=>{
|
|
|
- return <li className={styles.excelDataLis} style={{border:items.lisExcelRes.length-1 == idx? 0:''}}>
|
|
|
- <span className={styles.excelDataTitle}>
|
|
|
- {item.menus}
|
|
|
- </span>
|
|
|
- <table>
|
|
|
- {
|
|
|
- item.lisExcelItem && item.lisExcelItem.map((value)=>{
|
|
|
- return <tr>
|
|
|
- <td style={{width:'30%'}}>{value.itemName}</td>
|
|
|
- <td style={{width:'20%'}}><span className={value.type == 1?'red':null}>{value.value}</span> {value.unit}</td>
|
|
|
- <td style={{width:'25%'}}>
|
|
|
- {normalVal(value.min,value.max)}
|
|
|
- </td>
|
|
|
- <td style={{width:'25%'}}>{value.time == ''?('导入时间: '+this.state.dateTime):'化验时间: '+this.toTime(value.time)}</td>
|
|
|
- </tr>
|
|
|
- })
|
|
|
- }
|
|
|
- </table>
|
|
|
- </li>
|
|
|
+ return <SlideExcel
|
|
|
+ items={items}
|
|
|
+ item={item}
|
|
|
+ idx={idx}
|
|
|
+ dateTime={this.state.dateTime}
|
|
|
+ ></SlideExcel>
|
|
|
})
|
|
|
}
|
|
|
</ul>:null
|
|
@@ -308,79 +293,27 @@ class Inspect extends React.Component {
|
|
|
<ul className={styles.labelWrap} >
|
|
|
{
|
|
|
labelList && labelList.map((item,idx) => {
|
|
|
- return <li key={item.questionId}>
|
|
|
- {
|
|
|
- // 标签,血常规。。
|
|
|
- item.show ?
|
|
|
- <p className={styles.staticTagActive}>
|
|
|
- <span data-flg="current" style={{color:"#000"}} onClick={(e) => { handleLabelSub(e, item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</span>
|
|
|
- </p>:
|
|
|
- <p>
|
|
|
- <i data-flg="current" onClick={(e) => { handleLabelSub(e,item.questionId,idx); this.handleFillShow(e,idx) }}>{item.name}</i>
|
|
|
- </p>
|
|
|
- }
|
|
|
- {
|
|
|
- item.show ?
|
|
|
- <table className={styles.table}>
|
|
|
- {
|
|
|
- item.details.map((val)=>{
|
|
|
- if(val.value && val.value != ''){
|
|
|
- return <tr>
|
|
|
- <td style={{width:'30%'}}>{val.name}</td>
|
|
|
- {this.showDetails(val)}
|
|
|
- <td style={{width:'25%'}}>
|
|
|
- {normalVal(val.minValue,val.maxValue)}
|
|
|
- </td>
|
|
|
- <td style={{width:'25%'}}>{'化验时间:'+item.time}</td>
|
|
|
- </tr>
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- </table>:null
|
|
|
- }
|
|
|
- <div className={styles.searchResult}>
|
|
|
- {
|
|
|
- this.state.showFill && fillActive.id == item.id && idx == this.state.currentIdx ?
|
|
|
- <InspectCommon
|
|
|
- showFill={this.state.showFill}
|
|
|
- handleClear={(e)=>{
|
|
|
- // handleClear(e,idx)
|
|
|
- this.changeActivePart('','',true)
|
|
|
- this.setState({
|
|
|
- // currentData:fillActive
|
|
|
- })
|
|
|
- }}
|
|
|
- handleConfirm={(e)=>{
|
|
|
- // handleConfirm(e,idx,this.state.dateTime,fillActive);
|
|
|
- if(JSON.stringify(this.state.currentData) == '{}'){
|
|
|
- handleConfirm(e,idx,this.state.dateTime,fillActive);
|
|
|
- }else{
|
|
|
- handleConfirm(e,idx,this.state.dateTime,this.state.currentData);
|
|
|
- }
|
|
|
- this.setState({showFill:false})
|
|
|
- handlePush&&handlePush(); //右侧推送
|
|
|
- }}
|
|
|
- >
|
|
|
- <div className={styles.searchResultT}>
|
|
|
- <img style={{"position":"absolute","top":"8px","right":"8px"}} src={date1} alt="" onClick={this.handleShowDate}/>
|
|
|
- <p style={{position:"absolute",right:"38px",top:"4px",lineHeight:"28px"}}>
|
|
|
- {
|
|
|
- this.state.dateTime
|
|
|
- }
|
|
|
- </p>
|
|
|
- <div style={{display:this.state.date?"block":"none",position:"relative"}}>
|
|
|
- {/* 日期组件 */}
|
|
|
- <Calendar isShow={true} handleChange={this.handleChangeDate}></Calendar>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- {/* 填写单内容显示 */}
|
|
|
- { this.getItemList(idx) }
|
|
|
- </InspectCommon>
|
|
|
- : null
|
|
|
- }
|
|
|
- </div>
|
|
|
- <img className={styles.partDel} src={close} alt="删除项" onClick={()=>{this.handleDelClick(1,idx)}}/>
|
|
|
- </li>
|
|
|
+ return <SlideSelect
|
|
|
+ item={item}
|
|
|
+ idx={idx}
|
|
|
+ showFill={this.state.showFill}
|
|
|
+ handlePush={handlePush}
|
|
|
+ fillActive={fillActive}
|
|
|
+ handleLabelSub={handleLabelSub}
|
|
|
+ date={this.state.date}
|
|
|
+ dateTime={this.state.dateTime}
|
|
|
+ currentIdx={this.state.currentIdx}
|
|
|
+ currentData={this.state.currentData}
|
|
|
+ showDetails={this.showDetails}
|
|
|
+ handleShowDate={this.handleShowDate}
|
|
|
+ handleChangeDate={this.handleChangeDate}
|
|
|
+ changeShowFill={this.changeShowFill}
|
|
|
+ handleFillShow={this.handleFillShow}
|
|
|
+ getItemList={this.getItemList}
|
|
|
+ changeActivePart={this.changeActivePart}
|
|
|
+ handleDelClick={this.handleDelClick}
|
|
|
+ handleConfirm={handleConfirm}
|
|
|
+ ></SlideSelect>
|
|
|
})
|
|
|
}
|
|
|
</ul>
|