@bjsdistribution/dms-client-return 0.1.19-dev → 0.1.19-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/OutstandingTable.d.ts +3 -0
- package/dist/components/client-portal/ReturnRTFilters.d.ts +3 -0
- package/dist/components/client-portal/ReturnStatus.d.ts +5 -0
- package/dist/components/client-portal/return-confirm/ConfirmedMain.d.ts +3 -0
- package/dist/components/client-portal/return-confirm/ReturnConfirmedTable.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 +6 -2
- package/dist/dms-client-return.cjs.development.js +9140 -5835
- 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 +7617 -4312
- 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 +356 -0
- package/src/components/client-portal/ReturnAfterSearchBar.tsx +77 -17
- package/src/components/client-portal/ReturnOverview.tsx +15 -6
- package/src/components/client-portal/ReturnRTFilters.tsx +196 -80
- package/src/components/client-portal/ReturnSearchBar.tsx +64 -94
- package/src/components/client-portal/ReturnStatus.tsx +50 -66
- package/src/components/client-portal/return-confirm/ConfirmedMain.tsx +224 -0
- package/src/components/client-portal/return-confirm/ReturnConfirmedTable.tsx +327 -0
- 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 +23 -38
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +21 -24
- 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 +58 -155
- 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 +25 -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
package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx
CHANGED
|
@@ -6,17 +6,24 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
Checkbox,
|
|
8
8
|
displayValueOrNA,
|
|
9
|
-
|
|
9
|
+
useAxios,
|
|
10
10
|
} from '@bjsdistribution/dms-component-library';
|
|
11
11
|
import ActionIcon from '../../../../assets/icons/ActionIcon';
|
|
12
12
|
import { useOrderId, useProductDetails } from '../../store';
|
|
13
13
|
import { ApiResponse } from '../../types';
|
|
14
|
-
import { notification } from 'antd';
|
|
14
|
+
import { Empty, notification, Skeleton } from 'antd';
|
|
15
15
|
import { useNewReturnOrderData, useSelectedProducts } from '../../../store';
|
|
16
16
|
import styled from 'styled-components';
|
|
17
17
|
import { NavLink } from 'react-router-dom';
|
|
18
|
+
import { EmptyDataContainer } from '../../order-actions/actions/charge-log';
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
interface IPROS {
|
|
21
|
+
callReturnProducts: any;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
locationloading: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const ReturnProductTable = (props: IPROS) => {
|
|
20
27
|
const [selectedProducts, setSelectedProducts] = useSelectedProducts();
|
|
21
28
|
const [selectAll, setSelectAll] = useState(false);
|
|
22
29
|
const [productData, setProductData] = useProductDetails();
|
|
@@ -24,17 +31,16 @@ const ReturnProductTable = () => {
|
|
|
24
31
|
const [orderId] = useOrderId();
|
|
25
32
|
const [returnOrderData] = useNewReturnOrderData();
|
|
26
33
|
|
|
27
|
-
const handleActionClick = (id: number) => {
|
|
28
|
-
|
|
29
|
-
};
|
|
34
|
+
// const handleActionClick = (id: number) => {
|
|
35
|
+
// setSelectedRowId(id);
|
|
36
|
+
// };
|
|
30
37
|
|
|
31
|
-
const { data: isresponse,
|
|
38
|
+
const { data: isresponse, fetchData: callDeleteProduct } = useAxios<{
|
|
32
39
|
data: ApiResponse[];
|
|
33
40
|
}>({
|
|
34
|
-
endpoint: `
|
|
35
|
-
method: '
|
|
36
|
-
body:
|
|
37
|
-
performAction: false,
|
|
41
|
+
endpoint: `v1/return/product/remove/`,
|
|
42
|
+
method: 'POST',
|
|
43
|
+
body: { return_order_product_id: selectedRowId, return_order_id: +orderId },
|
|
38
44
|
});
|
|
39
45
|
|
|
40
46
|
useEffect(() => {
|
|
@@ -56,9 +62,9 @@ const ReturnProductTable = () => {
|
|
|
56
62
|
}
|
|
57
63
|
};
|
|
58
64
|
|
|
59
|
-
const onDeleteProducts = () => {
|
|
60
|
-
|
|
61
|
-
};
|
|
65
|
+
// const onDeleteProducts = () => {
|
|
66
|
+
// callDeleteProduct();
|
|
67
|
+
// };
|
|
62
68
|
|
|
63
69
|
const handleSelectAll = () => {
|
|
64
70
|
if (selectAll) {
|
|
@@ -78,6 +84,43 @@ const ReturnProductTable = () => {
|
|
|
78
84
|
);
|
|
79
85
|
};
|
|
80
86
|
|
|
87
|
+
//delete product API
|
|
88
|
+
const deleteProduct = async (selectedProductId: any) => {
|
|
89
|
+
try {
|
|
90
|
+
const response = (await callDeleteProduct({
|
|
91
|
+
payload: {
|
|
92
|
+
return_order_product_id: selectedProductId,
|
|
93
|
+
return_order_id: +orderId,
|
|
94
|
+
},
|
|
95
|
+
})) as {
|
|
96
|
+
code: number | null;
|
|
97
|
+
error?: string | null;
|
|
98
|
+
data?: any[];
|
|
99
|
+
message?: string;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
if (response?.code === 200) {
|
|
103
|
+
notification.success({
|
|
104
|
+
message: 'Success',
|
|
105
|
+
description: response?.message || 'Product deleted successfully.',
|
|
106
|
+
});
|
|
107
|
+
props?.callReturnProducts();
|
|
108
|
+
} else {
|
|
109
|
+
notification.error({
|
|
110
|
+
message: 'Deletion Failed',
|
|
111
|
+
description: response?.message || 'Could not delete the product.',
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.error('Error deleting product:', error);
|
|
116
|
+
notification.error({
|
|
117
|
+
message: 'Error',
|
|
118
|
+
//@ts-ignore
|
|
119
|
+
description: error?.message || 'An unexpected error occurred.',
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
81
124
|
const disableCheckbox =
|
|
82
125
|
productData?.length == 0 || returnOrderData?.length == 0;
|
|
83
126
|
|
|
@@ -104,7 +147,21 @@ const ReturnProductTable = () => {
|
|
|
104
147
|
</tr>
|
|
105
148
|
</thead>
|
|
106
149
|
<tbody>
|
|
107
|
-
{
|
|
150
|
+
{props?.loading || props?.locationloading ? (
|
|
151
|
+
<tr>
|
|
152
|
+
<td colSpan={14}>
|
|
153
|
+
<Skeleton active />
|
|
154
|
+
</td>
|
|
155
|
+
</tr>
|
|
156
|
+
) : productData?.length === 0 ? (
|
|
157
|
+
<tr>
|
|
158
|
+
<td colSpan={14}>
|
|
159
|
+
<EmptyDataContainer>
|
|
160
|
+
<Empty />
|
|
161
|
+
</EmptyDataContainer>
|
|
162
|
+
</td>
|
|
163
|
+
</tr>
|
|
164
|
+
) : (
|
|
108
165
|
productData?.map((product: any) => (
|
|
109
166
|
<tr key={product.id}>
|
|
110
167
|
<td>
|
|
@@ -140,8 +197,7 @@ const ReturnProductTable = () => {
|
|
|
140
197
|
<td>
|
|
141
198
|
<div
|
|
142
199
|
onClick={() => {
|
|
143
|
-
|
|
144
|
-
onDeleteProducts();
|
|
200
|
+
deleteProduct(product?.id);
|
|
145
201
|
}}
|
|
146
202
|
style={{ cursor: 'pointer' }}
|
|
147
203
|
>
|
|
@@ -150,12 +206,6 @@ const ReturnProductTable = () => {
|
|
|
150
206
|
</td>
|
|
151
207
|
</tr>
|
|
152
208
|
))
|
|
153
|
-
) : (
|
|
154
|
-
<tr>
|
|
155
|
-
<td colSpan={8} style={{ textAlign: 'center' }}>
|
|
156
|
-
No records found
|
|
157
|
-
</td>
|
|
158
|
-
</tr>
|
|
159
209
|
)}
|
|
160
210
|
</tbody>
|
|
161
211
|
</StyledTable>
|
|
@@ -2,6 +2,7 @@ import { atom, useAtom } from 'jotai';
|
|
|
2
2
|
import { atomWithReducer } from 'jotai/utils';
|
|
3
3
|
import {
|
|
4
4
|
CancelOrderProductsType,
|
|
5
|
+
ChargesType,
|
|
5
6
|
CreateProduct,
|
|
6
7
|
OrderActionsType,
|
|
7
8
|
OrdersType,
|
|
@@ -109,6 +110,15 @@ export const ordersInitialValue: OrdersType = {
|
|
|
109
110
|
id: null,
|
|
110
111
|
name: '',
|
|
111
112
|
carrier_id: null,
|
|
113
|
+
order_type: {
|
|
114
|
+
type: null,
|
|
115
|
+
},
|
|
116
|
+
assemble: false,
|
|
117
|
+
disassemble: false,
|
|
118
|
+
unpack_items: false,
|
|
119
|
+
take_packaging_away: false,
|
|
120
|
+
collect_disposal: false,
|
|
121
|
+
assembly_type: null,
|
|
112
122
|
};
|
|
113
123
|
|
|
114
124
|
export const orderProductInitialvalue: CreateProduct = {
|
|
@@ -140,6 +150,42 @@ export const updateOrderProducts: UpdateOrderProduct = {
|
|
|
140
150
|
return_reason_id: 0,
|
|
141
151
|
};
|
|
142
152
|
|
|
153
|
+
//force debrief
|
|
154
|
+
const chargesIntialValue: ChargesType = {
|
|
155
|
+
base_charge_type: 1,
|
|
156
|
+
base_charge: 0,
|
|
157
|
+
weight: 0,
|
|
158
|
+
drop_time: 0,
|
|
159
|
+
timed_service: 0,
|
|
160
|
+
wait_time: 0,
|
|
161
|
+
extra_floor: 0,
|
|
162
|
+
bulky_items: 0,
|
|
163
|
+
re_label: 0,
|
|
164
|
+
extra_cube: 0,
|
|
165
|
+
additional_box: 0,
|
|
166
|
+
additional_item: 0,
|
|
167
|
+
weekend: 0,
|
|
168
|
+
re_allocation: 0,
|
|
169
|
+
pre_dated: 0,
|
|
170
|
+
re_package: 0,
|
|
171
|
+
disassemble: 0,
|
|
172
|
+
qc: 0,
|
|
173
|
+
collection_qc: 0,
|
|
174
|
+
return_to_client: 0,
|
|
175
|
+
roc: 0,
|
|
176
|
+
unpack: 0,
|
|
177
|
+
packaging_disposal: 0,
|
|
178
|
+
assembly: 0,
|
|
179
|
+
debrief_notes: '',
|
|
180
|
+
recycle: 0,
|
|
181
|
+
admin: 0,
|
|
182
|
+
disposal: 0,
|
|
183
|
+
disposal_recycling: 0,
|
|
184
|
+
debrief_status: '',
|
|
185
|
+
new_order_status: '',
|
|
186
|
+
adhoc_charges: [],
|
|
187
|
+
};
|
|
188
|
+
|
|
143
189
|
export const usedate = () => {
|
|
144
190
|
return useAtom(date);
|
|
145
191
|
};
|
|
@@ -243,6 +289,11 @@ export function useOrderAlertsData() {
|
|
|
243
289
|
return useAtom(orderAlertsData);
|
|
244
290
|
}
|
|
245
291
|
|
|
292
|
+
const customerList = atom<any>([]);
|
|
293
|
+
export function useOrderCustomersList() {
|
|
294
|
+
return useAtom(customerList);
|
|
295
|
+
}
|
|
296
|
+
|
|
246
297
|
export {
|
|
247
298
|
useTabType,
|
|
248
299
|
useInfoType,
|
|
@@ -275,7 +326,7 @@ const DepotDeatils = atom<any>(0);
|
|
|
275
326
|
function useDepotDetails() {
|
|
276
327
|
return useAtom(DepotDeatils);
|
|
277
328
|
}
|
|
278
|
-
const productDetails = atom<any>([]);
|
|
329
|
+
const productDetails = atom<any[]>([]);
|
|
279
330
|
function useProductDetails() {
|
|
280
331
|
return useAtom(productDetails);
|
|
281
332
|
}
|
|
@@ -558,6 +609,67 @@ export function useGlobalStateHitOrder() {
|
|
|
558
609
|
return useAtom(globalOrderGetApi);
|
|
559
610
|
}
|
|
560
611
|
|
|
612
|
+
//force debrief states
|
|
613
|
+
const globalEscData = atom<any>([]);
|
|
614
|
+
export function useGlobalEscData() {
|
|
615
|
+
return useAtom(globalEscData);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
const activeTab = atom<any>('success');
|
|
619
|
+
|
|
620
|
+
export function useActiveTab() {
|
|
621
|
+
return useAtom(activeTab);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
const chargesStateAtom = atom<ChargesType>(chargesIntialValue);
|
|
625
|
+
|
|
626
|
+
export function useChargesState() {
|
|
627
|
+
return useAtom(chargesStateAtom);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
const failureReasonAtom = atom<any>('');
|
|
631
|
+
export function useFailureReason() {
|
|
632
|
+
return useAtom(failureReasonAtom);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
const escalationCategoryAtom = atom<any>('');
|
|
636
|
+
|
|
637
|
+
export function useEscalationCategory() {
|
|
638
|
+
return useAtom(escalationCategoryAtom);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
const escalationLevelAtom = atom<any>('');
|
|
642
|
+
|
|
643
|
+
export function useEscalationLevel() {
|
|
644
|
+
return useAtom(escalationLevelAtom);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const escalationReasonAtom = atom<any>('');
|
|
648
|
+
|
|
649
|
+
export function useEscalationReason() {
|
|
650
|
+
return useAtom(escalationReasonAtom);
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
const newStatusAtom = atom<any>('');
|
|
654
|
+
export function useNewStatus() {
|
|
655
|
+
return useAtom(newStatusAtom);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
const orderCancelReasonAtom = atom<any>('');
|
|
659
|
+
export function useOrderCancelReason() {
|
|
660
|
+
return useAtom(orderCancelReasonAtom);
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
const orderHoldReasonAtom = atom<any>('');
|
|
664
|
+
export function useOrderHoldReason() {
|
|
665
|
+
return useAtom(orderHoldReasonAtom);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
const isFailureReasonChangedAtom = atom<boolean>(false);
|
|
669
|
+
export function useIsFailureReasonChanged() {
|
|
670
|
+
return useAtom(isFailureReasonChangedAtom);
|
|
671
|
+
}
|
|
672
|
+
|
|
561
673
|
// Popup state Manage
|
|
562
674
|
const initialState = null;
|
|
563
675
|
|
|
@@ -8,7 +8,7 @@ import { tableColumns } from '../helper';
|
|
|
8
8
|
// import { useAxios } from '@bjsdistribution/dms-component-library';
|
|
9
9
|
// import { ApiResponse } from '../../types';
|
|
10
10
|
|
|
11
|
-
function SystemLogs() {
|
|
11
|
+
function SystemLogs({ loading }: any) {
|
|
12
12
|
const [systemLogs] = useOrderProductSystemLogs();
|
|
13
13
|
// const [, setNotesData] = useEventNotesData();
|
|
14
14
|
|
|
@@ -38,7 +38,11 @@ function SystemLogs() {
|
|
|
38
38
|
return (
|
|
39
39
|
<Table>
|
|
40
40
|
<CollapsableForm collapsedContent={<CollapsedContent />}>
|
|
41
|
-
<DynamicTable
|
|
41
|
+
<DynamicTable
|
|
42
|
+
columns={tableColumns}
|
|
43
|
+
data={systemLogs}
|
|
44
|
+
loading={loading}
|
|
45
|
+
/>
|
|
42
46
|
</CollapsableForm>
|
|
43
47
|
</Table>
|
|
44
48
|
);
|
|
@@ -50,7 +50,8 @@ export type OrderActionsType =
|
|
|
50
50
|
| 'unrelease-order'
|
|
51
51
|
| 'clear-date'
|
|
52
52
|
| 'uncancel-order'
|
|
53
|
-
| 'remove-from-route'
|
|
53
|
+
| 'remove-from-route'
|
|
54
|
+
| 'force-debrief';
|
|
54
55
|
|
|
55
56
|
export interface ChargeLogData {
|
|
56
57
|
id: number;
|
|
@@ -127,6 +128,10 @@ export interface OrderRouteType {
|
|
|
127
128
|
feedback_received?: boolean;
|
|
128
129
|
is_active?: boolean;
|
|
129
130
|
}
|
|
131
|
+
|
|
132
|
+
export interface orderType {
|
|
133
|
+
type: string | null;
|
|
134
|
+
}
|
|
130
135
|
export interface OrdersType {
|
|
131
136
|
depot_id: number | null;
|
|
132
137
|
gsit_order_id: number | null;
|
|
@@ -168,6 +173,13 @@ export interface OrdersType {
|
|
|
168
173
|
recipient_name: any;
|
|
169
174
|
postcode: any;
|
|
170
175
|
carrier_id: number | null;
|
|
176
|
+
order_type: orderType;
|
|
177
|
+
assemble: boolean;
|
|
178
|
+
disassemble: boolean;
|
|
179
|
+
unpack_items: boolean;
|
|
180
|
+
take_packaging_away: boolean;
|
|
181
|
+
collect_disposal: boolean;
|
|
182
|
+
assembly_type: string | null;
|
|
171
183
|
}
|
|
172
184
|
|
|
173
185
|
export type DeleteProds = {
|
|
@@ -269,3 +281,50 @@ export interface CancelOrderProductsType {
|
|
|
269
281
|
product_type?: string;
|
|
270
282
|
previous_product_type?: string;
|
|
271
283
|
}
|
|
284
|
+
|
|
285
|
+
//force debrief
|
|
286
|
+
export interface AdhocCharge {
|
|
287
|
+
adhoc_charges_description: string;
|
|
288
|
+
adhoc_charges: number;
|
|
289
|
+
id: string; // required for state updations only
|
|
290
|
+
}
|
|
291
|
+
export interface ChargesType {
|
|
292
|
+
base_charge_type: number;
|
|
293
|
+
base_charge: number;
|
|
294
|
+
weight: number;
|
|
295
|
+
drop_time: number;
|
|
296
|
+
timed_service: number;
|
|
297
|
+
wait_time: number;
|
|
298
|
+
extra_floor: number;
|
|
299
|
+
bulky_items: number;
|
|
300
|
+
re_label: number;
|
|
301
|
+
extra_cube: number;
|
|
302
|
+
additional_box: number;
|
|
303
|
+
additional_item: number;
|
|
304
|
+
weekend: number;
|
|
305
|
+
re_allocation: number;
|
|
306
|
+
pre_dated: number;
|
|
307
|
+
re_package: number;
|
|
308
|
+
disassemble: number;
|
|
309
|
+
qc: number;
|
|
310
|
+
collection_qc: number;
|
|
311
|
+
return_to_client: number;
|
|
312
|
+
roc: number;
|
|
313
|
+
unpack: number;
|
|
314
|
+
packaging_disposal: number;
|
|
315
|
+
assembly: number;
|
|
316
|
+
debrief_notes: string;
|
|
317
|
+
recycle: number;
|
|
318
|
+
admin: number;
|
|
319
|
+
disposal: number;
|
|
320
|
+
disposal_recycling: number;
|
|
321
|
+
debrief_status: string;
|
|
322
|
+
new_order_status: string;
|
|
323
|
+
adhoc_charges: AdhocCharge[];
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export interface AdhocCharge {
|
|
327
|
+
adhoc_charges_description: string;
|
|
328
|
+
adhoc_charges: number;
|
|
329
|
+
id: string; // required for state updations only
|
|
330
|
+
}
|
|
@@ -2,7 +2,6 @@ import {
|
|
|
2
2
|
OrderRecipientType,
|
|
3
3
|
OrderRouteType,
|
|
4
4
|
OrderServicesDetailType,
|
|
5
|
-
OrderServiceType,
|
|
6
5
|
OrdersType,
|
|
7
6
|
} from './types';
|
|
8
7
|
|
|
@@ -14,7 +13,44 @@ export const capitalize = (input: string) => {
|
|
|
14
13
|
return char.toUpperCase();
|
|
15
14
|
});
|
|
16
15
|
};
|
|
16
|
+
export const getBaseUrlSymbol = (): string => {
|
|
17
|
+
const storedSymbol = localStorage.getItem('baseUrlSymbol');
|
|
18
|
+
if (!storedSymbol) {
|
|
19
|
+
localStorage.setItem('baseUrlSymbol', '£');
|
|
20
|
+
return '£';
|
|
21
|
+
}
|
|
22
|
+
return storedSymbol;
|
|
23
|
+
};
|
|
24
|
+
export const handleKeyDownDebrief = (
|
|
25
|
+
e: React.KeyboardEvent<HTMLInputElement>
|
|
26
|
+
) => {
|
|
27
|
+
// Allowed keys: numbers (0-9), '.'
|
|
28
|
+
const allowedKeys = [
|
|
29
|
+
'0',
|
|
30
|
+
'1',
|
|
31
|
+
'2',
|
|
32
|
+
'3',
|
|
33
|
+
'4',
|
|
34
|
+
'5',
|
|
35
|
+
'6',
|
|
36
|
+
'7',
|
|
37
|
+
'8',
|
|
38
|
+
'9',
|
|
39
|
+
'.',
|
|
40
|
+
'ArrowLeft',
|
|
41
|
+
'ArrowRight',
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
// Allow backspace, delete and Tab keys
|
|
45
|
+
if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
17
48
|
|
|
49
|
+
// Prevent input if key is not in allowedKeys
|
|
50
|
+
if (!allowedKeys.includes(e.key)) {
|
|
51
|
+
e.preventDefault();
|
|
52
|
+
}
|
|
53
|
+
};
|
|
18
54
|
export const RepackData = [
|
|
19
55
|
{
|
|
20
56
|
packaging_type: 'Recycled Cardboard',
|
|
@@ -109,6 +145,18 @@ export const getCookie = (name: string): string | null => {
|
|
|
109
145
|
};
|
|
110
146
|
|
|
111
147
|
export const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
148
|
+
// Allow common shortcuts like Ctrl+V, Ctrl+C, Ctrl+A, etc.
|
|
149
|
+
if (e.ctrlKey || e.metaKey) {
|
|
150
|
+
if (
|
|
151
|
+
e.key.toLowerCase() === 'v' || // Paste
|
|
152
|
+
e.key.toLowerCase() === 'c' || // Copy
|
|
153
|
+
e.key.toLowerCase() === 'x' || // Cut
|
|
154
|
+
e.key.toLowerCase() === 'a' // Select All
|
|
155
|
+
) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
112
160
|
// Allowed keys: numbers (0-9), '.', '-', '+'
|
|
113
161
|
const allowedKeys = [
|
|
114
162
|
'0',
|
|
@@ -240,14 +288,12 @@ export const compareOrderDetailsStates = (
|
|
|
240
288
|
order_recipient: oldOrderRecipient,
|
|
241
289
|
order_routes: oldOrderRoutes,
|
|
242
290
|
order_services_detail: oldOrderServicesDetail,
|
|
243
|
-
order_services: oldOrderServices,
|
|
244
291
|
...oldRequiredData
|
|
245
292
|
} = oldData;
|
|
246
293
|
const {
|
|
247
294
|
order_recipient: newOrderRecipient,
|
|
248
295
|
order_routes: newOrderRoutes,
|
|
249
296
|
order_services_detail: newOrderServicesDetail,
|
|
250
|
-
order_services: newOrderServices,
|
|
251
297
|
...newRequiredData
|
|
252
298
|
} = newData;
|
|
253
299
|
|
|
@@ -270,33 +316,6 @@ export const compareOrderDetailsStates = (
|
|
|
270
316
|
newOrderServicesDetail
|
|
271
317
|
);
|
|
272
318
|
|
|
273
|
-
// need to remove id and new_id from new order_services
|
|
274
|
-
const filteredNewOrderServices = newOrderServices?.map((item: any) => {
|
|
275
|
-
if (item.new_id) {
|
|
276
|
-
const { id, new_id, ...newItem } = item;
|
|
277
|
-
return newItem;
|
|
278
|
-
} else {
|
|
279
|
-
return item;
|
|
280
|
-
}
|
|
281
|
-
});
|
|
282
|
-
|
|
283
|
-
const newOrderServicesWithoutId = filteredNewOrderServices.filter(
|
|
284
|
-
(service: OrderServiceType) => !service.id
|
|
285
|
-
);
|
|
286
|
-
const newOrderServicesWithId = filteredNewOrderServices.filter(
|
|
287
|
-
(service: OrderServiceType) => service.id
|
|
288
|
-
);
|
|
289
|
-
|
|
290
|
-
const payloadOrderServices: OrderServiceType[] = compareArrays(
|
|
291
|
-
oldOrderServices,
|
|
292
|
-
newOrderServicesWithId
|
|
293
|
-
);
|
|
294
|
-
|
|
295
|
-
const finalPayloadOrderServices = [
|
|
296
|
-
...payloadOrderServices,
|
|
297
|
-
...newOrderServicesWithoutId,
|
|
298
|
-
];
|
|
299
|
-
|
|
300
319
|
const finalPayload = {
|
|
301
320
|
...payloadWithId,
|
|
302
321
|
...(!isObjectEmpty(payloadOrderRecipient) && {
|
|
@@ -308,9 +327,6 @@ export const compareOrderDetailsStates = (
|
|
|
308
327
|
...(!isObjectEmpty(payloadOrderServicesDetail) && {
|
|
309
328
|
order_services_detail: payloadOrderServicesDetail,
|
|
310
329
|
}),
|
|
311
|
-
...(finalPayloadOrderServices.length > 0 && {
|
|
312
|
-
order_services: finalPayloadOrderServices,
|
|
313
|
-
}),
|
|
314
330
|
};
|
|
315
331
|
|
|
316
332
|
return finalPayload;
|
|
@@ -13,8 +13,6 @@ function AssigneeDropdown() {
|
|
|
13
13
|
const [reminderData] = useReminderById();
|
|
14
14
|
const [reminderPayload, setReminderPayload] = useUpdateReminderData();
|
|
15
15
|
const [departmentData, setDepartmentData] = useDeptData();
|
|
16
|
-
const [selectedDeptId, setSelectedDeptId] = useState<any | null>(null);
|
|
17
|
-
const [, setFilteredUsers] = useState<typeof allUsers>([]);
|
|
18
16
|
const [allUsers, setAllUsers] = useState<
|
|
19
17
|
{
|
|
20
18
|
fName: string;
|
|
@@ -58,15 +56,7 @@ function AssigneeDropdown() {
|
|
|
58
56
|
value: item?.value,
|
|
59
57
|
})) || [];
|
|
60
58
|
|
|
61
|
-
const
|
|
62
|
-
setSelectedDeptId(value);
|
|
63
|
-
|
|
64
|
-
setReminderPayload((prevState: any) => ({
|
|
65
|
-
...prevState,
|
|
66
|
-
department: option?.label,
|
|
67
|
-
assigned_to: null,
|
|
68
|
-
}));
|
|
69
|
-
};
|
|
59
|
+
const [selectedDeptIds, setSelectedDeptIds] = useState<string[]>([]);
|
|
70
60
|
|
|
71
61
|
// SSO Departments
|
|
72
62
|
const { fetchData: getSSOData, data: fetchData } = useAxios<{
|
|
@@ -134,15 +124,22 @@ function AssigneeDropdown() {
|
|
|
134
124
|
}, []);
|
|
135
125
|
|
|
136
126
|
useEffect(() => {
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
if (
|
|
128
|
+
selectedDeptIds.length === 0 &&
|
|
129
|
+
reminderPayload?.department &&
|
|
130
|
+
departmentData?.length > 0
|
|
131
|
+
) {
|
|
132
|
+
const deptNames = reminderPayload.department
|
|
133
|
+
.split(',')
|
|
134
|
+
.map((d: any) => d.trim());
|
|
135
|
+
|
|
136
|
+
const matched = departmentData
|
|
137
|
+
.filter((dept: any) => deptNames.includes(dept.label))
|
|
138
|
+
.map((dept: any) => dept.value);
|
|
139
|
+
|
|
140
|
+
setSelectedDeptIds(matched);
|
|
144
141
|
}
|
|
145
|
-
}, [
|
|
142
|
+
}, [reminderPayload?.department, departmentData, selectedDeptIds]);
|
|
146
143
|
|
|
147
144
|
useEffect(() => {
|
|
148
145
|
if (fetchData && fetchData?.data) {
|
|
@@ -155,24 +152,86 @@ function AssigneeDropdown() {
|
|
|
155
152
|
}
|
|
156
153
|
}, [fetchData]);
|
|
157
154
|
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
155
|
+
const assignedUserIds = (reminderPayload?.assigned_to ?? []) as string[];
|
|
156
|
+
|
|
157
|
+
const selectedUsers = allUsers?.filter(user =>
|
|
158
|
+
assignedUserIds?.includes(user?.id)
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
const deptUsers = selectedDeptIds.length
|
|
162
|
+
? allUsers?.filter(user => selectedDeptIds?.includes(user?.deptId as any))
|
|
163
|
+
: [];
|
|
164
|
+
|
|
165
|
+
const mergedUsersMap = new Map();
|
|
166
|
+
|
|
167
|
+
// Add selected users first
|
|
168
|
+
selectedUsers?.forEach(user => {
|
|
169
|
+
mergedUsersMap?.set(user.id, {
|
|
170
|
+
label: `${user?.fName} ${user?.lName}`,
|
|
171
|
+
value: user?.id,
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
// Add department users next
|
|
176
|
+
deptUsers?.forEach(user => {
|
|
177
|
+
if (!mergedUsersMap?.has(user?.id)) {
|
|
178
|
+
mergedUsersMap?.set(user?.id, {
|
|
179
|
+
label: `${user?.fName} ${user?.lName}`,
|
|
180
|
+
value: user?.id,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
const userOptions = Array.from(mergedUsersMap.values());
|
|
186
|
+
|
|
187
|
+
const handleDepartmentChange = (
|
|
188
|
+
values: string[],
|
|
189
|
+
options: { label: string }[]
|
|
190
|
+
) => {
|
|
191
|
+
setSelectedDeptIds(values);
|
|
192
|
+
|
|
193
|
+
const deptLabels = options?.map(opt => opt.label).join(', ');
|
|
194
|
+
|
|
195
|
+
let updatedAssignedTo = reminderPayload?.assigned_to || [];
|
|
196
|
+
|
|
197
|
+
if (reminderPayload && reminderPayload?.assigned_to?.length > 0) {
|
|
198
|
+
const matchedUsers = allUsers?.filter(
|
|
199
|
+
user => user?.deptId !== null && values?.includes(String(user?.deptId))
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
updatedAssignedTo = reminderPayload?.assigned_to?.filter((id: any) =>
|
|
203
|
+
matchedUsers?.some(user => user.id === id)
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
setReminderPayload((prev: any) => ({
|
|
208
|
+
...prev,
|
|
209
|
+
department: deptLabels,
|
|
210
|
+
assigned_to: updatedAssignedTo,
|
|
211
|
+
}));
|
|
212
|
+
};
|
|
162
213
|
|
|
163
214
|
return (
|
|
164
215
|
<FormContainer>
|
|
165
216
|
<Label label="Department" required />
|
|
166
217
|
<StyledAntSelect
|
|
167
218
|
disabled={disabled}
|
|
219
|
+
mode="multiple"
|
|
168
220
|
options={deptData}
|
|
169
221
|
placeholder="Select Department"
|
|
170
222
|
onChange={handleDepartmentChange}
|
|
223
|
+
// {(values: string[], options: { label: string }[]) => {
|
|
224
|
+
// setSelectedDeptIds(values);
|
|
225
|
+
// setReminderPayload((prev: any) => ({
|
|
226
|
+
// ...prev,
|
|
227
|
+
// department: options?.map(o => o?.label).join(', '),
|
|
228
|
+
// assigned_to: reminderPayload?.assigned_to,
|
|
229
|
+
// }));
|
|
230
|
+
// }}
|
|
171
231
|
style={{ width: '8vw' }}
|
|
172
|
-
value={
|
|
173
|
-
showSearch
|
|
174
|
-
dis
|
|
232
|
+
value={selectedDeptIds}
|
|
175
233
|
/>
|
|
234
|
+
|
|
176
235
|
<Label label="Assigned To" required htmlFor="assigneDropdown" />
|
|
177
236
|
<StyledAntSelect
|
|
178
237
|
disabled={disabled}
|