index.jsx 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 } = this.props;
  29. clearTreat && clearTreat();
  30. hideTreat && hideTreat();
  31. // windowRemoveEventHandler('mousemove',handleMove,document)
  32. }
  33. handlePrescription() {
  34. Notify.info('该功能即将上线,敬请期待。', 2000)
  35. }
  36. handleDetermine() {
  37. const { title, treatment, advice } = this.props
  38. const { addScheme } = this.props
  39. addScheme && addScheme(title, treatment);
  40. this.hideTreat()
  41. }
  42. showDrugInfo() {
  43. const { showDrugInfo } = this.props;
  44. showDrugInfo && showDrugInfo();
  45. }
  46. setTreatBox(){
  47. $('#treatWrapper').css({'z-index': 302});
  48. $('#drugWrapper').css({'z-index': 301});
  49. }
  50. render(){
  51. const {setDrugInfoMore,treatIndex,treatIndexSet, generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
  52. const { zIndex,show } = this.state
  53. return(
  54. <div className={style['treat-wrapper']}>
  55. <div className={style['treat-mask']} onClick={this.hideTreat}>
  56. </div>
  57. <div id="treatWrapper" className={style['treat-box']} onselectstart="return false">
  58. <img className={style.close} onClick={this.hideTreat} src={close}/>
  59. <div onMouseDown={this.setTreatBox} id="dragTreatTitle" className={style['treat-title']}>治疗方案 ({treatItem.name})</div>
  60. <div className={style['treat-inner-box']}>
  61. <GeneralTreat icon={generalIcon} title='一般治疗' generalTreat={generalTreat}></GeneralTreat>
  62. <DrugTreat treatment={ treatment }
  63. selectDrug={selectDrug}
  64. setOtherRecommend={ setOtherRecommend }
  65. showDrugInfo = {showDrugInfo}
  66. setDrugInfo={ setDrugInfo }
  67. setDrugInfoMore = {setDrugInfoMore} //查询多条药品说明数据
  68. >
  69. </DrugTreat>
  70. <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>
  71. </div>
  72. <div className={style['bottom']}>
  73. <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
  74. </div>
  75. {treatDesc && <TreatDesc
  76. treatment={treatment}
  77. treatDesc={treatDesc}
  78. selectDrug={selectDrug}
  79. setDrugInfo={ setDrugInfo }
  80. showDrugInfo = {showDrugInfo}
  81. showDrug = {showDrug}
  82. >
  83. </TreatDesc>}
  84. </div>
  85. {showDrug && drugInfo && <DrugInfo setTreatBox={this.setTreatBox} treatIndexSet={treatIndexSet} drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
  86. {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
  87. {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
  88. </div>
  89. )
  90. }
  91. }
  92. export default Treat;