index.jsx 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. import React, { Component } from "react";
  2. import style from "./index.less";
  3. import possibleImg from "../../common/images/possible.png";
  4. import doubtImg from "../../common/images/doubt.png";
  5. import recommendImg from "../../common/images/recommend.png";
  6. import tipsImg from "../../common/images/tips.png";
  7. import vigilantImg from "../../common/images/vigilant.png";
  8. import likelyImg from "../../common/images/likely.png";
  9. import DetailsModal from './DetailsModal';
  10. import PushDiag from "./PushDiag";
  11. import DiagnosticItem from "@containers/DiagnosticItem";
  12. import store from "@store";
  13. import {addLabel} from '@store/actions/inspect';
  14. import {addAssistLabel} from '@store/actions/assistCheck';
  15. import {windowEventHandler,getCurrentDate,getWindowInnerHeight,didPushParamChange} from '@utils/tools'
  16. import {ConfirmModal} from '@commonComp';
  17. import ChronicInfo from '@containers/ChronicInfo';//慢病推送模块
  18. import RecommendInspect from './RecommendInspect';
  19. import TipsMsg from './TipsMsg'
  20. import dataLis from '@components/EmergencyProcedure/emergency';
  21. import EmergencyProcedure from '@components/EmergencyProcedure';
  22. class PushItems extends Component {
  23. constructor(props) {
  24. super(props);
  25. this.state = {
  26. moreAssay: false,
  27. moreCheck: false,
  28. show:true,
  29. showAssess:false, //评估弹窗
  30. };
  31. this.showMore = this.showMore.bind(this);
  32. this.closeMore = this.closeMore.bind(this);
  33. this.billing = this.billing.bind(this);
  34. this.changeAssay = this.changeAssay.bind(this);
  35. this.changeCheck = this.changeCheck.bind(this);
  36. this.showTips = this.showTips.bind(this);
  37. this.hideTips = this.hideTips.bind(this);
  38. this.$cont = React.createRef();
  39. this.setDataIdx = this.setDataIdx.bind(this)
  40. }
  41. showMore(type) {
  42. this.setState({ [type]: true });
  43. }
  44. closeMore(type) {
  45. this.setState({ [type]: false });
  46. }
  47. showAssessFn(){
  48. this.setState({
  49. showAssess:!this.state.showAssess
  50. });
  51. }
  52. billing() {
  53. const { assay, check } = this.props.pushMessage;
  54. const {EMRScrollCont} = this.props;
  55. const checkedAssay = assay.filter(item => item.checked);
  56. const checkedCheck = check.filter(item => item.checked);
  57. this.props.billing(checkedAssay, checkedCheck);
  58. let obj = { //添加化验
  59. details: [],
  60. name: '',
  61. questionId: '',
  62. showType: 1,
  63. uniqueName:''
  64. }
  65. let obj1 = { //添加辅检
  66. name: '',
  67. questionId: '',
  68. showType: 1,
  69. time:getCurrentDate(1),
  70. value:''
  71. }
  72. if(checkedAssay.length > 0){
  73. let assayArr = [],tmpDetail=[]
  74. for(let i = 0;i < checkedAssay.length;i++){
  75. let tmpObj = JSON.parse(JSON.stringify(obj));
  76. if (checkedAssay[i].controlType == 0) {
  77. tmpDetail = checkedAssay[i].questionMapping
  78. }else if(checkedAssay[i].controlType == 1 || checkedAssay[i].controlType == 6){
  79. tmpDetail.push(checkedAssay[i])
  80. }
  81. tmpObj.questionId = checkedAssay[i].id
  82. tmpObj.name = checkedAssay[i].name
  83. tmpObj.details = tmpDetail
  84. tmpObj.uniqueName = checkedAssay[i].uniqueName||''
  85. assayArr.push(tmpObj)
  86. }
  87. store.dispatch(addLabel(assayArr))
  88. }
  89. if(checkedCheck.length > 0){
  90. let checkArr = []
  91. for(let i = 0;i < checkedCheck.length;i++){
  92. let tmpObj = JSON.parse(JSON.stringify(obj1));
  93. tmpObj.questionId = checkedCheck[i].id
  94. tmpObj.name = checkedCheck[i].name
  95. checkArr.push(tmpObj)
  96. }
  97. store.dispatch(addAssistLabel(checkArr))
  98. }
  99. //滚动到底部
  100. setTimeout(function(){
  101. EMRScrollCont&&EMRScrollCont.scrollBottom();
  102. },100);
  103. /*if(checkedAssay.length > 0){
  104. document.getElementById("inspectResultData").scrollIntoView(true)
  105. }else{
  106. if(checkedCheck.length > 0){
  107. document.getElementById("assistResultData").scrollIntoView(true)
  108. }else{
  109. return;
  110. }
  111. }*/
  112. }
  113. changeAssay(item) {
  114. this.props.changeAssay(item);
  115. }
  116. changeCheck(item) {
  117. this.props.changeCheck(item);
  118. }
  119. showTips() {
  120. const { getTipsDetails, showTipsDetailsModal, clickDiag } = this.props;
  121. getTipsDetails && getTipsDetails({name: clickDiag.name, type: clickDiag.type,position:0});
  122. //showTipsDetailsModal && showTipsDetailsModal()
  123. }
  124. hideTips() {
  125. const { hideTipsDetailsModal } = this.props;
  126. hideTipsDetailsModal && hideTipsDetailsModal()
  127. }
  128. componentDidMount() {
  129. const height = getWindowInnerHeight() - 190;
  130. this.$cont.current.style.height = height + "px";
  131. windowEventHandler('resize', ()=>{
  132. if(this.$cont.current){
  133. const height = getWindowInnerHeight() - 190;
  134. this.$cont.current.style.height = height + "px";
  135. }
  136. });
  137. }
  138. setDataIdx(index){
  139. this.props.setDataIdx&&this.props.setDataIdx(index)
  140. }
  141. render() {
  142. const {
  143. vigilant,
  144. determine,
  145. doubt,
  146. possible,
  147. likely,
  148. assay,
  149. check,
  150. tips,
  151. showTipsDetails,
  152. tipsDetails,
  153. tmpFlg,
  154. } = this.props.pushMessage;
  155. const { tipsDiscalimer,chronicPushItems,wholeIndexs,setPushEmergencyIdx,sysConfig,windowHeight,hideAllDrop} = this.props;
  156. const {
  157. billing,
  158. changeCheck,
  159. changeAssay,
  160. showTips
  161. } = this;
  162. const vigilants = vigilant.map((item, index) => {
  163. return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>;
  164. });
  165. return (
  166. <div className={style["push-content-wrapper"]}>
  167. <div className={style["push-content"]} ref={this.$cont}>
  168. <div style = {{width: '410px'}}>
  169. {vigilant && vigilant.length > 0 && (
  170. <div className={style["vigilant"]}>
  171. <div className={style["title"]}>
  172. <img src={vigilantImg} />
  173. 警惕
  174. </div>
  175. <div className={style["vigilantContent"]}>{vigilants}</div>
  176. </div>
  177. )}
  178. {/* 不展示确诊 */}
  179. {/* {determine && determine.length>0 && <PushDiag titleBg='#FAEBEC' icon={possibleImg} title='确诊' diagList={determine} maxShowNum={28}/>} */}
  180. {doubt && doubt.length > 0 && (
  181. <PushDiag
  182. titleBg="#FAEBEC"
  183. icon={doubtImg}
  184. title="初步诊断"
  185. diagList={doubt}
  186. />
  187. )}
  188. {possible && possible.length > 0 && (
  189. <PushDiag
  190. titleBg="#FAEBEC"
  191. icon={possibleImg}
  192. title="可能诊断"
  193. diagList={possible}
  194. />
  195. )}
  196. {likely && likely.length > 0 && (
  197. <PushDiag
  198. titleBg="#FAEBEC"
  199. icon={likelyImg}
  200. title="鉴别诊断"
  201. diagList={likely}
  202. />
  203. )}
  204. <div className={style["diagnose"]}>
  205. {vigilant.length === 0 &&
  206. determine.length === 0 &&
  207. doubt.length === 0 &&
  208. possible.length === 0 &&
  209. (!likely || likely&&likely.length ===0) &&
  210. (
  211. <div className={style["doubt"]}>
  212. <h1>
  213. <img src={doubtImg} />
  214. 初步诊断
  215. </h1>
  216. <div className={style["no-push"]}>无</div>
  217. </div>
  218. )}
  219. </div>
  220. <div className={style["recommend"]}>
  221. <h1>
  222. <img src={recommendImg} />
  223. 推荐检验检查
  224. <div className={style["billing"]}
  225. style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray', cursor:'auto'} : ''}
  226. onClick={assay.length === 0 && check.length === 0 ? '' : billing}>
  227. 开单
  228. </div>
  229. </h1>
  230. <div className={style["contentBox"]}>
  231. {assay.length === 0 && check.length === 0 ? (
  232. <span>无</span>
  233. ) : (<ul>
  234. <RecommendInspect
  235. title = '化验'
  236. list = {assay}
  237. changeFlag = {changeAssay}
  238. border = "true"
  239. >
  240. </RecommendInspect>
  241. <RecommendInspect
  242. title = '检查'
  243. list = {check}
  244. changeFlag = {changeCheck}
  245. >
  246. </RecommendInspect>
  247. </ul>)}
  248. </div>
  249. </div>
  250. {/*{chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}*/}
  251. {<ChronicInfo
  252. patDom={this.$cont}
  253. data={chronicPushItems}></ChronicInfo>}
  254. <TipsMsg
  255. patDom={this.$cont}
  256. tmpFlg = {tmpFlg}
  257. tipsImg = {tipsImg}
  258. tips = {tips}
  259. showTips = {showTips}
  260. tipsDiscalimer = {tipsDiscalimer}
  261. ></TipsMsg>
  262. </div>
  263. {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2')&&tipsDiscalimer.data.data.find(item => item.disclaimerCode == '2').description}}></div>}
  264. </div>
  265. {showTipsDetails && <DetailsModal
  266. showTipsDetails = {showTipsDetails}
  267. hideTips = {this.hideTips}
  268. tipsDetails = {tipsDetails}/>}
  269. {
  270. (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)&&<EmergencyProcedure hideAllDrop={hideAllDrop} windowHeight={windowHeight} data={dataLis[setPushEmergencyIdx]} idx={setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>
  271. }
  272. </div>
  273. );
  274. }
  275. }
  276. export default PushItems;