index.jsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 TreatDesc from '@components/TreatDesc'
  6. import {dragBox,windowRemoveEventHandler} from '@utils/tools'
  7. import DrugInfo from '@components/TreatDesc/DrugInfo';
  8. import Notify from '@commonComp/Notify'
  9. import close from './img/close.png';
  10. import generalIcon from './img/general.png';
  11. import surgicalIcon from './img/surgical.png';
  12. import $ from "jquery";
  13. class Treat extends Component {
  14. constructor(props){
  15. super(props);
  16. this.state = {
  17. zIndex:301
  18. }
  19. this.hideTreat = this.hideTreat.bind(this);
  20. this.handlePrescription = this.handlePrescription.bind(this);
  21. this.handleDetermine = this.handleDetermine.bind(this);
  22. this.setTreatBox = this.setTreatBox.bind(this);
  23. }
  24. componentDidMount(){
  25. dragBox('treatWrapper','dragTreatTitle')
  26. }
  27. hideTreat() {
  28. const { hideTreat,clearTreat, hideDrugInfo } = this.props;
  29. clearTreat && clearTreat();
  30. hideTreat && hideTreat();
  31. hideDrugInfo && hideDrugInfo();
  32. // windowRemoveEventHandler('mousemove',handleMove,document)
  33. }
  34. handlePrescription() {
  35. Notify.info('该功能即将上线,敬请期待。', 2000)
  36. }
  37. handleDetermine() {
  38. const { title, treatment, advice } = this.props
  39. const { addScheme } = this.props
  40. addScheme && addScheme(title, treatment);
  41. this.hideTreat()
  42. }
  43. showDrugInfo() {
  44. const { showDrugInfo } = this.props;
  45. showDrugInfo && showDrugInfo();
  46. }
  47. setTreatBox(idx){
  48. this.setState({
  49. zIndex:idx == 300?300 : 500
  50. })
  51. }
  52. render(){
  53. const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
  54. const { setDrugInfoMore } = this.props
  55. const { zIndex } = 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" style={{zIndex:zIndex}}>
  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. <DrugTreat treatment={ treatment }
  66. selectDrug={selectDrug}
  67. setOtherRecommend={ setOtherRecommend }
  68. showDrugInfo = {showDrugInfo}
  69. setDrugInfo={ setDrugInfo }
  70. setDrugInfoMore = {setDrugInfoMore} //查询多条药品说明数据
  71. >
  72. </DrugTreat>
  73. <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>
  74. </div>
  75. <div className={style['bottom']}>
  76. <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
  77. </div>
  78. {treatDesc && <TreatDesc
  79. treatment={treatment}
  80. treatDesc={treatDesc}
  81. selectDrug={selectDrug}
  82. setDrugInfo={ setDrugInfo }
  83. showDrugInfo = {showDrugInfo}
  84. showDrug = {showDrug}
  85. >
  86. </TreatDesc>}
  87. </div>
  88. {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
  89. {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
  90. {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
  91. </div>
  92. )
  93. }
  94. }
  95. export default Treat;