index.jsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React, { Component } from "react";
  2. import style from "./index.less";
  3. import store from "@store";
  4. import $ from "jquery";
  5. class Information extends Component {
  6. constructor(props) {
  7. super(props)
  8. this.$content = React.createRef();
  9. }
  10. componentWillReceiveProps() {
  11. $(this.$content.current)[0].scrollIntoView(true);
  12. }
  13. render() {
  14. const { baseObj} = this.props;
  15. let baseData = store.getState()
  16. let preInfo = baseData.historyTemplates.HospitalInfo.name
  17. const noData = JSON.stringify(preInfo) == '{}';
  18. return <div className={style['information']}>
  19. <div ref={this.$content} className={style['title']}>{preInfo}</div>
  20. <table className={style['patInfo']}>
  21. <tr>
  22. <td>姓名:{baseObj ? baseObj.patName : noData ? '' : preInfo.patientName}</td>
  23. <td>门诊号:{baseObj ? baseObj.inquiryCode : (noData ? '' : preInfo.recordId)}</td>
  24. </tr>
  25. <tr>
  26. <td>年龄:{baseObj ? baseObj.age : noData ? '' : preInfo.patientAge}</td>
  27. <td>医生:{baseObj ? baseObj.doctorName : (noData ? '' : preInfo.doctorName)}</td>
  28. </tr>
  29. <tr>
  30. <td>性别:{baseObj.sex === 0 ? '女' : '男'}</td>
  31. <td>科室:{baseObj ? baseObj.deptName : (noData ? '' : preInfo.hospitalDeptName)}</td>
  32. </tr>
  33. <tr>
  34. <td>卡号:{baseObj ? baseObj.cardNo : noData ? '' : preInfo.patientIdNo}</td>
  35. <td>就诊时间:{baseObj ? baseObj.inquiryDate : (noData ? '' : preInfo.systemTime.split(' ')[0])}</td>
  36. </tr>
  37. </table>
  38. </div>
  39. }
  40. }
  41. export default Information;