index.jsx 8.9 KB

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