@bjsdistribution/dms-client-return 0.1.19-dev → 0.1.21-dev
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/client-portal/DateFilterStore.d.ts +15 -0
- package/dist/components/client-portal/OutstandingTable.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-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 +49 -1
- package/dist/components/order-view/utils.d.ts +3 -0
- package/dist/components/order-view/view-reminder/ViewReminder.d.ts +2 -0
- package/dist/components/store.d.ts +5 -1
- package/dist/dms-client-return.cjs.development.js +7035 -3476
- 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 +7099 -3540
- 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 +94 -0
- package/src/components/client-portal/OutstandingTable.tsx +355 -0
- package/src/components/client-portal/ReturnAfterSearchBar.tsx +76 -17
- package/src/components/client-portal/ReturnOverview.tsx +4 -4
- package/src/components/client-portal/ReturnRTFilters.tsx +57 -40
- package/src/components/client-portal/ReturnSearchBar.tsx +64 -94
- package/src/components/client-portal/ReturnStatus.tsx +50 -68
- 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/RouterHeader.tsx +11 -18
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +43 -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 -6
- 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 +620 -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 +201 -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 +18 -5
- 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/footer/index.tsx +7 -1
- 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/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 +107 -1
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +6 -2
- package/src/components/order-view/types.ts +54 -1
- package/src/components/order-view/utils.ts +37 -0
- package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +85 -26
- package/src/components/order-view/view-reminder/ViewReminder.tsx +33 -14
- package/src/components/store.ts +24 -1
- package/src/index.tsx +6 -3
|
@@ -3,8 +3,9 @@ import styled from 'styled-components';
|
|
|
3
3
|
import ProductTable from '../../return-client-products/ProductTable';
|
|
4
4
|
import NewReturnDropdown, {
|
|
5
5
|
payloadAtom,
|
|
6
|
+
selectedOrderId,
|
|
6
7
|
} from '../../notes/order-dropdown/NewReturnDropdown';
|
|
7
|
-
import { Button,
|
|
8
|
+
import { Button, useAxios } from '@bjsdistribution/dms-component-library';
|
|
8
9
|
import { useAtom } from 'jotai';
|
|
9
10
|
import { ApiResponse } from '../../types';
|
|
10
11
|
import { usePostLoading, useSelectedProducts } from '../../../store';
|
|
@@ -13,25 +14,32 @@ import { useNavigate } from 'react-router-dom';
|
|
|
13
14
|
import { notification } from 'antd';
|
|
14
15
|
import { useOrderId } from '../../store';
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
interface IPROS {
|
|
18
|
+
callReturnProducts: any;
|
|
19
|
+
loading: boolean;
|
|
20
|
+
locationloading: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function ExpandedContent(props: IPROS) {
|
|
17
24
|
const [payload] = useAtom(payloadAtom);
|
|
18
25
|
const [, setPostLoading] = usePostLoading();
|
|
19
26
|
const [orderId] = useOrderId();
|
|
20
27
|
const [isButtonDisabled, setIsButtonDisabled] = useState(true);
|
|
21
28
|
const navigate = useNavigate();
|
|
22
29
|
const [, setSelectedProducts] = useSelectedProducts();
|
|
30
|
+
const [, setSelectedOrderId] = useAtom(selectedOrderId);
|
|
23
31
|
|
|
24
32
|
const {
|
|
25
33
|
data: response,
|
|
26
|
-
|
|
34
|
+
|
|
27
35
|
loading: confirmLoading,
|
|
28
|
-
|
|
36
|
+
fetchData: callMoveProducts,
|
|
37
|
+
} = useAxios<{
|
|
29
38
|
data: ApiResponse[];
|
|
30
39
|
}>({
|
|
31
40
|
endpoint: `/v1/return/product/move/?return_order_id=${orderId}`,
|
|
32
41
|
method: 'POST',
|
|
33
42
|
body: payload,
|
|
34
|
-
performAction: false,
|
|
35
43
|
});
|
|
36
44
|
|
|
37
45
|
useEffect(() => {
|
|
@@ -46,12 +54,22 @@ function ExpandedContent() {
|
|
|
46
54
|
}
|
|
47
55
|
}, [payload]);
|
|
48
56
|
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} else {
|
|
57
|
+
const sleep = (ms: number) => new Promise(res => setTimeout(res, ms));
|
|
58
|
+
|
|
59
|
+
const handleConfirmReturn = async () => {
|
|
60
|
+
if (isButtonDisabled) {
|
|
54
61
|
console.error('Payload is incomplete:', payload);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
setPostLoading(true);
|
|
66
|
+
|
|
67
|
+
const response = await callMoveProducts();
|
|
68
|
+
//@ts-ignore
|
|
69
|
+
if (response?.code === 200) {
|
|
70
|
+
await sleep(2000);
|
|
71
|
+
props?.callReturnProducts();
|
|
72
|
+
setSelectedOrderId(null);
|
|
55
73
|
}
|
|
56
74
|
};
|
|
57
75
|
|
|
@@ -90,7 +108,11 @@ function ExpandedContent() {
|
|
|
90
108
|
|
|
91
109
|
return (
|
|
92
110
|
<Container>
|
|
93
|
-
<ProductTable
|
|
111
|
+
<ProductTable
|
|
112
|
+
callReturnProducts={props?.callReturnProducts}
|
|
113
|
+
loading={props?.loading}
|
|
114
|
+
locationloading={props?.locationloading}
|
|
115
|
+
/>
|
|
94
116
|
<MidContainer>
|
|
95
117
|
<SaveNoteContainer>
|
|
96
118
|
<Button
|
|
@@ -15,12 +15,12 @@ interface ApiResponse {
|
|
|
15
15
|
setShouldPerformAction: boolean;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function ProductsInfo() {
|
|
18
|
+
function ProductsInfo({ locationloading }: any) {
|
|
19
19
|
const [data] = useOrderDetails();
|
|
20
20
|
const returnOrder = data;
|
|
21
21
|
|
|
22
22
|
// For API Call
|
|
23
|
-
const [,
|
|
23
|
+
const [, setProductsData] = useProductDetails();
|
|
24
24
|
const [, setLoading] = useLoading();
|
|
25
25
|
const {
|
|
26
26
|
data: returnOrdersData,
|
|
@@ -43,17 +43,21 @@ function ProductsInfo() {
|
|
|
43
43
|
setLoading(loading);
|
|
44
44
|
if (returnOrdersData && returnOrdersData.data) {
|
|
45
45
|
const requiredData = returnOrdersData.data;
|
|
46
|
-
if (requiredData
|
|
47
|
-
|
|
46
|
+
if (requiredData?.length > 0) {
|
|
47
|
+
setProductsData(requiredData);
|
|
48
48
|
} else {
|
|
49
|
-
|
|
49
|
+
setProductsData([]);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}, [returnOrdersData, loading]);
|
|
53
53
|
|
|
54
54
|
return (
|
|
55
55
|
<CollapsableForm collapsedContent={<CollapsedContent />}>
|
|
56
|
-
<ExpandedContent
|
|
56
|
+
<ExpandedContent
|
|
57
|
+
callReturnProducts={callReturnProducts}
|
|
58
|
+
loading={loading}
|
|
59
|
+
locationloading={locationloading}
|
|
60
|
+
/>
|
|
57
61
|
</CollapsableForm>
|
|
58
62
|
);
|
|
59
63
|
}
|
|
@@ -2,10 +2,20 @@ import React from 'react';
|
|
|
2
2
|
import ReturnProductTable from './product-table/ReturnProductTable';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface IPROS {
|
|
6
|
+
callReturnProducts: any;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
locationloading: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const ProductTable = (props: IPROS) => {
|
|
6
12
|
return (
|
|
7
13
|
<Container>
|
|
8
|
-
<ReturnProductTable
|
|
14
|
+
<ReturnProductTable
|
|
15
|
+
callReturnProducts={props?.callReturnProducts}
|
|
16
|
+
loading={props?.loading}
|
|
17
|
+
locationloading={props?.locationloading}
|
|
18
|
+
/>
|
|
9
19
|
</Container>
|
|
10
20
|
);
|
|
11
21
|
};
|
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,9 @@ export const ordersInitialValue: OrdersType = {
|
|
|
109
110
|
id: null,
|
|
110
111
|
name: '',
|
|
111
112
|
carrier_id: null,
|
|
113
|
+
order_type: {
|
|
114
|
+
type: null,
|
|
115
|
+
},
|
|
112
116
|
};
|
|
113
117
|
|
|
114
118
|
export const orderProductInitialvalue: CreateProduct = {
|
|
@@ -140,6 +144,42 @@ export const updateOrderProducts: UpdateOrderProduct = {
|
|
|
140
144
|
return_reason_id: 0,
|
|
141
145
|
};
|
|
142
146
|
|
|
147
|
+
//force debrief
|
|
148
|
+
const chargesIntialValue: ChargesType = {
|
|
149
|
+
base_charge_type: 1,
|
|
150
|
+
base_charge: 0,
|
|
151
|
+
weight: 0,
|
|
152
|
+
drop_time: 0,
|
|
153
|
+
timed_service: 0,
|
|
154
|
+
wait_time: 0,
|
|
155
|
+
extra_floor: 0,
|
|
156
|
+
bulky_items: 0,
|
|
157
|
+
re_label: 0,
|
|
158
|
+
extra_cube: 0,
|
|
159
|
+
additional_box: 0,
|
|
160
|
+
additional_item: 0,
|
|
161
|
+
weekend: 0,
|
|
162
|
+
re_allocation: 0,
|
|
163
|
+
pre_dated: 0,
|
|
164
|
+
re_package: 0,
|
|
165
|
+
disassemble: 0,
|
|
166
|
+
qc: 0,
|
|
167
|
+
collection_qc: 0,
|
|
168
|
+
return_to_client: 0,
|
|
169
|
+
roc: 0,
|
|
170
|
+
unpack: 0,
|
|
171
|
+
packaging_disposal: 0,
|
|
172
|
+
assembly: 0,
|
|
173
|
+
debrief_notes: '',
|
|
174
|
+
recycle: 0,
|
|
175
|
+
admin: 0,
|
|
176
|
+
disposal: 0,
|
|
177
|
+
disposal_recycling: 0,
|
|
178
|
+
debrief_status: '',
|
|
179
|
+
new_order_status: '',
|
|
180
|
+
adhoc_charges: [],
|
|
181
|
+
};
|
|
182
|
+
|
|
143
183
|
export const usedate = () => {
|
|
144
184
|
return useAtom(date);
|
|
145
185
|
};
|
|
@@ -243,6 +283,11 @@ export function useOrderAlertsData() {
|
|
|
243
283
|
return useAtom(orderAlertsData);
|
|
244
284
|
}
|
|
245
285
|
|
|
286
|
+
const customerList = atom<any>([]);
|
|
287
|
+
export function useOrderCustomersList() {
|
|
288
|
+
return useAtom(customerList);
|
|
289
|
+
}
|
|
290
|
+
|
|
246
291
|
export {
|
|
247
292
|
useTabType,
|
|
248
293
|
useInfoType,
|
|
@@ -275,7 +320,7 @@ const DepotDeatils = atom<any>(0);
|
|
|
275
320
|
function useDepotDetails() {
|
|
276
321
|
return useAtom(DepotDeatils);
|
|
277
322
|
}
|
|
278
|
-
const productDetails = atom<any>([]);
|
|
323
|
+
const productDetails = atom<any[]>([]);
|
|
279
324
|
function useProductDetails() {
|
|
280
325
|
return useAtom(productDetails);
|
|
281
326
|
}
|
|
@@ -558,6 +603,67 @@ export function useGlobalStateHitOrder() {
|
|
|
558
603
|
return useAtom(globalOrderGetApi);
|
|
559
604
|
}
|
|
560
605
|
|
|
606
|
+
//force debrief states
|
|
607
|
+
const globalEscData = atom<any>([]);
|
|
608
|
+
export function useGlobalEscData() {
|
|
609
|
+
return useAtom(globalEscData);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
const activeTab = atom<any>('success');
|
|
613
|
+
|
|
614
|
+
export function useActiveTab() {
|
|
615
|
+
return useAtom(activeTab);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
const chargesStateAtom = atom<ChargesType>(chargesIntialValue);
|
|
619
|
+
|
|
620
|
+
export function useChargesState() {
|
|
621
|
+
return useAtom(chargesStateAtom);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
const failureReasonAtom = atom<any>('');
|
|
625
|
+
export function useFailureReason() {
|
|
626
|
+
return useAtom(failureReasonAtom);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
const escalationCategoryAtom = atom<any>('');
|
|
630
|
+
|
|
631
|
+
export function useEscalationCategory() {
|
|
632
|
+
return useAtom(escalationCategoryAtom);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
const escalationLevelAtom = atom<any>('');
|
|
636
|
+
|
|
637
|
+
export function useEscalationLevel() {
|
|
638
|
+
return useAtom(escalationLevelAtom);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
const escalationReasonAtom = atom<any>('');
|
|
642
|
+
|
|
643
|
+
export function useEscalationReason() {
|
|
644
|
+
return useAtom(escalationReasonAtom);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const newStatusAtom = atom<any>('');
|
|
648
|
+
export function useNewStatus() {
|
|
649
|
+
return useAtom(newStatusAtom);
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
const orderCancelReasonAtom = atom<any>('');
|
|
653
|
+
export function useOrderCancelReason() {
|
|
654
|
+
return useAtom(orderCancelReasonAtom);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
const orderHoldReasonAtom = atom<any>('');
|
|
658
|
+
export function useOrderHoldReason() {
|
|
659
|
+
return useAtom(orderHoldReasonAtom);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
const isFailureReasonChangedAtom = atom<boolean>(false);
|
|
663
|
+
export function useIsFailureReasonChanged() {
|
|
664
|
+
return useAtom(isFailureReasonChangedAtom);
|
|
665
|
+
}
|
|
666
|
+
|
|
561
667
|
// Popup state Manage
|
|
562
668
|
const initialState = null;
|
|
563
669
|
|
|
@@ -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,7 @@ export interface OrdersType {
|
|
|
168
173
|
recipient_name: any;
|
|
169
174
|
postcode: any;
|
|
170
175
|
carrier_id: number | null;
|
|
176
|
+
order_type: orderType;
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
export type DeleteProds = {
|
|
@@ -269,3 +275,50 @@ export interface CancelOrderProductsType {
|
|
|
269
275
|
product_type?: string;
|
|
270
276
|
previous_product_type?: string;
|
|
271
277
|
}
|
|
278
|
+
|
|
279
|
+
//force debrief
|
|
280
|
+
export interface AdhocCharge {
|
|
281
|
+
adhoc_charges_description: string;
|
|
282
|
+
adhoc_charges: number;
|
|
283
|
+
id: string; // required for state updations only
|
|
284
|
+
}
|
|
285
|
+
export interface ChargesType {
|
|
286
|
+
base_charge_type: number;
|
|
287
|
+
base_charge: number;
|
|
288
|
+
weight: number;
|
|
289
|
+
drop_time: number;
|
|
290
|
+
timed_service: number;
|
|
291
|
+
wait_time: number;
|
|
292
|
+
extra_floor: number;
|
|
293
|
+
bulky_items: number;
|
|
294
|
+
re_label: number;
|
|
295
|
+
extra_cube: number;
|
|
296
|
+
additional_box: number;
|
|
297
|
+
additional_item: number;
|
|
298
|
+
weekend: number;
|
|
299
|
+
re_allocation: number;
|
|
300
|
+
pre_dated: number;
|
|
301
|
+
re_package: number;
|
|
302
|
+
disassemble: number;
|
|
303
|
+
qc: number;
|
|
304
|
+
collection_qc: number;
|
|
305
|
+
return_to_client: number;
|
|
306
|
+
roc: number;
|
|
307
|
+
unpack: number;
|
|
308
|
+
packaging_disposal: number;
|
|
309
|
+
assembly: number;
|
|
310
|
+
debrief_notes: string;
|
|
311
|
+
recycle: number;
|
|
312
|
+
admin: number;
|
|
313
|
+
disposal: number;
|
|
314
|
+
disposal_recycling: number;
|
|
315
|
+
debrief_status: string;
|
|
316
|
+
new_order_status: string;
|
|
317
|
+
adhoc_charges: AdhocCharge[];
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export interface AdhocCharge {
|
|
321
|
+
adhoc_charges_description: string;
|
|
322
|
+
adhoc_charges: number;
|
|
323
|
+
id: string; // required for state updations only
|
|
324
|
+
}
|
|
@@ -14,7 +14,44 @@ export const capitalize = (input: string) => {
|
|
|
14
14
|
return char.toUpperCase();
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
|
+
export const getBaseUrlSymbol = (): string => {
|
|
18
|
+
const storedSymbol = localStorage.getItem('baseUrlSymbol');
|
|
19
|
+
if (!storedSymbol) {
|
|
20
|
+
localStorage.setItem('baseUrlSymbol', '£');
|
|
21
|
+
return '£';
|
|
22
|
+
}
|
|
23
|
+
return storedSymbol;
|
|
24
|
+
};
|
|
25
|
+
export const handleKeyDownDebrief = (
|
|
26
|
+
e: React.KeyboardEvent<HTMLInputElement>
|
|
27
|
+
) => {
|
|
28
|
+
// Allowed keys: numbers (0-9), '.'
|
|
29
|
+
const allowedKeys = [
|
|
30
|
+
'0',
|
|
31
|
+
'1',
|
|
32
|
+
'2',
|
|
33
|
+
'3',
|
|
34
|
+
'4',
|
|
35
|
+
'5',
|
|
36
|
+
'6',
|
|
37
|
+
'7',
|
|
38
|
+
'8',
|
|
39
|
+
'9',
|
|
40
|
+
'.',
|
|
41
|
+
'ArrowLeft',
|
|
42
|
+
'ArrowRight',
|
|
43
|
+
];
|
|
17
44
|
|
|
45
|
+
// Allow backspace, delete and Tab keys
|
|
46
|
+
if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Prevent input if key is not in allowedKeys
|
|
51
|
+
if (!allowedKeys.includes(e.key)) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
18
55
|
export const RepackData = [
|
|
19
56
|
{
|
|
20
57
|
packaging_type: 'Recycled Cardboard',
|