DiagnosticList.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import React from 'react';
  2. import { connect } from 'react-redux';
  3. import DiagnosticList from '@components/DiagnosticList';
  4. import { ADD_DIAGNOSTIC, DEL_DIAGNOSTIC, UP_DIAGNOSTIC, DOWN_DIAGNOSTIC, GET_DIAGNOSTIC_STR, GET_IS_FIRST, HIDE_REFER_RECORD, SHOW_HISTORY_CASE,HIDE_HISTORY_CASE } from '@store/types/diagnosticList';
  5. import { getTreatResult } from '@store/async-actions/treat';
  6. import { SHOW_TREAT, DEL_REACT, DEL_FOLLOW_UP } from '@store/types/treat.js';
  7. import {billing, getTips} from '../store/async-actions/pushMessage';
  8. import {keepPushData} from '@store/actions/tabTemplate';
  9. import { showHistory,sortHistory,activeHistory,visibleHistory } from '@store/actions/historyTemplates'
  10. import {CURRENT_CHRONIC} from '@store/types/currentIll';
  11. import {autoFillModules} from '@store/async-actions/fetchModules';
  12. function mapStateToProps(state) {
  13. return {
  14. list: state.diagnosticList.diagnosticList,
  15. treatment: state.treat.show,
  16. isFirst: state.diagnosticList.isFirst,
  17. diagnosticStr: state.diagnosticList.diagnosticStr,
  18. showReferRecord: state.diagnosticList.showReferRecord,
  19. showHistoryCase: state.diagnosticList.showHistoryCase,
  20. items:state.historyTemplates.items,
  21. chronicMagItem: state.diagnosticList.chronicMagItem,
  22. }
  23. }
  24. function mapDispatchToProps(dispatch) {
  25. return {
  26. delDiagnostic: (item) => {
  27. dispatch({
  28. type: DEL_DIAGNOSTIC,
  29. item: item
  30. });
  31. dispatch({
  32. type: GET_DIAGNOSTIC_STR
  33. });
  34. },
  35. delReact: (item) => {
  36. dispatch({
  37. type: DEL_REACT,
  38. item: item
  39. })
  40. },
  41. delFollowUp:(delItem) => {
  42. dispatch({
  43. type: DEL_FOLLOW_UP,
  44. delItem: delItem
  45. })
  46. },
  47. upDiagnostic: (index, id) => {
  48. dispatch({
  49. type: UP_DIAGNOSTIC,
  50. index: index
  51. });
  52. dispatch({
  53. type: GET_DIAGNOSTIC_STR
  54. });
  55. },
  56. downDiagnostic: (index, id) => {
  57. dispatch({
  58. type: DOWN_DIAGNOSTIC,
  59. index: index
  60. });
  61. dispatch({
  62. type: GET_DIAGNOSTIC_STR
  63. });
  64. },
  65. getSearchResult:() => {
  66. dispatch(getSearchResult)
  67. },
  68. showTreat: () => {
  69. dispatch({
  70. type: SHOW_TREAT,
  71. })
  72. },
  73. getTreatResult: (item) => {
  74. dispatch(getTreatResult(item))
  75. },
  76. getTips: (diagItem) => {
  77. dispatch(getTips(diagItem))
  78. },
  79. getBilling: () => {
  80. dispatch(billing())
  81. },
  82. hideReferRecord: ()=>{
  83. dispatch({
  84. type: HIDE_REFER_RECORD
  85. })
  86. dispatch(autoFillModules())//自动分发模板
  87. },
  88. showHistoryCaseModal: ()=> {
  89. dispatch({
  90. type: SHOW_HISTORY_CASE
  91. })
  92. },
  93. hideHistoryCaseModal: ()=> {
  94. dispatch({
  95. type: HIDE_HISTORY_CASE
  96. })
  97. dispatch(autoFillModules())//自动分发模板
  98. },
  99. handleQuoteClick(data){
  100. dispatch(keepPushData(data,'his')) //历史病历引用
  101. // dispatch(activeHistory(idx))
  102. dispatch(visibleHistory(true))
  103. },
  104. }
  105. }
  106. const diagnosticListContainer = connect(
  107. mapStateToProps,
  108. mapDispatchToProps
  109. )(DiagnosticList)
  110. export default diagnosticListContainer;