index.jsx 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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 showImg from "../../common/images/show.png";
  9. import hideImg from "../../common/images/close.png";
  10. import DetailsModal from './DetailsModal';
  11. import PushDiag from "./PushDiag";
  12. import DiagnosticItem from "@containers/DiagnosticItem";
  13. import store from "@store";
  14. import {addLabel} from '@store/actions/inspect';
  15. import {addAssistLabel} from '@store/actions/assistCheck';
  16. import {windowEventHandler,getCurrentDate,getWindowInnerHeight} from '@utils/tools'
  17. import {ConfirmModal} from '@commonComp';
  18. import ChronicInfo from '@containers/ChronicInfo';//慢病推送模块
  19. import RecommendInspect from './RecommendInspect';
  20. import TipsMsg from './TipsMsg'
  21. class PushItems extends Component {
  22. constructor(props) {
  23. super(props);
  24. this.state = {
  25. moreAssay: false,
  26. moreCheck: false,
  27. show:true,
  28. showAssess:false //评估弹窗
  29. };
  30. this.showMore = this.showMore.bind(this);
  31. this.closeMore = this.closeMore.bind(this);
  32. this.billing = this.billing.bind(this);
  33. this.changeAssay = this.changeAssay.bind(this);
  34. this.changeCheck = this.changeCheck.bind(this);
  35. this.showTips = this.showTips.bind(this);
  36. this.hideTips = this.hideTips.bind(this);
  37. this.$cont = React.createRef();
  38. }
  39. showMore(type) {
  40. this.setState({ [type]: true });
  41. }
  42. closeMore(type) {
  43. this.setState({ [type]: false });
  44. }
  45. showAssessFn(){
  46. this.setState({
  47. showAssess:!this.state.showAssess
  48. });
  49. }
  50. billing() {
  51. const { assay, check } = this.props.pushMessage;
  52. const checkedAssay = assay.filter(item => item.checked);
  53. const checkedCheck = check.filter(item => item.checked);
  54. this.props.billing(checkedAssay, checkedCheck);
  55. let obj = { //添加化验
  56. details: [],
  57. name: '',
  58. questionId: '',
  59. showType: 1,
  60. uniqueName:''
  61. }
  62. let obj1 = { //添加辅检
  63. name: '',
  64. questionId: '',
  65. showType: 1,
  66. time:getCurrentDate(),
  67. value:''
  68. }
  69. if(checkedAssay.length > 0){
  70. let assayArr = [],tmpDetail=[]
  71. for(let i = 0;i < checkedAssay.length;i++){
  72. let tmpObj = JSON.parse(JSON.stringify(obj));
  73. if (checkedAssay[i].controlType == 0) {
  74. tmpDetail = checkedAssay[i].questionMapping
  75. }else if(checkedAssay[i].controlType == 1 || checkedAssay[i].controlType == 6){
  76. tmpDetail.push(checkedAssay[i])
  77. }
  78. tmpObj.questionId = checkedAssay[i].id
  79. tmpObj.name = checkedAssay[i].name
  80. tmpObj.details = tmpDetail
  81. tmpObj.uniqueName = checkedAssay[i].uniqueName||''
  82. assayArr.push(tmpObj)
  83. }
  84. store.dispatch(addLabel(assayArr))
  85. }
  86. if(checkedCheck.length > 0){
  87. let checkArr = []
  88. for(let i = 0;i < checkedCheck.length;i++){
  89. let tmpObj = JSON.parse(JSON.stringify(obj1));
  90. tmpObj.questionId = checkedCheck[i].id
  91. tmpObj.name = checkedCheck[i].name
  92. checkArr.push(tmpObj)
  93. }
  94. store.dispatch(addAssistLabel(checkArr))
  95. }
  96. if(checkedAssay.length > 0){
  97. document.getElementById("inspectResultData").scrollIntoView(true)
  98. }else{
  99. if(checkedCheck.length > 0){
  100. document.getElementById("assistResultData").scrollIntoView(true)
  101. }else{
  102. return;
  103. }
  104. }
  105. }
  106. changeAssay(item) {
  107. this.props.changeAssay(item);
  108. }
  109. changeCheck(item) {
  110. this.props.changeCheck(item);
  111. }
  112. showTips() {
  113. const { getTipsDetails, showTipsDetailsModal, clickDiag } = this.props;
  114. getTipsDetails && getTipsDetails({name: clickDiag.name, type: clickDiag.type,position:2});
  115. showTipsDetailsModal && showTipsDetailsModal()
  116. }
  117. hideTips() {
  118. const { hideTipsDetailsModal } = this.props;
  119. hideTipsDetailsModal && hideTipsDetailsModal()
  120. }
  121. componentDidMount() {
  122. const height = getWindowInnerHeight() - 200;
  123. this.$cont.current.style.height = height + "px";
  124. windowEventHandler('resize', ()=>{
  125. const height = getWindowInnerHeight() - 200;
  126. this.$cont.current.style.height = height + "px";
  127. });
  128. }
  129. render() {
  130. const {
  131. vigilant,
  132. determine,
  133. doubt,
  134. possible,
  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. <div className={style["diagnose"]}>
  186. {vigilant.length === 0 &&
  187. determine.length === 0 &&
  188. doubt.length === 0 &&
  189. possible.length === 0 && (
  190. <div className={style["doubt"]}>
  191. <h1>
  192. <img src={doubtImg} />
  193. 疑似诊断
  194. </h1>
  195. <div className={style["no-push"]}>无</div>
  196. </div>
  197. )}
  198. </div>
  199. <div className={style["recommend"]}>
  200. <h1>
  201. <img src={recommendImg} />
  202. 推荐检验检查
  203. <div className={style["billing"]}
  204. style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray', cursor:'auto'} : ''}
  205. onClick={assay.length === 0 && check.length === 0 ? '' : billing}>
  206. 开单
  207. </div>
  208. </h1>
  209. <div className={style["contentBox"]}>
  210. {assay.length === 0 && check.length === 0 ? (
  211. <span>无</span>
  212. ) : (<ul>
  213. <RecommendInspect
  214. title = '化验'
  215. list = {assay}
  216. changeFlag = {changeAssay}
  217. border = "true"
  218. >
  219. </RecommendInspect>
  220. <RecommendInspect
  221. title = '检查'
  222. list = {check}
  223. changeFlag = {changeCheck}
  224. >
  225. </RecommendInspect>
  226. </ul>)}
  227. </div>
  228. </div>
  229. {/*{chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}*/}
  230. {<ChronicInfo></ChronicInfo>}
  231. <TipsMsg
  232. tmpFlg = {tmpFlg}
  233. tipsImg = {tipsImg}
  234. tips = {tips}
  235. showTips = {showTips}
  236. tipsDiscalimer = {tipsDiscalimer}
  237. ></TipsMsg>
  238. </div>
  239. </div>
  240. {tipsDiscalimer.data && <div className={style['disTips']} dangerouslySetInnerHTML={{__html: tipsDiscalimer.data.data &&tipsDiscalimer.data.data.find(item => item.title == '推送免责信息')&&tipsDiscalimer.data.data.find(item => item.title == '推送免责信息').description}}></div>}
  241. {showTipsDetails && <DetailsModal
  242. showTipsDetails = {showTipsDetails}
  243. hideTips = {this.hideTips}
  244. tipsDetails = {tipsDetails}/>}
  245. </div>
  246. );
  247. }
  248. }
  249. export default PushItems;