@bjsdistribution/dms-client-return 0.1.9-prod → 0.1.10-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/components/client-portal/OutstandingTable.d.ts +3 -0
- package/dist/components/client-portal/ReturnAfterSearchBar.d.ts +4 -0
- package/dist/components/client-portal/ReturnOverview.d.ts +3 -0
- package/dist/components/client-portal/ReturnRTFilters.d.ts +5 -0
- package/dist/components/client-portal/ReturnSearchBar.d.ts +4 -0
- package/dist/components/client-portal/ReturnStatus.d.ts +8 -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/common/fakedata.d.ts +1 -0
- package/dist/components/order-daily-overview/header/route-header/RouterHeader.d.ts +1 -0
- 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/products-info/expanded-content/index.d.ts +4 -1
- package/dist/components/order-view/return-client-products/ProductTable.d.ts +4 -1
- package/dist/components/order-view/return-client-products/product-table/ReturnProductTable.d.ts +4 -1
- package/dist/components/order-view/store.d.ts +14 -2
- package/dist/components/order-view/types.d.ts +49 -1
- package/dist/components/order-view/utils.d.ts +3 -0
- package/dist/components/store.d.ts +12 -1
- package/dist/components/utils.d.ts +1 -0
- package/dist/dms-client-return.cjs.development.js +7053 -2711
- 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 +7111 -2769
- 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/OutstandingTable.tsx +412 -0
- package/src/components/client-portal/ReturnAfterSearchBar.tsx +242 -0
- package/src/components/client-portal/ReturnOverview.tsx +185 -0
- package/src/components/client-portal/ReturnRTFilters.tsx +228 -0
- package/src/components/client-portal/ReturnSearchBar.tsx +294 -0
- package/src/components/client-portal/ReturnStatus.tsx +252 -0
- package/src/components/client-portal/return-confirm/ConfirmedMain.tsx +235 -0
- package/src/components/client-portal/return-confirm/ReturnConfirmedTable.tsx +404 -0
- package/src/components/order-daily-overview/common/fakedata.tsx +18 -0
- package/src/components/order-daily-overview/header/route-header/RouterHeader.tsx +130 -1
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +15 -3
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +100 -70
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +4 -0
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +86 -0
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +12 -2
- package/src/components/order-daily-overview/return-after-table/table-filters/TableFilters.tsx +22 -1
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +34 -6
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +24 -11
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/RightFilters.tsx +26 -6
- package/src/components/order-daily-overview/shared/elements/PrintDropDown.tsx +5 -3
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/OptionsDropDown.tsx +5 -0
- package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
- package/src/components/order-view/generic-table/AuditLogs.tsx +39 -12
- package/src/components/order-view/index.tsx +45 -0
- package/src/components/order-view/notes/AddNote.tsx +94 -65
- package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
- package/src/components/order-view/notification/OrderTemplate.tsx +192 -41
- 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/create-task-reminder/CreateReminderModal.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 +15 -3
- package/src/components/order-view/order-details/expanded-content/instruction-section/index.tsx +1 -1
- package/src/components/order-view/products-info/expanded-content/index.tsx +27 -11
- package/src/components/order-view/products-info/index.tsx +4 -4
- package/src/components/order-view/return-client-products/ProductTable.tsx +6 -2
- package/src/components/order-view/return-client-products/product-table/ReturnProductTable.tsx +54 -15
- package/src/components/order-view/store.ts +106 -0
- package/src/components/order-view/types.ts +54 -1
- package/src/components/order-view/utils.ts +37 -0
- package/src/components/store.ts +62 -1
- package/src/components/utils.ts +13 -3
- package/src/index.tsx +26 -16
|
@@ -8,12 +8,13 @@ import { useNewReturnOrderData, useSelectedProducts } from '../../../store';
|
|
|
8
8
|
import { atom, useAtom } from 'jotai';
|
|
9
9
|
|
|
10
10
|
export const payloadAtom = atom<any>(null);
|
|
11
|
+
export const selectedOrderId = atom<any>(null);
|
|
11
12
|
|
|
12
13
|
const NewReturnDropdown = () => {
|
|
13
14
|
const defaultSelectStyle = { width: '100%' };
|
|
14
15
|
const defaultPopupClassName = 'dropDownStyle';
|
|
15
16
|
const [returnOrderData, setReturnOrderData] = useNewReturnOrderData();
|
|
16
|
-
const [
|
|
17
|
+
const [selectedId, setSelectedOrderId] = useAtom(selectedOrderId);
|
|
17
18
|
const [selectedProducts] = useSelectedProducts();
|
|
18
19
|
const [orderData] = useOrderDetails();
|
|
19
20
|
const [, setPayload] = useAtom(payloadAtom);
|
|
@@ -67,14 +68,14 @@ const NewReturnDropdown = () => {
|
|
|
67
68
|
}, [fetchedReturnOrderData, id]);
|
|
68
69
|
|
|
69
70
|
useEffect(() => {
|
|
70
|
-
if (
|
|
71
|
+
if (selectedId && selectedProducts?.length > 0) {
|
|
71
72
|
const newPayload = {
|
|
72
|
-
new_return_order:
|
|
73
|
+
new_return_order: selectedId,
|
|
73
74
|
products: selectedProducts,
|
|
74
75
|
};
|
|
75
76
|
setPayload(newPayload);
|
|
76
77
|
}
|
|
77
|
-
}, [
|
|
78
|
+
}, [selectedId, selectedProducts, setPayload]);
|
|
78
79
|
|
|
79
80
|
const handleDropdownChange = (value: string) => {
|
|
80
81
|
setSelectedOrderId(value);
|
|
@@ -83,23 +84,20 @@ const NewReturnDropdown = () => {
|
|
|
83
84
|
label: `${order?.recipient_name} - ${order?.postcode}`,
|
|
84
85
|
value: order?.id,
|
|
85
86
|
}));
|
|
86
|
-
|
|
87
87
|
return (
|
|
88
88
|
<Container>
|
|
89
89
|
<Text>New Return Order:</Text>
|
|
90
90
|
<StyledAntSelect
|
|
91
91
|
options={dropdownOptions}
|
|
92
|
-
value={
|
|
92
|
+
value={selectedId}
|
|
93
93
|
placeholder="Select"
|
|
94
94
|
// @ts-ignore
|
|
95
95
|
onChange={handleDropdownChange}
|
|
96
96
|
style={defaultSelectStyle}
|
|
97
97
|
showSearch
|
|
98
|
-
dropdownStyle={{ width: '
|
|
98
|
+
dropdownStyle={{ width: '250px' }}
|
|
99
99
|
popupClassName={defaultPopupClassName}
|
|
100
|
-
status={
|
|
101
|
-
dropdownOptions.length === 0 ? '' : selectedOrderId ? '' : 'error'
|
|
102
|
-
}
|
|
100
|
+
status={dropdownOptions.length === 0 ? '' : selectedId ? '' : 'error'}
|
|
103
101
|
notFoundContent="No orders found with a similar postcode"
|
|
104
102
|
/>
|
|
105
103
|
</Container>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { FlagAlert } from '@bjsdistribution/dms-component-library';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { useOrderNotify } from '../order-actions/store';
|
|
5
5
|
import { useOrderStaticData } from '../store';
|
|
6
|
+
import { useClientPortal } from '../../store';
|
|
6
7
|
|
|
7
8
|
function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
8
9
|
const [, setOrderCount] = useOrderNotify();
|
|
9
|
-
const precall = false;
|
|
10
|
+
// const precall = false;
|
|
10
11
|
const [orderStaticData] = useOrderStaticData();
|
|
11
12
|
const statusVal = routeInfoData?.status_value;
|
|
12
|
-
|
|
13
|
+
const [isClientPortal] = useClientPortal();
|
|
13
14
|
const unholdReasons = orderStaticData?.cancellation_reasons?.map(
|
|
14
15
|
(x: any) => ({
|
|
15
16
|
id: x?.id,
|
|
@@ -38,13 +39,17 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
38
39
|
isPreCall: true,
|
|
39
40
|
isConfirmed: true,
|
|
40
41
|
isPostcode: true,
|
|
42
|
+
isSubcontracted: true,
|
|
43
|
+
isRouted: true,
|
|
44
|
+
isOnSite: true,
|
|
45
|
+
isFailed: true,
|
|
41
46
|
});
|
|
42
47
|
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}, [precall]);
|
|
48
|
+
// useEffect(() => {
|
|
49
|
+
// if (precall) {
|
|
50
|
+
// setOrderCount(prevCount => prevCount + 1);
|
|
51
|
+
// }
|
|
52
|
+
// }, [precall]);
|
|
48
53
|
|
|
49
54
|
//on close alert functionality
|
|
50
55
|
const onCloseAlert = (alertType: string) => {
|
|
@@ -57,6 +62,28 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
57
62
|
|
|
58
63
|
return (
|
|
59
64
|
<>
|
|
65
|
+
{/* order_red_cross_alerts */}
|
|
66
|
+
{!isClientPortal && routeInfoData?.order_red_cross_alerts?.length > 0 && (
|
|
67
|
+
<FlagAlert
|
|
68
|
+
type="error"
|
|
69
|
+
title=""
|
|
70
|
+
description={
|
|
71
|
+
<FlagsStyle>
|
|
72
|
+
<div className="redCross">
|
|
73
|
+
<div
|
|
74
|
+
className="spanStyle"
|
|
75
|
+
dangerouslySetInnerHTML={{
|
|
76
|
+
__html: routeInfoData?.order_red_cross_alerts,
|
|
77
|
+
}}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
</FlagsStyle>
|
|
81
|
+
}
|
|
82
|
+
showOkButton={false}
|
|
83
|
+
onClose={() => onCloseAlert('isPostcode')}
|
|
84
|
+
/>
|
|
85
|
+
)}
|
|
86
|
+
|
|
60
87
|
{statusVal == 'on hold' && alertVisibility?.isHoldVisible && (
|
|
61
88
|
<StyledAlert>
|
|
62
89
|
<FlagAlert
|
|
@@ -64,7 +91,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
64
91
|
title={
|
|
65
92
|
<div
|
|
66
93
|
dangerouslySetInnerHTML={{
|
|
67
|
-
__html: routeInfoData?.
|
|
94
|
+
__html: routeInfoData?.order_info_alerts,
|
|
68
95
|
}}
|
|
69
96
|
></div>
|
|
70
97
|
}
|
|
@@ -81,7 +108,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
81
108
|
title={
|
|
82
109
|
<div
|
|
83
110
|
dangerouslySetInnerHTML={{
|
|
84
|
-
__html: routeInfoData?.
|
|
111
|
+
__html: routeInfoData?.order_info_alerts,
|
|
85
112
|
}}
|
|
86
113
|
></div>
|
|
87
114
|
}
|
|
@@ -92,24 +119,6 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
92
119
|
</StyledAlert>
|
|
93
120
|
)}
|
|
94
121
|
|
|
95
|
-
{precall && alertVisibility.isPreCall && (
|
|
96
|
-
<StyledAlert>
|
|
97
|
-
<FlagAlert
|
|
98
|
-
type="success"
|
|
99
|
-
title={
|
|
100
|
-
<div
|
|
101
|
-
dangerouslySetInnerHTML={{
|
|
102
|
-
__html: routeInfoData?.order_alert,
|
|
103
|
-
}}
|
|
104
|
-
></div>
|
|
105
|
-
}
|
|
106
|
-
description={``}
|
|
107
|
-
showOkButton={false}
|
|
108
|
-
onClose={() => onCloseAlert('isPreCall')}
|
|
109
|
-
/>
|
|
110
|
-
</StyledAlert>
|
|
111
|
-
)}
|
|
112
|
-
|
|
113
122
|
{statusVal == 'outstanding' && alertVisibility.isOutstanding && (
|
|
114
123
|
<StyledAlert>
|
|
115
124
|
<FlagAlert
|
|
@@ -117,7 +126,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
117
126
|
title={
|
|
118
127
|
<div
|
|
119
128
|
dangerouslySetInnerHTML={{
|
|
120
|
-
__html: routeInfoData?.
|
|
129
|
+
__html: routeInfoData?.order_info_alerts,
|
|
121
130
|
}}
|
|
122
131
|
></div>
|
|
123
132
|
}
|
|
@@ -127,6 +136,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
127
136
|
/>
|
|
128
137
|
</StyledAlert>
|
|
129
138
|
)}
|
|
139
|
+
|
|
130
140
|
{statusVal == 'awaiting confirmation' &&
|
|
131
141
|
alertVisibility.isAwaitingConfirmation && (
|
|
132
142
|
<StyledAlert>
|
|
@@ -135,7 +145,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
135
145
|
title={
|
|
136
146
|
<div
|
|
137
147
|
dangerouslySetInnerHTML={{
|
|
138
|
-
__html: routeInfoData?.
|
|
148
|
+
__html: routeInfoData?.order_info_alerts,
|
|
139
149
|
}}
|
|
140
150
|
></div>
|
|
141
151
|
}
|
|
@@ -152,7 +162,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
152
162
|
title={
|
|
153
163
|
<div
|
|
154
164
|
dangerouslySetInnerHTML={{
|
|
155
|
-
__html: routeInfoData?.
|
|
165
|
+
__html: routeInfoData?.order_info_alerts,
|
|
156
166
|
}}
|
|
157
167
|
></div>
|
|
158
168
|
}
|
|
@@ -165,11 +175,11 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
165
175
|
{statusVal == 'cancelled' && alertVisibility.isCancelled && (
|
|
166
176
|
<StyledAlert>
|
|
167
177
|
<FlagAlert
|
|
168
|
-
type="
|
|
178
|
+
type="info"
|
|
169
179
|
title={
|
|
170
180
|
<div
|
|
171
181
|
dangerouslySetInnerHTML={{
|
|
172
|
-
__html: routeInfoData?.
|
|
182
|
+
__html: routeInfoData?.order_info_alerts,
|
|
173
183
|
}}
|
|
174
184
|
></div>
|
|
175
185
|
}
|
|
@@ -179,6 +189,43 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
179
189
|
/>
|
|
180
190
|
</StyledAlert>
|
|
181
191
|
)}
|
|
192
|
+
|
|
193
|
+
{statusVal == 'confirmed' && alertVisibility.isConfirmed && (
|
|
194
|
+
<StyledAlert>
|
|
195
|
+
<FlagAlert
|
|
196
|
+
type="info"
|
|
197
|
+
title={
|
|
198
|
+
<div
|
|
199
|
+
dangerouslySetInnerHTML={{
|
|
200
|
+
__html: routeInfoData?.order_info_alerts,
|
|
201
|
+
}}
|
|
202
|
+
></div>
|
|
203
|
+
}
|
|
204
|
+
description={``}
|
|
205
|
+
showOkButton={false}
|
|
206
|
+
onClose={() => onCloseAlert('isConfirmed')}
|
|
207
|
+
/>
|
|
208
|
+
</StyledAlert>
|
|
209
|
+
)}
|
|
210
|
+
|
|
211
|
+
{statusVal == 'subcontracted' && alertVisibility.isSubcontracted && (
|
|
212
|
+
<StyledAlert>
|
|
213
|
+
<FlagAlert
|
|
214
|
+
type="info"
|
|
215
|
+
title={
|
|
216
|
+
<div
|
|
217
|
+
dangerouslySetInnerHTML={{
|
|
218
|
+
__html: routeInfoData?.order_info_alerts,
|
|
219
|
+
}}
|
|
220
|
+
></div>
|
|
221
|
+
}
|
|
222
|
+
description={``}
|
|
223
|
+
showOkButton={false}
|
|
224
|
+
onClose={() => onCloseAlert('isRouted')}
|
|
225
|
+
/>
|
|
226
|
+
</StyledAlert>
|
|
227
|
+
)}
|
|
228
|
+
|
|
182
229
|
{statusVal == 'enroute' && alertVisibility.isEnroute && (
|
|
183
230
|
<StyledAlert>
|
|
184
231
|
<FlagAlert
|
|
@@ -186,7 +233,7 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
186
233
|
title={
|
|
187
234
|
<div
|
|
188
235
|
dangerouslySetInnerHTML={{
|
|
189
|
-
__html: routeInfoData?.
|
|
236
|
+
__html: routeInfoData?.order_info_alerts,
|
|
190
237
|
}}
|
|
191
238
|
></div>
|
|
192
239
|
}
|
|
@@ -197,34 +244,89 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
197
244
|
</StyledAlert>
|
|
198
245
|
)}
|
|
199
246
|
|
|
200
|
-
{statusVal == '
|
|
247
|
+
{statusVal == 'routed' && alertVisibility.isRouted && (
|
|
201
248
|
<StyledAlert>
|
|
202
249
|
<FlagAlert
|
|
203
250
|
type="info"
|
|
204
251
|
title={
|
|
205
252
|
<div
|
|
206
253
|
dangerouslySetInnerHTML={{
|
|
207
|
-
__html: routeInfoData?.
|
|
254
|
+
__html: routeInfoData?.order_info_alerts,
|
|
208
255
|
}}
|
|
209
256
|
></div>
|
|
210
257
|
}
|
|
211
258
|
description={``}
|
|
212
259
|
showOkButton={false}
|
|
213
|
-
onClose={() => onCloseAlert('
|
|
260
|
+
onClose={() => onCloseAlert('isRouted')}
|
|
214
261
|
/>
|
|
215
262
|
</StyledAlert>
|
|
216
263
|
)}
|
|
217
264
|
|
|
218
|
-
{
|
|
265
|
+
{statusVal == 'precalled' && alertVisibility.isPreCall && (
|
|
266
|
+
<StyledAlert>
|
|
267
|
+
<FlagAlert
|
|
268
|
+
type="info"
|
|
269
|
+
title={
|
|
270
|
+
<div
|
|
271
|
+
dangerouslySetInnerHTML={{
|
|
272
|
+
__html: routeInfoData?.order_info_alerts,
|
|
273
|
+
}}
|
|
274
|
+
></div>
|
|
275
|
+
}
|
|
276
|
+
description={``}
|
|
277
|
+
showOkButton={false}
|
|
278
|
+
onClose={() => onCloseAlert('isPreCall')}
|
|
279
|
+
/>
|
|
280
|
+
</StyledAlert>
|
|
281
|
+
)}
|
|
282
|
+
|
|
283
|
+
{statusVal == 'on site' && alertVisibility.isOnSite && (
|
|
284
|
+
<StyledAlert>
|
|
285
|
+
<FlagAlert
|
|
286
|
+
type="info"
|
|
287
|
+
title={
|
|
288
|
+
<div
|
|
289
|
+
dangerouslySetInnerHTML={{
|
|
290
|
+
__html: routeInfoData?.order_info_alerts,
|
|
291
|
+
}}
|
|
292
|
+
></div>
|
|
293
|
+
}
|
|
294
|
+
description={``}
|
|
295
|
+
showOkButton={false}
|
|
296
|
+
onClose={() => onCloseAlert('isOnSite')}
|
|
297
|
+
/>
|
|
298
|
+
</StyledAlert>
|
|
299
|
+
)}
|
|
300
|
+
|
|
301
|
+
{statusVal == 'failed' && alertVisibility.isFailed && (
|
|
302
|
+
<StyledAlert>
|
|
303
|
+
<FlagAlert
|
|
304
|
+
type="info"
|
|
305
|
+
title={
|
|
306
|
+
<div
|
|
307
|
+
dangerouslySetInnerHTML={{
|
|
308
|
+
__html: routeInfoData?.order_info_alerts,
|
|
309
|
+
}}
|
|
310
|
+
></div>
|
|
311
|
+
}
|
|
312
|
+
description={``}
|
|
313
|
+
showOkButton={false}
|
|
314
|
+
onClose={() => onCloseAlert('isFailed')}
|
|
315
|
+
/>
|
|
316
|
+
</StyledAlert>
|
|
317
|
+
)}
|
|
318
|
+
|
|
319
|
+
{/* order_warnings_alerts */}
|
|
320
|
+
{!isClientPortal && routeInfoData?.order_warnings_alerts?.length > 0 && (
|
|
219
321
|
<FlagAlert
|
|
220
|
-
type="
|
|
322
|
+
type="warn"
|
|
221
323
|
title=""
|
|
222
324
|
description={
|
|
223
325
|
<FlagsStyle>
|
|
224
|
-
<div className="
|
|
326
|
+
<div className="">
|
|
225
327
|
<div
|
|
226
328
|
dangerouslySetInnerHTML={{
|
|
227
|
-
__html: routeInfoData
|
|
329
|
+
__html: routeInfoData?.order_warnings_alerts,
|
|
228
330
|
}}
|
|
229
331
|
/>
|
|
230
332
|
</div>
|
|
@@ -234,11 +336,58 @@ function OrderTemplate({ orderDetails, routeInfoData }: any) {
|
|
|
234
336
|
onClose={() => onCloseAlert('isPostcode')}
|
|
235
337
|
/>
|
|
236
338
|
)}
|
|
339
|
+
|
|
340
|
+
{/* order_green_check_alerts */}
|
|
341
|
+
{!isClientPortal && routeInfoData?.order_green_check_alerts?.length > 0 && (
|
|
342
|
+
<FlagAlert
|
|
343
|
+
type="success"
|
|
344
|
+
title=""
|
|
345
|
+
description={
|
|
346
|
+
<FlagsStyle>
|
|
347
|
+
<div className="">
|
|
348
|
+
<div
|
|
349
|
+
dangerouslySetInnerHTML={{
|
|
350
|
+
__html: routeInfoData?.order_green_check_alerts,
|
|
351
|
+
}}
|
|
352
|
+
/>
|
|
353
|
+
</div>
|
|
354
|
+
</FlagsStyle>
|
|
355
|
+
}
|
|
356
|
+
showOkButton={false}
|
|
357
|
+
onClose={() => onCloseAlert('isPostcode')}
|
|
358
|
+
/>
|
|
359
|
+
)}
|
|
360
|
+
|
|
361
|
+
{!isClientPortal &&
|
|
362
|
+
routeInfoData?.same_postcode_orders &&
|
|
363
|
+
alertVisibility.isPostcode && (
|
|
364
|
+
<FlagAlert
|
|
365
|
+
type="info"
|
|
366
|
+
title=""
|
|
367
|
+
description={
|
|
368
|
+
<FlagsStyle>
|
|
369
|
+
<div className="postcode-alert-content">
|
|
370
|
+
<div
|
|
371
|
+
dangerouslySetInnerHTML={{
|
|
372
|
+
__html: routeInfoData?.same_postcode_orders,
|
|
373
|
+
}}
|
|
374
|
+
/>
|
|
375
|
+
</div>
|
|
376
|
+
</FlagsStyle>
|
|
377
|
+
}
|
|
378
|
+
showOkButton={false}
|
|
379
|
+
onClose={() => onCloseAlert('isPostcode')}
|
|
380
|
+
/>
|
|
381
|
+
)}
|
|
237
382
|
</>
|
|
238
383
|
);
|
|
239
384
|
}
|
|
240
385
|
|
|
241
386
|
const FlagsStyle = styled.div`
|
|
387
|
+
.redCross {
|
|
388
|
+
font-size: 13px;
|
|
389
|
+
margin-top: 4px;
|
|
390
|
+
}
|
|
242
391
|
.postcode-alert-content {
|
|
243
392
|
> div {
|
|
244
393
|
> h4 {
|
|
@@ -251,6 +400,7 @@ const FlagsStyle = styled.div`
|
|
|
251
400
|
}
|
|
252
401
|
}
|
|
253
402
|
ul {
|
|
403
|
+
margin-bottom: 0;
|
|
254
404
|
}
|
|
255
405
|
|
|
256
406
|
li {
|
|
@@ -268,6 +418,7 @@ const FlagsStyle = styled.div`
|
|
|
268
418
|
> strong {
|
|
269
419
|
> a {
|
|
270
420
|
color: #6396e5;
|
|
421
|
+
|
|
271
422
|
font-family: Roboto;
|
|
272
423
|
font-size: 14px;
|
|
273
424
|
font-style: normal;
|
|
@@ -1,15 +1,36 @@
|
|
|
1
|
+
import { useCancelOrderProducts, useOrderStaticData } from '../../../store';
|
|
2
|
+
import { CancelOrderProductsType } from '../../../types';
|
|
1
3
|
import OrderActionsDropdown from '../../Dropdown';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
function ReturnAction() {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
+
const [orderStaticData] = useOrderStaticData();
|
|
7
|
+
const [, setCancelOrderProducts] = useCancelOrderProducts();
|
|
8
|
+
// const onSearch = () => {};
|
|
9
|
+
|
|
10
|
+
const returnActionOptions = orderStaticData?.order_product_return_action?.map(
|
|
11
|
+
(option: any) => ({
|
|
12
|
+
label: option?.value,
|
|
13
|
+
value: option?.value,
|
|
14
|
+
})
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
const onSelect = (selectedValue: any) => {
|
|
18
|
+
setCancelOrderProducts((prev: CancelOrderProductsType[]) =>
|
|
19
|
+
prev?.map((item: any) => ({
|
|
20
|
+
...item,
|
|
21
|
+
action: 'return',
|
|
22
|
+
return_action: selectedValue,
|
|
23
|
+
}))
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
6
27
|
return (
|
|
7
28
|
<OrderActionsDropdown
|
|
8
29
|
label="Return Action"
|
|
9
30
|
placeholder="Select Return Action"
|
|
10
|
-
options={
|
|
31
|
+
options={returnActionOptions}
|
|
11
32
|
onSelect={onSelect}
|
|
12
|
-
onSearch={onSearch}
|
|
33
|
+
// onSearch={onSearch}
|
|
13
34
|
/>
|
|
14
35
|
);
|
|
15
36
|
}
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
+
import { useCancelOrderProducts, useOrderStaticData } from '../../../store';
|
|
2
|
+
import { CancelOrderProductsType } from '../../../types';
|
|
1
3
|
import OrderActionsDropdown from '../../Dropdown';
|
|
2
4
|
import React from 'react';
|
|
3
5
|
function ReturnReason() {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
+
const [orderStaticData] = useOrderStaticData();
|
|
7
|
+
const [, setCancelOrderProducts] = useCancelOrderProducts();
|
|
8
|
+
|
|
9
|
+
const returnReasonsOptions = orderStaticData?.return_reasons?.map(
|
|
10
|
+
(option: any) => ({
|
|
11
|
+
label: option?.reason,
|
|
12
|
+
value: option?.reason,
|
|
13
|
+
})
|
|
14
|
+
);
|
|
15
|
+
const onSelect = (selectedValue: any) => {
|
|
16
|
+
setCancelOrderProducts((prev: CancelOrderProductsType[]) =>
|
|
17
|
+
prev?.map((item: any) => ({
|
|
18
|
+
...item,
|
|
19
|
+
action: 'return',
|
|
20
|
+
return_reason: selectedValue,
|
|
21
|
+
}))
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
// const onSearch = () => {};
|
|
25
|
+
|
|
6
26
|
return (
|
|
7
27
|
<OrderActionsDropdown
|
|
8
28
|
label="Return Reason"
|
|
9
29
|
placeholder="Select Return Reason"
|
|
10
|
-
options={
|
|
30
|
+
options={returnReasonsOptions}
|
|
11
31
|
onSelect={onSelect}
|
|
12
|
-
onSearch={onSearch}
|
|
32
|
+
// onSearch={onSearch}
|
|
13
33
|
/>
|
|
14
34
|
);
|
|
15
35
|
}
|
package/src/components/order-view/order-actions/actions/clear-booking-status/ClearBookingStatus.tsx
CHANGED
|
@@ -16,7 +16,11 @@ import { ApiResponse, OrdersType } from '../../../types';
|
|
|
16
16
|
import { useLoading } from '../../../../order-daily-overview/store/store';
|
|
17
17
|
import { notification } from 'antd';
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
interface IProps {
|
|
20
|
+
callOrderAlertsApi: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ClearBookingStatus = (props: IProps) => {
|
|
20
24
|
const [orderId] = useOrderId();
|
|
21
25
|
const [, setOrderDetails] = useOrderDetails();
|
|
22
26
|
const [, setPrevOrderDetails] = usePrevOrderDetails();
|
|
@@ -41,13 +45,16 @@ const ClearBookingStatus = () => {
|
|
|
41
45
|
method: 'GET',
|
|
42
46
|
performAction: false,
|
|
43
47
|
});
|
|
44
|
-
|
|
48
|
+
const callOrdersApi = async () => {
|
|
49
|
+
await props?.callOrderAlertsApi();
|
|
50
|
+
};
|
|
45
51
|
useEffect(() => {
|
|
46
52
|
setLoading(loading);
|
|
47
53
|
if (fetchedData && fetchedData?.data) {
|
|
48
54
|
const requiredData = fetchedData?.data;
|
|
49
55
|
setOrderDetails(requiredData[0]);
|
|
50
56
|
setPrevOrderDetails(requiredData[0]);
|
|
57
|
+
callOrdersApi();
|
|
51
58
|
setCurrentAction(undefined);
|
|
52
59
|
}
|
|
53
60
|
if (
|
|
@@ -26,7 +26,11 @@ import { compareOrderDetailsStates, filterObject } from '../../../utils';
|
|
|
26
26
|
import { format } from 'date-fns';
|
|
27
27
|
import { useConfirmOrderDate } from '../../store';
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
interface IProps {
|
|
30
|
+
callOrderAlertsApi: any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function ConfirmOrder(props: IProps) {
|
|
30
34
|
const [, setCurrentAction] = useCurrentAction();
|
|
31
35
|
const [orderDetails, setOrderDetails] = useOrderDetails();
|
|
32
36
|
const [prevOrderDetails, setPrevOrderDetails] = usePrevOrderDetails();
|
|
@@ -201,6 +205,7 @@ function ConfirmOrder() {
|
|
|
201
205
|
case 'no_contact':
|
|
202
206
|
// await confirmDeliveryDate();
|
|
203
207
|
notificationCall();
|
|
208
|
+
await fetchStatusData();
|
|
204
209
|
break;
|
|
205
210
|
|
|
206
211
|
case 'precall':
|
|
@@ -209,6 +214,7 @@ function ConfirmOrder() {
|
|
|
209
214
|
}
|
|
210
215
|
// await confirmDeliveryDate();
|
|
211
216
|
sendComs();
|
|
217
|
+
await fetchStatusData();
|
|
212
218
|
break;
|
|
213
219
|
default:
|
|
214
220
|
break;
|
|
@@ -247,9 +253,6 @@ function ConfirmOrder() {
|
|
|
247
253
|
}
|
|
248
254
|
}
|
|
249
255
|
|
|
250
|
-
// Execute actions first
|
|
251
|
-
await executeActions();
|
|
252
|
-
|
|
253
256
|
const keysToRemovefromOrders = [
|
|
254
257
|
'order_locked',
|
|
255
258
|
'order_communications',
|
|
@@ -288,8 +291,6 @@ function ConfirmOrder() {
|
|
|
288
291
|
[key: string]: any;
|
|
289
292
|
};
|
|
290
293
|
|
|
291
|
-
await executeSendComs();
|
|
292
|
-
|
|
293
294
|
if (response?.data?.length > 0) {
|
|
294
295
|
const updatedOrder = response?.data[0];
|
|
295
296
|
setOrderDetails(updatedOrder);
|
|
@@ -300,10 +301,15 @@ function ConfirmOrder() {
|
|
|
300
301
|
}
|
|
301
302
|
}
|
|
302
303
|
|
|
304
|
+
// Execute actions first
|
|
305
|
+
await executeActions();
|
|
306
|
+
await executeSendComs();
|
|
307
|
+
|
|
303
308
|
if (orderId && deliveryDate) {
|
|
304
309
|
const formattedDate = format(new Date(deliveryDate), 'yyyy-MM-dd');
|
|
305
310
|
setDeliveryDate(formattedDate);
|
|
306
311
|
}
|
|
312
|
+
await props?.callOrderAlertsApi();
|
|
307
313
|
|
|
308
314
|
setCurrentAction(undefined);
|
|
309
315
|
};
|
package/src/components/order-view/order-actions/actions/create-task-reminder/CreateReminderModal.tsx
CHANGED
|
@@ -39,7 +39,7 @@ function CreateReminderModal() {
|
|
|
39
39
|
deptId: number | null;
|
|
40
40
|
}[]
|
|
41
41
|
>([]);
|
|
42
|
-
const [, setFilteredUsers] = useState<typeof allUsers>([]);
|
|
42
|
+
const [filteredUsers, setFilteredUsers] = useState<typeof allUsers>([]);
|
|
43
43
|
|
|
44
44
|
const handleSelectUser = (value: string[]) => {
|
|
45
45
|
setReminderPayload((prevState: any) => ({
|
|
@@ -201,7 +201,7 @@ function CreateReminderModal() {
|
|
|
201
201
|
}
|
|
202
202
|
}, [fetchData]);
|
|
203
203
|
|
|
204
|
-
const userOptions =
|
|
204
|
+
const userOptions = filteredUsers?.map((user: any) => ({
|
|
205
205
|
label: `${user.fName} ${user.lName}`,
|
|
206
206
|
value: user.id,
|
|
207
207
|
}));
|