DiagnosticList.js 3.8 KB

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