index.jsx 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 LastTreat from './LastTreat/index.jsx';
  6. import AdverseReactions from './AdverseReactions/index.jsx';
  7. import TreatDesc from '@components/TreatDesc'
  8. import {dragBox,windowRemoveEventHandler} from '@utils/tools'
  9. import DrugInfo from '@components/TreatDesc/DrugInfo';
  10. import Notify from '@commonComp/Notify'
  11. import close from './img/close.png';
  12. import generalIcon from './img/general.png';
  13. import surgicalIcon from './img/surgical.png';
  14. import $ from "jquery";
  15. class Treat extends Component {
  16. constructor(props){
  17. super(props);
  18. this.state = {
  19. zIndex:301,
  20. }
  21. this.hideTreat = this.hideTreat.bind(this);
  22. this.handlePrescription = this.handlePrescription.bind(this);
  23. this.handleDetermine = this.handleDetermine.bind(this);
  24. this.setTreatBox = this.setTreatBox.bind(this);
  25. }
  26. componentDidMount(){
  27. dragBox('treatWrapper','dragTreatTitle')
  28. }
  29. hideTreat() {
  30. const { hideTreat,clearTreat, hideDrugInfo } = this.props;
  31. clearTreat && clearTreat();
  32. hideTreat && hideTreat();
  33. hideDrugInfo && hideDrugInfo();
  34. // windowRemoveEventHandler('mousemove',handleMove,document)
  35. }
  36. handlePrescription() {
  37. Notify.info('该功能即将上线,敬请期待。', 2000)
  38. }
  39. handleDetermine() {
  40. const { title, treatment, advice } = this.props
  41. const { addScheme } = this.props
  42. addScheme && addScheme(title, treatment);
  43. this.hideTreat()
  44. }
  45. showDrugInfo() {
  46. const { showDrugInfo } = this.props;
  47. showDrugInfo && showDrugInfo();
  48. }
  49. setTreatBox(){
  50. $('#treatWrapper').css({'z-index': 302});
  51. $('#drugWrapper').css({'z-index': 301});
  52. }
  53. render(){
  54. const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, lastTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore, adversReactionList} = this.props;
  55. const { zIndex,show } = this.state
  56. return(
  57. <div className={style['treat-wrapper']}>
  58. <div className={style['treat-mask']} onClick={this.hideTreat}>
  59. </div>
  60. <div id="treatWrapper" className={style['treat-box']} onselectstart="return false">
  61. <img className={style.close} onClick={this.hideTreat} src={close}/>
  62. <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
  63. <div className={style['treat-inner-box']}>
  64. <GeneralTreat icon={generalIcon} title='一般治疗' generalTreat={generalTreat}></GeneralTreat>
  65. {/* <LastTreat icon={generalIcon} title='上次用药情况' lastTreat={lastTreat} showDrugInfo = {showDrugInfo} setDrugInfo={ setDrugInfo }></LastTreat>
  66. <AdverseReactions icon={generalIcon} title='不良反应' adversReactionList = {adversReactionList}></AdverseReactions> */}
  67. <DrugTreat treatment={ treatment }
  68. selectDrug={selectDrug}
  69. setOtherRecommend={ setOtherRecommend }
  70. showDrugInfo = {showDrugInfo}
  71. setDrugInfo={ setDrugInfo }
  72. setDrugInfoMore = {setDrugInfoMore} //查询多条药品说明数据
  73. >
  74. </DrugTreat>
  75. <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>
  76. </div>
  77. <div className={style['bottom']}>
  78. <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
  79. </div>
  80. {treatDesc && <TreatDesc
  81. treatment={treatment}
  82. treatDesc={treatDesc}
  83. selectDrug={selectDrug}
  84. setDrugInfo={ setDrugInfo }
  85. showDrugInfo = {showDrugInfo}
  86. showDrug = {showDrug}
  87. >
  88. </TreatDesc>}
  89. </div>
  90. {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} treatIndexSet={treatIndexSet} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
  91. {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
  92. {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
  93. </div>
  94. )
  95. }
  96. }
  97. export default Treat;