123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297 |
- 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,showName:clickDiag.showName });
- //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,
- showPartName,
- showAllName
- } = this.props.pushMessage;
- const { tipsDiscalimer,chronicPushItems,wholeIndexs,setPushEmergencyIdx,sysConfig,windowHeight,hideAllDrop,getInfomation} = this.props;
- const {
- billing,
- changeCheck,
- changeAssay,
- showTips
- } = this;
- const vigilants = vigilant.map((item, index) => {
- return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>;
- });
- return (
- <div className={style["push-content-wrapper"]}>
- <div className={style["push-content"]} ref={this.$cont}>
- <div style = {{width: '410px'}}>
- {vigilant && vigilant.length > 0 && (
- <div className={style["vigilant"]}>
- <div className={style["title"]}>
- <img src={vigilantImg} />
- 警惕
- </div>
- <div className={style["vigilantContent"]}>{vigilants}</div>
- </div>
- )}
- {/* 不展示确诊 */}
- {/* {determine && determine.length>0 && <PushDiag titleBg='#FAEBEC' icon={possibleImg} title='确诊' diagList={determine} maxShowNum={28}/>} */}
- {doubt && doubt.length > 0 && (
- <PushDiag
- titleBg="#FAEBEC"
- icon={doubtImg}
- title="初步诊断"
- diagList={doubt}
- />
- )}
- {possible && possible.length > 0 && (
- <PushDiag
- titleBg="#FAEBEC"
- icon={possibleImg}
- title="可能诊断"
- diagList={possible}
- />
- )}
- {likely && likely.length > 0 && (
- <PushDiag
- titleBg="#FAEBEC"
- icon={likelyImg}
- title="鉴别诊断"
- diagList={likely}
- />
- )}
- <div className={style["diagnose"]}>
- {vigilant.length === 0 &&
- determine.length === 0 &&
- doubt.length === 0 &&
- possible.length === 0 &&
- (!likely || likely&&likely.length ===0) &&
- (
- <div className={style["doubt"]}>
- <h1>
- <img src={doubtImg} />
- 初步诊断
- </h1>
- <div className={style["no-push"]}>无</div>
- </div>
- )}
- </div>
- <div className={style["recommend"]}>
- <h1>
- <img src={recommendImg} />
- 推荐检验检查
- <div className={style["billing"]}
- style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray', cursor:'auto'} : ''}
- onClick={assay.length === 0 && check.length === 0 ? '' : billing}>
- 开单
- </div>
- </h1>
- <div className={style["contentBox"]}>
- {assay.length === 0 && check.length === 0 ? (
- <span>无</span>
- ) : (<ul>
- <RecommendInspect
- title = '化验'
- list = {assay}
- changeFlag = {changeAssay}
- border = "true"
- type = {12}
- getInfomation = {getInfomation}
- >
- </RecommendInspect>
- <RecommendInspect
- title = '检查'
- list = {check}
- type = {6}
- changeFlag = {changeCheck}
- getInfomation = {getInfomation}
- >
- </RecommendInspect>
- </ul>)}
- </div>
- </div>
- {/*{chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}*/}
- {<ChronicInfo
- patDom={this.$cont}
- data={chronicPushItems}></ChronicInfo>}
- <TipsMsg
- patDom={this.$cont}
- tmpFlg = {tmpFlg}
- tipsImg = {tipsImg}
- tips = {tips}
- showTips = {showTips}
- tipsDiscalimer = {tipsDiscalimer}
- showPartName = {showPartName}
- ></TipsMsg>
- </div>
- {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2')&&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2').description}}></div>}
- </div>
- {showTipsDetails && <DetailsModal
- showTipsDetails = {showTipsDetails}
- hideTips = {this.hideTips}
- showAllName = {showAllName}
- tipsDetails = {tipsDetails}/>}
- {
- (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)&&<EmergencyProcedure hideAllDrop={hideAllDrop} windowHeight={windowHeight} data={dataLis[setPushEmergencyIdx]} idx={setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>
- }
- </div>
- );
- }
- }
- export default PushItems;
|