index.jsx 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. import React,{ Component } from 'react';
  2. import style from './index.less';
  3. import GeneralTreat from './GeneralTreat/index.jsx';
  4. import DrugTreat from './DrugTreat/index.jsx';
  5. import DrugHistory from './DrugHistory/index.jsx';
  6. import FollowUp from './FollowUp/index.jsx';
  7. import AdverseReactions from './AdverseReactions/index.jsx';
  8. import TreatDesc from '@components/TreatDesc'
  9. import {dragBox,windowRemoveEventHandler} from '@utils/tools'
  10. import DrugInfo from '@components/TreatDesc/DrugInfo';
  11. import Notify from '@commonComp/Notify'
  12. import close from './img/close.png';
  13. import generalIcon from './img/general.png';
  14. import surgicalIcon from './img/surgical.png';
  15. import followUpIcon from './img/followUp.png';
  16. import drugIcon from './img/drug.png';
  17. import adverseReactionIcon from './img/adverseReaction.png';
  18. import $ from "jquery";
  19. class Treat extends Component {
  20. constructor(props){
  21. super(props);
  22. this.state = {
  23. zIndex:301,
  24. }
  25. this.hideTreat = this.hideTreat.bind(this);
  26. this.handlePrescription = this.handlePrescription.bind(this);
  27. this.handleDetermine = this.handleDetermine.bind(this);
  28. this.setTreatBox = this.setTreatBox.bind(this);
  29. }
  30. componentDidMount(){
  31. dragBox('treatWrapper','dragTreatTitle')
  32. }
  33. hideTreat() {
  34. const { hideTreat,clearTreat, hideDrugInfo } = this.props;
  35. clearTreat && clearTreat();
  36. hideTreat && hideTreat();
  37. hideDrugInfo && hideDrugInfo();
  38. // windowRemoveEventHandler('mousemove',handleMove,document)
  39. }
  40. handlePrescription() {
  41. Notify.info('该功能即将上线,敬请期待。', 2000)
  42. }
  43. handleDetermine() {
  44. const { title, treatment, advice, treatItem, adversReactionList, saveAllAdverseReaction, setAllFollowUp } = this.props
  45. const { addScheme } = this.props
  46. addScheme && addScheme(title, treatment);
  47. saveAllAdverseReaction && saveAllAdverseReaction(treatItem);
  48. setAllFollowUp && setAllFollowUp(treatItem)
  49. this.hideTreat()
  50. }
  51. showDrugInfo() {
  52. const { showDrugInfo } = this.props;
  53. showDrugInfo && showDrugInfo();
  54. }
  55. setTreatBox(){
  56. $('#treatWrapper').css({'z-index': 302});
  57. $('#drugWrapper').css({'z-index': 301});
  58. }
  59. render(){
  60. const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, drugHistory,
  61. selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo,
  62. title, drugInfoList, hideDrugInfoMore, adversReactionList, changeReact, followUp, setFollowUp, isRead, hasFollowUp} = this.props;
  63. const { zIndex,show } = this.state
  64. return(
  65. <div className={style['treat-wrapper']}>
  66. <div className={style['treat-mask']} onClick={this.hideTreat}>
  67. </div>
  68. <div id="treatWrapper" className={style['treat-box']} onselectstart="return false">
  69. <img className={style.close} onClick={this.hideTreat} src={close}/>
  70. <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
  71. <div className={style['treat-inner-box']}>
  72. <GeneralTreat icon={generalIcon} title='一般治疗' generalTreat={generalTreat}></GeneralTreat>
  73. {hasFollowUp && <FollowUp icon={followUpIcon} title='回访时间' noTitle='true' setFollowUp={setFollowUp} followUp = {followUp} isRead={isRead}></FollowUp>}
  74. {/* 回访时间 */}
  75. {/* {followUp && <div>回访时间:
  76. <span className={style['follow-up-box']}
  77. contentEditable='true'
  78. onInput = {this.handleInputFollowUp}>
  79. {followUp}</span>后回访,不适随诊
  80. </div>} */}
  81. { drugHistory && (drugHistory['慢病用药内容'] && drugHistory['慢病用药内容'].length > 0 || drugHistory['普通病用药内容'] && drugHistory['普通病用药内容'].length > 0) &&<DrugHistory icon={drugIcon}
  82. titleStyle={{background:'#EAF7FA',opacity:'1', filter:'alpha(opacity=100);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=100);'}}
  83. title='上次用药情况'
  84. drugHistory={drugHistory}
  85. showDrugInfo = {showDrugInfo}
  86. setDrugInfo={ setDrugInfo }>
  87. </DrugHistory>}
  88. {adversReactionList&&adversReactionList.length>0&&<AdverseReactions icon={adverseReactionIcon}
  89. titleStyle={{background:'#C72F2F',opacity:'0.1', filter:'alpha(opacity=10);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=10);'}}
  90. title='不良反应'
  91. adversReactionList = {adversReactionList}
  92. changeReact = {changeReact}
  93. showDrugInfo = {showDrugInfo}
  94. setDrugInfo={ setDrugInfo }>
  95. </AdverseReactions>}
  96. <DrugTreat treatment={ treatment }
  97. selectDrug={selectDrug}
  98. setOtherRecommend={ setOtherRecommend }
  99. showDrugInfo = {showDrugInfo}
  100. setDrugInfo={ setDrugInfo }
  101. setDrugInfoMore = {setDrugInfoMore} //查询多条药品说明数据
  102. >
  103. </DrugTreat>
  104. <GeneralTreat icon={surgicalIcon} title='手术治疗' titleStyle={{background:'#FAEAEA',opacity:'1', filter:'alpha(opacity=100);',filter:'progid:DXImageTransform.Microsoft.Alpha(opacity=100);'}} titleBg='#FAEAEA' generalTreat={surgeryTreat}></GeneralTreat>
  105. </div>
  106. <div className={style['bottom']}>
  107. <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
  108. </div>
  109. {treatDesc && <TreatDesc
  110. treatment={treatment}
  111. treatDesc={treatDesc}
  112. selectDrug={selectDrug}
  113. setDrugInfo={ setDrugInfo }
  114. showDrugInfo = {showDrugInfo}
  115. showDrug = {showDrug}
  116. >
  117. </TreatDesc>}
  118. </div>
  119. {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} treatIndexSet={treatIndexSet} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
  120. {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
  121. {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
  122. </div>
  123. )
  124. }
  125. }
  126. export default Treat;