index.jsx 6.2 KB

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