@bjsdistribution/dms-client-return 0.1.20-dev → 0.1.20-prod
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/client-portal/DateFilterStore.d.ts +15 -0
- package/dist/components/client-portal/ReturnRTFilters.d.ts +3 -0
- package/dist/components/order-daily-overview/header/route-header/ClientRouterHeader.d.ts +11 -0
- package/dist/components/order-daily-overview/table-view/TableStyle.d.ts +4 -4
- package/dist/components/order-view/DynamicTable.d.ts +2 -1
- package/dist/components/order-view/general-information/Status.d.ts +1 -1
- package/dist/components/order-view/general-information/index.d.ts +1 -1
- package/dist/components/order-view/index.d.ts +1 -1
- package/dist/components/order-view/notes/AddNote.d.ts +1 -0
- package/dist/components/order-view/notes/order-dropdown/NewReturnDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.d.ts +4 -1
- package/dist/components/order-view/order-actions/actions/confirm-order/index.d.ts +4 -1
- package/dist/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/Selector.d.ts +11 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.d.ts +8 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/escalation/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/notifications/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.d.ts +7 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/index.d.ts +4 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.d.ts +3 -0
- package/dist/components/order-view/order-actions/actions/force-debrief/styles.d.ts +8 -0
- package/dist/components/order-view/order-actions/actions/hold-order/HoldOrderModal.d.ts +1 -0
- package/dist/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.d.ts +1 -1
- package/dist/components/order-view/order-actions/actions/unhold-order/UnholdOrder.d.ts +1 -0
- package/dist/components/order-view/order-actions/types.d.ts +3 -3
- package/dist/components/order-view/order-details/expanded-content/index.d.ts +1 -1
- package/dist/components/order-view/order-details/index.d.ts +1 -1
- package/dist/components/order-view/order-resources/expanded-content/index.d.ts +1 -1
- package/dist/components/order-view/products-info/expanded-content/index.d.ts +6 -1
- package/dist/components/order-view/products-info/index.d.ts +1 -1
- package/dist/components/order-view/return-client-products/ProductTable.d.ts +6 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +6 -1
- package/dist/components/order-view/store.d.ts +15 -3
- package/dist/components/order-view/system-event-logs/expanded-content/index.d.ts +1 -1
- package/dist/components/order-view/types.d.ts +55 -1
- package/dist/components/order-view/utils.d.ts +11 -2
- package/dist/components/store.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +7157 -4661
- 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 +7173 -4677
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +6 -4
- package/src/assets/icons/ActionIcon.tsx +1 -1
- package/src/assets/icons/ArrowDownIcon.tsx +2 -2
- package/src/components/client-portal/DateFilterStore.ts +139 -0
- package/src/components/client-portal/OutstandingTable.tsx +16 -72
- package/src/components/client-portal/ReturnAfterSearchBar.tsx +42 -87
- package/src/components/client-portal/ReturnOverview.tsx +11 -2
- package/src/components/client-portal/ReturnRTFilters.tsx +140 -43
- package/src/components/client-portal/ReturnSearchBar.tsx +42 -153
- package/src/components/client-portal/ReturnStatus.tsx +33 -82
- package/src/components/client-portal/return-confirm/ConfirmedMain.tsx +12 -23
- package/src/components/client-portal/return-confirm/ReturnConfirmedTable.tsx +9 -86
- package/src/components/order-daily-overview/header/route-header/ClientRouterHeader.tsx +166 -0
- package/src/components/order-daily-overview/header/route-header/RouterHeader.tsx +2 -86
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +46 -15
- package/src/components/order-daily-overview/index.tsx +23 -4
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +6 -1
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +3 -0
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +36 -36
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +12 -2
- package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +16 -0
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +25 -11
- package/src/components/order-daily-overview/table/ReturnTable.tsx +8 -4
- package/src/components/order-view/DynamicTable.tsx +21 -8
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/DropDowns.tsx +1 -1
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +9 -0
- package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
- package/src/components/order-view/flags-action-modal/Dropdowns.tsx +2 -0
- package/src/components/order-view/general-information/Status.tsx +92 -18
- package/src/components/order-view/general-information/index.tsx +2 -2
- package/src/components/order-view/generic-table/AuditLogs.tsx +39 -12
- package/src/components/order-view/index.tsx +50 -8
- package/src/components/order-view/modalsPopup/ModalManager.tsx +1 -1
- package/src/components/order-view/notes/AddNote.tsx +95 -65
- package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
- package/src/components/order-view/notification/FlagTemplate.tsx +21 -10
- package/src/components/order-view/notification/OrderTemplate.tsx +192 -41
- package/src/components/order-view/notification/ReminderTemplate.tsx +28 -13
- package/src/components/order-view/notification/index.tsx +100 -55
- package/src/components/order-view/order-actions/actions/add-resources/DocFileUpload.tsx +92 -72
- package/src/components/order-view/order-actions/actions/add-resources/index.tsx +27 -10
- package/src/components/order-view/order-actions/actions/cancel-order/ReturnAction.tsx +25 -4
- package/src/components/order-view/order-actions/actions/cancel-order/ReturnReason.tsx +24 -4
- package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx +9 -2
- package/src/components/order-view/order-actions/actions/confirm-order/index.tsx +12 -35
- package/src/components/order-view/order-actions/actions/confirm-order/tables/NotesTable.tsx +1 -0
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx +88 -30
- package/src/components/order-view/order-actions/actions/create-task-reminder/CreateTaskModal.tsx +5 -3
- package/src/components/order-view/order-actions/actions/create-task-reminder/TaskModal.tsx +2 -2
- package/src/components/order-view/order-actions/actions/force-debrief/BaseChargeConfirmationModal.tsx +94 -0
- package/src/components/order-view/order-actions/actions/force-debrief/ForceDebriefModal.tsx +635 -0
- package/src/components/order-view/order-actions/actions/force-debrief/Selector.tsx +65 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/adhoc/index.tsx +94 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/base-charge/index.tsx +106 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/collection-add-ons/index.tsx +77 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/delivery-add-ons/index.tsx +78 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/disposal-charges/index.tsx +77 -0
- package/src/components/order-view/order-actions/actions/force-debrief/charges/order-charges/index.tsx +124 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationCategory.tsx +92 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationLevel.tsx +90 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/EscalationReason.tsx +122 -0
- package/src/components/order-view/order-actions/actions/force-debrief/escalation/index.tsx +16 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/FlagsTemplate.tsx +46 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/OrderTemplate.tsx +117 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/Tabs.tsx +32 -0
- package/src/components/order-view/order-actions/actions/force-debrief/notifications/index.tsx +180 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/RadioButtons.tsx +150 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/CancellationReasonDropdown.tsx +40 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/FailureReasonDropdown.tsx +108 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/OrderHoldReasonDropdown.tsx +37 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/StatusDropdown.tsx +48 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/dropdowns/ZoneDropdown.tsx +27 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/failure-content/index.tsx +187 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/index.tsx +55 -0
- package/src/components/order-view/order-actions/actions/force-debrief/order-info/success-content/index.tsx +221 -0
- package/src/components/order-view/order-actions/actions/force-debrief/styles.tsx +51 -0
- package/src/components/order-view/order-actions/actions/hold-order/HoldOrderModal.tsx +2 -0
- package/src/components/order-view/order-actions/actions/remove-from-route/RemoveFromRoute.tsx +7 -2
- package/src/components/order-view/order-actions/actions/unhold-order/UnholdOrder.tsx +2 -0
- package/src/components/order-view/order-actions/index.tsx +19 -10
- package/src/components/order-view/order-actions/store.ts +1 -1
- package/src/components/order-view/order-actions/types.ts +3 -3
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactHome.tsx +102 -45
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactMobile.tsx +93 -34
- package/src/components/order-view/order-details/expanded-content/customer-section/contact-info/ContactWork.tsx +88 -31
- package/src/components/order-view/order-details/expanded-content/footer/index.tsx +55 -80
- package/src/components/order-view/order-details/expanded-content/index.tsx +37 -16
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +1 -1
- package/src/components/order-view/order-details/expanded-content/services-section/AssemblyType.tsx +9 -91
- package/src/components/order-view/order-details/expanded-content/services-section/OrderServices.tsx +10 -182
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +3 -4
- package/src/components/order-view/order-details/index.tsx +5 -2
- package/src/components/order-view/order-resources/expanded-content/index.tsx +2 -2
- package/src/components/order-view/products-info/expanded-content/index.tsx +33 -11
- package/src/components/order-view/products-info/index.tsx +10 -6
- package/src/components/order-view/return-client-products/ProductTable.tsx +12 -2
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +73 -23
- package/src/components/order-view/store.ts +113 -1
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +6 -2
- package/src/components/order-view/types.ts +60 -1
- package/src/components/order-view/utils.ts +49 -33
- package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +85 -26
- package/src/components/order-view/view-reminder/ViewReminder.tsx +31 -14
- package/src/components/store.ts +2 -2
- package/src/index.tsx +23 -5
- package/dist/components/order-view/order-actions/actions/log-service-refusal/DeliveryPoint.d.ts +0 -7
- package/dist/components/order-view/order-actions/actions/log-service-refusal/Notes.d.ts +0 -7
- package/dist/components/order-view/order-actions/actions/log-service-refusal/OrderServices.d.ts +0 -7
- package/dist/components/order-view/order-actions/actions/log-service-refusal/helper.d.ts +0 -3
- package/dist/components/order-view/order-actions/actions/log-service-refusal/index.d.ts +0 -3
- package/src/components/order-view/order-actions/actions/log-service-refusal/DeliveryPoint.tsx +0 -50
- package/src/components/order-view/order-actions/actions/log-service-refusal/Notes.tsx +0 -50
- package/src/components/order-view/order-actions/actions/log-service-refusal/OrderServices.tsx +0 -57
- package/src/components/order-view/order-actions/actions/log-service-refusal/helper.ts +0 -26
- package/src/components/order-view/order-actions/actions/log-service-refusal/index.tsx +0 -130
|
@@ -6,9 +6,12 @@ import {
|
|
|
6
6
|
} from './store/store';
|
|
7
7
|
import Filters from './filters/Filters';
|
|
8
8
|
import styled from 'styled-components';
|
|
9
|
-
import { useCustomerData, useStickyStatus } from '../store';
|
|
9
|
+
import { useClientPortal, useCustomerData, useStickyStatus } from '../store';
|
|
10
10
|
import HeaderFilter from './header-filters/HeaderFilter';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
DocumentTitle,
|
|
13
|
+
useAxios,
|
|
14
|
+
} from '@bjsdistribution/dms-component-library';
|
|
12
15
|
import { useAtom, useClientData } from '../order-view/store';
|
|
13
16
|
import { ClientData } from './common/interface';
|
|
14
17
|
import ReturnFilter from './return-order-table/return-orders-filters/ReturnFilter';
|
|
@@ -33,6 +36,7 @@ function ReturnMainTable() {
|
|
|
33
36
|
const [, setCustomers] = useCustomerData();
|
|
34
37
|
// const [tableName] = useTableName();
|
|
35
38
|
const queryParams = new URLSearchParams(location.search);
|
|
39
|
+
const [clientPortal] = useClientPortal();
|
|
36
40
|
|
|
37
41
|
const customerId = queryParams.get('customerId');
|
|
38
42
|
|
|
@@ -44,15 +48,22 @@ function ReturnMainTable() {
|
|
|
44
48
|
};
|
|
45
49
|
|
|
46
50
|
//API for client data
|
|
47
|
-
const { data: fetchedCustomerData, loading: loading } =
|
|
51
|
+
const { data: fetchedCustomerData, loading: loading, fetchData } = useAxios<
|
|
48
52
|
ApiResponse
|
|
49
53
|
>({
|
|
50
54
|
endpoint: `/v1/return/product/customers/`,
|
|
51
55
|
method: 'GET',
|
|
52
56
|
//@ts-ignore
|
|
53
57
|
pagination: { is_pagination: false },
|
|
58
|
+
showLoader: false,
|
|
54
59
|
});
|
|
55
60
|
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
if (!clientPortal && clientPortal !== undefined) {
|
|
63
|
+
fetchData();
|
|
64
|
+
}
|
|
65
|
+
}, []);
|
|
66
|
+
|
|
56
67
|
useEffect(() => {
|
|
57
68
|
if (fetchedCustomerData && fetchedCustomerData?.data) {
|
|
58
69
|
setCustomers(fetchedCustomerData?.data);
|
|
@@ -63,7 +74,8 @@ function ReturnMainTable() {
|
|
|
63
74
|
data: fetchedClientData,
|
|
64
75
|
loading: statsDataLoading,
|
|
65
76
|
paginationData,
|
|
66
|
-
|
|
77
|
+
fetchData: fetchProductStats,
|
|
78
|
+
} = useAxios<{
|
|
67
79
|
data: ClientData[];
|
|
68
80
|
}>({
|
|
69
81
|
endpoint: `/v1/return/product/stats/`,
|
|
@@ -71,7 +83,13 @@ function ReturnMainTable() {
|
|
|
71
83
|
//@ts-ignore
|
|
72
84
|
pagination: pagination,
|
|
73
85
|
filters: filters,
|
|
86
|
+
showLoader: false,
|
|
74
87
|
});
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (!clientPortal && clientPortal !== undefined) {
|
|
90
|
+
fetchProductStats();
|
|
91
|
+
}
|
|
92
|
+
}, []);
|
|
75
93
|
|
|
76
94
|
useEffect(() => {
|
|
77
95
|
setLoading(statsDataLoading);
|
|
@@ -95,6 +113,7 @@ function ReturnMainTable() {
|
|
|
95
113
|
|
|
96
114
|
return (
|
|
97
115
|
<>
|
|
116
|
+
<DocumentTitle title="Client Return Products" />
|
|
98
117
|
<DashBoardWrapper className={` ${isScrolled ? 'stickyTableHead' : ''}`}>
|
|
99
118
|
{/* <RouterHeader /> */}
|
|
100
119
|
<div className="Tableconatiner">
|
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
UsePaginationReturnData,
|
|
11
11
|
} from '../store/store';
|
|
12
12
|
import { ApiResponse } from '../common/interface';
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
DocumentTitle,
|
|
15
|
+
useApiHook,
|
|
16
|
+
} from '@bjsdistribution/dms-component-library';
|
|
14
17
|
import { filtersReducerReturnAtom } from './table-filters/ReturnFilterStore';
|
|
15
18
|
import { notification } from 'antd';
|
|
16
19
|
import ReturnPagination from '../table-view/ReturnPagination';
|
|
@@ -47,6 +50,7 @@ const ReturnAfterTable = () => {
|
|
|
47
50
|
filters: filters && filters?.length > 0 ? filters : undefined,
|
|
48
51
|
pagination: pagination,
|
|
49
52
|
performAction: false,
|
|
53
|
+
showLoader: false,
|
|
50
54
|
});
|
|
51
55
|
|
|
52
56
|
useEffect(() => {
|
|
@@ -79,6 +83,7 @@ const ReturnAfterTable = () => {
|
|
|
79
83
|
|
|
80
84
|
return (
|
|
81
85
|
<div>
|
|
86
|
+
<DocumentTitle title="Return Order List" />
|
|
82
87
|
<DashBoardWrapper>
|
|
83
88
|
{/* <RouterHeader /> */}
|
|
84
89
|
<div className="Tableconatiner">
|
|
@@ -239,6 +239,7 @@ const OrderTable = () => {
|
|
|
239
239
|
<th>Consignment</th>
|
|
240
240
|
<th>Return Order No</th>
|
|
241
241
|
<th> Total Parts</th>
|
|
242
|
+
<th> Total Orders</th>
|
|
242
243
|
<th onClick={() => handleSort('weight')}>
|
|
243
244
|
<div className="sortIconClass">
|
|
244
245
|
Total Weight {renderSortIcon('weight')}
|
|
@@ -328,6 +329,8 @@ const OrderTable = () => {
|
|
|
328
329
|
<td>{displayValueOrNA(item?.order_number)}</td>
|
|
329
330
|
|
|
330
331
|
<td>{displayValueOrNA(item?.total_products)}</td>
|
|
332
|
+
<td>{displayValueOrNA(item?.total_orders)}</td>
|
|
333
|
+
|
|
331
334
|
<td>
|
|
332
335
|
{displayValueOrNA(item?.weight)}{' '}
|
|
333
336
|
{item?.weight && item?.weight > 0 ? 'KG' : ''}
|
package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts
CHANGED
|
@@ -171,46 +171,46 @@ const filterReducer = (state: FilterState, action: any): FilterState => {
|
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
//client portal
|
|
174
|
-
case 'SET_CP_DATE_FILTER': {
|
|
175
|
-
|
|
174
|
+
// case 'SET_CP_DATE_FILTER': {
|
|
175
|
+
// let { startDate, endDate } = action.payload;
|
|
176
176
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
177
|
+
// if (!startDate || !endDate) {
|
|
178
|
+
// const storedDates = JSON.parse(
|
|
179
|
+
// localStorage.getItem('returnDate') || '{}'
|
|
180
|
+
// );
|
|
181
|
+
// startDate = startDate ?? storedDates?.startDate;
|
|
182
|
+
// endDate = endDate ?? storedDates?.endDate ?? startDate;
|
|
183
|
+
// }
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
// const filters = state['x-filters'].filter(f => f.field !== 'created_at');
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
187
|
+
// if (startDate === endDate) {
|
|
188
|
+
// filters.push({
|
|
189
|
+
// field: 'created_at',
|
|
190
|
+
// op: '=',
|
|
191
|
+
// value: format(new Date(startDate), 'yyyy-MM-dd'),
|
|
192
|
+
// });
|
|
193
|
+
// } else if (startDate && endDate) {
|
|
194
|
+
// filters.push(
|
|
195
|
+
// {
|
|
196
|
+
// field: 'created_at',
|
|
197
|
+
// op: '>=',
|
|
198
|
+
// value: format(new Date(startDate), 'yyyy-MM-dd'),
|
|
199
|
+
// },
|
|
200
|
+
// {
|
|
201
|
+
// field: 'created_at',
|
|
202
|
+
// op: '<=',
|
|
203
|
+
// value: format(new Date(endDate), 'yyyy-MM-dd'),
|
|
204
|
+
// }
|
|
205
|
+
// );
|
|
206
|
+
// }
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
208
|
+
// return {
|
|
209
|
+
// ...state,
|
|
210
|
+
// 'x-filters': filters,
|
|
211
|
+
// 'x-pagination': { ...state['x-pagination'], page: 1 },
|
|
212
|
+
// };
|
|
213
|
+
// }
|
|
214
214
|
// case 'CLEAR_CLIENT':
|
|
215
215
|
// return {
|
|
216
216
|
// ...state,
|
package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx
CHANGED
|
@@ -209,7 +209,7 @@ const ReturnOrderFilter = () => {
|
|
|
209
209
|
className="custom-select"
|
|
210
210
|
placeholder="Status of Order"
|
|
211
211
|
onChange={handleStatusOfOrder}
|
|
212
|
-
style={{ minWidth: '
|
|
212
|
+
style={{ minWidth: '250px', maxWidth: '300px' }}
|
|
213
213
|
value={statusOrder}
|
|
214
214
|
onClear={handleClear}
|
|
215
215
|
allowClear
|
|
@@ -227,9 +227,19 @@ const ReturnOrderFilter = () => {
|
|
|
227
227
|
placeholder="Clients"
|
|
228
228
|
onChange={handleClientChange}
|
|
229
229
|
value={selectedClient}
|
|
230
|
-
style={{
|
|
230
|
+
style={{
|
|
231
|
+
minWidth: '150px',
|
|
232
|
+
width: 'auto',
|
|
233
|
+
cursor: 'pointer',
|
|
234
|
+
}}
|
|
231
235
|
allowClear
|
|
232
236
|
onClear={handleClearClient}
|
|
237
|
+
filterOption={(input: any, option: any) =>
|
|
238
|
+
(option?.label ?? '')
|
|
239
|
+
.toLowerCase()
|
|
240
|
+
.includes(input.toLowerCase())
|
|
241
|
+
}
|
|
242
|
+
showSearch
|
|
233
243
|
/>
|
|
234
244
|
</StyledAntSelect>
|
|
235
245
|
</div>
|
|
@@ -8,12 +8,15 @@ import ReturnOrderTable from './return-orders-filters/ReturnOrderTable';
|
|
|
8
8
|
import ModalManager from '../../order-view/modalsPopup/ModalManager';
|
|
9
9
|
import { useItemsPerPage, UsePaginationData } from '../store/store';
|
|
10
10
|
import Pagination from '../table-view/Pagination';
|
|
11
|
+
import { useCustomerData } from '../../store';
|
|
12
|
+
import { DocumentTitle } from '@bjsdistribution/dms-component-library';
|
|
11
13
|
// import { useLocation } from 'react-router-dom';
|
|
12
14
|
|
|
13
15
|
const ReturnTable = () => {
|
|
14
16
|
const [paginationObj] = UsePaginationData();
|
|
15
17
|
const [, setCurrentPage] = useState(1);
|
|
16
18
|
const [itemsPerPage, setItemsPerPage] = useItemsPerPage();
|
|
19
|
+
const [customers] = useCustomerData();
|
|
17
20
|
// const location = useLocation();
|
|
18
21
|
const { page, total } = paginationObj;
|
|
19
22
|
|
|
@@ -30,10 +33,23 @@ const ReturnTable = () => {
|
|
|
30
33
|
// const clientId = queryParams.get('customerId');
|
|
31
34
|
// }, [location]);
|
|
32
35
|
|
|
36
|
+
const queryParams = new URLSearchParams(location.search);
|
|
37
|
+
|
|
38
|
+
const customerId = queryParams.get('customerId');
|
|
39
|
+
|
|
40
|
+
const selectedCustomer = customers?.find(
|
|
41
|
+
(customer: any) => customer?.customer_id?.toString() === customerId
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const customerName = selectedCustomer?.customer_name;
|
|
45
|
+
|
|
46
|
+
const docTitle = `${customerName}: Return Product`;
|
|
47
|
+
|
|
33
48
|
return (
|
|
34
49
|
<div>
|
|
35
50
|
<DashBoardWrapper>
|
|
36
51
|
{/* <RouterHeader /> */}
|
|
52
|
+
<DocumentTitle title={docTitle} />
|
|
37
53
|
<div className="Tableconatiner">
|
|
38
54
|
<HeaderFilter />
|
|
39
55
|
<Container>
|
|
@@ -10,6 +10,7 @@ import SortIcon from '../../../../common/SortIcon';
|
|
|
10
10
|
import PrintDropDownReturn from '../../../order-view/details-filters/left-side-filters/dropdowns/PrintDropDownReturn';
|
|
11
11
|
import { usefetchAgain, useReturnData } from '../../../order-view/store';
|
|
12
12
|
import {
|
|
13
|
+
useCustomerData,
|
|
13
14
|
useGroupedPayload,
|
|
14
15
|
useLocationData,
|
|
15
16
|
useNewReturnPayload,
|
|
@@ -27,7 +28,7 @@ import {
|
|
|
27
28
|
} from '../../store/store';
|
|
28
29
|
import { EmptyDataContainer } from '../../table/table-data/styles';
|
|
29
30
|
import { CustomDrop, StyledTable, StyledTableWrapper } from './returnstyles';
|
|
30
|
-
import { NavLink } from 'react-router-dom';
|
|
31
|
+
import { NavLink, useSearchParams } from 'react-router-dom';
|
|
31
32
|
|
|
32
33
|
const ReturnOrderTable = () => {
|
|
33
34
|
const [state] = useAtom(filtersReducerAtom);
|
|
@@ -39,13 +40,14 @@ const ReturnOrderTable = () => {
|
|
|
39
40
|
const dropdownRefParent = useRef<HTMLDivElement>(null);
|
|
40
41
|
const dropdownRef = useRef<HTMLDivElement>(null);
|
|
41
42
|
const [printToogle, setPrintToggle] = usePrintOptionTOggle();
|
|
42
|
-
const [
|
|
43
|
+
const [, setReturnPayload] = useReturnPayload();
|
|
43
44
|
const [newpayload, setNewPayload] = useNewReturnPayload();
|
|
44
45
|
const [, setGrouped] = useGroupedPayload();
|
|
45
46
|
const [locationData] = useLocationData();
|
|
46
47
|
const [, setPaginationObject] = UsePaginationData();
|
|
47
48
|
const [callForFetch] = usefetchAgain();
|
|
48
|
-
|
|
49
|
+
const [searchParams] = useSearchParams();
|
|
50
|
+
const urlCustomerId = searchParams.get('customerId');
|
|
49
51
|
//sorting
|
|
50
52
|
const [sortConfig, setSortConfig] = useState<{
|
|
51
53
|
key: string;
|
|
@@ -122,6 +124,7 @@ const ReturnOrderTable = () => {
|
|
|
122
124
|
filters: filters,
|
|
123
125
|
pagination: pagination,
|
|
124
126
|
performAction: false,
|
|
127
|
+
showLoader: false,
|
|
125
128
|
});
|
|
126
129
|
|
|
127
130
|
useEffect(() => {
|
|
@@ -168,7 +171,15 @@ const ReturnOrderTable = () => {
|
|
|
168
171
|
}
|
|
169
172
|
// setShouldPerformAction(false);
|
|
170
173
|
}, [fetchedOrderData, returnDataLoad, locationData, state, callForFetch]);
|
|
174
|
+
const [customers] = useCustomerData();
|
|
175
|
+
|
|
176
|
+
const selectedCustomer = customers?.find((customer: any) => {
|
|
177
|
+
const customerId = customer?.customer_id?.toString();
|
|
178
|
+
return customerId && customerId === urlCustomerId;
|
|
179
|
+
});
|
|
171
180
|
|
|
181
|
+
const accountNumber = selectedCustomer?.account_number;
|
|
182
|
+
console.log(selectedCustomer, 'selectedCustomer');
|
|
172
183
|
const handleSelectAll = (e: any) => {
|
|
173
184
|
const isChecked = e.target.checked;
|
|
174
185
|
setSelectAll(isChecked);
|
|
@@ -187,8 +198,8 @@ const ReturnOrderTable = () => {
|
|
|
187
198
|
}));
|
|
188
199
|
const newPayload = filteredData.map((loc: any) => ({
|
|
189
200
|
id: loc.id,
|
|
190
|
-
account_number:
|
|
191
|
-
customer_id:
|
|
201
|
+
account_number: accountNumber,
|
|
202
|
+
customer_id: Number(urlCustomerId),
|
|
192
203
|
products: [loc?.legacy_product_id],
|
|
193
204
|
return_action: loc?.product_return_action,
|
|
194
205
|
return_location_token: loc?.return_location || null,
|
|
@@ -214,7 +225,6 @@ const ReturnOrderTable = () => {
|
|
|
214
225
|
const isSelected = prevSelectedLocations?.some(
|
|
215
226
|
(loc: any) => loc.id === id
|
|
216
227
|
);
|
|
217
|
-
|
|
218
228
|
if (isSelected) {
|
|
219
229
|
const updatedSelectedLocations = prevSelectedLocations.filter(
|
|
220
230
|
(loc: any) => loc.id !== id
|
|
@@ -237,8 +247,8 @@ const ReturnOrderTable = () => {
|
|
|
237
247
|
} else {
|
|
238
248
|
const newReturnPayload = {
|
|
239
249
|
id,
|
|
240
|
-
account_number:
|
|
241
|
-
customer_id:
|
|
250
|
+
account_number: accountNumber,
|
|
251
|
+
customer_id: Number(urlCustomerId),
|
|
242
252
|
products: [legacy_product_id],
|
|
243
253
|
return_action: product_return_action || null,
|
|
244
254
|
return_location_token: return_location || null,
|
|
@@ -299,7 +309,6 @@ const ReturnOrderTable = () => {
|
|
|
299
309
|
const mergedPayload = Object.values(groupedPayload);
|
|
300
310
|
setGrouped(mergedPayload);
|
|
301
311
|
}, [newpayload]);
|
|
302
|
-
|
|
303
312
|
return (
|
|
304
313
|
<>
|
|
305
314
|
<StyledTableWrapper className="fortables">
|
|
@@ -310,7 +319,10 @@ const ReturnOrderTable = () => {
|
|
|
310
319
|
<Checkbox checked={selectAll} onChange={handleSelectAll} />
|
|
311
320
|
</th> */}
|
|
312
321
|
{returnData?.some(
|
|
313
|
-
(item: any) =>
|
|
322
|
+
(item: any) =>
|
|
323
|
+
item?.product_return_action === 'RTS' &&
|
|
324
|
+
item?.return_location !== 'null' &&
|
|
325
|
+
item?.return_location !== null
|
|
314
326
|
) ? (
|
|
315
327
|
<th className="emailInvoiceCheckbox">
|
|
316
328
|
<Checkbox checked={selectAll} onChange={handleSelectAll} />
|
|
@@ -376,7 +388,9 @@ const ReturnOrderTable = () => {
|
|
|
376
388
|
sortedData?.map((item: any, index: any) => (
|
|
377
389
|
<tr key={item.id}>
|
|
378
390
|
<td>
|
|
379
|
-
{item?.product_return_action === 'RTS'
|
|
391
|
+
{item?.product_return_action === 'RTS' &&
|
|
392
|
+
item?.return_location !== 'null' &&
|
|
393
|
+
item?.return_location !== null ? (
|
|
380
394
|
<Checkbox
|
|
381
395
|
className="custom-check"
|
|
382
396
|
checked={selectedReturnOrder.some(
|
|
@@ -108,7 +108,6 @@ const ReturnTable: React.FC = () => {
|
|
|
108
108
|
customerId: customerId?.toString(),
|
|
109
109
|
});
|
|
110
110
|
//for dev
|
|
111
|
-
//navigate(`filter?${queryParams.toString()}`);
|
|
112
111
|
navigate(`/orders/view/return/filter?${queryParams.toString()}`);
|
|
113
112
|
|
|
114
113
|
//for local
|
|
@@ -138,7 +137,6 @@ const ReturnTable: React.FC = () => {
|
|
|
138
137
|
type: RTS,
|
|
139
138
|
});
|
|
140
139
|
//for dev
|
|
141
|
-
//navigate(`filter?${queryParams.toString()}`);
|
|
142
140
|
navigate(`/orders/view/return/filter?${queryParams.toString()}`);
|
|
143
141
|
|
|
144
142
|
//for local
|
|
@@ -158,6 +156,7 @@ const ReturnTable: React.FC = () => {
|
|
|
158
156
|
{ label: 'Products', key: 'return_order_products' },
|
|
159
157
|
{ label: 'RTS', key: 'RTS' },
|
|
160
158
|
{ label: 'Pending', key: 'PENDING' },
|
|
159
|
+
{ label: 'Claims Paid', key: 'CLAIMS PAID' },
|
|
161
160
|
{ label: 'Dispose', key: 'DISPOSE' },
|
|
162
161
|
{ label: 'Re-allocate', key: 'RE-ALLOCATE' },
|
|
163
162
|
{ label: 'Re-Del', key: 'RE-DEL' },
|
|
@@ -175,13 +174,13 @@ const ReturnTable: React.FC = () => {
|
|
|
175
174
|
<tbody>
|
|
176
175
|
{statsLoading ? (
|
|
177
176
|
<tr>
|
|
178
|
-
<td colSpan={
|
|
177
|
+
<td colSpan={12}>
|
|
179
178
|
<Skeleton active />
|
|
180
179
|
</td>
|
|
181
180
|
</tr>
|
|
182
181
|
) : sortedData?.length === 0 ? (
|
|
183
182
|
<tr>
|
|
184
|
-
<td colSpan={
|
|
183
|
+
<td colSpan={12}>
|
|
185
184
|
<EmptyDataContainer>
|
|
186
185
|
<Empty />
|
|
187
186
|
</EmptyDataContainer>
|
|
@@ -249,6 +248,11 @@ const ReturnTable: React.FC = () => {
|
|
|
249
248
|
<GreyBox>{key?.PENDING}</GreyBox>
|
|
250
249
|
</ColumStyle>
|
|
251
250
|
</td>
|
|
251
|
+
<td>
|
|
252
|
+
<ColumStyle>
|
|
253
|
+
<GreyBox>{key?.['CLAIMS PAID']}</GreyBox>
|
|
254
|
+
</ColumStyle>
|
|
255
|
+
</td>
|
|
252
256
|
<td>
|
|
253
257
|
<ColumStyle>
|
|
254
258
|
<GreyBox>{key?.DISPOSE}</GreyBox>
|
|
@@ -8,14 +8,19 @@ import React, { useMemo } from 'react';
|
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
import CustomScrollBar from '../../common/scrollbar';
|
|
10
10
|
import { atom, useAtom } from 'jotai';
|
|
11
|
+
import { Skeleton } from 'antd';
|
|
11
12
|
export const selectedID = atom<any>([]);
|
|
12
13
|
|
|
13
14
|
interface DynamicTableProps {
|
|
14
15
|
columns: any;
|
|
15
16
|
data: any[];
|
|
17
|
+
loading: boolean;
|
|
16
18
|
}
|
|
17
19
|
|
|
18
|
-
function DynamicTable(
|
|
20
|
+
function DynamicTable(
|
|
21
|
+
{ columns, data, loading }: DynamicTableProps,
|
|
22
|
+
props: any
|
|
23
|
+
) {
|
|
19
24
|
const tableColumns = useMemo(() => columns, [columns]);
|
|
20
25
|
const tableData = useMemo(() => data, [data]);
|
|
21
26
|
|
|
@@ -44,6 +49,8 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
|
|
|
44
49
|
const largeColumns = ['details', 'datetime'];
|
|
45
50
|
const noFlexColumns = ['id'];
|
|
46
51
|
|
|
52
|
+
console.log(rows, '<===========rows');
|
|
53
|
+
console.log(props, 'props');
|
|
47
54
|
return (
|
|
48
55
|
<MainContainer>
|
|
49
56
|
<Container>
|
|
@@ -78,7 +85,19 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
|
|
|
78
85
|
))}
|
|
79
86
|
</TableHead>
|
|
80
87
|
<TableBody>
|
|
81
|
-
{
|
|
88
|
+
{loading ? (
|
|
89
|
+
<tr>
|
|
90
|
+
<td colSpan={5}>
|
|
91
|
+
<Skeleton active />
|
|
92
|
+
</td>
|
|
93
|
+
</tr>
|
|
94
|
+
) : rows?.length === 0 ? (
|
|
95
|
+
<TableRow>
|
|
96
|
+
<TableData colSpan={columns.length}>
|
|
97
|
+
No entries found.
|
|
98
|
+
</TableData>
|
|
99
|
+
</TableRow>
|
|
100
|
+
) : (
|
|
82
101
|
rows?.map(row => (
|
|
83
102
|
<TableRow
|
|
84
103
|
key={row.id}
|
|
@@ -115,12 +134,6 @@ function DynamicTable({ columns, data }: DynamicTableProps, props: any) {
|
|
|
115
134
|
))}
|
|
116
135
|
</TableRow>
|
|
117
136
|
))
|
|
118
|
-
) : (
|
|
119
|
-
<TableRow>
|
|
120
|
-
<TableData colSpan={columns.length}>
|
|
121
|
-
No entries found.
|
|
122
|
-
</TableData>
|
|
123
|
-
</TableRow>
|
|
124
137
|
)}
|
|
125
138
|
</TableBody>
|
|
126
139
|
</Table>
|
package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx
CHANGED
|
@@ -40,6 +40,7 @@ function Options() {
|
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
const isReleased = orderStatus[0]?.released;
|
|
43
|
+
// const routedValue = orderStatus[0]?.routed;
|
|
43
44
|
const isRouted = orderStatus[0]?.routed && orderDetails?.order_routes?.id;
|
|
44
45
|
const isOrderOnHold = orderDetails?.status === 'OO';
|
|
45
46
|
const isOrderCancelled = orderDetails?.status === 'CO';
|
|
@@ -73,6 +74,14 @@ function Options() {
|
|
|
73
74
|
shouldExclude = true;
|
|
74
75
|
}
|
|
75
76
|
|
|
77
|
+
if (isRouted && option.value === 'clear-date') {
|
|
78
|
+
shouldExclude = true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// if (routedValue && option.value === 'remove-from-route') {
|
|
82
|
+
// shouldExclude = true;
|
|
83
|
+
// }
|
|
84
|
+
|
|
76
85
|
return !shouldExclude;
|
|
77
86
|
});
|
|
78
87
|
|
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import { useCustomerInfo } from '../../store';
|
|
3
|
+
import { useCustomerInfo, useGlobalEscData } from '../../store';
|
|
4
4
|
|
|
5
5
|
const Details = () => {
|
|
6
6
|
// const [orderDetails] = useOrderDetails();
|
|
7
7
|
const [customerInfo] = useCustomerInfo();
|
|
8
8
|
const recipient = customerInfo?.recipient_name || '';
|
|
9
9
|
const postcodeShow = customerInfo?.postcode || '';
|
|
10
|
+
const [globalEscData] = useGlobalEscData();
|
|
10
11
|
|
|
11
12
|
return (
|
|
12
13
|
<DetailsContainer>
|
|
13
14
|
<Typo>
|
|
14
|
-
CUSTOMER RETURN - {recipient} , {postcodeShow}
|
|
15
|
+
CUSTOMER RETURN - {recipient} , {postcodeShow} {}
|
|
16
|
+
{globalEscData?.length > 0 && (
|
|
17
|
+
<EscInfo>
|
|
18
|
+
{`${globalEscData[0]?.escalation_type?.level} (${globalEscData[0]?.escalation_type?.name})`}
|
|
19
|
+
</EscInfo>
|
|
20
|
+
)}
|
|
15
21
|
</Typo>
|
|
16
22
|
</DetailsContainer>
|
|
17
23
|
);
|
|
@@ -27,10 +33,14 @@ const DetailsContainer = styled.div`
|
|
|
27
33
|
`;
|
|
28
34
|
|
|
29
35
|
const Typo = styled.div`
|
|
36
|
+
display: flex;
|
|
37
|
+
flex-direction: row;
|
|
38
|
+
gap: 15px;
|
|
39
|
+
align-items: center;
|
|
30
40
|
font-size: 20px;
|
|
31
41
|
font-style: normal;
|
|
32
42
|
font-weight: 600;
|
|
33
|
-
line-height: 32px;
|
|
43
|
+
line-height: 32px;
|
|
34
44
|
text-transform: uppercase;
|
|
35
45
|
margin: 0;
|
|
36
46
|
padding: 0;
|
|
@@ -40,4 +50,19 @@ const Typo = styled.div`
|
|
|
40
50
|
}
|
|
41
51
|
`;
|
|
42
52
|
|
|
53
|
+
const Name = styled.div`
|
|
54
|
+
/* heading/h3-subHeader */
|
|
55
|
+
font-family: 'Roboto', sans-serif;
|
|
56
|
+
font-size: 20px;
|
|
57
|
+
font-style: normal;
|
|
58
|
+
font-weight: 900;
|
|
59
|
+
line-height: 32px; /* 160% */
|
|
60
|
+
text-transform: uppercase;
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
const EscInfo = styled(Name)`
|
|
64
|
+
color: #6396e5;
|
|
65
|
+
font-size: 16px;
|
|
66
|
+
`;
|
|
67
|
+
|
|
43
68
|
export default Details;
|
|
@@ -75,6 +75,7 @@ function ButtonsSection() {
|
|
|
75
75
|
placeholder="Select Type"
|
|
76
76
|
onChange={handleTaskTypeChange}
|
|
77
77
|
value={selectedTypeId}
|
|
78
|
+
style={{ minWidth: '200px', width: 'auto' }}
|
|
78
79
|
/>
|
|
79
80
|
</Flex>
|
|
80
81
|
<Flex>
|
|
@@ -84,6 +85,7 @@ function ButtonsSection() {
|
|
|
84
85
|
placeholder="Select Type"
|
|
85
86
|
onChange={handlePriorityChange}
|
|
86
87
|
value={taskPayload?.priority || flagById?.priority}
|
|
88
|
+
style={{ minWidth: '100px', width: 'auto' }}
|
|
87
89
|
/>
|
|
88
90
|
</Flex>
|
|
89
91
|
<Flex>
|