import React,{Component} from 'react'; import style from './index.less'; import empty from '@common/images/check-circle.png'; import check from '@common/images/check-right.png'; import date from '@common/images/date1.png'; import TimeInterval from '@components/TimeInterval'; import {getCurrentDate} from "@utils/tools"; /** 科室病历列表 **/ class HisList extends Component { constructor(props){ super(props); this.state = { select:[], //选中ids hasSecond:-1, all:false, index:0, startTime:getCurrentDate(false)+' 00:00:00', endTime:getCurrentDate(false)+' 23:59:59', } this.handleGetMore = this.handleGetMore.bind(this); this.handleSelect = this.handleSelect.bind(this); this.handleAll = this.handleAll.bind(this); this.handleDownload = this.handleDownload.bind(this); this.getStartTime = this.getStartTime.bind(this); this.getEndTime = this.getEndTime.bind(this); } getStartTime(date){ this.setState({startTime:date}); const {handleFilter} = this.props; const {endTime} = this.state; const obj = { startDate:date, endDate:endTime, flag:999 //自定义以区分筛选条件 } handleFilter&&handleFilter(obj); } getEndTime(date){ this.setState({endTime:date}); const {handleFilter} = this.props; const {startTime} = this.state; const obj = { startDate:startTime, endDate:date, flag:999 //自定义以区分筛选条件 } handleFilter&&handleFilter(obj); } handleFilter(flag){ const {handleFilter} = this.props; this.setState({ hasSecond:flag }) const obj = { flag:flag } handleFilter&&handleFilter(obj); } handleGetMore(){ const {getMore} = this.props; getMore&&getMore(); } getClassName(id,ind){ const {select,index} = this.state; if(select.indexOf(id) !=-1 || ind==index){ return style['select-li'] } return ''; } handleSelect(e,id){ e.stopPropagation(); let {select} = this.state; if(select.indexOf(id)==-1){ select.push(id); }else{ select.splice(select.indexOf(id),1); } this.setState({ select }) } getIcon(id){ const {select} = this.state; if(select.indexOf(id)==-1){ return empty; } return check; } getAllIcon(){ const {all,select} = this.state; const {data} = this.props; if(all || select.length==data.length&&select.length!=0){ return check; } return empty; } handleAll(){ const {data} = this.props; let {all} = this.state; let allIds = []; if(!all){ data&&data.map((v,i)=>{ allIds.push(v.inquiryId); }) } this.setState({ all:!all, select:allIds }) } handleDetail(index){ const {detail} = this.props; detail&&detail(index); this.setState({ index:index }) } handleDownload(){ const { handleDownload } = this.props; const {select} = this.state; if(select.length>0){ handleDownload&&handleDownload(select); } } getExportStyle(){ const {select} = this.state; if(select.length>0){ return `${style['export']} ${style['exp-select']}` } return style['export']; } getList(){ const { data } = this.props; let list = data&&data.map((v,i)=>{ return
{v.diagnose}
{v.doctorName} {'于'}{v.inquiryTime} {'保存病历'}
{v.diagnoseSecond?{v.diagnoseSecond}{'(诊后添加)'}
{v.doctorNameSecond} {'于'}{v.inquiryTimeSecond} {'添加'}
点击查看更多
:''}