@bjsdistribution/dms-client-return 0.0.41 → 0.0.42
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/dist/common/date-picker/header/ClearDate.d.ts +1 -1
- package/dist/components/order-daily-overview/store/store.d.ts +1 -1
- package/dist/components/order-daily-overview/table/table-data/styles.d.ts +3 -3
- package/dist/components/order-daily-overview/table-view/TableStyle.d.ts +4 -4
- package/dist/components/order-view/view-reminder/reminder-styles.d.ts +2 -2
- package/dist/dms-client-return.cjs.development.js +300 -156
- 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 +301 -157
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/common/services-slider/ServiceSlider.tsx +1 -1
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +100 -82
- package/src/components/order-daily-overview/index.tsx +6 -4
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +60 -16
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +70 -20
- package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +8 -1
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +13 -2
- package/src/components/order-daily-overview/store/store.ts +1 -1
- package/src/components/order-daily-overview/table/ReturnTable.tsx +55 -22
- package/src/components/order-view/hooks/useGetEventNotes.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +1 -2
- package/src/index.tsx +15 -18
|
@@ -37,6 +37,7 @@ const ReturnTable: React.FC = () => {
|
|
|
37
37
|
const [, dispatch] = useAtom(filtersReducerAtom);
|
|
38
38
|
const navigate = useNavigate();
|
|
39
39
|
const [customers] = useCustomerData();
|
|
40
|
+
// const [searchParams] = useSearchParams();
|
|
40
41
|
|
|
41
42
|
//sorting
|
|
42
43
|
const [sortConfig, setSortConfig] = useState<{
|
|
@@ -93,7 +94,6 @@ const ReturnTable: React.FC = () => {
|
|
|
93
94
|
});
|
|
94
95
|
|
|
95
96
|
useEffect(() => {
|
|
96
|
-
// setLoading(staticDataLoading);
|
|
97
97
|
if (fetchedStaticData && fetchedStaticData.data) {
|
|
98
98
|
const result = fetchedStaticData?.data;
|
|
99
99
|
setOrderStaticData(result[0]);
|
|
@@ -117,15 +117,7 @@ const ReturnTable: React.FC = () => {
|
|
|
117
117
|
}, [customers, clientData]);
|
|
118
118
|
|
|
119
119
|
//handle Redirect
|
|
120
|
-
const handleRedirect = (
|
|
121
|
-
customerName: string,
|
|
122
|
-
customerId: number,
|
|
123
|
-
account_number: string
|
|
124
|
-
) => {
|
|
125
|
-
localStorage.setItem('clientName', customerName);
|
|
126
|
-
localStorage.setItem('clientId', customerId?.toString());
|
|
127
|
-
localStorage.setItem('account_number', account_number);
|
|
128
|
-
|
|
120
|
+
const handleRedirect = (customerId: number) => {
|
|
129
121
|
if (customerId) {
|
|
130
122
|
dispatch({
|
|
131
123
|
type: 'SET_CLIENT_FILTER',
|
|
@@ -141,14 +133,45 @@ const ReturnTable: React.FC = () => {
|
|
|
141
133
|
payload: [],
|
|
142
134
|
});
|
|
143
135
|
}
|
|
136
|
+
|
|
137
|
+
const queryParams = new URLSearchParams({
|
|
138
|
+
customerId: customerId?.toString(),
|
|
139
|
+
});
|
|
144
140
|
//for dev
|
|
145
|
-
navigate(`filter
|
|
141
|
+
navigate(`filter?${queryParams.toString()}`);
|
|
146
142
|
|
|
147
143
|
//for local
|
|
148
|
-
//
|
|
144
|
+
//navigate(`/filter?${queryParams.toString()}`);
|
|
149
145
|
};
|
|
150
146
|
|
|
151
|
-
|
|
147
|
+
//for RTS
|
|
148
|
+
const handleRedirectRTS = (customerId: number, RTS: string) => {
|
|
149
|
+
if (customerId) {
|
|
150
|
+
dispatch({
|
|
151
|
+
type: 'SET_CLIENT_FILTER',
|
|
152
|
+
payload: customerId,
|
|
153
|
+
});
|
|
154
|
+
dispatch({
|
|
155
|
+
type: 'SET_PAGE',
|
|
156
|
+
payload: 1,
|
|
157
|
+
});
|
|
158
|
+
} else {
|
|
159
|
+
dispatch({
|
|
160
|
+
type: 'SET_CLIENT_FILTER',
|
|
161
|
+
payload: [],
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const queryParams = new URLSearchParams({
|
|
166
|
+
customerId: customerId?.toString(),
|
|
167
|
+
type: RTS,
|
|
168
|
+
});
|
|
169
|
+
//for dev
|
|
170
|
+
navigate(`filter?${queryParams.toString()}`);
|
|
171
|
+
|
|
172
|
+
//for local
|
|
173
|
+
//navigate(`/filter?${queryParams.toString()}`);
|
|
174
|
+
};
|
|
152
175
|
|
|
153
176
|
return (
|
|
154
177
|
<>
|
|
@@ -200,13 +223,7 @@ const ReturnTable: React.FC = () => {
|
|
|
200
223
|
<td>{key?.trading_as}</td>
|
|
201
224
|
|
|
202
225
|
<td
|
|
203
|
-
onClick={() =>
|
|
204
|
-
handleRedirect(
|
|
205
|
-
key?.customer_name,
|
|
206
|
-
key?.customer_id,
|
|
207
|
-
key?.account_number
|
|
208
|
-
)
|
|
209
|
-
}
|
|
226
|
+
onClick={() => handleRedirect(key?.customer_id)}
|
|
210
227
|
style={{
|
|
211
228
|
color: '#0099ff',
|
|
212
229
|
fontWeight: 600,
|
|
@@ -230,9 +247,25 @@ const ReturnTable: React.FC = () => {
|
|
|
230
247
|
<GreyBox>{key?.return_order_products}</GreyBox>
|
|
231
248
|
</ColumStyle>
|
|
232
249
|
</td>
|
|
233
|
-
<td
|
|
250
|
+
<td
|
|
251
|
+
style={{
|
|
252
|
+
color: key?.RTS > 0 ? '#0099ff' : 'inherit',
|
|
253
|
+
fontWeight: key?.RTS > 0 ? 600 : 'normal',
|
|
254
|
+
cursor: key?.RTS > 0 ? 'pointer' : 'default',
|
|
255
|
+
}}
|
|
256
|
+
onClick={() => handleRedirectRTS(key?.customer_id, 'RTS')}
|
|
257
|
+
>
|
|
234
258
|
<ColumStyle>
|
|
235
|
-
<GreyBox
|
|
259
|
+
<GreyBox
|
|
260
|
+
style={{
|
|
261
|
+
backgroundColor:
|
|
262
|
+
key?.RTS > 0
|
|
263
|
+
? 'rgba(99, 150, 229, 0.1)'
|
|
264
|
+
: 'rgba(153, 153, 153, 0.1)',
|
|
265
|
+
}}
|
|
266
|
+
>
|
|
267
|
+
{key?.RTS}
|
|
268
|
+
</GreyBox>
|
|
236
269
|
</ColumStyle>
|
|
237
270
|
</td>
|
|
238
271
|
|
|
@@ -7,7 +7,7 @@ function useGetEventNotes() {
|
|
|
7
7
|
const ssoToken = getCookie('id_token');
|
|
8
8
|
|
|
9
9
|
const perform = async () => {
|
|
10
|
-
const endpoint = `${getBaseEndpoint()}
|
|
10
|
+
const endpoint = `${getBaseEndpoint()}events/get/event_information/`;
|
|
11
11
|
// setLoading(true);
|
|
12
12
|
try {
|
|
13
13
|
const headers = {
|
package/src/index.tsx
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { Suspense, useEffect } from 'react';
|
|
2
|
-
import { Route, Routes,
|
|
2
|
+
import { Route, Routes, useSearchParams } from 'react-router-dom';
|
|
3
3
|
import OrderView from './components/order-view';
|
|
4
4
|
import ReturnTable from './components/order-daily-overview/return-order-table/ReturnTable';
|
|
5
5
|
import ReturnAfterTable from './components/order-daily-overview/return-after-table/ReturnAfterTable';
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
useSelectedAction,
|
|
8
|
+
useSelectedClient,
|
|
9
9
|
} from './components/order-daily-overview/store/store';
|
|
10
10
|
import ReturnMainTable from './components/order-daily-overview';
|
|
11
11
|
import { notification } from 'antd';
|
|
@@ -27,8 +27,6 @@ function ReturnClient() {
|
|
|
27
27
|
top: 80,
|
|
28
28
|
});
|
|
29
29
|
const LoadingMessage = () => <div>Loading...</div>;
|
|
30
|
-
const [selectedClientId] = useIdForTableName();
|
|
31
|
-
const navigate = useNavigate();
|
|
32
30
|
const [, setCustomers] = useCustomerData();
|
|
33
31
|
const [, setActionType] = useActionType();
|
|
34
32
|
const [, setLocationData] = useLocationData();
|
|
@@ -36,7 +34,9 @@ function ReturnClient() {
|
|
|
36
34
|
const [, setAssignData] = useAssignData();
|
|
37
35
|
const [, setActionTypeOptions] = useActionTypeOptions();
|
|
38
36
|
const [, setLocationOptions] = useLocationOptions();
|
|
39
|
-
const [,
|
|
37
|
+
const [, setSelectedFilterValue] = useSelectedAction();
|
|
38
|
+
const [, setSelectedClient] = useSelectedClient();
|
|
39
|
+
const [searchParams] = useSearchParams();
|
|
40
40
|
|
|
41
41
|
const splitPath = (str: any) => {
|
|
42
42
|
const parts = str?.split('/')?.filter((part: any) => part !== ''); // Filter out empty parts
|
|
@@ -45,20 +45,18 @@ function ReturnClient() {
|
|
|
45
45
|
const paths = splitPath(location.pathname);
|
|
46
46
|
useEffect(() => {
|
|
47
47
|
if (paths[paths.length - 1] === 'returnclient') {
|
|
48
|
-
localStorage.removeItem('clientName');
|
|
49
|
-
localStorage.removeItem('clientId');
|
|
50
|
-
localStorage.removeItem('account_number');
|
|
51
48
|
setActionTypeOptions([]);
|
|
52
49
|
setLocationOptions([]);
|
|
53
|
-
|
|
50
|
+
setSelectedClient(null);
|
|
51
|
+
setSelectedFilterValue(null);
|
|
54
52
|
}
|
|
55
|
-
}, [location.pathname]);
|
|
53
|
+
}, [location.pathname, searchParams]);
|
|
56
54
|
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}, [selectedClientId]);
|
|
55
|
+
// useEffect(() => {
|
|
56
|
+
// if (selectedClientId) {
|
|
57
|
+
// navigate(`filter/${selectedClientId}`);
|
|
58
|
+
// }
|
|
59
|
+
// }, [selectedClientId]);
|
|
62
60
|
|
|
63
61
|
//API for client data
|
|
64
62
|
const { data: fetchedCustomerData, loading: loading } = useApiHook<
|
|
@@ -76,7 +74,6 @@ function ReturnClient() {
|
|
|
76
74
|
>({
|
|
77
75
|
endpoint: `/orders/getStaticData/all/`,
|
|
78
76
|
method: 'GET',
|
|
79
|
-
// pagination: { page: 1, per_page: 50 },
|
|
80
77
|
});
|
|
81
78
|
|
|
82
79
|
//API for return locations
|
|
@@ -130,7 +127,7 @@ function ReturnClient() {
|
|
|
130
127
|
|
|
131
128
|
<Route path="order-return" element={<ReturnAfterTable />} />
|
|
132
129
|
<Route path="order-return/:id" element={<OrderView />} />
|
|
133
|
-
<Route path="filter
|
|
130
|
+
<Route path="filter" element={<ReturnTable />} />
|
|
134
131
|
|
|
135
132
|
{/* <Route
|
|
136
133
|
path=""
|