index.jsx 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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(){
  48. $('#treatWrapper').css({'z-index': 302});
  49. $('#drugWrapper').css({'z-index': 301});
  50. }
  51. render(){
  52. const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
  53. const { zIndex,show } = this.state
  54. return(
  55. <div className={style['treat-wrapper']}>
  56. <div className={style['treat-mask']} onClick={this.hideTreat}>
  57. </div>
  58. <div id="treatWrapper" className={style['treat-box']} onselectstart="return false">
  59. <img className={style.close} onClick={this.hideTreat} src={close}/>
  60. <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
  61. <div className={style['treat-inner-box']}>
  62. <GeneralTreat icon={generalIcon} title='一般治疗' generalTreat={generalTreat}></GeneralTreat>
  63. <DrugTreat treatment={ treatment }
  64. selectDrug={selectDrug}
  65. setOtherRecommend={ setOtherRecommend }
  66. showDrugInfo = {showDrugInfo}
  67. setDrugInfo={ setDrugInfo }
  68. setDrugInfoMore = {setDrugInfoMore} //查询多条药品说明数据
  69. >
  70. </DrugTreat>
  71. <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>
  72. </div>
  73. <div className={style['bottom']}>
  74. <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
  75. </div>
  76. {treatDesc && <TreatDesc
  77. treatment={treatment}
  78. treatDesc={treatDesc}
  79. selectDrug={selectDrug}
  80. setDrugInfo={ setDrugInfo }
  81. showDrugInfo = {showDrugInfo}
  82. showDrug = {showDrug}
  83. >
  84. </TreatDesc>}
  85. </div>
  86. {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} treatIndexSet={treatIndexSet} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
  87. {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
  88. {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
  89. </div>
  90. )
  91. }
  92. }
  93. export default Treat;