DiagnosticList.js 3.6 KB

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