@bjsdistribution/dms-client-return 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/order-daily-overview/common/interface.d.ts +22 -0
- package/dist/components/order-daily-overview/header-filters/Styledfilters.d.ts +1 -2
- package/dist/components/order-daily-overview/header-filters/filterStore.d.ts +16 -0
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.d.ts +1 -0
- package/dist/components/order-daily-overview/shared/utlis.d.ts +2 -2
- package/dist/components/order-daily-overview/store/store.d.ts +4 -0
- package/dist/components/order-daily-overview/table/table-data/styles.d.ts +2 -0
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
- package/dist/components/order-view/generic-table/AuditLogs.d.ts +4 -0
- package/dist/components/order-view/hooks/useGetEventNotes.d.ts +2 -0
- package/dist/components/order-view/hooks/useGetSystemLogs.d.ts +2 -0
- package/dist/components/order-view/modalsPopup/CreateReturnModal.d.ts +4 -0
- package/dist/components/order-view/notes/logs/fakeData.d.ts +7 -7
- package/dist/components/order-view/store.d.ts +23 -1
- package/dist/components/order-view/system-event-logs/columns/Code.d.ts +3 -0
- package/dist/components/order-view/system-event-logs/columns/Date.d.ts +3 -0
- package/dist/components/order-view/system-event-logs/columns/Event.d.ts +3 -0
- package/dist/components/order-view/system-event-logs/columns/Note.d.ts +3 -0
- package/dist/components/order-view/system-event-logs/columns/index.d.ts +4 -0
- package/dist/components/order-view/system-event-logs/helper.d.ts +7 -0
- package/dist/components/store.d.ts +5 -2
- package/dist/components/types.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +3553 -2396
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +3557 -2400
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/common/expand-collapse/index.tsx +3 -3
- package/src/components/fakeData.ts +14 -23
- package/src/components/order-daily-overview/common/fakedata.tsx +5 -6
- package/src/components/order-daily-overview/common/interface.ts +120 -97
- package/src/components/order-daily-overview/filters/Filters.tsx +6 -13
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +170 -224
- package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +20 -7
- package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
- package/src/components/order-daily-overview/index.tsx +77 -20
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +32 -4
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +184 -235
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +69 -10
- package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +10 -3
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +9 -47
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +106 -190
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/RightFilters.tsx +35 -38
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +69 -1
- package/src/components/order-daily-overview/store/store.ts +23 -12
- package/src/components/order-daily-overview/table/ReturnTable.tsx +133 -207
- package/src/components/order-daily-overview/table/table-data/styles.ts +15 -0
- package/src/components/order-view/details-filters/DetailsFilters.tsx +5 -4
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +0 -2
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +54 -46
- package/src/components/order-view/general-information/Status.tsx +1 -1
- package/src/components/order-view/generic-table/AuditLogs.tsx +96 -0
- package/src/components/order-view/hooks/useGetEventNotes.tsx +47 -0
- package/src/components/order-view/hooks/useGetSystemLogs.tsx +60 -0
- package/src/components/order-view/index.tsx +25 -4
- package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +83 -0
- package/src/components/order-view/modalsPopup/ModalManager.tsx +49 -49
- package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
- package/src/components/order-view/notes/AddNote.tsx +127 -13
- package/src/components/order-view/notes/index.tsx +100 -3
- package/src/components/order-view/notes/logs/fakeData.ts +8 -48
- package/src/components/order-view/notes/logs/index.tsx +6 -45
- package/src/components/order-view/order-actions/actions/escalation/EscalationModal.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/customer-section/RecipientName.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactEmail.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactWork.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Address.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Latitude.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Longitude.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/Postcode.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/customer-section/location-info/What3words.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +3 -2
- package/src/components/order-view/order-details/expanded-content/index.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Carrier.tsx +7 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/DeliveryDate.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/Depot.tsx +14 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/Droptime.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/OrderNumber.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/RecipientReference.tsx +2 -1
- package/src/components/order-view/order-details/expanded-content/orders-section/ScheduleAfter.tsx +1 -0
- package/src/components/order-view/order-details/expanded-content/orders-section/VehicleType.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/DeliveryPoint.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceType.tsx +13 -1
- package/src/components/order-view/order-details/expanded-content/services-section/TimedService.tsx +14 -1
- package/src/components/order-view/order-resources/collapsed-content/index.tsx +1 -1
- package/src/components/order-view/products-info/expanded-content/index.tsx +2 -2
- package/src/components/order-view/products-info/index.tsx +3 -2
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +30 -34
- package/src/components/order-view/store.ts +80 -14
- package/src/components/order-view/system-event-logs/collapsed-content/index.tsx +1 -1
- package/src/components/order-view/system-event-logs/columns/Code.tsx +17 -0
- package/src/components/order-view/system-event-logs/columns/Date.tsx +18 -0
- package/src/components/order-view/system-event-logs/columns/Event.tsx +26 -0
- package/src/components/order-view/system-event-logs/columns/Note.tsx +24 -0
- package/src/components/order-view/system-event-logs/columns/index.tsx +6 -0
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +34 -6
- package/src/components/order-view/system-event-logs/helper.ts +29 -0
- package/src/components/store.ts +26 -4
- package/src/components/types.ts +2 -6
- package/src/index.tsx +32 -5
- package/dist/components/order-daily-overview/table/InfiniteScrolling.d.ts +0 -5
- package/dist/components/order-daily-overview/table/Return.d.ts +0 -3
- package/dist/components/order-daily-overview/table/table-data/MyTable.d.ts +0 -18
- package/dist/components/order-daily-overview/table/table-data/Table.d.ts +0 -18
- package/dist/components/order-view/system-event-logs/system-logs-table/SystemLogsTables.d.ts +0 -3
- package/dist/components/order-view/system-event-logs/system-logs-table/SytemLogsStyles.d.ts +0 -3
- package/src/components/order-daily-overview/table/InfiniteScrolling.tsx +0 -54
- package/src/components/order-daily-overview/table/Return.tsx +0 -156
- package/src/components/order-daily-overview/table/table-data/MyTable.tsx +0 -433
- package/src/components/order-daily-overview/table/table-data/Table.tsx +0 -445
- package/src/components/order-view/system-event-logs/system-logs-table/SystemLogsTables.tsx +0 -59
- package/src/components/order-view/system-event-logs/system-logs-table/SytemLogsStyles.tsx +0 -239
package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx
CHANGED
|
@@ -4,27 +4,29 @@ import {
|
|
|
4
4
|
StyledTableWrapper,
|
|
5
5
|
} from '../../../order-daily-overview/return-order-table/return-orders-filters/returnstyles';
|
|
6
6
|
import { Checkbox } from '@bjsdistribution/dms-component-library';
|
|
7
|
-
import { data } from '../../../order-daily-overview/table/table-data/Fakedata';
|
|
8
|
-
import { useSelectedEmail } from '../../../store';
|
|
7
|
+
// import { data } from '../../../order-daily-overview/table/table-data/Fakedata';
|
|
9
8
|
import ActionIcon from '../../../../assets/icons/ActionIcon';
|
|
9
|
+
import { useSelectedOrders } from '../../../store';
|
|
10
|
+
import { useProductDetails } from '../../store';
|
|
10
11
|
|
|
11
12
|
const ReturnProductTable = () => {
|
|
12
|
-
const [selectedInvoices
|
|
13
|
-
const [selectAll
|
|
13
|
+
const [selectedInvoices] = useSelectedOrders();
|
|
14
|
+
const [selectAll] = useState(false);
|
|
15
|
+
const [productData] = useProductDetails();
|
|
14
16
|
|
|
15
|
-
const handleSelectAll = (e: any) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
17
|
+
// const handleSelectAll = (e: any) => {
|
|
18
|
+
// setSelectAll(e.target.checked);
|
|
19
|
+
// if (e.target.checked) {
|
|
20
|
+
// setSelectedInvoices(
|
|
21
|
+
// productData.map((invoice: any) => ({
|
|
22
|
+
// id: invoice.id,
|
|
23
|
+
// status_id: 3,
|
|
24
|
+
// }))
|
|
25
|
+
// );
|
|
26
|
+
// } else {
|
|
27
|
+
// setSelectedInvoices([]);
|
|
28
|
+
// }
|
|
29
|
+
// };
|
|
28
30
|
|
|
29
31
|
return (
|
|
30
32
|
<div>
|
|
@@ -33,7 +35,7 @@ const ReturnProductTable = () => {
|
|
|
33
35
|
<thead>
|
|
34
36
|
<tr>
|
|
35
37
|
<th className="emailInvoiceCheckbox">
|
|
36
|
-
<Checkbox checked={selectAll} onChange={
|
|
38
|
+
<Checkbox checked={selectAll} onChange={() => {}} />
|
|
37
39
|
</th>
|
|
38
40
|
<th> Location</th>
|
|
39
41
|
<th>Sender</th>
|
|
@@ -45,7 +47,7 @@ const ReturnProductTable = () => {
|
|
|
45
47
|
</tr>
|
|
46
48
|
</thead>
|
|
47
49
|
<tbody>
|
|
48
|
-
{
|
|
50
|
+
{productData?.map((invoice: any) => (
|
|
49
51
|
<tr key={invoice.id}>
|
|
50
52
|
<td>
|
|
51
53
|
<Checkbox
|
|
@@ -56,25 +58,19 @@ const ReturnProductTable = () => {
|
|
|
56
58
|
/>
|
|
57
59
|
</td>
|
|
58
60
|
|
|
59
|
-
<td>{
|
|
61
|
+
<td>{'N/A'}</td>
|
|
60
62
|
|
|
61
63
|
<td>
|
|
62
|
-
<ul style={{ listStyleType: 'none', padding: 0 }}>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
paddingLeft: 0,
|
|
68
|
-
}}
|
|
69
|
-
>
|
|
70
|
-
{invoice?.customer_name}
|
|
71
|
-
</li>
|
|
72
|
-
</ul>
|
|
64
|
+
{/* <ul style={{ listStyleType: 'none', padding: 0 }}> */}
|
|
65
|
+
{/* <li> */}
|
|
66
|
+
{'N/A'}
|
|
67
|
+
{/* </li> */}
|
|
68
|
+
{/* </ul> */}
|
|
73
69
|
</td>
|
|
74
70
|
|
|
75
|
-
<td>{invoice?.
|
|
76
|
-
<td>{invoice?.
|
|
77
|
-
<td>{
|
|
71
|
+
<td>{invoice?.code}</td>
|
|
72
|
+
<td>{invoice?.description}</td>
|
|
73
|
+
<td>{'N/A'}</td>
|
|
78
74
|
<td>1 of 1</td>
|
|
79
75
|
|
|
80
76
|
{/* <td onClick={() => dispatch({ type: 'email-sent' })}>
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { atom, useAtom } from 'jotai';
|
|
2
2
|
import { atomWithReducer } from 'jotai/utils';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
CreateProduct,
|
|
5
|
+
OrderActionsType,
|
|
6
|
+
OrdersType,
|
|
7
|
+
UnRecieveOrderProduct,
|
|
8
|
+
UpdateOrderProduct,
|
|
9
|
+
} from './types';
|
|
10
|
+
import { ClientData } from '../order-daily-overview/common/interface';
|
|
4
11
|
// OrderActionsType
|
|
5
12
|
const activeTabAtom = atom<string>('active');
|
|
6
13
|
const infoAtom = atom<boolean | undefined>(false);
|
|
@@ -11,6 +18,11 @@ const date = atom(new Date());
|
|
|
11
18
|
|
|
12
19
|
const orderStaticDataAtom = atom<any>({});
|
|
13
20
|
|
|
21
|
+
const clientDataAtom = atom<ClientData[]>([]);
|
|
22
|
+
const returnDataAtom = atom<any[]>([]);
|
|
23
|
+
|
|
24
|
+
const returnAfterOrderAtom = atom<any[]>([]);
|
|
25
|
+
|
|
14
26
|
export const ordersInitialValue: OrdersType = {
|
|
15
27
|
depot_id: null,
|
|
16
28
|
gsit_order_id: null,
|
|
@@ -92,18 +104,18 @@ export const orderProductInitialvalue: CreateProduct = {
|
|
|
92
104
|
};
|
|
93
105
|
|
|
94
106
|
export const unrecieveOrderProducts: UnRecieveOrderProduct = {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
107
|
+
unrecieve_reason_id: 0,
|
|
108
|
+
unrecieve_note: '',
|
|
109
|
+
// id: 0
|
|
98
110
|
};
|
|
99
111
|
|
|
100
112
|
export const updateOrderProducts: UpdateOrderProduct = {
|
|
101
113
|
id: 0,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
order_id: 0,
|
|
115
|
+
product_type_id: 0,
|
|
116
|
+
product_return_action_id: 0,
|
|
117
|
+
return_location: '',
|
|
118
|
+
return_reason_id: 0,
|
|
107
119
|
};
|
|
108
120
|
|
|
109
121
|
export const usedate = () => {
|
|
@@ -126,6 +138,17 @@ function useOrderStaticData() {
|
|
|
126
138
|
return useAtom(orderStaticDataAtom);
|
|
127
139
|
}
|
|
128
140
|
|
|
141
|
+
function useClientData() {
|
|
142
|
+
return useAtom(clientDataAtom);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function useReturnData() {
|
|
146
|
+
return useAtom(returnDataAtom);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function useReturnAfterOrderData() {
|
|
150
|
+
return useAtom(returnAfterOrderAtom);
|
|
151
|
+
}
|
|
129
152
|
// Define initial modal state
|
|
130
153
|
export const initialModalState = {
|
|
131
154
|
openModalType: null,
|
|
@@ -191,7 +214,9 @@ function useCreateOrderProducts() {
|
|
|
191
214
|
return useAtom(createOrderProduct);
|
|
192
215
|
}
|
|
193
216
|
|
|
194
|
-
const unrevieveOrderProduct = atom<UnRecieveOrderProduct>(
|
|
217
|
+
const unrevieveOrderProduct = atom<UnRecieveOrderProduct>(
|
|
218
|
+
unrecieveOrderProducts
|
|
219
|
+
);
|
|
195
220
|
function useRecieveOrderProducts() {
|
|
196
221
|
return useAtom(unrevieveOrderProduct);
|
|
197
222
|
}
|
|
@@ -205,11 +230,47 @@ export const selectedProductIdAtom = atom<number | null>(null);
|
|
|
205
230
|
|
|
206
231
|
export const selectedTabKeyAtom = atom<string>('1');
|
|
207
232
|
|
|
233
|
+
const eventNotesData = atom<any>([]);
|
|
234
|
+
function useEventNotesData() {
|
|
235
|
+
return useAtom(eventNotesData);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const orderProductSystemLogs = atom<any>([]);
|
|
239
|
+
function useOrderProductSystemLogs() {
|
|
240
|
+
return useAtom(orderProductSystemLogs);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const moduleIds = atom<{
|
|
244
|
+
id?: string;
|
|
245
|
+
parentId?: string;
|
|
246
|
+
} | null>(null);
|
|
247
|
+
|
|
248
|
+
export function usemoduleIds() {
|
|
249
|
+
return useAtom(moduleIds);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const CallAPi = atom(false);
|
|
253
|
+
|
|
254
|
+
export function useCallAPi() {
|
|
255
|
+
return useAtom(CallAPi);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const NotesLoading = atom<boolean>(true);
|
|
259
|
+
export const UseNotesLoading = () => {
|
|
260
|
+
return useAtom(NotesLoading);
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
const notes = atom<any>([]);
|
|
264
|
+
|
|
265
|
+
export function usegetNotes() {
|
|
266
|
+
return useAtom(notes);
|
|
267
|
+
}
|
|
268
|
+
|
|
208
269
|
export const errorAtom = atom({
|
|
209
270
|
homeError: '',
|
|
210
271
|
mobileError: '',
|
|
211
272
|
emailError: '',
|
|
212
|
-
w3wError: ''
|
|
273
|
+
w3wError: '',
|
|
213
274
|
});
|
|
214
275
|
|
|
215
276
|
export {
|
|
@@ -224,13 +285,18 @@ export {
|
|
|
224
285
|
useDeleteProdsID,
|
|
225
286
|
useCreateOrderProducts,
|
|
226
287
|
useRecieveOrderProducts,
|
|
227
|
-
useUpdateOrderProducts
|
|
288
|
+
useUpdateOrderProducts,
|
|
289
|
+
useClientData,
|
|
290
|
+
useReturnData,
|
|
291
|
+
useReturnAfterOrderData,
|
|
292
|
+
useEventNotesData,
|
|
293
|
+
useOrderProductSystemLogs,
|
|
228
294
|
};
|
|
229
295
|
// Popup state Manage
|
|
230
296
|
const initialState = null;
|
|
231
297
|
const popupReducer = (state: any, action: any) => {
|
|
232
|
-
if (action.type === '
|
|
233
|
-
state = '
|
|
298
|
+
if (action.type === 'create-return') {
|
|
299
|
+
state = 'create-return';
|
|
234
300
|
return { state };
|
|
235
301
|
} else if (action.type === 'addProduct') {
|
|
236
302
|
state = 'addProduct';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
function Code(props: any) {
|
|
5
|
+
const data = props?.row?.original.event_code;
|
|
6
|
+
return (
|
|
7
|
+
<RowContainer>
|
|
8
|
+
<Row>{data}</Row>
|
|
9
|
+
</RowContainer>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const RowContainer = styled.div``;
|
|
14
|
+
|
|
15
|
+
const Row = styled.div``;
|
|
16
|
+
|
|
17
|
+
export default Code;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { formatDate } from '../../order-actions/utils';
|
|
4
|
+
|
|
5
|
+
function Date(props: any) {
|
|
6
|
+
const data = props?.row?.original.created_at;
|
|
7
|
+
return (
|
|
8
|
+
<RowContainer>
|
|
9
|
+
<Row>{formatDate(data)}</Row>
|
|
10
|
+
</RowContainer>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const RowContainer = styled.div``;
|
|
15
|
+
|
|
16
|
+
const Row = styled.div``;
|
|
17
|
+
|
|
18
|
+
export default Date;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { useEventNotesData } from '../../store';
|
|
4
|
+
|
|
5
|
+
function Event(props: any) {
|
|
6
|
+
const data = props?.row?.original.event_information_id;
|
|
7
|
+
const [notesData] = useEventNotesData();
|
|
8
|
+
|
|
9
|
+
const getDescription = (eventId: number | undefined) => {
|
|
10
|
+
if (eventId === undefined || notesData?.length === 0) return '';
|
|
11
|
+
|
|
12
|
+
const eventData = notesData?.find((note: any) => note?.id === eventId);
|
|
13
|
+
return eventData ? eventData?.description : 'N/A';
|
|
14
|
+
};
|
|
15
|
+
return (
|
|
16
|
+
<RowContainer>
|
|
17
|
+
<Row>{getDescription(data)}</Row>
|
|
18
|
+
</RowContainer>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const RowContainer = styled.div``;
|
|
23
|
+
|
|
24
|
+
const Row = styled.div``;
|
|
25
|
+
|
|
26
|
+
export default Event;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
function Note(props: any) {
|
|
5
|
+
const data = props?.row?.original?.event_notes;
|
|
6
|
+
|
|
7
|
+
return (
|
|
8
|
+
<RowContainer title={data}>
|
|
9
|
+
<Row>{data}</Row>
|
|
10
|
+
</RowContainer>
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const RowContainer = styled.div`
|
|
15
|
+
display: inline-block;
|
|
16
|
+
max-width: 200px;
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
text-overflow: ellipsis;
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
const Row = styled.div``;
|
|
23
|
+
|
|
24
|
+
export default Note;
|
|
@@ -1,17 +1,45 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
import CollapsedContent from '../collapsed-content';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import CollapsableForm from '../../../../common/expand-collapse';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import DynamicTable from '../../DynamicTable';
|
|
6
|
+
import {
|
|
7
|
+
useEventNotesData,
|
|
8
|
+
useOrderDetails,
|
|
9
|
+
useOrderProductSystemLogs,
|
|
10
|
+
} from '../../store';
|
|
11
|
+
import { tableColumns } from '../helper';
|
|
12
|
+
import useGetEventNotes from '../../hooks/useGetEventNotes';
|
|
8
13
|
|
|
9
14
|
function SystemLogs() {
|
|
15
|
+
const [systemLogs] = useOrderProductSystemLogs();
|
|
16
|
+
|
|
17
|
+
const [orderDetails] = useOrderDetails();
|
|
18
|
+
const systemLogsData = useGetEventNotes();
|
|
19
|
+
const [, setNotesData] = useEventNotesData();
|
|
20
|
+
const gsitId = orderDetails?.gsit_order_id;
|
|
21
|
+
|
|
22
|
+
const fetchReminderData = async () => {
|
|
23
|
+
try {
|
|
24
|
+
const result = await systemLogsData();
|
|
25
|
+
if (result) {
|
|
26
|
+
setNotesData(result);
|
|
27
|
+
}
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.error('Error fetching event notes:', error);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (gsitId) {
|
|
35
|
+
fetchReminderData();
|
|
36
|
+
}
|
|
37
|
+
}, [gsitId, setNotesData]);
|
|
38
|
+
|
|
10
39
|
return (
|
|
11
40
|
<Table>
|
|
12
41
|
<CollapsableForm collapsedContent={<CollapsedContent />}>
|
|
13
|
-
|
|
14
|
-
<SystemLogsTables />
|
|
42
|
+
<DynamicTable columns={tableColumns} data={systemLogs} />
|
|
15
43
|
</CollapsableForm>
|
|
16
44
|
</Table>
|
|
17
45
|
);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {Note, Code, Event, Date } from "./columns";
|
|
2
|
+
|
|
3
|
+
export const tableColumns = [
|
|
4
|
+
{
|
|
5
|
+
header: 'Date',
|
|
6
|
+
accessorKey: 'date',
|
|
7
|
+
cell: Date,
|
|
8
|
+
enableSorting: false,
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
{
|
|
12
|
+
header: 'Code',
|
|
13
|
+
accessorKey: 'code',
|
|
14
|
+
cell: Code,
|
|
15
|
+
enableSorting: false,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
header: 'Event',
|
|
19
|
+
accessorKey: 'event',
|
|
20
|
+
cell: Event,
|
|
21
|
+
enableSorting: false,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
header: 'Note',
|
|
25
|
+
accessorKey: 'note',
|
|
26
|
+
cell: Note,
|
|
27
|
+
enableSorting: false,
|
|
28
|
+
},
|
|
29
|
+
];
|
package/src/components/store.ts
CHANGED
|
@@ -21,6 +21,12 @@ const reminderTableData = atom<any[]>([]);
|
|
|
21
21
|
|
|
22
22
|
const inQueueDataAtom = atom<any>({});
|
|
23
23
|
|
|
24
|
+
const customerData = atom<any>([]);
|
|
25
|
+
|
|
26
|
+
const actionTypeData = atom<any>([]);
|
|
27
|
+
|
|
28
|
+
const locationData = atom<any>([]);
|
|
29
|
+
|
|
24
30
|
function useReminderData() {
|
|
25
31
|
return useAtom(reminderTableData);
|
|
26
32
|
}
|
|
@@ -49,10 +55,10 @@ function useEmailInvoice() {
|
|
|
49
55
|
return useAtom(emailInvoiceData);
|
|
50
56
|
}
|
|
51
57
|
|
|
52
|
-
const
|
|
58
|
+
const selectedOrderlList = atom<any[]>([]);
|
|
53
59
|
|
|
54
|
-
function
|
|
55
|
-
return useAtom(
|
|
60
|
+
function useSelectedOrders() {
|
|
61
|
+
return useAtom(selectedOrderlList);
|
|
56
62
|
}
|
|
57
63
|
|
|
58
64
|
// Sticky menu state
|
|
@@ -61,6 +67,18 @@ export const useStickyStatus = () => {
|
|
|
61
67
|
return useAtom(stickyStatus);
|
|
62
68
|
};
|
|
63
69
|
|
|
70
|
+
function useCustomerData() {
|
|
71
|
+
return useAtom(customerData);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function useActionType() {
|
|
75
|
+
return useAtom(actionTypeData);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function useLocationData() {
|
|
79
|
+
return useAtom(locationData);
|
|
80
|
+
}
|
|
81
|
+
|
|
64
82
|
export {
|
|
65
83
|
useAtom,
|
|
66
84
|
useFilter,
|
|
@@ -70,5 +88,9 @@ export {
|
|
|
70
88
|
useReminderData,
|
|
71
89
|
useInQueueData,
|
|
72
90
|
useEmailInvoice,
|
|
73
|
-
useSelectedEmail
|
|
91
|
+
// useSelectedEmail,
|
|
92
|
+
useCustomerData,
|
|
93
|
+
useActionType,
|
|
94
|
+
useLocationData,
|
|
95
|
+
useSelectedOrders,
|
|
74
96
|
};
|
package/src/components/types.ts
CHANGED
|
@@ -9,10 +9,6 @@ export type SelectDateType = {
|
|
|
9
9
|
|
|
10
10
|
export type OrderViewType = 'add' | 'view' | 'edit';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
12
|
export interface ColumnConfig {
|
|
17
13
|
key: string;
|
|
18
14
|
label: string;
|
|
@@ -33,7 +29,7 @@ export interface Column {
|
|
|
33
29
|
render?: (data: any, row: TableRow) => React.ReactNode;
|
|
34
30
|
callback?: (data: any) => void;
|
|
35
31
|
sortable?: boolean;
|
|
36
|
-
showIcon?: boolean
|
|
32
|
+
showIcon?: boolean;
|
|
37
33
|
}
|
|
38
34
|
|
|
39
35
|
export interface TableRow {
|
|
@@ -45,7 +41,7 @@ export interface ApiResponse {
|
|
|
45
41
|
code: number;
|
|
46
42
|
error: string | null;
|
|
47
43
|
error_traceback: string | null;
|
|
48
|
-
data: any;
|
|
44
|
+
data: any[];
|
|
49
45
|
}
|
|
50
46
|
|
|
51
47
|
export interface InvoiceData {
|
package/src/index.tsx
CHANGED
|
@@ -1,22 +1,49 @@
|
|
|
1
|
-
import React, { Suspense } from 'react';
|
|
2
|
-
import { Route, Routes } from 'react-router-dom';
|
|
1
|
+
import React, { Suspense, useEffect } from 'react';
|
|
2
|
+
import { Navigate, Route, Routes, useNavigate } from 'react-router-dom';
|
|
3
3
|
// import AddOrder from './components/add-order';
|
|
4
4
|
import OrderView from './components/order-view';
|
|
5
5
|
// import AllReminder from './components/order-view/all-reminder/AllReminder';
|
|
6
6
|
import ReturnTable from './components/order-daily-overview/return-order-table/ReturnTable';
|
|
7
7
|
import ReturnAfterTable from './components/order-daily-overview/return-after-table/ReturnAfterTable';
|
|
8
|
+
import { useTableName } from './components/order-daily-overview/store/store';
|
|
9
|
+
// import ReturnOrderTable from './components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable';
|
|
8
10
|
import ReturnMainTable from './components/order-daily-overview';
|
|
9
11
|
|
|
10
12
|
function ReturnClient() {
|
|
11
13
|
const LoadingMessage = () => <div>Loading...</div>;
|
|
14
|
+
const [selectedClient] = useTableName();
|
|
15
|
+
const navigate = useNavigate();
|
|
16
|
+
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
if (!location.pathname.includes('/return')) {
|
|
19
|
+
localStorage.removeItem('clientName');
|
|
20
|
+
localStorage.removeItem('clientId');
|
|
21
|
+
}
|
|
22
|
+
}, [location.pathname]);
|
|
23
|
+
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (selectedClient) {
|
|
26
|
+
navigate(`/return/${selectedClient}`);
|
|
27
|
+
}
|
|
28
|
+
}, [selectedClient, navigate]);
|
|
12
29
|
|
|
13
30
|
return (
|
|
14
31
|
<Suspense fallback={<LoadingMessage />}>
|
|
15
32
|
<Routes>
|
|
16
33
|
<Route path="" element={<ReturnMainTable />} />
|
|
17
|
-
<Route path="return" element={<
|
|
18
|
-
<Route path="
|
|
19
|
-
<Route path="
|
|
34
|
+
<Route path="order-return" element={<ReturnAfterTable />} />
|
|
35
|
+
<Route path="order-return/:id" element={<OrderView />} />
|
|
36
|
+
<Route path="return/:selectedClient" element={<ReturnTable />} />
|
|
37
|
+
<Route
|
|
38
|
+
path=""
|
|
39
|
+
element={
|
|
40
|
+
selectedClient ? (
|
|
41
|
+
<Navigate to={`/return/${selectedClient}`} />
|
|
42
|
+
) : (
|
|
43
|
+
<ReturnMainTable />
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
/>
|
|
20
47
|
</Routes>
|
|
21
48
|
</Suspense>
|
|
22
49
|
);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Column } from '../../../types';
|
|
3
|
-
export declare const selectedValueAtom: import("jotai/esm/").PrimitiveAtom<null> & {
|
|
4
|
-
init: null;
|
|
5
|
-
};
|
|
6
|
-
export declare const selectedIDAtom: import("jotai/esm/").PrimitiveAtom<null> & {
|
|
7
|
-
init: null;
|
|
8
|
-
};
|
|
9
|
-
interface MyTableProps {
|
|
10
|
-
columns: Column[];
|
|
11
|
-
data: any;
|
|
12
|
-
loading: boolean;
|
|
13
|
-
loadingskeleton?: boolean;
|
|
14
|
-
view?: 'rfi';
|
|
15
|
-
}
|
|
16
|
-
declare const MyTable: React.FC<MyTableProps>;
|
|
17
|
-
export default MyTable;
|
|
18
|
-
export declare const CoverDiv: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Column } from '../../../types';
|
|
3
|
-
export declare const selectedValueAtom: import("jotai/esm/").PrimitiveAtom<null> & {
|
|
4
|
-
init: null;
|
|
5
|
-
};
|
|
6
|
-
export declare const selectedIDAtom: import("jotai/esm/").PrimitiveAtom<null> & {
|
|
7
|
-
init: null;
|
|
8
|
-
};
|
|
9
|
-
interface MyTableProps {
|
|
10
|
-
columns: Column[];
|
|
11
|
-
data: any;
|
|
12
|
-
loading: boolean;
|
|
13
|
-
loadingskeleton?: boolean;
|
|
14
|
-
view?: 'rfi';
|
|
15
|
-
}
|
|
16
|
-
declare const Table: React.FC<MyTableProps>;
|
|
17
|
-
export default Table;
|
|
18
|
-
export declare const CoverDiv: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare const SystemStyledTableWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
-
export declare const SystemStyledTable: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, never>> & string;
|