Browse Source

feat(patient->worklist): implement query functionality by name, accno and other conditions .
fix #19

sw 1 month ago
parent
commit
e96017a7e5
1 changed files with 19 additions and 2 deletions
  1. 19 2
      src/pages/patient/components/SearchPanel.tsx

+ 19 - 2
src/pages/patient/components/SearchPanel.tsx

@@ -14,13 +14,16 @@ import {
   setPage,
   setPageSize,
 } from '../../../states/patient/worklist/slices/searchSlice';
-import { RootState } from '../../../states/store';
+import { fetchWorkThunk } from '../../../states/patient/worklist/slices/workSlice';
+import { AppDispatch, RootState } from '../../../states/store';
+import { WorkFilter } from '@/states/patient/worklist/types/workfilter';
+// import { AnyAction } from '@reduxjs/toolkit';
 
 const { RangePicker } = DatePicker;
 
 const SearchPanel: React.FC = () => {
   const intl = useIntl();
-  const dispatch = useDispatch();
+  const dispatch = useDispatch<AppDispatch>();
   const id = useSelector((state: RootState) => state.search.id);
   const name = useSelector((state: RootState) => state.search.name);
   const accNo = useSelector((state: RootState) => state.search.acc_no);
@@ -87,6 +90,20 @@ const SearchPanel: React.FC = () => {
           dispatch(setStatus('Arrived,InProgress'));
           dispatch(setPage(1));
           dispatch(setPageSize(10));
+          dispatch(
+            fetchWorkThunk({
+              page: 1,
+              pageSize: 10,
+              filters: {
+                patient_id: id,
+                patient_name: name,
+                access_number: accNo,
+                start_time: startTime,
+                end_time: endTime,
+                status: 'Arrived',
+              } as WorkFilter,
+            })
+          );
         }}
       >
         <FormattedMessage