DiagnosticList.js 4.4 KB

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