@bjsdistribution/dms-client-return 0.1.7-prod → 0.1.8-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/order-view/notes/order-dropdown/NewReturnDropdown.d.ts +3 -0
- 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/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/dms-client-return.cjs.development.js +2636 -335
- 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 +2700 -399
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +5 -3
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +43 -15
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +24 -11
- package/src/components/order-view/details-filters/right-side-filters/Details.tsx +28 -3
- package/src/components/order-view/index.tsx +29 -0
- package/src/components/order-view/notes/AddNote.tsx +14 -34
- package/src/components/order-view/notes/order-dropdown/NewReturnDropdown.tsx +8 -10
- 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/index.tsx +10 -0
- 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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef, useMemo, Suspense } from 'react';
|
|
2
2
|
import { useSearchParams, useNavigate, useParams, NavLink, useLocation, Routes, Route, Navigate } from 'react-router-dom';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
|
-
import { Select, notification, Skeleton, Empty, DatePicker, Input as Input$
|
|
4
|
+
import { Select, notification, Skeleton, Empty, DatePicker, Input as Input$3, Dropdown, Space } from 'antd';
|
|
5
5
|
import { useAtom, atom } from 'jotai';
|
|
6
6
|
import dayjs from 'dayjs';
|
|
7
|
-
import { format, isValid } from 'date-fns';
|
|
7
|
+
import { format, isValid, parseISO } from 'date-fns';
|
|
8
8
|
import { atomWithReducer } from 'jotai/utils';
|
|
9
|
-
import { useAxios, CountItem, device, ExportButton, useApiHook, Checkbox as Checkbox$1, AntTable, Alert, AntModal, Label as Label$
|
|
9
|
+
import { useAxios, CountItem, device, ExportButton, useApiHook, Checkbox as Checkbox$1, AntTable, Alert, AntModal, Label as Label$k, Input as Input$2, TextArea, FormSection, displayValueOrNA as displayValueOrNA$1, dropdownStyles, SelectDropdown, RadioButtonGroup as RadioButtonGroup$1, Switch, formatUtcToLocal, Button, PrivateIcon, SectionHeader, CrossIcon, AntSelect, CancelationModal, CancelAndCompleteAction, BackgroundModal as BackgroundModal$1, CalendarIcon, FlagAlert, WarningIcon, getBaseEndpoint, ViewIcon, SearchIcon as SearchIcon$1 } from '@bjsdistribution/dms-component-library';
|
|
10
10
|
import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@tanstack/react-table';
|
|
11
11
|
import Scrollbars from 'react-custom-scrollbars-2';
|
|
12
12
|
import { createPortal } from 'react-dom';
|
|
@@ -14,6 +14,8 @@ import 'tippy.js/dist/tippy.css';
|
|
|
14
14
|
import Tippy from '@tippyjs/react';
|
|
15
15
|
import 'react-datepicker/dist/react-datepicker.css';
|
|
16
16
|
import utc from 'dayjs/plugin/utc';
|
|
17
|
+
import SwitchSelector from 'react-switch-selector';
|
|
18
|
+
import { v4 } from 'uuid';
|
|
17
19
|
|
|
18
20
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
19
21
|
try {
|
|
@@ -784,7 +786,45 @@ var ordersInitialValue = {
|
|
|
784
786
|
order_communications: [],
|
|
785
787
|
id: null,
|
|
786
788
|
name: '',
|
|
787
|
-
carrier_id: null
|
|
789
|
+
carrier_id: null,
|
|
790
|
+
order_type: {
|
|
791
|
+
type: null
|
|
792
|
+
}
|
|
793
|
+
};
|
|
794
|
+
//force debrief
|
|
795
|
+
var chargesIntialValue = {
|
|
796
|
+
base_charge_type: 1,
|
|
797
|
+
base_charge: 0,
|
|
798
|
+
weight: 0,
|
|
799
|
+
drop_time: 0,
|
|
800
|
+
timed_service: 0,
|
|
801
|
+
wait_time: 0,
|
|
802
|
+
extra_floor: 0,
|
|
803
|
+
bulky_items: 0,
|
|
804
|
+
re_label: 0,
|
|
805
|
+
extra_cube: 0,
|
|
806
|
+
additional_box: 0,
|
|
807
|
+
additional_item: 0,
|
|
808
|
+
weekend: 0,
|
|
809
|
+
re_allocation: 0,
|
|
810
|
+
pre_dated: 0,
|
|
811
|
+
re_package: 0,
|
|
812
|
+
disassemble: 0,
|
|
813
|
+
qc: 0,
|
|
814
|
+
collection_qc: 0,
|
|
815
|
+
return_to_client: 0,
|
|
816
|
+
roc: 0,
|
|
817
|
+
unpack: 0,
|
|
818
|
+
packaging_disposal: 0,
|
|
819
|
+
assembly: 0,
|
|
820
|
+
debrief_notes: '',
|
|
821
|
+
recycle: 0,
|
|
822
|
+
admin: 0,
|
|
823
|
+
disposal: 0,
|
|
824
|
+
disposal_recycling: 0,
|
|
825
|
+
debrief_status: '',
|
|
826
|
+
new_order_status: '',
|
|
827
|
+
adhoc_charges: []
|
|
788
828
|
};
|
|
789
829
|
function useTabType() {
|
|
790
830
|
return useAtom(activeTabAtom);
|
|
@@ -846,6 +886,10 @@ var orderAlertsData = /*#__PURE__*/atom({});
|
|
|
846
886
|
function useOrderAlertsData() {
|
|
847
887
|
return useAtom(orderAlertsData);
|
|
848
888
|
}
|
|
889
|
+
var customerList = /*#__PURE__*/atom([]);
|
|
890
|
+
function useOrderCustomersList() {
|
|
891
|
+
return useAtom(customerList);
|
|
892
|
+
}
|
|
849
893
|
// Remainder count
|
|
850
894
|
var OrderDetails = /*#__PURE__*/atom(ordersInitialValue);
|
|
851
895
|
function useOrderDetails() {
|
|
@@ -972,6 +1016,51 @@ var globalOrderGetApi = /*#__PURE__*/atom(true);
|
|
|
972
1016
|
function useGlobalStateHitOrder() {
|
|
973
1017
|
return useAtom(globalOrderGetApi);
|
|
974
1018
|
}
|
|
1019
|
+
//force debrief states
|
|
1020
|
+
var globalEscData = /*#__PURE__*/atom([]);
|
|
1021
|
+
function useGlobalEscData() {
|
|
1022
|
+
return useAtom(globalEscData);
|
|
1023
|
+
}
|
|
1024
|
+
var activeTab = /*#__PURE__*/atom('success');
|
|
1025
|
+
function useActiveTab() {
|
|
1026
|
+
return useAtom(activeTab);
|
|
1027
|
+
}
|
|
1028
|
+
var chargesStateAtom = /*#__PURE__*/atom(chargesIntialValue);
|
|
1029
|
+
function useChargesState() {
|
|
1030
|
+
return useAtom(chargesStateAtom);
|
|
1031
|
+
}
|
|
1032
|
+
var failureReasonAtom = /*#__PURE__*/atom('');
|
|
1033
|
+
function useFailureReason() {
|
|
1034
|
+
return useAtom(failureReasonAtom);
|
|
1035
|
+
}
|
|
1036
|
+
var escalationCategoryAtom = /*#__PURE__*/atom('');
|
|
1037
|
+
function useEscalationCategory() {
|
|
1038
|
+
return useAtom(escalationCategoryAtom);
|
|
1039
|
+
}
|
|
1040
|
+
var escalationLevelAtom = /*#__PURE__*/atom('');
|
|
1041
|
+
function useEscalationLevel() {
|
|
1042
|
+
return useAtom(escalationLevelAtom);
|
|
1043
|
+
}
|
|
1044
|
+
var escalationReasonAtom = /*#__PURE__*/atom('');
|
|
1045
|
+
function useEscalationReason() {
|
|
1046
|
+
return useAtom(escalationReasonAtom);
|
|
1047
|
+
}
|
|
1048
|
+
var newStatusAtom = /*#__PURE__*/atom('');
|
|
1049
|
+
function useNewStatus() {
|
|
1050
|
+
return useAtom(newStatusAtom);
|
|
1051
|
+
}
|
|
1052
|
+
var orderCancelReasonAtom = /*#__PURE__*/atom('');
|
|
1053
|
+
function useOrderCancelReason() {
|
|
1054
|
+
return useAtom(orderCancelReasonAtom);
|
|
1055
|
+
}
|
|
1056
|
+
var orderHoldReasonAtom = /*#__PURE__*/atom('');
|
|
1057
|
+
function useOrderHoldReason() {
|
|
1058
|
+
return useAtom(orderHoldReasonAtom);
|
|
1059
|
+
}
|
|
1060
|
+
var isFailureReasonChangedAtom = /*#__PURE__*/atom(false);
|
|
1061
|
+
function useIsFailureReasonChanged() {
|
|
1062
|
+
return useAtom(isFailureReasonChangedAtom);
|
|
1063
|
+
}
|
|
975
1064
|
// Popup state Manage
|
|
976
1065
|
var initialState$1 = null;
|
|
977
1066
|
var popupReducer = function popupReducer(state, action) {
|
|
@@ -1040,7 +1129,8 @@ var countReducerAtom = /*#__PURE__*/atomWithReducer(initialState$1, popupReducer
|
|
|
1040
1129
|
var _templateObject;
|
|
1041
1130
|
function SelectionFilter() {
|
|
1042
1131
|
var _useCustomerData = useCustomerData(),
|
|
1043
|
-
customers = _useCustomerData[0]
|
|
1132
|
+
customers = _useCustomerData[0],
|
|
1133
|
+
setCustomers = _useCustomerData[1];
|
|
1044
1134
|
var _useSelectedAction = useSelectedAction(),
|
|
1045
1135
|
selectedFilterValue = _useSelectedAction[0],
|
|
1046
1136
|
setSelectedFilterValue = _useSelectedAction[1];
|
|
@@ -1071,6 +1161,26 @@ function SelectionFilter() {
|
|
|
1071
1161
|
var _useSearchParams = useSearchParams(),
|
|
1072
1162
|
searchParams = _useSearchParams[0];
|
|
1073
1163
|
var navigate = useNavigate();
|
|
1164
|
+
//API for client data
|
|
1165
|
+
var _useAxios = useAxios({
|
|
1166
|
+
endpoint: "/v1/return/product/customers/",
|
|
1167
|
+
method: 'GET',
|
|
1168
|
+
//@ts-ignore
|
|
1169
|
+
pagination: {
|
|
1170
|
+
is_pagination: false
|
|
1171
|
+
}
|
|
1172
|
+
}),
|
|
1173
|
+
fetchedCustomerData = _useAxios.data,
|
|
1174
|
+
loading = _useAxios.loading,
|
|
1175
|
+
fetchData = _useAxios.fetchData;
|
|
1176
|
+
useEffect(function () {
|
|
1177
|
+
fetchData();
|
|
1178
|
+
}, []);
|
|
1179
|
+
useEffect(function () {
|
|
1180
|
+
if (fetchedCustomerData && fetchedCustomerData != null && fetchedCustomerData.data) {
|
|
1181
|
+
setCustomers(fetchedCustomerData == null ? void 0 : fetchedCustomerData.data);
|
|
1182
|
+
}
|
|
1183
|
+
}, [loading]);
|
|
1074
1184
|
//new codee
|
|
1075
1185
|
var urlCustomerId = searchParams.get('customerId');
|
|
1076
1186
|
var urlActiontype = searchParams.get('type');
|
|
@@ -1099,7 +1209,7 @@ function SelectionFilter() {
|
|
|
1099
1209
|
return (client == null ? void 0 : client.value) == value;
|
|
1100
1210
|
});
|
|
1101
1211
|
if (filteredClient) {
|
|
1102
|
-
var _filteredClient$actio
|
|
1212
|
+
var _filteredClient$actio;
|
|
1103
1213
|
var mappedActions = Array.isArray(filteredClient == null ? void 0 : filteredClient.actions) ? filteredClient == null || (_filteredClient$actio = filteredClient.actions) == null ? void 0 : _filteredClient$actio.map(function (action) {
|
|
1104
1214
|
return {
|
|
1105
1215
|
label: action,
|
|
@@ -1107,10 +1217,12 @@ function SelectionFilter() {
|
|
|
1107
1217
|
};
|
|
1108
1218
|
}) : [];
|
|
1109
1219
|
setActionTypeOptions(mappedActions);
|
|
1110
|
-
var mappedLocations = Array.isArray(filteredClient == null ? void 0 : filteredClient.return_locations) ? filteredClient
|
|
1220
|
+
var mappedLocations = Array.isArray(filteredClient == null ? void 0 : filteredClient.return_locations) ? filteredClient.return_locations.filter(function (location) {
|
|
1221
|
+
return (location == null ? void 0 : location.location_name) && (location == null ? void 0 : location.token);
|
|
1222
|
+
}).map(function (location) {
|
|
1111
1223
|
return {
|
|
1112
|
-
label: location
|
|
1113
|
-
value: location
|
|
1224
|
+
label: location.location_name,
|
|
1225
|
+
value: location.token
|
|
1114
1226
|
};
|
|
1115
1227
|
}) : [];
|
|
1116
1228
|
setLocationOptions(mappedLocations);
|
|
@@ -1139,7 +1251,7 @@ function SelectionFilter() {
|
|
|
1139
1251
|
return (client == null ? void 0 : client.value) == urlCustomerId;
|
|
1140
1252
|
});
|
|
1141
1253
|
if (filteredClient) {
|
|
1142
|
-
var _filteredClient$actio2
|
|
1254
|
+
var _filteredClient$actio2;
|
|
1143
1255
|
var mappedActions = Array.isArray(filteredClient == null ? void 0 : filteredClient.actions) ? filteredClient == null || (_filteredClient$actio2 = filteredClient.actions) == null ? void 0 : _filteredClient$actio2.map(function (action) {
|
|
1144
1256
|
return {
|
|
1145
1257
|
label: action,
|
|
@@ -1147,7 +1259,11 @@ function SelectionFilter() {
|
|
|
1147
1259
|
};
|
|
1148
1260
|
}) : [];
|
|
1149
1261
|
setActionTypeOptions(mappedActions);
|
|
1150
|
-
var mappedLocations = Array.isArray(filteredClient == null ? void 0 : filteredClient.return_locations) ? filteredClient
|
|
1262
|
+
var mappedLocations = Array.isArray(filteredClient == null ? void 0 : filteredClient.return_locations) ? filteredClient.return_locations.filter(function (location) {
|
|
1263
|
+
var name = location == null ? void 0 : location.location_name;
|
|
1264
|
+
var token = location == null ? void 0 : location.token;
|
|
1265
|
+
return name && name !== 'null' && token && token !== 'null';
|
|
1266
|
+
}).map(function (location) {
|
|
1151
1267
|
return {
|
|
1152
1268
|
label: location == null ? void 0 : location.location_name,
|
|
1153
1269
|
value: location == null ? void 0 : location.token
|
|
@@ -1174,9 +1290,7 @@ function SelectionFilter() {
|
|
|
1174
1290
|
var currentSearch = window.location.search;
|
|
1175
1291
|
console.log(currentSearch, 'currentSearch');
|
|
1176
1292
|
if (!currentSearch.includes('filter')) {
|
|
1177
|
-
console.log('inside include');
|
|
1178
1293
|
// for dev
|
|
1179
|
-
//navigate(`filter?${queryParams.toString()}`);
|
|
1180
1294
|
navigate("/orders/view/return/filter?" + queryParams.toString());
|
|
1181
1295
|
// for local
|
|
1182
1296
|
//navigate(`/filter?${queryParams.toString()}`);
|
|
@@ -1316,7 +1430,7 @@ function SelectionFilter() {
|
|
|
1316
1430
|
placeholder: "Select Client Name",
|
|
1317
1431
|
onChange: handleClientChange,
|
|
1318
1432
|
style: {
|
|
1319
|
-
minWidth: '
|
|
1433
|
+
minWidth: '250px'
|
|
1320
1434
|
},
|
|
1321
1435
|
value: selectedClient,
|
|
1322
1436
|
allowClear: true,
|
|
@@ -1332,7 +1446,7 @@ function SelectionFilter() {
|
|
|
1332
1446
|
value: selectedFilterValue,
|
|
1333
1447
|
onChange: handleActionClick,
|
|
1334
1448
|
style: {
|
|
1335
|
-
minWidth: '
|
|
1449
|
+
minWidth: '200px'
|
|
1336
1450
|
},
|
|
1337
1451
|
allowClear: true,
|
|
1338
1452
|
onClear: handleClearAction
|
|
@@ -1342,7 +1456,7 @@ function SelectionFilter() {
|
|
|
1342
1456
|
placeholder: "Select Location",
|
|
1343
1457
|
onChange: handleLocationChange,
|
|
1344
1458
|
style: {
|
|
1345
|
-
minWidth: '
|
|
1459
|
+
minWidth: '200px'
|
|
1346
1460
|
},
|
|
1347
1461
|
allowClear: true,
|
|
1348
1462
|
mode: "multiple"
|
|
@@ -2279,7 +2393,6 @@ var ReturnOrderTable = function ReturnOrderTable() {
|
|
|
2279
2393
|
printToogle = _usePrintOptionTOggle[0],
|
|
2280
2394
|
setPrintToggle = _usePrintOptionTOggle[1];
|
|
2281
2395
|
var _useReturnPayload = useReturnPayload(),
|
|
2282
|
-
createReturn = _useReturnPayload[0],
|
|
2283
2396
|
setReturnPayload = _useReturnPayload[1];
|
|
2284
2397
|
var _useNewReturnPayload = useNewReturnPayload(),
|
|
2285
2398
|
newpayload = _useNewReturnPayload[0],
|
|
@@ -2292,6 +2405,9 @@ var ReturnOrderTable = function ReturnOrderTable() {
|
|
|
2292
2405
|
setPaginationObject = _UsePaginationData[1];
|
|
2293
2406
|
var _usefetchAgain = usefetchAgain(),
|
|
2294
2407
|
callForFetch = _usefetchAgain[0];
|
|
2408
|
+
var _useSearchParams = useSearchParams(),
|
|
2409
|
+
searchParams = _useSearchParams[0];
|
|
2410
|
+
var urlCustomerId = searchParams.get('customerId');
|
|
2295
2411
|
//sorting
|
|
2296
2412
|
var _useState = useState(null),
|
|
2297
2413
|
sortConfig = _useState[0],
|
|
@@ -2401,6 +2517,15 @@ var ReturnOrderTable = function ReturnOrderTable() {
|
|
|
2401
2517
|
}
|
|
2402
2518
|
// setShouldPerformAction(false);
|
|
2403
2519
|
}, [fetchedOrderData, returnDataLoad, locationData, state, callForFetch]);
|
|
2520
|
+
var _useCustomerData = useCustomerData(),
|
|
2521
|
+
customers = _useCustomerData[0];
|
|
2522
|
+
var selectedCustomer = customers == null ? void 0 : customers.find(function (customer) {
|
|
2523
|
+
var _customer$customer_id;
|
|
2524
|
+
var customerId = customer == null || (_customer$customer_id = customer.customer_id) == null ? void 0 : _customer$customer_id.toString();
|
|
2525
|
+
return customerId && customerId === urlCustomerId;
|
|
2526
|
+
});
|
|
2527
|
+
var accountNumber = selectedCustomer == null ? void 0 : selectedCustomer.account_number;
|
|
2528
|
+
console.log(selectedCustomer, 'selectedCustomer');
|
|
2404
2529
|
var handleSelectAll = function handleSelectAll(e) {
|
|
2405
2530
|
var isChecked = e.target.checked;
|
|
2406
2531
|
setSelectAll(isChecked);
|
|
@@ -2421,8 +2546,8 @@ var ReturnOrderTable = function ReturnOrderTable() {
|
|
|
2421
2546
|
var newPayload = filteredData.map(function (loc) {
|
|
2422
2547
|
return {
|
|
2423
2548
|
id: loc.id,
|
|
2424
|
-
account_number:
|
|
2425
|
-
customer_id:
|
|
2549
|
+
account_number: accountNumber,
|
|
2550
|
+
customer_id: Number(urlCustomerId),
|
|
2426
2551
|
products: [loc == null ? void 0 : loc.legacy_product_id],
|
|
2427
2552
|
return_action: loc == null ? void 0 : loc.product_return_action,
|
|
2428
2553
|
return_location_token: (loc == null ? void 0 : loc.return_location) || null
|
|
@@ -2463,8 +2588,8 @@ var ReturnOrderTable = function ReturnOrderTable() {
|
|
|
2463
2588
|
var _returnData$filter;
|
|
2464
2589
|
var newReturnPayload = {
|
|
2465
2590
|
id: id,
|
|
2466
|
-
account_number:
|
|
2467
|
-
customer_id:
|
|
2591
|
+
account_number: accountNumber,
|
|
2592
|
+
customer_id: Number(urlCustomerId),
|
|
2468
2593
|
products: [legacy_product_id],
|
|
2469
2594
|
return_action: product_return_action || null,
|
|
2470
2595
|
return_location_token: return_location || null
|
|
@@ -2509,7 +2634,7 @@ var ReturnOrderTable = function ReturnOrderTable() {
|
|
|
2509
2634
|
return React.createElement(React.Fragment, null, React.createElement(StyledTableWrapper$1, {
|
|
2510
2635
|
className: "fortables"
|
|
2511
2636
|
}, React.createElement(StyledTable$1, null, React.createElement("thead", null, React.createElement("tr", null, returnData != null && returnData.some(function (item) {
|
|
2512
|
-
return (item == null ? void 0 : item.product_return_action) === 'RTS';
|
|
2637
|
+
return (item == null ? void 0 : item.product_return_action) === 'RTS' && (item == null ? void 0 : item.return_location) !== 'null' && (item == null ? void 0 : item.return_location) !== null;
|
|
2513
2638
|
}) ? React.createElement("th", {
|
|
2514
2639
|
className: "emailInvoiceCheckbox"
|
|
2515
2640
|
}, React.createElement(Checkbox$1, {
|
|
@@ -2562,7 +2687,7 @@ var ReturnOrderTable = function ReturnOrderTable() {
|
|
|
2562
2687
|
}, React.createElement(EmptyDataContainer, null, React.createElement(Empty, null)))) : sortedData == null ? void 0 : sortedData.map(function (item, index) {
|
|
2563
2688
|
return React.createElement("tr", {
|
|
2564
2689
|
key: item.id
|
|
2565
|
-
}, React.createElement("td", null, (item == null ? void 0 : item.product_return_action) === 'RTS' ? React.createElement(Checkbox$1, {
|
|
2690
|
+
}, React.createElement("td", null, (item == null ? void 0 : item.product_return_action) === 'RTS' && (item == null ? void 0 : item.return_location) !== 'null' && (item == null ? void 0 : item.return_location) !== null ? React.createElement(Checkbox$1, {
|
|
2566
2691
|
className: "custom-check",
|
|
2567
2692
|
checked: selectedReturnOrder.some(function (selectedInvoice) {
|
|
2568
2693
|
return (selectedInvoice == null ? void 0 : selectedInvoice.id) === (item == null ? void 0 : item.id);
|
|
@@ -2619,6 +2744,26 @@ var capitalize = function capitalize(input) {
|
|
|
2619
2744
|
return _char.toUpperCase();
|
|
2620
2745
|
});
|
|
2621
2746
|
};
|
|
2747
|
+
var getBaseUrlSymbol = function getBaseUrlSymbol() {
|
|
2748
|
+
var storedSymbol = localStorage.getItem('baseUrlSymbol');
|
|
2749
|
+
if (!storedSymbol) {
|
|
2750
|
+
localStorage.setItem('baseUrlSymbol', '£');
|
|
2751
|
+
return '£';
|
|
2752
|
+
}
|
|
2753
|
+
return storedSymbol;
|
|
2754
|
+
};
|
|
2755
|
+
var handleKeyDownDebrief = function handleKeyDownDebrief(e) {
|
|
2756
|
+
// Allowed keys: numbers (0-9), '.'
|
|
2757
|
+
var allowedKeys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'ArrowLeft', 'ArrowRight'];
|
|
2758
|
+
// Allow backspace, delete and Tab keys
|
|
2759
|
+
if (e.key === 'Backspace' || e.key === 'Delete' || e.key === 'Tab') {
|
|
2760
|
+
return;
|
|
2761
|
+
}
|
|
2762
|
+
// Prevent input if key is not in allowedKeys
|
|
2763
|
+
if (!allowedKeys.includes(e.key)) {
|
|
2764
|
+
e.preventDefault();
|
|
2765
|
+
}
|
|
2766
|
+
};
|
|
2622
2767
|
var DefectsData = [{
|
|
2623
2768
|
action: 'Route',
|
|
2624
2769
|
type: 'Product',
|
|
@@ -4350,7 +4495,7 @@ function RecipientName() {
|
|
|
4350
4495
|
});
|
|
4351
4496
|
});
|
|
4352
4497
|
};
|
|
4353
|
-
return React.createElement(Container$6, null, React.createElement(Wrapper$2, null, React.createElement(Label$
|
|
4498
|
+
return React.createElement(Container$6, null, React.createElement(Wrapper$2, null, React.createElement(Label$k, {
|
|
4354
4499
|
label: "Recipient Name",
|
|
4355
4500
|
htmlFor: "recipient-name"
|
|
4356
4501
|
}), showCopyIcon && React.createElement(CopyText, {
|
|
@@ -4366,7 +4511,7 @@ function RecipientName() {
|
|
|
4366
4511
|
}
|
|
4367
4512
|
var Wrapper$2 = /*#__PURE__*/styled.div(_templateObject$i || (_templateObject$i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 5px;\n"])));
|
|
4368
4513
|
var Container$6 = /*#__PURE__*/styled.div(_templateObject2$d || (_templateObject2$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n"])));
|
|
4369
|
-
var InputStyled = /*#__PURE__*/styled(Input$
|
|
4514
|
+
var InputStyled = /*#__PURE__*/styled(Input$2)(_templateObject3$5 || (_templateObject3$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* Hide autofill suggestions in Safari */\n border-radius: 25px;\n &:-webkit-autofill {\n -webkit-box-shadow: 0 0 0 100px white inset;\n -webkit-text-fill-color: black;\n }\n\n &:-webkit-autofill::first-line {\n font-family: 'inherit';\n font-size: inherit;\n }\n"])));
|
|
4370
4515
|
|
|
4371
4516
|
var _templateObject$j, _templateObject2$e, _templateObject3$6;
|
|
4372
4517
|
function Address() {
|
|
@@ -4390,7 +4535,7 @@ function Address() {
|
|
|
4390
4535
|
});
|
|
4391
4536
|
});
|
|
4392
4537
|
};
|
|
4393
|
-
return React.createElement(Container$7, null, React.createElement(Wrapper$3, null, React.createElement(Label$
|
|
4538
|
+
return React.createElement(Container$7, null, React.createElement(Wrapper$3, null, React.createElement(Label$k, {
|
|
4394
4539
|
label: "Address",
|
|
4395
4540
|
htmlFor: "address"
|
|
4396
4541
|
}), showCopyIcon && React.createElement(CopyText, {
|
|
@@ -4429,12 +4574,12 @@ function Postcode() {
|
|
|
4429
4574
|
});
|
|
4430
4575
|
});
|
|
4431
4576
|
};
|
|
4432
|
-
return React.createElement(Container$8, null, React.createElement(Wrapper$4, null, React.createElement(Label$
|
|
4577
|
+
return React.createElement(Container$8, null, React.createElement(Wrapper$4, null, React.createElement(Label$k, {
|
|
4433
4578
|
label: "Postcode",
|
|
4434
4579
|
htmlFor: "postcode"
|
|
4435
4580
|
}), showCopyIcon && React.createElement(CopyText, {
|
|
4436
4581
|
text: orderRecipient == null ? void 0 : orderRecipient.postcode
|
|
4437
|
-
})), React.createElement(Input$
|
|
4582
|
+
})), React.createElement(Input$2, {
|
|
4438
4583
|
name: "postcode",
|
|
4439
4584
|
type: "text",
|
|
4440
4585
|
placeholder: "Enter Postcode",
|
|
@@ -4468,7 +4613,7 @@ function Latitude() {
|
|
|
4468
4613
|
});
|
|
4469
4614
|
});
|
|
4470
4615
|
};
|
|
4471
|
-
return React.createElement(Container$9, null, React.createElement(Label$
|
|
4616
|
+
return React.createElement(Container$9, null, React.createElement(Label$k, {
|
|
4472
4617
|
label: "Latitude",
|
|
4473
4618
|
htmlFor: "lat"
|
|
4474
4619
|
}), React.createElement(CustomInput, {
|
|
@@ -4481,7 +4626,7 @@ function Latitude() {
|
|
|
4481
4626
|
readOnly: true
|
|
4482
4627
|
}));
|
|
4483
4628
|
}
|
|
4484
|
-
var CustomInput = /*#__PURE__*/styled(Input$
|
|
4629
|
+
var CustomInput = /*#__PURE__*/styled(Input$2)(_templateObject$l || (_templateObject$l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n opacity: 0.8;\n background-color: #f4f4f4;\n pointer-events: none;\n"])));
|
|
4485
4630
|
var Container$9 = /*#__PURE__*/styled.div(_templateObject2$g || (_templateObject2$g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
4486
4631
|
|
|
4487
4632
|
var _templateObject$m, _templateObject2$h;
|
|
@@ -4503,7 +4648,7 @@ function Longitude() {
|
|
|
4503
4648
|
});
|
|
4504
4649
|
});
|
|
4505
4650
|
};
|
|
4506
|
-
return React.createElement(Container$a, null, React.createElement(Label$
|
|
4651
|
+
return React.createElement(Container$a, null, React.createElement(Label$k, {
|
|
4507
4652
|
label: "Longitude",
|
|
4508
4653
|
htmlFor: "long"
|
|
4509
4654
|
}), React.createElement(CustomInput$1, {
|
|
@@ -4516,7 +4661,7 @@ function Longitude() {
|
|
|
4516
4661
|
readOnly: true
|
|
4517
4662
|
}));
|
|
4518
4663
|
}
|
|
4519
|
-
var CustomInput$1 = /*#__PURE__*/styled(Input$
|
|
4664
|
+
var CustomInput$1 = /*#__PURE__*/styled(Input$2)(_templateObject$m || (_templateObject$m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n opacity: 0.8;\n background-color: #f4f4f4;\n pointer-events: none;\n"])));
|
|
4520
4665
|
var Container$a = /*#__PURE__*/styled.div(_templateObject2$h || (_templateObject2$h = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
4521
4666
|
|
|
4522
4667
|
var _templateObject$n, _templateObject2$i, _templateObject3$7, _templateObject4$3, _templateObject5$2;
|
|
@@ -4559,7 +4704,7 @@ function What3words() {
|
|
|
4559
4704
|
});
|
|
4560
4705
|
}
|
|
4561
4706
|
};
|
|
4562
|
-
return React.createElement(Container$b, null, React.createElement(Label$
|
|
4707
|
+
return React.createElement(Container$b, null, React.createElement(Label$k, {
|
|
4563
4708
|
label: "What3Words Address",
|
|
4564
4709
|
htmlFor: "w3w"
|
|
4565
4710
|
}), React.createElement(Wrapper$5, null, React.createElement(What3wordsPrefix, null, React.createElement(What3WordsIcon, null)), React.createElement(CustomInput$2, {
|
|
@@ -4572,7 +4717,7 @@ function What3words() {
|
|
|
4572
4717
|
}
|
|
4573
4718
|
var What3wordsPrefix = /*#__PURE__*/styled.div(_templateObject$n || (_templateObject$n = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: absolute;\n top: 13px;\n left: 12px;\n"])));
|
|
4574
4719
|
var Wrapper$5 = /*#__PURE__*/styled.div(_templateObject2$i || (_templateObject2$i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n"])));
|
|
4575
|
-
var CustomInput$2 = /*#__PURE__*/styled(Input$
|
|
4720
|
+
var CustomInput$2 = /*#__PURE__*/styled(Input$2)(_templateObject3$7 || (_templateObject3$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-radius: 25px;\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n padding-left: 40px;\n"])));
|
|
4576
4721
|
var Container$b = /*#__PURE__*/styled.div(_templateObject4$3 || (_templateObject4$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
4577
4722
|
var ErrorText = /*#__PURE__*/styled.span(_templateObject5$2 || (_templateObject5$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n"])));
|
|
4578
4723
|
|
|
@@ -4636,7 +4781,7 @@ function ContactHome() {
|
|
|
4636
4781
|
});
|
|
4637
4782
|
}
|
|
4638
4783
|
};
|
|
4639
|
-
return React.createElement(MainContainer, null, React.createElement(Wrapper$6, null, React.createElement(Label$
|
|
4784
|
+
return React.createElement(MainContainer, null, React.createElement(Wrapper$6, null, React.createElement(Label$k, {
|
|
4640
4785
|
label: "Contact Home",
|
|
4641
4786
|
htmlFor: "contact-home"
|
|
4642
4787
|
})), React.createElement(InputContainer, null, React.createElement(CustomInput$3, {
|
|
@@ -4651,7 +4796,7 @@ function ContactHome() {
|
|
|
4651
4796
|
})), errors.homeContactError && React.createElement(ErrorText$1, null, errors.homeContactError));
|
|
4652
4797
|
}
|
|
4653
4798
|
var Wrapper$6 = /*#__PURE__*/styled.div(_templateObject$p || (_templateObject$p = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 5px;\n"])));
|
|
4654
|
-
var CustomInput$3 = /*#__PURE__*/styled(Input$
|
|
4799
|
+
var CustomInput$3 = /*#__PURE__*/styled(Input$2)(_templateObject2$k || (_templateObject2$k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 80%;\n // @media (max-width: 1024px) {\n // width: 80%;\n // }\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n"])));
|
|
4655
4800
|
var InputContainer = /*#__PURE__*/styled.div(_templateObject3$9 || (_templateObject3$9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 7px;\n align-items: center;\n"])));
|
|
4656
4801
|
var MainContainer = /*#__PURE__*/styled.div(_templateObject4$4 || (_templateObject4$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
4657
4802
|
var ErrorText$1 = /*#__PURE__*/styled.span(_templateObject5$3 || (_templateObject5$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n"])));
|
|
@@ -4706,7 +4851,7 @@ function ContactWork() {
|
|
|
4706
4851
|
});
|
|
4707
4852
|
}
|
|
4708
4853
|
};
|
|
4709
|
-
return React.createElement(Container$d, null, React.createElement(Wrapper$7, null, React.createElement(Label$
|
|
4854
|
+
return React.createElement(Container$d, null, React.createElement(Wrapper$7, null, React.createElement(Label$k, {
|
|
4710
4855
|
label: "Contact Work",
|
|
4711
4856
|
htmlFor: "contact-work"
|
|
4712
4857
|
})), React.createElement(InputContainer$1, null, React.createElement(CustomInput$4, {
|
|
@@ -4722,7 +4867,7 @@ function ContactWork() {
|
|
|
4722
4867
|
}
|
|
4723
4868
|
var InputContainer$1 = /*#__PURE__*/styled.div(_templateObject$q || (_templateObject$q = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 7px;\n align-items: center;\n"])));
|
|
4724
4869
|
var Wrapper$7 = /*#__PURE__*/styled.div(_templateObject2$l || (_templateObject2$l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 5px;\n"])));
|
|
4725
|
-
var CustomInput$4 = /*#__PURE__*/styled(Input$
|
|
4870
|
+
var CustomInput$4 = /*#__PURE__*/styled(Input$2)(_templateObject3$a || (_templateObject3$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n"])));
|
|
4726
4871
|
var Container$d = /*#__PURE__*/styled.div(_templateObject4$5 || (_templateObject4$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
4727
4872
|
var ErrorText$2 = /*#__PURE__*/styled.span(_templateObject5$4 || (_templateObject5$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n"])));
|
|
4728
4873
|
|
|
@@ -4786,7 +4931,7 @@ function ContactMobile() {
|
|
|
4786
4931
|
});
|
|
4787
4932
|
}
|
|
4788
4933
|
};
|
|
4789
|
-
return React.createElement(Container$f, null, React.createElement(Wrapper$8, null, React.createElement(Label$
|
|
4934
|
+
return React.createElement(Container$f, null, React.createElement(Wrapper$8, null, React.createElement(Label$k, {
|
|
4790
4935
|
label: "Contact Mobile",
|
|
4791
4936
|
htmlFor: "contact-work"
|
|
4792
4937
|
}), showCopyIcon && React.createElement(CopyText, {
|
|
@@ -4804,7 +4949,7 @@ function ContactMobile() {
|
|
|
4804
4949
|
}
|
|
4805
4950
|
var InputContainer$2 = /*#__PURE__*/styled.div(_templateObject$s || (_templateObject$s = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 7px;\n align-items: center;\n"])));
|
|
4806
4951
|
var Wrapper$8 = /*#__PURE__*/styled.div(_templateObject2$m || (_templateObject2$m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 5px;\n"])));
|
|
4807
|
-
var CustomInput$5 = /*#__PURE__*/styled(Input$
|
|
4952
|
+
var CustomInput$5 = /*#__PURE__*/styled(Input$2)(_templateObject3$b || (_templateObject3$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 80%;\n\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n"])));
|
|
4808
4953
|
var Container$f = /*#__PURE__*/styled.div(_templateObject4$6 || (_templateObject4$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
4809
4954
|
var ErrorText$3 = /*#__PURE__*/styled.span(_templateObject5$5 || (_templateObject5$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: red;\n font-size: 0.85rem;\n margin-top: 4px;\n"])));
|
|
4810
4955
|
|
|
@@ -4840,10 +4985,10 @@ function ContactEmail() {
|
|
|
4840
4985
|
});
|
|
4841
4986
|
});
|
|
4842
4987
|
};
|
|
4843
|
-
return React.createElement(Container$g, null, React.createElement(Wrapper$9, null, React.createElement(Label$
|
|
4988
|
+
return React.createElement(Container$g, null, React.createElement(Wrapper$9, null, React.createElement(Label$k, {
|
|
4844
4989
|
label: "Email",
|
|
4845
4990
|
htmlFor: "email-id"
|
|
4846
|
-
})), React.createElement(Input$
|
|
4991
|
+
})), React.createElement(Input$2, {
|
|
4847
4992
|
name: "email-id",
|
|
4848
4993
|
type: "email",
|
|
4849
4994
|
placeholder: "Email",
|
|
@@ -4875,7 +5020,7 @@ var _templateObject$w, _templateObject2$q, _templateObject3$d;
|
|
|
4875
5020
|
function ConsignmentNumber() {
|
|
4876
5021
|
var _useOrderDetails = useOrderDetails(),
|
|
4877
5022
|
orderDetails = _useOrderDetails[0];
|
|
4878
|
-
return React.createElement(Container$i, null, React.createElement(Wrapper$a, null, React.createElement(Label$
|
|
5023
|
+
return React.createElement(Container$i, null, React.createElement(Wrapper$a, null, React.createElement(Label$k, {
|
|
4879
5024
|
label: "Consignment Number"
|
|
4880
5025
|
}), React.createElement(CopyText, {
|
|
4881
5026
|
text: displayValueOrNA$1(orderDetails.consignment)
|
|
@@ -4899,12 +5044,12 @@ function RecipientReference() {
|
|
|
4899
5044
|
});
|
|
4900
5045
|
});
|
|
4901
5046
|
};
|
|
4902
|
-
return React.createElement(Container$j, null, React.createElement(Wrapper$b, null, React.createElement(Label$
|
|
5047
|
+
return React.createElement(Container$j, null, React.createElement(Wrapper$b, null, React.createElement(Label$k, {
|
|
4903
5048
|
label: "Recipient Reference",
|
|
4904
5049
|
htmlFor: "recipient-reference"
|
|
4905
5050
|
}), showCopyIcon && React.createElement(CopyText, {
|
|
4906
5051
|
text: orderRecipient
|
|
4907
|
-
})), React.createElement(Input$
|
|
5052
|
+
})), React.createElement(Input$2, {
|
|
4908
5053
|
name: "recipient-reference",
|
|
4909
5054
|
type: "text",
|
|
4910
5055
|
placeholder: "Enter Recipient Reference",
|
|
@@ -4932,7 +5077,7 @@ function DepotDropdown() {
|
|
|
4932
5077
|
});
|
|
4933
5078
|
});
|
|
4934
5079
|
};
|
|
4935
|
-
return React.createElement(FormContainer, null, React.createElement(Label$
|
|
5080
|
+
return React.createElement(FormContainer, null, React.createElement(Label$k, {
|
|
4936
5081
|
label: "Depot",
|
|
4937
5082
|
htmlFor: "depotDropdown"
|
|
4938
5083
|
}), React.createElement(StyledSelectDropdown, {
|
|
@@ -4969,7 +5114,7 @@ function Droptime() {
|
|
|
4969
5114
|
});
|
|
4970
5115
|
});
|
|
4971
5116
|
};
|
|
4972
|
-
return React.createElement(Container$k, null, React.createElement(Label$
|
|
5117
|
+
return React.createElement(Container$k, null, React.createElement(Label$k, {
|
|
4973
5118
|
label: "Droptime",
|
|
4974
5119
|
htmlFor: "droptime"
|
|
4975
5120
|
}), React.createElement(CustomInput$6, {
|
|
@@ -4981,7 +5126,7 @@ function Droptime() {
|
|
|
4981
5126
|
onChange: onChange
|
|
4982
5127
|
}));
|
|
4983
5128
|
}
|
|
4984
|
-
var CustomInput$6 = /*#__PURE__*/styled(Input$
|
|
5129
|
+
var CustomInput$6 = /*#__PURE__*/styled(Input$2)(_templateObject$z || (_templateObject$z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n &::-webkit-outer-spin-button,\n &::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n &:focus-visible {\n outline: none;\n }\n"])));
|
|
4985
5130
|
var Container$k = /*#__PURE__*/styled.div(_templateObject2$t || (_templateObject2$t = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
4986
5131
|
|
|
4987
5132
|
var _templateObject$A;
|
|
@@ -5023,7 +5168,7 @@ function DeliveryDate() {
|
|
|
5023
5168
|
});
|
|
5024
5169
|
}
|
|
5025
5170
|
};
|
|
5026
|
-
return React.createElement(MainContainer$1, null, React.createElement(Label$
|
|
5171
|
+
return React.createElement(MainContainer$1, null, React.createElement(Label$k, {
|
|
5027
5172
|
label: "Delivery Date"
|
|
5028
5173
|
}), React.createElement(DatePicker, {
|
|
5029
5174
|
onChange: onChange,
|
|
@@ -5081,7 +5226,7 @@ function Carrier() {
|
|
|
5081
5226
|
});
|
|
5082
5227
|
});
|
|
5083
5228
|
};
|
|
5084
|
-
return React.createElement(FormContainer$1, null, React.createElement(Label$
|
|
5229
|
+
return React.createElement(FormContainer$1, null, React.createElement(Label$k, {
|
|
5085
5230
|
label: "Carrier",
|
|
5086
5231
|
htmlFor: "CarrierDropdown"
|
|
5087
5232
|
}), React.createElement(SelectDropdown, {
|
|
@@ -5110,12 +5255,12 @@ function OrderNumber() {
|
|
|
5110
5255
|
});
|
|
5111
5256
|
});
|
|
5112
5257
|
};
|
|
5113
|
-
return React.createElement(Container$l, null, React.createElement(Wrapper$c, null, React.createElement(Label$
|
|
5258
|
+
return React.createElement(Container$l, null, React.createElement(Wrapper$c, null, React.createElement(Label$k, {
|
|
5114
5259
|
label: "Order Number",
|
|
5115
5260
|
htmlFor: "order-number"
|
|
5116
5261
|
}), showCopyIcon && React.createElement(CopyText, {
|
|
5117
5262
|
text: orderDetails == null ? void 0 : orderDetails.order_number
|
|
5118
|
-
})), React.createElement(Input$
|
|
5263
|
+
})), React.createElement(Input$2, {
|
|
5119
5264
|
name: "order-number",
|
|
5120
5265
|
type: "text",
|
|
5121
5266
|
placeholder: "Order Number",
|
|
@@ -5161,7 +5306,7 @@ function ScheduleAfter() {
|
|
|
5161
5306
|
});
|
|
5162
5307
|
}
|
|
5163
5308
|
};
|
|
5164
|
-
return React.createElement(MainContainer$2, null, React.createElement(Label$
|
|
5309
|
+
return React.createElement(MainContainer$2, null, React.createElement(Label$k, {
|
|
5165
5310
|
label: "Schedule After"
|
|
5166
5311
|
}), React.createElement(DatePicker, {
|
|
5167
5312
|
onChange: onChange,
|
|
@@ -5195,7 +5340,7 @@ function VehicleTypeDropdown() {
|
|
|
5195
5340
|
});
|
|
5196
5341
|
});
|
|
5197
5342
|
};
|
|
5198
|
-
return React.createElement(FormContainer$2, null, React.createElement(Label$
|
|
5343
|
+
return React.createElement(FormContainer$2, null, React.createElement(Label$k, {
|
|
5199
5344
|
label: "Vehicle Type",
|
|
5200
5345
|
htmlFor: "vehicleType"
|
|
5201
5346
|
}), React.createElement(StyledSelectDropdown, {
|
|
@@ -5233,7 +5378,7 @@ function OrderStatusNote() {
|
|
|
5233
5378
|
});
|
|
5234
5379
|
});
|
|
5235
5380
|
};
|
|
5236
|
-
return React.createElement(Container$m, null, React.createElement(Label$
|
|
5381
|
+
return React.createElement(Container$m, null, React.createElement(Label$k, {
|
|
5237
5382
|
label: "Order Status Note"
|
|
5238
5383
|
}), React.createElement(CustomTextArea, {
|
|
5239
5384
|
value: (orderDetails == null ? void 0 : orderDetails.order_status_note) || '',
|
|
@@ -5256,7 +5401,7 @@ function DeliveryInstructions() {
|
|
|
5256
5401
|
});
|
|
5257
5402
|
});
|
|
5258
5403
|
};
|
|
5259
|
-
return React.createElement(Container$n, null, React.createElement(Label$
|
|
5404
|
+
return React.createElement(Container$n, null, React.createElement(Label$k, {
|
|
5260
5405
|
label: "Delivery Instructions"
|
|
5261
5406
|
}), React.createElement(CustomTextArea$1, {
|
|
5262
5407
|
value: (orderDetails == null ? void 0 : orderDetails.delivery_instructions) || '',
|
|
@@ -5279,7 +5424,7 @@ function OtherInstructions() {
|
|
|
5279
5424
|
});
|
|
5280
5425
|
});
|
|
5281
5426
|
};
|
|
5282
|
-
return React.createElement(Container$o, null, React.createElement(Label$
|
|
5427
|
+
return React.createElement(Container$o, null, React.createElement(Label$k, {
|
|
5283
5428
|
label: "Other Instructions (simple instructions)"
|
|
5284
5429
|
}), React.createElement(CustomTextArea$2, {
|
|
5285
5430
|
value: (orderDetails == null ? void 0 : orderDetails.other_instructions) || '',
|
|
@@ -5297,7 +5442,7 @@ function InstructionSection() {
|
|
|
5297
5442
|
}), React.createElement(FormInputs$2, null, React.createElement(OrderStatusNote, null), React.createElement(DeliveryInstructions, null), React.createElement(OtherInstructions, null)));
|
|
5298
5443
|
}
|
|
5299
5444
|
var FormInputs$2 = /*#__PURE__*/styled.div(_templateObject$J || (_templateObject$J = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 7px;\n flex: 1;\n"])));
|
|
5300
|
-
var CustomFormSection$2 = /*#__PURE__*/styled(FormSection)(_templateObject2$z || (_templateObject2$z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n border-radius: 8px;\n background: #f8fafc;\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);\n padding:
|
|
5445
|
+
var CustomFormSection$2 = /*#__PURE__*/styled(FormSection)(_templateObject2$z || (_templateObject2$z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n border-radius: 8px;\n background: #f8fafc;\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);\n padding: 24px !important;\n"])));
|
|
5301
5446
|
|
|
5302
5447
|
var _templateObject$K, _templateObject2$A;
|
|
5303
5448
|
function convertTo12HourFormat(time24) {
|
|
@@ -5336,7 +5481,7 @@ function TimedServiceDropdown() {
|
|
|
5336
5481
|
});
|
|
5337
5482
|
setOrderData(newData);
|
|
5338
5483
|
};
|
|
5339
|
-
return React.createElement(Container$p, null, React.createElement(Label$
|
|
5484
|
+
return React.createElement(Container$p, null, React.createElement(Label$k, {
|
|
5340
5485
|
label: "Timed Service"
|
|
5341
5486
|
}), React.createElement(StyledSelectDropdown$1, {
|
|
5342
5487
|
styles: _extends({}, dropdownStyles, {
|
|
@@ -5381,7 +5526,7 @@ function ServiceTypeDropdown() {
|
|
|
5381
5526
|
});
|
|
5382
5527
|
setOrderData(newData);
|
|
5383
5528
|
};
|
|
5384
|
-
return React.createElement(Container$q, null, React.createElement(Label$
|
|
5529
|
+
return React.createElement(Container$q, null, React.createElement(Label$k, {
|
|
5385
5530
|
label: "Service Type",
|
|
5386
5531
|
htmlFor: "serviceTypeDropdown"
|
|
5387
5532
|
}), React.createElement(StyledSelectDropdown$2, {
|
|
@@ -5424,7 +5569,7 @@ function DeliveryPointDropdown() {
|
|
|
5424
5569
|
});
|
|
5425
5570
|
setOrderData(newData);
|
|
5426
5571
|
};
|
|
5427
|
-
return React.createElement(Container$r, null, React.createElement(Label$
|
|
5572
|
+
return React.createElement(Container$r, null, React.createElement(Label$k, {
|
|
5428
5573
|
label: "Delivery Point"
|
|
5429
5574
|
}), React.createElement(StyledSelectDropdown$3, {
|
|
5430
5575
|
placeholder: "Select Delivery Point",
|
|
@@ -6068,7 +6213,6 @@ function AddNote() {
|
|
|
6068
6213
|
}),
|
|
6069
6214
|
getNoteType = _useAxios.fetchData,
|
|
6070
6215
|
fetchedData = _useAxios.data;
|
|
6071
|
-
console.log(selectedNoteType, 'selectedNoteType');
|
|
6072
6216
|
useEffect(function () {
|
|
6073
6217
|
getNoteType();
|
|
6074
6218
|
}, []);
|
|
@@ -6099,12 +6243,16 @@ function AddNote() {
|
|
|
6099
6243
|
method: 'POST'
|
|
6100
6244
|
}),
|
|
6101
6245
|
callAuditLogs = _useAxios2.fetchData;
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6246
|
+
// `const isValidFormat = () => {
|
|
6247
|
+
// const lines = noteText.split('\n');
|
|
6248
|
+
// if (lines.length < 3) return false;
|
|
6249
|
+
// return (
|
|
6250
|
+
// lines[0].startsWith('REASON-') &&
|
|
6251
|
+
// lines[1].startsWith('STC-') &&
|
|
6252
|
+
// lines[2].startsWith('ACTION-')
|
|
6253
|
+
// );
|
|
6254
|
+
// };
|
|
6255
|
+
var isDisabled = !noteText.trim() || !selectedAssignee;
|
|
6108
6256
|
var saveNote = /*#__PURE__*/function () {
|
|
6109
6257
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
6110
6258
|
var payload, response;
|
|
@@ -6176,26 +6324,9 @@ function AddNote() {
|
|
|
6176
6324
|
};
|
|
6177
6325
|
}();
|
|
6178
6326
|
var handleChange = function handleChange(e) {
|
|
6179
|
-
|
|
6180
|
-
var lines = val.split('\n');
|
|
6181
|
-
while (lines.length < 3) {
|
|
6182
|
-
if (lines.length === 0) lines.push('REASON- ');else if (lines.length === 1) lines.push('STC- ');else if (lines.length === 2) lines.push('ACTION- ');
|
|
6183
|
-
}
|
|
6184
|
-
var enforcedLines = lines.map(function (line, idx) {
|
|
6185
|
-
if (idx === 0) {
|
|
6186
|
-
if (!line.startsWith('REASON-')) return 'REASON- ';
|
|
6187
|
-
}
|
|
6188
|
-
if (idx === 1) {
|
|
6189
|
-
if (!line.startsWith('STC-')) return 'STC- ';
|
|
6190
|
-
}
|
|
6191
|
-
if (idx === 2) {
|
|
6192
|
-
if (!line.startsWith('ACTION-')) return 'ACTION- ';
|
|
6193
|
-
}
|
|
6194
|
-
return line;
|
|
6195
|
-
});
|
|
6196
|
-
setNoteText(enforcedLines.join('\n'));
|
|
6327
|
+
setNoteText(e.target.value);
|
|
6197
6328
|
};
|
|
6198
|
-
return React.createElement(Container$A, null, React.createElement(Label$
|
|
6329
|
+
return React.createElement(Container$A, null, React.createElement(Label$k, {
|
|
6199
6330
|
label: "Add New Note",
|
|
6200
6331
|
required: true,
|
|
6201
6332
|
style: {
|
|
@@ -6845,7 +6976,7 @@ var ActionIcon = function ActionIcon() {
|
|
|
6845
6976
|
};
|
|
6846
6977
|
|
|
6847
6978
|
var _templateObject$19;
|
|
6848
|
-
var ReturnProductTable = function ReturnProductTable() {
|
|
6979
|
+
var ReturnProductTable = function ReturnProductTable(props) {
|
|
6849
6980
|
var _useSelectedProducts = useSelectedProducts(),
|
|
6850
6981
|
selectedProducts = _useSelectedProducts[0],
|
|
6851
6982
|
setSelectedProducts = _useSelectedProducts[1];
|
|
@@ -6862,20 +6993,19 @@ var ReturnProductTable = function ReturnProductTable() {
|
|
|
6862
6993
|
orderId = _useOrderId[0];
|
|
6863
6994
|
var _useNewReturnOrderDat = useNewReturnOrderData(),
|
|
6864
6995
|
returnOrderData = _useNewReturnOrderDat[0];
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
};
|
|
6868
|
-
var
|
|
6869
|
-
endpoint: "
|
|
6870
|
-
method: '
|
|
6871
|
-
body:
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
}
|
|
6875
|
-
performAction: false
|
|
6996
|
+
// const handleActionClick = (id: number) => {
|
|
6997
|
+
// setSelectedRowId(id);
|
|
6998
|
+
// };
|
|
6999
|
+
var _useAxios = useAxios({
|
|
7000
|
+
endpoint: "v1/return/product/remove/",
|
|
7001
|
+
method: 'POST',
|
|
7002
|
+
body: {
|
|
7003
|
+
return_order_product_id: selectedRowId,
|
|
7004
|
+
return_order_id: +orderId
|
|
7005
|
+
}
|
|
6876
7006
|
}),
|
|
6877
|
-
isresponse =
|
|
6878
|
-
|
|
7007
|
+
isresponse = _useAxios.data,
|
|
7008
|
+
callDeleteProduct = _useAxios.fetchData;
|
|
6879
7009
|
useEffect(function () {
|
|
6880
7010
|
if (isresponse && isresponse.data) {
|
|
6881
7011
|
notification.success({
|
|
@@ -6895,9 +7025,9 @@ var ReturnProductTable = function ReturnProductTable() {
|
|
|
6895
7025
|
});
|
|
6896
7026
|
}
|
|
6897
7027
|
};
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
};
|
|
7028
|
+
// const onDeleteProducts = () => {
|
|
7029
|
+
// callDeleteProduct();
|
|
7030
|
+
// };
|
|
6901
7031
|
var handleSelectAll = function handleSelectAll() {
|
|
6902
7032
|
if (selectAll) {
|
|
6903
7033
|
setSelectedProducts([]);
|
|
@@ -6916,6 +7046,56 @@ var ReturnProductTable = function ReturnProductTable() {
|
|
|
6916
7046
|
}) : [].concat(prevSelected, [id]);
|
|
6917
7047
|
});
|
|
6918
7048
|
};
|
|
7049
|
+
//delete product API
|
|
7050
|
+
var deleteProduct = /*#__PURE__*/function () {
|
|
7051
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(selectedProductId) {
|
|
7052
|
+
var response;
|
|
7053
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7054
|
+
while (1) switch (_context.prev = _context.next) {
|
|
7055
|
+
case 0:
|
|
7056
|
+
_context.prev = 0;
|
|
7057
|
+
_context.next = 3;
|
|
7058
|
+
return callDeleteProduct({
|
|
7059
|
+
payload: {
|
|
7060
|
+
return_order_product_id: selectedProductId,
|
|
7061
|
+
return_order_id: +orderId
|
|
7062
|
+
}
|
|
7063
|
+
});
|
|
7064
|
+
case 3:
|
|
7065
|
+
response = _context.sent;
|
|
7066
|
+
if ((response == null ? void 0 : response.code) === 200) {
|
|
7067
|
+
notification.success({
|
|
7068
|
+
message: 'Success',
|
|
7069
|
+
description: (response == null ? void 0 : response.message) || 'Product deleted successfully.'
|
|
7070
|
+
});
|
|
7071
|
+
props == null || props.callReturnProducts();
|
|
7072
|
+
} else {
|
|
7073
|
+
notification.error({
|
|
7074
|
+
message: 'Deletion Failed',
|
|
7075
|
+
description: (response == null ? void 0 : response.message) || 'Could not delete the product.'
|
|
7076
|
+
});
|
|
7077
|
+
}
|
|
7078
|
+
_context.next = 11;
|
|
7079
|
+
break;
|
|
7080
|
+
case 7:
|
|
7081
|
+
_context.prev = 7;
|
|
7082
|
+
_context.t0 = _context["catch"](0);
|
|
7083
|
+
console.error('Error deleting product:', _context.t0);
|
|
7084
|
+
notification.error({
|
|
7085
|
+
message: 'Error',
|
|
7086
|
+
//@ts-ignore
|
|
7087
|
+
description: (_context.t0 == null ? void 0 : _context.t0.message) || 'An unexpected error occurred.'
|
|
7088
|
+
});
|
|
7089
|
+
case 11:
|
|
7090
|
+
case "end":
|
|
7091
|
+
return _context.stop();
|
|
7092
|
+
}
|
|
7093
|
+
}, _callee, null, [[0, 7]]);
|
|
7094
|
+
}));
|
|
7095
|
+
return function deleteProduct(_x) {
|
|
7096
|
+
return _ref.apply(this, arguments);
|
|
7097
|
+
};
|
|
7098
|
+
}();
|
|
6919
7099
|
var disableCheckbox = (productData == null ? void 0 : productData.length) == 0 || (returnOrderData == null ? void 0 : returnOrderData.length) == 0;
|
|
6920
7100
|
return React.createElement("div", null, React.createElement(StyledTableWrapper$1, {
|
|
6921
7101
|
id: "tableScrolling",
|
|
@@ -6954,8 +7134,7 @@ var ReturnProductTable = function ReturnProductTable() {
|
|
|
6954
7134
|
}
|
|
6955
7135
|
}, displayValueOrNA$1(product == null ? void 0 : product.postcode)))), React.createElement("td", null, product == null ? void 0 : product.code), React.createElement("td", null, product == null ? void 0 : product.description), React.createElement("td", null, product == null ? void 0 : product.return_reason), React.createElement("td", null, product == null ? void 0 : product.part), React.createElement("td", null, React.createElement("div", {
|
|
6956
7136
|
onClick: function onClick() {
|
|
6957
|
-
|
|
6958
|
-
onDeleteProducts();
|
|
7137
|
+
deleteProduct(product == null ? void 0 : product.id);
|
|
6959
7138
|
},
|
|
6960
7139
|
style: {
|
|
6961
7140
|
cursor: 'pointer'
|
|
@@ -6971,13 +7150,16 @@ var ReturnProductTable = function ReturnProductTable() {
|
|
|
6971
7150
|
var StyleCheckbox = /*#__PURE__*/styled(Checkbox$1)(_templateObject$19 || (_templateObject$19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n &:disabled {\n background-color: gray;\n cursor: not-allowed;\n opacity: -0.4;\n }\n"])));
|
|
6972
7151
|
|
|
6973
7152
|
var _templateObject$1a;
|
|
6974
|
-
var ProductTable = function ProductTable() {
|
|
6975
|
-
return React.createElement(Container$G, null, React.createElement(ReturnProductTable,
|
|
7153
|
+
var ProductTable = function ProductTable(props) {
|
|
7154
|
+
return React.createElement(Container$G, null, React.createElement(ReturnProductTable, {
|
|
7155
|
+
callReturnProducts: props == null ? void 0 : props.callReturnProducts
|
|
7156
|
+
}));
|
|
6976
7157
|
};
|
|
6977
7158
|
var Container$G = /*#__PURE__*/styled.div(_templateObject$1a || (_templateObject$1a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* height: 230px; */\n overflow: auto; /* Enable scrolling */\n scrollbar-width: thin;\n"])));
|
|
6978
7159
|
|
|
6979
7160
|
var _templateObject$1b, _templateObject2$S, _templateObject3$p;
|
|
6980
7161
|
var payloadAtom = /*#__PURE__*/atom(null);
|
|
7162
|
+
var selectedOrderId = /*#__PURE__*/atom(null);
|
|
6981
7163
|
var NewReturnDropdown = function NewReturnDropdown() {
|
|
6982
7164
|
var defaultSelectStyle = {
|
|
6983
7165
|
width: '100%'
|
|
@@ -6986,20 +7168,20 @@ var NewReturnDropdown = function NewReturnDropdown() {
|
|
|
6986
7168
|
var _useNewReturnOrderDat = useNewReturnOrderData(),
|
|
6987
7169
|
returnOrderData = _useNewReturnOrderDat[0],
|
|
6988
7170
|
setReturnOrderData = _useNewReturnOrderDat[1];
|
|
6989
|
-
var
|
|
6990
|
-
|
|
6991
|
-
setSelectedOrderId =
|
|
7171
|
+
var _useAtom = useAtom(selectedOrderId),
|
|
7172
|
+
selectedId = _useAtom[0],
|
|
7173
|
+
setSelectedOrderId = _useAtom[1];
|
|
6992
7174
|
var _useSelectedProducts = useSelectedProducts(),
|
|
6993
7175
|
selectedProducts = _useSelectedProducts[0];
|
|
6994
7176
|
var _useOrderDetails = useOrderDetails(),
|
|
6995
7177
|
orderData = _useOrderDetails[0];
|
|
6996
|
-
var
|
|
6997
|
-
setPayload =
|
|
7178
|
+
var _useAtom2 = useAtom(payloadAtom),
|
|
7179
|
+
setPayload = _useAtom2[1];
|
|
6998
7180
|
var _useProductDetails = useProductDetails(),
|
|
6999
7181
|
productData = _useProductDetails[0];
|
|
7000
|
-
var
|
|
7001
|
-
idProduct =
|
|
7002
|
-
setId =
|
|
7182
|
+
var _useState = useState(),
|
|
7183
|
+
idProduct = _useState[0],
|
|
7184
|
+
setId = _useState[1];
|
|
7003
7185
|
var _useOrderId = useOrderId(),
|
|
7004
7186
|
orderId = _useOrderId[0];
|
|
7005
7187
|
var id = orderData == null ? void 0 : orderData.customer_id;
|
|
@@ -7056,14 +7238,14 @@ var NewReturnDropdown = function NewReturnDropdown() {
|
|
|
7056
7238
|
}
|
|
7057
7239
|
}, [fetchedReturnOrderData, id]);
|
|
7058
7240
|
useEffect(function () {
|
|
7059
|
-
if (
|
|
7241
|
+
if (selectedId && (selectedProducts == null ? void 0 : selectedProducts.length) > 0) {
|
|
7060
7242
|
var newPayload = {
|
|
7061
|
-
new_return_order:
|
|
7243
|
+
new_return_order: selectedId,
|
|
7062
7244
|
products: selectedProducts
|
|
7063
7245
|
};
|
|
7064
7246
|
setPayload(newPayload);
|
|
7065
7247
|
}
|
|
7066
|
-
}, [
|
|
7248
|
+
}, [selectedId, selectedProducts, setPayload]);
|
|
7067
7249
|
var handleDropdownChange = function handleDropdownChange(value) {
|
|
7068
7250
|
setSelectedOrderId(value);
|
|
7069
7251
|
};
|
|
@@ -7075,18 +7257,17 @@ var NewReturnDropdown = function NewReturnDropdown() {
|
|
|
7075
7257
|
});
|
|
7076
7258
|
return React.createElement(Container$H, null, React.createElement(Text$5, null, "New Return Order:"), React.createElement(StyledAntSelect$4, {
|
|
7077
7259
|
options: dropdownOptions,
|
|
7078
|
-
value:
|
|
7260
|
+
value: selectedId,
|
|
7079
7261
|
placeholder: "Select",
|
|
7080
7262
|
// @ts-ignore
|
|
7081
7263
|
onChange: handleDropdownChange,
|
|
7082
7264
|
style: defaultSelectStyle,
|
|
7083
7265
|
showSearch: true,
|
|
7084
7266
|
dropdownStyle: {
|
|
7085
|
-
|
|
7086
|
-
width: 'auto'
|
|
7267
|
+
width: '250px'
|
|
7087
7268
|
},
|
|
7088
7269
|
popupClassName: defaultPopupClassName,
|
|
7089
|
-
status: dropdownOptions.length === 0 ? '' :
|
|
7270
|
+
status: dropdownOptions.length === 0 ? '' : selectedId ? '' : 'error',
|
|
7090
7271
|
notFoundContent: "No orders found with a similar postcode"
|
|
7091
7272
|
}));
|
|
7092
7273
|
};
|
|
@@ -7095,7 +7276,7 @@ var Container$H = /*#__PURE__*/styled.div(_templateObject2$S || (_templateObject
|
|
|
7095
7276
|
var Text$5 = /*#__PURE__*/styled.div(_templateObject3$p || (_templateObject3$p = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #000;\n font-family: 'Lato';\n font-size: 13px;\n font-weight: 400;\n line-height: 16px;\n"])));
|
|
7096
7277
|
|
|
7097
7278
|
var _templateObject$1c, _templateObject2$T, _templateObject3$q;
|
|
7098
|
-
function ExpandedContent$2() {
|
|
7279
|
+
function ExpandedContent$2(props) {
|
|
7099
7280
|
var _response$data, _response$data2;
|
|
7100
7281
|
var _useAtom = useAtom(payloadAtom),
|
|
7101
7282
|
payload = _useAtom[0];
|
|
@@ -7109,15 +7290,16 @@ function ExpandedContent$2() {
|
|
|
7109
7290
|
var navigate = useNavigate();
|
|
7110
7291
|
var _useSelectedProducts = useSelectedProducts(),
|
|
7111
7292
|
setSelectedProducts = _useSelectedProducts[1];
|
|
7112
|
-
var
|
|
7293
|
+
var _useAtom2 = useAtom(selectedOrderId),
|
|
7294
|
+
setSelectedOrderId = _useAtom2[1];
|
|
7295
|
+
var _useAxios = useAxios({
|
|
7113
7296
|
endpoint: "/v1/return/product/move/?return_order_id=" + orderId,
|
|
7114
7297
|
method: 'POST',
|
|
7115
|
-
body: payload
|
|
7116
|
-
performAction: false
|
|
7298
|
+
body: payload
|
|
7117
7299
|
}),
|
|
7118
|
-
response =
|
|
7119
|
-
|
|
7120
|
-
|
|
7300
|
+
response = _useAxios.data,
|
|
7301
|
+
confirmLoading = _useAxios.loading,
|
|
7302
|
+
callMoveProducts = _useAxios.fetchData;
|
|
7121
7303
|
useEffect(function () {
|
|
7122
7304
|
setPostLoading(confirmLoading);
|
|
7123
7305
|
}, [confirmLoading, setPostLoading]);
|
|
@@ -7129,14 +7311,48 @@ function ExpandedContent$2() {
|
|
|
7129
7311
|
setIsButtonDisabled(true);
|
|
7130
7312
|
}
|
|
7131
7313
|
}, [payload]);
|
|
7132
|
-
var
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
} else {
|
|
7137
|
-
console.error('Payload is incomplete:', payload);
|
|
7138
|
-
}
|
|
7314
|
+
var sleep = function sleep(ms) {
|
|
7315
|
+
return new Promise(function (res) {
|
|
7316
|
+
return setTimeout(res, ms);
|
|
7317
|
+
});
|
|
7139
7318
|
};
|
|
7319
|
+
var handleConfirmReturn = /*#__PURE__*/function () {
|
|
7320
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7321
|
+
var response;
|
|
7322
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
7323
|
+
while (1) switch (_context.prev = _context.next) {
|
|
7324
|
+
case 0:
|
|
7325
|
+
if (!isButtonDisabled) {
|
|
7326
|
+
_context.next = 3;
|
|
7327
|
+
break;
|
|
7328
|
+
}
|
|
7329
|
+
console.error('Payload is incomplete:', payload);
|
|
7330
|
+
return _context.abrupt("return");
|
|
7331
|
+
case 3:
|
|
7332
|
+
setPostLoading(true);
|
|
7333
|
+
_context.next = 6;
|
|
7334
|
+
return callMoveProducts();
|
|
7335
|
+
case 6:
|
|
7336
|
+
response = _context.sent;
|
|
7337
|
+
if (!((response == null ? void 0 : response.code) === 200)) {
|
|
7338
|
+
_context.next = 12;
|
|
7339
|
+
break;
|
|
7340
|
+
}
|
|
7341
|
+
_context.next = 10;
|
|
7342
|
+
return sleep(2000);
|
|
7343
|
+
case 10:
|
|
7344
|
+
props == null || props.callReturnProducts();
|
|
7345
|
+
setSelectedOrderId(null);
|
|
7346
|
+
case 12:
|
|
7347
|
+
case "end":
|
|
7348
|
+
return _context.stop();
|
|
7349
|
+
}
|
|
7350
|
+
}, _callee);
|
|
7351
|
+
}));
|
|
7352
|
+
return function handleConfirmReturn() {
|
|
7353
|
+
return _ref.apply(this, arguments);
|
|
7354
|
+
};
|
|
7355
|
+
}();
|
|
7140
7356
|
var newId = Array.isArray(response == null ? void 0 : response.data) ? //@ts-ignore
|
|
7141
7357
|
response == null || (_response$data = response.data) == null || (_response$data = _response$data[0]) == null ? void 0 : _response$data.id : //@ts-ignore
|
|
7142
7358
|
response == null || (_response$data2 = response.data) == null ? void 0 : _response$data2.id;
|
|
@@ -7163,7 +7379,9 @@ function ExpandedContent$2() {
|
|
|
7163
7379
|
setSelectedProducts([]);
|
|
7164
7380
|
}
|
|
7165
7381
|
}, [response, newId, navigate, setSelectedProducts]);
|
|
7166
|
-
return React.createElement(Container$I, null, React.createElement(ProductTable,
|
|
7382
|
+
return React.createElement(Container$I, null, React.createElement(ProductTable, {
|
|
7383
|
+
callReturnProducts: props == null ? void 0 : props.callReturnProducts
|
|
7384
|
+
}), React.createElement(MidContainer, null, React.createElement(SaveNoteContainer$1, null, React.createElement(Button, {
|
|
7167
7385
|
style: {
|
|
7168
7386
|
borderRadius: '20px'
|
|
7169
7387
|
},
|
|
@@ -7190,7 +7408,7 @@ function ProductsInfo() {
|
|
|
7190
7408
|
var returnOrder = data;
|
|
7191
7409
|
// For API Call
|
|
7192
7410
|
var _useProductDetails = useProductDetails(),
|
|
7193
|
-
|
|
7411
|
+
setProductsData = _useProductDetails[1];
|
|
7194
7412
|
var _useLoading = useLoading(),
|
|
7195
7413
|
setLoading = _useLoading[1];
|
|
7196
7414
|
var _useAxios = useAxios({
|
|
@@ -7210,15 +7428,17 @@ function ProductsInfo() {
|
|
|
7210
7428
|
if (returnOrdersData && returnOrdersData.data) {
|
|
7211
7429
|
var requiredData = returnOrdersData.data;
|
|
7212
7430
|
if (requiredData.length > 0) {
|
|
7213
|
-
|
|
7431
|
+
setProductsData(requiredData);
|
|
7214
7432
|
} else {
|
|
7215
|
-
|
|
7433
|
+
setProductsData(null);
|
|
7216
7434
|
}
|
|
7217
7435
|
}
|
|
7218
7436
|
}, [returnOrdersData, loading]);
|
|
7219
7437
|
return React.createElement(CollapsableForm, {
|
|
7220
7438
|
collapsedContent: React.createElement(CollapsedContent$1, null)
|
|
7221
|
-
}, React.createElement(ExpandedContent$2,
|
|
7439
|
+
}, React.createElement(ExpandedContent$2, {
|
|
7440
|
+
callReturnProducts: callReturnProducts
|
|
7441
|
+
}));
|
|
7222
7442
|
}
|
|
7223
7443
|
|
|
7224
7444
|
var _templateObject$1e;
|
|
@@ -8900,7 +9120,7 @@ function EmailAddress() {
|
|
|
8900
9120
|
});
|
|
8901
9121
|
});
|
|
8902
9122
|
};
|
|
8903
|
-
return React.createElement(Container$U, null, React.createElement(Label$6, null, "Email Address"), React.createElement(Input$
|
|
9123
|
+
return React.createElement(Container$U, null, React.createElement(Label$6, null, "Email Address"), React.createElement(Input$3, {
|
|
8904
9124
|
style: {
|
|
8905
9125
|
borderRadius: '15px'
|
|
8906
9126
|
},
|
|
@@ -8962,7 +9182,7 @@ function ContactPhone() {
|
|
|
8962
9182
|
});
|
|
8963
9183
|
}
|
|
8964
9184
|
};
|
|
8965
|
-
return React.createElement(Container$V, null, React.createElement(Label$7, null, "Contact Phone"), React.createElement(Input$
|
|
9185
|
+
return React.createElement(Container$V, null, React.createElement(Label$7, null, "Contact Phone"), React.createElement(Input$3, {
|
|
8966
9186
|
name: "contact-home",
|
|
8967
9187
|
type: "text",
|
|
8968
9188
|
placeholder: "Home Number",
|
|
@@ -9027,7 +9247,7 @@ function ContactWork$1() {
|
|
|
9027
9247
|
});
|
|
9028
9248
|
}
|
|
9029
9249
|
};
|
|
9030
|
-
return React.createElement(Container$W, null, React.createElement(Label$8, null, "Contact Work"), React.createElement(Input$
|
|
9250
|
+
return React.createElement(Container$W, null, React.createElement(Label$8, null, "Contact Work"), React.createElement(Input$3, {
|
|
9031
9251
|
name: "contact-work",
|
|
9032
9252
|
type: "text",
|
|
9033
9253
|
placeholder: "Work Number",
|
|
@@ -9092,7 +9312,7 @@ function ContactMobile$1() {
|
|
|
9092
9312
|
});
|
|
9093
9313
|
}
|
|
9094
9314
|
};
|
|
9095
|
-
return React.createElement(Container$X, null, React.createElement(Label$9, null, "Contact Mobile"), React.createElement(Input$
|
|
9315
|
+
return React.createElement(Container$X, null, React.createElement(Label$9, null, "Contact Mobile"), React.createElement(Input$3, {
|
|
9096
9316
|
name: "contact-work",
|
|
9097
9317
|
type: "text",
|
|
9098
9318
|
placeholder: "Mobile Number",
|
|
@@ -9169,7 +9389,7 @@ function ActionDropdown() {
|
|
|
9169
9389
|
var onSelect = function onSelect(value) {
|
|
9170
9390
|
setSelectedAction(value);
|
|
9171
9391
|
};
|
|
9172
|
-
return React.createElement(Container$Y, null, React.createElement(Label$
|
|
9392
|
+
return React.createElement(Container$Y, null, React.createElement(Label$k, {
|
|
9173
9393
|
label: "Action"
|
|
9174
9394
|
}), React.createElement(Select, {
|
|
9175
9395
|
style: {
|
|
@@ -9444,7 +9664,7 @@ var Container$12 = /*#__PURE__*/styled.div(_templateObject2$1h || (_templateObje
|
|
|
9444
9664
|
|
|
9445
9665
|
var _templateObject$1J, _templateObject2$1i;
|
|
9446
9666
|
function ContactWith() {
|
|
9447
|
-
return React.createElement(Container$13, null, React.createElement(Label$d, null, "Contact With"), React.createElement(Input$
|
|
9667
|
+
return React.createElement(Container$13, null, React.createElement(Label$d, null, "Contact With"), React.createElement(Input$3, {
|
|
9448
9668
|
style: {
|
|
9449
9669
|
borderRadius: '15px'
|
|
9450
9670
|
}
|
|
@@ -9845,7 +10065,7 @@ var Wrapper$h = /*#__PURE__*/styled.div(_templateObject$1L || (_templateObject$1
|
|
|
9845
10065
|
var ContentContainer$4 = /*#__PURE__*/styled.div(_templateObject2$1k || (_templateObject2$1k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* display: flex; */\n padding: 15px 12px;\n flex: 1 0 0;\n border-radius: 15px;\n background: white;\n display: flex;\n flex-direction: column;\n gap: 15px;\n overflow: auto;\n min-height: 500px;\n overflow-x: hidden;\n max-height: 500px;\n scrollbar-width: thin;\n"])));
|
|
9846
10066
|
|
|
9847
10067
|
var _templateObject2$1l, _templateObject3$L, _templateObject5$f, _templateObject6$7, _templateObject7$9, _templateObject8$7, _templateObject9$5, _templateObject10$3, _templateObject11$2, _templateObject18$1, _templateObject19$1;
|
|
9848
|
-
var StyledInput = /*#__PURE__*/styled(Input$
|
|
10068
|
+
var StyledInput = /*#__PURE__*/styled(Input$2)(_templateObject2$1l || (_templateObject2$1l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-radius: 66px;\n min-width: 700px;\n"])));
|
|
9849
10069
|
var StyledTextArea$1 = /*#__PURE__*/styled(TextArea)(_templateObject3$L || (_templateObject3$L = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 12px;\n align-items: flex-start;\n gap: 4px;\n flex: 1 0 0;\n align-self: stretch;\n border-radius: 10px;\n border: 1px solid #e0e2e7;\n background: #fff;\n resize: none;\n min-height: 200px;\n"])));
|
|
9850
10070
|
var SplitLayout = /*#__PURE__*/styled.div(_templateObject5$f || (_templateObject5$f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n gap: 10px;\n"])));
|
|
9851
10071
|
var SplitText = /*#__PURE__*/styled.div(_templateObject6$7 || (_templateObject6$7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n gap: 10px;\n flex-direction: column;\n margin-bottom: 4px;\n"])));
|
|
@@ -10109,7 +10329,7 @@ function SendEmailModal() {
|
|
|
10109
10329
|
onSubmit: handleSubmit,
|
|
10110
10330
|
submitBtnTitle: loading ? 'Sending...' : 'Send Email',
|
|
10111
10331
|
isSubmitDisabled: isDisabled
|
|
10112
|
-
}, React.createElement(ContentContainer$5, null, React.createElement(Label$
|
|
10332
|
+
}, React.createElement(ContentContainer$5, null, React.createElement(Label$k, {
|
|
10113
10333
|
label: "To",
|
|
10114
10334
|
required: true
|
|
10115
10335
|
}), React.createElement(StyledInput, {
|
|
@@ -10126,7 +10346,7 @@ function SendEmailModal() {
|
|
|
10126
10346
|
style: {
|
|
10127
10347
|
color: 'red'
|
|
10128
10348
|
}
|
|
10129
|
-
}, emailError), React.createElement(Label$
|
|
10349
|
+
}, emailError), React.createElement(Label$k, {
|
|
10130
10350
|
label: "Subject",
|
|
10131
10351
|
required: true
|
|
10132
10352
|
}), React.createElement(StyledInput, {
|
|
@@ -10135,7 +10355,7 @@ function SendEmailModal() {
|
|
|
10135
10355
|
required: true,
|
|
10136
10356
|
value: formData.subject,
|
|
10137
10357
|
onChange: handleChange
|
|
10138
|
-
}), React.createElement(Label$
|
|
10358
|
+
}), React.createElement(Label$k, {
|
|
10139
10359
|
label: "Body",
|
|
10140
10360
|
required: true
|
|
10141
10361
|
}), React.createElement(StyledTextArea$1, {
|
|
@@ -10267,7 +10487,7 @@ function ChangeCustomerAccModal(props) {
|
|
|
10267
10487
|
popupClassName: "dropDownStyle",
|
|
10268
10488
|
selectWrapperClass: "rounded",
|
|
10269
10489
|
defaultValue: selectedCustomerId
|
|
10270
|
-
})), React.createElement(Row$4, null, React.createElement(Label$e, null, "New Trading Name"), React.createElement(Input$
|
|
10490
|
+
})), React.createElement(Row$4, null, React.createElement(Label$e, null, "New Trading Name"), React.createElement(Input$3, {
|
|
10271
10491
|
style: {
|
|
10272
10492
|
borderRadius: '15px',
|
|
10273
10493
|
minWidth: '22vw'
|
|
@@ -10409,7 +10629,7 @@ function HoldOrderModal(props) {
|
|
|
10409
10629
|
infoText: infoText,
|
|
10410
10630
|
submitBtnTitle: "Save Details",
|
|
10411
10631
|
isSubmitDisabled: !showSubmitBtn
|
|
10412
|
-
}, React.createElement(HoldContentContainer, null, React.createElement(SplitText, null, React.createElement(HoldRow, null, React.createElement(Label$
|
|
10632
|
+
}, React.createElement(HoldContentContainer, null, React.createElement(SplitText, null, React.createElement(HoldRow, null, React.createElement(Label$k, {
|
|
10413
10633
|
label: "Hold Until (leave blank for indefinite)"
|
|
10414
10634
|
}), React.createElement(HoldDatePickerWrap, null, React.createElement(DatePicker, {
|
|
10415
10635
|
needConfirm: true,
|
|
@@ -10419,7 +10639,7 @@ function HoldOrderModal(props) {
|
|
|
10419
10639
|
disabledDate: function disabledDate(current) {
|
|
10420
10640
|
return current && current < dayjs().startOf('day');
|
|
10421
10641
|
}
|
|
10422
|
-
}))), React.createElement(HoldRow, null, React.createElement(Label$
|
|
10642
|
+
}))), React.createElement(HoldRow, null, React.createElement(Label$k, {
|
|
10423
10643
|
label: "Hold Reason",
|
|
10424
10644
|
required: true
|
|
10425
10645
|
}), React.createElement(AntSelect, {
|
|
@@ -10712,7 +10932,7 @@ function AssigneeDropdown() {
|
|
|
10712
10932
|
value: user == null ? void 0 : user.id
|
|
10713
10933
|
};
|
|
10714
10934
|
});
|
|
10715
|
-
return React.createElement(FormContainer$3, null, React.createElement(Label$
|
|
10935
|
+
return React.createElement(FormContainer$3, null, React.createElement(Label$k, {
|
|
10716
10936
|
label: "Department",
|
|
10717
10937
|
required: true
|
|
10718
10938
|
}), React.createElement(StyledAntSelect$5, {
|
|
@@ -10726,7 +10946,7 @@ function AssigneeDropdown() {
|
|
|
10726
10946
|
value: (reminderPayload == null ? void 0 : reminderPayload.department) || undefined,
|
|
10727
10947
|
showSearch: true,
|
|
10728
10948
|
dis: true
|
|
10729
|
-
}), React.createElement(Label$
|
|
10949
|
+
}), React.createElement(Label$k, {
|
|
10730
10950
|
label: "Assigned To",
|
|
10731
10951
|
required: true,
|
|
10732
10952
|
htmlFor: "assigneDropdown"
|
|
@@ -11000,10 +11220,10 @@ var ViewReminderModal = function ViewReminderModal(props) {
|
|
|
11000
11220
|
checked: (reminderPayload == null ? void 0 : reminderPayload.status) || false,
|
|
11001
11221
|
disabled: disabled
|
|
11002
11222
|
}), React.createElement(RoundCheckbox, null)), React.createElement(StyledSpan, null, "Mark As Complete"))))
|
|
11003
|
-
}, React.createElement(ReferenceContainer, null, React.createElement(InnerContainer, null, React.createElement(MiniContainer, null, React.createElement(Label$
|
|
11223
|
+
}, React.createElement(ReferenceContainer, null, React.createElement(InnerContainer, null, React.createElement(MiniContainer, null, React.createElement(Label$k, {
|
|
11004
11224
|
label: "Reference",
|
|
11005
11225
|
required: true
|
|
11006
|
-
}), React.createElement(LabelText, null, (reminderDataById == null ? void 0 : reminderDataById.reference) || 'N/A')), React.createElement(MiniContainer, null, React.createElement(Label$
|
|
11226
|
+
}), React.createElement(LabelText, null, (reminderDataById == null ? void 0 : reminderDataById.reference) || 'N/A')), React.createElement(MiniContainer, null, React.createElement(Label$k, {
|
|
11007
11227
|
label: "Status"
|
|
11008
11228
|
}), React.createElement(LabelText, null, (reminderDataById == null ? void 0 : reminderDataById.status) === false ? React.createElement(StatusIndicator, {
|
|
11009
11229
|
text: "Incomplete",
|
|
@@ -11011,7 +11231,7 @@ var ViewReminderModal = function ViewReminderModal(props) {
|
|
|
11011
11231
|
}) : React.createElement(StatusIndicator, {
|
|
11012
11232
|
text: "Completed on " + (reminderDataById == null ? void 0 : reminderDataById.completed_at) + " by " + (reminderDataById == null ? void 0 : reminderDataById.completed_by),
|
|
11013
11233
|
status: "SD"
|
|
11014
|
-
}))))), React.createElement(ContentsContainer, null, React.createElement(Left$1, null, React.createElement(AssigneeDropdown, null), React.createElement(DateTimeContainer, null, React.createElement(Label$
|
|
11234
|
+
}))))), React.createElement(ContentsContainer, null, React.createElement(Left$1, null, React.createElement(AssigneeDropdown, null), React.createElement(DateTimeContainer, null, React.createElement(Label$k, {
|
|
11015
11235
|
label: "Due Date & Time",
|
|
11016
11236
|
required: true
|
|
11017
11237
|
}), React.createElement(Row$5, null, React.createElement(StyleContainer, null, React.createElement(DatePickerWrap, null, React.createElement(DatePicker, {
|
|
@@ -11029,7 +11249,7 @@ var ViewReminderModal = function ViewReminderModal(props) {
|
|
|
11029
11249
|
return getDisabledTime(date);
|
|
11030
11250
|
},
|
|
11031
11251
|
disabled: disabled
|
|
11032
|
-
})))))), React.createElement(Right$2, null, React.createElement(Label$
|
|
11252
|
+
})))))), React.createElement(Right$2, null, React.createElement(Label$k, {
|
|
11033
11253
|
label: "Details",
|
|
11034
11254
|
required: true
|
|
11035
11255
|
}), React.createElement(DetailedContainer, {
|
|
@@ -11199,7 +11419,7 @@ function TextSection() {
|
|
|
11199
11419
|
description: event.target.value
|
|
11200
11420
|
}));
|
|
11201
11421
|
};
|
|
11202
|
-
return React.createElement(Text$9, null, React.createElement(Label$
|
|
11422
|
+
return React.createElement(Text$9, null, React.createElement(Label$k, {
|
|
11203
11423
|
label: "Details"
|
|
11204
11424
|
}), React.createElement(TextField, {
|
|
11205
11425
|
placeholder: "Type here....",
|
|
@@ -11269,21 +11489,21 @@ function ButtonsSection() {
|
|
|
11269
11489
|
}, [orderFlagTypes, taskPayload, flagById]);
|
|
11270
11490
|
var isResolved = (flagById == null ? void 0 : flagById.status) !== 'AD';
|
|
11271
11491
|
var resolvedText = "Resolved on " + formatDate$1((flagById == null ? void 0 : flagById.resolved_at) || 'N/A') + " by " + ((flagById == null ? void 0 : flagById.resolved_by) || 'N/A');
|
|
11272
|
-
return React.createElement(Buttons, null, React.createElement(Flex, null, React.createElement(Label$
|
|
11492
|
+
return React.createElement(Buttons, null, React.createElement(Flex, null, React.createElement(Label$k, {
|
|
11273
11493
|
label: "Type"
|
|
11274
11494
|
}), React.createElement(StyledAntSelect$6, {
|
|
11275
11495
|
options: taskTypeOptions,
|
|
11276
11496
|
placeholder: "Select Type",
|
|
11277
11497
|
onChange: handleTaskTypeChange,
|
|
11278
11498
|
value: selectedTypeId
|
|
11279
|
-
})), React.createElement(Flex, null, React.createElement(Label$
|
|
11499
|
+
})), React.createElement(Flex, null, React.createElement(Label$k, {
|
|
11280
11500
|
label: "Priority"
|
|
11281
11501
|
}), React.createElement(StyledAntSelect$6, {
|
|
11282
11502
|
options: priorityOptions,
|
|
11283
11503
|
placeholder: "Select Type",
|
|
11284
11504
|
onChange: handlePriorityChange,
|
|
11285
11505
|
value: (taskPayload == null ? void 0 : taskPayload.priority) || (flagById == null ? void 0 : flagById.priority)
|
|
11286
|
-
})), React.createElement(Flex, null, React.createElement(Label$
|
|
11506
|
+
})), React.createElement(Flex, null, React.createElement(Label$k, {
|
|
11287
11507
|
label: "Status"
|
|
11288
11508
|
}), isResolved ? React.createElement(StatusIndicator, {
|
|
11289
11509
|
text: resolvedText,
|
|
@@ -11441,7 +11661,7 @@ var Detail = /*#__PURE__*/styled.div(_templateObject$1W || (_templateObject$1W =
|
|
|
11441
11661
|
var Flex$1 = /*#__PURE__*/styled.div(_templateObject2$1v || (_templateObject2$1v = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-top: 20px;\n"])));
|
|
11442
11662
|
var Ref = /*#__PURE__*/styled.div(_templateObject3$S || (_templateObject3$S = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #7b7874;\n font-family: 'Lato', sans-serif;\n"])));
|
|
11443
11663
|
var Order = /*#__PURE__*/styled.div(_templateObject4$r || (_templateObject4$r = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #7b7874;\n text-decoration: underline;\n font-family: 'Lato', sans-serif;\n"])));
|
|
11444
|
-
var StyledLabel$2 = /*#__PURE__*/styled(Label$
|
|
11664
|
+
var StyledLabel$2 = /*#__PURE__*/styled(Label$k)(_templateObject5$j || (_templateObject5$j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-right: 10px;\n font-weight: bold;\n"])));
|
|
11445
11665
|
|
|
11446
11666
|
var _templateObject$1X, _templateObject2$1w, _templateObject3$T;
|
|
11447
11667
|
function ViewFlag() {
|
|
@@ -12923,71 +13143,2160 @@ function TaskModal(props) {
|
|
|
12923
13143
|
}
|
|
12924
13144
|
var OrderModal$1 = /*#__PURE__*/styled(OrderActionModal)(_templateObject$25 || (_templateObject$25 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 70%;\n"])));
|
|
12925
13145
|
|
|
12926
|
-
var _templateObject$26;
|
|
12927
|
-
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
13146
|
+
var _templateObject$26, _templateObject2$1B, _templateObject3$Z, _templateObject4$w, _templateObject5$n, _templateObject6$b, _templateObject7$c;
|
|
13147
|
+
var Title$6 = /*#__PURE__*/styled.span(_templateObject$26 || (_templateObject$26 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: 'Lato', sans-serif;\n font-size: 16px;\n font-weight: 600;\n color: #6a7378;\n"])));
|
|
13148
|
+
var Container$17 = /*#__PURE__*/styled.div(_templateObject2$1B || (_templateObject2$1B = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 4px;\n"])));
|
|
13149
|
+
var FieldRow = /*#__PURE__*/styled.div(_templateObject3$Z || (_templateObject3$Z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 8px;\n width: 300px;\n justify-content: space-between;\n"])));
|
|
13150
|
+
var Label$i = /*#__PURE__*/styled.label(_templateObject4$w || (_templateObject4$w = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 14px;\n color: #7b7874;\n"])));
|
|
13151
|
+
var Input$1 = /*#__PURE__*/styled.input(_templateObject5$n || (_templateObject5$n = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 70px;\n padding: 6px;\n font-size: 14px;\n border: 1px solid #ccc;\n border-radius: 4px;\n &::-webkit-inner-spin-button,\n &::-webkit-outer-spin-button {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n margin: 0;\n }\n"])));
|
|
13152
|
+
var MainContainer$b = /*#__PURE__*/styled.div(_templateObject6$b || (_templateObject6$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 4px;\n"])));
|
|
13153
|
+
var CurrencySymbol = /*#__PURE__*/styled.span(_templateObject7$c || (_templateObject7$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #858d9d;\n"])));
|
|
13154
|
+
|
|
13155
|
+
var _templateObject$27;
|
|
13156
|
+
var fields = [{
|
|
13157
|
+
label: 'Weight',
|
|
13158
|
+
value: 'weight'
|
|
13159
|
+
}, {
|
|
13160
|
+
label: 'Drop Time',
|
|
13161
|
+
value: 'drop_time'
|
|
13162
|
+
}, {
|
|
13163
|
+
label: 'Timed Services',
|
|
13164
|
+
value: 'timed_service'
|
|
13165
|
+
}, {
|
|
13166
|
+
label: 'Wait Time',
|
|
13167
|
+
value: 'wait_time'
|
|
13168
|
+
}, {
|
|
13169
|
+
label: 'Extra Floor',
|
|
13170
|
+
value: 'extra_floor'
|
|
13171
|
+
}, {
|
|
13172
|
+
label: 'Bulk Items',
|
|
13173
|
+
value: 'bulky_items'
|
|
13174
|
+
}, {
|
|
13175
|
+
label: 'Relabel (Pre-del)',
|
|
13176
|
+
value: 're_label'
|
|
13177
|
+
}, {
|
|
13178
|
+
label: 'Extra CBM',
|
|
13179
|
+
value: 'extra_cube'
|
|
13180
|
+
}, {
|
|
13181
|
+
label: 'Additional Box',
|
|
13182
|
+
value: 'additional_box'
|
|
13183
|
+
}, {
|
|
13184
|
+
label: 'Additional Item',
|
|
13185
|
+
value: 'additional_item'
|
|
13186
|
+
}];
|
|
13187
|
+
function OrderCharges(props) {
|
|
13188
|
+
var _orderDetails$order_s, _orderStaticData$orde;
|
|
13189
|
+
var _useChargesState = useChargesState(),
|
|
13190
|
+
setCharges = _useChargesState[1];
|
|
12933
13191
|
var _useOrderDetails = useOrderDetails(),
|
|
12934
|
-
|
|
12935
|
-
var
|
|
12936
|
-
|
|
12937
|
-
var
|
|
12938
|
-
|
|
12939
|
-
var
|
|
12940
|
-
|
|
12941
|
-
var
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
var
|
|
12946
|
-
|
|
12947
|
-
var
|
|
12948
|
-
|
|
12949
|
-
var
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
setCurrentAction(undefined);
|
|
12967
|
-
}
|
|
12968
|
-
if (fetchedData && (fetchedData == null ? void 0 : fetchedData.data) === null || (fetchedData == null || (_fetchedData$data = fetchedData.data) == null ? void 0 : _fetchedData$data.length) === 0) {
|
|
12969
|
-
setCurrentAction(undefined);
|
|
13192
|
+
orderDetails = _useOrderDetails[0];
|
|
13193
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
13194
|
+
orderStaticData = _useOrderStaticData[0];
|
|
13195
|
+
var weightVal = orderDetails == null ? void 0 : orderDetails.weight;
|
|
13196
|
+
var dropTime = orderDetails == null ? void 0 : orderDetails.drop_time;
|
|
13197
|
+
var cbm = orderDetails == null ? void 0 : orderDetails.cube;
|
|
13198
|
+
var timesServiceId = orderDetails == null || (_orderDetails$order_s = orderDetails.order_services_detail) == null ? void 0 : _orderDetails$order_s.timed_service_id;
|
|
13199
|
+
var selectedTimedService = orderStaticData == null || (_orderStaticData$orde = orderStaticData.order_timed_services) == null ? void 0 : _orderStaticData$orde.find(function (x) {
|
|
13200
|
+
return (x == null ? void 0 : x.id) === timesServiceId;
|
|
13201
|
+
});
|
|
13202
|
+
var showSelectedTimedService = selectedTimedService !== null && selectedTimedService !== undefined;
|
|
13203
|
+
var showCbm = cbm !== undefined && cbm !== null && cbm > 0;
|
|
13204
|
+
var showDropTime = dropTime !== undefined && dropTime !== null;
|
|
13205
|
+
var showWeight = weightVal !== null && weightVal > 0;
|
|
13206
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
13207
|
+
var handleChange = function handleChange(field, value) {
|
|
13208
|
+
props == null || props.setInputValue(function (prev) {
|
|
13209
|
+
var _extends2;
|
|
13210
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[field] = value, _extends2));
|
|
13211
|
+
});
|
|
13212
|
+
var val = parseFloat(value);
|
|
13213
|
+
if (value === '') {
|
|
13214
|
+
setCharges(function (prev) {
|
|
13215
|
+
var _extends3;
|
|
13216
|
+
return _extends({}, prev, (_extends3 = {}, _extends3[field] = 0, _extends3));
|
|
13217
|
+
});
|
|
13218
|
+
} else if (!isNaN(val)) {
|
|
13219
|
+
val = val >= 0 ? val : 0;
|
|
13220
|
+
setCharges(function (prev) {
|
|
13221
|
+
var _extends4;
|
|
13222
|
+
return _extends({}, prev, (_extends4 = {}, _extends4[field] = val, _extends4));
|
|
13223
|
+
});
|
|
12970
13224
|
}
|
|
12971
|
-
}
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12984
|
-
|
|
12985
|
-
|
|
13225
|
+
};
|
|
13226
|
+
return React.createElement(MainContainer$b, null, React.createElement(Title$6, null, "Order Charges"), React.createElement(Container$17, null, fields == null ? void 0 : fields.map(function (item) {
|
|
13227
|
+
var _selectedTimedService, _props$inputValue$ite;
|
|
13228
|
+
return React.createElement(FieldRow, {
|
|
13229
|
+
key: item.value
|
|
13230
|
+
}, React.createElement(Label$i, {
|
|
13231
|
+
style: {
|
|
13232
|
+
minWidth: '100px'
|
|
13233
|
+
}
|
|
13234
|
+
}, item.label), showWeight && (item == null ? void 0 : item.value) === 'weight' && React.createElement(OrderValue, null, weightVal, " Kg"), showDropTime && (item == null ? void 0 : item.value) === 'drop_time' && React.createElement(OrderValue, null, dropTime, " mins"), showCbm && (item == null ? void 0 : item.value) === 'extra_cube' && React.createElement(OrderValue, null, cbm, " (m", React.createElement("sup", null, "3"), ")"), showSelectedTimedService && (item == null ? void 0 : item.value) === 'timed_service' && React.createElement(OrderValue, null, selectedTimedService == null || (_selectedTimedService = selectedTimedService.type) == null ? void 0 : _selectedTimedService.replaceAll('_', '')), React.createElement("div", {
|
|
13235
|
+
style: {
|
|
13236
|
+
display: 'flex',
|
|
13237
|
+
gap: '3px',
|
|
13238
|
+
alignItems: 'center'
|
|
13239
|
+
}
|
|
13240
|
+
}, React.createElement(CurrencySymbol, null, baseUrlSymbol), React.createElement(Input$1, {
|
|
13241
|
+
min: 0,
|
|
13242
|
+
max: 10000,
|
|
13243
|
+
type: "number",
|
|
13244
|
+
placeholder: "0.00",
|
|
13245
|
+
onWheel: function onWheel(e) {
|
|
13246
|
+
return e.target.blur();
|
|
13247
|
+
},
|
|
13248
|
+
value: (_props$inputValue$ite = props == null ? void 0 : props.inputValue[item.value]) != null ? _props$inputValue$ite : '',
|
|
13249
|
+
onChange: function onChange(e) {
|
|
13250
|
+
return handleChange(item.value, e.target.value);
|
|
13251
|
+
},
|
|
13252
|
+
onKeyDown: handleKeyDownDebrief
|
|
13253
|
+
})));
|
|
13254
|
+
})));
|
|
13255
|
+
}
|
|
13256
|
+
var OrderValue = /*#__PURE__*/styled.span(_templateObject$27 || (_templateObject$27 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6396e5;\n"])));
|
|
13257
|
+
|
|
13258
|
+
var fields$1 = [{
|
|
13259
|
+
label: 'Repackage',
|
|
13260
|
+
value: 're_package'
|
|
13261
|
+
}, {
|
|
13262
|
+
label: 'Disassemble',
|
|
13263
|
+
value: 'disassemble'
|
|
13264
|
+
}, {
|
|
13265
|
+
label: 'QC',
|
|
13266
|
+
value: 'collection_qc'
|
|
13267
|
+
}, {
|
|
13268
|
+
label: 'Return to Client',
|
|
13269
|
+
value: 'return_to_client'
|
|
13270
|
+
}];
|
|
13271
|
+
function CollectionAddOns(props) {
|
|
13272
|
+
var _useChargesState = useChargesState(),
|
|
13273
|
+
setCharges = _useChargesState[1];
|
|
13274
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
13275
|
+
var handleChange = function handleChange(field, value) {
|
|
13276
|
+
props == null || props.setInputValue(function (prev) {
|
|
13277
|
+
var _extends2;
|
|
13278
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[field] = value, _extends2));
|
|
13279
|
+
});
|
|
13280
|
+
var val = parseFloat(value);
|
|
13281
|
+
if (isNaN(val)) {
|
|
13282
|
+
setCharges(function (prev) {
|
|
13283
|
+
var _extends3;
|
|
13284
|
+
return _extends({}, prev, (_extends3 = {}, _extends3[field] = 0, _extends3));
|
|
13285
|
+
});
|
|
12986
13286
|
} else {
|
|
12987
|
-
|
|
12988
|
-
|
|
13287
|
+
val = val >= 0 ? val : 0;
|
|
13288
|
+
setCharges(function (prev) {
|
|
13289
|
+
var _extends4;
|
|
13290
|
+
return _extends({}, prev, (_extends4 = {}, _extends4[field] = val, _extends4));
|
|
13291
|
+
});
|
|
12989
13292
|
}
|
|
12990
|
-
}
|
|
13293
|
+
};
|
|
13294
|
+
return React.createElement(MainContainer$b, null, React.createElement(Title$6, null, "Collection Add-Ons"), React.createElement(Container$17, null, fields$1.map(function (item) {
|
|
13295
|
+
var _props$inputValue$ite;
|
|
13296
|
+
return React.createElement(FieldRow, {
|
|
13297
|
+
key: item.value
|
|
13298
|
+
}, React.createElement(Label$i, null, item.label), React.createElement("div", {
|
|
13299
|
+
style: {
|
|
13300
|
+
display: 'flex',
|
|
13301
|
+
gap: '3px',
|
|
13302
|
+
alignItems: 'center'
|
|
13303
|
+
}
|
|
13304
|
+
}, React.createElement(CurrencySymbol, null, baseUrlSymbol), React.createElement(Input$1, {
|
|
13305
|
+
min: 0,
|
|
13306
|
+
max: 10000,
|
|
13307
|
+
type: "number",
|
|
13308
|
+
placeholder: "0.00",
|
|
13309
|
+
onWheel: function onWheel(e) {
|
|
13310
|
+
return e.target.blur();
|
|
13311
|
+
},
|
|
13312
|
+
value: (_props$inputValue$ite = props == null ? void 0 : props.inputValue[item.value]) != null ? _props$inputValue$ite : '',
|
|
13313
|
+
onChange: function onChange(e) {
|
|
13314
|
+
return handleChange(item.value, e.target.value);
|
|
13315
|
+
},
|
|
13316
|
+
onKeyDown: handleKeyDownDebrief
|
|
13317
|
+
})));
|
|
13318
|
+
})));
|
|
13319
|
+
}
|
|
13320
|
+
|
|
13321
|
+
var fields$2 = [{
|
|
13322
|
+
label: 'Disposal & Recycling',
|
|
13323
|
+
value: 'disposal_recycling'
|
|
13324
|
+
}, {
|
|
13325
|
+
label: 'Disposal Only',
|
|
13326
|
+
value: 'disposal'
|
|
13327
|
+
}, {
|
|
13328
|
+
label: 'Recycle Only',
|
|
13329
|
+
value: 'recycle'
|
|
13330
|
+
}, {
|
|
13331
|
+
label: 'Admin',
|
|
13332
|
+
value: 'admin'
|
|
13333
|
+
}];
|
|
13334
|
+
function DisposalCharge(props) {
|
|
13335
|
+
var _useChargesState = useChargesState(),
|
|
13336
|
+
setCharges = _useChargesState[1];
|
|
13337
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
13338
|
+
var handleChange = function handleChange(field, value) {
|
|
13339
|
+
props == null || props.setInputValue(function (prev) {
|
|
13340
|
+
var _extends2;
|
|
13341
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[field] = value, _extends2));
|
|
13342
|
+
});
|
|
13343
|
+
var val = parseFloat(value);
|
|
13344
|
+
if (isNaN(val)) {
|
|
13345
|
+
setCharges(function (prev) {
|
|
13346
|
+
var _extends3;
|
|
13347
|
+
return _extends({}, prev, (_extends3 = {}, _extends3[field] = 0, _extends3));
|
|
13348
|
+
});
|
|
13349
|
+
} else {
|
|
13350
|
+
val = val >= 0 ? val : 0;
|
|
13351
|
+
setCharges(function (prev) {
|
|
13352
|
+
var _extends4;
|
|
13353
|
+
return _extends({}, prev, (_extends4 = {}, _extends4[field] = val, _extends4));
|
|
13354
|
+
});
|
|
13355
|
+
}
|
|
13356
|
+
};
|
|
13357
|
+
return React.createElement(MainContainer$b, null, React.createElement(Title$6, null, "Disposal Charges"), React.createElement(Container$17, null, fields$2.map(function (item) {
|
|
13358
|
+
var _props$inputValue$ite;
|
|
13359
|
+
return React.createElement(FieldRow, {
|
|
13360
|
+
key: item.value
|
|
13361
|
+
}, React.createElement(Label$i, null, item.label), React.createElement("div", {
|
|
13362
|
+
style: {
|
|
13363
|
+
display: 'flex',
|
|
13364
|
+
gap: '3px',
|
|
13365
|
+
alignItems: 'center'
|
|
13366
|
+
}
|
|
13367
|
+
}, React.createElement(CurrencySymbol, null, baseUrlSymbol), React.createElement(Input$1, {
|
|
13368
|
+
min: 0,
|
|
13369
|
+
max: 10000,
|
|
13370
|
+
type: "number",
|
|
13371
|
+
placeholder: "0.00",
|
|
13372
|
+
onWheel: function onWheel(e) {
|
|
13373
|
+
return e.target.blur();
|
|
13374
|
+
},
|
|
13375
|
+
value: (_props$inputValue$ite = props == null ? void 0 : props.inputValue[item.value]) != null ? _props$inputValue$ite : '',
|
|
13376
|
+
onChange: function onChange(e) {
|
|
13377
|
+
return handleChange(item.value, e.target.value);
|
|
13378
|
+
},
|
|
13379
|
+
onKeyDown: handleKeyDownDebrief
|
|
13380
|
+
})));
|
|
13381
|
+
})));
|
|
13382
|
+
}
|
|
13383
|
+
|
|
13384
|
+
var _templateObject$28, _templateObject2$1C;
|
|
13385
|
+
function BaseCharges(props) {
|
|
13386
|
+
var _props$staticData, _props$inputValue$bas;
|
|
13387
|
+
var _useChargesState = useChargesState(),
|
|
13388
|
+
chargesState = _useChargesState[0],
|
|
13389
|
+
setCharges = _useChargesState[1];
|
|
13390
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
13391
|
+
// const [inputValue, setInputValue] = useState<Record<string, string>>({});
|
|
13392
|
+
var handleChange = function handleChange(field, value) {
|
|
13393
|
+
props == null || props.setInputValue(function (prev) {
|
|
13394
|
+
var _extends2;
|
|
13395
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[field] = value, _extends2));
|
|
13396
|
+
});
|
|
13397
|
+
var val = parseFloat(value);
|
|
13398
|
+
if (value === '') {
|
|
13399
|
+
setCharges(function (prev) {
|
|
13400
|
+
var _extends3;
|
|
13401
|
+
return _extends({}, prev, (_extends3 = {}, _extends3[field] = 0, _extends3));
|
|
13402
|
+
});
|
|
13403
|
+
} else if (!isNaN(val)) {
|
|
13404
|
+
val = val >= 0 ? val : 0;
|
|
13405
|
+
setCharges(function (prev) {
|
|
13406
|
+
var _extends4;
|
|
13407
|
+
return _extends({}, prev, (_extends4 = {}, _extends4[field] = val, _extends4));
|
|
13408
|
+
});
|
|
13409
|
+
}
|
|
13410
|
+
};
|
|
13411
|
+
var onChange = function onChange(val) {
|
|
13412
|
+
setCharges(function (charge) {
|
|
13413
|
+
return _extends({}, charge, {
|
|
13414
|
+
base_charge_type: +val
|
|
13415
|
+
});
|
|
13416
|
+
});
|
|
13417
|
+
};
|
|
13418
|
+
var baseChargeOptions = props == null || (_props$staticData = props.staticData) == null || (_props$staticData = _props$staticData.base_charges) == null ? void 0 : _props$staticData.map(function (x) {
|
|
13419
|
+
return {
|
|
13420
|
+
label: x == null ? void 0 : x.type,
|
|
13421
|
+
value: x == null ? void 0 : x.id
|
|
13422
|
+
};
|
|
13423
|
+
});
|
|
13424
|
+
return React.createElement(MainContainer$b, null, React.createElement(Title$6, null, "Base Charge"), React.createElement(Wrapper$k, null, React.createElement(FieldRow, null, React.createElement(Label$i, {
|
|
13425
|
+
style: {
|
|
13426
|
+
width: '90px'
|
|
13427
|
+
}
|
|
13428
|
+
}, "Base Charge"), React.createElement("div", {
|
|
13429
|
+
style: {
|
|
13430
|
+
display: 'flex',
|
|
13431
|
+
gap: '3px',
|
|
13432
|
+
alignItems: 'center'
|
|
13433
|
+
}
|
|
13434
|
+
}, React.createElement(AntSelect, {
|
|
13435
|
+
onChange: onChange,
|
|
13436
|
+
options: baseChargeOptions || [],
|
|
13437
|
+
placeholder: "Base charge type",
|
|
13438
|
+
defaultValue: baseChargeOptions == null ? void 0 : baseChargeOptions.filter(function (x) {
|
|
13439
|
+
return (x == null ? void 0 : x.value) === (chargesState == null ? void 0 : chargesState.base_charge_type);
|
|
13440
|
+
}),
|
|
13441
|
+
style: {
|
|
13442
|
+
width: 100
|
|
13443
|
+
}
|
|
13444
|
+
}), React.createElement(CurrencyWrapper, null, baseUrlSymbol), React.createElement(Input$1, {
|
|
13445
|
+
min: 0,
|
|
13446
|
+
max: 10000,
|
|
13447
|
+
type: "number",
|
|
13448
|
+
placeholder: "0.00",
|
|
13449
|
+
onWheel: function onWheel(e) {
|
|
13450
|
+
return e.target.blur();
|
|
13451
|
+
},
|
|
13452
|
+
value: (_props$inputValue$bas = props == null ? void 0 : props.inputValue['base_charge']) != null ? _props$inputValue$bas : '',
|
|
13453
|
+
onChange: function onChange(e) {
|
|
13454
|
+
return handleChange('base_charge', e.target.value);
|
|
13455
|
+
},
|
|
13456
|
+
onKeyDown: handleKeyDownDebrief
|
|
13457
|
+
})))));
|
|
13458
|
+
}
|
|
13459
|
+
var Wrapper$k = /*#__PURE__*/styled.div(_templateObject$28 || (_templateObject$28 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
13460
|
+
var CurrencyWrapper = /*#__PURE__*/styled.div(_templateObject2$1C || (_templateObject2$1C = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n color: #999;\n"])));
|
|
13461
|
+
|
|
13462
|
+
var fields$3 = ['ROC', 'Unpack', 'Packaging Disposal', 'Assembly', 'QC'];
|
|
13463
|
+
function DeliveryAddOns(props) {
|
|
13464
|
+
var _useChargesState = useChargesState(),
|
|
13465
|
+
setCharges = _useChargesState[1];
|
|
13466
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
13467
|
+
var fieldsInLabelValueFormat = fields$3.map(function (field) {
|
|
13468
|
+
return {
|
|
13469
|
+
label: field,
|
|
13470
|
+
value: field.toLowerCase().replace(/ /g, '_')
|
|
13471
|
+
};
|
|
13472
|
+
});
|
|
13473
|
+
var handleChange = function handleChange(field, value) {
|
|
13474
|
+
props == null || props.setInputValue(function (prev) {
|
|
13475
|
+
var _extends2;
|
|
13476
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[field] = value, _extends2));
|
|
13477
|
+
});
|
|
13478
|
+
var val = parseFloat(value);
|
|
13479
|
+
if (isNaN(val)) {
|
|
13480
|
+
setCharges(function (prev) {
|
|
13481
|
+
var _extends3;
|
|
13482
|
+
return _extends({}, prev, (_extends3 = {}, _extends3[field] = 0, _extends3));
|
|
13483
|
+
});
|
|
13484
|
+
} else {
|
|
13485
|
+
val = val >= 0 ? val : 0;
|
|
13486
|
+
setCharges(function (prev) {
|
|
13487
|
+
var _extends4;
|
|
13488
|
+
return _extends({}, prev, (_extends4 = {}, _extends4[field] = val, _extends4));
|
|
13489
|
+
});
|
|
13490
|
+
}
|
|
13491
|
+
};
|
|
13492
|
+
return React.createElement(MainContainer$b, null, React.createElement(Title$6, null, "Delivery Add-Ons"), React.createElement(Container$17, null, fieldsInLabelValueFormat.map(function (item) {
|
|
13493
|
+
var _props$inputValue$ite;
|
|
13494
|
+
return React.createElement(FieldRow, {
|
|
13495
|
+
key: item.value
|
|
13496
|
+
}, React.createElement(Label$i, null, item.label), React.createElement("div", {
|
|
13497
|
+
style: {
|
|
13498
|
+
display: 'flex',
|
|
13499
|
+
gap: '3px',
|
|
13500
|
+
alignItems: 'center'
|
|
13501
|
+
}
|
|
13502
|
+
}, React.createElement(CurrencySymbol, null, baseUrlSymbol), React.createElement(Input$1, {
|
|
13503
|
+
min: 0,
|
|
13504
|
+
max: 10000,
|
|
13505
|
+
type: "number",
|
|
13506
|
+
placeholder: "0.00",
|
|
13507
|
+
onWheel: function onWheel(e) {
|
|
13508
|
+
return e.target.blur();
|
|
13509
|
+
},
|
|
13510
|
+
value: (_props$inputValue$ite = props == null ? void 0 : props.inputValue[item.value]) != null ? _props$inputValue$ite : '',
|
|
13511
|
+
onKeyDown: handleKeyDownDebrief,
|
|
13512
|
+
onChange: function onChange(e) {
|
|
13513
|
+
return handleChange(item.value, e.target.value);
|
|
13514
|
+
}
|
|
13515
|
+
})));
|
|
13516
|
+
})));
|
|
13517
|
+
}
|
|
13518
|
+
|
|
13519
|
+
function AdhocSection() {
|
|
13520
|
+
var _charges$adhoc_charge;
|
|
13521
|
+
var _useChargesState = useChargesState(),
|
|
13522
|
+
charges = _useChargesState[0],
|
|
13523
|
+
setCharges = _useChargesState[1];
|
|
13524
|
+
var _useState = useState(charges == null ? void 0 : charges.adhoc_charges),
|
|
13525
|
+
inputValues = _useState[0],
|
|
13526
|
+
setInputValues = _useState[1];
|
|
13527
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
13528
|
+
var handleLabelChange = function handleLabelChange(id, newLabel) {
|
|
13529
|
+
setCharges(function (prev) {
|
|
13530
|
+
return _extends({}, prev, {
|
|
13531
|
+
adhoc_charges: prev.adhoc_charges.map(function (charge) {
|
|
13532
|
+
return charge.id === id ? _extends({}, charge, {
|
|
13533
|
+
adhoc_charges_description: newLabel
|
|
13534
|
+
}) : charge;
|
|
13535
|
+
})
|
|
13536
|
+
});
|
|
13537
|
+
});
|
|
13538
|
+
};
|
|
13539
|
+
var handleValueChange = function handleValueChange(id, value) {
|
|
13540
|
+
setInputValues(function (prev) {
|
|
13541
|
+
var _extends2;
|
|
13542
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[id] = value, _extends2));
|
|
13543
|
+
});
|
|
13544
|
+
var val = parseFloat(value);
|
|
13545
|
+
if (value === '') {
|
|
13546
|
+
setCharges(function (prev) {
|
|
13547
|
+
return _extends({}, prev, {
|
|
13548
|
+
adhoc_charges: prev.adhoc_charges.map(function (charge) {
|
|
13549
|
+
return charge.id === id ? _extends({}, charge, {
|
|
13550
|
+
adhoc_charges: 0
|
|
13551
|
+
}) : charge;
|
|
13552
|
+
})
|
|
13553
|
+
});
|
|
13554
|
+
});
|
|
13555
|
+
} else if (!isNaN(val)) {
|
|
13556
|
+
val = val >= 0 ? val : 0;
|
|
13557
|
+
setCharges(function (prev) {
|
|
13558
|
+
return _extends({}, prev, {
|
|
13559
|
+
adhoc_charges: prev.adhoc_charges.map(function (charge) {
|
|
13560
|
+
return charge.id === id ? _extends({}, charge, {
|
|
13561
|
+
adhoc_charges: val
|
|
13562
|
+
}) : charge;
|
|
13563
|
+
})
|
|
13564
|
+
});
|
|
13565
|
+
});
|
|
13566
|
+
}
|
|
13567
|
+
};
|
|
13568
|
+
return React.createElement(MainContainer$b, null, React.createElement(Title$6, null, "Adhoc"), React.createElement(Container$17, null, charges == null || (_charges$adhoc_charge = charges.adhoc_charges) == null ? void 0 : _charges$adhoc_charge.map(function (item) {
|
|
13569
|
+
var _inputValues$item$id;
|
|
13570
|
+
return React.createElement(FieldRow, {
|
|
13571
|
+
key: item.id
|
|
13572
|
+
}, React.createElement(Input$1, {
|
|
13573
|
+
placeholder: "",
|
|
13574
|
+
value: item.adhoc_charges_description,
|
|
13575
|
+
onChange: function onChange(e) {
|
|
13576
|
+
return handleLabelChange(item.id, e.target.value);
|
|
13577
|
+
},
|
|
13578
|
+
style: {
|
|
13579
|
+
marginRight: '8px',
|
|
13580
|
+
flex: 1
|
|
13581
|
+
}
|
|
13582
|
+
}), React.createElement("div", {
|
|
13583
|
+
style: {
|
|
13584
|
+
display: 'flex',
|
|
13585
|
+
gap: '3px',
|
|
13586
|
+
alignItems: 'center'
|
|
13587
|
+
}
|
|
13588
|
+
}, React.createElement(CurrencySymbol, null, baseUrlSymbol), React.createElement(Input$1, {
|
|
13589
|
+
type: "number",
|
|
13590
|
+
min: 0,
|
|
13591
|
+
max: 10000,
|
|
13592
|
+
placeholder: "0.00",
|
|
13593
|
+
onWheel: function onWheel(e) {
|
|
13594
|
+
return e.target.blur();
|
|
13595
|
+
},
|
|
13596
|
+
value: (_inputValues$item$id = inputValues[item.id]) != null ? _inputValues$item$id : '',
|
|
13597
|
+
onChange: function onChange(e) {
|
|
13598
|
+
return handleValueChange(item.id, e.target.value);
|
|
13599
|
+
},
|
|
13600
|
+
style: {
|
|
13601
|
+
flex: 1
|
|
13602
|
+
},
|
|
13603
|
+
onKeyDown: handleKeyDownDebrief
|
|
13604
|
+
})));
|
|
13605
|
+
})));
|
|
13606
|
+
}
|
|
13607
|
+
|
|
13608
|
+
var _templateObject$29;
|
|
13609
|
+
function FailureReasonDropdown() {
|
|
13610
|
+
var _escalationCategory$f, _escalationCategory$f2, _escalationTypes$filt, _escalationTypes$filt2;
|
|
13611
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
13612
|
+
orderStaticData = _useOrderStaticData[0];
|
|
13613
|
+
var _useFailureReason = useFailureReason(),
|
|
13614
|
+
failureReasonState = _useFailureReason[0],
|
|
13615
|
+
setFailureReason = _useFailureReason[1];
|
|
13616
|
+
var _useIsFailureReasonCh = useIsFailureReasonChanged(),
|
|
13617
|
+
setIsFailureReasonChanged = _useIsFailureReasonCh[1]; // to map esc reason properly
|
|
13618
|
+
var failureReasons = orderStaticData == null ? void 0 : orderStaticData.failure_reasons;
|
|
13619
|
+
var escalationCategory = orderStaticData == null ? void 0 : orderStaticData.escalation_category;
|
|
13620
|
+
var escalationTypes = orderStaticData == null ? void 0 : orderStaticData.escalation_types;
|
|
13621
|
+
var faultNonFaultReasons = orderStaticData == null ? void 0 : orderStaticData.fault_non_fault_reasons;
|
|
13622
|
+
// Step 1: Get IDs of "Failure-Non_Fault" and "Failure-Fault"
|
|
13623
|
+
var failureNonFaultId = escalationCategory == null || (_escalationCategory$f = escalationCategory.find(function (category) {
|
|
13624
|
+
return (category == null ? void 0 : category.type) === 'Failure - Non Fault';
|
|
13625
|
+
})) == null ? void 0 : _escalationCategory$f.id;
|
|
13626
|
+
var failureFaultId = escalationCategory == null || (_escalationCategory$f2 = escalationCategory.find(function (category) {
|
|
13627
|
+
return (category == null ? void 0 : category.type) === 'Failure - Fault';
|
|
13628
|
+
})) == null ? void 0 : _escalationCategory$f2.id;
|
|
13629
|
+
// Step 2: Map to get escalation type IDs
|
|
13630
|
+
var failureNonFaultEscTypeId = escalationTypes == null || (_escalationTypes$filt = escalationTypes.filter(function (type) {
|
|
13631
|
+
return (type == null ? void 0 : type.escalation_category_id) === failureNonFaultId;
|
|
13632
|
+
})[0]) == null ? void 0 : _escalationTypes$filt.id;
|
|
13633
|
+
var failureFaultEscTypeId = escalationTypes == null || (_escalationTypes$filt2 = escalationTypes.filter(function (type) {
|
|
13634
|
+
return (type == null ? void 0 : type.escalation_category_id) === failureFaultId;
|
|
13635
|
+
})[0]) == null ? void 0 : _escalationTypes$filt2.id;
|
|
13636
|
+
// Step 3: Separate fault and non-fault reasons
|
|
13637
|
+
var nonFaultReasons = faultNonFaultReasons == null ? void 0 : faultNonFaultReasons.filter(function (reason) {
|
|
13638
|
+
return (reason == null ? void 0 : reason.escalation_type_id) === failureNonFaultEscTypeId;
|
|
13639
|
+
});
|
|
13640
|
+
var faultReasons = faultNonFaultReasons == null ? void 0 : faultNonFaultReasons.filter(function (reason) {
|
|
13641
|
+
return (reason == null ? void 0 : reason.escalation_type_id) === failureFaultEscTypeId;
|
|
13642
|
+
});
|
|
13643
|
+
// Step 4: Simplified mapping to failureReasons
|
|
13644
|
+
var mapReasonsToFailures = function mapReasonsToFailures(reasons) {
|
|
13645
|
+
var _failureReasons$filte;
|
|
13646
|
+
var reasonIds = new Set(reasons == null ? void 0 : reasons.map(function (reason) {
|
|
13647
|
+
return reason == null ? void 0 : reason.order_reason_id;
|
|
13648
|
+
}));
|
|
13649
|
+
return failureReasons == null || (_failureReasons$filte = failureReasons.filter(function (failure) {
|
|
13650
|
+
return reasonIds == null ? void 0 : reasonIds.has(failure == null ? void 0 : failure.id);
|
|
13651
|
+
})) == null ? void 0 : _failureReasons$filte.map(function (failure) {
|
|
13652
|
+
return {
|
|
13653
|
+
value: failure == null ? void 0 : failure.reason,
|
|
13654
|
+
label: failure == null ? void 0 : failure.title,
|
|
13655
|
+
id: failure == null ? void 0 : failure.id
|
|
13656
|
+
};
|
|
13657
|
+
});
|
|
13658
|
+
};
|
|
13659
|
+
var faultReasonOptions = mapReasonsToFailures(faultReasons);
|
|
13660
|
+
var nonFaultReasonOptions = mapReasonsToFailures(nonFaultReasons);
|
|
13661
|
+
var groupedOptions = [{
|
|
13662
|
+
label: 'Fault Reasons',
|
|
13663
|
+
options: faultReasonOptions
|
|
13664
|
+
}, {
|
|
13665
|
+
label: 'Non-Fault Reasons',
|
|
13666
|
+
options: nonFaultReasonOptions
|
|
13667
|
+
}];
|
|
13668
|
+
var onChangeOption = function onChangeOption(option) {
|
|
13669
|
+
setFailureReason(option);
|
|
13670
|
+
setIsFailureReasonChanged(true);
|
|
13671
|
+
};
|
|
13672
|
+
var formatGroupLabel = function formatGroupLabel(data) {
|
|
13673
|
+
return React.createElement("div", {
|
|
13674
|
+
style: {
|
|
13675
|
+
color: 'rgba(0,0,0,0.8)'
|
|
13676
|
+
}
|
|
13677
|
+
}, React.createElement("span", null, data == null ? void 0 : data.label));
|
|
13678
|
+
};
|
|
13679
|
+
return React.createElement(Container$18, null, React.createElement(Label$k, {
|
|
13680
|
+
label: "Failure Reason",
|
|
13681
|
+
htmlFor: "failurereasondropdown",
|
|
13682
|
+
required: true
|
|
13683
|
+
}), React.createElement(SelectDropdown, {
|
|
13684
|
+
placeholder: "Select Reason",
|
|
13685
|
+
options: groupedOptions || [],
|
|
13686
|
+
inputId: "failurereasondropdown",
|
|
13687
|
+
openMenuOnFocus: true,
|
|
13688
|
+
value: failureReasonState,
|
|
13689
|
+
onChange: onChangeOption,
|
|
13690
|
+
formatGroupLabel: formatGroupLabel,
|
|
13691
|
+
isDisabled: false
|
|
13692
|
+
}));
|
|
13693
|
+
}
|
|
13694
|
+
var Container$18 = /*#__PURE__*/styled.div(_templateObject$29 || (_templateObject$29 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
13695
|
+
|
|
13696
|
+
var _templateObject$2a;
|
|
13697
|
+
function StatusDropdown() {
|
|
13698
|
+
var _orderStaticData$new_;
|
|
13699
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
13700
|
+
orderStaticData = _useOrderStaticData[0];
|
|
13701
|
+
var _useNewStatus = useNewStatus(),
|
|
13702
|
+
newStatus = _useNewStatus[0],
|
|
13703
|
+
setNewStatus = _useNewStatus[1];
|
|
13704
|
+
var _useChargesState = useChargesState(),
|
|
13705
|
+
setCharges = _useChargesState[1];
|
|
13706
|
+
var newStatusOptions = orderStaticData == null || (_orderStaticData$new_ = orderStaticData.new_status) == null ? void 0 : _orderStaticData$new_.map(function (x) {
|
|
13707
|
+
return {
|
|
13708
|
+
label: x.type,
|
|
13709
|
+
value: x.id
|
|
13710
|
+
};
|
|
13711
|
+
});
|
|
13712
|
+
var selectedOption = (newStatusOptions == null ? void 0 : newStatusOptions.find(function (option) {
|
|
13713
|
+
return option.label === newStatus;
|
|
13714
|
+
})) || null;
|
|
13715
|
+
var onChange = function onChange(option) {
|
|
13716
|
+
setNewStatus(option == null ? void 0 : option.label);
|
|
13717
|
+
setCharges(function (prev) {
|
|
13718
|
+
return _extends({}, prev, {
|
|
13719
|
+
new_order_status: option == null ? void 0 : option.label
|
|
13720
|
+
});
|
|
13721
|
+
});
|
|
13722
|
+
};
|
|
13723
|
+
return React.createElement(Container$19, null, React.createElement(Label$k, {
|
|
13724
|
+
label: "New Status",
|
|
13725
|
+
htmlFor: "statusdropdown",
|
|
13726
|
+
required: true
|
|
13727
|
+
}), React.createElement(SelectDropdown, {
|
|
13728
|
+
placeholder: "Select Status",
|
|
13729
|
+
options: newStatusOptions || [],
|
|
13730
|
+
inputId: "statusdropdown",
|
|
13731
|
+
value: selectedOption,
|
|
13732
|
+
openMenuOnFocus: true,
|
|
13733
|
+
onChange: onChange,
|
|
13734
|
+
isDisabled: false
|
|
13735
|
+
}));
|
|
13736
|
+
}
|
|
13737
|
+
var Container$19 = /*#__PURE__*/styled.div(_templateObject$2a || (_templateObject$2a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
13738
|
+
|
|
13739
|
+
var _templateObject$2b;
|
|
13740
|
+
function CancellationReasonDropdown() {
|
|
13741
|
+
var _orderStaticData$canc;
|
|
13742
|
+
var _useOrderCancelReason = useOrderCancelReason(),
|
|
13743
|
+
cancelationReason = _useOrderCancelReason[0],
|
|
13744
|
+
setCancelationReason = _useOrderCancelReason[1];
|
|
13745
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
13746
|
+
orderStaticData = _useOrderStaticData[0];
|
|
13747
|
+
var cancellationReasonOptions = (orderStaticData == null || (_orderStaticData$canc = orderStaticData.cancellation_reasons) == null ? void 0 : _orderStaticData$canc.map(function (x) {
|
|
13748
|
+
return {
|
|
13749
|
+
label: x.reason,
|
|
13750
|
+
value: x.id
|
|
13751
|
+
};
|
|
13752
|
+
})) || [];
|
|
13753
|
+
return React.createElement(Container$1a, null, React.createElement(Label$k, {
|
|
13754
|
+
label: "Cancellation Reason",
|
|
13755
|
+
htmlFor: "cancellationreasondropdown",
|
|
13756
|
+
required: true
|
|
13757
|
+
}), React.createElement(SelectDropdown, {
|
|
13758
|
+
placeholder: "Select Reason",
|
|
13759
|
+
options: cancellationReasonOptions || [],
|
|
13760
|
+
inputId: "cancellationreasondropdown",
|
|
13761
|
+
openMenuOnFocus: true,
|
|
13762
|
+
value: cancelationReason,
|
|
13763
|
+
onChange: function onChange(selectedOption) {
|
|
13764
|
+
return setCancelationReason(selectedOption);
|
|
13765
|
+
}
|
|
13766
|
+
}));
|
|
13767
|
+
}
|
|
13768
|
+
var Container$1a = /*#__PURE__*/styled.div(_templateObject$2b || (_templateObject$2b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
13769
|
+
|
|
13770
|
+
var _templateObject$2c;
|
|
13771
|
+
function OrderHoldReasonDropdown() {
|
|
13772
|
+
var _orderStaticData$onho;
|
|
13773
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
13774
|
+
orderStaticData = _useOrderStaticData[0];
|
|
13775
|
+
var _useOrderHoldReason = useOrderHoldReason(),
|
|
13776
|
+
orderHold = _useOrderHoldReason[0],
|
|
13777
|
+
setOrderHold = _useOrderHoldReason[1];
|
|
13778
|
+
var holdReasonOptions = (orderStaticData == null || (_orderStaticData$onho = orderStaticData.onhold_reasons) == null ? void 0 : _orderStaticData$onho.map(function (x) {
|
|
13779
|
+
return {
|
|
13780
|
+
label: x.reason,
|
|
13781
|
+
value: x.id
|
|
13782
|
+
};
|
|
13783
|
+
})) || [];
|
|
13784
|
+
return React.createElement(Container$1b, null, React.createElement(Label$k, {
|
|
13785
|
+
label: "Hold Reason",
|
|
13786
|
+
htmlFor: "holdreasondropdown",
|
|
13787
|
+
required: true
|
|
13788
|
+
}), React.createElement(SelectDropdown, {
|
|
13789
|
+
placeholder: "Select Reason",
|
|
13790
|
+
options: holdReasonOptions || [],
|
|
13791
|
+
inputId: "holdreasondropdown",
|
|
13792
|
+
openMenuOnFocus: true,
|
|
13793
|
+
value: orderHold,
|
|
13794
|
+
onChange: function onChange(selectedOption) {
|
|
13795
|
+
return setOrderHold(selectedOption);
|
|
13796
|
+
}
|
|
13797
|
+
}));
|
|
13798
|
+
}
|
|
13799
|
+
var Container$1b = /*#__PURE__*/styled.div(_templateObject$2c || (_templateObject$2c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n"])));
|
|
13800
|
+
|
|
13801
|
+
var _templateObject$2d, _templateObject2$1D, _templateObject3$_, _templateObject4$x, _templateObject5$o, _templateObject6$c, _templateObject7$d, _templateObject8$a, _templateObject9$8, _templateObject10$4;
|
|
13802
|
+
function FailureContent() {
|
|
13803
|
+
var _chargesState$adhoc_c, _chargesState$adhoc_c2;
|
|
13804
|
+
var _useNewStatus = useNewStatus(),
|
|
13805
|
+
newStatus = _useNewStatus[0];
|
|
13806
|
+
var _useOrderDetails = useOrderDetails(),
|
|
13807
|
+
orderDetails = _useOrderDetails[0];
|
|
13808
|
+
var _useChargesState = useChargesState(),
|
|
13809
|
+
chargesState = _useChargesState[0];
|
|
13810
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
13811
|
+
var _useProductDetails = useProductDetails(),
|
|
13812
|
+
productdata = _useProductDetails[0];
|
|
13813
|
+
var sortedProductData = productdata == null ? void 0 : productdata.sort(function (a, b) {
|
|
13814
|
+
return (a == null ? void 0 : a.status) === (b == null ? void 0 : b.status) ? 0 : a != null && a.status ? -1 : 1;
|
|
13815
|
+
});
|
|
13816
|
+
var products = Array.isArray(sortedProductData) ? sortedProductData == null ? void 0 : sortedProductData.filter(function (item) {
|
|
13817
|
+
return (item == null ? void 0 : item.status) === true;
|
|
13818
|
+
}) : [];
|
|
13819
|
+
var excludedFields = ['debrief_notes', 'new_order_status', 'base_charge_type', 'adhoc_charges', 'debrief_status']; // Fields to exclude
|
|
13820
|
+
var totalChargesAmount = 0;
|
|
13821
|
+
for (var _i = 0, _Object$entries = Object.entries(chargesState); _i < _Object$entries.length; _i++) {
|
|
13822
|
+
var _Object$entries$_i = _Object$entries[_i],
|
|
13823
|
+
key = _Object$entries$_i[0],
|
|
13824
|
+
value = _Object$entries$_i[1];
|
|
13825
|
+
if (!excludedFields.includes(key) && typeof value === 'number') {
|
|
13826
|
+
totalChargesAmount += value;
|
|
13827
|
+
}
|
|
13828
|
+
}
|
|
13829
|
+
var adhocTotalCharges = (chargesState == null || (_chargesState$adhoc_c = chargesState.adhoc_charges) == null ? void 0 : _chargesState$adhoc_c.length) > 0 ? chargesState == null || (_chargesState$adhoc_c2 = chargesState.adhoc_charges) == null ? void 0 : _chargesState$adhoc_c2.reduce(function (acc, item) {
|
|
13830
|
+
return acc + item.adhoc_charges;
|
|
13831
|
+
}, 0) : 0;
|
|
13832
|
+
return React.createElement(React.Fragment, null, React.createElement(DropdownGrid, null, React.createElement(DropdownGroup, null, React.createElement(FailureReasonDropdown, null)), React.createElement(DropdownGroup, null, React.createElement(StatusDropdown, null)), newStatus === 'Cancelled' && React.createElement(DropdownGroup, null, React.createElement(CancellationReasonDropdown, null)), newStatus === 'On Hold' && React.createElement(DropdownGroup, null, React.createElement(OrderHoldReasonDropdown, null)), React.createElement(GroupedFields, null, React.createElement(PairGroup, null, React.createElement(SmallGroup, null, React.createElement(Label$k, {
|
|
13833
|
+
label: "Items",
|
|
13834
|
+
htmlFor: "items"
|
|
13835
|
+
}), React.createElement(Text$a, null, products == null ? void 0 : products.length)), React.createElement(SmallGroup, null, React.createElement(Label$k, {
|
|
13836
|
+
label: "Total Charge",
|
|
13837
|
+
htmlFor: "totalCharge"
|
|
13838
|
+
}), React.createElement("div", {
|
|
13839
|
+
style: {
|
|
13840
|
+
display: 'flex',
|
|
13841
|
+
gap: '4px',
|
|
13842
|
+
alignItems: 'center'
|
|
13843
|
+
}
|
|
13844
|
+
}, React.createElement(CurrencyWrapper$1, null, baseUrlSymbol), React.createElement(Text$a, null, totalChargesAmount + adhocTotalCharges)))), React.createElement(PairGroup, null, React.createElement(SmallGroup, null, React.createElement(Label$k, {
|
|
13845
|
+
label: "Weight",
|
|
13846
|
+
htmlFor: "weight"
|
|
13847
|
+
}), React.createElement(Text$a, null, orderDetails == null ? void 0 : orderDetails.weight, "Kg"))))), React.createElement(ContDropdownGrid, null, React.createElement(FieldGroup, {
|
|
13848
|
+
wide: true
|
|
13849
|
+
}, React.createElement(Label$k, {
|
|
13850
|
+
label: "Order Status Notes",
|
|
13851
|
+
htmlFor: "notes"
|
|
13852
|
+
}), React.createElement(TextInput, {
|
|
13853
|
+
id: "notes",
|
|
13854
|
+
placeholder: "Type notes here...",
|
|
13855
|
+
value: (orderDetails == null ? void 0 : orderDetails.order_status_note) || '',
|
|
13856
|
+
readOnly: true
|
|
13857
|
+
})), React.createElement(FieldGroup, {
|
|
13858
|
+
wide: true
|
|
13859
|
+
}, React.createElement(Label$k, {
|
|
13860
|
+
label: "Charge Description",
|
|
13861
|
+
htmlFor: "chargedescription"
|
|
13862
|
+
}), React.createElement(TextInput, {
|
|
13863
|
+
id: "chargedescription",
|
|
13864
|
+
placeholder: "Type charge description here...",
|
|
13865
|
+
onChange: function onChange() {}
|
|
13866
|
+
}))));
|
|
13867
|
+
}
|
|
13868
|
+
var CurrencyWrapper$1 = /*#__PURE__*/styled.span(_templateObject$2d || (_templateObject$2d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n color: #999;\n"])));
|
|
13869
|
+
var Text$a = /*#__PURE__*/styled.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #363a30;\n font-size: 14px;\n"])));
|
|
13870
|
+
var GroupedFields = /*#__PURE__*/styled.div(_templateObject3$_ || (_templateObject3$_ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 7px;\n"])));
|
|
13871
|
+
var PairGroup = /*#__PURE__*/styled.div(_templateObject4$x || (_templateObject4$x = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n gap: 20px;\n\n @media (max-width: 768px) {\n flex-direction: column;\n }\n"])));
|
|
13872
|
+
var SmallGroup = /*#__PURE__*/styled.div(_templateObject5$o || (_templateObject5$o = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n min-width: 140px;\n flex: 1;\n"])));
|
|
13873
|
+
var FieldGroup = /*#__PURE__*/styled.div(_templateObject6$c || (_templateObject6$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: ", ";\n min-width: ", ";\n"])), function (props) {
|
|
13874
|
+
return props.wide ? 2 : 1;
|
|
13875
|
+
}, function (props) {
|
|
13876
|
+
return props.wide ? '300px' : '220px';
|
|
13877
|
+
});
|
|
13878
|
+
var TextInput = /*#__PURE__*/styled(TextArea)(_templateObject7$d || (_templateObject7$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n resize: none;\n width: 100%;\n min-height: 180px;\n"])));
|
|
13879
|
+
var DropdownGrid = /*#__PURE__*/styled.div(_templateObject8$a || (_templateObject8$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 20px;\n"])));
|
|
13880
|
+
var ContDropdownGrid = /*#__PURE__*/styled.div(_templateObject9$8 || (_templateObject9$8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 20px;\n"])));
|
|
13881
|
+
var DropdownGroup = /*#__PURE__*/styled.div(_templateObject10$4 || (_templateObject10$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1 1 calc(50% - 10px);\n\n @media (max-width: 768px) {\n flex: 1 1 100%;\n }\n"])));
|
|
13882
|
+
|
|
13883
|
+
var _templateObject$2e, _templateObject2$1E, _templateObject3$$, _templateObject4$y, _templateObject5$p, _templateObject6$d, _templateObject7$e, _templateObject8$b, _templateObject9$9, _templateObject10$5, _templateObject11$3;
|
|
13884
|
+
var formatDate$2 = function formatDate(date) {
|
|
13885
|
+
var padZero = function padZero(num) {
|
|
13886
|
+
return num.toString().padStart(2, '0');
|
|
13887
|
+
};
|
|
13888
|
+
var year = new Date(date).getFullYear();
|
|
13889
|
+
var month = padZero(new Date(date).getMonth() + 1);
|
|
13890
|
+
var day = padZero(new Date(date).getDate());
|
|
13891
|
+
return day + "/" + month + "/" + year;
|
|
13892
|
+
};
|
|
13893
|
+
function SuccessContent() {
|
|
13894
|
+
var _chargesState$adhoc_c, _chargesState$adhoc_c2, _orderDetails$order_r;
|
|
13895
|
+
var _useOrderDetails = useOrderDetails(),
|
|
13896
|
+
orderDetails = _useOrderDetails[0];
|
|
13897
|
+
var _useChargesState = useChargesState(),
|
|
13898
|
+
chargesState = _useChargesState[0];
|
|
13899
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
13900
|
+
var _useProductDetails = useProductDetails(),
|
|
13901
|
+
productdata = _useProductDetails[0];
|
|
13902
|
+
var sortedProductData = productdata == null ? void 0 : productdata.sort(function (a, b) {
|
|
13903
|
+
return (a == null ? void 0 : a.status) === (b == null ? void 0 : b.status) ? 0 : a != null && a.status ? -1 : 1;
|
|
13904
|
+
});
|
|
13905
|
+
var products = Array.isArray(sortedProductData) ? sortedProductData == null ? void 0 : sortedProductData.filter(function (item) {
|
|
13906
|
+
return (item == null ? void 0 : item.status) === true;
|
|
13907
|
+
}) : [];
|
|
13908
|
+
var excludedFields = ['debrief_notes', 'new_order_status', 'base_charge_type', 'adhoc_charges', 'debrief_status']; // Fields to exclude
|
|
13909
|
+
var totalChargesAmount = 0;
|
|
13910
|
+
for (var _i = 0, _Object$entries = Object.entries(chargesState); _i < _Object$entries.length; _i++) {
|
|
13911
|
+
var _Object$entries$_i = _Object$entries[_i],
|
|
13912
|
+
key = _Object$entries$_i[0],
|
|
13913
|
+
value = _Object$entries$_i[1];
|
|
13914
|
+
if (!excludedFields.includes(key) && typeof value === 'number') {
|
|
13915
|
+
totalChargesAmount += value;
|
|
13916
|
+
}
|
|
13917
|
+
}
|
|
13918
|
+
var formattedDate = (orderDetails == null ? void 0 : orderDetails.action_date) === null ? ' ' : formatDate$2(orderDetails == null ? void 0 : orderDetails.action_date);
|
|
13919
|
+
var adhocTotalCharges = (chargesState == null || (_chargesState$adhoc_c = chargesState.adhoc_charges) == null ? void 0 : _chargesState$adhoc_c.length) > 0 ? chargesState == null || (_chargesState$adhoc_c2 = chargesState.adhoc_charges) == null ? void 0 : _chargesState$adhoc_c2.reduce(function (acc, item) {
|
|
13920
|
+
return acc + item.adhoc_charges;
|
|
13921
|
+
}, 0) : 0;
|
|
13922
|
+
return React.createElement(Wrapper$l, null, React.createElement(FieldGroup$1, null, React.createElement(Label$k, {
|
|
13923
|
+
label: "Signed By",
|
|
13924
|
+
htmlFor: "signedby"
|
|
13925
|
+
}), React.createElement(StyledInput$1, {
|
|
13926
|
+
id: "signedby",
|
|
13927
|
+
placeholder: "",
|
|
13928
|
+
value: (orderDetails == null || (_orderDetails$order_r = orderDetails.order_recipient) == null ? void 0 : _orderDetails$order_r.recipient_name) || '',
|
|
13929
|
+
onChange: function onChange() {},
|
|
13930
|
+
disabled: true
|
|
13931
|
+
}), React.createElement(Label$k, {
|
|
13932
|
+
label: "Date",
|
|
13933
|
+
htmlFor: "datefield"
|
|
13934
|
+
}), React.createElement(DateInput, null, React.createElement(Text$b, null, formattedDate), React.createElement(CalendarIcon, null)), React.createElement(GroupedFields$1, null, React.createElement(PairGroup$1, null, React.createElement(SmallGroup$1, null, React.createElement(Label$k, {
|
|
13935
|
+
label: "Items",
|
|
13936
|
+
htmlFor: "items"
|
|
13937
|
+
}), React.createElement(Text$b, null, products == null ? void 0 : products.length)), React.createElement(SmallGroup$1, null, React.createElement(Label$k, {
|
|
13938
|
+
label: "Zone",
|
|
13939
|
+
htmlFor: "zone"
|
|
13940
|
+
}), React.createElement(Text$b, null, orderDetails == null ? void 0 : orderDetails.zone_code))), React.createElement(PairGroup$1, null, React.createElement(SmallGroup$1, null, React.createElement(Label$k, {
|
|
13941
|
+
label: "Weight",
|
|
13942
|
+
htmlFor: "weight"
|
|
13943
|
+
}), React.createElement(Text$b, null, orderDetails == null ? void 0 : orderDetails.weight, "Kg")), React.createElement(SmallGroup$1, null, React.createElement(Label$k, {
|
|
13944
|
+
label: "Total Charge",
|
|
13945
|
+
htmlFor: "totalCharge"
|
|
13946
|
+
}), React.createElement("div", {
|
|
13947
|
+
style: {
|
|
13948
|
+
display: 'flex',
|
|
13949
|
+
gap: '4px',
|
|
13950
|
+
alignItems: 'center'
|
|
13951
|
+
}
|
|
13952
|
+
}, React.createElement(CurrencyWrapper$2, null, baseUrlSymbol), React.createElement(Text$b, null, totalChargesAmount + adhocTotalCharges)))))), React.createElement(DropdownGrid$1, null, React.createElement(FieldGroup$1, {
|
|
13953
|
+
wide: true
|
|
13954
|
+
}, React.createElement(Label$k, {
|
|
13955
|
+
label: "Order Status Notes",
|
|
13956
|
+
htmlFor: "notes"
|
|
13957
|
+
}), React.createElement(TextInput$1, {
|
|
13958
|
+
id: "notes",
|
|
13959
|
+
placeholder: "Type notes here...",
|
|
13960
|
+
value: (orderDetails == null ? void 0 : orderDetails.order_status_note) || '',
|
|
13961
|
+
readOnly: true
|
|
13962
|
+
})), React.createElement(FieldGroup$1, {
|
|
13963
|
+
wide: true
|
|
13964
|
+
}, React.createElement(Label$k, {
|
|
13965
|
+
label: "Charge Description",
|
|
13966
|
+
htmlFor: "chargedescription"
|
|
13967
|
+
}), React.createElement(TextInput$1, {
|
|
13968
|
+
id: "chargedescription",
|
|
13969
|
+
placeholder: "Type charge description here...",
|
|
13970
|
+
onChange: function onChange() {}
|
|
13971
|
+
}))));
|
|
13972
|
+
}
|
|
13973
|
+
var CurrencyWrapper$2 = /*#__PURE__*/styled.span(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n color: #999;\n"])));
|
|
13974
|
+
var DropdownGrid$1 = /*#__PURE__*/styled.div(_templateObject2$1E || (_templateObject2$1E = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n width: 48%;\n"])));
|
|
13975
|
+
var GroupedFields$1 = /*#__PURE__*/styled.div(_templateObject3$$ || (_templateObject3$$ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 7px;\n"])));
|
|
13976
|
+
var PairGroup$1 = /*#__PURE__*/styled.div(_templateObject4$y || (_templateObject4$y = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n gap: 20px;\n\n @media (max-width: 768px) {\n flex-direction: column;\n }\n"])));
|
|
13977
|
+
var SmallGroup$1 = /*#__PURE__*/styled.div(_templateObject5$p || (_templateObject5$p = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n width: 48%;\n"])));
|
|
13978
|
+
var Wrapper$l = /*#__PURE__*/styled.div(_templateObject6$d || (_templateObject6$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n gap: 20px;\n width: 100%;\n padding: 10px 0;\n"])));
|
|
13979
|
+
var FieldGroup$1 = /*#__PURE__*/styled.div(_templateObject7$e || (_templateObject7$e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: ", ";\n"])), function (props) {
|
|
13980
|
+
return props.wide ? 2 : 1;
|
|
13981
|
+
});
|
|
13982
|
+
var TextInput$1 = /*#__PURE__*/styled(TextArea)(_templateObject8$b || (_templateObject8$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n resize: none;\n width: 100%;\n min-height: 180px;\n"])));
|
|
13983
|
+
var StyledInput$1 = /*#__PURE__*/styled(Input$1)(_templateObject9$9 || (_templateObject9$9 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n height: 38px;\n"])));
|
|
13984
|
+
var DateInput = /*#__PURE__*/styled.div(_templateObject10$5 || (_templateObject10$5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0 12px;\n border-radius: 6px;\n border: 1px solid #e0e2e7;\n background-color: #fff;\n color: #363a30;\n height: 38px;\n font-size: 14px;\n box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);\n"])));
|
|
13985
|
+
var Text$b = /*#__PURE__*/styled.div(_templateObject11$3 || (_templateObject11$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #363a30;\n font-size: 14px;\n"])));
|
|
13986
|
+
|
|
13987
|
+
var _templateObject$2f, _templateObject2$1F;
|
|
13988
|
+
var radioButtonFilterOptions = [{
|
|
13989
|
+
label: 'Yes',
|
|
13990
|
+
value: 'true'
|
|
13991
|
+
}, {
|
|
13992
|
+
label: 'No',
|
|
13993
|
+
value: 'false'
|
|
13994
|
+
}];
|
|
13995
|
+
function RadioButtonGroups() {
|
|
13996
|
+
var _orderStaticData$orde, _orderStaticData$orde2, _orderStaticData$orde3, _orderDetails$order_s, _orderDetails$order_s2, _orderDetails$order_t;
|
|
13997
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
13998
|
+
orderStaticData = _useOrderStaticData[0];
|
|
13999
|
+
var _useOrderDetails = useOrderDetails(),
|
|
14000
|
+
orderDetails = _useOrderDetails[0],
|
|
14001
|
+
setOrderDetails = _useOrderDetails[1];
|
|
14002
|
+
var serviceLevelOptions = orderStaticData == null || (_orderStaticData$orde = orderStaticData.order_service_levels) == null ? void 0 : _orderStaticData$orde.map(function (x) {
|
|
14003
|
+
return {
|
|
14004
|
+
label: capitalize(x.type.replaceAll('_', ' ')),
|
|
14005
|
+
value: x.id.toString()
|
|
14006
|
+
};
|
|
14007
|
+
});
|
|
14008
|
+
var deliveryPointOptions = orderStaticData == null || (_orderStaticData$orde2 = orderStaticData.order_delivery_point) == null ? void 0 : _orderStaticData$orde2.map(function (x) {
|
|
14009
|
+
return {
|
|
14010
|
+
label: capitalize(x.type.replaceAll('_', ' ')),
|
|
14011
|
+
value: x.id.toString()
|
|
14012
|
+
};
|
|
14013
|
+
});
|
|
14014
|
+
var serviceTypeOptions = orderStaticData == null || (_orderStaticData$orde3 = orderStaticData.order_type) == null ? void 0 : _orderStaticData$orde3.map(function (option) {
|
|
14015
|
+
return {
|
|
14016
|
+
label: capitalize(option.type.replaceAll('_', ' ')),
|
|
14017
|
+
value: option.id.toString()
|
|
14018
|
+
};
|
|
14019
|
+
});
|
|
14020
|
+
var orderServicesOptions = orderStaticData == null ? void 0 : orderStaticData.order_service_list;
|
|
14021
|
+
var orderServices = orderDetails == null ? void 0 : orderDetails.order_services;
|
|
14022
|
+
var deliveryPointId = orderDetails == null || (_orderDetails$order_s = orderDetails.order_services_detail) == null || (_orderDetails$order_s = _orderDetails$order_s.order_delivery_point_id) == null ? void 0 : _orderDetails$order_s.toString();
|
|
14023
|
+
var serviceLevelId = orderDetails == null || (_orderDetails$order_s2 = orderDetails.order_services_detail) == null || (_orderDetails$order_s2 = _orderDetails$order_s2.order_service_level_id) == null ? void 0 : _orderDetails$order_s2.toString();
|
|
14024
|
+
var orderTypeId = orderDetails == null || (_orderDetails$order_t = orderDetails.order_type_id) == null ? void 0 : _orderDetails$order_t.toString();
|
|
14025
|
+
// ON CHANGE HANDLERS
|
|
14026
|
+
var onChangeDeliveryPoint = function onChangeDeliveryPoint(event) {
|
|
14027
|
+
var updatedServices = _extends({}, orderDetails == null ? void 0 : orderDetails.order_services_detail, {
|
|
14028
|
+
order_delivery_point_id: +event.target.value
|
|
14029
|
+
});
|
|
14030
|
+
var newData = _extends({}, orderDetails, {
|
|
14031
|
+
order_services_detail: updatedServices
|
|
14032
|
+
});
|
|
14033
|
+
setOrderDetails(newData);
|
|
14034
|
+
};
|
|
14035
|
+
var onChangeServiceLevel = function onChangeServiceLevel(event) {
|
|
14036
|
+
var updatedServices = _extends({}, orderDetails == null ? void 0 : orderDetails.order_services_detail, {
|
|
14037
|
+
order_service_level_id: +event.target.value
|
|
14038
|
+
});
|
|
14039
|
+
var newData = _extends({}, orderDetails, {
|
|
14040
|
+
order_services_detail: updatedServices
|
|
14041
|
+
});
|
|
14042
|
+
setOrderDetails(newData);
|
|
14043
|
+
};
|
|
14044
|
+
var onChangeServiceType = function onChangeServiceType(event) {
|
|
14045
|
+
var newData = _extends({}, orderDetails, {
|
|
14046
|
+
order_type_id: +event.target.value
|
|
14047
|
+
});
|
|
14048
|
+
setOrderDetails(newData);
|
|
14049
|
+
};
|
|
14050
|
+
var onChangeServices = function onChangeServices(id) {
|
|
14051
|
+
var clone = [].concat(orderServices);
|
|
14052
|
+
// Check if the service already exists in the order
|
|
14053
|
+
var selectedService = clone.find(function (s) {
|
|
14054
|
+
return s.order_service_list_id === id;
|
|
14055
|
+
});
|
|
14056
|
+
if (selectedService !== undefined) {
|
|
14057
|
+
if (selectedService.new_id) {
|
|
14058
|
+
// It's a newly added service, just remove it
|
|
14059
|
+
var updatedOrderServices = clone.filter(function (service) {
|
|
14060
|
+
return service.id !== selectedService.id;
|
|
14061
|
+
});
|
|
14062
|
+
var newData = _extends({}, orderDetails, {
|
|
14063
|
+
order_services: updatedOrderServices
|
|
14064
|
+
});
|
|
14065
|
+
setOrderDetails(newData);
|
|
14066
|
+
} else {
|
|
14067
|
+
// It's an existing (persisted) service, toggle its `is_deleted` flag
|
|
14068
|
+
var updatedSelectedService = _extends({}, selectedService, {
|
|
14069
|
+
is_deleted: !selectedService.is_deleted
|
|
14070
|
+
});
|
|
14071
|
+
var _updatedOrderServices = clone.filter(function (service) {
|
|
14072
|
+
return service.id !== selectedService.id;
|
|
14073
|
+
}).concat(updatedSelectedService);
|
|
14074
|
+
var _newData = _extends({}, orderDetails, {
|
|
14075
|
+
order_services: _updatedOrderServices
|
|
14076
|
+
});
|
|
14077
|
+
setOrderDetails(_newData);
|
|
14078
|
+
}
|
|
14079
|
+
} else {
|
|
14080
|
+
// Case 2: Service doesn't exist — add it as a new one
|
|
14081
|
+
var newService = {
|
|
14082
|
+
is_deleted: false,
|
|
14083
|
+
order_service_list_id: id,
|
|
14084
|
+
new_id: id,
|
|
14085
|
+
id: id
|
|
14086
|
+
};
|
|
14087
|
+
clone.push(newService);
|
|
14088
|
+
var _newData2 = _extends({}, orderDetails, {
|
|
14089
|
+
order_services: clone
|
|
14090
|
+
});
|
|
14091
|
+
setOrderDetails(_newData2);
|
|
14092
|
+
}
|
|
14093
|
+
};
|
|
14094
|
+
return React.createElement(Container$1c, null, React.createElement(Group, null, React.createElement(RadioButtonGroup$1, {
|
|
14095
|
+
heading: "Service Type",
|
|
14096
|
+
onChange: onChangeServiceType,
|
|
14097
|
+
options: serviceTypeOptions || [],
|
|
14098
|
+
selectedValue: orderTypeId || '',
|
|
14099
|
+
direction: "vertical",
|
|
14100
|
+
required: false,
|
|
14101
|
+
isDisabled: true
|
|
14102
|
+
})), React.createElement(Group, null, React.createElement(RadioButtonGroup$1, {
|
|
14103
|
+
heading: "Service Level",
|
|
14104
|
+
onChange: onChangeServiceLevel,
|
|
14105
|
+
options: serviceLevelOptions || [],
|
|
14106
|
+
selectedValue: serviceLevelId || '',
|
|
14107
|
+
direction: "vertical",
|
|
14108
|
+
required: false,
|
|
14109
|
+
isDisabled: true
|
|
14110
|
+
})), React.createElement(Group, null, React.createElement(RadioButtonGroup$1, {
|
|
14111
|
+
heading: "Delivery Point",
|
|
14112
|
+
onChange: onChangeDeliveryPoint,
|
|
14113
|
+
options: deliveryPointOptions || [],
|
|
14114
|
+
selectedValue: deliveryPointId || '',
|
|
14115
|
+
direction: "vertical",
|
|
14116
|
+
required: false,
|
|
14117
|
+
isDisabled: true
|
|
14118
|
+
})), orderServicesOptions == null ? void 0 : orderServicesOptions.map(function (service) {
|
|
14119
|
+
var _service$type;
|
|
14120
|
+
var selected = !!(orderServices != null && orderServices.find(function (s) {
|
|
14121
|
+
return (s == null ? void 0 : s.order_service_list_id) === (service == null ? void 0 : service.id) && s.is_deleted === false;
|
|
14122
|
+
}));
|
|
14123
|
+
return React.createElement(Group, null, React.createElement(RadioButtonGroup$1, {
|
|
14124
|
+
heading: service == null || (_service$type = service.type) == null ? void 0 : _service$type.replaceAll('_', ' '),
|
|
14125
|
+
onChange: function onChange() {
|
|
14126
|
+
return onChangeServices(service == null ? void 0 : service.id);
|
|
14127
|
+
},
|
|
14128
|
+
options: radioButtonFilterOptions || [],
|
|
14129
|
+
selectedValue: selected === false ? 'false' : 'true',
|
|
14130
|
+
direction: "vertical",
|
|
14131
|
+
required: false,
|
|
14132
|
+
isDisabled: true
|
|
14133
|
+
}));
|
|
14134
|
+
}));
|
|
14135
|
+
}
|
|
14136
|
+
var Container$1c = /*#__PURE__*/styled.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n gap: 16px;\n padding: 8px;\n width: 100%;\n align-items: flex-start;\n pointer-events: none;\n"])));
|
|
14137
|
+
var Group = /*#__PURE__*/styled.div(_templateObject2$1F || (_templateObject2$1F = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n"])));
|
|
14138
|
+
|
|
14139
|
+
var _templateObject$2g, _templateObject2$1G, _templateObject3$10;
|
|
14140
|
+
function OrderInfo() {
|
|
14141
|
+
var _useActiveTab = useActiveTab(),
|
|
14142
|
+
activeTab = _useActiveTab[0];
|
|
14143
|
+
return React.createElement(Container$1d, null, React.createElement(Top$3, null, activeTab === 'success' ? React.createElement(SuccessContent, null) : React.createElement(FailureContent, null)), React.createElement(Middle, null, React.createElement(RadioButtonGroups, null)));
|
|
14144
|
+
}
|
|
14145
|
+
// const DescriptionWrapper = styled.div`
|
|
14146
|
+
// display: flex;
|
|
14147
|
+
// gap: 20px;
|
|
14148
|
+
// width: 100%;
|
|
14149
|
+
// `;
|
|
14150
|
+
var Middle = /*#__PURE__*/styled.div(_templateObject$2g || (_templateObject$2g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n"])));
|
|
14151
|
+
// const Bottom = styled.div`
|
|
14152
|
+
// display: flex;
|
|
14153
|
+
// flex-direction: column;
|
|
14154
|
+
// gap: 20px;
|
|
14155
|
+
// `;
|
|
14156
|
+
var Top$3 = /*#__PURE__*/styled.div(_templateObject2$1G || (_templateObject2$1G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 15px;\n width: 100%;\n"])));
|
|
14157
|
+
var Container$1d = /*#__PURE__*/styled.div(_templateObject3$10 || (_templateObject3$10 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 20px;\n width: 100%;\n"])));
|
|
14158
|
+
var OrderInfo$1 = /*#__PURE__*/React.memo(OrderInfo);
|
|
14159
|
+
|
|
14160
|
+
var _templateObject$2h;
|
|
14161
|
+
var Options = [{
|
|
14162
|
+
label: 'Success',
|
|
14163
|
+
value: 'success',
|
|
14164
|
+
selectedBackgroundColor: '#57DB7A'
|
|
14165
|
+
}, {
|
|
14166
|
+
label: 'Failure',
|
|
14167
|
+
value: 'failure',
|
|
14168
|
+
selectedBackgroundColor: '#E95252'
|
|
14169
|
+
}];
|
|
14170
|
+
var ForceDebriefSelector = function ForceDebriefSelector(_ref) {
|
|
14171
|
+
var onSwitchChange = _ref.onSwitchChange;
|
|
14172
|
+
var initialSelectedIndex = Options == null ? void 0 : Options.findIndex(function (_ref2) {
|
|
14173
|
+
var value = _ref2.value;
|
|
14174
|
+
return value === 'success';
|
|
14175
|
+
});
|
|
14176
|
+
var handleSwitchChange = function handleSwitchChange(selectedOptionValue) {
|
|
14177
|
+
if (typeof selectedOptionValue === 'string') {
|
|
14178
|
+
onSwitchChange(selectedOptionValue);
|
|
14179
|
+
} else {
|
|
14180
|
+
notification.error({
|
|
14181
|
+
message: 'Error',
|
|
14182
|
+
description: typeof selectedOptionValue || 'Unexpected type for selectedOptionValue:'
|
|
14183
|
+
});
|
|
14184
|
+
}
|
|
14185
|
+
};
|
|
14186
|
+
return React.createElement(StyledSwitch, null, React.createElement(SwitchSelector, {
|
|
14187
|
+
onChange: handleSwitchChange,
|
|
14188
|
+
options: Options,
|
|
14189
|
+
initialSelectedIndex: initialSelectedIndex,
|
|
14190
|
+
backgroundColor: '#cbc8c2',
|
|
14191
|
+
fontColor: '#f5f6fa',
|
|
14192
|
+
optionBorderRadius: 30
|
|
14193
|
+
}));
|
|
14194
|
+
};
|
|
14195
|
+
var StyledSwitch = /*#__PURE__*/styled.div(_templateObject$2h || (_templateObject$2h = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 25%;\n height: 40px;\n .react-switch-selector-wrapper {\n background: #777777;\n }\n"])));
|
|
14196
|
+
|
|
14197
|
+
var _templateObject$2i;
|
|
14198
|
+
function EscalationCategory() {
|
|
14199
|
+
var _orderStaticData$esca;
|
|
14200
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
14201
|
+
orderStaticData = _useOrderStaticData[0];
|
|
14202
|
+
var _useEscalationCategor = useEscalationCategory(),
|
|
14203
|
+
escalationCategory = _useEscalationCategor[0],
|
|
14204
|
+
setEscalationCategory = _useEscalationCategor[1];
|
|
14205
|
+
var _useFailureReason = useFailureReason(),
|
|
14206
|
+
failureReason = _useFailureReason[0];
|
|
14207
|
+
var faultNonFaultReasons = orderStaticData == null ? void 0 : orderStaticData.fault_non_fault_reasons;
|
|
14208
|
+
var escalationTypes = orderStaticData == null ? void 0 : orderStaticData.escalation_types;
|
|
14209
|
+
var escalationCategoryOptions = orderStaticData == null || (_orderStaticData$esca = orderStaticData.escalation_category) == null ? void 0 : _orderStaticData$esca.map(function (category) {
|
|
14210
|
+
return {
|
|
14211
|
+
label: category == null ? void 0 : category.type,
|
|
14212
|
+
value: category == null ? void 0 : category.id
|
|
14213
|
+
};
|
|
14214
|
+
});
|
|
14215
|
+
useEffect(function () {
|
|
14216
|
+
var _faultNonFaultReasons, _escalationTypes$find;
|
|
14217
|
+
var escTypeId = faultNonFaultReasons == null || (_faultNonFaultReasons = faultNonFaultReasons.find(function (x) {
|
|
14218
|
+
return (x == null ? void 0 : x.order_reason_id) === (failureReason == null ? void 0 : failureReason.id);
|
|
14219
|
+
})) == null ? void 0 : _faultNonFaultReasons.escalation_type_id;
|
|
14220
|
+
var escCategoryId = escalationTypes == null || (_escalationTypes$find = escalationTypes.find(function (x) {
|
|
14221
|
+
return (x == null ? void 0 : x.id) === escTypeId;
|
|
14222
|
+
})) == null ? void 0 : _escalationTypes$find.escalation_category_id;
|
|
14223
|
+
var selectedOption = escalationCategoryOptions == null ? void 0 : escalationCategoryOptions.find(function (option) {
|
|
14224
|
+
return (option == null ? void 0 : option.value) === escCategoryId;
|
|
14225
|
+
});
|
|
14226
|
+
setEscalationCategory(selectedOption);
|
|
14227
|
+
}, [failureReason]);
|
|
14228
|
+
return React.createElement(Container$1e, null, React.createElement(Label$k, {
|
|
14229
|
+
label: "Escalation Category"
|
|
14230
|
+
}), React.createElement(SelectDropdown, {
|
|
14231
|
+
options: escalationCategoryOptions || [],
|
|
14232
|
+
styles: _extends({}, dropdownStyles, {
|
|
14233
|
+
control: function control(styles, state) {
|
|
14234
|
+
return _extends({}, styles, {
|
|
14235
|
+
border: '1px solid #D0D5DD',
|
|
14236
|
+
cursor: 'pointer',
|
|
14237
|
+
borderRadius: "" + (state.selectProps.menuIsOpen ? '0px 0px 6px 6px' : '6px'),
|
|
14238
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
14239
|
+
minHeight: '40px',
|
|
14240
|
+
'&:hover': {
|
|
14241
|
+
borderColor: '#D0D5DD',
|
|
14242
|
+
boxShadow: '0px 3px 22px #00000014'
|
|
14243
|
+
}
|
|
14244
|
+
});
|
|
14245
|
+
},
|
|
14246
|
+
menu: function menu(styles) {
|
|
14247
|
+
return _extends({}, styles, {
|
|
14248
|
+
marginBottom: '0px',
|
|
14249
|
+
borderRadius: '6px 6px 0px 0px',
|
|
14250
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
14251
|
+
border: '1px solid #D0D5DD',
|
|
14252
|
+
borderBottom: '0px'
|
|
14253
|
+
});
|
|
14254
|
+
},
|
|
14255
|
+
dropdownIndicator: function dropdownIndicator(styles, state) {
|
|
14256
|
+
return _extends({}, styles, {
|
|
14257
|
+
transition: 'all 0.3s ease-in-out',
|
|
14258
|
+
transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'null'
|
|
14259
|
+
});
|
|
14260
|
+
}
|
|
14261
|
+
}),
|
|
14262
|
+
placeholder: "Select Category",
|
|
14263
|
+
menuPlacement: "top",
|
|
14264
|
+
value: escalationCategory,
|
|
14265
|
+
onChange: function onChange(selectedOption) {
|
|
14266
|
+
return setEscalationCategory(selectedOption);
|
|
14267
|
+
}
|
|
14268
|
+
}));
|
|
14269
|
+
}
|
|
14270
|
+
var Container$1e = /*#__PURE__*/styled.div(_templateObject$2i || (_templateObject$2i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n flex: 1;\n"])));
|
|
14271
|
+
|
|
14272
|
+
var _templateObject$2j;
|
|
14273
|
+
function EscalationLevel() {
|
|
14274
|
+
var _orderStaticData$esca;
|
|
14275
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
14276
|
+
orderStaticData = _useOrderStaticData[0];
|
|
14277
|
+
var _useEscalationCategor = useEscalationCategory(),
|
|
14278
|
+
escalationCategory = _useEscalationCategor[0];
|
|
14279
|
+
var _useEscalationLevel = useEscalationLevel(),
|
|
14280
|
+
escalationLevel = _useEscalationLevel[0],
|
|
14281
|
+
setEscalationLevel = _useEscalationLevel[1];
|
|
14282
|
+
var escalationLevelOptions = orderStaticData == null || (_orderStaticData$esca = orderStaticData.escalation_levels) == null ? void 0 : _orderStaticData$esca.map(function (escalation) {
|
|
14283
|
+
return {
|
|
14284
|
+
label: escalation == null ? void 0 : escalation.type,
|
|
14285
|
+
value: escalation == null ? void 0 : escalation.id
|
|
14286
|
+
};
|
|
14287
|
+
});
|
|
14288
|
+
var escalationTypes = orderStaticData == null ? void 0 : orderStaticData.escalation_types;
|
|
14289
|
+
useEffect(function () {
|
|
14290
|
+
var _escalationTypes$find;
|
|
14291
|
+
var selectedEscalationLevelId = escalationTypes == null || (_escalationTypes$find = escalationTypes.find(function (item) {
|
|
14292
|
+
return (item == null ? void 0 : item.escalation_category_id) === (escalationCategory == null ? void 0 : escalationCategory.value);
|
|
14293
|
+
})) == null ? void 0 : _escalationTypes$find.escalation_level_id;
|
|
14294
|
+
var defaultLevel = escalationLevelOptions == null ? void 0 : escalationLevelOptions.find(function (item) {
|
|
14295
|
+
return item.value === selectedEscalationLevelId;
|
|
14296
|
+
});
|
|
14297
|
+
setEscalationLevel(defaultLevel);
|
|
14298
|
+
}, [escalationCategory]);
|
|
14299
|
+
return React.createElement(Container$1f, null, React.createElement(Label$k, {
|
|
14300
|
+
label: "Escalation Level"
|
|
14301
|
+
}), React.createElement(SelectDropdown, {
|
|
14302
|
+
options: escalationLevelOptions || [],
|
|
14303
|
+
styles: _extends({}, dropdownStyles, {
|
|
14304
|
+
control: function control(styles, state) {
|
|
14305
|
+
return _extends({}, styles, {
|
|
14306
|
+
border: '1px solid #D0D5DD',
|
|
14307
|
+
cursor: 'pointer',
|
|
14308
|
+
borderRadius: "" + (state.selectProps.menuIsOpen ? '0px 0px 6px 6px' : '6px'),
|
|
14309
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
14310
|
+
minHeight: '40px',
|
|
14311
|
+
'&:hover': {
|
|
14312
|
+
borderColor: '#D0D5DD',
|
|
14313
|
+
boxShadow: '0px 3px 22px #00000014'
|
|
14314
|
+
}
|
|
14315
|
+
});
|
|
14316
|
+
},
|
|
14317
|
+
menu: function menu(styles) {
|
|
14318
|
+
return _extends({}, styles, {
|
|
14319
|
+
marginBottom: '0px',
|
|
14320
|
+
borderRadius: '6px 6px 0px 0px',
|
|
14321
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
14322
|
+
border: '1px solid #D0D5DD',
|
|
14323
|
+
borderBottom: '0px'
|
|
14324
|
+
});
|
|
14325
|
+
},
|
|
14326
|
+
dropdownIndicator: function dropdownIndicator(styles, state) {
|
|
14327
|
+
return _extends({}, styles, {
|
|
14328
|
+
transition: 'all 0.3s ease-in-out',
|
|
14329
|
+
transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'null'
|
|
14330
|
+
});
|
|
14331
|
+
}
|
|
14332
|
+
}),
|
|
14333
|
+
placeholder: "Select Level",
|
|
14334
|
+
menuPlacement: "top",
|
|
14335
|
+
value: escalationLevel,
|
|
14336
|
+
onChange: function onChange(selectedOption) {
|
|
14337
|
+
return setEscalationLevel(selectedOption);
|
|
14338
|
+
}
|
|
14339
|
+
}));
|
|
14340
|
+
}
|
|
14341
|
+
var Container$1f = /*#__PURE__*/styled.div(_templateObject$2j || (_templateObject$2j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n flex: 1;\n"])));
|
|
14342
|
+
|
|
14343
|
+
var _templateObject$2k;
|
|
14344
|
+
function EscalationReason() {
|
|
14345
|
+
var _escalationTypes$find, _orderStaticData$esca;
|
|
14346
|
+
var _useEscalationReason = useEscalationReason(),
|
|
14347
|
+
escalationReasonState = _useEscalationReason[0],
|
|
14348
|
+
setEscalationReasonState = _useEscalationReason[1];
|
|
14349
|
+
var _useOrderStaticData = useOrderStaticData(),
|
|
14350
|
+
orderStaticData = _useOrderStaticData[0];
|
|
14351
|
+
var _useEscalationCategor = useEscalationCategory(),
|
|
14352
|
+
escalationCategory = _useEscalationCategor[0];
|
|
14353
|
+
var _useFailureReason = useFailureReason(),
|
|
14354
|
+
failureReason = _useFailureReason[0];
|
|
14355
|
+
var _useIsFailureReasonCh = useIsFailureReasonChanged(),
|
|
14356
|
+
isFailureReasonChanged = _useIsFailureReasonCh[0],
|
|
14357
|
+
setIsFailureReasonChanged = _useIsFailureReasonCh[1];
|
|
14358
|
+
var escalationTypes = orderStaticData == null ? void 0 : orderStaticData.escalation_types;
|
|
14359
|
+
var escalationTypeId = escalationTypes == null || (_escalationTypes$find = escalationTypes.find(function (item) {
|
|
14360
|
+
return (item == null ? void 0 : item.escalation_category_id) === (escalationCategory == null ? void 0 : escalationCategory.value);
|
|
14361
|
+
})) == null ? void 0 : _escalationTypes$find.id;
|
|
14362
|
+
var escalationReasons = orderStaticData == null || (_orderStaticData$esca = orderStaticData.escalation_reasons) == null ? void 0 : _orderStaticData$esca.filter(function (x) {
|
|
14363
|
+
return (x == null ? void 0 : x.escalation_type_id) === escalationTypeId;
|
|
14364
|
+
});
|
|
14365
|
+
var escalationReasonsOptions = escalationReasons == null ? void 0 : escalationReasons.map(function (item) {
|
|
14366
|
+
var _orderStaticData$orde;
|
|
14367
|
+
var matchedItem = orderStaticData == null || (_orderStaticData$orde = orderStaticData.order_escalation_reasons) == null ? void 0 : _orderStaticData$orde.find(function (x) {
|
|
14368
|
+
return (x == null ? void 0 : x.id) === (item == null ? void 0 : item.order_reason_id);
|
|
14369
|
+
});
|
|
14370
|
+
if (matchedItem !== undefined) {
|
|
14371
|
+
return {
|
|
14372
|
+
label: matchedItem == null ? void 0 : matchedItem.reason,
|
|
14373
|
+
value: matchedItem == null ? void 0 : matchedItem.id
|
|
14374
|
+
};
|
|
14375
|
+
} else {
|
|
14376
|
+
return;
|
|
14377
|
+
}
|
|
14378
|
+
});
|
|
14379
|
+
var filteredEscReasonOptions = escalationReasonsOptions == null ? void 0 : escalationReasonsOptions.filter(function (option) {
|
|
14380
|
+
return option !== undefined;
|
|
14381
|
+
});
|
|
14382
|
+
useEffect(function () {
|
|
14383
|
+
if (isFailureReasonChanged && (filteredEscReasonOptions == null ? void 0 : filteredEscReasonOptions.length) > 0) {
|
|
14384
|
+
// ids of both esc reason options and failure reason not matched but their labels matched
|
|
14385
|
+
var reason = filteredEscReasonOptions == null ? void 0 : filteredEscReasonOptions.find(function (option) {
|
|
14386
|
+
return (option == null ? void 0 : option.label) === (failureReason == null ? void 0 : failureReason.label);
|
|
14387
|
+
});
|
|
14388
|
+
setEscalationReasonState(reason);
|
|
14389
|
+
setIsFailureReasonChanged(false);
|
|
14390
|
+
}
|
|
14391
|
+
if (!isFailureReasonChanged && (filteredEscReasonOptions == null ? void 0 : filteredEscReasonOptions.length) > 0) {
|
|
14392
|
+
setEscalationReasonState(filteredEscReasonOptions[0]);
|
|
14393
|
+
}
|
|
14394
|
+
}, [escalationCategory]);
|
|
14395
|
+
return React.createElement(Container$1g, null, React.createElement(Label$k, {
|
|
14396
|
+
label: "Escalation Reason"
|
|
14397
|
+
}), React.createElement(SelectDropdown, {
|
|
14398
|
+
options: filteredEscReasonOptions || [],
|
|
14399
|
+
styles: _extends({}, dropdownStyles, {
|
|
14400
|
+
control: function control(styles, state) {
|
|
14401
|
+
return _extends({}, styles, {
|
|
14402
|
+
border: '1px solid #D0D5DD',
|
|
14403
|
+
cursor: 'pointer',
|
|
14404
|
+
borderRadius: "" + (state.selectProps.menuIsOpen ? '0px 0px 6px 6px' : '6px'),
|
|
14405
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
14406
|
+
minHeight: '40px',
|
|
14407
|
+
'&:hover': {
|
|
14408
|
+
borderColor: '#D0D5DD',
|
|
14409
|
+
boxShadow: '0px 3px 22px #00000014'
|
|
14410
|
+
}
|
|
14411
|
+
});
|
|
14412
|
+
},
|
|
14413
|
+
menu: function menu(styles) {
|
|
14414
|
+
return _extends({}, styles, {
|
|
14415
|
+
marginBottom: '0px',
|
|
14416
|
+
borderRadius: '6px 6px 0px 0px',
|
|
14417
|
+
boxShadow: '0px 3px 22px #00000014',
|
|
14418
|
+
border: '1px solid #D0D5DD',
|
|
14419
|
+
borderBottom: '0px'
|
|
14420
|
+
});
|
|
14421
|
+
},
|
|
14422
|
+
dropdownIndicator: function dropdownIndicator(styles, state) {
|
|
14423
|
+
return _extends({}, styles, {
|
|
14424
|
+
transition: 'all 0.3s ease-in-out',
|
|
14425
|
+
transform: state.selectProps.menuIsOpen ? 'rotate(180deg)' : 'null'
|
|
14426
|
+
});
|
|
14427
|
+
}
|
|
14428
|
+
}),
|
|
14429
|
+
placeholder: "Select Reason",
|
|
14430
|
+
menuPlacement: "top",
|
|
14431
|
+
value: escalationReasonState,
|
|
14432
|
+
onChange: function onChange(selectedOption) {
|
|
14433
|
+
return setEscalationReasonState(selectedOption);
|
|
14434
|
+
}
|
|
14435
|
+
}));
|
|
14436
|
+
}
|
|
14437
|
+
var Container$1g = /*#__PURE__*/styled.div(_templateObject$2k || (_templateObject$2k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 8px;\n flex: 1;\n"])));
|
|
14438
|
+
|
|
14439
|
+
function Escalation() {
|
|
14440
|
+
return React.createElement("div", {
|
|
14441
|
+
style: {
|
|
14442
|
+
display: 'flex',
|
|
14443
|
+
gap: '15px',
|
|
14444
|
+
width: '100%'
|
|
14445
|
+
}
|
|
14446
|
+
}, React.createElement(EscalationCategory, null), React.createElement(EscalationLevel, null), React.createElement(EscalationReason, null));
|
|
14447
|
+
}
|
|
14448
|
+
|
|
14449
|
+
var _templateObject$2l, _templateObject2$1H, _templateObject3$11;
|
|
14450
|
+
function OrderTemplate() {
|
|
14451
|
+
var _orderDetails$order_r, _routesDetails$route_;
|
|
14452
|
+
var _useOrderDetails = useOrderDetails(),
|
|
14453
|
+
orderDetails = _useOrderDetails[0];
|
|
14454
|
+
var _useRouteDetails = useRouteDetails(),
|
|
14455
|
+
routesDetails = _useRouteDetails[0];
|
|
14456
|
+
var _useState = useState({
|
|
14457
|
+
isAllocated: true,
|
|
14458
|
+
isOrderStatusNote: true
|
|
14459
|
+
}),
|
|
14460
|
+
alertVisibility = _useState[0],
|
|
14461
|
+
setAlertVisibility = _useState[1];
|
|
14462
|
+
var isRouteId = (orderDetails == null || (_orderDetails$order_r = orderDetails.order_routes) == null ? void 0 : _orderDetails$order_r.route_id) != null;
|
|
14463
|
+
//on close alert functionality
|
|
14464
|
+
var onCloseAlert = function onCloseAlert(alertType) {
|
|
14465
|
+
setAlertVisibility(function (prev) {
|
|
14466
|
+
var _extends2;
|
|
14467
|
+
return _extends({}, prev, (_extends2 = {}, _extends2[alertType] = false, _extends2));
|
|
14468
|
+
});
|
|
14469
|
+
};
|
|
14470
|
+
return React.createElement(StyledAlert, null, React.createElement(React.Fragment, null, alertVisibility.isAllocated && React.createElement(React.Fragment, null, isRouteId ? React.createElement(FlagAlert, {
|
|
14471
|
+
type: "info",
|
|
14472
|
+
title: "",
|
|
14473
|
+
description: React.createElement(React.Fragment, null, React.createElement(Title$7, null, "Allocated To Route :"), (routesDetails == null ? void 0 : routesDetails.route_name) || '', routesDetails != null && routesDetails.route_lock ? "*Locked* on " + (routesDetails == null || (_routesDetails$route_ = routesDetails.route_detail) == null ? void 0 : _routesDetails$route_.vehicle_number) + " " : '', ' ', "| Crew:", (routesDetails == null ? void 0 : routesDetails.crew1) || 'N/A', " &", ' ', (routesDetails == null ? void 0 : routesDetails.crew2) || 'N/A', " |", ' ', routesDetails != null && routesDetails.route_date ? format(parseISO(routesDetails == null ? void 0 : routesDetails.route_date), 'dd/MM/yyyy') : ''),
|
|
14474
|
+
showOkButton: false,
|
|
14475
|
+
onClose: function onClose() {
|
|
14476
|
+
return onCloseAlert('isAllocated');
|
|
14477
|
+
}
|
|
14478
|
+
}) : React.createElement(FlagAlert, {
|
|
14479
|
+
type: "info",
|
|
14480
|
+
title: "",
|
|
14481
|
+
description: React.createElement(React.Fragment, null, React.createElement(Title$7, null, "Allocated To Route :"), ' ', React.createElement(Info, null, "Route not allocated")),
|
|
14482
|
+
showOkButton: false,
|
|
14483
|
+
onClose: function onClose() {
|
|
14484
|
+
return onCloseAlert('isAllocated');
|
|
14485
|
+
}
|
|
14486
|
+
}))), alertVisibility.isOrderStatusNote && React.createElement(React.Fragment, null, (orderDetails == null ? void 0 : orderDetails.order_status_note) && React.createElement(React.Fragment, null, React.createElement(FlagAlert, {
|
|
14487
|
+
type: "info",
|
|
14488
|
+
title: "",
|
|
14489
|
+
description: React.createElement(React.Fragment, null, React.createElement(Title$7, null, "Order Status Note : "), orderDetails == null ? void 0 : orderDetails.order_status_note),
|
|
14490
|
+
showOkButton: false,
|
|
14491
|
+
onClose: function onClose() {
|
|
14492
|
+
return onCloseAlert('isOrderStatusNote');
|
|
14493
|
+
}
|
|
14494
|
+
}))));
|
|
14495
|
+
}
|
|
14496
|
+
var StyledAlert = /*#__PURE__*/styled.div(_templateObject$2l || (_templateObject$2l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: contents;\n gap: 15px;\n"])));
|
|
14497
|
+
var Title$7 = /*#__PURE__*/styled.span(_templateObject2$1H || (_templateObject2$1H = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6396e5;\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n"])));
|
|
14498
|
+
var Info = /*#__PURE__*/styled.span(_templateObject3$11 || (_templateObject3$11 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6a7378;\n font-family: Lato;\n font-size: 13px;\n font-style: normal;\n font-weight: 600;\n"])));
|
|
14499
|
+
|
|
14500
|
+
var _templateObject$2m, _templateObject2$1I, _templateObject3$12;
|
|
14501
|
+
function FlagTemplate(_ref) {
|
|
14502
|
+
var data = _ref.data,
|
|
14503
|
+
dismissFlags = _ref.dismissFlags;
|
|
14504
|
+
var _useFlagRefId = useFlagRefId(),
|
|
14505
|
+
setSelectedFlag = _useFlagRefId[1];
|
|
14506
|
+
var _useCurrentAction = useCurrentAction(),
|
|
14507
|
+
setCurrentAction = _useCurrentAction[1];
|
|
14508
|
+
var openModal = function openModal() {
|
|
14509
|
+
setCurrentAction('view-flag');
|
|
14510
|
+
};
|
|
14511
|
+
var handleClick = function handleClick(Id) {
|
|
14512
|
+
setSelectedFlag(Id);
|
|
14513
|
+
openModal();
|
|
14514
|
+
};
|
|
14515
|
+
var titleColor = (data == null ? void 0 : data.status) === 'SD' ? '#36A053' : '#3a3630';
|
|
14516
|
+
return React.createElement(StyledAlert$1, null, React.createElement(FlagAlert, {
|
|
14517
|
+
type: (data == null ? void 0 : data.status) === 'AD' ? 'info' : 'success',
|
|
14518
|
+
title: React.createElement(React.Fragment, null, React.createElement(StyledTitle, {
|
|
14519
|
+
color: titleColor
|
|
14520
|
+
}, "Flag : ", data != null && data.is_private ? 'Private' : '', ' ', React.createElement(StyledLink$1, {
|
|
14521
|
+
onClick: function onClick() {
|
|
14522
|
+
return handleClick(data.id);
|
|
14523
|
+
}
|
|
14524
|
+
}, data == null ? void 0 : data.id, " - ", data == null ? void 0 : data.flag_type, ' '), ' ', (data == null ? void 0 : data.status) === 'AD' ? 'Unresolved' : 'Resolved on', ' ', (data == null ? void 0 : data.status) == 'SD' ? React.createElement(React.Fragment, null, formatDate$1(data == null ? void 0 : data.resolved_at), " by ", data == null ? void 0 : data.resolved_by, ' ') : null)),
|
|
14525
|
+
subtitle: "",
|
|
14526
|
+
description: "" + (data == null ? void 0 : data.description),
|
|
14527
|
+
showOkButton: false,
|
|
14528
|
+
onClose: function onClose() {
|
|
14529
|
+
return dismissFlags(data == null ? void 0 : data.id);
|
|
14530
|
+
}
|
|
14531
|
+
}));
|
|
14532
|
+
}
|
|
14533
|
+
var StyledAlert$1 = /*#__PURE__*/styled.div(_templateObject$2m || (_templateObject$2m = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 10px;\n"])));
|
|
14534
|
+
var StyledLink$1 = /*#__PURE__*/styled.span(_templateObject2$1I || (_templateObject2$1I = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--contextual-blue, #6396e5);\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n"])));
|
|
14535
|
+
var StyledTitle = /*#__PURE__*/styled.span(_templateObject3$12 || (_templateObject3$12 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: ", ";\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n"])), function (_ref2) {
|
|
14536
|
+
var color = _ref2.color;
|
|
14537
|
+
return color;
|
|
14538
|
+
});
|
|
14539
|
+
|
|
14540
|
+
var _templateObject$2n, _templateObject2$1J;
|
|
14541
|
+
function Tabs(_ref) {
|
|
14542
|
+
var dismissFlags = _ref.dismissFlags;
|
|
14543
|
+
var _useTasksData = useTasksData(),
|
|
14544
|
+
taskData = _useTasksData[0];
|
|
14545
|
+
return React.createElement(React.Fragment, null, React.createElement(Content, null, React.createElement(Container$1h, {
|
|
14546
|
+
className: "tab-content"
|
|
14547
|
+
}, React.createElement(OrderTemplate, null), taskData == null ? void 0 : taskData.map(function (item, index) {
|
|
14548
|
+
return React.createElement(FlagTemplate, {
|
|
14549
|
+
key: index,
|
|
14550
|
+
data: item,
|
|
14551
|
+
dismissFlags: dismissFlags
|
|
14552
|
+
});
|
|
14553
|
+
}))));
|
|
14554
|
+
}
|
|
14555
|
+
var Container$1h = /*#__PURE__*/styled.div(_templateObject$2n || (_templateObject$2n = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n gap: 15px;\n display: grid;\n"])));
|
|
14556
|
+
var Content = /*#__PURE__*/styled.div(_templateObject2$1J || (_templateObject2$1J = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n"])));
|
|
14557
|
+
|
|
14558
|
+
var _templateObject$2o, _templateObject2$1K, _templateObject3$13, _templateObject4$z, _templateObject5$q;
|
|
14559
|
+
function FDNotification() {
|
|
14560
|
+
var _orderData$order_rout;
|
|
14561
|
+
var _useTasksData = useTasksData(),
|
|
14562
|
+
taskData = _useTasksData[0],
|
|
14563
|
+
setTasksData = _useTasksData[1];
|
|
14564
|
+
var _useOrderDetails = useOrderDetails(),
|
|
14565
|
+
orderData = _useOrderDetails[0];
|
|
14566
|
+
var routeId = orderData == null || (_orderData$order_rout = orderData.order_routes) == null ? void 0 : _orderData$order_rout.route_id;
|
|
14567
|
+
var _useRouteDetails = useRouteDetails(),
|
|
14568
|
+
setRouteDetails = _useRouteDetails[1];
|
|
14569
|
+
//Unresolved API
|
|
14570
|
+
var _useAxios = useAxios({
|
|
14571
|
+
endpoint: "/v1/task/",
|
|
14572
|
+
method: 'GET',
|
|
14573
|
+
pagination: {
|
|
14574
|
+
is_pagination: false
|
|
14575
|
+
},
|
|
14576
|
+
filters: [{
|
|
14577
|
+
field: 'department',
|
|
14578
|
+
op: '=',
|
|
14579
|
+
value: 'debrief'
|
|
14580
|
+
}, {
|
|
14581
|
+
field: 'order_id',
|
|
14582
|
+
op: '=',
|
|
14583
|
+
value: "" + (orderData == null ? void 0 : orderData.id)
|
|
14584
|
+
}]
|
|
14585
|
+
}),
|
|
14586
|
+
fetchedUnresolvedData = _useAxios.data,
|
|
14587
|
+
unresolvedLoading = _useAxios.loading,
|
|
14588
|
+
callUnresolvedTaskApi = _useAxios.fetchData;
|
|
14589
|
+
//flags data set
|
|
14590
|
+
useEffect(function () {
|
|
14591
|
+
if (fetchedUnresolvedData && fetchedUnresolvedData != null && fetchedUnresolvedData.data) {
|
|
14592
|
+
setTasksData(fetchedUnresolvedData == null ? void 0 : fetchedUnresolvedData.data);
|
|
14593
|
+
}
|
|
14594
|
+
}, [unresolvedLoading, fetchedUnresolvedData]);
|
|
14595
|
+
useEffect(function () {
|
|
14596
|
+
var fetchData = /*#__PURE__*/function () {
|
|
14597
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
14598
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
14599
|
+
while (1) switch (_context.prev = _context.next) {
|
|
14600
|
+
case 0:
|
|
14601
|
+
if (!((orderData == null ? void 0 : orderData.id) == null)) {
|
|
14602
|
+
_context.next = 2;
|
|
14603
|
+
break;
|
|
14604
|
+
}
|
|
14605
|
+
return _context.abrupt("return");
|
|
14606
|
+
case 2:
|
|
14607
|
+
_context.prev = 2;
|
|
14608
|
+
_context.next = 5;
|
|
14609
|
+
return callUnresolvedTaskApi();
|
|
14610
|
+
case 5:
|
|
14611
|
+
_context.next = 10;
|
|
14612
|
+
break;
|
|
14613
|
+
case 7:
|
|
14614
|
+
_context.prev = 7;
|
|
14615
|
+
_context.t0 = _context["catch"](2);
|
|
14616
|
+
console.error('Error while fetching order-related data:', _context.t0);
|
|
14617
|
+
case 10:
|
|
14618
|
+
case "end":
|
|
14619
|
+
return _context.stop();
|
|
14620
|
+
}
|
|
14621
|
+
}, _callee, null, [[2, 7]]);
|
|
14622
|
+
}));
|
|
14623
|
+
return function fetchData() {
|
|
14624
|
+
return _ref.apply(this, arguments);
|
|
14625
|
+
};
|
|
14626
|
+
}();
|
|
14627
|
+
fetchData();
|
|
14628
|
+
}, [orderData == null ? void 0 : orderData.id]);
|
|
14629
|
+
var _useAxios2 = useAxios({
|
|
14630
|
+
endpoint: "/route/debrief/",
|
|
14631
|
+
method: 'GET'
|
|
14632
|
+
}),
|
|
14633
|
+
fetchRouteDetails = _useAxios2.fetchData,
|
|
14634
|
+
routesData = _useAxios2.data,
|
|
14635
|
+
routesDataLoading = _useAxios2.loading;
|
|
14636
|
+
useEffect(function () {
|
|
14637
|
+
if (routeId !== undefined && routeId !== null) {
|
|
14638
|
+
fetchRouteDetails({
|
|
14639
|
+
endPointQuery: routeId
|
|
14640
|
+
});
|
|
14641
|
+
} else {
|
|
14642
|
+
setRouteDetails([]);
|
|
14643
|
+
}
|
|
14644
|
+
}, [routeId]);
|
|
14645
|
+
useEffect(function () {
|
|
14646
|
+
var _routesData$data;
|
|
14647
|
+
if ((routesData == null || (_routesData$data = routesData.data) == null ? void 0 : _routesData$data.length) > 0) {
|
|
14648
|
+
var routeData = routesData == null ? void 0 : routesData.data[0];
|
|
14649
|
+
setRouteDetails(routeData);
|
|
14650
|
+
}
|
|
14651
|
+
}, [routesDataLoading]);
|
|
14652
|
+
return React.createElement(React.Fragment, null, React.createElement(Section$1, null, unresolvedLoading ? React.createElement(Loader, null, React.createElement(Spinner, null), React.createElement(Text$c, null, "Fetching Notifications...")) : (taskData == null ? void 0 : taskData.length) > 0 || orderData ? React.createElement(TabsWrapper, null, React.createElement(Tabs, null)) : 'No Notifications Found'));
|
|
14653
|
+
}
|
|
14654
|
+
var Loader = /*#__PURE__*/styled.div(_templateObject$2o || (_templateObject$2o = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: column;\n gap: 10px;\n"])));
|
|
14655
|
+
var Spinner = /*#__PURE__*/styled.div(_templateObject2$1K || (_templateObject2$1K = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 4px solid rgba(0, 0, 0, 0.1);\n border-left-color: #3a3630;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
|
|
14656
|
+
var Section$1 = /*#__PURE__*/styled.div(_templateObject3$13 || (_templateObject3$13 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 14px;\n background: #ffffff;\n border-radius: 12px;\n padding: 10px;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n border: 1px solid #e0e0e0;\n"])));
|
|
14657
|
+
var TabsWrapper = /*#__PURE__*/styled.div(_templateObject4$z || (_templateObject4$z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* min-height: 200px; */\n max-height: 350px;\n overflow-y: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &:hover {\n scrollbar-width: thin;\n }\n\n &::-webkit-scrollbar {\n width: 0;\n }\n\n &:hover::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.5);\n }\n"])));
|
|
14658
|
+
var Text$c = /*#__PURE__*/styled.div(_templateObject5$q || (_templateObject5$q = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--tonal-brown-651, #6a7378);\n font-family: Lato;\n font-size: 13px;\n font-style: normal;\n font-weight: 600;\n"])));
|
|
14659
|
+
|
|
14660
|
+
var _templateObject$2p, _templateObject2$1L, _templateObject3$14, _templateObject4$A, _templateObject5$r;
|
|
14661
|
+
var BaseChargeConfirmationModal = function BaseChargeConfirmationModal(props) {
|
|
14662
|
+
var baseUrlSymbol = getBaseUrlSymbol();
|
|
14663
|
+
var onCancel = function onCancel() {
|
|
14664
|
+
// window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
14665
|
+
props == null || props.setConfirmationModal(false);
|
|
14666
|
+
};
|
|
14667
|
+
var onComplete = function onComplete() {
|
|
14668
|
+
props == null || props.setConfirmationModal(false);
|
|
14669
|
+
props == null || props.onProceed();
|
|
14670
|
+
};
|
|
14671
|
+
return React.createElement(BackgroundModal$1, Object.assign({}, props), React.createElement(MainContainer$c, null, React.createElement(Container$1i, null, React.createElement(IconContainer$4, null, React.createElement(WarningIcon, null)), React.createElement(Title$8, null, "Base Charge Exceeds " + baseUrlSymbol + "200")), React.createElement(CustomCancelAndCompleteAction$5, {
|
|
14672
|
+
cancelLabel: "Amend",
|
|
14673
|
+
completeLabel: "Proceed",
|
|
14674
|
+
onCancel: onCancel,
|
|
14675
|
+
onComplete: onComplete
|
|
14676
|
+
})));
|
|
14677
|
+
};
|
|
14678
|
+
var CustomCancelAndCompleteAction$5 = /*#__PURE__*/styled(CancelAndCompleteAction)(_templateObject$2p || (_templateObject$2p = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n justify-content: center;\n"])));
|
|
14679
|
+
var Container$1i = /*#__PURE__*/styled.div(_templateObject2$1L || (_templateObject2$1L = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 20px;\n"])));
|
|
14680
|
+
var Title$8 = /*#__PURE__*/styled.span(_templateObject3$14 || (_templateObject3$14 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: 'Roboto', sans-serif;\n font-size: 20px;\n font-weight: 900;\n line-height: 32px;\n margin: 0;\n padding: 0;\n text-transform: uppercase;\n"])));
|
|
14681
|
+
var IconContainer$4 = /*#__PURE__*/styled.div(_templateObject4$A || (_templateObject4$A = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: 54px;\n height: 54px;\n padding: 14px;\n border-radius: 50%;\n background: #feba301a;\n border: 10px solid #feba305e;\n"])));
|
|
14682
|
+
var MainContainer$c = /*#__PURE__*/styled.div(_templateObject5$r || (_templateObject5$r = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 400px;\n min-height: 248px;\n padding: 24px;\n border-radius: 12px;\n background: #ffffff;\n box-shadow: 0px 20px 24px -4px #10182814;\n display: flex;\n flex-direction: column;\n gap: 30px;\n align-items: center;\n"])));
|
|
14683
|
+
|
|
14684
|
+
var _templateObject$2q, _templateObject2$1M, _templateObject3$15, _templateObject4$B, _templateObject5$s, _templateObject6$e, _templateObject7$f, _templateObject8$c;
|
|
14685
|
+
function ForceDebriefModal(props) {
|
|
14686
|
+
var _useCustomerInfo = useCustomerInfo(),
|
|
14687
|
+
customerInfo = _useCustomerInfo[0],
|
|
14688
|
+
setCustomerInfo = _useCustomerInfo[1];
|
|
14689
|
+
var _useOrderCustomersLis = useOrderCustomersList(),
|
|
14690
|
+
allCustomers = _useOrderCustomersLis[0],
|
|
14691
|
+
setAllCustomers = _useOrderCustomersLis[1];
|
|
14692
|
+
var infoText = (customerInfo == null ? void 0 : customerInfo.recipient_name) + ", " + (customerInfo == null ? void 0 : customerInfo.postcode);
|
|
14693
|
+
var _useCurrentAction = useCurrentAction(),
|
|
14694
|
+
setCurrentAction = _useCurrentAction[1];
|
|
14695
|
+
var _useActiveTab = useActiveTab(),
|
|
14696
|
+
activeTab = _useActiveTab[0],
|
|
14697
|
+
setActiveTab = _useActiveTab[1];
|
|
14698
|
+
var handleSwitchChange = function handleSwitchChange(newValue) {
|
|
14699
|
+
return setActiveTab(newValue);
|
|
14700
|
+
};
|
|
14701
|
+
var _useChargesState = useChargesState(),
|
|
14702
|
+
chargesState = _useChargesState[0],
|
|
14703
|
+
setCharges = _useChargesState[1];
|
|
14704
|
+
var _useState = useState({}),
|
|
14705
|
+
inputValue = _useState[0],
|
|
14706
|
+
setInputValue = _useState[1]; // only for UI purpose
|
|
14707
|
+
var _useState2 = useState([]),
|
|
14708
|
+
staticData = _useState2[0],
|
|
14709
|
+
setDebriefStaticData = _useState2[1];
|
|
14710
|
+
var _useOrderDetails = useOrderDetails(),
|
|
14711
|
+
orderDetails = _useOrderDetails[0],
|
|
14712
|
+
setOrderDetails = _useOrderDetails[1];
|
|
14713
|
+
var _usePrevOrderDetails = usePrevOrderDetails(),
|
|
14714
|
+
prevOrderDetails = _usePrevOrderDetails[0],
|
|
14715
|
+
setPrevOrderDetails = _usePrevOrderDetails[1];
|
|
14716
|
+
var _useState3 = useState(true),
|
|
14717
|
+
isEscalationEnabled = _useState3[0],
|
|
14718
|
+
setIsEscalationEnabled = _useState3[1];
|
|
14719
|
+
var _useNewStatus = useNewStatus(),
|
|
14720
|
+
newStatus = _useNewStatus[0],
|
|
14721
|
+
setNewStatus = _useNewStatus[1];
|
|
14722
|
+
var _useOrderCancelReason = useOrderCancelReason(),
|
|
14723
|
+
cancellationReason = _useOrderCancelReason[0],
|
|
14724
|
+
setCancellationReason = _useOrderCancelReason[1];
|
|
14725
|
+
var _useOrderHoldReason = useOrderHoldReason(),
|
|
14726
|
+
orderHold = _useOrderHoldReason[0],
|
|
14727
|
+
setOrderHold = _useOrderHoldReason[1];
|
|
14728
|
+
var _useFailureReason = useFailureReason(),
|
|
14729
|
+
failureReason = _useFailureReason[0],
|
|
14730
|
+
setFailureReason = _useFailureReason[1];
|
|
14731
|
+
var _useEscalationCategor = useEscalationCategory(),
|
|
14732
|
+
escalationCategory = _useEscalationCategor[0],
|
|
14733
|
+
setEscalationCategory = _useEscalationCategor[1];
|
|
14734
|
+
var _useEscalationLevel = useEscalationLevel(),
|
|
14735
|
+
escalationLevel = _useEscalationLevel[0],
|
|
14736
|
+
setEscalationLevel = _useEscalationLevel[1];
|
|
14737
|
+
var _useEscalationReason = useEscalationReason(),
|
|
14738
|
+
escalationReason = _useEscalationReason[0],
|
|
14739
|
+
setEscalationReason = _useEscalationReason[1];
|
|
14740
|
+
var _useGlobalStateHitOrd = useGlobalStateHitOrder(),
|
|
14741
|
+
setRecallOrders = _useGlobalStateHitOrd[1];
|
|
14742
|
+
var _useGlobalStateHitAud = useGlobalStateHitAuditLog(),
|
|
14743
|
+
setRecallAuditLog = _useGlobalStateHitAud[1];
|
|
14744
|
+
var _useGlobalEscData = useGlobalEscData(),
|
|
14745
|
+
setGlobalEscData = _useGlobalEscData[1];
|
|
14746
|
+
var _useState4 = useState(false),
|
|
14747
|
+
showAmountConfirmModal = _useState4[0],
|
|
14748
|
+
setShowAmountConfirmModal = _useState4[1];
|
|
14749
|
+
var _useProductDetails = useProductDetails(),
|
|
14750
|
+
productdata = _useProductDetails[0];
|
|
14751
|
+
var sortedProductData = productdata == null ? void 0 : productdata.sort(function (a, b) {
|
|
14752
|
+
return (a == null ? void 0 : a.status) === (b == null ? void 0 : b.status) ? 0 : a != null && a.status ? -1 : 1;
|
|
14753
|
+
});
|
|
14754
|
+
var isDeleted = Array.isArray(sortedProductData) ? sortedProductData == null ? void 0 : sortedProductData.filter(function (item) {
|
|
14755
|
+
return (item == null ? void 0 : item.status) === true;
|
|
14756
|
+
}) : [];
|
|
14757
|
+
//customers API
|
|
14758
|
+
var _useOrderDetails2 = useOrderDetails(),
|
|
14759
|
+
orderData = _useOrderDetails2[0];
|
|
14760
|
+
var customersData = orderData;
|
|
14761
|
+
var id = customersData == null ? void 0 : customersData.customer_id;
|
|
14762
|
+
//Customers list API call
|
|
14763
|
+
var _useAxios = useAxios({
|
|
14764
|
+
endpoint: "/v1/customer/list",
|
|
14765
|
+
method: 'GET',
|
|
14766
|
+
pagination: {
|
|
14767
|
+
is_pagination: false
|
|
14768
|
+
},
|
|
14769
|
+
filters: [{
|
|
14770
|
+
field: 'status',
|
|
14771
|
+
op: '=',
|
|
14772
|
+
value: '1'
|
|
14773
|
+
}]
|
|
14774
|
+
}),
|
|
14775
|
+
fetchCustomerData = _useAxios.data,
|
|
14776
|
+
customerLoading = _useAxios.loading,
|
|
14777
|
+
fetchData = _useAxios.fetchData;
|
|
14778
|
+
useEffect(function () {
|
|
14779
|
+
if (fetchCustomerData && fetchCustomerData != null && fetchCustomerData.data) {
|
|
14780
|
+
var res = fetchCustomerData == null ? void 0 : fetchCustomerData.data;
|
|
14781
|
+
setAllCustomers(res);
|
|
14782
|
+
}
|
|
14783
|
+
}, [fetchCustomerData, customerLoading]);
|
|
14784
|
+
useEffect(function () {
|
|
14785
|
+
fetchData();
|
|
14786
|
+
}, []);
|
|
14787
|
+
// For API Call
|
|
14788
|
+
var _useCustomerDetails = useCustomerDetails(),
|
|
14789
|
+
customerData = _useCustomerDetails[0],
|
|
14790
|
+
setCustomerData = _useCustomerDetails[1];
|
|
14791
|
+
var _useApiHook = useApiHook({
|
|
14792
|
+
endpoint: "customers/" + id,
|
|
14793
|
+
method: 'GET',
|
|
14794
|
+
performAction: false
|
|
14795
|
+
}),
|
|
14796
|
+
fetchedData = _useApiHook.data,
|
|
14797
|
+
loading = _useApiHook.loading,
|
|
14798
|
+
setShouldPerformAction = _useApiHook.setShouldPerformAction;
|
|
14799
|
+
useEffect(function () {
|
|
14800
|
+
if (id) {
|
|
14801
|
+
setShouldPerformAction(true);
|
|
14802
|
+
}
|
|
14803
|
+
}, [id]);
|
|
14804
|
+
useEffect(function () {
|
|
14805
|
+
if (fetchedData && fetchedData != null && fetchedData.data) {
|
|
14806
|
+
var requiredData = fetchedData == null ? void 0 : fetchedData.data;
|
|
14807
|
+
setCustomerData(requiredData);
|
|
14808
|
+
}
|
|
14809
|
+
}, [fetchedData, loading]);
|
|
14810
|
+
var selectedCustomer = allCustomers == null ? void 0 : allCustomers.find(function (customer) {
|
|
14811
|
+
return (customer == null ? void 0 : customer.id) === (customerData == null ? void 0 : customerData.id);
|
|
14812
|
+
});
|
|
14813
|
+
var adhocChargesFields = Array.from({
|
|
14814
|
+
length: 9
|
|
14815
|
+
}, function () {
|
|
14816
|
+
return {
|
|
14817
|
+
id: v4(),
|
|
14818
|
+
adhoc_charges_description: '',
|
|
14819
|
+
adhoc_charges: 0
|
|
14820
|
+
};
|
|
14821
|
+
});
|
|
14822
|
+
var _useAxios2 = useAxios({
|
|
14823
|
+
endpoint: "/finance/debrief/getData/all/",
|
|
14824
|
+
method: 'GET'
|
|
14825
|
+
}),
|
|
14826
|
+
fetchAllDebriefStaticData = _useAxios2.fetchData,
|
|
14827
|
+
debriefStaticData = _useAxios2.data,
|
|
14828
|
+
debriefLoading = _useAxios2.loading;
|
|
14829
|
+
useEffect(function () {
|
|
14830
|
+
setCharges(function (prev) {
|
|
14831
|
+
return _extends({}, prev, {
|
|
14832
|
+
adhoc_charges: adhocChargesFields
|
|
14833
|
+
});
|
|
14834
|
+
});
|
|
14835
|
+
// call debrief static api for getting base charges type
|
|
14836
|
+
fetchAllDebriefStaticData();
|
|
14837
|
+
}, []);
|
|
14838
|
+
useEffect(function () {
|
|
14839
|
+
if (debriefStaticData != null && debriefStaticData.data) {
|
|
14840
|
+
setDebriefStaticData(debriefStaticData == null ? void 0 : debriefStaticData.data[0]);
|
|
14841
|
+
}
|
|
14842
|
+
}, [debriefLoading]);
|
|
14843
|
+
var _useAxios3 = useAxios({
|
|
14844
|
+
endpoint: "/orders/update/",
|
|
14845
|
+
method: 'PUT'
|
|
14846
|
+
}),
|
|
14847
|
+
callUpdateOrderAPI = _useAxios3.fetchData;
|
|
14848
|
+
var _useAxios4 = useAxios({
|
|
14849
|
+
endpoint: "/invoices/force-debrief/",
|
|
14850
|
+
method: 'POST'
|
|
14851
|
+
}),
|
|
14852
|
+
callForceDebriefApi = _useAxios4.fetchData;
|
|
14853
|
+
var _useAxios5 = useAxios({
|
|
14854
|
+
endpoint: "/orders/escalations/create/",
|
|
14855
|
+
method: 'POST'
|
|
14856
|
+
}),
|
|
14857
|
+
createEscalation = _useAxios5.fetchData;
|
|
14858
|
+
var initialValues = function initialValues() {
|
|
14859
|
+
setOrderDetails(prevOrderDetails);
|
|
14860
|
+
setNewStatus('');
|
|
14861
|
+
setCancellationReason('');
|
|
14862
|
+
setOrderHold('');
|
|
14863
|
+
setFailureReason('');
|
|
14864
|
+
setEscalationCategory('');
|
|
14865
|
+
setEscalationLevel('');
|
|
14866
|
+
setEscalationReason('');
|
|
14867
|
+
setActiveTab('success');
|
|
14868
|
+
};
|
|
14869
|
+
var closeModal = function closeModal() {
|
|
14870
|
+
initialValues();
|
|
14871
|
+
setCurrentAction(undefined);
|
|
14872
|
+
};
|
|
14873
|
+
var isDifferent = function isDifferent() {
|
|
14874
|
+
var _orderDetails$order_s, _orderDetails$order_s2, _prevOrderDetails$ord;
|
|
14875
|
+
var keysToRemovefromOrders = ['order_locked', 'order_communications', 'updated_at', 'updated_by', 'order_services'];
|
|
14876
|
+
var filteredOrderDetails = filterObject(orderDetails, keysToRemovefromOrders);
|
|
14877
|
+
var filteredPrevOrderDetails = filterObject(prevOrderDetails, keysToRemovefromOrders);
|
|
14878
|
+
var newOrderServices = (orderDetails == null || (_orderDetails$order_s = orderDetails.order_services) == null ? void 0 : _orderDetails$order_s.length) > 0 && (orderDetails == null || (_orderDetails$order_s2 = orderDetails.order_services) == null ? void 0 : _orderDetails$order_s2.sort(function (a, b) {
|
|
14879
|
+
return a.id - b.id;
|
|
14880
|
+
}));
|
|
14881
|
+
var prevOrderServices = (prevOrderDetails == null || (_prevOrderDetails$ord = prevOrderDetails.order_services) == null ? void 0 : _prevOrderDetails$ord.length) > 0 && (prevOrderDetails == null ? void 0 : prevOrderDetails.order_services.sort(function (a, b) {
|
|
14882
|
+
return a.id - b.id;
|
|
14883
|
+
}));
|
|
14884
|
+
var newOrderServicesSorted = JSON.stringify(newOrderServices);
|
|
14885
|
+
var prevOrderServicesSorted = JSON.stringify(prevOrderServices);
|
|
14886
|
+
var orderDetailsSorted = JSON.stringify(filteredOrderDetails);
|
|
14887
|
+
var prevOrderDetailsSorted = JSON.stringify(filteredPrevOrderDetails);
|
|
14888
|
+
var isSame = orderDetailsSorted === prevOrderDetailsSorted && newOrderServicesSorted === prevOrderServicesSorted;
|
|
14889
|
+
return !isSame;
|
|
14890
|
+
};
|
|
14891
|
+
var debriefchargesApi = /*#__PURE__*/function () {
|
|
14892
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(finalPayload, failurePayload) {
|
|
14893
|
+
var responseForceDebrief;
|
|
14894
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
14895
|
+
while (1) switch (_context.prev = _context.next) {
|
|
14896
|
+
case 0:
|
|
14897
|
+
_context.prev = 0;
|
|
14898
|
+
_context.next = 3;
|
|
14899
|
+
return callForceDebriefApi({
|
|
14900
|
+
payload: _extends({
|
|
14901
|
+
debrief_data: finalPayload
|
|
14902
|
+
}, activeTab === 'failure' ? {
|
|
14903
|
+
failure_data: failurePayload
|
|
14904
|
+
} : {
|
|
14905
|
+
failure_data: {}
|
|
14906
|
+
})
|
|
14907
|
+
});
|
|
14908
|
+
case 3:
|
|
14909
|
+
responseForceDebrief = _context.sent;
|
|
14910
|
+
if (responseForceDebrief.code === 200) {
|
|
14911
|
+
notification.success({
|
|
14912
|
+
message: 'Success',
|
|
14913
|
+
description: "" + (responseForceDebrief == null ? void 0 : responseForceDebrief.message)
|
|
14914
|
+
});
|
|
14915
|
+
}
|
|
14916
|
+
_context.next = 9;
|
|
14917
|
+
break;
|
|
14918
|
+
case 7:
|
|
14919
|
+
_context.prev = 7;
|
|
14920
|
+
_context.t0 = _context["catch"](0);
|
|
14921
|
+
case 9:
|
|
14922
|
+
case "end":
|
|
14923
|
+
return _context.stop();
|
|
14924
|
+
}
|
|
14925
|
+
}, _callee, null, [[0, 7]]);
|
|
14926
|
+
}));
|
|
14927
|
+
return function debriefchargesApi(_x, _x2) {
|
|
14928
|
+
return _ref.apply(this, arguments);
|
|
14929
|
+
};
|
|
14930
|
+
}();
|
|
14931
|
+
var ordersUpdateApi = /*#__PURE__*/function () {
|
|
14932
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
14933
|
+
var ordersApiPayload, _response$data, response, _response$data$, _response$data$2;
|
|
14934
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
14935
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
14936
|
+
case 0:
|
|
14937
|
+
ordersApiPayload = compareOrderDetailsStates(prevOrderDetails, orderDetails);
|
|
14938
|
+
_context2.prev = 1;
|
|
14939
|
+
_context2.next = 4;
|
|
14940
|
+
return callUpdateOrderAPI({
|
|
14941
|
+
payload: [ordersApiPayload]
|
|
14942
|
+
});
|
|
14943
|
+
case 4:
|
|
14944
|
+
response = _context2.sent;
|
|
14945
|
+
if (!(response.code === 200 && (response == null || (_response$data = response.data) == null ? void 0 : _response$data.length) > 0)) {
|
|
14946
|
+
_context2.next = 12;
|
|
14947
|
+
break;
|
|
14948
|
+
}
|
|
14949
|
+
notification.success({
|
|
14950
|
+
message: 'Success',
|
|
14951
|
+
description: "" + (response == null ? void 0 : response.message)
|
|
14952
|
+
});
|
|
14953
|
+
setOrderDetails(response == null ? void 0 : response.data[0]);
|
|
14954
|
+
setPrevOrderDetails(response == null ? void 0 : response.data[0]);
|
|
14955
|
+
setCustomerInfo({
|
|
14956
|
+
recipient_name: response == null || (_response$data$ = response.data[0]) == null || (_response$data$ = _response$data$.order_recipient) == null ? void 0 : _response$data$.recipient_name,
|
|
14957
|
+
postcode: response == null || (_response$data$2 = response.data[0]) == null || (_response$data$2 = _response$data$2.order_recipient) == null ? void 0 : _response$data$2.postcode
|
|
14958
|
+
});
|
|
14959
|
+
_context2.next = 12;
|
|
14960
|
+
return setRecallOrders(true);
|
|
14961
|
+
case 12:
|
|
14962
|
+
_context2.next = 17;
|
|
14963
|
+
break;
|
|
14964
|
+
case 14:
|
|
14965
|
+
_context2.prev = 14;
|
|
14966
|
+
_context2.t0 = _context2["catch"](1);
|
|
14967
|
+
setOrderDetails(prevOrderDetails);
|
|
14968
|
+
case 17:
|
|
14969
|
+
case "end":
|
|
14970
|
+
return _context2.stop();
|
|
14971
|
+
}
|
|
14972
|
+
}, _callee2, null, [[1, 14]]);
|
|
14973
|
+
}));
|
|
14974
|
+
return function ordersUpdateApi() {
|
|
14975
|
+
return _ref2.apply(this, arguments);
|
|
14976
|
+
};
|
|
14977
|
+
}();
|
|
14978
|
+
var escalationCreateApi = /*#__PURE__*/function () {
|
|
14979
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(escalationPayload) {
|
|
14980
|
+
var apiResponse;
|
|
14981
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
14982
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
14983
|
+
case 0:
|
|
14984
|
+
_context3.prev = 0;
|
|
14985
|
+
_context3.next = 3;
|
|
14986
|
+
return createEscalation({
|
|
14987
|
+
payload: escalationPayload
|
|
14988
|
+
});
|
|
14989
|
+
case 3:
|
|
14990
|
+
apiResponse = _context3.sent;
|
|
14991
|
+
if ((apiResponse == null ? void 0 : apiResponse.code) === 200) {
|
|
14992
|
+
notification.success({
|
|
14993
|
+
message: 'Success',
|
|
14994
|
+
description: "" + (apiResponse == null ? void 0 : apiResponse.message)
|
|
14995
|
+
});
|
|
14996
|
+
setGlobalEscData(apiResponse == null ? void 0 : apiResponse.data);
|
|
14997
|
+
}
|
|
14998
|
+
_context3.next = 9;
|
|
14999
|
+
break;
|
|
15000
|
+
case 7:
|
|
15001
|
+
_context3.prev = 7;
|
|
15002
|
+
_context3.t0 = _context3["catch"](0);
|
|
15003
|
+
case 9:
|
|
15004
|
+
case "end":
|
|
15005
|
+
return _context3.stop();
|
|
15006
|
+
}
|
|
15007
|
+
}, _callee3, null, [[0, 7]]);
|
|
15008
|
+
}));
|
|
15009
|
+
return function escalationCreateApi(_x3) {
|
|
15010
|
+
return _ref3.apply(this, arguments);
|
|
15011
|
+
};
|
|
15012
|
+
}();
|
|
15013
|
+
var onSubmit = /*#__PURE__*/function () {
|
|
15014
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
15015
|
+
var _orderDetails$order_r, _orderDetails$order_t, _orderDetails$order_r2, _chargesState$adhoc_c;
|
|
15016
|
+
var ordersPayload, adhocCharges, chargesPayload, failurePayload, finalPayload, _orderDetails$order_r3, escalationPayload;
|
|
15017
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
15018
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
15019
|
+
case 0:
|
|
15020
|
+
setRecallOrders(false);
|
|
15021
|
+
ordersPayload = _extends({
|
|
15022
|
+
consignment: orderDetails == null ? void 0 : orderDetails.consignment,
|
|
15023
|
+
order_number: orderDetails == null ? void 0 : orderDetails.order_number,
|
|
15024
|
+
customer_id: customerData == null ? void 0 : customerData.id,
|
|
15025
|
+
customer_name: customerData == null ? void 0 : customerData.customer_name,
|
|
15026
|
+
client_name: selectedCustomer == null ? void 0 : selectedCustomer.client_name,
|
|
15027
|
+
recipient_name: orderDetails == null || (_orderDetails$order_r = orderDetails.order_recipient) == null ? void 0 : _orderDetails$order_r.recipient_name,
|
|
15028
|
+
order_id: orderDetails == null ? void 0 : orderDetails.id,
|
|
15029
|
+
order_type: orderDetails == null || (_orderDetails$order_t = orderDetails.order_type) == null ? void 0 : _orderDetails$order_t.type,
|
|
15030
|
+
legacy_order_id: orderDetails == null ? void 0 : orderDetails.gsit_order_id,
|
|
15031
|
+
postcode: orderDetails == null || (_orderDetails$order_r2 = orderDetails.order_recipient) == null ? void 0 : _orderDetails$order_r2.postcode
|
|
15032
|
+
}, activeTab === 'failure' && {
|
|
15033
|
+
failure_new_status: newStatus
|
|
15034
|
+
});
|
|
15035
|
+
adhocCharges = chargesState == null || (_chargesState$adhoc_c = chargesState.adhoc_charges) == null ? void 0 : _chargesState$adhoc_c.filter(function (item) {
|
|
15036
|
+
return !(item.adhoc_charges === 0 && item.adhoc_charges_description === '');
|
|
15037
|
+
}).map(function (_ref5) {
|
|
15038
|
+
var adhoc_charges_description = _ref5.adhoc_charges_description,
|
|
15039
|
+
adhoc_charges = _ref5.adhoc_charges;
|
|
15040
|
+
return {
|
|
15041
|
+
adhoc_charges_description: adhoc_charges_description,
|
|
15042
|
+
adhoc_charges: adhoc_charges
|
|
15043
|
+
};
|
|
15044
|
+
});
|
|
15045
|
+
chargesPayload = _extends({}, chargesState);
|
|
15046
|
+
chargesPayload.adhoc_charges = adhocCharges;
|
|
15047
|
+
chargesPayload.debrief_status = activeTab;
|
|
15048
|
+
if (activeTab === 'success') {
|
|
15049
|
+
delete chargesPayload.new_order_status;
|
|
15050
|
+
}
|
|
15051
|
+
failurePayload = _extends({
|
|
15052
|
+
failure_reason_id: failureReason == null ? void 0 : failureReason.id
|
|
15053
|
+
}, newStatus === 'Cancelled' && {
|
|
15054
|
+
cancelled_reason_id: cancellationReason == null ? void 0 : cancellationReason.value
|
|
15055
|
+
}, newStatus === 'On Hold' && {
|
|
15056
|
+
hold_reason_id: orderHold == null ? void 0 : orderHold.value
|
|
15057
|
+
}, {
|
|
15058
|
+
failure_order_status: newStatus,
|
|
15059
|
+
status: activeTab
|
|
15060
|
+
});
|
|
15061
|
+
finalPayload = _extends({}, ordersPayload, {
|
|
15062
|
+
status: activeTab,
|
|
15063
|
+
charges: [chargesPayload]
|
|
15064
|
+
}, activeTab === 'failure' && {
|
|
15065
|
+
failureData: failurePayload
|
|
15066
|
+
}); // check adhoc charges if 0 and description is empty then
|
|
15067
|
+
// APPLY ALL VALIDATIONS HERE BEFORE CALLING ANY API
|
|
15068
|
+
if (!(activeTab === 'failure')) {
|
|
15069
|
+
_context4.next = 22;
|
|
15070
|
+
break;
|
|
15071
|
+
}
|
|
15072
|
+
if (failureReason != null && failureReason.id) {
|
|
15073
|
+
_context4.next = 13;
|
|
15074
|
+
break;
|
|
15075
|
+
}
|
|
15076
|
+
notification.error({
|
|
15077
|
+
message: 'Error',
|
|
15078
|
+
description: 'Failure reason is mandatory'
|
|
15079
|
+
});
|
|
15080
|
+
return _context4.abrupt("return");
|
|
15081
|
+
case 13:
|
|
15082
|
+
if (!((newStatus == null ? void 0 : newStatus.length) === 0)) {
|
|
15083
|
+
_context4.next = 16;
|
|
15084
|
+
break;
|
|
15085
|
+
}
|
|
15086
|
+
notification.error({
|
|
15087
|
+
message: 'Error',
|
|
15088
|
+
description: 'New status is mandatory'
|
|
15089
|
+
});
|
|
15090
|
+
return _context4.abrupt("return");
|
|
15091
|
+
case 16:
|
|
15092
|
+
if (!(newStatus === 'On Hold' && (orderHold == null ? void 0 : orderHold.length) === 0)) {
|
|
15093
|
+
_context4.next = 19;
|
|
15094
|
+
break;
|
|
15095
|
+
}
|
|
15096
|
+
notification.error({
|
|
15097
|
+
message: 'Error',
|
|
15098
|
+
description: 'Hold reason is mandatory'
|
|
15099
|
+
});
|
|
15100
|
+
return _context4.abrupt("return");
|
|
15101
|
+
case 19:
|
|
15102
|
+
if (!(newStatus === 'Cancelled' && (cancellationReason == null ? void 0 : cancellationReason.length) === 0)) {
|
|
15103
|
+
_context4.next = 22;
|
|
15104
|
+
break;
|
|
15105
|
+
}
|
|
15106
|
+
notification.error({
|
|
15107
|
+
message: 'Error',
|
|
15108
|
+
description: 'Cancel reason is mandatory'
|
|
15109
|
+
});
|
|
15110
|
+
return _context4.abrupt("return");
|
|
15111
|
+
case 22:
|
|
15112
|
+
if (!isDifferent()) {
|
|
15113
|
+
_context4.next = 25;
|
|
15114
|
+
break;
|
|
15115
|
+
}
|
|
15116
|
+
_context4.next = 25;
|
|
15117
|
+
return ordersUpdateApi();
|
|
15118
|
+
case 25:
|
|
15119
|
+
if (!(activeTab === 'failure' && isEscalationEnabled)) {
|
|
15120
|
+
_context4.next = 29;
|
|
15121
|
+
break;
|
|
15122
|
+
}
|
|
15123
|
+
escalationPayload = [{
|
|
15124
|
+
order_id: orderDetails == null ? void 0 : orderDetails.id,
|
|
15125
|
+
escalation_reason_id: escalationReason == null ? void 0 : escalationReason.value,
|
|
15126
|
+
escalation_category_id: escalationCategory == null ? void 0 : escalationCategory.value,
|
|
15127
|
+
escalation_level_id: escalationLevel == null ? void 0 : escalationLevel.value,
|
|
15128
|
+
is_deleted: false,
|
|
15129
|
+
route_id: orderDetails == null || (_orderDetails$order_r3 = orderDetails.order_routes) == null ? void 0 : _orderDetails$order_r3.route_id
|
|
15130
|
+
}];
|
|
15131
|
+
_context4.next = 29;
|
|
15132
|
+
return escalationCreateApi(escalationPayload);
|
|
15133
|
+
case 29:
|
|
15134
|
+
_context4.next = 31;
|
|
15135
|
+
return debriefchargesApi(finalPayload, failurePayload);
|
|
15136
|
+
case 31:
|
|
15137
|
+
_context4.next = 33;
|
|
15138
|
+
return setRecallAuditLog(true);
|
|
15139
|
+
case 33:
|
|
15140
|
+
// call status api and alerts api
|
|
15141
|
+
initialValues();
|
|
15142
|
+
_context4.next = 36;
|
|
15143
|
+
return props == null ? void 0 : props.callOrderStatusApi();
|
|
15144
|
+
case 36:
|
|
15145
|
+
_context4.next = 38;
|
|
15146
|
+
return props == null ? void 0 : props.callOrderAlertsApi();
|
|
15147
|
+
case 38:
|
|
15148
|
+
_context4.next = 40;
|
|
15149
|
+
return props == null ? void 0 : props.callOrdersApi();
|
|
15150
|
+
case 40:
|
|
15151
|
+
case "end":
|
|
15152
|
+
return _context4.stop();
|
|
15153
|
+
}
|
|
15154
|
+
}, _callee4);
|
|
15155
|
+
}));
|
|
15156
|
+
return function onSubmit() {
|
|
15157
|
+
return _ref4.apply(this, arguments);
|
|
15158
|
+
};
|
|
15159
|
+
}();
|
|
15160
|
+
var onForceDebrief = function onForceDebrief() {
|
|
15161
|
+
if ((chargesState == null ? void 0 : chargesState.base_charge) > 200) {
|
|
15162
|
+
setShowAmountConfirmModal(true);
|
|
15163
|
+
} else {
|
|
15164
|
+
onSubmit();
|
|
15165
|
+
}
|
|
15166
|
+
};
|
|
15167
|
+
return React.createElement(OrderActionModal, {
|
|
15168
|
+
headerTitle: "Order Debrief",
|
|
15169
|
+
onCloseHeader: closeModal,
|
|
15170
|
+
infoText: infoText,
|
|
15171
|
+
onSubmit: onForceDebrief,
|
|
15172
|
+
submitBtnTitle: 'Complete Order',
|
|
15173
|
+
// isSubmitDisabled={true}
|
|
15174
|
+
maxWidth: "95vw",
|
|
15175
|
+
headerActions: React.createElement(ForceDebriefSelector, {
|
|
15176
|
+
onSwitchChange: handleSwitchChange
|
|
15177
|
+
})
|
|
15178
|
+
}, React.createElement(MainContainer$d, null, React.createElement(FDNotification, null), React.createElement(ContentContainer$7, null, React.createElement(OrderInfo$1, null)), React.createElement(ContentContainer$7, null, React.createElement(Container$1j, null, React.createElement(Label$k, {
|
|
15179
|
+
label: "Delivery Instructions",
|
|
15180
|
+
htmlFor: "deliveryInstruction"
|
|
15181
|
+
}), React.createElement(Text$d, null, (orderDetails == null ? void 0 : orderDetails.delivery_instructions) || 'N/A')), React.createElement(Container$1j, null, React.createElement(Label$k, {
|
|
15182
|
+
label: "Other Instructions",
|
|
15183
|
+
htmlFor: "otherInstruction"
|
|
15184
|
+
}), React.createElement(Text$d, null, (orderDetails == null ? void 0 : orderDetails.other_instructions) || 'N/A'))), (isDeleted == null ? void 0 : isDeleted.length) > 0 && React.createElement(ProductDiv, null, React.createElement(Container$1j, null, isDeleted == null ? void 0 : isDeleted.map(function (item, index) {
|
|
15185
|
+
var _item$order_product_t;
|
|
15186
|
+
return React.createElement(ProductContainer, {
|
|
15187
|
+
key: index
|
|
15188
|
+
}, React.createElement(Status$1, null, '*'), React.createElement(Status$1, null, (item == null ? void 0 : item.status_value) || 'N/A'), React.createElement(Status$1, null, (item == null || (_item$order_product_t = item.order_product_type) == null ? void 0 : _item$order_product_t.type) || 'N/A'), React.createElement(Status$1, null, (item == null ? void 0 : item.sku) || 'N/A'), React.createElement(Status$1, null, "Part 1 of 1"), React.createElement(Status$1, null, 'Weight' + ':' + (item == null ? void 0 : item.weight) || 'N/A'), React.createElement(Status$1, null, 'Cube' + ':' + (item == null ? void 0 : item.cube) || 'N/A'));
|
|
15189
|
+
}))), React.createElement(ContentContainer$7, null, React.createElement(ContainerInner, null, React.createElement(BaseCharges, {
|
|
15190
|
+
inputValue: inputValue,
|
|
15191
|
+
setInputValue: setInputValue,
|
|
15192
|
+
staticData: staticData
|
|
15193
|
+
}), React.createElement(DeliveryAddOns, {
|
|
15194
|
+
inputValue: inputValue,
|
|
15195
|
+
setInputValue: setInputValue
|
|
15196
|
+
})), React.createElement(ContainerInner, null, React.createElement(CollectionAddOns, {
|
|
15197
|
+
inputValue: inputValue,
|
|
15198
|
+
setInputValue: setInputValue
|
|
15199
|
+
}), React.createElement(DisposalCharge, {
|
|
15200
|
+
inputValue: inputValue,
|
|
15201
|
+
setInputValue: setInputValue
|
|
15202
|
+
})), React.createElement(OrderCharges, {
|
|
15203
|
+
inputValue: inputValue,
|
|
15204
|
+
setInputValue: setInputValue
|
|
15205
|
+
}), React.createElement(AdhocSection, null)), activeTab === 'failure' && React.createElement(ContentContainer$7, {
|
|
15206
|
+
style: {
|
|
15207
|
+
flexDirection: 'column',
|
|
15208
|
+
gap: '10px'
|
|
15209
|
+
}
|
|
15210
|
+
}, React.createElement("div", {
|
|
15211
|
+
style: {
|
|
15212
|
+
display: 'flex',
|
|
15213
|
+
gap: '10px'
|
|
15214
|
+
}
|
|
15215
|
+
}, "Escalation", React.createElement(Checkbox$1, {
|
|
15216
|
+
checked: isEscalationEnabled,
|
|
15217
|
+
onChange: function onChange(event) {
|
|
15218
|
+
return setIsEscalationEnabled(event.target.checked);
|
|
15219
|
+
}
|
|
15220
|
+
})), React.createElement(Escalation, null))), showAmountConfirmModal && React.createElement(BaseChargeConfirmationModal, {
|
|
15221
|
+
setConfirmationModal: setShowAmountConfirmModal,
|
|
15222
|
+
onProceed: onSubmit
|
|
15223
|
+
}));
|
|
15224
|
+
}
|
|
15225
|
+
var Status$1 = /*#__PURE__*/styled.span(_templateObject$2q || (_templateObject$2q = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: 'Roboto', sans-serif;\n font-size: 14px;\n font-weight: 400;\n text-transform: capitalize;\n color: #3a3630;\n"])));
|
|
15226
|
+
var ProductContainer = /*#__PURE__*/styled.div(_templateObject2$1M || (_templateObject2$1M = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-wrap: wrap;\n gap: 16px;\n"])));
|
|
15227
|
+
var MainContainer$d = /*#__PURE__*/styled.div(_templateObject3$15 || (_templateObject3$15 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 10px;\n display: flex;\n flex-direction: column;\n gap: 10px;\n"])));
|
|
15228
|
+
var ContainerInner = /*#__PURE__*/styled.div(_templateObject4$B || (_templateObject4$B = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 16px;\n"])));
|
|
15229
|
+
var Container$1j = /*#__PURE__*/styled.div(_templateObject5$s || (_templateObject5$s = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n"])));
|
|
15230
|
+
var Text$d = /*#__PURE__*/styled.div(_templateObject6$e || (_templateObject6$e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #363a30;\n font-size: 14px;\n white-space: break-spaces;\n"])));
|
|
15231
|
+
var ContentContainer$7 = /*#__PURE__*/styled.div(_templateObject7$f || (_templateObject7$f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 12px;\n flex-direction: row;\n align-items: flex-start;\n gap: 40px;\n flex: 1 0 0;\n border-radius: 15px;\n background: #f8fafc;\n width: 100%;\n white-space: nowrap;\n"])));
|
|
15232
|
+
var ProductDiv = /*#__PURE__*/styled.div(_templateObject8$c || (_templateObject8$c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 12px;\n flex-direction: row;\n align-items: flex-start;\n gap: 40px;\n flex: 1 0 0;\n border-radius: 15px;\n background: #f8fafc;\n width: 100%;\n white-space: nowrap;\n min-height: 60px;\n overflow: scroll;\n max-height: 150px;\n"])));
|
|
15233
|
+
var ForceDebriefModal$1 = /*#__PURE__*/React.memo(ForceDebriefModal);
|
|
15234
|
+
|
|
15235
|
+
var _templateObject$2r;
|
|
15236
|
+
function OrderActions() {
|
|
15237
|
+
var _useCurrentAction = useCurrentAction(),
|
|
15238
|
+
currentAction = _useCurrentAction[0],
|
|
15239
|
+
setCurrentAction = _useCurrentAction[1];
|
|
15240
|
+
var _useOrderId = useOrderId(),
|
|
15241
|
+
orderId = _useOrderId[0];
|
|
15242
|
+
var _useOrderDetails = useOrderDetails(),
|
|
15243
|
+
setOrderDetails = _useOrderDetails[1];
|
|
15244
|
+
var _usePrevOrderDetails = usePrevOrderDetails(),
|
|
15245
|
+
setPrevOrderDetails = _usePrevOrderDetails[1];
|
|
15246
|
+
var _useStatusDetails = useStatusDetails(),
|
|
15247
|
+
setOrderStatus = _useStatusDetails[1];
|
|
15248
|
+
var _useOrderAlertsData = useOrderAlertsData(),
|
|
15249
|
+
setOrderAlertsData = _useOrderAlertsData[1];
|
|
15250
|
+
var _useProductDetails = useProductDetails(),
|
|
15251
|
+
setProductDetails = _useProductDetails[1];
|
|
15252
|
+
var _useProductDetailsCop = useProductDetailsCopy(),
|
|
15253
|
+
setProductDetailsCopy = _useProductDetailsCop[1];
|
|
15254
|
+
var _useLoading = useLoading(),
|
|
15255
|
+
setLoading = _useLoading[1];
|
|
15256
|
+
var _useTasksData = useTasksData(),
|
|
15257
|
+
setTasksData = _useTasksData[1];
|
|
15258
|
+
var _useReminderNotiData = useReminderNotiData(),
|
|
15259
|
+
setReminderNotifyData = _useReminderNotiData[1];
|
|
15260
|
+
// call orders api
|
|
15261
|
+
var _useAxios = useAxios({
|
|
15262
|
+
endpoint: "/orders/" + orderId,
|
|
15263
|
+
method: 'GET'
|
|
15264
|
+
}),
|
|
15265
|
+
callOrdersApi = _useAxios.fetchData,
|
|
15266
|
+
loading = _useAxios.loading,
|
|
15267
|
+
fetchedData = _useAxios.data;
|
|
15268
|
+
useEffect(function () {
|
|
15269
|
+
var _fetchedData$data;
|
|
15270
|
+
setLoading(loading);
|
|
15271
|
+
if (fetchedData && fetchedData != null && fetchedData.data) {
|
|
15272
|
+
var requiredData = fetchedData == null ? void 0 : fetchedData.data;
|
|
15273
|
+
setOrderDetails(requiredData[0]);
|
|
15274
|
+
setPrevOrderDetails(requiredData[0]);
|
|
15275
|
+
setCurrentAction(undefined);
|
|
15276
|
+
}
|
|
15277
|
+
if (fetchedData && (fetchedData == null ? void 0 : fetchedData.data) === null || (fetchedData == null || (_fetchedData$data = fetchedData.data) == null ? void 0 : _fetchedData$data.length) === 0) {
|
|
15278
|
+
setCurrentAction(undefined);
|
|
15279
|
+
}
|
|
15280
|
+
}, [loading]);
|
|
15281
|
+
// orders api ends
|
|
15282
|
+
// call order products api start
|
|
15283
|
+
var _useAxios2 = useAxios({
|
|
15284
|
+
endpoint: "/order/order_products/" + orderId,
|
|
15285
|
+
method: 'GET'
|
|
15286
|
+
}),
|
|
15287
|
+
productsData = _useAxios2.data,
|
|
15288
|
+
orderProductsLoading = _useAxios2.loading,
|
|
15289
|
+
callOrderProductsApi = _useAxios2.fetchData;
|
|
15290
|
+
useEffect(function () {
|
|
15291
|
+
var _productsData$data;
|
|
15292
|
+
if (productsData && (productsData == null || (_productsData$data = productsData.data) == null ? void 0 : _productsData$data.length) > 0) {
|
|
15293
|
+
setProductDetails(productsData == null ? void 0 : productsData.data);
|
|
15294
|
+
setProductDetailsCopy(productsData == null ? void 0 : productsData.data);
|
|
15295
|
+
} else {
|
|
15296
|
+
setProductDetails(null);
|
|
15297
|
+
setProductDetailsCopy(null);
|
|
15298
|
+
}
|
|
15299
|
+
}, [orderProductsLoading]);
|
|
12991
15300
|
// call order products api end
|
|
12992
15301
|
// call alerts api
|
|
12993
15302
|
var _useAxios3 = useAxios({
|
|
@@ -13104,6 +15413,12 @@ function OrderActions() {
|
|
|
13104
15413
|
});
|
|
13105
15414
|
case 'send-sms':
|
|
13106
15415
|
return React.createElement(SendSmsModal, null);
|
|
15416
|
+
case 'force-debrief':
|
|
15417
|
+
return React.createElement(ForceDebriefModal$1, {
|
|
15418
|
+
callOrdersApi: callOrdersApi,
|
|
15419
|
+
callOrderStatusApi: fetchStatusData,
|
|
15420
|
+
callOrderAlertsApi: callOrderAlertsApi
|
|
15421
|
+
});
|
|
13107
15422
|
case 'send-email':
|
|
13108
15423
|
return React.createElement(SendEmailModal, null);
|
|
13109
15424
|
case 'change-customer-account':
|
|
@@ -13156,21 +15471,26 @@ function OrderActions() {
|
|
|
13156
15471
|
return null;
|
|
13157
15472
|
}
|
|
13158
15473
|
};
|
|
13159
|
-
return React.createElement(Container$
|
|
15474
|
+
return React.createElement(Container$1k, null, renderContent());
|
|
13160
15475
|
}
|
|
13161
|
-
var Container$
|
|
15476
|
+
var Container$1k = /*#__PURE__*/styled.div(_templateObject$2r || (_templateObject$2r = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
13162
15477
|
|
|
13163
|
-
var _templateObject$
|
|
15478
|
+
var _templateObject$2s, _templateObject2$1N, _templateObject3$16, _templateObject4$C;
|
|
13164
15479
|
var Details = function Details() {
|
|
15480
|
+
var _globalEscData$, _globalEscData$2;
|
|
13165
15481
|
// const [orderDetails] = useOrderDetails();
|
|
13166
15482
|
var _useCustomerInfo = useCustomerInfo(),
|
|
13167
15483
|
customerInfo = _useCustomerInfo[0];
|
|
13168
15484
|
var recipient = (customerInfo == null ? void 0 : customerInfo.recipient_name) || '';
|
|
13169
15485
|
var postcodeShow = (customerInfo == null ? void 0 : customerInfo.postcode) || '';
|
|
13170
|
-
|
|
15486
|
+
var _useGlobalEscData = useGlobalEscData(),
|
|
15487
|
+
globalEscData = _useGlobalEscData[0];
|
|
15488
|
+
return React.createElement(DetailsContainer, null, React.createElement(Typo, null, "CUSTOMER RETURN - ", recipient, " , ", postcodeShow, " ", (globalEscData == null ? void 0 : globalEscData.length) > 0 && React.createElement(EscInfo, null, ((_globalEscData$ = globalEscData[0]) == null || (_globalEscData$ = _globalEscData$.escalation_type) == null ? void 0 : _globalEscData$.level) + " (" + ((_globalEscData$2 = globalEscData[0]) == null || (_globalEscData$2 = _globalEscData$2.escalation_type) == null ? void 0 : _globalEscData$2.name) + ")")));
|
|
13171
15489
|
};
|
|
13172
|
-
var DetailsContainer = /*#__PURE__*/styled.div(_templateObject$
|
|
13173
|
-
var Typo = /*#__PURE__*/styled.div(_templateObject2$
|
|
15490
|
+
var DetailsContainer = /*#__PURE__*/styled.div(_templateObject$2s || (_templateObject$2s = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 10px;\n > svg {\n transform: scale(0.6);\n }\n"])));
|
|
15491
|
+
var Typo = /*#__PURE__*/styled.div(_templateObject2$1N || (_templateObject2$1N = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: row;\n gap: 15px;\n align-items: center;\n font-size: 20px;\n font-style: normal;\n font-weight: 600;\n line-height: 32px;\n text-transform: uppercase;\n margin: 0;\n padding: 0;\n\n @media screen and (max-width: 1220px) {\n font-size: 14px;\n }\n"])));
|
|
15492
|
+
var Name = /*#__PURE__*/styled.div(_templateObject3$16 || (_templateObject3$16 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* heading/h3-subHeader */\n font-family: 'Roboto', sans-serif;\n font-size: 20px;\n font-style: normal;\n font-weight: 900;\n line-height: 32px; /* 160% */\n text-transform: uppercase;\n"])));
|
|
15493
|
+
var EscInfo = /*#__PURE__*/styled(Name)(_templateObject4$C || (_templateObject4$C = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6396e5;\n font-size: 16px;\n"])));
|
|
13174
15494
|
|
|
13175
15495
|
var bjsMenu = [{
|
|
13176
15496
|
label: 'Add Order Resources',
|
|
@@ -13246,8 +15566,8 @@ var ArrowDownIcon = function ArrowDownIcon(_ref) {
|
|
|
13246
15566
|
}));
|
|
13247
15567
|
};
|
|
13248
15568
|
|
|
13249
|
-
var _templateObject$
|
|
13250
|
-
function Options() {
|
|
15569
|
+
var _templateObject$2t, _templateObject2$1O;
|
|
15570
|
+
function Options$1() {
|
|
13251
15571
|
var _orderStatus$, _orderStatus$2, _orderDetails$order_r;
|
|
13252
15572
|
var _useCurrentAction = useCurrentAction(),
|
|
13253
15573
|
setCurrentAction = _useCurrentAction[1];
|
|
@@ -13338,10 +15658,10 @@ function Options() {
|
|
|
13338
15658
|
fill: '#f0f2f2'
|
|
13339
15659
|
})))));
|
|
13340
15660
|
}
|
|
13341
|
-
var Option = /*#__PURE__*/styled.div(_templateObject$
|
|
13342
|
-
var StyledSpace = /*#__PURE__*/styled(Space)(_templateObject2$
|
|
15661
|
+
var Option = /*#__PURE__*/styled.div(_templateObject$2t || (_templateObject$2t = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
15662
|
+
var StyledSpace = /*#__PURE__*/styled(Space)(_templateObject2$1O || (_templateObject2$1O = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .ant-space-item {\n color: #6a7378;\n text-align: center;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n }\n"])));
|
|
13343
15663
|
|
|
13344
|
-
var _templateObject$
|
|
15664
|
+
var _templateObject$2u, _templateObject2$1P;
|
|
13345
15665
|
function Print() {
|
|
13346
15666
|
var _useOrderDetails = useOrderDetails(),
|
|
13347
15667
|
orderDetails = _useOrderDetails[0];
|
|
@@ -13461,7 +15781,7 @@ function Print() {
|
|
|
13461
15781
|
};
|
|
13462
15782
|
})
|
|
13463
15783
|
};
|
|
13464
|
-
return React.createElement(Container$
|
|
15784
|
+
return React.createElement(Container$1l, null, React.createElement(Dropdown, {
|
|
13465
15785
|
menu: menuItems,
|
|
13466
15786
|
trigger: ['hover']
|
|
13467
15787
|
}, React.createElement("a", {
|
|
@@ -13475,10 +15795,10 @@ function Print() {
|
|
|
13475
15795
|
fill: '#f0f2f2'
|
|
13476
15796
|
})))));
|
|
13477
15797
|
}
|
|
13478
|
-
var Container$
|
|
13479
|
-
var StyledSpace$1 = /*#__PURE__*/styled(Space)(_templateObject2$
|
|
15798
|
+
var Container$1l = /*#__PURE__*/styled.div(_templateObject$2u || (_templateObject$2u = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
15799
|
+
var StyledSpace$1 = /*#__PURE__*/styled(Space)(_templateObject2$1P || (_templateObject2$1P = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .ant-space-item {\n color: #6a7378;\n text-align: center;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n }\n"])));
|
|
13480
15800
|
|
|
13481
|
-
var _templateObject$
|
|
15801
|
+
var _templateObject$2v;
|
|
13482
15802
|
function BjsMenuDropDown() {
|
|
13483
15803
|
var _orderStatus$;
|
|
13484
15804
|
var _useCurrentAction = useCurrentAction(),
|
|
@@ -13522,9 +15842,9 @@ function BjsMenuDropDown() {
|
|
|
13522
15842
|
fill: '#f0f2f2'
|
|
13523
15843
|
}))));
|
|
13524
15844
|
}
|
|
13525
|
-
var StyledSpace$2 = /*#__PURE__*/styled(Space)(_templateObject$
|
|
15845
|
+
var StyledSpace$2 = /*#__PURE__*/styled(Space)(_templateObject$2v || (_templateObject$2v = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .ant-space-item {\n color: #6a7378;\n text-align: center;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n }\n"])));
|
|
13526
15846
|
|
|
13527
|
-
var _templateObject$
|
|
15847
|
+
var _templateObject$2w, _templateObject2$1Q;
|
|
13528
15848
|
// components
|
|
13529
15849
|
function DropDowns$1() {
|
|
13530
15850
|
var _orderDetails$order_r, _orderDetails$order_r2;
|
|
@@ -13551,7 +15871,7 @@ function DropDowns$1() {
|
|
|
13551
15871
|
}
|
|
13552
15872
|
});
|
|
13553
15873
|
}
|
|
13554
|
-
return React.createElement(React.Fragment, null, React.createElement(DashBoardWrapper$2, null, React.createElement(BjsMenuDropDown, null), React.createElement(Options, null), React.createElement(Print, null), actions == null ? void 0 : actions.map(function (action, index) {
|
|
15874
|
+
return React.createElement(React.Fragment, null, React.createElement(DashBoardWrapper$2, null, React.createElement(BjsMenuDropDown, null), React.createElement(Options$1, null), React.createElement(Print, null), actions == null ? void 0 : actions.map(function (action, index) {
|
|
13555
15875
|
return React.createElement(FontContainer, {
|
|
13556
15876
|
key: index,
|
|
13557
15877
|
onClick: action.onClick,
|
|
@@ -13561,25 +15881,25 @@ function DropDowns$1() {
|
|
|
13561
15881
|
}, action.label);
|
|
13562
15882
|
})));
|
|
13563
15883
|
}
|
|
13564
|
-
var DashBoardWrapper$2 = /*#__PURE__*/styled.section(_templateObject$
|
|
13565
|
-
var FontContainer = /*#__PURE__*/styled.div(_templateObject2$
|
|
15884
|
+
var DashBoardWrapper$2 = /*#__PURE__*/styled.section(_templateObject$2w || (_templateObject$2w = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 0 5px;\n display: flex;\n align-self: center;\n gap: 10px;\n align-items: center;\n"])));
|
|
15885
|
+
var FontContainer = /*#__PURE__*/styled.div(_templateObject2$1Q || (_templateObject2$1Q = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6a7378;\n text-align: center;\n font-family: 'lato', sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n text-transform: uppercase;\n cursor: ", ";\n @media screen and (max-width: 1210px) {\n font-size: 11px;\n line-height: 12px;\n }\n"])), function (props) {
|
|
13566
15886
|
return props.disabled ? 'not-allowed' : 'pointer';
|
|
13567
15887
|
});
|
|
13568
15888
|
|
|
13569
|
-
var _templateObject$
|
|
15889
|
+
var _templateObject$2x;
|
|
13570
15890
|
var ActionsMenu = function ActionsMenu() {
|
|
13571
15891
|
return React.createElement(Flex$2, null, React.createElement(DropDowns$1, null));
|
|
13572
15892
|
};
|
|
13573
|
-
var Flex$2 = /*#__PURE__*/styled.div(_templateObject$
|
|
15893
|
+
var Flex$2 = /*#__PURE__*/styled.div(_templateObject$2x || (_templateObject$2x = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n display: flex;\n height: 34px;\n padding: 1px;\n align-items: flex-start;\n border-radius: 20px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n background: #f0f2f2;\n cursor: pointer;\n"])));
|
|
13574
15894
|
|
|
13575
|
-
var _templateObject$
|
|
15895
|
+
var _templateObject$2y;
|
|
13576
15896
|
var DetailsFilters = function DetailsFilters() {
|
|
13577
15897
|
return React.createElement(Flex$3, null, React.createElement(Details, null), React.createElement(ActionsMenu, null));
|
|
13578
15898
|
};
|
|
13579
|
-
var Flex$3 = /*#__PURE__*/styled.div(_templateObject$
|
|
15899
|
+
var Flex$3 = /*#__PURE__*/styled.div(_templateObject$2y || (_templateObject$2y = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-radius: 40px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n background: linear-gradient(180deg, #fff 0%, #f9fcff 100%);\n\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n /* z-index: 9999; */\n display: flex;\n padding: 10px;\n flex-direction: row;\n gap: 10px;\n align-self: stretch;\n position: relative;\n margin-bottom: -71px;\n width: 97%;\n margin-left: 21px;\n top: -132px;\n justify-content: space-between;\n"])));
|
|
13580
15900
|
|
|
13581
|
-
var _templateObject$
|
|
13582
|
-
function OrderTemplate(_ref) {
|
|
15901
|
+
var _templateObject$2z, _templateObject2$1R;
|
|
15902
|
+
function OrderTemplate$1(_ref) {
|
|
13583
15903
|
var _orderStaticData$canc, _orderDetails$order_c, _routeInfoData$order_, _routeInfoData$order_2, _routeInfoData$order_3;
|
|
13584
15904
|
var orderDetails = _ref.orderDetails,
|
|
13585
15905
|
routeInfoData = _ref.routeInfoData;
|
|
@@ -13653,7 +15973,7 @@ function OrderTemplate(_ref) {
|
|
|
13653
15973
|
onClose: function onClose() {
|
|
13654
15974
|
return onCloseAlert('isPostcode');
|
|
13655
15975
|
}
|
|
13656
|
-
}), statusVal == 'on hold' && (alertVisibility == null ? void 0 : alertVisibility.isHoldVisible) && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
15976
|
+
}), statusVal == 'on hold' && (alertVisibility == null ? void 0 : alertVisibility.isHoldVisible) && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13657
15977
|
type: "warn",
|
|
13658
15978
|
title: React.createElement("div", {
|
|
13659
15979
|
dangerouslySetInnerHTML: {
|
|
@@ -13665,7 +15985,7 @@ function OrderTemplate(_ref) {
|
|
|
13665
15985
|
onClose: function onClose() {
|
|
13666
15986
|
return onCloseAlert('isHoldVisible');
|
|
13667
15987
|
}
|
|
13668
|
-
})), statusVal == 'complete' && alertVisibility.isCompleted && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
15988
|
+
})), statusVal == 'complete' && alertVisibility.isCompleted && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13669
15989
|
type: "success",
|
|
13670
15990
|
title: React.createElement("div", {
|
|
13671
15991
|
dangerouslySetInnerHTML: {
|
|
@@ -13677,7 +15997,7 @@ function OrderTemplate(_ref) {
|
|
|
13677
15997
|
onClose: function onClose() {
|
|
13678
15998
|
return onCloseAlert('isCompleted');
|
|
13679
15999
|
}
|
|
13680
|
-
})), statusVal == 'outstanding' && alertVisibility.isOutstanding && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16000
|
+
})), statusVal == 'outstanding' && alertVisibility.isOutstanding && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13681
16001
|
type: "release",
|
|
13682
16002
|
title: React.createElement("div", {
|
|
13683
16003
|
dangerouslySetInnerHTML: {
|
|
@@ -13689,7 +16009,7 @@ function OrderTemplate(_ref) {
|
|
|
13689
16009
|
onClose: function onClose() {
|
|
13690
16010
|
return onCloseAlert('isOutstanding');
|
|
13691
16011
|
}
|
|
13692
|
-
})), statusVal == 'awaiting confirmation' && alertVisibility.isAwaitingConfirmation && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16012
|
+
})), statusVal == 'awaiting confirmation' && alertVisibility.isAwaitingConfirmation && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13693
16013
|
type: "info",
|
|
13694
16014
|
title: React.createElement("div", {
|
|
13695
16015
|
dangerouslySetInnerHTML: {
|
|
@@ -13701,7 +16021,7 @@ function OrderTemplate(_ref) {
|
|
|
13701
16021
|
onClose: function onClose() {
|
|
13702
16022
|
return onCloseAlert('isAwaitingConfirmation');
|
|
13703
16023
|
}
|
|
13704
|
-
})), statusVal == 'awaiting route' && alertVisibility.isAwaitingRoute && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16024
|
+
})), statusVal == 'awaiting route' && alertVisibility.isAwaitingRoute && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13705
16025
|
type: "info",
|
|
13706
16026
|
title: React.createElement("div", {
|
|
13707
16027
|
dangerouslySetInnerHTML: {
|
|
@@ -13713,7 +16033,7 @@ function OrderTemplate(_ref) {
|
|
|
13713
16033
|
onClose: function onClose() {
|
|
13714
16034
|
return onCloseAlert('isAwaitingRoute');
|
|
13715
16035
|
}
|
|
13716
|
-
})), statusVal == 'cancelled' && alertVisibility.isCancelled && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16036
|
+
})), statusVal == 'cancelled' && alertVisibility.isCancelled && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13717
16037
|
type: "info",
|
|
13718
16038
|
title: React.createElement("div", {
|
|
13719
16039
|
dangerouslySetInnerHTML: {
|
|
@@ -13725,7 +16045,7 @@ function OrderTemplate(_ref) {
|
|
|
13725
16045
|
onClose: function onClose() {
|
|
13726
16046
|
return onCloseAlert('isCancelled');
|
|
13727
16047
|
}
|
|
13728
|
-
})), statusVal == 'confirmed' && alertVisibility.isConfirmed && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16048
|
+
})), statusVal == 'confirmed' && alertVisibility.isConfirmed && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13729
16049
|
type: "info",
|
|
13730
16050
|
title: React.createElement("div", {
|
|
13731
16051
|
dangerouslySetInnerHTML: {
|
|
@@ -13737,7 +16057,7 @@ function OrderTemplate(_ref) {
|
|
|
13737
16057
|
onClose: function onClose() {
|
|
13738
16058
|
return onCloseAlert('isConfirmed');
|
|
13739
16059
|
}
|
|
13740
|
-
})), statusVal == 'subcontracted' && alertVisibility.isSubcontracted && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16060
|
+
})), statusVal == 'subcontracted' && alertVisibility.isSubcontracted && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13741
16061
|
type: "info",
|
|
13742
16062
|
title: React.createElement("div", {
|
|
13743
16063
|
dangerouslySetInnerHTML: {
|
|
@@ -13749,7 +16069,7 @@ function OrderTemplate(_ref) {
|
|
|
13749
16069
|
onClose: function onClose() {
|
|
13750
16070
|
return onCloseAlert('isRouted');
|
|
13751
16071
|
}
|
|
13752
|
-
})), statusVal == 'enroute' && alertVisibility.isEnroute && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16072
|
+
})), statusVal == 'enroute' && alertVisibility.isEnroute && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13753
16073
|
type: "info",
|
|
13754
16074
|
title: React.createElement("div", {
|
|
13755
16075
|
dangerouslySetInnerHTML: {
|
|
@@ -13761,7 +16081,7 @@ function OrderTemplate(_ref) {
|
|
|
13761
16081
|
onClose: function onClose() {
|
|
13762
16082
|
return onCloseAlert('isEnroute');
|
|
13763
16083
|
}
|
|
13764
|
-
})), statusVal == 'routed' && alertVisibility.isRouted && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16084
|
+
})), statusVal == 'routed' && alertVisibility.isRouted && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13765
16085
|
type: "info",
|
|
13766
16086
|
title: React.createElement("div", {
|
|
13767
16087
|
dangerouslySetInnerHTML: {
|
|
@@ -13773,7 +16093,7 @@ function OrderTemplate(_ref) {
|
|
|
13773
16093
|
onClose: function onClose() {
|
|
13774
16094
|
return onCloseAlert('isRouted');
|
|
13775
16095
|
}
|
|
13776
|
-
})), statusVal == 'precalled' && alertVisibility.isPreCall && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16096
|
+
})), statusVal == 'precalled' && alertVisibility.isPreCall && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13777
16097
|
type: "info",
|
|
13778
16098
|
title: React.createElement("div", {
|
|
13779
16099
|
dangerouslySetInnerHTML: {
|
|
@@ -13785,7 +16105,7 @@ function OrderTemplate(_ref) {
|
|
|
13785
16105
|
onClose: function onClose() {
|
|
13786
16106
|
return onCloseAlert('isPreCall');
|
|
13787
16107
|
}
|
|
13788
|
-
})), statusVal == 'on site' && alertVisibility.isOnSite && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16108
|
+
})), statusVal == 'on site' && alertVisibility.isOnSite && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13789
16109
|
type: "info",
|
|
13790
16110
|
title: React.createElement("div", {
|
|
13791
16111
|
dangerouslySetInnerHTML: {
|
|
@@ -13797,7 +16117,7 @@ function OrderTemplate(_ref) {
|
|
|
13797
16117
|
onClose: function onClose() {
|
|
13798
16118
|
return onCloseAlert('isOnSite');
|
|
13799
16119
|
}
|
|
13800
|
-
})), statusVal == 'failed' && alertVisibility.isFailed && React.createElement(StyledAlert, null, React.createElement(FlagAlert, {
|
|
16120
|
+
})), statusVal == 'failed' && alertVisibility.isFailed && React.createElement(StyledAlert$2, null, React.createElement(FlagAlert, {
|
|
13801
16121
|
type: "info",
|
|
13802
16122
|
title: React.createElement("div", {
|
|
13803
16123
|
dangerouslySetInnerHTML: {
|
|
@@ -13853,50 +16173,10 @@ function OrderTemplate(_ref) {
|
|
|
13853
16173
|
}
|
|
13854
16174
|
}));
|
|
13855
16175
|
}
|
|
13856
|
-
var FlagsStyle = /*#__PURE__*/styled.div(_templateObject$
|
|
13857
|
-
var StyledAlert = /*#__PURE__*/styled.div(_templateObject2$
|
|
13858
|
-
|
|
13859
|
-
var _templateObject$2f, _templateObject2$1G, _templateObject3$Z;
|
|
13860
|
-
function FlagTemplate(_ref) {
|
|
13861
|
-
var data = _ref.data,
|
|
13862
|
-
dismissFlags = _ref.dismissFlags;
|
|
13863
|
-
var _useFlagRefId = useFlagRefId(),
|
|
13864
|
-
setSelectedFlag = _useFlagRefId[1];
|
|
13865
|
-
var _useCurrentAction = useCurrentAction(),
|
|
13866
|
-
setCurrentAction = _useCurrentAction[1];
|
|
13867
|
-
var openModal = function openModal() {
|
|
13868
|
-
setCurrentAction('view-flag');
|
|
13869
|
-
};
|
|
13870
|
-
var handleClick = function handleClick(Id) {
|
|
13871
|
-
setSelectedFlag(Id);
|
|
13872
|
-
openModal();
|
|
13873
|
-
};
|
|
13874
|
-
var titleColor = (data == null ? void 0 : data.status) === 'SD' ? '#36A053' : '#3a3630';
|
|
13875
|
-
return React.createElement(StyledAlert$1, null, React.createElement(FlagAlert, {
|
|
13876
|
-
type: (data == null ? void 0 : data.status) === 'AD' ? 'info' : 'success',
|
|
13877
|
-
title: React.createElement(React.Fragment, null, React.createElement(StyledTitle, {
|
|
13878
|
-
color: titleColor
|
|
13879
|
-
}, "Flag : ", data != null && data.is_private ? 'Private' : '', ' ', React.createElement(StyledLink$1, {
|
|
13880
|
-
onClick: function onClick() {
|
|
13881
|
-
return handleClick(data.id);
|
|
13882
|
-
}
|
|
13883
|
-
}, data == null ? void 0 : data.id, " - ", data == null ? void 0 : data.flag_type, ' '), ' ', (data == null ? void 0 : data.status) === 'AD' ? 'Unresolved' : 'Resolved on', ' ', (data == null ? void 0 : data.status) == 'SD' ? React.createElement(React.Fragment, null, formatDate$1(data == null ? void 0 : data.resolved_at), " by ", data == null ? void 0 : data.resolved_by, ' ') : null)),
|
|
13884
|
-
subtitle: "",
|
|
13885
|
-
description: "" + (data == null ? void 0 : data.description),
|
|
13886
|
-
showOkButton: false,
|
|
13887
|
-
onClose: function onClose() {
|
|
13888
|
-
return dismissFlags(data == null ? void 0 : data.id);
|
|
13889
|
-
}
|
|
13890
|
-
}));
|
|
13891
|
-
}
|
|
13892
|
-
var StyledAlert$1 = /*#__PURE__*/styled.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 10px;\n"])));
|
|
13893
|
-
var StyledLink$1 = /*#__PURE__*/styled.span(_templateObject2$1G || (_templateObject2$1G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--contextual-blue, #6396e5);\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n"])));
|
|
13894
|
-
var StyledTitle = /*#__PURE__*/styled.span(_templateObject3$Z || (_templateObject3$Z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: ", ";\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n"])), function (_ref2) {
|
|
13895
|
-
var color = _ref2.color;
|
|
13896
|
-
return color;
|
|
13897
|
-
});
|
|
16176
|
+
var FlagsStyle = /*#__PURE__*/styled.div(_templateObject$2z || (_templateObject$2z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .redCross {\n font-size: 13px;\n margin-top: 4px;\n }\n .postcode-alert-content {\n > div {\n > h4 {\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n }\n ul {\n margin-bottom: 0;\n }\n\n li {\n border-radius: 6px;\n list-style-type: none;\n > a {\n color: #6396e5;\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n text-decoration: none;\n }\n > strong {\n > a {\n color: #6396e5;\n\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: 24px;\n text-decoration: none;\n }\n }\n }\n\n li.outstanding strong,\n li.awaiting_confirmation strong,\n li.awaiting_route strong {\n font-family: Roboto, sans-serif;\n font-size: 14px;\n font-weight: 600;\n line-height: 24px;\n font-style: normal;\n }\n li.routed strong {\n margin-left: 5px;\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n\n li.outstanding strong {\n color: #e95252;\n }\n li.awaiting_confirmation strong {\n color: #6396e5;\n }\n li.awaiting_route strong {\n color: #36a053;\n }\n li.confirmed strong {\n color: #36a053;\n }\n li.enroute strong {\n color: #36a053;\n }\n li.cancelled strong {\n color: #e95252;\n }\n li.complete strong {\n color: #36a053;\n }\n li.on_hold strong {\n color: #feba30;\n }\n li.routed strong {\n color: #3a3630;\n }\n span {\n margin-left: 5px;\n color: #3a3630;\n font-family: Lato;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 18px;\n }\n }\n"])));
|
|
16177
|
+
var StyledAlert$2 = /*#__PURE__*/styled.div(_templateObject2$1R || (_templateObject2$1R = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 5px;\n"])));
|
|
13898
16178
|
|
|
13899
|
-
var _templateObject$
|
|
16179
|
+
var _templateObject$2A, _templateObject2$1S, _templateObject3$17;
|
|
13900
16180
|
function ReminderTemplate(_ref) {
|
|
13901
16181
|
var data = _ref.data,
|
|
13902
16182
|
dismissReminder = _ref.dismissReminder;
|
|
@@ -13914,7 +16194,7 @@ function ReminderTemplate(_ref) {
|
|
|
13914
16194
|
};
|
|
13915
16195
|
var type = (data == null ? void 0 : data.status) === true ? 'success' : (data == null ? void 0 : data.status) === false ? 'warn' : 'info';
|
|
13916
16196
|
var titleColor = (data == null ? void 0 : data.status) === true ? '#36A053' : (data == null ? void 0 : data.staus) === false ? '#FEBA30' : '#3A3630';
|
|
13917
|
-
return React.createElement("div", null, React.createElement(StyledAlert$
|
|
16197
|
+
return React.createElement("div", null, React.createElement(StyledAlert$3, null, React.createElement(FlagAlert, {
|
|
13918
16198
|
type: type,
|
|
13919
16199
|
title: React.createElement(React.Fragment, null, React.createElement(StyledTitle$1, {
|
|
13920
16200
|
color: titleColor
|
|
@@ -13930,15 +16210,15 @@ function ReminderTemplate(_ref) {
|
|
|
13930
16210
|
}
|
|
13931
16211
|
})));
|
|
13932
16212
|
}
|
|
13933
|
-
var StyledAlert$
|
|
13934
|
-
var StyledTitle$1 = /*#__PURE__*/styled.span(_templateObject2$
|
|
16213
|
+
var StyledAlert$3 = /*#__PURE__*/styled.div(_templateObject$2A || (_templateObject$2A = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-bottom: 10px;\n"])));
|
|
16214
|
+
var StyledTitle$1 = /*#__PURE__*/styled.span(_templateObject2$1S || (_templateObject2$1S = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: ", ";\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n"])), function (_ref2) {
|
|
13935
16215
|
var color = _ref2.color;
|
|
13936
16216
|
return color;
|
|
13937
16217
|
});
|
|
13938
|
-
var StyledLink$2 = /*#__PURE__*/styled.span(_templateObject3$
|
|
16218
|
+
var StyledLink$2 = /*#__PURE__*/styled.span(_templateObject3$17 || (_templateObject3$17 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--contextual-blue, #6396e5);\n font-family: Roboto;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n"])));
|
|
13939
16219
|
|
|
13940
|
-
var _templateObject$
|
|
13941
|
-
function Tabs(_ref) {
|
|
16220
|
+
var _templateObject$2B, _templateObject2$1T;
|
|
16221
|
+
function Tabs$1(_ref) {
|
|
13942
16222
|
var activeTasks = _ref.activeTasks,
|
|
13943
16223
|
closedTasks = _ref.closedTasks,
|
|
13944
16224
|
activeReminders = _ref.activeReminders,
|
|
@@ -13954,9 +16234,9 @@ function Tabs(_ref) {
|
|
|
13954
16234
|
var additionalNotifications = activeTasks == null ? void 0 : activeTasks.slice(3);
|
|
13955
16235
|
var initialReminders = activeReminders == null ? void 0 : activeReminders.slice(0, 3);
|
|
13956
16236
|
var additionalReminders = activeReminders == null ? void 0 : activeReminders.slice(3);
|
|
13957
|
-
return React.createElement(React.Fragment, null, React.createElement(Content, null, React.createElement(Container$
|
|
16237
|
+
return React.createElement(React.Fragment, null, React.createElement(Content$1, null, React.createElement(Container$1m, {
|
|
13958
16238
|
className: "tab-content"
|
|
13959
|
-
}, activeTab === 'active' && React.createElement(React.Fragment, null, React.createElement(OrderTemplate, {
|
|
16239
|
+
}, activeTab === 'active' && React.createElement(React.Fragment, null, React.createElement(OrderTemplate$1, {
|
|
13960
16240
|
orderDetails: orderDetails,
|
|
13961
16241
|
routeInfoData: routeInfoData
|
|
13962
16242
|
}), initialReminders == null ? void 0 : initialReminders.map(function (item, index) {
|
|
@@ -13997,8 +16277,8 @@ function Tabs(_ref) {
|
|
|
13997
16277
|
});
|
|
13998
16278
|
})))));
|
|
13999
16279
|
}
|
|
14000
|
-
var Container$
|
|
14001
|
-
var Content = /*#__PURE__*/styled.div(_templateObject2$
|
|
16280
|
+
var Container$1m = /*#__PURE__*/styled.div(_templateObject$2B || (_templateObject$2B = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n gap: 10px;\n display: grid;\n"])));
|
|
16281
|
+
var Content$1 = /*#__PURE__*/styled.div(_templateObject2$1T || (_templateObject2$1T = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n"])));
|
|
14002
16282
|
|
|
14003
16283
|
var NotifyFlag = function NotifyFlag() {
|
|
14004
16284
|
return React.createElement("svg", {
|
|
@@ -14016,7 +16296,7 @@ var NotifyFlag = function NotifyFlag() {
|
|
|
14016
16296
|
}));
|
|
14017
16297
|
};
|
|
14018
16298
|
|
|
14019
|
-
var _templateObject$
|
|
16299
|
+
var _templateObject$2C, _templateObject2$1U, _templateObject3$18, _templateObject4$D, _templateObject5$t, _templateObject6$f, _templateObject7$g, _templateObject8$d, _templateObject9$a, _templateObject10$6, _templateObject11$4, _templateObject12$1;
|
|
14020
16300
|
function Notification() {
|
|
14021
16301
|
var _orderData$order_rout, _activeTasks$filter, _closedTasks$filter;
|
|
14022
16302
|
var _useTabType = useTabType(),
|
|
@@ -14253,9 +16533,9 @@ function Notification() {
|
|
|
14253
16533
|
var totalClosedCount = (closedTasks == null || (_closedTasks$filter = closedTasks.filter(function (item) {
|
|
14254
16534
|
return item.status === 'SD';
|
|
14255
16535
|
})) == null ? void 0 : _closedTasks$filter.length) + (closedReminders == null ? void 0 : closedReminders.length);
|
|
14256
|
-
return React.createElement(React.Fragment, null, React.createElement(Section$
|
|
16536
|
+
return React.createElement(React.Fragment, null, React.createElement(Section$2, null, React.createElement(Container$1n, {
|
|
14257
16537
|
className: "notification-header"
|
|
14258
|
-
}, React.createElement(FlagContainer, null, React.createElement(NotifyFlag, null)), React.createElement(Label$
|
|
16538
|
+
}, React.createElement(FlagContainer, null, React.createElement(NotifyFlag, null)), React.createElement(Label$j, {
|
|
14259
16539
|
label: "NOTIFICATIONS"
|
|
14260
16540
|
}), React.createElement(TabsData, {
|
|
14261
16541
|
className: "tab-buttons"
|
|
@@ -14269,7 +16549,7 @@ function Notification() {
|
|
|
14269
16549
|
onClick: function onClick() {
|
|
14270
16550
|
return handleTabChange('closed');
|
|
14271
16551
|
}
|
|
14272
|
-
}, "Closed", React.createElement(ClosedCount, null, totalClosedCount)))), unresolvedLoading || reminderLoading ? React.createElement(Loader, null, React.createElement(Spinner, null), React.createElement(Text$
|
|
16552
|
+
}, "Closed", React.createElement(ClosedCount, null, totalClosedCount)))), unresolvedLoading || reminderLoading ? React.createElement(Loader$1, null, React.createElement(Spinner$1, null), React.createElement(Text$e, null, "Fetching Notifications...")) : (taskData == null ? void 0 : taskData.length) > 0 || (reminderNotifyData == null ? void 0 : reminderNotifyData.length) > 0 || orderData ? React.createElement(TabsWrapper$1, null, React.createElement(Tabs$1, {
|
|
14273
16553
|
activeTasks: activeTasks,
|
|
14274
16554
|
closedTasks: closedTasks,
|
|
14275
16555
|
activeReminders: activeReminders,
|
|
@@ -14279,64 +16559,64 @@ function Notification() {
|
|
|
14279
16559
|
routeInfoData: orderAlertsData
|
|
14280
16560
|
})) : 'No Notifications Found'));
|
|
14281
16561
|
}
|
|
14282
|
-
var Container$
|
|
14283
|
-
var Loader = /*#__PURE__*/styled.div(_templateObject2$
|
|
14284
|
-
var Spinner = /*#__PURE__*/styled.div(_templateObject3
|
|
14285
|
-
var FlagContainer = /*#__PURE__*/styled.div(_templateObject4$
|
|
14286
|
-
var TabsData = /*#__PURE__*/styled.div(_templateObject5$
|
|
14287
|
-
var ActiveCount = /*#__PURE__*/styled.div(_templateObject6$
|
|
14288
|
-
var ClosedCount = /*#__PURE__*/styled.div(_templateObject7$
|
|
14289
|
-
var StyledTab = /*#__PURE__*/styled.div(_templateObject8$
|
|
16562
|
+
var Container$1n = /*#__PURE__*/styled.div(_templateObject$2C || (_templateObject$2C = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 20px;\n padding: 10px;\n border-bottom: 1px solid #ccc;\n"])));
|
|
16563
|
+
var Loader$1 = /*#__PURE__*/styled.div(_templateObject2$1U || (_templateObject2$1U = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n align-items: center;\n justify-content: center;\n display: flex;\n flex-direction: column;\n gap: 10px;\n"])));
|
|
16564
|
+
var Spinner$1 = /*#__PURE__*/styled.div(_templateObject3$18 || (_templateObject3$18 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: 4px solid rgba(0, 0, 0, 0.1);\n border-left-color: #3a3630;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 1s linear infinite;\n\n @keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n }\n"])));
|
|
16565
|
+
var FlagContainer = /*#__PURE__*/styled.div(_templateObject4$D || (_templateObject4$D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 8px;\n background-color: #3a3630;\n border-radius: 10px;\n"])));
|
|
16566
|
+
var TabsData = /*#__PURE__*/styled.div(_templateObject5$t || (_templateObject5$t = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 20px;\n padding: 10px;\n"])));
|
|
16567
|
+
var ActiveCount = /*#__PURE__*/styled.div(_templateObject6$f || (_templateObject6$f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #6396e5;\n border-radius: 6px;\n"])));
|
|
16568
|
+
var ClosedCount = /*#__PURE__*/styled.div(_templateObject7$g || (_templateObject7$g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #ffffff;\n padding: 1px 5px;\n background-color: #e95252;\n border-radius: 6px;\n"])));
|
|
16569
|
+
var StyledTab = /*#__PURE__*/styled.div(_templateObject8$d || (_templateObject8$d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 5px;\n cursor: pointer;\n color: ", ";\n border-bottom: ", ";\n transition: border-bottom 0.3s ease;\n font-family: 'Roboto', sans-serif;\n padding-bottom: 5px;\n align-items: center;\n"])), function (props) {
|
|
14290
16570
|
return props.active ? '#3a3630' : '#AEA9A1';
|
|
14291
16571
|
}, function (props) {
|
|
14292
16572
|
return props.active ? '2px solid #feba30' : '2px solid #eeeeee';
|
|
14293
16573
|
});
|
|
14294
|
-
var Section$
|
|
14295
|
-
var Label$
|
|
14296
|
-
var TabsWrapper = /*#__PURE__*/styled.div(_templateObject11$
|
|
14297
|
-
var Text$
|
|
16574
|
+
var Section$2 = /*#__PURE__*/styled.div(_templateObject9$a || (_templateObject9$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 14px;\n background: #ffffff;\n border-radius: 12px;\n padding: 10px;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n border: 1px solid #e0e0e0;\n"])));
|
|
16575
|
+
var Label$j = /*#__PURE__*/styled(SectionHeader)(_templateObject10$6 || (_templateObject10$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-bottom: 1px solid #ccc;\n font-family: 'Roboto', sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n text-transform: uppercase;\n"])));
|
|
16576
|
+
var TabsWrapper$1 = /*#__PURE__*/styled.div(_templateObject11$4 || (_templateObject11$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* min-height: 200px; */\n max-height: 350px;\n overflow-y: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n\n &:hover {\n scrollbar-width: thin;\n }\n\n &::-webkit-scrollbar {\n width: 0;\n }\n\n &:hover::-webkit-scrollbar {\n width: 8px;\n }\n\n &::-webkit-scrollbar-thumb {\n background-color: rgba(0, 0, 0, 0.5);\n }\n"])));
|
|
16577
|
+
var Text$e = /*#__PURE__*/styled.div(_templateObject12$1 || (_templateObject12$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: var(--tonal-brown-651, #6a7378);\n font-family: Lato;\n font-size: 13px;\n font-style: normal;\n font-weight: 600;\n"])));
|
|
14298
16578
|
|
|
14299
|
-
var _templateObject$
|
|
16579
|
+
var _templateObject$2D;
|
|
14300
16580
|
function CollapsedContent$2() {
|
|
14301
16581
|
return React.createElement(Font$1, null, "ORDER RESOURCES");
|
|
14302
16582
|
}
|
|
14303
|
-
var Font$1 = /*#__PURE__*/styled.div(_templateObject$
|
|
16583
|
+
var Font$1 = /*#__PURE__*/styled.div(_templateObject$2D || (_templateObject$2D = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-family: 'Roboto', sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: 500;\n line-height: 24px; /* 150% */\n"])));
|
|
14304
16584
|
|
|
14305
|
-
var _templateObject$
|
|
16585
|
+
var _templateObject$2E, _templateObject2$1V;
|
|
14306
16586
|
function Category(props) {
|
|
14307
16587
|
var _props$row;
|
|
14308
16588
|
var data = props == null || (_props$row = props.row) == null ? void 0 : _props$row.original.category;
|
|
14309
16589
|
return React.createElement(RowContainer$4, null, React.createElement(Row$7, null, data));
|
|
14310
16590
|
}
|
|
14311
|
-
var RowContainer$4 = /*#__PURE__*/styled.div(_templateObject$
|
|
14312
|
-
var Row$7 = /*#__PURE__*/styled.div(_templateObject2$
|
|
16591
|
+
var RowContainer$4 = /*#__PURE__*/styled.div(_templateObject$2E || (_templateObject$2E = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
16592
|
+
var Row$7 = /*#__PURE__*/styled.div(_templateObject2$1V || (_templateObject2$1V = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
14313
16593
|
|
|
14314
|
-
var _templateObject$
|
|
16594
|
+
var _templateObject$2F, _templateObject2$1W;
|
|
14315
16595
|
function Date$2(props) {
|
|
14316
16596
|
var _props$row;
|
|
14317
16597
|
var data = props == null || (_props$row = props.row) == null ? void 0 : _props$row.original.date;
|
|
14318
16598
|
return React.createElement(RowContainer$5, null, React.createElement(Row$8, null, formatDate$1(data)));
|
|
14319
16599
|
}
|
|
14320
|
-
var RowContainer$5 = /*#__PURE__*/styled.div(_templateObject$
|
|
14321
|
-
var Row$8 = /*#__PURE__*/styled.div(_templateObject2$
|
|
16600
|
+
var RowContainer$5 = /*#__PURE__*/styled.div(_templateObject$2F || (_templateObject$2F = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
16601
|
+
var Row$8 = /*#__PURE__*/styled.div(_templateObject2$1W || (_templateObject2$1W = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
14322
16602
|
|
|
14323
|
-
var _templateObject$
|
|
16603
|
+
var _templateObject$2G, _templateObject2$1X;
|
|
14324
16604
|
function Reference(props) {
|
|
14325
16605
|
var _props$row;
|
|
14326
16606
|
var data = props == null || (_props$row = props.row) == null ? void 0 : _props$row.original.reference;
|
|
14327
16607
|
return React.createElement(RowContainer$6, null, React.createElement(Row$9, null, data));
|
|
14328
16608
|
}
|
|
14329
|
-
var RowContainer$6 = /*#__PURE__*/styled.div(_templateObject$
|
|
14330
|
-
var Row$9 = /*#__PURE__*/styled.div(_templateObject2$
|
|
16609
|
+
var RowContainer$6 = /*#__PURE__*/styled.div(_templateObject$2G || (_templateObject$2G = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
16610
|
+
var Row$9 = /*#__PURE__*/styled.div(_templateObject2$1X || (_templateObject2$1X = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
14331
16611
|
|
|
14332
|
-
var _templateObject$
|
|
16612
|
+
var _templateObject$2H, _templateObject2$1Y;
|
|
14333
16613
|
function Type(props) {
|
|
14334
16614
|
var _props$row;
|
|
14335
16615
|
var data = props == null || (_props$row = props.row) == null ? void 0 : _props$row.original.type;
|
|
14336
16616
|
return React.createElement(RowContainer$7, null, React.createElement(Row$a, null, data));
|
|
14337
16617
|
}
|
|
14338
|
-
var RowContainer$7 = /*#__PURE__*/styled.div(_templateObject$
|
|
14339
|
-
var Row$a = /*#__PURE__*/styled.div(_templateObject2$
|
|
16618
|
+
var RowContainer$7 = /*#__PURE__*/styled.div(_templateObject$2H || (_templateObject$2H = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
16619
|
+
var Row$a = /*#__PURE__*/styled.div(_templateObject2$1Y || (_templateObject2$1Y = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
14340
16620
|
|
|
14341
16621
|
var DownloadIcon = function DownloadIcon() {
|
|
14342
16622
|
return React.createElement("svg", {
|
|
@@ -14365,7 +16645,7 @@ var DownloadIcon = function DownloadIcon() {
|
|
|
14365
16645
|
})));
|
|
14366
16646
|
};
|
|
14367
16647
|
|
|
14368
|
-
var _templateObject$
|
|
16648
|
+
var _templateObject$2I, _templateObject2$1Z, _templateObject3$19;
|
|
14369
16649
|
function Action(_ref) {
|
|
14370
16650
|
var _row$original, _orderResources$data;
|
|
14371
16651
|
var row = _ref.row;
|
|
@@ -14475,9 +16755,9 @@ function Action(_ref) {
|
|
|
14475
16755
|
}, React.createElement(DownloadIcon, null)))));
|
|
14476
16756
|
}
|
|
14477
16757
|
// Styled components for styling
|
|
14478
|
-
var Actions = /*#__PURE__*/styled.div(_templateObject$
|
|
14479
|
-
var TippyContainer = /*#__PURE__*/styled.div(_templateObject2$
|
|
14480
|
-
var Row$b = /*#__PURE__*/styled.div(_templateObject3$
|
|
16758
|
+
var Actions = /*#__PURE__*/styled.div(_templateObject$2I || (_templateObject$2I = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
16759
|
+
var TippyContainer = /*#__PURE__*/styled.div(_templateObject2$1Z || (_templateObject2$1Z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: inline-block;\n margin: 7px;\n"])));
|
|
16760
|
+
var Row$b = /*#__PURE__*/styled.div(_templateObject3$19 || (_templateObject3$19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n gap: 10px;\n cursor: pointer;\n display: flex;\n align-items: center;\n"])));
|
|
14481
16761
|
|
|
14482
16762
|
var tableColumns$1 = [{
|
|
14483
16763
|
header: 'Date',
|
|
@@ -14506,7 +16786,7 @@ var tableColumns$1 = [{
|
|
|
14506
16786
|
enableSorting: false
|
|
14507
16787
|
}];
|
|
14508
16788
|
|
|
14509
|
-
var _templateObject$
|
|
16789
|
+
var _templateObject$2J;
|
|
14510
16790
|
function Order$1() {
|
|
14511
16791
|
var _orderResources$data;
|
|
14512
16792
|
var _useOrderProductsReso = useOrderProductsResources(),
|
|
@@ -14519,9 +16799,9 @@ function Order$1() {
|
|
|
14519
16799
|
data: data
|
|
14520
16800
|
})));
|
|
14521
16801
|
}
|
|
14522
|
-
var Table$2 = /*#__PURE__*/styled.div(_templateObject$
|
|
16802
|
+
var Table$2 = /*#__PURE__*/styled.div(_templateObject$2J || (_templateObject$2J = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n width: 100%;\n"])));
|
|
14523
16803
|
|
|
14524
|
-
var _templateObject$
|
|
16804
|
+
var _templateObject$2K, _templateObject2$1_, _templateObject3$1a, _templateObject4$E;
|
|
14525
16805
|
function OrderView() {
|
|
14526
16806
|
notification.config({
|
|
14527
16807
|
top: 150
|
|
@@ -14573,6 +16853,8 @@ function OrderView() {
|
|
|
14573
16853
|
getResources = _useAtom[0];
|
|
14574
16854
|
var _usegetClientData = usegetClientData(),
|
|
14575
16855
|
setClientData = _usegetClientData[1];
|
|
16856
|
+
var _useGlobalEscData = useGlobalEscData(),
|
|
16857
|
+
setGlobalEscData = _useGlobalEscData[1];
|
|
14576
16858
|
useEffect(function () {
|
|
14577
16859
|
setStatusVal(orderDetails == null ? void 0 : orderDetails.status_value);
|
|
14578
16860
|
}, [orderDetails == null ? void 0 : orderDetails.status_value]);
|
|
@@ -14728,6 +17010,7 @@ function OrderView() {
|
|
|
14728
17010
|
useEffect(function () {
|
|
14729
17011
|
if (orderId) {
|
|
14730
17012
|
callCLientApi();
|
|
17013
|
+
callEscalationApi();
|
|
14731
17014
|
}
|
|
14732
17015
|
}, [orderId]);
|
|
14733
17016
|
useEffect(function () {
|
|
@@ -14874,15 +17157,33 @@ function OrderView() {
|
|
|
14874
17157
|
setSubContracterData(formattedData);
|
|
14875
17158
|
}
|
|
14876
17159
|
}, [fetchedSubcontractotData, fetchedSubcontractotData, apiLoading]);
|
|
14877
|
-
|
|
17160
|
+
// ESCALATIONS API
|
|
17161
|
+
var _useAxios3 = useAxios({
|
|
17162
|
+
endpoint: "/orders/escalations/" + orderId,
|
|
17163
|
+
method: 'GET'
|
|
17164
|
+
}),
|
|
17165
|
+
fetchedEscalationData = _useAxios3.data,
|
|
17166
|
+
callEscalationApi = _useAxios3.fetchData,
|
|
17167
|
+
escalationDataLoading = _useAxios3.loading;
|
|
17168
|
+
useEffect(function () {
|
|
17169
|
+
if (fetchedEscalationData != null && fetchedEscalationData.data) {
|
|
17170
|
+
var escalationData = fetchedEscalationData == null ? void 0 : fetchedEscalationData.data;
|
|
17171
|
+
var sortedEscData = escalationData == null ? void 0 : escalationData.sort(function (a, b) {
|
|
17172
|
+
return new Date(b == null ? void 0 : b.created_at).getTime() - new Date(a == null ? void 0 : a.created_at).getTime();
|
|
17173
|
+
});
|
|
17174
|
+
var showEsc = sortedEscData != null && sortedEscData.length > 0;
|
|
17175
|
+
showEsc ? setGlobalEscData(sortedEscData) : setGlobalEscData([]);
|
|
17176
|
+
}
|
|
17177
|
+
}, [escalationDataLoading]);
|
|
17178
|
+
return React.createElement(MainContainer$e, null, React.createElement(GeneralHeader, null), React.createElement(DetailsFilters, null), React.createElement(Notification, null), React.createElement(OrderDetails$1, null), React.createElement(ProductsInfo, null), React.createElement(SplitLayout$1, null, React.createElement(NotesContainer, null, React.createElement(Notes, null)), React.createElement(TablesContainer, null, React.createElement(Order$1, null), React.createElement(SystemLogs, null))), React.createElement(OrderActions, null));
|
|
14878
17179
|
}
|
|
14879
|
-
var MainContainer$
|
|
14880
|
-
var SplitLayout$1 = /*#__PURE__*/styled.div(_templateObject2$
|
|
14881
|
-
var NotesContainer = /*#__PURE__*/styled.div(_templateObject3$
|
|
14882
|
-
var TablesContainer = /*#__PURE__*/styled.div(_templateObject4$
|
|
17180
|
+
var MainContainer$e = /*#__PURE__*/styled.div(_templateObject$2K || (_templateObject$2K = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding-bottom: 30px;\n"])));
|
|
17181
|
+
var SplitLayout$1 = /*#__PURE__*/styled.div(_templateObject2$1_ || (_templateObject2$1_ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 15px;\n @media (max-width: 1024px) {\n display: contents;\n }\n"])));
|
|
17182
|
+
var NotesContainer = /*#__PURE__*/styled.div(_templateObject3$1a || (_templateObject3$1a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n"])));
|
|
17183
|
+
var TablesContainer = /*#__PURE__*/styled.div(_templateObject4$E || (_templateObject4$E = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n flex: 1;\n display: flex;\n flex-direction: column;\n gap: 15px;\n"])));
|
|
14883
17184
|
|
|
14884
|
-
var _templateObject2$
|
|
14885
|
-
var StyledBulkItem$1 = /*#__PURE__*/styled.div(_templateObject2$
|
|
17185
|
+
var _templateObject2$1$;
|
|
17186
|
+
var StyledBulkItem$1 = /*#__PURE__*/styled.div(_templateObject2$1$ || (_templateObject2$1$ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 8px 12px;\n display: flex;\n align-items: center;\n /* border-right: 1px solid #d0d5dd; */\n gap: 8px;\n cursor: pointer;\n position: relative;\n\n @media screen and (max-width: 1030px) {\n padding: 8px 11px;\n }\n\n ul {\n margin: 0;\n padding: 0;\n list-style: none;\n box-sizing: border-box;\n top: 54px;\n }\n &:last-child {\n border-right: none;\n }\n &.active svg.arrowDown {\n transform: rotate(180deg);\n }\n label {\n color: #6a7378;\n text-align: center;\n font-family: 'Open Sans';\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 18px;\n cursor: pointer;\n }\n\n &.noPadding {\n padding: 0;\n }\n"])));
|
|
14886
17187
|
|
|
14887
17188
|
var initialState$3 = {
|
|
14888
17189
|
'x-filters': [],
|
|
@@ -14951,7 +17252,7 @@ var overviewfiltersReducerAtom = /*#__PURE__*/atom(function (get) {
|
|
|
14951
17252
|
return set(filtersStateAtom$2, filterReducer$2(get(filtersStateAtom$2), action));
|
|
14952
17253
|
});
|
|
14953
17254
|
|
|
14954
|
-
var _templateObject$
|
|
17255
|
+
var _templateObject$2L, _templateObject2$20, _templateObject3$1b;
|
|
14955
17256
|
var _excluded$8 = ["count"];
|
|
14956
17257
|
var SearchType = function SearchType() {
|
|
14957
17258
|
var _useState = useState(''),
|
|
@@ -15048,9 +17349,9 @@ var SearchType = function SearchType() {
|
|
|
15048
17349
|
onClick: handleClear
|
|
15049
17350
|
}, React.createElement(CrossIcon, null)));
|
|
15050
17351
|
};
|
|
15051
|
-
var Search = /*#__PURE__*/styled.div(_templateObject$
|
|
15052
|
-
var ClearButton = /*#__PURE__*/styled.button(_templateObject2$
|
|
15053
|
-
var SearchInput = /*#__PURE__*/styled.input(_templateObject3$
|
|
17352
|
+
var Search = /*#__PURE__*/styled.div(_templateObject$2L || (_templateObject$2L = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n svg {\n position: absolute;\n left: 12px;\n top: 50%;\n transform: translateY(-50%);\n }\n .clear {\n position: absolute;\n right: 32px;\n top: 50%;\n transform: translateY(-50%);\n }\n"])));
|
|
17353
|
+
var ClearButton = /*#__PURE__*/styled.button(_templateObject2$20 || (_templateObject2$20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: none;\n color: rgba(0, 0, 0, 0.25);\n cursor: pointer;\n padding: 0 8px;\n font-size: 14px;\n background: transparent;\n &:hover {\n color: #000;\n }\n"])));
|
|
17354
|
+
var SearchInput = /*#__PURE__*/styled.input(_templateObject3$1b || (_templateObject3$1b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-radius: 20px;\n border: 1px solid #e0e2e7;\n background: #fff;\n box-shadow: 0px 1px 2px rgba(16, 24, 40, 0.05);\n display: flex;\n padding: 8.5px 12px;\n padding-left: 39px;\n width: 100%;\n &:focus {\n outline: none;\n border-color: gray;\n }\n"])));
|
|
15054
17355
|
|
|
15055
17356
|
var BulkFilter = function BulkFilter() {
|
|
15056
17357
|
// const [printToogle, setPrintToggle] = useMenuDropDown();
|
|
@@ -15284,7 +17585,7 @@ var ReturnTable$1 = function ReturnTable() {
|
|
|
15284
17585
|
})))));
|
|
15285
17586
|
};
|
|
15286
17587
|
|
|
15287
|
-
var _templateObject$
|
|
17588
|
+
var _templateObject$2M, _templateObject2$21, _templateObject3$1c;
|
|
15288
17589
|
var _excluded$9 = ["count"];
|
|
15289
17590
|
function ReturnMainTable() {
|
|
15290
17591
|
var _useAtom = useAtom(overviewfiltersReducerAtom),
|
|
@@ -15370,7 +17671,7 @@ function ReturnMainTable() {
|
|
|
15370
17671
|
className: " " + (isScrolled ? 'stickyTableHead' : '')
|
|
15371
17672
|
}, React.createElement("div", {
|
|
15372
17673
|
className: "Tableconatiner"
|
|
15373
|
-
}, React.createElement(HeaderFilter, null), React.createElement(Container$
|
|
17674
|
+
}, React.createElement(HeaderFilter, null), React.createElement(Container$1o, null, React.createElement(Row$c, null, React.createElement(Text, null, "Client Return"), customerId ? React.createElement(ReturnFilter, null) : React.createElement(Filters, null)), React.createElement(ReturnTable$1, null)), total > 0 && React.createElement(Pagination, {
|
|
15374
17675
|
currentPage: page,
|
|
15375
17676
|
totalItems: total,
|
|
15376
17677
|
itemsPerPage: itemsPerPage,
|
|
@@ -15378,9 +17679,9 @@ function ReturnMainTable() {
|
|
|
15378
17679
|
onItemsPerPageChange: handleItemsPerPageChange
|
|
15379
17680
|
}))));
|
|
15380
17681
|
}
|
|
15381
|
-
var Row$c = /*#__PURE__*/styled.div(_templateObject$
|
|
15382
|
-
var Container$
|
|
15383
|
-
var DashBoardWrapper$3 = /*#__PURE__*/styled.section(_templateObject3$
|
|
17682
|
+
var Row$c = /*#__PURE__*/styled.div(_templateObject$2M || (_templateObject$2M = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
17683
|
+
var Container$1o = /*#__PURE__*/styled.div(_templateObject2$21 || (_templateObject2$21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
|
|
17684
|
+
var DashBoardWrapper$3 = /*#__PURE__*/styled.section(_templateObject3$1c || (_templateObject3$1c = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .Tableconatiner {\n border-radius: 12px;\n background: #fff;\n box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1);\n display: block;\n padding: 15px 20px;\n }\n .headerWrap,\n .tableData,\n .styleCovered {\n transition: all ease 0.5s;\n }\n &.stickyTableHead {\n h2 {\n font-size: 21px;\n }\n .headerWrap {\n height: 84px;\n padding: 10px;\n border-radius: 0px 0px 15px 15px;\n > div {\n position: relative;\n z-index: 10;\n }\n }\n .styleCovered {\n margin-top: -32px;\n width: 67%;\n float: right;\n gap: 5px;\n padding-right: 11px;\n\n li {\n padding: 4px 10px 5px 5px;\n gap: 5px;\n .svgCover {\n width: 30px;\n height: 30px;\n svg {\n height: auto;\n width: 58%;\n }\n }\n .countDigit {\n font-size: 19px;\n }\n }\n .countMess {\n font-size: 13px;\n }\n }\n .dmsBulkFilter {\n min-height: unset;\n gap: 4px;\n > div {\n padding: 4px 12px;\n label {\n font-size: 11px;\n }\n }\n }\n\n .StyledFilterList {\n gap: 4px;\n li {\n height: 29px;\n padding: 3px 8px;\n gap: 4px;\n .StyledFilterBtnIcon {\n width: 20px;\n height: 20px;\n svh {\n width: 10px;\n height: auto;\n }\n }\n .StyledFilterBtnLabel {\n font-size: 13px;\n }\n }\n }\n .StyledFilterLabel {\n padding-left: 10px;\n span {\n font-size: 13px;\n }\n }\n .cardcontainer.tableData {\n max-height: calc(100vh - 310px);\n min-height: calc(100vh - 310px);\n }\n\n .tableData {\n max-height: calc(100vh - 320px);\n min-height: calc(100vh - 320px);\n\n margin-top: 8px;\n thead {\n position: sticky;\n top: 0;\n z-index: 9;\n th {\n font-size: 13px;\n padding: 2px 15px;\n }\n }\n }\n }\n"])));
|
|
15384
17685
|
|
|
15385
17686
|
var OrderViewQueryHandler = function OrderViewQueryHandler() {
|
|
15386
17687
|
var _useSearchParams = useSearchParams(),
|
|
@@ -15390,22 +17691,22 @@ var OrderViewQueryHandler = function OrderViewQueryHandler() {
|
|
|
15390
17691
|
return orderId ? React.createElement(OrderView, null) : React.createElement(ReturnMainTable, null);
|
|
15391
17692
|
};
|
|
15392
17693
|
|
|
15393
|
-
var _templateObject$
|
|
15394
|
-
var HeaderWrapper = /*#__PURE__*/styled.div(_templateObject$
|
|
15395
|
-
var StyledFlex = /*#__PURE__*/styled.div(_templateObject2$
|
|
17694
|
+
var _templateObject$2N, _templateObject2$22;
|
|
17695
|
+
var HeaderWrapper = /*#__PURE__*/styled.div(_templateObject$2N || (_templateObject$2N = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 20px;\n gap: 10px;\n border-radius: 0px 0px 30px 30px;\n background: #313130;\n height: 151px;\n background: url(./assets/bgBlack.png) no-repeat;\n background-size: cover;\n background-color: #000000d9;\n"])));
|
|
17696
|
+
var StyledFlex = /*#__PURE__*/styled.div(_templateObject2$22 || (_templateObject2$22 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n"])));
|
|
15396
17697
|
|
|
15397
|
-
var _templateObject$
|
|
17698
|
+
var _templateObject$2O;
|
|
15398
17699
|
var HeaderTitle = function HeaderTitle(props) {
|
|
15399
|
-
return React.createElement(React.Fragment, null, React.createElement(Title$
|
|
17700
|
+
return React.createElement(React.Fragment, null, React.createElement(Title$9, null, props.title));
|
|
15400
17701
|
};
|
|
15401
|
-
var Title$
|
|
17702
|
+
var Title$9 = /*#__PURE__*/styled.h2(_templateObject$2O || (_templateObject$2O = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0px;\n padding: 0px;\n color: #fff;\n font-size: 26px;\n font-style: normal;\n font-weight: 700;\n line-height: 36px;\n text-transform: uppercase;\n margin-bottom: 8px;\n"])));
|
|
15402
17703
|
|
|
15403
|
-
var _templateObject$
|
|
17704
|
+
var _templateObject$2P, _templateObject2$23;
|
|
15404
17705
|
function Breadcrumb(props) {
|
|
15405
17706
|
return React.createElement(BreadcrumbContainer, null, React.createElement(BreadcrumbList, null, props.title || ''), React.createElement(BreadcrumbList, null, props.subtitle || ''), props.subPart && React.createElement(React.Fragment, null, React.createElement(BreadcrumbList, null, props.subPart)));
|
|
15406
17707
|
}
|
|
15407
|
-
var BreadcrumbContainer = /*#__PURE__*/styled.div(_templateObject$
|
|
15408
|
-
var BreadcrumbList = /*#__PURE__*/styled.span(_templateObject2$
|
|
17708
|
+
var BreadcrumbContainer = /*#__PURE__*/styled.div(_templateObject$2P || (_templateObject$2P = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n"])));
|
|
17709
|
+
var BreadcrumbList = /*#__PURE__*/styled.span(_templateObject2$23 || (_templateObject2$23 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #edebe8;\n font-family: 'Open Sans', sans-serif;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n"])));
|
|
15409
17710
|
|
|
15410
17711
|
var javascriptStringDumpToJSON = function javascriptStringDumpToJSON(data) {
|
|
15411
17712
|
var d = data.replace(new RegExp("(?<=[a-zA-Z])'(?=[a-zA-Z ])", 'g'), '__');
|
|
@@ -15418,7 +17719,7 @@ var javascriptStringDumpToJSON = function javascriptStringDumpToJSON(data) {
|
|
|
15418
17719
|
return JSON.parse(d);
|
|
15419
17720
|
};
|
|
15420
17721
|
|
|
15421
|
-
var _templateObject$
|
|
17722
|
+
var _templateObject$2Q, _templateObject2$24, _templateObject3$1d;
|
|
15422
17723
|
function ReturnSearchBar() {
|
|
15423
17724
|
var _useState = useState(''),
|
|
15424
17725
|
searchText = _useState[0],
|
|
@@ -15635,12 +17936,12 @@ function ReturnSearchBar() {
|
|
|
15635
17936
|
onClick: handleClear
|
|
15636
17937
|
}, React.createElement(CrossIcon, null)) : null);
|
|
15637
17938
|
}
|
|
15638
|
-
var ClearButton$1 = /*#__PURE__*/styled.button(_templateObject$
|
|
15639
|
-
var Search$1 = /*#__PURE__*/styled.div(_templateObject2$
|
|
15640
|
-
var SearchInput$1 = /*#__PURE__*/styled.input(_templateObject3$
|
|
17939
|
+
var ClearButton$1 = /*#__PURE__*/styled.button(_templateObject$2Q || (_templateObject$2Q = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: none;\n background: none;\n position: relative;\n border: none;\n cursor: pointer;\n padding: 0 4px;\n font-size: 0;\n &:hover {\n color: #000;\n }\n"])));
|
|
17940
|
+
var Search$1 = /*#__PURE__*/styled.div(_templateObject2$24 || (_templateObject2$24 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 4px 12px;\n align-items: center;\n gap: 8px;\n align-self: stretch;\n border-radius: 20px;\n border: 1px solid var(--Neutral-Gray-Gray-100, #e0e2e7);\n background-color: var(--Flowkit-White, #fff);\n height: 35px;\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n"])));
|
|
17941
|
+
var SearchInput$1 = /*#__PURE__*/styled.input(_templateObject3$1d || (_templateObject3$1d = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: none;\n outline: none;\n flex-grow: 1;\n width: 100%;\n background: transparent;\n"])));
|
|
15641
17942
|
var ReturnSearchBar$1 = /*#__PURE__*/React.memo(ReturnSearchBar);
|
|
15642
17943
|
|
|
15643
|
-
var _templateObject$
|
|
17944
|
+
var _templateObject$2R, _templateObject2$25, _templateObject3$1e;
|
|
15644
17945
|
function ReturnAfterSearchBar() {
|
|
15645
17946
|
var _useState = useState(''),
|
|
15646
17947
|
searchText = _useState[0],
|
|
@@ -15817,12 +18118,12 @@ function ReturnAfterSearchBar() {
|
|
|
15817
18118
|
onClick: handleClear
|
|
15818
18119
|
}, React.createElement(CrossIcon, null)) : null);
|
|
15819
18120
|
}
|
|
15820
|
-
var ClearButton$2 = /*#__PURE__*/styled.button(_templateObject$
|
|
15821
|
-
var Search$2 = /*#__PURE__*/styled.div(_templateObject2$
|
|
15822
|
-
var SearchInput$2 = /*#__PURE__*/styled.input(_templateObject3$
|
|
18121
|
+
var ClearButton$2 = /*#__PURE__*/styled.button(_templateObject$2R || (_templateObject$2R = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: none;\n background: none;\n position: relative;\n border: none;\n cursor: pointer;\n padding: 0 4px;\n font-size: 0;\n &:hover {\n color: #000;\n }\n"])));
|
|
18122
|
+
var Search$2 = /*#__PURE__*/styled.div(_templateObject2$25 || (_templateObject2$25 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 4px 12px;\n align-items: center;\n gap: 8px;\n align-self: stretch;\n border-radius: 20px;\n border: 1px solid var(--Neutral-Gray-Gray-100, #e0e2e7);\n background-color: var(--Flowkit-White, #fff);\n height: 35px;\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n"])));
|
|
18123
|
+
var SearchInput$2 = /*#__PURE__*/styled.input(_templateObject3$1e || (_templateObject3$1e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border: none;\n outline: none;\n flex-grow: 1;\n width: 100%;\n background: transparent;\n"])));
|
|
15823
18124
|
var ReturnAfterSearchBar$1 = /*#__PURE__*/React.memo(ReturnAfterSearchBar);
|
|
15824
18125
|
|
|
15825
|
-
var _templateObject$
|
|
18126
|
+
var _templateObject$2S;
|
|
15826
18127
|
var RouterHeader = function RouterHeader(_ref) {
|
|
15827
18128
|
var _ref$breadcrumbTitle = _ref.breadcrumbTitle,
|
|
15828
18129
|
breadcrumbTitle = _ref$breadcrumbTitle === void 0 ? 'Clients >' : _ref$breadcrumbTitle,
|
|
@@ -15897,7 +18198,7 @@ var RouterHeader = function RouterHeader(_ref) {
|
|
|
15897
18198
|
}
|
|
15898
18199
|
}))));
|
|
15899
18200
|
};
|
|
15900
|
-
var DatePickerWrap$1 = /*#__PURE__*/styled.div(_templateObject$
|
|
18201
|
+
var DatePickerWrap$1 = /*#__PURE__*/styled.div(_templateObject$2S || (_templateObject$2S = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding-right: 10px;\n padding-left: 7px;\n justify-content: space-between;\n align-items: center;\n align-self: stretch;\n border-radius: 20px;\n border: 1px solid #e0e2e7;\n background: var(--Neutral-White, #fff);\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n min-width: 22vw;\n height: 35px;\n input[type='text'] {\n border-radius: 20px;\n background: var(--Flowkit-White, #fff);\n border: none;\n color: #6a7378;\n font-size: 13px;\n font-weight: 400;\n line-height: 18px;\n padding: 8px 0;\n padding-left: 10px;\n &:focus-visible {\n outline: none;\n }\n }\n\n .ant-picker-outlined {\n border-style: none !important;\n }\n\n .ant-picker-focused {\n box-shadow: none;\n }\n\n /* .ant-picker {\n .ant-picker-input {\n width: 150px;\n }\n } */\n .ant-btn {\n background-color: #3348ff !important;\n }\n"])));
|
|
15901
18202
|
|
|
15902
18203
|
var _excluded$a = ["count"];
|
|
15903
18204
|
var OutstandingTable = function OutstandingTable() {
|
|
@@ -16533,7 +18834,7 @@ var ReturnConfirmedTable = function ReturnConfirmedTable() {
|
|
|
16533
18834
|
})))));
|
|
16534
18835
|
};
|
|
16535
18836
|
|
|
16536
|
-
var _templateObject$
|
|
18837
|
+
var _templateObject$2T, _templateObject2$26;
|
|
16537
18838
|
var _excluded$b = ["count"];
|
|
16538
18839
|
var ConfirmedMain = function ConfirmedMain() {
|
|
16539
18840
|
var _useReturnConfirmedOr = useReturnConfirmedOrderData(),
|
|
@@ -16603,7 +18904,7 @@ var ConfirmedMain = function ConfirmedMain() {
|
|
|
16603
18904
|
}, [fetchedReturnOrderData, loading]);
|
|
16604
18905
|
return React.createElement("div", null, React.createElement(DashBoardWrapper$4, null, React.createElement("div", {
|
|
16605
18906
|
className: "Tableconatiner"
|
|
16606
|
-
}, React.createElement(Container$
|
|
18907
|
+
}, React.createElement(Container$1p, null, React.createElement(ReturnConfirmedTable, null), total > 0 && React.createElement(ReturnPagination, {
|
|
16607
18908
|
currentPage: page,
|
|
16608
18909
|
totalItems: total,
|
|
16609
18910
|
itemsPerPage: itemsPerPage,
|
|
@@ -16611,10 +18912,10 @@ var ConfirmedMain = function ConfirmedMain() {
|
|
|
16611
18912
|
onItemsPerPageChange: handleItemsPerPageChange
|
|
16612
18913
|
})))));
|
|
16613
18914
|
};
|
|
16614
|
-
var Container$
|
|
16615
|
-
var DashBoardWrapper$4 = /*#__PURE__*/styled.section(_templateObject2$
|
|
18915
|
+
var Container$1p = /*#__PURE__*/styled.div(_templateObject$2T || (_templateObject$2T = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n /* top: -30px; */\n"])));
|
|
18916
|
+
var DashBoardWrapper$4 = /*#__PURE__*/styled.section(_templateObject2$26 || (_templateObject2$26 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .Tableconatiner {\n border-radius: 12px;\n background: #fff;\n box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1);\n display: block;\n padding: 15px 20px;\n }\n .headerWrap,\n .tableData,\n .styleCovered {\n transition: all ease 0.5s;\n }\n &.stickyTableHead {\n h2 {\n font-size: 21px;\n }\n .headerWrap {\n height: 84px;\n padding: 10px;\n border-radius: 0px 0px 15px 15px;\n > div {\n position: relative;\n z-index: 10;\n }\n }\n .styleCovered {\n margin-top: -32px;\n width: 67%;\n float: right;\n gap: 5px;\n padding-right: 11px;\n\n li {\n padding: 4px 10px 5px 5px;\n gap: 5px;\n .svgCover {\n width: 30px;\n height: 30px;\n svg {\n height: auto;\n width: 58%;\n }\n }\n .countDigit {\n font-size: 19px;\n }\n }\n .countMess {\n font-size: 13px;\n }\n }\n .dmsBulkFilter {\n min-height: unset;\n gap: 4px;\n > div {\n padding: 4px 12px;\n label {\n font-size: 11px;\n }\n }\n }\n\n .StyledFilterList {\n gap: 4px;\n li {\n height: 29px;\n padding: 3px 8px;\n gap: 4px;\n .StyledFilterBtnIcon {\n width: 20px;\n height: 20px;\n svh {\n width: 10px;\n height: auto;\n }\n }\n .StyledFilterBtnLabel {\n font-size: 13px;\n }\n }\n }\n .StyledFilterLabel {\n padding-left: 10px;\n span {\n font-size: 13px;\n }\n }\n .cardcontainer.tableData {\n max-height: calc(100vh - 310px);\n min-height: calc(100vh - 310px);\n }\n\n .tableData {\n max-height: calc(100vh - 320px);\n min-height: calc(100vh - 320px);\n\n margin-top: 8px;\n thead {\n position: sticky;\n top: 0;\n z-index: 9;\n th {\n font-size: 13px;\n padding: 2px 15px;\n }\n }\n }\n }\n"])));
|
|
16616
18917
|
|
|
16617
|
-
var _templateObject$
|
|
18918
|
+
var _templateObject$2U, _templateObject2$27;
|
|
16618
18919
|
var ReturnOverview = function ReturnOverview() {
|
|
16619
18920
|
var _UsePaginationData = UsePaginationData(),
|
|
16620
18921
|
paginationObj = _UsePaginationData[0];
|
|
@@ -16639,7 +18940,7 @@ var ReturnOverview = function ReturnOverview() {
|
|
|
16639
18940
|
var shouldShowReturnAfterTable = clientPortal && status === 'scheduled_for_return' || clientPortal && status === 'return_completed';
|
|
16640
18941
|
return React.createElement(React.Fragment, null, React.createElement(RouterHeader, null), React.createElement("div", null, React.createElement(DashBoardWrapper$5, null, React.createElement("div", {
|
|
16641
18942
|
className: "Tableconatiner"
|
|
16642
|
-
}, React.createElement(HeaderFilter, null), React.createElement(Container$
|
|
18943
|
+
}, React.createElement(HeaderFilter, null), React.createElement(Container$1q, null, React.createElement(ReturnFilter, null), clientPortal && status === 'outstanding_return' && React.createElement(React.Fragment, null, React.createElement(OutstandingTable, null), total > 0 && React.createElement(Pagination, {
|
|
16643
18944
|
currentPage: page,
|
|
16644
18945
|
totalItems: total,
|
|
16645
18946
|
itemsPerPage: itemsPerPage,
|
|
@@ -16647,8 +18948,8 @@ var ReturnOverview = function ReturnOverview() {
|
|
|
16647
18948
|
onItemsPerPageChange: handleItemsPerPageChange
|
|
16648
18949
|
})), shouldShowReturnAfterTable && React.createElement(React.Fragment, null, React.createElement(ConfirmedMain, null)))))));
|
|
16649
18950
|
};
|
|
16650
|
-
var Container$
|
|
16651
|
-
var DashBoardWrapper$5 = /*#__PURE__*/styled.section(_templateObject2$
|
|
18951
|
+
var Container$1q = /*#__PURE__*/styled.div(_templateObject$2U || (_templateObject$2U = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -16px;\n"])));
|
|
18952
|
+
var DashBoardWrapper$5 = /*#__PURE__*/styled.section(_templateObject2$27 || (_templateObject2$27 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .Tableconatiner {\n border-radius: 12px;\n background: #fff;\n box-shadow: -2px 0px 12px 0px rgba(56, 71, 109, 0.1);\n display: block;\n padding: 15px 20px;\n }\n .headerWrap,\n .tableData,\n .styleCovered {\n transition: all ease 0.5s;\n }\n &.stickyTableHead {\n h2 {\n font-size: 21px;\n }\n .headerWrap {\n height: 84px;\n padding: 10px;\n border-radius: 0px 0px 15px 15px;\n > div {\n position: relative;\n z-index: 10;\n }\n }\n .styleCovered {\n margin-top: -32px;\n width: 67%;\n float: right;\n gap: 5px;\n padding-right: 11px;\n\n li {\n padding: 4px 10px 5px 5px;\n gap: 5px;\n .svgCover {\n width: 30px;\n height: 30px;\n svg {\n height: auto;\n width: 58%;\n }\n }\n .countDigit {\n font-size: 19px;\n }\n }\n .countMess {\n font-size: 13px;\n }\n }\n .dmsBulkFilter {\n min-height: unset;\n gap: 4px;\n > div {\n padding: 4px 12px;\n label {\n font-size: 11px;\n }\n }\n }\n\n .StyledFilterList {\n gap: 4px;\n li {\n height: 29px;\n padding: 3px 8px;\n gap: 4px;\n .StyledFilterBtnIcon {\n width: 20px;\n height: 20px;\n svh {\n width: 10px;\n height: auto;\n }\n }\n .StyledFilterBtnLabel {\n font-size: 13px;\n }\n }\n }\n .StyledFilterLabel {\n padding-left: 10px;\n span {\n font-size: 13px;\n }\n }\n .cardcontainer.tableData {\n max-height: calc(100vh - 310px);\n min-height: calc(100vh - 310px);\n }\n\n .tableData {\n max-height: calc(100vh - 320px);\n min-height: calc(100vh - 320px);\n\n margin-top: 8px;\n thead {\n position: sticky;\n top: 0;\n z-index: 9;\n th {\n font-size: 13px;\n padding: 2px 15px;\n }\n }\n }\n }\n"])));
|
|
16652
18953
|
|
|
16653
18954
|
function ReturnClient() {
|
|
16654
18955
|
notification.config({
|