index.jsx 9.9 KB

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