index.jsx 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import React from 'react';
  2. import AddAssistCheck from '../AddAssistCheck';
  3. import { ItemBox, ConfirmModal, WrapModalContainer } from '@commonComp';
  4. import styles from './index.less';
  5. import Notify from '@commonComp/Notify';
  6. import $ from 'jquery';
  7. import { isIE, getUrlArgObject } from '@utils/tools.js';
  8. import { dragBox } from '@utils/drag';
  9. import WrapModalBodyPac from '@containers/WrapModalBodyPac';
  10. import { getExcelList } from '@store/actions/inspect';
  11. import { host, prefix } from '@utils/config.js';
  12. class AssistCheck extends React.Component {
  13. constructor(props){
  14. super(props);
  15. this.state={
  16. val: '',
  17. visible: false,
  18. dom: [],
  19. isIE: isIE(),
  20. ieVersion: null,
  21. height: '-1',
  22. hide: false,
  23. importLis:false
  24. }
  25. this.showSlideImport=this.showSlideImport.bind(this)
  26. // this.handleBindFileApi=this.handleBindFileApi.bind(this)
  27. this.checkSystemIpt=this.checkSystemIpt.bind(this)
  28. this.closeInIcss=this.closeInIcss.bind(this)
  29. this.onClose=this.onClose.bind(this)
  30. this.handleImportExcel=this.handleImportExcel.bind(this)
  31. this.refreshScroller = this.refreshScroller.bind(this);
  32. }
  33. handleImportExcel() {
  34. this.inputRef.click();
  35. }
  36. showSlideImport(){
  37. let flg = this.state.importLis
  38. this.setState({
  39. importLis:!flg
  40. })
  41. }
  42. onClose() {
  43. this.setState({
  44. hide: false
  45. })
  46. dragBox('previewWrapper', 'previewStatic', 'del')
  47. }
  48. checkSystemIpt() {
  49. this.setState({
  50. hide: true
  51. })
  52. }
  53. closeInIcss(){
  54. this.setState({
  55. hide: false
  56. })
  57. }
  58. refreshScroller(){
  59. //更新滚动条状态,解决容器变大滚动条不更新bug
  60. return this.context.scrollArea;
  61. //this.context.scrollArea.scrollBottom();
  62. }
  63. render(){
  64. const {setHighter,checkedListImport,list,getInfomation,windowHeight,hospitalMsg,assistLabel,assistVal,handleChangeValue,handleSign,fetchPushInfos,handleDelAssist,handleChangeAssistValue,handleChangeDate,isRead,winWidth,assistList} = this.props;
  65. const {showSlideImport,checkSystemIpt,onClose,closeInIcss} = this;
  66. const {importLis,ieVersion,hide} = this.state;
  67. // if(JSON.stringify(hospitalMsg) != {} && document.getElementById("choose")){//动态绑定只绑定一次
  68. // ++numFlg
  69. // numFlg == 1?handleBindFileApi():null
  70. // }
  71. return (
  72. <div className={styles.wrapper}>
  73. <div className={styles.top}>
  74. <span id="assistResultData">辅检结果数据</span>
  75. {/* <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
  76. <p id="importPacBtn" className={styles.importInspectBtn}>导入辅检结果</p>
  77. </div> */}
  78. {
  79. hospitalMsg.import_way_pacs == 1 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>
  80. <p className={styles.importInspectBtn}>导入辅检结果</p>
  81. <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
  82. </div> : hospitalMsg.import_way_pacs == 2 ? <div className={styles.pushButton} disabled={ieVersion && ieVersion > 9 ? true : false} onClick={checkSystemIpt}>
  83. <p className={styles.importInspectBtn}>导入辅检结果</p>
  84. </div> : hospitalMsg.import_way_pacs == 3 ? <div className={`${styles.pushButton} ${styles.importInspect}`} onClick={showSlideImport}>
  85. <p id="importExcelBtns" className={styles.importInspectBtn}>导入辅检结果</p>
  86. {
  87. importLis?<ul className={styles.importSelect} id="importExcelLists">
  88. <li className={styles.excelIpt}>
  89. <div onClick={ieVersion && ieVersion <= 9 ? null : this.handleImportExcel}>本地导入</div>
  90. <input type="file" name="uploadfile" id="choose" style={{ display: 'none' }} ref={(DOM) => this.inputRef = DOM} />
  91. </li>
  92. <li className={`${styles.excelIpt} ${styles.systemIpt}`} onClick={checkSystemIpt}>从设备导入</li>
  93. </ul>:null
  94. }
  95. </div> : null
  96. }
  97. {
  98. hide ? <WrapModalContainer hide={hide} title={'导入辅检数据'} width={1000} height={580} onClose={onClose}>
  99. <WrapModalBodyPac
  100. closeInIcss={closeInIcss}
  101. height={580}
  102. ></WrapModalBodyPac>
  103. </WrapModalContainer> : null
  104. }
  105. </div>
  106. <ItemBox
  107. className={styles.title}
  108. title={'辅检'}
  109. editable={false}
  110. border={true}
  111. marginTop={'20px'}
  112. >
  113. <div style={{padding:'10px',boxSizing:'border-box'}} >
  114. <AddAssistCheck
  115. handleChangeValue={handleChangeValue}
  116. refreshScroller={this.refreshScroller}
  117. list={list}
  118. handleSign={handleSign}
  119. assistLabel={assistLabel}
  120. handleDelAssist={handleDelAssist}
  121. handlePush={fetchPushInfos}
  122. handleChangeAssistValue={handleChangeAssistValue}
  123. handleChangeDate={handleChangeDate}
  124. isRead={isRead}
  125. winWidth={winWidth}
  126. getInfomation={getInfomation}
  127. assistList={assistList}
  128. assistVal={assistVal}
  129. windowHeight={windowHeight}
  130. checkedListImport={checkedListImport}
  131. setHighter={setHighter}
  132. >
  133. </AddAssistCheck>
  134. </div>
  135. </ItemBox>
  136. </div>
  137. )
  138. }
  139. }
  140. AssistCheck.contextTypes = {
  141. scrollArea: React.PropTypes.object
  142. };
  143. export default AssistCheck;