@bjsdistribution/dms-client-return 0.0.1 → 0.0.3
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/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-view/details-filters/left-side-filters/dropdowns/PrintDropDown.d.ts +3 -1
- package/dist/components/order-view/store.d.ts +5 -1
- package/dist/components/store.d.ts +5 -2
- package/dist/components/types.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +1065 -964
- 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 +1067 -966
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- 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 +1 -8
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +56 -67
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +160 -223
- package/src/components/order-daily-overview/header-filters/Styledfilters.tsx +19 -7
- package/src/components/order-daily-overview/header-filters/filterStore.ts +145 -0
- package/src/components/order-daily-overview/index.tsx +59 -6
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +24 -1
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +177 -234
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +63 -6
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +5 -47
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +51 -185
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +62 -0
- package/src/components/order-daily-overview/store/store.ts +23 -12
- package/src/components/order-daily-overview/table/ReturnTable.tsx +193 -205
- package/src/components/order-view/details-filters/DetailsFilters.tsx +3 -2
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx +57 -46
- package/src/components/order-view/general-information/Status.tsx +1 -1
- package/src/components/order-view/index.tsx +6 -4
- package/src/components/order-view/modalsPopup/UnReceiveProduct.tsx +1 -1
- 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/return-client-products/product-table/ReturnProductTable.tsx +2 -2
- package/src/components/order-view/store.ts +40 -12
- package/src/components/store.ts +26 -4
- package/src/components/types.ts +2 -6
- 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/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
|
@@ -1,217 +1,205 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import {
|
|
11
|
-
// import useInfiniteScroll from './InfiniteScrolling';
|
|
12
|
-
// import { overviewFiltersReducerAtom } from '../header-for-invoice/invoice-selection/FilterStore';
|
|
13
|
-
// import {
|
|
14
|
-
// usePrevSelectedClients,
|
|
15
|
-
// useSelectedClients,
|
|
16
|
-
// } from '../header-for-invoice/store';
|
|
17
|
-
// import ClientView from './client-view';
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { useClientData, useOrderStaticData } from '../../order-view/store';
|
|
3
|
+
import { useLoading } from '../store/store';
|
|
4
|
+
import { useApiHook } from '@bjsdistribution/dms-component-library';
|
|
5
|
+
import {
|
|
6
|
+
EmptyDataContainer,
|
|
7
|
+
StyledTable,
|
|
8
|
+
StyledTableWrapper,
|
|
9
|
+
} from './table-data/styles';
|
|
10
|
+
import { Empty, Skeleton } from 'antd';
|
|
18
11
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// overviewFiltersReducerAtom
|
|
27
|
-
// );
|
|
28
|
-
// const [, setPrevSelectedClients] = usePrevSelectedClients();
|
|
29
|
-
// const [, dispatchFilters] = useAtom(overviewFiltersReducerAtom);
|
|
12
|
+
interface ApiResponse {
|
|
13
|
+
message: string;
|
|
14
|
+
code: number;
|
|
15
|
+
error: string | null;
|
|
16
|
+
error_traceback: string | null;
|
|
17
|
+
data: [];
|
|
18
|
+
}
|
|
30
19
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
// setPrevSelectedClients([data]); // to disable apply button if client is clickec from table
|
|
34
|
-
// setReadyForInvoiceView('client');
|
|
35
|
-
// dispatchOverviewFilter({
|
|
36
|
-
// type: 'SET_CUSTOMER_FILTER',
|
|
37
|
-
// payload: [data.value],
|
|
38
|
-
// });
|
|
39
|
-
// };
|
|
20
|
+
const ReturnTable: React.FC = ({ loadingskeleton }: any) => {
|
|
21
|
+
const [clientData] = useClientData();
|
|
40
22
|
|
|
41
|
-
const
|
|
42
|
-
{
|
|
43
|
-
Header: 'Trading Name',
|
|
44
|
-
accessor: 'name',
|
|
45
|
-
sortable: true,
|
|
46
|
-
showIcon: true,
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
Header: 'Client',
|
|
50
|
-
accessor: 'customer_name',
|
|
51
|
-
// callback: getId,
|
|
52
|
-
sortable: true,
|
|
53
|
-
showIcon: false,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
Header: 'Orders',
|
|
57
|
-
accessor: 'total_amount',
|
|
58
|
-
sortable: true,
|
|
59
|
-
showIcon: true,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
Header: 'Products',
|
|
63
|
-
accessor: 'total_orders',
|
|
64
|
-
sortable: true,
|
|
65
|
-
showIcon: false,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
Header: 'RTS',
|
|
69
|
-
accessor: 'total_amount',
|
|
70
|
-
sortable: true,
|
|
71
|
-
showIcon: true,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
Header: 'Pending',
|
|
75
|
-
accessor: 'total_amount',
|
|
76
|
-
sortable: true,
|
|
77
|
-
showIcon: true,
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
Header: 'Dispose',
|
|
81
|
-
accessor: 'total_orders',
|
|
82
|
-
sortable: true,
|
|
83
|
-
showIcon: false,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
Header: 'Re-allocate',
|
|
87
|
-
accessor: 'total_amount',
|
|
88
|
-
sortable: true,
|
|
89
|
-
showIcon: true,
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
Header: 'Re-Del',
|
|
93
|
-
accessor: 'total_amount',
|
|
94
|
-
sortable: true,
|
|
95
|
-
showIcon: true,
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
Header: 'Recycle',
|
|
99
|
-
accessor: 'total_orders',
|
|
100
|
-
sortable: true,
|
|
101
|
-
showIcon: false,
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
Header: 'unknown',
|
|
105
|
-
accessor: 'total_amount',
|
|
106
|
-
sortable: true,
|
|
107
|
-
showIcon: true,
|
|
108
|
-
},
|
|
109
|
-
// {
|
|
110
|
-
// Header: 'Amount',
|
|
111
|
-
// accessor: 'total_amount',
|
|
112
|
-
// sortable: true,
|
|
113
|
-
// showIcon: true,
|
|
114
|
-
// },
|
|
115
|
-
// { Header: 'VAT', accessor: 'vat_rate', sortable: true, showIcon: true },
|
|
116
|
-
// { Header: 'Total', accessor: 'total', sortable: true, showIcon: false },
|
|
117
|
-
];
|
|
23
|
+
const [, setLoading] = useLoading();
|
|
118
24
|
|
|
119
|
-
|
|
120
|
-
// const [
|
|
121
|
-
// readyForInvoiceOverview,
|
|
122
|
-
// setReadyForInvoiceOverview,
|
|
123
|
-
// ] = useReadyForInvoiceOverview();
|
|
124
|
-
// const [filterApplied] = usefilterApplied();
|
|
25
|
+
const [, setOrderStaticData] = useOrderStaticData();
|
|
125
26
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
// endpoint: `/invoices/ready_for_invoice/overview/`,
|
|
134
|
-
// method: 'GET',
|
|
135
|
-
// filters: filters,
|
|
136
|
-
// pagination: pagination,
|
|
137
|
-
// performAction: true,
|
|
138
|
-
// });
|
|
139
|
-
// // infinite scrolling code start here
|
|
140
|
-
// const { page, scrollActivated } = useInfiniteScroll(
|
|
141
|
-
// paginationData,
|
|
142
|
-
// setShouldPerformAction,
|
|
143
|
-
// 'tableScrolling'
|
|
144
|
-
// );
|
|
145
|
-
// useEffect(() => {
|
|
146
|
-
// dispatchOverviewFilter({ type: 'SET_PAGE', payload: page });
|
|
147
|
-
// }, [page]);
|
|
27
|
+
const { data: fetchedStaticData, loading: staticDataLoading } = useApiHook<{
|
|
28
|
+
data: ApiResponse[];
|
|
29
|
+
}>({
|
|
30
|
+
endpoint: `/orders/getStaticData/all/`,
|
|
31
|
+
method: 'GET',
|
|
32
|
+
});
|
|
33
|
+
console.log('fetchedStaticData', fetchedStaticData);
|
|
148
34
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setLoading(staticDataLoading);
|
|
37
|
+
if (fetchedStaticData && fetchedStaticData.data) {
|
|
38
|
+
const result = fetchedStaticData?.data;
|
|
39
|
+
setOrderStaticData(result[0]);
|
|
40
|
+
}
|
|
41
|
+
}, [staticDataLoading, fetchedStaticData]);
|
|
152
42
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
43
|
+
return (
|
|
44
|
+
<>
|
|
45
|
+
<StyledTableWrapper id="tableScrolling">
|
|
46
|
+
<StyledTable>
|
|
47
|
+
<thead>
|
|
48
|
+
<tr>
|
|
49
|
+
<th>Trading Name</th>
|
|
50
|
+
<th>Client</th>
|
|
51
|
+
<th>Orders</th>
|
|
52
|
+
<th>Products</th>
|
|
53
|
+
<th>Dispose</th>
|
|
54
|
+
<th>Re-allocate</th>
|
|
55
|
+
<th>Re-Del</th>
|
|
56
|
+
<th>Recycle</th>
|
|
57
|
+
<th>Unknown</th>
|
|
58
|
+
</tr>
|
|
59
|
+
</thead>
|
|
60
|
+
<tbody>
|
|
61
|
+
{loadingskeleton ? (
|
|
62
|
+
<tr>
|
|
63
|
+
<td colSpan={9}>
|
|
64
|
+
<Skeleton active />
|
|
65
|
+
</td>
|
|
66
|
+
</tr>
|
|
67
|
+
) : clientData?.length === 0 ? (
|
|
68
|
+
<tr>
|
|
69
|
+
<td colSpan={9}>
|
|
70
|
+
<EmptyDataContainer>
|
|
71
|
+
<Empty />
|
|
72
|
+
</EmptyDataContainer>
|
|
73
|
+
</td>
|
|
74
|
+
</tr>
|
|
75
|
+
) : (
|
|
76
|
+
Object.keys(clientData[0]).map(key => {
|
|
77
|
+
const clientReturn = clientData[0][key];
|
|
78
|
+
return (
|
|
79
|
+
<tr key={key}>
|
|
80
|
+
<td>{clientReturn?.trading_as}</td>
|
|
176
81
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
82
|
+
<td>
|
|
83
|
+
{' '}
|
|
84
|
+
<ul style={{ listStyleType: 'none', padding: 0 }}>
|
|
85
|
+
<li
|
|
86
|
+
style={{
|
|
87
|
+
color: '#0099ff',
|
|
88
|
+
fontWeight: 600,
|
|
89
|
+
paddingLeft: 0,
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
{clientReturn?.customer_name}
|
|
93
|
+
</li>
|
|
94
|
+
</ul>{' '}
|
|
95
|
+
</td>
|
|
96
|
+
<td>
|
|
97
|
+
<div
|
|
98
|
+
style={{
|
|
99
|
+
background: 'rgba(153, 153, 153, 0.10)',
|
|
100
|
+
padding: '3px 12px',
|
|
101
|
+
borderRadius: '4px',
|
|
102
|
+
color: '#6A7378',
|
|
103
|
+
display: 'flex',
|
|
104
|
+
justifyContent: 'center',
|
|
105
|
+
}}
|
|
106
|
+
>
|
|
107
|
+
{clientReturn?.return_orders}
|
|
108
|
+
</div>
|
|
109
|
+
</td>
|
|
203
110
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
111
|
+
<td>
|
|
112
|
+
<div
|
|
113
|
+
style={{
|
|
114
|
+
background: 'rgba(153, 153, 153, 0.10)',
|
|
115
|
+
padding: '3px 12px',
|
|
116
|
+
borderRadius: '4px',
|
|
117
|
+
color: '#6A7378',
|
|
118
|
+
display: 'flex',
|
|
119
|
+
justifyContent: 'center',
|
|
120
|
+
}}
|
|
121
|
+
>
|
|
122
|
+
{clientReturn?.return_order_products}
|
|
123
|
+
</div>
|
|
124
|
+
</td>
|
|
125
|
+
<td>
|
|
126
|
+
<div
|
|
127
|
+
style={{
|
|
128
|
+
background: 'rgba(153, 153, 153, 0.10)',
|
|
129
|
+
padding: '3px 12px',
|
|
130
|
+
borderRadius: '4px',
|
|
131
|
+
color: '#6A7378',
|
|
132
|
+
display: 'flex',
|
|
133
|
+
justifyContent: 'center',
|
|
134
|
+
}}
|
|
135
|
+
>
|
|
136
|
+
{clientReturn?.DISPOSE}
|
|
137
|
+
</div>
|
|
138
|
+
</td>
|
|
139
|
+
<td>
|
|
140
|
+
<div
|
|
141
|
+
style={{
|
|
142
|
+
background: 'rgba(153, 153, 153, 0.10)',
|
|
143
|
+
padding: '3px 12px',
|
|
144
|
+
borderRadius: '4px',
|
|
145
|
+
color: '#6A7378',
|
|
146
|
+
display: 'flex',
|
|
147
|
+
justifyContent: 'center',
|
|
148
|
+
}}
|
|
149
|
+
>
|
|
150
|
+
{clientReturn?.['RE-ALLOCATE']}
|
|
151
|
+
</div>
|
|
152
|
+
</td>
|
|
153
|
+
<td>
|
|
154
|
+
<div
|
|
155
|
+
style={{
|
|
156
|
+
background: 'rgba(153, 153, 153, 0.10)',
|
|
157
|
+
padding: '3px 12px',
|
|
158
|
+
borderRadius: '4px',
|
|
159
|
+
color: '#6A7378',
|
|
160
|
+
display: 'flex',
|
|
161
|
+
justifyContent: 'center',
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
{clientReturn?.['RE-DEL']}
|
|
165
|
+
</div>
|
|
166
|
+
</td>
|
|
167
|
+
<td>
|
|
168
|
+
<div
|
|
169
|
+
style={{
|
|
170
|
+
background: 'rgba(153, 153, 153, 0.10)',
|
|
171
|
+
padding: '3px 12px',
|
|
172
|
+
borderRadius: '4px',
|
|
173
|
+
color: '#6A7378',
|
|
174
|
+
display: 'flex',
|
|
175
|
+
justifyContent: 'center',
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
{clientReturn?.RECYCLE}
|
|
179
|
+
</div>
|
|
180
|
+
</td>
|
|
181
|
+
<td>
|
|
182
|
+
<div
|
|
183
|
+
style={{
|
|
184
|
+
background: 'rgba(153, 153, 153, 0.10)',
|
|
185
|
+
padding: '3px 12px',
|
|
186
|
+
borderRadius: '4px',
|
|
187
|
+
color: '#6A7378',
|
|
188
|
+
display: 'flex',
|
|
189
|
+
justifyContent: 'center',
|
|
190
|
+
}}
|
|
191
|
+
>
|
|
192
|
+
{clientReturn?.UNKNOWN}
|
|
193
|
+
</div>
|
|
194
|
+
</td>
|
|
195
|
+
</tr>
|
|
196
|
+
);
|
|
197
|
+
})
|
|
198
|
+
)}
|
|
199
|
+
</tbody>
|
|
200
|
+
</StyledTable>
|
|
201
|
+
</StyledTableWrapper>
|
|
202
|
+
</>
|
|
215
203
|
);
|
|
216
204
|
};
|
|
217
205
|
|
|
@@ -25,9 +25,10 @@ const Flex = styled.div`
|
|
|
25
25
|
gap: 10px;
|
|
26
26
|
align-self: stretch;
|
|
27
27
|
position: relative;
|
|
28
|
-
margin-
|
|
28
|
+
margin-bottom: -71px;
|
|
29
29
|
width: 97%;
|
|
30
|
-
margin-left:
|
|
30
|
+
margin-left: 21px;
|
|
31
|
+
top: -40px;
|
|
31
32
|
justify-content: space-between;
|
|
32
33
|
`;
|
|
33
34
|
export default DetailsFilters;
|
package/src/components/order-view/details-filters/left-side-filters/dropdowns/PrintDropDown.tsx
CHANGED
|
@@ -1,52 +1,63 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { PrintIconMap } from '../../../../order-daily-overview/shared/utlis';
|
|
4
|
+
import { PrintData } from '../../../../order-daily-overview/shared/interface';
|
|
5
|
+
import { optionsPrint } from '../../../../order-daily-overview/common/fakedata';
|
|
6
|
+
// import { PrintIconMap } from '../utils';
|
|
7
|
+
// import { optionsPrint } from '../fakeData';
|
|
8
|
+
// import { PrintData } from '../interface';
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
import DropDownMenu from './DropDownMenu';
|
|
5
|
-
import DropDownItem from './DropDownItem';
|
|
6
|
-
import DropDownLarge from '../../../../../assets/icons/DropDownLarge';
|
|
7
|
-
|
|
8
|
-
const Options = [
|
|
9
|
-
{ label: 'Return notes', value: 'return-notes' },
|
|
10
|
-
{ label: 'Product Labels', value: 'product-labels' },
|
|
11
|
-
{ label: 'Returns Cover Note', value: 'cover-note' },
|
|
12
|
-
];
|
|
13
|
-
|
|
14
|
-
const PrintDropDown: React.FC = () => {
|
|
15
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
16
|
-
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
17
|
-
|
|
18
|
-
const handleClick = () => {
|
|
19
|
-
setIsOpen(prev => !prev);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const handleSelect = (value: string) => {
|
|
23
|
-
console.log(`Selected: ${value}`);
|
|
24
|
-
setIsOpen(false);
|
|
25
|
-
};
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
const handleClickOutside = (event: MouseEvent) => {
|
|
28
|
-
if (
|
|
29
|
-
dropdownRef.current &&
|
|
30
|
-
!dropdownRef.current.contains(event.target as Node)
|
|
31
|
-
) {
|
|
32
|
-
setIsOpen(false);
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
document.addEventListener('mousedown', handleClickOutside);
|
|
36
|
-
return () => {
|
|
37
|
-
document.removeEventListener('mousedown', handleClickOutside);
|
|
38
|
-
};
|
|
39
|
-
}, []);
|
|
10
|
+
const options: PrintData[] = optionsPrint;
|
|
40
11
|
|
|
12
|
+
const PrintDropDown = () => {
|
|
13
|
+
const downloadFiles = () => {};
|
|
41
14
|
return (
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
15
|
+
<OptionsList>
|
|
16
|
+
{options.map((item, index) => {
|
|
17
|
+
const IconComponent = PrintIconMap[item.icon];
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<OptionsListLi key={index} onClick={downloadFiles}>
|
|
21
|
+
{IconComponent && <IconComponent />} {item.label}
|
|
22
|
+
</OptionsListLi>
|
|
23
|
+
);
|
|
24
|
+
})}
|
|
25
|
+
</OptionsList>
|
|
50
26
|
);
|
|
51
27
|
};
|
|
28
|
+
|
|
52
29
|
export default PrintDropDown;
|
|
30
|
+
|
|
31
|
+
export const OptionsList = styled.ul`
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
list-style: none;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
border-radius: 6px;
|
|
37
|
+
border: 1px solid rgba(224, 226, 231, 0.5);
|
|
38
|
+
background: #fff;
|
|
39
|
+
box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);
|
|
40
|
+
width: 177px;
|
|
41
|
+
padding: 5px 1px 3px 1px;
|
|
42
|
+
position: absolute;
|
|
43
|
+
/* top: 34px;
|
|
44
|
+
right: 0; */
|
|
45
|
+
|
|
46
|
+
top: 530px;
|
|
47
|
+
right: 25px;
|
|
48
|
+
z-index: 99;
|
|
49
|
+
min-width: 194px;
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
export const OptionsListLi = styled.li`
|
|
53
|
+
border-bottom: 1px solid #f0f2f2;
|
|
54
|
+
padding: 8px 10px;
|
|
55
|
+
display: flex;
|
|
56
|
+
gap: 12px;
|
|
57
|
+
align-items: center;
|
|
58
|
+
font-size: 13px;
|
|
59
|
+
cursor: pointer;
|
|
60
|
+
&:last-child {
|
|
61
|
+
border: none;
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
@@ -41,7 +41,7 @@ interface ApiResponse {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function OrderView() {
|
|
44
|
-
const [
|
|
44
|
+
const [, setOrderId] = useOrderId();
|
|
45
45
|
|
|
46
46
|
const splitPath = (str: any) => {
|
|
47
47
|
const parts = str?.split('/')?.filter((part: any) => part !== ''); // Filter out empty parts
|
|
@@ -57,6 +57,7 @@ function OrderView() {
|
|
|
57
57
|
const [, setDepotOptions] = useDepotOptions();
|
|
58
58
|
const location = useLocation();
|
|
59
59
|
const paths = splitPath(location.pathname);
|
|
60
|
+
const orderId = 192;
|
|
60
61
|
|
|
61
62
|
const { data: fetchedData, loading, setShouldPerformAction } = useApiHook<{
|
|
62
63
|
data: OrdersType[];
|
|
@@ -206,15 +207,16 @@ const Section = styled.div`
|
|
|
206
207
|
border-radius: 12px;
|
|
207
208
|
box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);
|
|
208
209
|
border: 1px solid #e0e0e0;
|
|
210
|
+
padding: 12px;
|
|
209
211
|
`;
|
|
210
212
|
/* // `; */
|
|
211
213
|
const DashBoardWrapper = styled.section`
|
|
212
214
|
.Tableconatiner {
|
|
213
215
|
border-radius: 12px;
|
|
214
|
-
background: #fff;
|
|
215
|
-
box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1);
|
|
216
|
+
/* background: #fff; */
|
|
217
|
+
/* box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1); */
|
|
216
218
|
display: block;
|
|
217
|
-
padding: 15px
|
|
219
|
+
padding: 15px 0px;
|
|
218
220
|
}
|
|
219
221
|
.headerWrap,
|
|
220
222
|
.tableData,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AntSelect, Label } from '@bjsdistribution/dms-component-library';
|
|
2
2
|
import React, { useEffect } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
|
-
import Notes from '
|
|
4
|
+
import Notes from '../order-actions/actions/log-service-refusal/Notes';
|
|
5
5
|
import {
|
|
6
6
|
useOrderStaticData,
|
|
7
7
|
useProductDetails,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import OrderActionModal from '../../../../../common/modals/order-action-modal/OrderActionModal';
|
|
3
3
|
import { useCurrentAction } from '../../../store';
|
|
4
|
-
import NewEscalation from '
|
|
4
|
+
import NewEscalation from './NewEscalation';
|
|
5
5
|
|
|
6
6
|
const EscalationModal: React.FC = () => {
|
|
7
7
|
const [, setCurrentAction] = useCurrentAction();
|