import React, { Component } from "react"; import style from "./index.less"; import possibleImg from "../../common/images/possible.png"; import doubtImg from "../../common/images/doubt.png"; import recommendImg from "../../common/images/recommend.png"; import tipsImg from "../../common/images/tips.png"; import vigilantImg from "../../common/images/vigilant.png"; import likelyImg from "../../common/images/likely.png"; import DetailsModal from './DetailsModal'; import PushDiag from "./PushDiag"; import DiagnosticItem from "@containers/DiagnosticItem"; import store from "@store"; import {addLabel} from '@store/actions/inspect'; import {addAssistLabel} from '@store/actions/assistCheck'; import {windowEventHandler,getCurrentDate,getWindowInnerHeight,didPushParamChange} from '@utils/tools' import {ConfirmModal} from '@commonComp'; import ChronicInfo from '@containers/ChronicInfo';//慢病推送模块 import RecommendInspect from './RecommendInspect'; import TipsMsg from './TipsMsg' import dataLis from '@components/EmergencyProcedure/emergency'; import EmergencyProcedure from '@components/EmergencyProcedure'; class PushItems extends Component { constructor(props) { super(props); this.state = { moreAssay: false, moreCheck: false, show:true, showAssess:false, //评估弹窗 }; this.showMore = this.showMore.bind(this); this.closeMore = this.closeMore.bind(this); this.billing = this.billing.bind(this); this.changeAssay = this.changeAssay.bind(this); this.changeCheck = this.changeCheck.bind(this); this.showTips = this.showTips.bind(this); this.hideTips = this.hideTips.bind(this); this.$cont = React.createRef(); this.setDataIdx = this.setDataIdx.bind(this) } showMore(type) { this.setState({ [type]: true }); } closeMore(type) { this.setState({ [type]: false }); } showAssessFn(){ this.setState({ showAssess:!this.state.showAssess }); } billing() { const { assay, check } = this.props.pushMessage; const {EMRScrollCont} = this.props; const checkedAssay = assay.filter(item => item.checked); const checkedCheck = check.filter(item => item.checked); this.props.billing(checkedAssay, checkedCheck); let obj = { //添加化验 details: [], name: '', questionId: '', showType: 1, uniqueName:'' } let obj1 = { //添加辅检 name: '', questionId: '', showType: 1, time:getCurrentDate(1), value:'' } if(checkedAssay.length > 0){ let assayArr = [],tmpDetail=[] for(let i = 0;i < checkedAssay.length;i++){ let tmpObj = JSON.parse(JSON.stringify(obj)); if (checkedAssay[i].controlType == 0) { tmpDetail = checkedAssay[i].questionMapping }else if(checkedAssay[i].controlType == 1 || checkedAssay[i].controlType == 6){ tmpDetail.push(checkedAssay[i]) } tmpObj.questionId = checkedAssay[i].id tmpObj.name = checkedAssay[i].name tmpObj.details = tmpDetail tmpObj.uniqueName = checkedAssay[i].uniqueName||'' assayArr.push(tmpObj) } store.dispatch(addLabel(assayArr)) } if(checkedCheck.length > 0){ let checkArr = [] for(let i = 0;i < checkedCheck.length;i++){ let tmpObj = JSON.parse(JSON.stringify(obj1)); tmpObj.questionId = checkedCheck[i].id tmpObj.name = checkedCheck[i].name checkArr.push(tmpObj) } store.dispatch(addAssistLabel(checkArr)) } //滚动到底部 setTimeout(function(){ EMRScrollCont&&EMRScrollCont.scrollBottom(); },100); /*if(checkedAssay.length > 0){ document.getElementById("inspectResultData").scrollIntoView(true) }else{ if(checkedCheck.length > 0){ document.getElementById("assistResultData").scrollIntoView(true) }else{ return; } }*/ } changeAssay(item) { this.props.changeAssay(item); } changeCheck(item) { this.props.changeCheck(item); } showTips() { const { getTipsDetails, showTipsDetailsModal, clickDiag } = this.props; getTipsDetails && getTipsDetails({name: clickDiag.name, type: clickDiag.type,position:0}); //showTipsDetailsModal && showTipsDetailsModal() } hideTips() { const { hideTipsDetailsModal } = this.props; hideTipsDetailsModal && hideTipsDetailsModal() } componentDidMount() { const height = getWindowInnerHeight() - 190; this.$cont.current.style.height = height + "px"; windowEventHandler('resize', ()=>{ if(this.$cont.current){ const height = getWindowInnerHeight() - 190; this.$cont.current.style.height = height + "px"; } }); } setDataIdx(index){ this.props.setDataIdx&&this.props.setDataIdx(index) } render() { const { vigilant, determine, doubt, possible, likely, assay, check, tips, showTipsDetails, tipsDetails, tmpFlg, } = this.props.pushMessage; const { tipsDiscalimer,chronicPushItems,wholeIndexs,setPushEmergencyIdx,sysConfig,windowHeight,hideAllDrop} = this.props; const { billing, changeCheck, changeAssay, showTips } = this; const vigilants = vigilant.map((item, index) => { return