index.jsx 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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 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. if(checkedAssay.length > 0){
  100. document.getElementById("inspectResultData").scrollIntoView(true)
  101. }else{
  102. if(checkedCheck.length > 0){
  103. document.getElementById("assistResultData").scrollIntoView(true)
  104. }else{
  105. return;
  106. }
  107. }
  108. }
  109. changeAssay(item) {
  110. this.props.changeAssay(item);
  111. }
  112. changeCheck(item) {
  113. this.props.changeCheck(item);
  114. }
  115. showTips() {
  116. const { getTipsDetails, showTipsDetailsModal, clickDiag } = this.props;console.log(this.props)
  117. getTipsDetails && getTipsDetails({name: clickDiag.name, type: clickDiag.type,position:2});
  118. //showTipsDetailsModal && showTipsDetailsModal()
  119. }
  120. hideTips() {
  121. const { hideTipsDetailsModal } = this.props;
  122. hideTipsDetailsModal && hideTipsDetailsModal()
  123. }
  124. componentDidMount() {
  125. const height = getWindowInnerHeight() - 200;
  126. this.$cont.current.style.height = height + "px";
  127. windowEventHandler('resize', ()=>{
  128. const height = getWindowInnerHeight() - 200;
  129. this.$cont.current.style.height = height + "px";
  130. });
  131. }
  132. setDataIdx(index){
  133. this.setState({
  134. idx:index+''
  135. })
  136. }
  137. render() {
  138. const {
  139. vigilant,
  140. determine,
  141. doubt,
  142. possible,
  143. likely,
  144. assay,
  145. check,
  146. tips,
  147. showTipsDetails,
  148. tipsDetails,
  149. tmpFlg,
  150. } = this.props.pushMessage;
  151. const { tipsDiscalimer,chronicPushItems,wholeIndexs,setPushEmergencyIdx,sysConfig} = this.props;
  152. const {
  153. billing,
  154. changeCheck,
  155. changeAssay,
  156. showTips
  157. } = this;
  158. const vigilants = vigilant.map((item, index) => {
  159. return <div key={item.id} className={style['push-diag-item']}><DiagnosticItem item={item} type='disSelect'/></div>;
  160. });
  161. return (
  162. <div className={style["push-content-wrapper"]}>
  163. <div className={style["push-content"]} ref={this.$cont}>
  164. <div style = {{width: '410px'}}>
  165. {vigilant && vigilant.length > 0 && (
  166. <div className={style["vigilant"]}>
  167. <div className={style["title"]}>
  168. <img src={vigilantImg} />
  169. 警惕
  170. </div>
  171. <div className={style["vigilantContent"]}>{vigilants}</div>
  172. </div>
  173. )}
  174. {/* 不展示确诊 */}
  175. {/* {determine && determine.length>0 && <PushDiag titleBg='#FAEBEC' icon={possibleImg} title='确诊' diagList={determine} maxShowNum={28}/>} */}
  176. {doubt && doubt.length > 0 && (
  177. <PushDiag
  178. titleBg="#FAEBEC"
  179. icon={doubtImg}
  180. title="疑似诊断"
  181. diagList={doubt}
  182. maxShowNum={24}
  183. />
  184. )}
  185. {possible && possible.length > 0 && (
  186. <PushDiag
  187. titleBg="#FAEBEC"
  188. icon={possibleImg}
  189. title="可能诊断"
  190. diagList={possible}
  191. maxShowNum={24}
  192. />
  193. )}
  194. {likely && likely.length > 0 && (
  195. <PushDiag
  196. titleBg="#FAEBEC"
  197. icon={likelyImg}
  198. title="鉴别诊断"
  199. diagList={likely}
  200. maxShowNum={24}
  201. />
  202. )}
  203. <div className={style["diagnose"]}>
  204. {vigilant.length === 0 &&
  205. determine.length === 0 &&
  206. doubt.length === 0 &&
  207. possible.length === 0 &&
  208. (!likely || likely&&likely.length ===0) &&
  209. (
  210. <div className={style["doubt"]}>
  211. <h1>
  212. <img src={doubtImg} />
  213. 疑似诊断
  214. </h1>
  215. <div className={style["no-push"]}>无</div>
  216. </div>
  217. )}
  218. </div>
  219. <div className={style["recommend"]}>
  220. <h1>
  221. <img src={recommendImg} />
  222. 推荐检验检查
  223. <div className={style["billing"]}
  224. style={assay.length === 0 && check.length === 0 ? {color: 'gray', border: '1px solid gray', cursor:'auto'} : ''}
  225. onClick={assay.length === 0 && check.length === 0 ? '' : billing}>
  226. 开单
  227. </div>
  228. </h1>
  229. <div className={style["contentBox"]}>
  230. {assay.length === 0 && check.length === 0 ? (
  231. <span>无</span>
  232. ) : (<ul>
  233. <RecommendInspect
  234. title = '化验'
  235. list = {assay}
  236. changeFlag = {changeAssay}
  237. border = "true"
  238. >
  239. </RecommendInspect>
  240. <RecommendInspect
  241. title = '检查'
  242. list = {check}
  243. changeFlag = {changeCheck}
  244. >
  245. </RecommendInspect>
  246. </ul>)}
  247. </div>
  248. </div>
  249. {/*{chronicPushItems&&chronicPushItems.length>0?<ChronicInfo data={chronicPushItems}></ChronicInfo>:''}*/}
  250. {<ChronicInfo data={chronicPushItems}></ChronicInfo>}
  251. <TipsMsg
  252. patDom={this.$cont}
  253. tmpFlg = {tmpFlg}
  254. tipsImg = {tipsImg}
  255. tips = {tips}
  256. showTips = {showTips}
  257. tipsDiscalimer = {tipsDiscalimer}
  258. ></TipsMsg>
  259. </div>
  260. </div>
  261. {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>}
  262. {showTipsDetails && <DetailsModal
  263. showTipsDetails = {showTipsDetails}
  264. hideTips = {this.hideTips}
  265. tipsDetails = {tipsDetails}/>}
  266. {
  267. (setPushEmergencyIdx+'')&&(sysConfig.emergency_show==1)&&<EmergencyProcedure data={dataLis[this.state.idx]||dataLis[setPushEmergencyIdx]} idx={this.state.idx||setPushEmergencyIdx} setDataIdx={this.setDataIdx}></EmergencyProcedure>
  268. }
  269. </div>
  270. );
  271. }
  272. }
  273. export default PushItems;