index.jsx 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 DrugInfo from '@components/TreatDesc/DrugInfo';
  7. import Notify from '@commonComp/Notify'
  8. import close from './img/close.png';
  9. import generalIcon from './img/general.png';
  10. import surgicalIcon from './img/surgical.png';
  11. import $ from "jquery";
  12. class Treat extends Component {
  13. constructor(props){
  14. super(props);
  15. this.hideTreat = this.hideTreat.bind(this);
  16. this.handlePrescription = this.handlePrescription.bind(this);
  17. this.handleDetermine = this.handleDetermine.bind(this);
  18. }
  19. hideTreat() {
  20. const { hideTreat,clearTreat } = this.props;
  21. clearTreat && clearTreat();
  22. hideTreat && hideTreat();
  23. }
  24. handlePrescription() {
  25. Notify.info('该功能即将上线,敬请期待。', 2000)
  26. }
  27. handleDetermine() {
  28. const { title, treatment, advice } = this.props
  29. const { addScheme } = this.props
  30. addScheme && addScheme(title, treatment);
  31. this.hideTreat()
  32. }
  33. showDrugInfo() {
  34. const { showDrugInfo } = this.props;
  35. showDrugInfo && showDrugInfo();
  36. }
  37. render(){
  38. const { generalTreat, treatment, treatItem, surgeryTreat, selectDrug, drugInfo, treatDesc, setOtherRecommend, setDrugInfo, showDrug, showDrugInfo,hideDrugInfo, title, drugInfoList, hideDrugInfoMore} = this.props;
  39. const { setDrugInfoMore } = this.props
  40. return(
  41. <div className={style['treat-wrapper']}>
  42. <div className={style['treat-mask']} onClick={this.hideTreat}>
  43. </div>
  44. <div id='treatWrapper' className={style['treat-box']}>
  45. <div className={style['treat-title']}>治疗方案 ({treatItem.name})<img onClick={this.hideTreat} src={close}/></div>
  46. <div className={style['treat-inner-box']}>
  47. <GeneralTreat icon={generalIcon} title='一般治疗' generalTreat={generalTreat}></GeneralTreat>
  48. <DrugTreat treatment={ treatment }
  49. selectDrug={selectDrug}
  50. setOtherRecommend={ setOtherRecommend }
  51. showDrugInfo = {showDrugInfo}
  52. setDrugInfo={ setDrugInfo }
  53. setDrugInfoMore = {setDrugInfoMore} //查询多条药品说明数据
  54. >
  55. </DrugTreat>
  56. <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>
  57. </div>
  58. <div className={style['bottom']}>
  59. <span className={style['prescription-btn']} onClick={this.handlePrescription}>开处方</span> <span className={style['determine-btn']} onClick={this.handleDetermine}>确定</span>
  60. </div>
  61. {treatDesc && <TreatDesc
  62. treatment={treatment}
  63. treatDesc={treatDesc}
  64. selectDrug={selectDrug}
  65. setDrugInfo={ setDrugInfo }
  66. showDrugInfo = {showDrugInfo}
  67. showDrug = {showDrug}
  68. >
  69. </TreatDesc>}
  70. </div>
  71. {showDrug && drugInfo && <DrugInfo drugInfo = {drugInfo} hideDrugInfo = {hideDrugInfo}></DrugInfo>}
  72. {/* 查询多个药品说明书 (添加数据查看药品说明书用)*/}
  73. {/* {showDrug && <DrugInfo drugInfoList = {drugInfoList} hideDrugInfoMore = {hideDrugInfoMore}></DrugInfo>} */}
  74. </div>
  75. )
  76. }
  77. }
  78. export default Treat;