@bjsdistribution/dms-client-return 0.0.8 → 0.0.10
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-daily-overview/return-after-table/table-filters/ReturnFilterStore.d.ts +16 -0
- package/dist/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.d.ts +1 -0
- package/dist/components/store.d.ts +12 -2
- package/dist/components/types.d.ts +7 -0
- package/dist/dms-client-return.cjs.development.js +698 -431
- 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 +700 -433
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/common/custom-switch/index.tsx +12 -4
- package/src/components/order-daily-overview/filters/FilterStyle.tsx +2 -13
- package/src/components/order-daily-overview/filters/Filters.tsx +7 -1
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +1 -1
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +46 -1
- package/src/components/order-daily-overview/return-after-table/ReturnAfterTable.tsx +6 -5
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +130 -0
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +143 -63
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +3 -2
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +123 -14
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +1 -1
- package/src/components/order-daily-overview/table/ReturnTable.tsx +12 -0
- package/src/components/order-view/hooks/useGetEventNotes.tsx +15 -2
- package/src/components/order-view/hooks/useGetSystemLogs.tsx +14 -2
- package/src/components/order-view/hooks/useUpdateOrder.ts +13 -2
- package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +14 -17
- package/src/components/order-view/modalsPopup/ModalManager.tsx +90 -62
- package/src/components/order-view/notes/AddNote.tsx +7 -2
- package/src/components/order-view/order-actions/actions/change-customer-account/ChangeCustomerAccModal.tsx +6 -2
- package/src/components/order-view/order-actions/actions/escalation/Dropdowns.tsx +5 -0
- package/src/components/order-view/order-actions/actions/escalation/upgrade/index.tsx +7 -1
- package/src/components/order-view/order-actions/hooks/useAllReminderData.ts +13 -2
- package/src/components/order-view/order-actions/hooks/useAllTaskData.ts +15 -5
- package/src/components/order-view/order-actions/hooks/useCreateReminder.ts +20 -4
- package/src/components/order-view/order-actions/hooks/useCreateTask.ts +14 -3
- package/src/components/order-view/order-actions/hooks/useFetchSingleFlagData.ts +15 -3
- package/src/components/order-view/order-actions/hooks/useFetchSingleReminder.ts +13 -2
- package/src/components/order-view/order-actions/hooks/useUpdateFlag.ts +12 -2
- package/src/components/order-view/order-actions/hooks/useUpdateReminder.ts +12 -2
- package/src/components/order-view/products-info/expanded-content/index.tsx +6 -1
- package/src/components/order-view/return-client-products/product-table-footer/ProductDetailsFooter.tsx +6 -1
- package/src/components/order-view/system-event-logs/expanded-content/index.tsx +7 -1
- package/src/components/order-view/view-reminder/AssigneeDropdown.tsx +6 -1
- package/src/components/store.ts +30 -1
- package/src/components/types.ts +8 -0
- package/src/index.tsx +19 -9
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useState, useMemo, useRef, Suspense } from 'react';
|
|
2
|
-
import { useLocation, useParams, NavLink, useNavigate, Routes, Route
|
|
2
|
+
import { useLocation, useParams, NavLink, useNavigate, Routes, Route } from 'react-router-dom';
|
|
3
3
|
import styled, { css, keyframes } from 'styled-components';
|
|
4
4
|
import { Label as Label$h, Input as Input$1, TextArea, FormSection, displayValueOrNA, SelectDropdown, dropdownStyles, RadioButtonGroup as RadioButtonGroup$1, Switch, Button as Button$1, useApiHook, getBaseEndpoint, formatDateTime, Alert, Checkbox as Checkbox$1, SectionHeader, CrossIcon, AntSelect, AntTable, CustomRating, DeleteIcon, CancelationModal, CancelAndCompleteAction, filterDropdownStyles, BackgroundModal as BackgroundModal$1, AntModal } from '@bjsdistribution/dms-component-library';
|
|
5
5
|
import { useAtom, atom } from 'jotai';
|
|
6
6
|
import { atomWithReducer } from 'jotai/utils';
|
|
7
|
-
import { DatePicker, notification, Skeleton, Upload, message, Input as Input$2, Select, Empty, Checkbox as Checkbox$2, Tabs } from 'antd';
|
|
7
|
+
import { DatePicker, notification, Skeleton, Upload, message, Input as Input$2, Select, Empty, Checkbox as Checkbox$2, Tabs, Tooltip } from 'antd';
|
|
8
8
|
import dayjs from 'dayjs';
|
|
9
9
|
import { useReactTable, getCoreRowModel, getSortedRowModel, flexRender } from '@tanstack/react-table';
|
|
10
10
|
import Scrollbars from 'react-custom-scrollbars-2';
|
|
@@ -2330,14 +2330,18 @@ function AddNote() {
|
|
|
2330
2330
|
description: error || 'Something went wrong. Please try again.'
|
|
2331
2331
|
});
|
|
2332
2332
|
}
|
|
2333
|
-
_context.next =
|
|
2333
|
+
_context.next = 17;
|
|
2334
2334
|
break;
|
|
2335
2335
|
case 14:
|
|
2336
2336
|
_context.prev = 14;
|
|
2337
2337
|
_context.t0 = _context["catch"](6);
|
|
2338
|
-
console.error('Error saving note:',
|
|
2339
|
-
alert('Failed to save note');
|
|
2340
|
-
|
|
2338
|
+
// console.error('Error saving note:', error);
|
|
2339
|
+
// alert('Failed to save note');
|
|
2340
|
+
notification.error({
|
|
2341
|
+
message: 'Error',
|
|
2342
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
2343
|
+
});
|
|
2344
|
+
case 17:
|
|
2341
2345
|
case "end":
|
|
2342
2346
|
return _context.stop();
|
|
2343
2347
|
}
|
|
@@ -2819,8 +2823,11 @@ function useGetEventNotes() {
|
|
|
2819
2823
|
case 9:
|
|
2820
2824
|
_json = _context.sent;
|
|
2821
2825
|
detail = _json == null ? void 0 : _json.detail;
|
|
2822
|
-
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
|
|
2823
|
-
|
|
2826
|
+
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
|
|
2827
|
+
notification.error({
|
|
2828
|
+
message: 'Error',
|
|
2829
|
+
description: "" + msg || 'An error has occurred. Please try again later.'
|
|
2830
|
+
});
|
|
2824
2831
|
// setLoading(false);
|
|
2825
2832
|
return _context.abrupt("return", []);
|
|
2826
2833
|
case 14:
|
|
@@ -2838,7 +2845,11 @@ function useGetEventNotes() {
|
|
|
2838
2845
|
case 22:
|
|
2839
2846
|
_context.prev = 22;
|
|
2840
2847
|
_context.t0 = _context["catch"](1);
|
|
2841
|
-
console.error('Error fetching data:',
|
|
2848
|
+
// console.error('Error fetching data:', err);
|
|
2849
|
+
notification.error({
|
|
2850
|
+
message: 'Error',
|
|
2851
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
2852
|
+
});
|
|
2842
2853
|
return _context.abrupt("return", []);
|
|
2843
2854
|
case 26:
|
|
2844
2855
|
_context.prev = 26;
|
|
@@ -2885,7 +2896,11 @@ function SystemLogs() {
|
|
|
2885
2896
|
case 7:
|
|
2886
2897
|
_context.prev = 7;
|
|
2887
2898
|
_context.t0 = _context["catch"](0);
|
|
2888
|
-
console.error('Error fetching event notes:',
|
|
2899
|
+
// console.error('Error fetching event notes:', error);
|
|
2900
|
+
notification.error({
|
|
2901
|
+
message: 'Error',
|
|
2902
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
2903
|
+
});
|
|
2889
2904
|
case 10:
|
|
2890
2905
|
case "end":
|
|
2891
2906
|
return _context.stop();
|
|
@@ -3130,7 +3145,7 @@ var Section = /*#__PURE__*/styled.div(_templateObject$V || (_templateObject$V =
|
|
|
3130
3145
|
var _templateObject19, _templateObject20, _templateObject21;
|
|
3131
3146
|
var StyledTable = /*#__PURE__*/styled.table(_templateObject19 || (_templateObject19 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-spacing: 0 10px;\n width: 100%;\n /* min-width: 1600px; */\n thead {\n white-space: nowrap;\n tr {\n border-radius: 40px;\n border-spacing: 0 10px;\n .emailInvoiceCheckbox {\n padding-right: 0px;\n width: 0;\n > div {\n width: fit-content;\n }\n }\n .emailInvoiceNo {\n padding-left: 0px;\n }\n .emailInvoiceShare {\n width: 100px;\n }\n th {\n color: #3a3630;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n padding: 11px 15px;\n background: #f0f2f2;\n border-right: none;\n border-left: none;\n text-align: left;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-width: 1px 0;\n &:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n &:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n }\n }\n }\n tbody {\n tr {\n td {\n color: #3a3630;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n padding: 12px 15px;\n background: #fff;\n border: 1px solid rgba(0, 0, 0, 0.08);\n border-right: none;\n border-left: none;\n .actionbox {\n display: flex;\n gap: 5px;\n }\n .shareIconContainer {\n display: flex;\n padding: 2px 12px;\n align-items: center;\n gap: 8px;\n border-radius: 20px;\n border: 1px solid var(--tonal-brown-101, #e2e0db);\n background: #fff;\n list-style-type: none;\n /* padding-left: 0; */\n /* fontWeight: 600,\n paddingLeft: 0, */\n cursor: pointer;\n position: relative;\n }\n .statusCancelled {\n color: #e95252;\n /* background: rgba(233, 82, 82, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusOnHold {\n color: #f4a503;\n /* background: #fff1d6; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusSubContracted {\n color: #845adf;\n /* background: rgba(132, 90, 223, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusAwaiting {\n color: #845adf;\n /* background: rgba(132, 90, 223, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusCompleted {\n color: #1f9254;\n /* background: rgba(41, 204, 106, 0.15); */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusOutstanding {\n color: #f4a503;\n /* background: #fff1d6; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n\n .statusUnknown {\n color: #000;\n /* background: #fff; */\n padding: 4px 8px;\n border-radius: 4px;\n }\n .statustext {\n color: #1f9254;\n font-family: 'Open Sans';\n font-size: 12px;\n font-style: normal;\n font-weight: 600;\n line-height: normal;\n }\n .downloadcontainer {\n display: flex;\n padding: 2px 12px;\n align-items: center;\n\n width: 28px;\n height: 28px;\n flex-direction: column;\n\n border-radius: 14px;\n border: 1px solid #e2e0db;\n background: #fff;\n }\n .statuscontainer {\n display: flex;\n padding: 5px 30px 5px 30px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n flex: 1 0 0;\n border-radius: 22px;\n background: rgba(41, 204, 106, 0.15);\n }\n ul > li > a {\n text-decoration: none !important;\n color: #0099ff;\n }\n }\n &:nth-child(even) td {\n background: #f6fbff;\n }\n td:first-child {\n border-radius: 100px 0 0 100px;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n }\n td:last-child {\n border-radius: 0px 100px 100px 0;\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n }\n .flex {\n display: flex;\n flex-direction: row;\n gap: 5px;\n height: 29px;\n align-items: center;\n }\n\n &.insideTable {\n td {\n border-radius: 0;\n border: none;\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n table {\n border-spacing: 0;\n width: 100%;\n border-radius: 5px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n overflow: hidden;\n border-top-left-radius: 15px;\n border-top-right-radius: 15px;\n thead {\n tr {\n border-bottom: none;\n th {\n padding: 14px 20px;\n text-align: left;\n border-top: 0;\n border-right: 0;\n border-left: 0;\n background: #f8fafc;\n\n &:first-child {\n border-radius: 0;\n border-left: 1px solid rgba(0, 0, 0, 0.08);\n border-top-left-radius: 15px;\n }\n &:last-child {\n border-radius: 0;\n }\n }\n }\n }\n tbody {\n tr {\n td {\n padding: 14px 20px;\n text-align: left;\n border-bottom: 1px solid rgba(58, 54, 48, 0.15);\n background: #fff;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n &:last-child {\n border-radius: 0;\n border-right: none;\n }\n }\n }\n }\n }\n }\n }\n }\n .actions {\n display: flex;\n align-items: center;\n gap: 20px;\n > svg {\n transform: scale(1.5);\n background-color: #edebe8;\n border-radius: 20px;\n padding: 5px;\n }\n\n .close-icon {\n transform: scale(1.3);\n background-color: transparent;\n border-radius: 0;\n padding: 0;\n }\n }\n"])));
|
|
3132
3147
|
// Styled components
|
|
3133
|
-
var StyledTableWrapper = /*#__PURE__*/styled.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n overflow-x: auto;\n max-height: calc(100vh - 396px);\n scrollbar-width: none;\n height:
|
|
3148
|
+
var StyledTableWrapper = /*#__PURE__*/styled.div(_templateObject20 || (_templateObject20 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n overflow-x: auto;\n max-height: calc(100vh - 396px);\n scrollbar-width: none;\n height: 600px;\n /* box-shadow: 0px 0px 30px 6px rgba(46, 45, 116, 0.05); */\n &::-webkit-scrollbar {\n width: 5px;\n border-radius: 100px;\n height: 5px;\n }\n\n &::-webkit-scrollbar-track {\n background: #777;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #7b61ff;\n border-radius: 100px;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #7b61ff;\n }\n"])));
|
|
3134
3149
|
var CustomDrop = /*#__PURE__*/styled.div(_templateObject21 || (_templateObject21 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* border-radius: 20px;\n border: 1px solid #e2e0db;\n background: #fff;\n display: flex;\n padding: 4px 8px;\n gap: 8px;\n align-items: center; */\n cursor: pointer;\n &.active .drop {\n transform: rotate(180deg);\n }\n"])));
|
|
3135
3150
|
|
|
3136
3151
|
var ActionIcon = function ActionIcon() {
|
|
@@ -3150,9 +3165,19 @@ var ActionIcon = function ActionIcon() {
|
|
|
3150
3165
|
}));
|
|
3151
3166
|
};
|
|
3152
3167
|
|
|
3168
|
+
var CreateReturnInitial = {
|
|
3169
|
+
customer_id: 0,
|
|
3170
|
+
account_number: '',
|
|
3171
|
+
return_location_token: '',
|
|
3172
|
+
products: [],
|
|
3173
|
+
return_action: []
|
|
3174
|
+
};
|
|
3153
3175
|
var customerData = /*#__PURE__*/atom([]);
|
|
3154
3176
|
var actionTypeData = /*#__PURE__*/atom([]);
|
|
3155
3177
|
var locationData = /*#__PURE__*/atom([]);
|
|
3178
|
+
var createReturnPayload = /*#__PURE__*/atom(CreateReturnInitial);
|
|
3179
|
+
var newPayload = /*#__PURE__*/atom([]);
|
|
3180
|
+
var grpPayload = /*#__PURE__*/atom([]);
|
|
3156
3181
|
var selectedOrderlList = /*#__PURE__*/atom([]);
|
|
3157
3182
|
function useSelectedOrders() {
|
|
3158
3183
|
return useAtom(selectedOrderlList);
|
|
@@ -3171,6 +3196,15 @@ function useActionType() {
|
|
|
3171
3196
|
function useLocationData() {
|
|
3172
3197
|
return useAtom(locationData);
|
|
3173
3198
|
}
|
|
3199
|
+
function useReturnPayload() {
|
|
3200
|
+
return useAtom(createReturnPayload);
|
|
3201
|
+
}
|
|
3202
|
+
function useNewReturnPayload() {
|
|
3203
|
+
return useAtom(newPayload);
|
|
3204
|
+
}
|
|
3205
|
+
function useGroupedPayload() {
|
|
3206
|
+
return useAtom(grpPayload);
|
|
3207
|
+
}
|
|
3174
3208
|
|
|
3175
3209
|
var ReturnProductTable = function ReturnProductTable() {
|
|
3176
3210
|
var _useSelectedOrders = useSelectedOrders(),
|
|
@@ -3219,7 +3253,11 @@ var Container$B = /*#__PURE__*/styled.div(_templateObject$W || (_templateObject$
|
|
|
3219
3253
|
var _templateObject$X, _templateObject2$C, _templateObject3$k;
|
|
3220
3254
|
function ExpandedContent$2() {
|
|
3221
3255
|
var SaveNote = function SaveNote() {
|
|
3222
|
-
alert('saved');
|
|
3256
|
+
// alert('saved');
|
|
3257
|
+
notification.success({
|
|
3258
|
+
message: 'Success',
|
|
3259
|
+
description: ' Saved successfully.'
|
|
3260
|
+
});
|
|
3223
3261
|
};
|
|
3224
3262
|
return React.createElement(Container$C, null, React.createElement(ProductTable, null), React.createElement(MidConatiner, null, React.createElement(SaveNoteContainer$1, null, React.createElement(Button$1, {
|
|
3225
3263
|
style: {
|
|
@@ -4770,7 +4808,11 @@ function ChangeCustomerAccModal() {
|
|
|
4770
4808
|
setCurrentAction(undefined);
|
|
4771
4809
|
};
|
|
4772
4810
|
var handleSelectChange = function handleSelectChange() {
|
|
4773
|
-
alert('hello');
|
|
4811
|
+
// alert('hello');
|
|
4812
|
+
notification.success({
|
|
4813
|
+
message: 'Success',
|
|
4814
|
+
description: 'Saved successfully.'
|
|
4815
|
+
});
|
|
4774
4816
|
};
|
|
4775
4817
|
return React.createElement(OrderActionModal, {
|
|
4776
4818
|
headerTitle: "Change customer account",
|
|
@@ -4900,6 +4942,10 @@ var StyledAntSelect = /*#__PURE__*/styled(AntSelect)(_templateObject3$y || (_tem
|
|
|
4900
4942
|
var Dropdowns = function Dropdowns() {
|
|
4901
4943
|
var handleSelectChange = function handleSelectChange() {
|
|
4902
4944
|
// alert('hello');
|
|
4945
|
+
notification.success({
|
|
4946
|
+
message: 'Success',
|
|
4947
|
+
description: 'Saved successfully.'
|
|
4948
|
+
});
|
|
4903
4949
|
};
|
|
4904
4950
|
return React.createElement(FlexContainer, null, React.createElement(InnerCont, null, React.createElement(Label$h, {
|
|
4905
4951
|
label: "Escalation Category",
|
|
@@ -4973,7 +5019,11 @@ var Notes$2 = function Notes() {
|
|
|
4973
5019
|
var _templateObject$1w, _templateObject2$14, _templateObject3$z, _templateObject4$i, _templateObject5$a, _templateObject6$8, _templateObject7$7, _templateObject8$4, _templateObject9$2, _templateObject10$1;
|
|
4974
5020
|
var Upgrade = function Upgrade() {
|
|
4975
5021
|
var handleSelectChange = function handleSelectChange() {
|
|
4976
|
-
alert('hello');
|
|
5022
|
+
// alert('hello');
|
|
5023
|
+
notification.success({
|
|
5024
|
+
message: 'Success',
|
|
5025
|
+
description: 'Upgrade successfully.'
|
|
5026
|
+
});
|
|
4977
5027
|
};
|
|
4978
5028
|
return React.createElement(React.Fragment, null, React.createElement(Wrapper$g, null, React.createElement(Heading$2, null, "Upgrade"), React.createElement(Container$_, null, React.createElement(Top$3, null, React.createElement(InnerCont$1, null, React.createElement(Toggle, {
|
|
4979
5029
|
label: 'Timed Service',
|
|
@@ -5535,7 +5585,11 @@ var RestoreProducts = function RestoreProducts() {
|
|
|
5535
5585
|
var _templateObject$1B, _templateObject2$17;
|
|
5536
5586
|
function AssigneeDropdown() {
|
|
5537
5587
|
var handleSelectChange = function handleSelectChange() {
|
|
5538
|
-
alert('hello');
|
|
5588
|
+
// alert('hello');
|
|
5589
|
+
notification.success({
|
|
5590
|
+
message: 'Success',
|
|
5591
|
+
description: 'Order has been saved successfully.'
|
|
5592
|
+
});
|
|
5539
5593
|
};
|
|
5540
5594
|
return React.createElement(FormContainer$2, null, React.createElement(Label$h, {
|
|
5541
5595
|
label: "Assigned To",
|
|
@@ -5755,8 +5809,11 @@ function useFetchSingleReminderData() {
|
|
|
5755
5809
|
case 10:
|
|
5756
5810
|
_json = _context.sent;
|
|
5757
5811
|
detail = _json == null ? void 0 : _json.detail;
|
|
5758
|
-
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
|
|
5759
|
-
|
|
5812
|
+
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // alert(`${msg}`);
|
|
5813
|
+
notification.error({
|
|
5814
|
+
message: 'Error',
|
|
5815
|
+
description: "" + msg || 'An error has occurred. Please try again later.'
|
|
5816
|
+
});
|
|
5760
5817
|
setLoading(false);
|
|
5761
5818
|
return _context.abrupt("return", []);
|
|
5762
5819
|
case 16:
|
|
@@ -5776,7 +5833,11 @@ function useFetchSingleReminderData() {
|
|
|
5776
5833
|
_context.prev = 25;
|
|
5777
5834
|
_context.t0 = _context["catch"](2);
|
|
5778
5835
|
//setloading(false);
|
|
5779
|
-
console.error('Error fetching data:',
|
|
5836
|
+
// console.error('Error fetching data:', err);
|
|
5837
|
+
notification.error({
|
|
5838
|
+
message: 'Error',
|
|
5839
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
5840
|
+
});
|
|
5780
5841
|
return _context.abrupt("return", []);
|
|
5781
5842
|
case 29:
|
|
5782
5843
|
case "end":
|
|
@@ -5863,12 +5924,20 @@ function useUpdateReminder() {
|
|
|
5863
5924
|
return response.json();
|
|
5864
5925
|
case 11:
|
|
5865
5926
|
json = _context.sent;
|
|
5866
|
-
alert('Reminder has been updated');
|
|
5927
|
+
// alert('Reminder has been updated');
|
|
5928
|
+
notification.success({
|
|
5929
|
+
message: 'Success',
|
|
5930
|
+
description: 'Reminder has been updated'
|
|
5931
|
+
});
|
|
5867
5932
|
return _context.abrupt("return", json);
|
|
5868
5933
|
case 16:
|
|
5869
5934
|
_context.prev = 16;
|
|
5870
5935
|
_context.t0 = _context["catch"](2);
|
|
5871
|
-
console.error('Error:',
|
|
5936
|
+
// console.error('Error:', err);
|
|
5937
|
+
notification.error({
|
|
5938
|
+
message: 'Error',
|
|
5939
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
5940
|
+
});
|
|
5872
5941
|
case 19:
|
|
5873
5942
|
_context.prev = 19;
|
|
5874
5943
|
setLoading(false);
|
|
@@ -5932,8 +6001,11 @@ function useFetchReminders() {
|
|
|
5932
6001
|
case 9:
|
|
5933
6002
|
_json = _context.sent;
|
|
5934
6003
|
detail = _json == null ? void 0 : _json.detail;
|
|
5935
|
-
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
|
|
5936
|
-
|
|
6004
|
+
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
|
|
6005
|
+
notification.error({
|
|
6006
|
+
message: 'Error',
|
|
6007
|
+
description: "" + msg || 'An error has occurred. Please try again later.'
|
|
6008
|
+
});
|
|
5937
6009
|
// setLoading(false);
|
|
5938
6010
|
return _context.abrupt("return", []);
|
|
5939
6011
|
case 14:
|
|
@@ -5953,7 +6025,11 @@ function useFetchReminders() {
|
|
|
5953
6025
|
case 23:
|
|
5954
6026
|
_context.prev = 23;
|
|
5955
6027
|
_context.t0 = _context["catch"](1);
|
|
5956
|
-
console.error('Error fetching data:',
|
|
6028
|
+
// console.error('Error fetching data:', err);
|
|
6029
|
+
notification.error({
|
|
6030
|
+
message: 'Error',
|
|
6031
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
6032
|
+
});
|
|
5957
6033
|
return _context.abrupt("return", []);
|
|
5958
6034
|
case 27:
|
|
5959
6035
|
_context.prev = 27;
|
|
@@ -6216,7 +6292,14 @@ var CustomSwitchSelector = function CustomSwitchSelector(_ref) {
|
|
|
6216
6292
|
if (typeof selectedOptionValue === 'string') {
|
|
6217
6293
|
onSwitchChange(selectedOptionValue);
|
|
6218
6294
|
} else {
|
|
6219
|
-
console.error(
|
|
6295
|
+
// console.error(
|
|
6296
|
+
// 'Unexpected type for selectedOptionValue:',
|
|
6297
|
+
// typeof selectedOptionValue
|
|
6298
|
+
// );
|
|
6299
|
+
notification.error({
|
|
6300
|
+
message: 'Error',
|
|
6301
|
+
description: "" + typeof selectedOptionValue || 'Unexpected type for selectedOptionValue.'
|
|
6302
|
+
});
|
|
6220
6303
|
}
|
|
6221
6304
|
};
|
|
6222
6305
|
return React.createElement(StyledSwitch, null, React.createElement(SwitchSelector, {
|
|
@@ -6666,7 +6749,11 @@ function useCreateTask() {
|
|
|
6666
6749
|
setLoading(false);
|
|
6667
6750
|
throw new Error('response is not ok');
|
|
6668
6751
|
case 10:
|
|
6669
|
-
alert('Task Created Successfully');
|
|
6752
|
+
// alert('Task Created Successfully');
|
|
6753
|
+
notification.success({
|
|
6754
|
+
message: 'Success',
|
|
6755
|
+
description: 'Task Created Successfully'
|
|
6756
|
+
});
|
|
6670
6757
|
_context.next = 13;
|
|
6671
6758
|
return response.json();
|
|
6672
6759
|
case 13:
|
|
@@ -6676,19 +6763,23 @@ function useCreateTask() {
|
|
|
6676
6763
|
_context.prev = 17;
|
|
6677
6764
|
_context.t0 = _context["catch"](2);
|
|
6678
6765
|
setLoading(false);
|
|
6679
|
-
alert(
|
|
6680
|
-
console.error('Error:',
|
|
6681
|
-
|
|
6682
|
-
|
|
6766
|
+
// alert(err);
|
|
6767
|
+
// console.error('Error:', err);
|
|
6768
|
+
notification.error({
|
|
6769
|
+
message: 'Error',
|
|
6770
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
6771
|
+
});
|
|
6772
|
+
case 21:
|
|
6773
|
+
_context.prev = 21;
|
|
6683
6774
|
setLoading(false);
|
|
6684
|
-
return _context.finish(
|
|
6685
|
-
case
|
|
6775
|
+
return _context.finish(21);
|
|
6776
|
+
case 24:
|
|
6686
6777
|
setLoading(false);
|
|
6687
|
-
case
|
|
6778
|
+
case 25:
|
|
6688
6779
|
case "end":
|
|
6689
6780
|
return _context.stop();
|
|
6690
6781
|
}
|
|
6691
|
-
}, _callee, null, [[2, 17,
|
|
6782
|
+
}, _callee, null, [[2, 17, 21, 24]]);
|
|
6692
6783
|
}));
|
|
6693
6784
|
return function create(_x) {
|
|
6694
6785
|
return _ref.apply(this, arguments);
|
|
@@ -6726,9 +6817,17 @@ function useCreateReminder() {
|
|
|
6726
6817
|
response = _context.sent;
|
|
6727
6818
|
if (!response.ok) {
|
|
6728
6819
|
setLoading(false);
|
|
6729
|
-
alert('response is not ok');
|
|
6820
|
+
// alert('response is not ok');
|
|
6821
|
+
notification.error({
|
|
6822
|
+
message: 'Error',
|
|
6823
|
+
description: 'response is not ok'
|
|
6824
|
+
});
|
|
6730
6825
|
}
|
|
6731
|
-
alert('Reminder Created Successfully');
|
|
6826
|
+
// alert('Reminder Created Successfully');
|
|
6827
|
+
notification.success({
|
|
6828
|
+
message: 'Success',
|
|
6829
|
+
description: 'Reminder Created Successfully'
|
|
6830
|
+
});
|
|
6732
6831
|
_context.next = 11;
|
|
6733
6832
|
return response.json();
|
|
6734
6833
|
case 11:
|
|
@@ -6738,19 +6837,23 @@ function useCreateReminder() {
|
|
|
6738
6837
|
_context.prev = 15;
|
|
6739
6838
|
_context.t0 = _context["catch"](2);
|
|
6740
6839
|
setLoading(false);
|
|
6741
|
-
alert(
|
|
6742
|
-
console.error('Error:',
|
|
6743
|
-
|
|
6744
|
-
|
|
6840
|
+
// alert(err);
|
|
6841
|
+
// console.error('Error:', err);
|
|
6842
|
+
notification.error({
|
|
6843
|
+
message: 'Error',
|
|
6844
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
6845
|
+
});
|
|
6846
|
+
case 19:
|
|
6847
|
+
_context.prev = 19;
|
|
6745
6848
|
setLoading(false);
|
|
6746
|
-
return _context.finish(
|
|
6747
|
-
case
|
|
6849
|
+
return _context.finish(19);
|
|
6850
|
+
case 22:
|
|
6748
6851
|
setLoading(false);
|
|
6749
|
-
case
|
|
6852
|
+
case 23:
|
|
6750
6853
|
case "end":
|
|
6751
6854
|
return _context.stop();
|
|
6752
6855
|
}
|
|
6753
|
-
}, _callee, null, [[2, 15,
|
|
6856
|
+
}, _callee, null, [[2, 15, 19, 22]]);
|
|
6754
6857
|
}));
|
|
6755
6858
|
return function create(_x) {
|
|
6756
6859
|
return _ref.apply(this, arguments);
|
|
@@ -6805,8 +6908,11 @@ function useFetchUnresolvedTasks() {
|
|
|
6805
6908
|
case 9:
|
|
6806
6909
|
_json = _context.sent;
|
|
6807
6910
|
detail = _json == null ? void 0 : _json.detail;
|
|
6808
|
-
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
|
|
6809
|
-
|
|
6911
|
+
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
|
|
6912
|
+
notification.error({
|
|
6913
|
+
message: 'Error',
|
|
6914
|
+
description: "" + msg || 'An error has occurred. Please try again later.'
|
|
6915
|
+
});
|
|
6810
6916
|
setLoading(false);
|
|
6811
6917
|
return _context.abrupt("return", []);
|
|
6812
6918
|
case 15:
|
|
@@ -6826,7 +6932,11 @@ function useFetchUnresolvedTasks() {
|
|
|
6826
6932
|
case 25:
|
|
6827
6933
|
_context.prev = 25;
|
|
6828
6934
|
_context.t0 = _context["catch"](1);
|
|
6829
|
-
console.error('Error fetching data:',
|
|
6935
|
+
// console.error('Error fetching data:', err);
|
|
6936
|
+
notification.error({
|
|
6937
|
+
message: 'Error',
|
|
6938
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
6939
|
+
});
|
|
6830
6940
|
setLoading(false);
|
|
6831
6941
|
return _context.abrupt("return", []);
|
|
6832
6942
|
case 30:
|
|
@@ -7058,13 +7168,21 @@ function useUpdateOrder() {
|
|
|
7058
7168
|
return response.json();
|
|
7059
7169
|
case 13:
|
|
7060
7170
|
json = _context.sent;
|
|
7061
|
-
alert('Order has been updated');
|
|
7171
|
+
// alert('Order has been updated');
|
|
7172
|
+
notification.success({
|
|
7173
|
+
message: 'Success',
|
|
7174
|
+
description: 'Order has been updated.'
|
|
7175
|
+
});
|
|
7062
7176
|
return _context.abrupt("return", json);
|
|
7063
7177
|
case 18:
|
|
7064
7178
|
_context.prev = 18;
|
|
7065
7179
|
_context.t0 = _context["catch"](4);
|
|
7066
7180
|
// setLoading(false);
|
|
7067
|
-
console.log(
|
|
7181
|
+
// console.log(err, 'error');
|
|
7182
|
+
notification.error({
|
|
7183
|
+
message: 'Error',
|
|
7184
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
7185
|
+
});
|
|
7068
7186
|
case 21:
|
|
7069
7187
|
_context.prev = 21;
|
|
7070
7188
|
return _context.finish(21);
|
|
@@ -7172,12 +7290,20 @@ function useUpdateFlag() {
|
|
|
7172
7290
|
return response.json();
|
|
7173
7291
|
case 11:
|
|
7174
7292
|
json = _context.sent;
|
|
7175
|
-
alert('Flag has been updated');
|
|
7293
|
+
// alert('Flag has been updated');
|
|
7294
|
+
notification.success({
|
|
7295
|
+
message: 'Success',
|
|
7296
|
+
description: 'Flag has been updated'
|
|
7297
|
+
});
|
|
7176
7298
|
return _context.abrupt("return", json);
|
|
7177
7299
|
case 16:
|
|
7178
7300
|
_context.prev = 16;
|
|
7179
7301
|
_context.t0 = _context["catch"](2);
|
|
7180
|
-
console.error('Error:',
|
|
7302
|
+
// console.error('Error:', err);
|
|
7303
|
+
notification.error({
|
|
7304
|
+
message: 'Error',
|
|
7305
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
7306
|
+
});
|
|
7181
7307
|
case 19:
|
|
7182
7308
|
_context.prev = 19;
|
|
7183
7309
|
setLoading(false);
|
|
@@ -7509,7 +7635,7 @@ function useFetchSingleFlagsData() {
|
|
|
7509
7635
|
loading = _useFlagsLoading[0],
|
|
7510
7636
|
setLoading = _useFlagsLoading[1];
|
|
7511
7637
|
var ssoToken = getCookie('id_token');
|
|
7512
|
-
console.log(loading,
|
|
7638
|
+
console.log(loading, 'loading loading');
|
|
7513
7639
|
var res = /*#__PURE__*/function () {
|
|
7514
7640
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
7515
7641
|
var endpoint, headers, response, _detail$, _json, detail, msg, json;
|
|
@@ -7539,8 +7665,11 @@ function useFetchSingleFlagsData() {
|
|
|
7539
7665
|
case 9:
|
|
7540
7666
|
_json = _context.sent;
|
|
7541
7667
|
detail = _json == null ? void 0 : _json.detail;
|
|
7542
|
-
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
|
|
7543
|
-
|
|
7668
|
+
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // alert(`${msg}`);
|
|
7669
|
+
notification.error({
|
|
7670
|
+
message: 'Error',
|
|
7671
|
+
description: "" + msg || 'An error has occurred. Please try again later.'
|
|
7672
|
+
});
|
|
7544
7673
|
setLoading(false);
|
|
7545
7674
|
return _context.abrupt("return", []);
|
|
7546
7675
|
case 15:
|
|
@@ -7560,7 +7689,11 @@ function useFetchSingleFlagsData() {
|
|
|
7560
7689
|
_context.prev = 24;
|
|
7561
7690
|
_context.t0 = _context["catch"](1);
|
|
7562
7691
|
setLoading(false);
|
|
7563
|
-
console.error('Error fetching data:',
|
|
7692
|
+
// console.error('Error fetching data:', err);
|
|
7693
|
+
notification.error({
|
|
7694
|
+
message: 'Error',
|
|
7695
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
7696
|
+
});
|
|
7564
7697
|
return _context.abrupt("return", []);
|
|
7565
7698
|
case 29:
|
|
7566
7699
|
case "end":
|
|
@@ -7848,8 +7981,11 @@ function useSystemLogs() {
|
|
|
7848
7981
|
case 9:
|
|
7849
7982
|
_json = _context.sent;
|
|
7850
7983
|
detail = _json == null ? void 0 : _json.detail;
|
|
7851
|
-
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg;
|
|
7852
|
-
|
|
7984
|
+
msg = (_detail$ = detail[0]) == null ? void 0 : _detail$.msg; // console.error('Error response:', msg);
|
|
7985
|
+
notification.error({
|
|
7986
|
+
message: 'Error',
|
|
7987
|
+
description: "" + msg || 'An error has occurred. Please try again later.'
|
|
7988
|
+
});
|
|
7853
7989
|
// setLoading(false);
|
|
7854
7990
|
return _context.abrupt("return", []);
|
|
7855
7991
|
case 14:
|
|
@@ -7869,7 +8005,11 @@ function useSystemLogs() {
|
|
|
7869
8005
|
case 23:
|
|
7870
8006
|
_context.prev = 23;
|
|
7871
8007
|
_context.t0 = _context["catch"](1);
|
|
7872
|
-
console.error('Error fetching data:',
|
|
8008
|
+
// console.error('Error fetching data:', err);
|
|
8009
|
+
notification.error({
|
|
8010
|
+
message: 'Error',
|
|
8011
|
+
description: "" + _context.t0 || 'An error has occurred. Please try again later.'
|
|
8012
|
+
});
|
|
7873
8013
|
return _context.abrupt("return", []);
|
|
7874
8014
|
case 27:
|
|
7875
8015
|
_context.prev = 27;
|
|
@@ -8185,6 +8325,16 @@ function SelectionFilter() {
|
|
|
8185
8325
|
var _useState4 = useState(false),
|
|
8186
8326
|
isButtonEnabled = _useState4[0],
|
|
8187
8327
|
setIsButtonEnabled = _useState4[1];
|
|
8328
|
+
var _useReturnPayload = useReturnPayload(),
|
|
8329
|
+
setReturnPayload = _useReturnPayload[1];
|
|
8330
|
+
var _useState5 = useState(),
|
|
8331
|
+
storedAccNumber = _useState5[0],
|
|
8332
|
+
setStoredAccNumber = _useState5[1];
|
|
8333
|
+
var _useState6 = useState(),
|
|
8334
|
+
storedCustomerId = _useState6[0],
|
|
8335
|
+
setStoredCustomerId = _useState6[1];
|
|
8336
|
+
var _useNewReturnPayload = useNewReturnPayload(),
|
|
8337
|
+
setNewPayload = _useNewReturnPayload[1];
|
|
8188
8338
|
//client options
|
|
8189
8339
|
var clientOptions = customers == null ? void 0 : customers.map(function (option) {
|
|
8190
8340
|
var _option$customer_name, _option$customer_name2;
|
|
@@ -8192,7 +8342,9 @@ function SelectionFilter() {
|
|
|
8192
8342
|
label: (option == null || (_option$customer_name = option.customer_name) == null || (_option$customer_name = _option$customer_name.charAt(0)) == null ? void 0 : _option$customer_name.toUpperCase()) + (option == null || (_option$customer_name2 = option.customer_name) == null ? void 0 : _option$customer_name2.slice(1)),
|
|
8193
8343
|
value: (option == null ? void 0 : option.id) + "_" + (option == null ? void 0 : option.uuid),
|
|
8194
8344
|
id: option == null ? void 0 : option.id,
|
|
8195
|
-
uuid: option == null ? void 0 : option.uuid
|
|
8345
|
+
uuid: option == null ? void 0 : option.uuid,
|
|
8346
|
+
account_number: option == null ? void 0 : option.account_number,
|
|
8347
|
+
gsit_customer_id: option == null ? void 0 : option.gsit_customer_id
|
|
8196
8348
|
};
|
|
8197
8349
|
});
|
|
8198
8350
|
var actionTypeOptions = actionType == null ? void 0 : actionType.map(function (option) {
|
|
@@ -8210,14 +8362,28 @@ function SelectionFilter() {
|
|
|
8210
8362
|
});
|
|
8211
8363
|
//client change
|
|
8212
8364
|
var handleSelectChange = function handleSelectChange(value, option) {
|
|
8365
|
+
setNewPayload([]);
|
|
8213
8366
|
console.log(value, 'value');
|
|
8214
8367
|
var selectedLabel = option == null ? void 0 : option.label;
|
|
8215
8368
|
var selectedValue = option == null ? void 0 : option.id;
|
|
8216
8369
|
var selectedUuids = option == null ? void 0 : option.uuid;
|
|
8370
|
+
var selectAccountNumber = option.account_number;
|
|
8371
|
+
var selectedCustomerId = option.gsit_customer_id;
|
|
8217
8372
|
setSelectedClient(selectedValue);
|
|
8218
8373
|
setName(selectedLabel);
|
|
8219
8374
|
localStorage.setItem('clientName', selectedLabel);
|
|
8220
8375
|
localStorage.setItem('clientId', selectedValue.toString());
|
|
8376
|
+
localStorage.setItem('account_number', selectAccountNumber);
|
|
8377
|
+
localStorage.setItem('customer_id', selectedCustomerId.toString());
|
|
8378
|
+
var storedAccNo = localStorage.getItem('account_number');
|
|
8379
|
+
var storedCustomerId = localStorage.getItem('customer_id');
|
|
8380
|
+
setReturnPayload(function (prevState) {
|
|
8381
|
+
return _extends({}, prevState, {
|
|
8382
|
+
account_number: storedAccNo,
|
|
8383
|
+
customer_id: storedCustomerId
|
|
8384
|
+
});
|
|
8385
|
+
});
|
|
8386
|
+
console.log(selectedUuids, 'selectedUuids');
|
|
8221
8387
|
var filteredSubLocations = locationData == null ? void 0 : locationData.filter(function (subCat) {
|
|
8222
8388
|
return (subCat == null ? void 0 : subCat.customer_id) === selectedUuids;
|
|
8223
8389
|
}).map(function (subCat) {
|
|
@@ -8229,6 +8395,24 @@ function SelectionFilter() {
|
|
|
8229
8395
|
setFilteredLocationOptions(filteredSubLocations);
|
|
8230
8396
|
setUuid('');
|
|
8231
8397
|
};
|
|
8398
|
+
useEffect(function () {
|
|
8399
|
+
var accountNumberFromStorage = localStorage.getItem('account_number');
|
|
8400
|
+
var customerIdFromStorage = localStorage.getItem('customer_id');
|
|
8401
|
+
if (accountNumberFromStorage) {
|
|
8402
|
+
setStoredAccNumber(accountNumberFromStorage);
|
|
8403
|
+
}
|
|
8404
|
+
if (customerIdFromStorage) {
|
|
8405
|
+
setStoredCustomerId(customerIdFromStorage);
|
|
8406
|
+
}
|
|
8407
|
+
if (storedAccNumber && storedCustomerId) {
|
|
8408
|
+
setReturnPayload(function (prevState) {
|
|
8409
|
+
return _extends({}, prevState, {
|
|
8410
|
+
account_number: storedAccNumber,
|
|
8411
|
+
customer_id: storedCustomerId
|
|
8412
|
+
});
|
|
8413
|
+
});
|
|
8414
|
+
}
|
|
8415
|
+
}, [storedAccNumber, storedCustomerId]);
|
|
8232
8416
|
useEffect(function () {}, [getUuid, filteredLocationOptions]);
|
|
8233
8417
|
//location change
|
|
8234
8418
|
var handleLocationChange = function handleLocationChange(value, option) {
|
|
@@ -8293,6 +8477,7 @@ function SelectionFilter() {
|
|
|
8293
8477
|
setIsButtonEnabled(false);
|
|
8294
8478
|
}
|
|
8295
8479
|
}, [storedName, selectedFilterValue, selectedLocationValue]);
|
|
8480
|
+
console.log(filteredLocationOptions, 'filteredLocationOptions');
|
|
8296
8481
|
console.log('check', storedName, selectedFilterValue, selectedLocationValue);
|
|
8297
8482
|
return React.createElement(Wrapper$k, null, React.createElement(FilterRow, null, React.createElement(LeftColumn, null, React.createElement(FilterColumn, null, React.createElement(Label$g, null, "Clients"), React.createElement(StyledAntSelect$5, {
|
|
8298
8483
|
options: clientOptions,
|
|
@@ -8377,7 +8562,7 @@ function HeaderFilter() {
|
|
|
8377
8562
|
if (fetchedStaticData && fetchedStaticData != null && fetchedStaticData.data) {
|
|
8378
8563
|
var _fetchedStaticData$da;
|
|
8379
8564
|
setActionType(fetchedStaticData == null || (_fetchedStaticData$da = fetchedStaticData.data) == null ? void 0 : _fetchedStaticData$da.flatMap(function (i) {
|
|
8380
|
-
return i.
|
|
8565
|
+
return i == null ? void 0 : i.order_product_return_action;
|
|
8381
8566
|
}));
|
|
8382
8567
|
}
|
|
8383
8568
|
}, [actionLoading, fetchedStaticData]);
|
|
@@ -8391,7 +8576,7 @@ function HeaderFilter() {
|
|
|
8391
8576
|
|
|
8392
8577
|
var _templateObject$1$, _templateObject4$v, _templateObject5$k, _templateObject7$d, _templateObject8$8;
|
|
8393
8578
|
//Left side
|
|
8394
|
-
var LeftSideConatiner = /*#__PURE__*/styled.div(_templateObject$1$ || (_templateObject$1$ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 1px 5px 1px 1.1px;\n align-items: center;\n gap: 10px;\n border-radius: 40px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n background: var(--Flowkit-White, #fff);\n\n .filtercontainer {\n display: flex;\n padding: 8px 8px 8px 4px;\n align-items: center;\n gap: 4px;\n align-self: stretch;\n border-radius: 20px 0px 0px 20px;\n border-right: 1px solid rgba(0, 0, 0, 0.04);\n background: var(--BjsColor-Bg-F0F2F2, #f0f2f2);\n\n .filtericon {\n display: flex;\n padding: 7px 0px 5px 5px;\n align-items: flex-start;\n gap: 10px;\n border-radius: 30px;\n }\n .textcont {\n color: #758588;\n text-align: center;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n }\n }\n .datefilter {\n display: flex;\n height: 36px;\n padding: 6px 8px;\n justify-content: center;\n align-items: center;\n gap:
|
|
8579
|
+
var LeftSideConatiner = /*#__PURE__*/styled.div(_templateObject$1$ || (_templateObject$1$ = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 1px 5px 1px 1.1px;\n align-items: center;\n gap: 10px;\n border-radius: 40px;\n border: 1px solid rgba(0, 0, 0, 0.08);\n background: var(--Flowkit-White, #fff);\n\n .filtercontainer {\n display: flex;\n padding: 8px 8px 8px 4px;\n align-items: center;\n gap: 4px;\n align-self: stretch;\n border-radius: 20px 0px 0px 20px;\n border-right: 1px solid rgba(0, 0, 0, 0.04);\n background: var(--BjsColor-Bg-F0F2F2, #f0f2f2);\n\n .filtericon {\n display: flex;\n padding: 7px 0px 5px 5px;\n align-items: flex-start;\n gap: 10px;\n border-radius: 30px;\n }\n .textcont {\n color: #758588;\n text-align: center;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: normal;\n }\n }\n .datefilter {\n display: flex;\n height: 36px;\n padding: 6px 8px;\n justify-content: center;\n align-items: center;\n gap: 2px;\n border-radius: 20px;\n border: 1px solid #edebe8;\n\n .dateiconcontainer {\n display: flex;\n width: 24px;\n height: 24px;\n padding: 5px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-radius: 20px;\n border: 1px solid var(--tonal-brown-101, #e2e0db);\n background: #f1f5f6;\n }\n .datetext {\n color: #6a7378;\n\n /* body/captions */\n font-family: 'Lato';\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px; /* 123.077% */\n }\n }\n"])));
|
|
8395
8580
|
//
|
|
8396
8581
|
var StyledFiter = /*#__PURE__*/styled.div(_templateObject4$v || (_templateObject4$v = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
8397
8582
|
var StyledFIlterELements = /*#__PURE__*/styled.div(_templateObject5$k || (_templateObject5$k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 0;\n gap: 10px;\n align-items: center;\n"])));
|
|
@@ -8461,8 +8646,8 @@ var IconText = /*#__PURE__*/styled.div(_templateObject5$l || (_templateObject5$l
|
|
|
8461
8646
|
|
|
8462
8647
|
var ReturnFilter = function ReturnFilter() {
|
|
8463
8648
|
var _useParams = useParams(),
|
|
8464
|
-
|
|
8465
|
-
return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(Text$7, null, " ",
|
|
8649
|
+
clientName = _useParams.clientName;
|
|
8650
|
+
return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(Text$7, null, " ", clientName), React.createElement(StyledFIlterELements, null, React.createElement(StyledTableFilter, null)), React.createElement(RightFilters, null)));
|
|
8466
8651
|
};
|
|
8467
8652
|
|
|
8468
8653
|
var _templateObject$22, _templateObject2$1s, _templateObject3$P, _templateObject4$x, _templateObject34;
|
|
@@ -8681,6 +8866,14 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8681
8866
|
var _usePrintOptionTOggle = usePrintOptionTOggle(),
|
|
8682
8867
|
printToogle = _usePrintOptionTOggle[0],
|
|
8683
8868
|
setPrintToggle = _usePrintOptionTOggle[1];
|
|
8869
|
+
var _useReturnPayload = useReturnPayload(),
|
|
8870
|
+
createReturn = _useReturnPayload[0],
|
|
8871
|
+
setReturnPayload = _useReturnPayload[1];
|
|
8872
|
+
var _useNewReturnPayload = useNewReturnPayload(),
|
|
8873
|
+
newpayload = _useNewReturnPayload[0],
|
|
8874
|
+
setNewPayload = _useNewReturnPayload[1];
|
|
8875
|
+
var _useGroupedPayload = useGroupedPayload(),
|
|
8876
|
+
setGrouped = _useGroupedPayload[1];
|
|
8684
8877
|
var OpenDropDown = function OpenDropDown(index) {
|
|
8685
8878
|
setPrintToggle(function (prevIndex) {
|
|
8686
8879
|
return prevIndex === index ? null : index;
|
|
@@ -8715,36 +8908,104 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8715
8908
|
var handleSelectAll = function handleSelectAll(e) {
|
|
8716
8909
|
setSelectAll(e.target.checked);
|
|
8717
8910
|
if (e.target.checked) {
|
|
8718
|
-
setSelectedReturnOrder(returnData.map(function (
|
|
8911
|
+
setSelectedReturnOrder(returnData == null ? void 0 : returnData.map(function (loc) {
|
|
8912
|
+
var _loc$return_locations;
|
|
8719
8913
|
return {
|
|
8720
|
-
id:
|
|
8721
|
-
|
|
8914
|
+
id: loc.id,
|
|
8915
|
+
return_locations: loc == null ? void 0 : loc.return_locations,
|
|
8916
|
+
return_location: loc == null ? void 0 : loc.return_location,
|
|
8917
|
+
products: loc.id,
|
|
8918
|
+
order_product_return_action: loc == null ? void 0 : loc.order_product_return_action,
|
|
8919
|
+
return_location_token: loc == null || (_loc$return_locations = loc.return_locations) == null ? void 0 : _loc$return_locations.token
|
|
8920
|
+
};
|
|
8921
|
+
}));
|
|
8922
|
+
setNewPayload(returnData == null ? void 0 : returnData.map(function (loc) {
|
|
8923
|
+
var _loc$order_product_re, _loc$return_locations2;
|
|
8924
|
+
return {
|
|
8925
|
+
id: loc.id,
|
|
8926
|
+
account_number: createReturn == null ? void 0 : createReturn.account_number,
|
|
8927
|
+
customer_id: createReturn == null ? void 0 : createReturn.customer_id,
|
|
8928
|
+
products: loc.id,
|
|
8929
|
+
return_action: (loc == null || (_loc$order_product_re = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re.type) || null,
|
|
8930
|
+
return_location_token: loc == null || (_loc$return_locations2 = loc.return_locations) == null ? void 0 : _loc$return_locations2.token
|
|
8722
8931
|
};
|
|
8723
8932
|
}));
|
|
8724
8933
|
} else {
|
|
8725
8934
|
setSelectedReturnOrder([]);
|
|
8726
8935
|
}
|
|
8727
8936
|
};
|
|
8728
|
-
var
|
|
8729
|
-
setSelectedReturnOrder(function (
|
|
8730
|
-
var isSelected =
|
|
8731
|
-
return
|
|
8937
|
+
var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action) {
|
|
8938
|
+
setSelectedReturnOrder(function (prevSelectedLocations) {
|
|
8939
|
+
var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (loc) {
|
|
8940
|
+
return loc.id === id;
|
|
8732
8941
|
});
|
|
8733
8942
|
if (isSelected) {
|
|
8734
|
-
|
|
8735
|
-
return
|
|
8943
|
+
var updatedSelectedLocations = prevSelectedLocations.filter(function (loc) {
|
|
8944
|
+
return loc.id !== id;
|
|
8945
|
+
});
|
|
8946
|
+
setReturnPayload(function (prevState) {
|
|
8947
|
+
return _extends({}, prevState, {
|
|
8948
|
+
products: id,
|
|
8949
|
+
return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
|
|
8950
|
+
return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
|
|
8951
|
+
});
|
|
8952
|
+
});
|
|
8953
|
+
setNewPayload(function (prevPayload) {
|
|
8954
|
+
return prevPayload.filter(function (item) {
|
|
8955
|
+
return item.id !== id;
|
|
8956
|
+
});
|
|
8736
8957
|
});
|
|
8958
|
+
return updatedSelectedLocations;
|
|
8737
8959
|
} else {
|
|
8738
|
-
|
|
8960
|
+
var newReturnPayload = {
|
|
8739
8961
|
id: id,
|
|
8740
|
-
|
|
8962
|
+
account_number: createReturn == null ? void 0 : createReturn.account_number,
|
|
8963
|
+
customer_id: createReturn == null ? void 0 : createReturn.customer_id,
|
|
8964
|
+
products: id,
|
|
8965
|
+
return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
|
|
8966
|
+
return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
|
|
8967
|
+
};
|
|
8968
|
+
setNewPayload(function (prevPayload) {
|
|
8969
|
+
return [].concat(prevPayload, [newReturnPayload]);
|
|
8970
|
+
});
|
|
8971
|
+
setReturnPayload(function (prevState) {
|
|
8972
|
+
return _extends({}, prevState, {
|
|
8973
|
+
products: id,
|
|
8974
|
+
return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
|
|
8975
|
+
return_location_token: (return_locations == null ? void 0 : return_locations.token) || null
|
|
8976
|
+
});
|
|
8977
|
+
});
|
|
8978
|
+
return [].concat(prevSelectedLocations, [{
|
|
8979
|
+
id: id,
|
|
8980
|
+
return_location: return_location,
|
|
8981
|
+
return_locations: return_locations,
|
|
8982
|
+
order_product_return_action: order_product_return_action
|
|
8741
8983
|
}]);
|
|
8742
8984
|
}
|
|
8743
8985
|
});
|
|
8744
8986
|
};
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8987
|
+
useEffect(function () {
|
|
8988
|
+
if ((newpayload == null ? void 0 : newpayload.length) === 0) return;
|
|
8989
|
+
var groupedPayload = newpayload == null ? void 0 : newpayload.reduce(function (acc, item) {
|
|
8990
|
+
var return_location_token = item.return_location_token;
|
|
8991
|
+
if (!return_location_token) {
|
|
8992
|
+
acc.push(item);
|
|
8993
|
+
} else {
|
|
8994
|
+
if (!acc[return_location_token]) {
|
|
8995
|
+
acc[return_location_token] = _extends({}, item, {
|
|
8996
|
+
products: [],
|
|
8997
|
+
return_action: []
|
|
8998
|
+
});
|
|
8999
|
+
}
|
|
9000
|
+
acc[return_location_token].products = [].concat(acc[return_location_token].products, item.products);
|
|
9001
|
+
acc[return_location_token].return_action = [].concat(acc[return_location_token].return_action, item.return_action);
|
|
9002
|
+
}
|
|
9003
|
+
return acc;
|
|
9004
|
+
}, []);
|
|
9005
|
+
var mergedPayload = Object.values(groupedPayload);
|
|
9006
|
+
setGrouped(mergedPayload);
|
|
9007
|
+
}, [newpayload]);
|
|
9008
|
+
return React.createElement(React.Fragment, null, React.createElement(StyledTableWrapper, null, React.createElement(StyledTable, null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", {
|
|
8748
9009
|
className: "emailInvoiceCheckbox"
|
|
8749
9010
|
}, React.createElement(Checkbox$1, {
|
|
8750
9011
|
checked: selectAll,
|
|
@@ -8768,7 +9029,7 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8768
9029
|
return (selectedInvoice == null ? void 0 : selectedInvoice.id) === item.id;
|
|
8769
9030
|
}),
|
|
8770
9031
|
onChange: function onChange() {
|
|
8771
|
-
return
|
|
9032
|
+
return handleSelectOrderReturn(item.id, item.return_location, item.return_locations, item.order_product_return_action);
|
|
8772
9033
|
}
|
|
8773
9034
|
})), React.createElement("td", null, displayValueOrNA(item == null || (_item$orders_products = item.orders_products_stock) == null ? void 0 : _item$orders_products.location)), React.createElement("td", null, " ", displayValueOrNA(item == null ? void 0 : item.return_location)), React.createElement("td", null, React.createElement("ul", {
|
|
8774
9035
|
style: {
|
|
@@ -9303,161 +9564,7 @@ var ProductAction = function ProductAction() {
|
|
|
9303
9564
|
var GLobalPopupContent$4 = /*#__PURE__*/styled.div(_templateObject$2c || (_templateObject$2c = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
9304
9565
|
var Container$1a = /*#__PURE__*/styled.div(_templateObject2$1B || (_templateObject2$1B = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n height: 50vh;\n padding-bottom: 30px;\n flex-direction: column;\n align-items: flex-start;\n gap: 20px;\n align-self: stretch;\n border-radius: 6px;\n border: 1px solid #edebe8;\n padding: 15px;\n overflow-y: scroll;\n .ant-tabs {\n width: 100%;\n }\n .ant-tabs-tab-active {\n .ant-tabs-tab-btn {\n color: #3a3630 !important;\n font-family: 'Lato', sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n }\n }\n .ant-tabs-ink-bar {\n background: #feba30;\n }\n"])));
|
|
9305
9566
|
|
|
9306
|
-
var
|
|
9307
|
-
return React.createElement("svg", {
|
|
9308
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9309
|
-
width: "18",
|
|
9310
|
-
height: "18",
|
|
9311
|
-
viewBox: "0 0 18 18",
|
|
9312
|
-
fill: "none"
|
|
9313
|
-
}, React.createElement("path", {
|
|
9314
|
-
d: "M1.5 4.3125C1.5 3.76549 1.7173 3.24089 2.10409 2.85409C2.49089 2.4673 3.01549 2.25 3.5625 2.25H4.6875C4.83668 2.25 4.97976 2.30926 5.08525 2.41475C5.19074 2.52024 5.25 2.66332 5.25 2.8125C5.25 2.96168 5.19074 3.10476 5.08525 3.21025C4.97976 3.31574 4.83668 3.375 4.6875 3.375H3.5625C3.045 3.375 2.625 3.795 2.625 4.3125V5.4375C2.625 5.58668 2.56574 5.72976 2.46025 5.83525C2.35476 5.94074 2.21168 6 2.0625 6C1.91332 6 1.77024 5.94074 1.66475 5.83525C1.55926 5.72976 1.5 5.58668 1.5 5.4375V4.3125ZM12.75 2.8125C12.75 2.66332 12.8093 2.52024 12.9148 2.41475C13.0202 2.30926 13.1633 2.25 13.3125 2.25H14.4375C14.9845 2.25 15.5091 2.4673 15.8959 2.85409C16.2827 3.24089 16.5 3.76549 16.5 4.3125V5.4375C16.5 5.58668 16.4407 5.72976 16.3352 5.83525C16.2298 5.94074 16.0867 6 15.9375 6C15.7883 6 15.6452 5.94074 15.5398 5.83525C15.4343 5.72976 15.375 5.58668 15.375 5.4375V4.3125C15.375 3.795 14.955 3.375 14.4375 3.375H13.3125C13.1633 3.375 13.0202 3.31574 12.9148 3.21025C12.8093 3.10476 12.75 2.96168 12.75 2.8125ZM2.0625 12C2.21168 12 2.35476 12.0593 2.46025 12.1648C2.56574 12.2702 2.625 12.4133 2.625 12.5625V13.6875C2.625 14.205 3.045 14.625 3.5625 14.625H4.6875C4.83668 14.625 4.97976 14.6843 5.08525 14.7898C5.19074 14.8952 5.25 15.0383 5.25 15.1875C5.25 15.3367 5.19074 15.4798 5.08525 15.5852C4.97976 15.6907 4.83668 15.75 4.6875 15.75H3.5625C3.01549 15.75 2.49089 15.5327 2.10409 15.1459C1.7173 14.7591 1.5 14.2345 1.5 13.6875V12.5625C1.5 12.4133 1.55926 12.2702 1.66475 12.1648C1.77024 12.0593 1.91332 12 2.0625 12ZM15.9375 12C16.0867 12 16.2298 12.0593 16.3352 12.1648C16.4407 12.2702 16.5 12.4133 16.5 12.5625V13.6875C16.5 14.2345 16.2827 14.7591 15.8959 15.1459C15.5091 15.5327 14.9845 15.75 14.4375 15.75H13.3125C13.1633 15.75 13.0202 15.6907 12.9148 15.5852C12.8093 15.4798 12.75 15.3367 12.75 15.1875C12.75 15.0383 12.8093 14.8952 12.9148 14.7898C13.0202 14.6843 13.1633 14.625 13.3125 14.625H14.4375C14.955 14.625 15.375 14.205 15.375 13.6875V12.5625C15.375 12.4133 15.4343 12.2702 15.5398 12.1648C15.6452 12.0593 15.7883 12 15.9375 12ZM4.3125 5.25C4.46168 5.25 4.60476 5.30926 4.71025 5.41475C4.81574 5.52024 4.875 5.66332 4.875 5.8125V12.1875C4.875 12.3367 4.81574 12.4798 4.71025 12.5852C4.60476 12.6907 4.46168 12.75 4.3125 12.75C4.16332 12.75 4.02024 12.6907 3.91475 12.5852C3.80926 12.4798 3.75 12.3367 3.75 12.1875V5.8125C3.75 5.66332 3.80926 5.52024 3.91475 5.41475C4.02024 5.30926 4.16332 5.25 4.3125 5.25ZM7.875 5.8125C7.875 5.66332 7.81574 5.52024 7.71025 5.41475C7.60476 5.30926 7.46168 5.25 7.3125 5.25C7.16332 5.25 7.02024 5.30926 6.91475 5.41475C6.80926 5.52024 6.75 5.66332 6.75 5.8125V12.1875C6.75 12.3367 6.80926 12.4798 6.91475 12.5852C7.02024 12.6907 7.16332 12.75 7.3125 12.75C7.46168 12.75 7.60476 12.6907 7.71025 12.5852C7.81574 12.4798 7.875 12.3367 7.875 12.1875V5.8125ZM10.3125 5.25C10.4617 5.25 10.6048 5.30926 10.7102 5.41475C10.8157 5.52024 10.875 5.66332 10.875 5.8125V12.1875C10.875 12.3367 10.8157 12.4798 10.7102 12.5852C10.6048 12.6907 10.4617 12.75 10.3125 12.75C10.1633 12.75 10.0202 12.6907 9.91475 12.5852C9.80926 12.4798 9.75 12.3367 9.75 12.1875V5.8125C9.75 5.66332 9.80926 5.52024 9.91475 5.41475C10.0202 5.30926 10.1633 5.25 10.3125 5.25ZM13.875 5.8125C13.875 5.66332 13.8157 5.52024 13.7102 5.41475C13.6048 5.30926 13.4617 5.25 13.3125 5.25C13.1633 5.25 13.0202 5.30926 12.9148 5.41475C12.8093 5.52024 12.75 5.66332 12.75 5.8125V12.1875C12.75 12.3367 12.8093 12.4798 12.9148 12.5852C13.0202 12.6907 13.1633 12.75 13.3125 12.75C13.4617 12.75 13.6048 12.6907 13.7102 12.5852C13.8157 12.4798 13.875 12.3367 13.875 12.1875V5.8125Z",
|
|
9315
|
-
fill: "#3A3630",
|
|
9316
|
-
fillOpacity: "0.8"
|
|
9317
|
-
}));
|
|
9318
|
-
};
|
|
9319
|
-
|
|
9320
|
-
var WeightIcon = function WeightIcon() {
|
|
9321
|
-
return React.createElement("svg", {
|
|
9322
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9323
|
-
width: "18",
|
|
9324
|
-
height: "18",
|
|
9325
|
-
viewBox: "0 0 18 18",
|
|
9326
|
-
fill: "none"
|
|
9327
|
-
}, React.createElement("path", {
|
|
9328
|
-
d: "M9 2.25C9.79565 2.25 10.5587 2.56607 11.1213 3.12868C11.6839 3.69129 12 4.45435 12 5.25C12 5.7975 11.8575 6.3075 11.595 6.75H13.5C14.2125 6.75 14.8125 7.2525 14.9625 7.92C16.47 13.9275 16.5 14.085 16.5 14.25C16.5 14.6478 16.342 15.0294 16.0607 15.3107C15.7794 15.592 15.3978 15.75 15 15.75H3C2.60218 15.75 2.22064 15.592 1.93934 15.3107C1.65804 15.0294 1.5 14.6478 1.5 14.25C1.5 14.085 1.53 13.9275 3.0375 7.92C3.1875 7.2525 3.7875 6.75 4.5 6.75H6.405C6.13724 6.29565 5.99731 5.77737 6 5.25C6 4.45435 6.31607 3.69129 6.87868 3.12868C7.44129 2.56607 8.20435 2.25 9 2.25ZM9 3.75C8.60218 3.75 8.22064 3.90804 7.93934 4.18934C7.65804 4.47064 7.5 4.85218 7.5 5.25C7.5 5.64782 7.65804 6.02936 7.93934 6.31066C8.22064 6.59196 8.60218 6.75 9 6.75C9.39782 6.75 9.77936 6.59196 10.0607 6.31066C10.342 6.02936 10.5 5.64782 10.5 5.25C10.5 4.85218 10.342 4.47064 10.0607 4.18934C9.77936 3.90804 9.39782 3.75 9 3.75ZM4.5 8.25V14.25H6V12.375L6.75 13.125V14.25H8.25V12.75L6.75 11.25L8.25 9.75V8.25H6.75V9.375L6 10.125V8.25H4.5ZM11.25 8.25C10.4175 8.25 9.75 8.9175 9.75 9.75V12.75C9.75 13.5825 10.4175 14.25 11.25 14.25H13.5V10.5H12V12.75H11.25V9.75H13.5V8.25H11.25Z",
|
|
9329
|
-
fill: "#3A3630",
|
|
9330
|
-
fillOpacity: "0.6"
|
|
9331
|
-
}));
|
|
9332
|
-
};
|
|
9333
|
-
|
|
9334
|
-
var CbmIcon = function CbmIcon() {
|
|
9335
|
-
return React.createElement("svg", {
|
|
9336
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9337
|
-
width: "18",
|
|
9338
|
-
height: "18",
|
|
9339
|
-
viewBox: "0 0 18 18",
|
|
9340
|
-
fill: "none"
|
|
9341
|
-
}, React.createElement("path", {
|
|
9342
|
-
d: "M13.4213 2.66475C13.3589 2.54013 13.2631 2.43533 13.1446 2.36208C13.026 2.28883 12.8894 2.25002 12.75 2.25H5.25005C4.9658 2.25 4.7063 2.4105 4.5788 2.66475L1.5788 8.66475C1.52666 8.76895 1.49951 8.88386 1.49951 9.00037C1.49951 9.11689 1.52666 9.2318 1.5788 9.336L4.5788 15.336C4.7063 15.5895 4.9658 15.75 5.25005 15.75H12.75C13.0343 15.75 13.2938 15.5895 13.4213 15.3353L16.4213 9.33525C16.4734 9.23105 16.5006 9.11614 16.5006 8.99963C16.5006 8.88311 16.4734 8.7682 16.4213 8.664L13.4213 2.66475ZM14.5365 8.25H8.71355L6.46355 3.75H12.2865L14.5365 8.25ZM3.08855 9L5.25005 4.677L7.41155 9L5.25005 13.323L3.08855 9ZM12.2865 14.25H6.46355L8.71355 9.75H14.5365L12.2865 14.25Z",
|
|
9343
|
-
fill: "#3A3630",
|
|
9344
|
-
fillOpacity: "0.6"
|
|
9345
|
-
}));
|
|
9346
|
-
};
|
|
9347
|
-
|
|
9348
|
-
var _templateObject$2d, _templateObject2$1C;
|
|
9349
|
-
var AddProduct = function AddProduct() {
|
|
9350
|
-
var _orderStaticData$orde;
|
|
9351
|
-
var _useCreateOrderProduc = useCreateOrderProducts(),
|
|
9352
|
-
orderProduct = _useCreateOrderProduc[0],
|
|
9353
|
-
setOrderProduct = _useCreateOrderProduc[1];
|
|
9354
|
-
var _useOrderStaticData = useOrderStaticData(),
|
|
9355
|
-
orderStaticData = _useOrderStaticData[0];
|
|
9356
|
-
var typeOptions = orderStaticData == null || (_orderStaticData$orde = orderStaticData.order_product_type) == null ? void 0 : _orderStaticData$orde.map(function (option) {
|
|
9357
|
-
return {
|
|
9358
|
-
label: option == null ? void 0 : option.type,
|
|
9359
|
-
value: option == null ? void 0 : option.id
|
|
9360
|
-
};
|
|
9361
|
-
});
|
|
9362
|
-
var handleInputChange = function handleInputChange(index, field, value) {
|
|
9363
|
-
setOrderProduct(function (prevProducts) {
|
|
9364
|
-
var _extends2;
|
|
9365
|
-
var newProducts = [].concat(prevProducts);
|
|
9366
|
-
newProducts[index] = _extends({}, newProducts[index], (_extends2 = {}, _extends2[field] = value, _extends2));
|
|
9367
|
-
return newProducts;
|
|
9368
|
-
});
|
|
9369
|
-
};
|
|
9370
|
-
var onSelectChange = function onSelectChange(index, value) {
|
|
9371
|
-
handleInputChange(index, 'product_type_id', +value);
|
|
9372
|
-
};
|
|
9373
|
-
var onSearch = function onSearch(value) {
|
|
9374
|
-
console.log('search item value:', value);
|
|
9375
|
-
};
|
|
9376
|
-
return React.createElement(GLobalPopupContent$5, null, React.createElement(SimpleTable, null, React.createElement("table", null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", null, "Product Type"), React.createElement("th", {
|
|
9377
|
-
style: {
|
|
9378
|
-
width: '130px'
|
|
9379
|
-
}
|
|
9380
|
-
}, React.createElement("span", null, "Code ", React.createElement("em", null, "*"))), React.createElement("th", {
|
|
9381
|
-
style: {
|
|
9382
|
-
width: '33%'
|
|
9383
|
-
}
|
|
9384
|
-
}, React.createElement("span", null, "Description ", React.createElement("em", null, "*"))), React.createElement("th", null, "Barcode"), React.createElement("th", {
|
|
9385
|
-
style: {
|
|
9386
|
-
width: '120px'
|
|
9387
|
-
}
|
|
9388
|
-
}, "Weight"), React.createElement("th", {
|
|
9389
|
-
style: {
|
|
9390
|
-
width: '120px'
|
|
9391
|
-
}
|
|
9392
|
-
}, "CBM"))), React.createElement("tbody", null, orderProduct.length > 0 && (orderProduct == null ? void 0 : orderProduct.map(function (item, index) {
|
|
9393
|
-
return React.createElement("tr", {
|
|
9394
|
-
key: index
|
|
9395
|
-
}, React.createElement("td", null, React.createElement(AntSelect, {
|
|
9396
|
-
options: typeOptions,
|
|
9397
|
-
placeholder: "Deliver",
|
|
9398
|
-
onChange: function onChange(value) {
|
|
9399
|
-
return onSelectChange(index, value);
|
|
9400
|
-
},
|
|
9401
|
-
disabled: false,
|
|
9402
|
-
style: {
|
|
9403
|
-
width: 120
|
|
9404
|
-
},
|
|
9405
|
-
onSearch: onSearch,
|
|
9406
|
-
showSearch: true,
|
|
9407
|
-
popupClassName: 'dropDownStyle',
|
|
9408
|
-
selectWrapperClass: ''
|
|
9409
|
-
})), React.createElement("td", null, React.createElement("div", {
|
|
9410
|
-
className: "inputWrap"
|
|
9411
|
-
}, React.createElement("input", {
|
|
9412
|
-
type: "text",
|
|
9413
|
-
placeholder: "code",
|
|
9414
|
-
value: item.code,
|
|
9415
|
-
onChange: function onChange(e) {
|
|
9416
|
-
return handleInputChange(index, 'code', e.target.value);
|
|
9417
|
-
}
|
|
9418
|
-
}))), React.createElement("td", null, React.createElement("div", {
|
|
9419
|
-
className: "inputWrap"
|
|
9420
|
-
}, React.createElement("input", {
|
|
9421
|
-
type: "text",
|
|
9422
|
-
placeholder: "Enter Description of Product",
|
|
9423
|
-
value: item.description,
|
|
9424
|
-
onChange: function onChange(e) {
|
|
9425
|
-
return handleInputChange(index, 'description', e.target.value);
|
|
9426
|
-
}
|
|
9427
|
-
}))), React.createElement("td", null, React.createElement("div", {
|
|
9428
|
-
className: "inputWrap"
|
|
9429
|
-
}, React.createElement("input", {
|
|
9430
|
-
type: "text",
|
|
9431
|
-
placeholder: "Enter barcode of product",
|
|
9432
|
-
value: item.sku,
|
|
9433
|
-
onChange: function onChange(e) {
|
|
9434
|
-
return handleInputChange(index, 'sku', e.target.value);
|
|
9435
|
-
}
|
|
9436
|
-
}), React.createElement(BarCode, null))), React.createElement("td", null, React.createElement("div", {
|
|
9437
|
-
className: "inputWrap"
|
|
9438
|
-
}, React.createElement("input", {
|
|
9439
|
-
type: "text",
|
|
9440
|
-
placeholder: "00.00",
|
|
9441
|
-
value: item.weight,
|
|
9442
|
-
onChange: function onChange(e) {
|
|
9443
|
-
return handleInputChange(index, 'weight', parseFloat(e.target.value));
|
|
9444
|
-
}
|
|
9445
|
-
}), React.createElement(WeightIcon, null))), React.createElement("td", null, React.createElement("div", {
|
|
9446
|
-
className: "inputWrap"
|
|
9447
|
-
}, React.createElement("input", {
|
|
9448
|
-
type: "text",
|
|
9449
|
-
placeholder: "00.00",
|
|
9450
|
-
value: item.cube,
|
|
9451
|
-
onChange: function onChange(e) {
|
|
9452
|
-
return handleInputChange(index, 'cube', parseFloat(e.target.value));
|
|
9453
|
-
}
|
|
9454
|
-
}), React.createElement(CbmIcon, null))));
|
|
9455
|
-
}))))));
|
|
9456
|
-
};
|
|
9457
|
-
var GLobalPopupContent$5 = /*#__PURE__*/styled.div(_templateObject$2d || (_templateObject$2d = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
9458
|
-
var SimpleTable = /*#__PURE__*/styled.div(_templateObject2$1C || (_templateObject2$1C = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 0 15px;\n min-height: 158px;\n table {\n border-spacing: 0px 12px;\n border-collapse: separate;\n thead {\n tr {\n th {\n padding: 0 10px 0;\n color: #6a7378;\n font-size: 14px;\n font-style: normal;\n font-weight: 500;\n line-height: 20px;\n text-align: left;\n span {\n position: relative;\n em {\n color: #fc5555;\n font-style: normal;\n }\n }\n }\n }\n }\n tbody {\n tr {\n td {\n padding: 10px 8px;\n background: #f8fafc;\n box-shadow: 5px 1px 5px 0px rgba(16, 24, 40, 0.1);\n\n .inputWrap {\n position: relative;\n input[type='text'] {\n border-radius: 6px;\n border: 1px solid #e0e2e7;\n background: #fff;\n box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n padding: 8px 10px;\n width: 100%;\n padding-right: 30px;\n &:focus-visible {\n outline: none;\n }\n }\n svg {\n position: absolute;\n right: 11px;\n top: 7px;\n }\n }\n &:first-child {\n border-radius: 5px 0 0 5px;\n }\n &:last-child {\n border-radius: 0 5px 5px 0;\n }\n }\n }\n }\n }\n"])));
|
|
9459
|
-
|
|
9460
|
-
var _templateObject$2e;
|
|
9567
|
+
var _templateObject$2d;
|
|
9461
9568
|
var LogsTable = function LogsTable() {
|
|
9462
9569
|
var options = [{
|
|
9463
9570
|
value: 'bjsCouriers',
|
|
@@ -9532,9 +9639,9 @@ var LogsTable = function LogsTable() {
|
|
|
9532
9639
|
}
|
|
9533
9640
|
})));
|
|
9534
9641
|
};
|
|
9535
|
-
var GlobalPopupContent = /*#__PURE__*/styled.div(_templateObject$
|
|
9642
|
+
var GlobalPopupContent = /*#__PURE__*/styled.div(_templateObject$2d || (_templateObject$2d = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
9536
9643
|
|
|
9537
|
-
var _templateObject$
|
|
9644
|
+
var _templateObject$2e, _templateObject2$1C;
|
|
9538
9645
|
var DefectsModal = function DefectsModal() {
|
|
9539
9646
|
var options = [{
|
|
9540
9647
|
value: 'bjsCouriers',
|
|
@@ -9577,7 +9684,7 @@ var DefectsModal = function DefectsModal() {
|
|
|
9577
9684
|
key: 'images',
|
|
9578
9685
|
title: 'Images'
|
|
9579
9686
|
}];
|
|
9580
|
-
return React.createElement(React.Fragment, null, React.createElement(GLobalPopupContent$
|
|
9687
|
+
return React.createElement(React.Fragment, null, React.createElement(GLobalPopupContent$5, null, React.createElement(StyledConatiner, null, React.createElement(AntTable, {
|
|
9581
9688
|
columns: columns,
|
|
9582
9689
|
data: DefectsData,
|
|
9583
9690
|
selectOptions: options,
|
|
@@ -9586,10 +9693,10 @@ var DefectsModal = function DefectsModal() {
|
|
|
9586
9693
|
}
|
|
9587
9694
|
}))));
|
|
9588
9695
|
};
|
|
9589
|
-
var StyledConatiner = /*#__PURE__*/styled.div(_templateObject$
|
|
9590
|
-
var GLobalPopupContent$
|
|
9696
|
+
var StyledConatiner = /*#__PURE__*/styled.div(_templateObject$2e || (_templateObject$2e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* tex: nowrap; */\n"])));
|
|
9697
|
+
var GLobalPopupContent$5 = /*#__PURE__*/styled.div(_templateObject2$1C || (_templateObject2$1C = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
9591
9698
|
|
|
9592
|
-
var _templateObject$
|
|
9699
|
+
var _templateObject$2f;
|
|
9593
9700
|
var repackModal = function repackModal() {
|
|
9594
9701
|
var columns = [{
|
|
9595
9702
|
key: 'packaging_type',
|
|
@@ -9619,28 +9726,24 @@ var repackModal = function repackModal() {
|
|
|
9619
9726
|
}
|
|
9620
9727
|
}))));
|
|
9621
9728
|
};
|
|
9622
|
-
var StyledConatiner$1 = /*#__PURE__*/styled.div(_templateObject$
|
|
9729
|
+
var StyledConatiner$1 = /*#__PURE__*/styled.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* text-wrap: nowrap; */\n"])));
|
|
9623
9730
|
|
|
9624
|
-
var _templateObject$
|
|
9731
|
+
var _templateObject$2g, _templateObject2$1D, _templateObject3$X;
|
|
9625
9732
|
var CreateReturnModal = function CreateReturnModal() {
|
|
9626
|
-
var _useState = useState(),
|
|
9733
|
+
var _useState = useState([]),
|
|
9734
|
+
selectedlocation = _useState[0],
|
|
9627
9735
|
setSelectedLocations = _useState[1];
|
|
9628
|
-
var
|
|
9629
|
-
|
|
9736
|
+
var _useSelectedOrders = useSelectedOrders(),
|
|
9737
|
+
selectedReturnOrder = _useSelectedOrders[0];
|
|
9630
9738
|
var handleSelectLocations = function handleSelectLocations(id) {
|
|
9631
9739
|
setSelectedLocations(function (prevSelectedLocations) {
|
|
9632
|
-
var isSelected = prevSelectedLocations
|
|
9633
|
-
return location.id === id;
|
|
9634
|
-
});
|
|
9740
|
+
var isSelected = prevSelectedLocations.includes(id);
|
|
9635
9741
|
if (isSelected) {
|
|
9636
|
-
return prevSelectedLocations.filter(function (
|
|
9637
|
-
return
|
|
9742
|
+
return prevSelectedLocations.filter(function (selectedId) {
|
|
9743
|
+
return selectedId !== id;
|
|
9638
9744
|
});
|
|
9639
9745
|
} else {
|
|
9640
|
-
return [].concat(prevSelectedLocations, [
|
|
9641
|
-
id: id,
|
|
9642
|
-
status_id: 3
|
|
9643
|
-
}]);
|
|
9746
|
+
return [].concat(prevSelectedLocations, [id]);
|
|
9644
9747
|
}
|
|
9645
9748
|
});
|
|
9646
9749
|
};
|
|
@@ -9655,38 +9758,38 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9655
9758
|
listStyle: 'none',
|
|
9656
9759
|
padding: 0
|
|
9657
9760
|
}
|
|
9658
|
-
},
|
|
9761
|
+
}, selectedReturnOrder == null ? void 0 : selectedReturnOrder.map(function (returnLoc) {
|
|
9659
9762
|
return React.createElement("li", {
|
|
9660
|
-
key:
|
|
9763
|
+
key: returnLoc.id,
|
|
9661
9764
|
style: {
|
|
9662
9765
|
marginBottom: '8px',
|
|
9663
9766
|
display: 'flex',
|
|
9664
9767
|
alignItems: 'center'
|
|
9665
9768
|
}
|
|
9666
9769
|
}, React.createElement(Checkbox$1, {
|
|
9667
|
-
checked:
|
|
9770
|
+
checked: selectedlocation.includes(returnLoc.id),
|
|
9668
9771
|
onChange: function onChange() {
|
|
9669
|
-
return handleSelectLocations(
|
|
9772
|
+
return handleSelectLocations(returnLoc.id);
|
|
9670
9773
|
}
|
|
9671
9774
|
}), React.createElement(StyledText$1, {
|
|
9672
9775
|
style: {
|
|
9673
9776
|
marginLeft: '8px'
|
|
9674
9777
|
}
|
|
9675
|
-
},
|
|
9778
|
+
}, returnLoc == null ? void 0 : returnLoc.return_location));
|
|
9676
9779
|
}))));
|
|
9677
9780
|
};
|
|
9678
|
-
var StyledText$1 = /*#__PURE__*/styled.div(_templateObject$
|
|
9679
|
-
var Container$1b = /*#__PURE__*/styled.div(_templateObject2$
|
|
9781
|
+
var StyledText$1 = /*#__PURE__*/styled.div(_templateObject$2g || (_templateObject$2g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #8d8f90;\n font-family: Poppins;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n"])));
|
|
9782
|
+
var Container$1b = /*#__PURE__*/styled.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
9680
9783
|
var Wrapper$l = /*#__PURE__*/styled.div(_templateObject3$X || (_templateObject3$X = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 15px;\n flex-direction: column;\n justify-content: center;\n align-items: flex-start;\n gap: 15px;\n align-self: stretch;\n border-radius: 8px;\n background: #f8fafc;\n box-shadow: 0px 1px 3px 0px rgba(16, 24, 40, 0.1);\n"])));
|
|
9681
9784
|
|
|
9785
|
+
var _excluded$2 = ["id"];
|
|
9682
9786
|
var ModalManager = function ModalManager() {
|
|
9683
9787
|
var _useAtom = useAtom(countReducerAtom),
|
|
9684
9788
|
popupName = _useAtom[0],
|
|
9685
9789
|
dispatch = _useAtom[1];
|
|
9686
9790
|
var _useProductDetails = useProductDetails();
|
|
9687
9791
|
var _useCreateOrderProduc = useCreateOrderProducts(),
|
|
9688
|
-
orderProduct = _useCreateOrderProduc[0]
|
|
9689
|
-
setOrderProduct = _useCreateOrderProduc[1];
|
|
9792
|
+
orderProduct = _useCreateOrderProduc[0];
|
|
9690
9793
|
var _useOrderId = useOrderId(),
|
|
9691
9794
|
orderId = _useOrderId[0];
|
|
9692
9795
|
var _useDeleteProdsID = useDeleteProdsID(),
|
|
@@ -9703,6 +9806,9 @@ var ModalManager = function ModalManager() {
|
|
|
9703
9806
|
selectedTab = _useAtom3[0];
|
|
9704
9807
|
var _useState = useState(false),
|
|
9705
9808
|
setIsFormValid = _useState[1];
|
|
9809
|
+
var _useNewReturnPayload = useNewReturnPayload(),
|
|
9810
|
+
newPayload = _useNewReturnPayload[0],
|
|
9811
|
+
setNewPayload = _useNewReturnPayload[1];
|
|
9706
9812
|
console.log(orderProduct, 'abcabcabcabcabcabcabcabcabcabcabc');
|
|
9707
9813
|
var _closeModal = function closeModal() {
|
|
9708
9814
|
dispatch({
|
|
@@ -9753,68 +9859,73 @@ var ModalManager = function ModalManager() {
|
|
|
9753
9859
|
// }
|
|
9754
9860
|
// };
|
|
9755
9861
|
// API block for creating product order
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
}
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9862
|
+
// const {
|
|
9863
|
+
// data: response,
|
|
9864
|
+
// setShouldPerformAction: setOrderAction,
|
|
9865
|
+
// } = useApiHook<{
|
|
9866
|
+
// data: ApiResponse[];
|
|
9867
|
+
// }>({
|
|
9868
|
+
// endpoint: `order/order_products/create/`,
|
|
9869
|
+
// method: 'POST',
|
|
9870
|
+
// body: [orderProduct],
|
|
9871
|
+
// performAction: false,
|
|
9872
|
+
// });
|
|
9873
|
+
// const validateAddForm = () => {
|
|
9874
|
+
// if (!Array.isArray(orderProduct)) return false;
|
|
9875
|
+
// return orderProduct.every(
|
|
9876
|
+
// (product: any) =>
|
|
9877
|
+
// product.code !== '' &&
|
|
9878
|
+
// product.description !== '' &&
|
|
9879
|
+
// product.weight !== 0 &&
|
|
9880
|
+
// product.cube !== 0 &&
|
|
9881
|
+
// product.order_product_type_id !== 0 &&
|
|
9882
|
+
// product.sku !== ''
|
|
9883
|
+
// );
|
|
9884
|
+
// };
|
|
9885
|
+
// useEffect(() => {
|
|
9886
|
+
// setAddIsFormValid(validateAddForm());
|
|
9887
|
+
// }, [orderProduct]);
|
|
9888
|
+
// const onAddOrderProduct = () => {
|
|
9889
|
+
// if (isAddFormValid) {
|
|
9890
|
+
// setOrderProduct((prev: any) =>
|
|
9891
|
+
// prev.map((product: any) => ({
|
|
9892
|
+
// ...product,
|
|
9893
|
+
// order_id: orderId,
|
|
9894
|
+
// }))
|
|
9895
|
+
// );
|
|
9896
|
+
// setOrderAction(true);
|
|
9897
|
+
// } else {
|
|
9898
|
+
// console.log('Please fill in all required fields before proceeding.');
|
|
9899
|
+
// }
|
|
9900
|
+
// };
|
|
9901
|
+
// useEffect(() => {
|
|
9902
|
+
// if (response && response?.data) {
|
|
9903
|
+
// dispatch({ type: 'close' });
|
|
9904
|
+
// }
|
|
9905
|
+
// }, [response]);
|
|
9906
|
+
// const [isAddFormValid, setAddIsFormValid] = useState(false);
|
|
9907
|
+
// const AddMore = () => {
|
|
9908
|
+
// setOrderProduct((prevProducts: any) => [
|
|
9909
|
+
// ...prevProducts,
|
|
9910
|
+
// {
|
|
9911
|
+
// code: '',
|
|
9912
|
+
// description: '',
|
|
9913
|
+
// sku: '',
|
|
9914
|
+
// weight: '',
|
|
9915
|
+
// cube: '',
|
|
9916
|
+
// order_product_type_id: '',
|
|
9917
|
+
// },
|
|
9918
|
+
// ]);
|
|
9919
|
+
// };
|
|
9809
9920
|
// api block for the create product order
|
|
9810
|
-
var
|
|
9921
|
+
var _useApiHook = useApiHook({
|
|
9811
9922
|
endpoint: "order/order_products/unrecieve/",
|
|
9812
9923
|
method: 'POST',
|
|
9813
9924
|
body: [unRecieve],
|
|
9814
9925
|
performAction: false
|
|
9815
9926
|
}),
|
|
9816
|
-
actionResponse =
|
|
9817
|
-
setUnrecieveaction =
|
|
9927
|
+
actionResponse = _useApiHook.data,
|
|
9928
|
+
setUnrecieveaction = _useApiHook.setShouldPerformAction;
|
|
9818
9929
|
useEffect(function () {
|
|
9819
9930
|
if (actionResponse && actionResponse != null && actionResponse.data) {
|
|
9820
9931
|
dispatch({
|
|
@@ -9823,14 +9934,14 @@ var ModalManager = function ModalManager() {
|
|
|
9823
9934
|
}
|
|
9824
9935
|
}, [actionResponse]);
|
|
9825
9936
|
// api block for the update product order
|
|
9826
|
-
var
|
|
9937
|
+
var _useApiHook2 = useApiHook({
|
|
9827
9938
|
endpoint: "order/order_products/type/update/",
|
|
9828
9939
|
method: 'PUT',
|
|
9829
9940
|
body: [updateOrderProduct],
|
|
9830
9941
|
performAction: false
|
|
9831
9942
|
}),
|
|
9832
|
-
updateResponse =
|
|
9833
|
-
setUpdateSction =
|
|
9943
|
+
updateResponse = _useApiHook2.data,
|
|
9944
|
+
setUpdateSction = _useApiHook2.setShouldPerformAction;
|
|
9834
9945
|
// const onUnrecieveProductOrder = () => {
|
|
9835
9946
|
// setUnRecieve((prev: any) => ({
|
|
9836
9947
|
// ...prev,
|
|
@@ -9869,6 +9980,28 @@ var ModalManager = function ModalManager() {
|
|
|
9869
9980
|
});
|
|
9870
9981
|
}
|
|
9871
9982
|
}, [updateResponse]);
|
|
9983
|
+
//Confirm return popup
|
|
9984
|
+
var _useApiHook3 = useApiHook({
|
|
9985
|
+
endpoint: "return_orders/",
|
|
9986
|
+
method: 'POST',
|
|
9987
|
+
body: [newPayload],
|
|
9988
|
+
performAction: false
|
|
9989
|
+
}),
|
|
9990
|
+
response = _useApiHook3.data,
|
|
9991
|
+
setShouldPerformAction = _useApiHook3.setShouldPerformAction;
|
|
9992
|
+
var handleConfirmReturn = function handleConfirmReturn() {
|
|
9993
|
+
var payloadWithoutId = newPayload == null ? void 0 : newPayload.map(function (_ref) {
|
|
9994
|
+
var rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
9995
|
+
return _extends({}, rest);
|
|
9996
|
+
});
|
|
9997
|
+
console.log(response);
|
|
9998
|
+
if (payloadWithoutId) {
|
|
9999
|
+
setNewPayload(payloadWithoutId);
|
|
10000
|
+
setShouldPerformAction(true);
|
|
10001
|
+
} else {
|
|
10002
|
+
setShouldPerformAction(false);
|
|
10003
|
+
}
|
|
10004
|
+
};
|
|
9872
10005
|
return React.createElement(React.Fragment, null, (popupName == null ? void 0 : popupName.state) == 'create-return' && React.createElement(AntModal, {
|
|
9873
10006
|
openStatus: (popupName == null ? void 0 : popupName.state) == 'create-return' ? true : false,
|
|
9874
10007
|
closeModal: function closeModal() {
|
|
@@ -9882,37 +10015,15 @@ var ModalManager = function ModalManager() {
|
|
|
9882
10015
|
btns: [{
|
|
9883
10016
|
name: 'Submit',
|
|
9884
10017
|
btnStyle: 'rounded',
|
|
9885
|
-
|
|
10018
|
+
onClick: handleConfirmReturn,
|
|
10019
|
+
type: 'button',
|
|
10020
|
+
disabled: !newPayload
|
|
9886
10021
|
}],
|
|
9887
10022
|
btnAlign: 'justifyEnd'
|
|
9888
10023
|
},
|
|
9889
10024
|
BodyComponent: CreateReturnModal,
|
|
9890
10025
|
width: 800,
|
|
9891
10026
|
classNameAdd: 'globalPopup'
|
|
9892
|
-
}), (popupName == null ? void 0 : popupName.state) === 'addProduct' && React.createElement(AntModal, {
|
|
9893
|
-
openStatus: (popupName == null ? void 0 : popupName.state) === 'addProduct',
|
|
9894
|
-
closeModal: _closeModal,
|
|
9895
|
-
PopupHeader: {
|
|
9896
|
-
heading: 'Add Product(s) to Order',
|
|
9897
|
-
subHeading: 'Full Stock Control'
|
|
9898
|
-
},
|
|
9899
|
-
PopupFooter: {
|
|
9900
|
-
btns: [{
|
|
9901
|
-
name: 'Add More Product',
|
|
9902
|
-
btnStyle: 'normalLink',
|
|
9903
|
-
icon: 'addIcon',
|
|
9904
|
-
onClick: AddMore
|
|
9905
|
-
}, {
|
|
9906
|
-
name: 'Save Details',
|
|
9907
|
-
btnStyle: 'rounded',
|
|
9908
|
-
onClick: onAddOrderProduct,
|
|
9909
|
-
disabled: !isAddFormValid
|
|
9910
|
-
}],
|
|
9911
|
-
btnAlign: 'justifySpaceBetween'
|
|
9912
|
-
},
|
|
9913
|
-
BodyComponent: AddProduct,
|
|
9914
|
-
width: 1104,
|
|
9915
|
-
classNameAdd: 'globalPopup'
|
|
9916
10027
|
}), (popupName == null ? void 0 : popupName.state) === 'qclog' && React.createElement(AntModal, {
|
|
9917
10028
|
openStatus: (popupName == null ? void 0 : popupName.state) === 'qclog',
|
|
9918
10029
|
closeModal: _closeModal,
|
|
@@ -9985,14 +10096,14 @@ var ModalManager = function ModalManager() {
|
|
|
9985
10096
|
}));
|
|
9986
10097
|
};
|
|
9987
10098
|
|
|
9988
|
-
var _templateObject$
|
|
10099
|
+
var _templateObject$2h, _templateObject2$1E;
|
|
9989
10100
|
var ReturnTable = function ReturnTable() {
|
|
9990
10101
|
return React.createElement("div", null, React.createElement(DashBoardWrapper$1, null, React.createElement(RouterHeader, null), React.createElement("div", {
|
|
9991
10102
|
className: "Tableconatiner"
|
|
9992
10103
|
}, React.createElement(HeaderFilter, null), React.createElement(Container$1c, null, React.createElement(ReturnFilter, null), React.createElement(ReturnOrderTable, null)))), React.createElement(ModalManager, null));
|
|
9993
10104
|
};
|
|
9994
|
-
var Container$1c = /*#__PURE__*/styled.div(_templateObject$
|
|
9995
|
-
var DashBoardWrapper$1 = /*#__PURE__*/styled.section(_templateObject2$
|
|
10105
|
+
var Container$1c = /*#__PURE__*/styled.div(_templateObject$2h || (_templateObject$2h = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
|
|
10106
|
+
var DashBoardWrapper$1 = /*#__PURE__*/styled.section(_templateObject2$1E || (_templateObject2$1E = /*#__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"])));
|
|
9996
10107
|
|
|
9997
10108
|
function LoadIcon() {
|
|
9998
10109
|
return React.createElement("svg", {
|
|
@@ -10215,7 +10326,7 @@ var OrderTable = function OrderTable(_ref) {
|
|
|
10215
10326
|
})))));
|
|
10216
10327
|
};
|
|
10217
10328
|
|
|
10218
|
-
var _templateObject$
|
|
10329
|
+
var _templateObject$2i, _templateObject2$1F, _templateObject3$Y, _templateObject4$E;
|
|
10219
10330
|
var TableFilters = function TableFilters() {
|
|
10220
10331
|
return React.createElement(Container$1d, null, React.createElement(StyledBulkItem, null, React.createElement(SearchType, null)), React.createElement(IconConatiner$1, null, React.createElement(Mid$1, null, React.createElement(IconText$1, null, "Export"), React.createElement(DownloadIcon, null))));
|
|
10221
10332
|
// return (
|
|
@@ -10231,8 +10342,8 @@ var TableFilters = function TableFilters() {
|
|
|
10231
10342
|
// // </StyledBulkFilterCover>
|
|
10232
10343
|
// );
|
|
10233
10344
|
};
|
|
10234
|
-
var Container$1d = /*#__PURE__*/styled.div(_templateObject$
|
|
10235
|
-
var Mid$1 = /*#__PURE__*/styled.div(_templateObject2$
|
|
10345
|
+
var Container$1d = /*#__PURE__*/styled.div(_templateObject$2i || (_templateObject$2i = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n /* align-items: flex-start; */\n gap: 16px;\n align-items: center;\n"])));
|
|
10346
|
+
var Mid$1 = /*#__PURE__*/styled.div(_templateObject2$1F || (_templateObject2$1F = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n padding: 10px 10px 10px 10px;\n align-items: center;\n gap: 8px;\n align-self: stretch;\n /* border-radius: 15px 15px 15px 15px; */\n"])));
|
|
10236
10347
|
// const TextConatiner = styled.div`
|
|
10237
10348
|
// display: flex;
|
|
10238
10349
|
// padding: 7px 12px;
|
|
@@ -10299,19 +10410,6 @@ var DateIcon = function DateIcon() {
|
|
|
10299
10410
|
}));
|
|
10300
10411
|
};
|
|
10301
10412
|
|
|
10302
|
-
var DownArrowIcon = function DownArrowIcon() {
|
|
10303
|
-
return React.createElement("svg", {
|
|
10304
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10305
|
-
width: "8",
|
|
10306
|
-
height: "4",
|
|
10307
|
-
viewBox: "0 0 8 4",
|
|
10308
|
-
fill: "none"
|
|
10309
|
-
}, React.createElement("path", {
|
|
10310
|
-
d: "M0.350098 0.125L4.1001 3.875L7.8501 0.125H0.350098Z",
|
|
10311
|
-
fill: "#888075"
|
|
10312
|
-
}));
|
|
10313
|
-
};
|
|
10314
|
-
|
|
10315
10413
|
var StatusIcon = function StatusIcon() {
|
|
10316
10414
|
return React.createElement("svg", {
|
|
10317
10415
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10369,37 +10467,143 @@ var AssigneIcon = function AssigneIcon() {
|
|
|
10369
10467
|
}))));
|
|
10370
10468
|
};
|
|
10371
10469
|
|
|
10372
|
-
var
|
|
10470
|
+
var initialState$2 = {
|
|
10471
|
+
'x-filters': [],
|
|
10472
|
+
'x-pagination': {
|
|
10473
|
+
page: 1,
|
|
10474
|
+
per_page: 50
|
|
10475
|
+
}
|
|
10476
|
+
};
|
|
10477
|
+
var filterReducer$1 = function filterReducer(state, action) {
|
|
10478
|
+
switch (action.type) {
|
|
10479
|
+
case 'SET_DATE_FILTER':
|
|
10480
|
+
return _extends({}, state, {
|
|
10481
|
+
'x-filters': [].concat(state['x-filters'].filter(function (f) {
|
|
10482
|
+
return f.field !== 'created_at';
|
|
10483
|
+
}), [{
|
|
10484
|
+
field: 'created_at',
|
|
10485
|
+
op: '>=',
|
|
10486
|
+
value: format(new Date(action.payload), 'yyyy-MM-dd') + "T00:00:00+00:00"
|
|
10487
|
+
}, {
|
|
10488
|
+
field: 'created_at',
|
|
10489
|
+
op: '<=',
|
|
10490
|
+
value: format(new Date(action.payload), 'yyyy-MM-dd') + "T23:59:59+00:00"
|
|
10491
|
+
}])
|
|
10492
|
+
});
|
|
10493
|
+
case 'SET_CLIENT_FILTER':
|
|
10494
|
+
return _extends({}, state, {
|
|
10495
|
+
'x-filters': [].concat(state['x-filters'].filter(function (f) {
|
|
10496
|
+
return f.field !== 'customer_id';
|
|
10497
|
+
}), [{
|
|
10498
|
+
field: 'customer_id',
|
|
10499
|
+
op: '=',
|
|
10500
|
+
value: action.payload
|
|
10501
|
+
}])
|
|
10502
|
+
});
|
|
10503
|
+
// case 'SET_ACTIONS_FILTER':
|
|
10504
|
+
// return {
|
|
10505
|
+
// ...state,
|
|
10506
|
+
// 'x-filters': [
|
|
10507
|
+
// ...state['x-filters'].filter(
|
|
10508
|
+
// f => f.field !== 'product_return_action_id'
|
|
10509
|
+
// ),
|
|
10510
|
+
// {
|
|
10511
|
+
// field: 'product_return_action_id',
|
|
10512
|
+
// op: '=',
|
|
10513
|
+
// value: action.payload,
|
|
10514
|
+
// },
|
|
10515
|
+
// ],
|
|
10516
|
+
// };
|
|
10517
|
+
// case 'SET_LOCATION_FILTER':
|
|
10518
|
+
// return {
|
|
10519
|
+
// ...state,
|
|
10520
|
+
// 'x-filters': [
|
|
10521
|
+
// ...state['x-filters'].filter(f => f.field !== 'return_location'),
|
|
10522
|
+
// {
|
|
10523
|
+
// field: 'return_location',
|
|
10524
|
+
// op: 'in',
|
|
10525
|
+
// value: action.payload,
|
|
10526
|
+
// },
|
|
10527
|
+
// ],
|
|
10528
|
+
// };
|
|
10529
|
+
case 'SET_PAGE':
|
|
10530
|
+
return _extends({}, state, {
|
|
10531
|
+
'x-pagination': _extends({}, state['x-pagination'], {
|
|
10532
|
+
page: action.payload
|
|
10533
|
+
})
|
|
10534
|
+
});
|
|
10535
|
+
case 'SET_PERPAGE':
|
|
10536
|
+
return _extends({}, state, {
|
|
10537
|
+
'x-pagination': _extends({}, state['x-pagination'], {
|
|
10538
|
+
per_page: action.payload
|
|
10539
|
+
})
|
|
10540
|
+
});
|
|
10541
|
+
case 'CLEAR_FILTERS':
|
|
10542
|
+
return _extends({}, state);
|
|
10543
|
+
default:
|
|
10544
|
+
return state;
|
|
10545
|
+
}
|
|
10546
|
+
};
|
|
10547
|
+
var filtersStateAtom$1 = /*#__PURE__*/atom(initialState$2);
|
|
10548
|
+
var filtersReducerAtom$1 = /*#__PURE__*/atom(function (get) {
|
|
10549
|
+
return get(filtersStateAtom$1);
|
|
10550
|
+
}, function (get, set, action) {
|
|
10551
|
+
return set(filtersStateAtom$1, filterReducer$1(get(filtersStateAtom$1), action));
|
|
10552
|
+
});
|
|
10553
|
+
|
|
10554
|
+
var _templateObject$2j, _templateObject2$1G;
|
|
10373
10555
|
var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
10374
|
-
var
|
|
10375
|
-
|
|
10376
|
-
|
|
10377
|
-
|
|
10378
|
-
|
|
10379
|
-
|
|
10380
|
-
|
|
10381
|
-
|
|
10382
|
-
|
|
10383
|
-
|
|
10384
|
-
|
|
10385
|
-
|
|
10386
|
-
|
|
10387
|
-
|
|
10388
|
-
|
|
10389
|
-
|
|
10390
|
-
|
|
10391
|
-
|
|
10392
|
-
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10556
|
+
var _useAtom = useAtom(filtersReducerAtom$1),
|
|
10557
|
+
dispatch = _useAtom[1];
|
|
10558
|
+
var _useCustomerData = useCustomerData(),
|
|
10559
|
+
customers = _useCustomerData[0];
|
|
10560
|
+
var _useState = useState(),
|
|
10561
|
+
selectedDate = _useState[0],
|
|
10562
|
+
setSelectedDate = _useState[1];
|
|
10563
|
+
var zoneOptions = [{
|
|
10564
|
+
label: 'Zone 1',
|
|
10565
|
+
value: 'zone1'
|
|
10566
|
+
}, {
|
|
10567
|
+
label: 'Zone 2',
|
|
10568
|
+
value: 'zone2'
|
|
10569
|
+
}, {
|
|
10570
|
+
label: 'Zone 3',
|
|
10571
|
+
value: 'zone3'
|
|
10572
|
+
}, {
|
|
10573
|
+
label: 'Zone 4',
|
|
10574
|
+
value: 'zone4'
|
|
10575
|
+
}, {
|
|
10576
|
+
label: 'Zone 5',
|
|
10577
|
+
value: 'zone5'
|
|
10578
|
+
}];
|
|
10579
|
+
// date change here
|
|
10580
|
+
var handleDateChange = function handleDateChange(date) {
|
|
10581
|
+
setSelectedDate(date ? date == null ? void 0 : date.$d : null);
|
|
10582
|
+
console.log(selectedDate, 'selected');
|
|
10583
|
+
};
|
|
10584
|
+
useEffect(function () {
|
|
10585
|
+
if (selectedDate) {
|
|
10586
|
+
console.log(selectedDate, 'selected');
|
|
10587
|
+
dispatch({
|
|
10588
|
+
type: 'SET_DATE_FILTER',
|
|
10589
|
+
payload: selectedDate
|
|
10401
10590
|
});
|
|
10402
10591
|
}
|
|
10592
|
+
}, [selectedDate]);
|
|
10593
|
+
//client options
|
|
10594
|
+
var clientOptions = customers == null ? void 0 : customers.map(function (option) {
|
|
10595
|
+
var _option$customer_name, _option$customer_name2;
|
|
10596
|
+
return {
|
|
10597
|
+
label: (option == null || (_option$customer_name = option.customer_name) == null || (_option$customer_name = _option$customer_name.charAt(0)) == null ? void 0 : _option$customer_name.toUpperCase()) + (option == null || (_option$customer_name2 = option.customer_name) == null ? void 0 : _option$customer_name2.slice(1)),
|
|
10598
|
+
value: option == null ? void 0 : option.id
|
|
10599
|
+
};
|
|
10600
|
+
});
|
|
10601
|
+
var handleClientChange = function handleClientChange(value) {
|
|
10602
|
+
console.log(value, 'value');
|
|
10603
|
+
dispatch({
|
|
10604
|
+
type: 'SET_CLIENT_FILTER',
|
|
10605
|
+
payload: value
|
|
10606
|
+
});
|
|
10403
10607
|
};
|
|
10404
10608
|
return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(StyledFIlterELements, null, React.createElement(LeftSideConatiner, null, React.createElement("div", {
|
|
10405
10609
|
className: "filtercontainer"
|
|
@@ -10413,48 +10617,105 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10413
10617
|
className: "dateiconcontainer"
|
|
10414
10618
|
}, React.createElement(DateIcon, null)), React.createElement(StyledDatePicker, null, React.createElement(DatePicker, {
|
|
10415
10619
|
className: "custom-datepicker",
|
|
10416
|
-
onChange:
|
|
10417
|
-
|
|
10620
|
+
onChange: handleDateChange,
|
|
10621
|
+
style: {
|
|
10622
|
+
width: '100px'
|
|
10623
|
+
},
|
|
10624
|
+
value: selectedDate ? dayjs(selectedDate) : null,
|
|
10418
10625
|
format: "DD/MM/YY",
|
|
10419
|
-
placeholder: "Date"
|
|
10626
|
+
placeholder: "Date",
|
|
10627
|
+
needConfirm: true
|
|
10420
10628
|
}))), React.createElement("div", {
|
|
10421
10629
|
className: "datefilter"
|
|
10422
10630
|
}, React.createElement("div", {
|
|
10423
10631
|
className: "dateiconcontainer"
|
|
10424
|
-
},
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10632
|
+
}, React.createElement(StatusIcon, null)), React.createElement(StyledAntSelect$d, null, React.createElement(Select, {
|
|
10633
|
+
options: zoneOptions,
|
|
10634
|
+
className: "custom-select",
|
|
10635
|
+
placeholder: "Status of Order",
|
|
10636
|
+
onChange: function onChange() {},
|
|
10637
|
+
style: {
|
|
10638
|
+
minWidth: '115px'
|
|
10639
|
+
},
|
|
10640
|
+
maxTagCount: 0,
|
|
10641
|
+
maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
|
|
10642
|
+
return React.createElement(Tooltip, {
|
|
10643
|
+
overlayStyle: {
|
|
10644
|
+
pointerEvents: 'none'
|
|
10645
|
+
},
|
|
10646
|
+
title: omittedValues.map(function (_ref) {
|
|
10647
|
+
var label = _ref.label;
|
|
10648
|
+
return label;
|
|
10649
|
+
}).join(', ')
|
|
10650
|
+
}, React.createElement("span", null, omittedValues.length + " selected"));
|
|
10651
|
+
}
|
|
10652
|
+
}))), React.createElement("div", {
|
|
10429
10653
|
className: "datefilter"
|
|
10430
10654
|
}, React.createElement("div", {
|
|
10431
10655
|
className: "dateiconcontainer"
|
|
10432
|
-
}, React.createElement(ClientIcon, null)), React.createElement(
|
|
10433
|
-
|
|
10434
|
-
|
|
10435
|
-
|
|
10436
|
-
|
|
10656
|
+
}, React.createElement(ClientIcon, null)), React.createElement(StyledAntSelect$d, null, React.createElement(Select, {
|
|
10657
|
+
options: clientOptions,
|
|
10658
|
+
className: "custom-select",
|
|
10659
|
+
placeholder: "Client",
|
|
10660
|
+
onChange: handleClientChange,
|
|
10661
|
+
style: {
|
|
10662
|
+
width: '125px'
|
|
10663
|
+
},
|
|
10664
|
+
maxTagCount: 0,
|
|
10665
|
+
maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
|
|
10666
|
+
return React.createElement(Tooltip, {
|
|
10667
|
+
overlayStyle: {
|
|
10668
|
+
pointerEvents: 'none'
|
|
10669
|
+
},
|
|
10670
|
+
title: omittedValues.map(function (_ref2) {
|
|
10671
|
+
var label = _ref2.label;
|
|
10672
|
+
return label;
|
|
10673
|
+
}).join(', ')
|
|
10674
|
+
}, React.createElement("span", null, omittedValues.length + " selected"));
|
|
10675
|
+
}
|
|
10676
|
+
}))), React.createElement("div", {
|
|
10437
10677
|
className: "datefilter"
|
|
10438
10678
|
}, React.createElement("div", {
|
|
10439
10679
|
className: "dateiconcontainer"
|
|
10440
|
-
}, React.createElement(AssigneIcon, null)), React.createElement(
|
|
10441
|
-
|
|
10442
|
-
|
|
10443
|
-
|
|
10444
|
-
|
|
10680
|
+
}, React.createElement(AssigneIcon, null)), React.createElement(StyledAntSelect$d, null, React.createElement(Select, {
|
|
10681
|
+
options: zoneOptions,
|
|
10682
|
+
className: "custom-select",
|
|
10683
|
+
placeholder: "Asignee",
|
|
10684
|
+
onChange: function onChange() {},
|
|
10685
|
+
style: {
|
|
10686
|
+
minWidth: '100px'
|
|
10687
|
+
},
|
|
10688
|
+
maxTagCount: 0,
|
|
10689
|
+
maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
|
|
10690
|
+
return React.createElement(Tooltip, {
|
|
10691
|
+
overlayStyle: {
|
|
10692
|
+
pointerEvents: 'none'
|
|
10693
|
+
},
|
|
10694
|
+
title: omittedValues.map(function (_ref3) {
|
|
10695
|
+
var label = _ref3.label;
|
|
10696
|
+
return label;
|
|
10697
|
+
}).join(', ')
|
|
10698
|
+
}, React.createElement("span", null, omittedValues.length + " selected"));
|
|
10699
|
+
}
|
|
10700
|
+
}))))), React.createElement(TableFilters, null)));
|
|
10445
10701
|
};
|
|
10446
|
-
var StyledDatePicker = /*#__PURE__*/styled.div(_templateObject$
|
|
10702
|
+
var StyledDatePicker = /*#__PURE__*/styled.div(_templateObject$2j || (_templateObject$2j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-datepicker {\n border: none;\n }\n"])));
|
|
10703
|
+
// const DropdownContainer = styled.div``;
|
|
10704
|
+
var StyledAntSelect$d = /*#__PURE__*/styled.div(_templateObject2$1G || (_templateObject2$1G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-select {\n border: none;\n width: 80px;\n }\n :where(.css-dev-only-do-not-override-m4timi).ant-select-single:not(.ant-select-customize-input)\n .ant-select-selector {\n padding: 0 5px;\n }\n\n :where(.css-dev-only-do-not-override-m4timi).ant-select-outlined:not(.ant-select-customize-input)\n .ant-select-selector {\n border: none;\n }\n .roundbox {\n display: flex;\n width: 18px;\n height: 18px;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n border-radius: 18px;\n background: #fff;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1);\n left: 359px;\n position: absolute;\n border-radius: 18px;\n background: #fff;\n box-shadow: 0px 1px 4px 0px rgba(0, 0, 0, 0.1);\n top: 16px;\n }\n"])));
|
|
10447
10705
|
|
|
10448
|
-
var _templateObject$
|
|
10706
|
+
var _templateObject$2k, _templateObject2$1H;
|
|
10449
10707
|
var ReturnAfterTable = function ReturnAfterTable() {
|
|
10450
10708
|
var _useReturnAfterOrderD = useReturnAfterOrderData(),
|
|
10451
|
-
returnAfterOrder = _useReturnAfterOrderD[0],
|
|
10452
10709
|
setReturnOrderData = _useReturnAfterOrderD[1];
|
|
10453
10710
|
var _useLoading = useLoading(),
|
|
10454
10711
|
setLoading = _useLoading[1];
|
|
10712
|
+
var _useAtom = useAtom(filtersReducerAtom$1),
|
|
10713
|
+
state = _useAtom[0];
|
|
10714
|
+
var filters = state['x-filters'];
|
|
10455
10715
|
var _useApiHook = useApiHook({
|
|
10456
10716
|
endpoint: '/return_orders/?skip_filters=0',
|
|
10457
|
-
method: 'GET'
|
|
10717
|
+
method: 'GET',
|
|
10718
|
+
filters: filters
|
|
10458
10719
|
}),
|
|
10459
10720
|
fetchedReturnOrderData = _useApiHook.data,
|
|
10460
10721
|
staticDataLoading = _useApiHook.loading;
|
|
@@ -10464,12 +10725,11 @@ var ReturnAfterTable = function ReturnAfterTable() {
|
|
|
10464
10725
|
setReturnOrderData(fetchedReturnOrderData == null ? void 0 : fetchedReturnOrderData.data);
|
|
10465
10726
|
}
|
|
10466
10727
|
}, [fetchedReturnOrderData, staticDataLoading]);
|
|
10467
|
-
console.log('returnAfterOrder', returnAfterOrder);
|
|
10468
10728
|
return React.createElement("div", null, React.createElement(DashBoardWrapper$2, null, React.createElement(RouterHeader, null), React.createElement("div", {
|
|
10469
10729
|
className: "Tableconatiner"
|
|
10470
10730
|
}, React.createElement(HeaderFilter, null), React.createElement(Container$1e, null, React.createElement(ReturnOrderFilter, null), React.createElement(OrderTable, null)))));
|
|
10471
10731
|
};
|
|
10472
|
-
var Container$1e = /*#__PURE__*/styled.div(_templateObject$
|
|
10732
|
+
var Container$1e = /*#__PURE__*/styled.div(_templateObject$2k || (_templateObject$2k = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -30px;\n"])));
|
|
10473
10733
|
var DashBoardWrapper$2 = /*#__PURE__*/styled.section(_templateObject2$1H || (_templateObject2$1H = /*#__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"])));
|
|
10474
10734
|
|
|
10475
10735
|
var BulkFilter = function BulkFilter() {
|
|
@@ -10499,7 +10759,7 @@ var BulkFilter = function BulkFilter() {
|
|
|
10499
10759
|
);
|
|
10500
10760
|
};
|
|
10501
10761
|
|
|
10502
|
-
var _excluded$
|
|
10762
|
+
var _excluded$3 = ["count"];
|
|
10503
10763
|
// import { useAtom } from 'jotai';
|
|
10504
10764
|
var Filters = function Filters() {
|
|
10505
10765
|
var _useRoutesTable = useRoutesTable(),
|
|
@@ -10525,11 +10785,15 @@ var Filters = function Filters() {
|
|
|
10525
10785
|
if (paginationData !== null) {
|
|
10526
10786
|
var _JSON$parse = JSON.parse(paginationData),
|
|
10527
10787
|
count = _JSON$parse.count,
|
|
10528
|
-
rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$
|
|
10788
|
+
rest = _objectWithoutPropertiesLoose(_JSON$parse, _excluded$3);
|
|
10529
10789
|
setPaginationObject(rest);
|
|
10530
10790
|
setCount(count);
|
|
10531
10791
|
} else {
|
|
10532
|
-
console.error('Pagination data is null');
|
|
10792
|
+
// console.error('Pagination data is null');
|
|
10793
|
+
notification.error({
|
|
10794
|
+
message: 'Error',
|
|
10795
|
+
description: 'Pagination data is null'
|
|
10796
|
+
});
|
|
10533
10797
|
}
|
|
10534
10798
|
}
|
|
10535
10799
|
}, [apiLoading]);
|
|
@@ -10563,7 +10827,7 @@ var ReturnTable$1 = function ReturnTable(_ref) {
|
|
|
10563
10827
|
}, [staticDataLoading, fetchedStaticData]);
|
|
10564
10828
|
return React.createElement(React.Fragment, null, React.createElement(StyledTableWrapper$1, {
|
|
10565
10829
|
id: "tableScrolling"
|
|
10566
|
-
}, React.createElement(StyledTable$1, null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", null, "Trading Name"), React.createElement("th", null, "Client"), React.createElement("th", null, "Orders"), React.createElement("th", null, "Products"), React.createElement("th", null, "Dispose"), React.createElement("th", null, "Re-allocate"), React.createElement("th", null, "Re-Del"), React.createElement("th", null, "Recycle"), React.createElement("th", null, "Unknown"))), React.createElement("tbody", null, loadingskeleton ? React.createElement("tr", null, React.createElement("td", {
|
|
10830
|
+
}, React.createElement(StyledTable$1, null, React.createElement("thead", null, React.createElement("tr", null, React.createElement("th", null, "Trading Name"), React.createElement("th", null, "Client"), React.createElement("th", null, "Orders"), React.createElement("th", null, "Products"), React.createElement("th", null, "RTS"), React.createElement("th", null, "Pending"), React.createElement("th", null, "Dispose"), React.createElement("th", null, "Re-allocate"), React.createElement("th", null, "Re-Del"), React.createElement("th", null, "Recycle"), React.createElement("th", null, "Unknown"))), React.createElement("tbody", null, loadingskeleton ? React.createElement("tr", null, React.createElement("td", {
|
|
10567
10831
|
colSpan: 9
|
|
10568
10832
|
}, React.createElement(Skeleton, {
|
|
10569
10833
|
active: true
|
|
@@ -10583,11 +10847,11 @@ var ReturnTable$1 = function ReturnTable(_ref) {
|
|
|
10583
10847
|
fontWeight: 600,
|
|
10584
10848
|
paddingLeft: 0
|
|
10585
10849
|
}
|
|
10586
|
-
}, key == null ? void 0 : key.customer_name)), ' '), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_orders))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.DISPOSE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-ALLOCATE']), ' ')), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-DEL']))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.RECYCLE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.UNKNOWN))));
|
|
10850
|
+
}, key == null ? void 0 : key.customer_name)), ' '), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_orders))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.RTS))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.PENDING))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.DISPOSE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-ALLOCATE']), ' ')), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-DEL']))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.RECYCLE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.UNKNOWN))));
|
|
10587
10851
|
})))));
|
|
10588
10852
|
};
|
|
10589
10853
|
|
|
10590
|
-
var _templateObject$
|
|
10854
|
+
var _templateObject$2l, _templateObject2$1I, _templateObject3$Z;
|
|
10591
10855
|
// import Loader from '../loader/Loader';
|
|
10592
10856
|
// interface ApiResponse {
|
|
10593
10857
|
// message: string;
|
|
@@ -10636,29 +10900,37 @@ function ReturnMainTable() {
|
|
|
10636
10900
|
className: "Tableconatiner"
|
|
10637
10901
|
}, React.createElement(HeaderFilter, null), React.createElement(Container$1f, null, React.createElement(Row$7, null, React.createElement(Text$7, null, "Client Return"), selectedClient ? React.createElement(ReturnFilter, null) : React.createElement(Filters, null)), React.createElement(ReturnTable$1, null)))));
|
|
10638
10902
|
}
|
|
10639
|
-
var Row$7 = /*#__PURE__*/styled.div(_templateObject$
|
|
10903
|
+
var Row$7 = /*#__PURE__*/styled.div(_templateObject$2l || (_templateObject$2l = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
10640
10904
|
var Container$1f = /*#__PURE__*/styled.div(_templateObject2$1I || (_templateObject2$1I = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: relative;\n top: -46px;\n"])));
|
|
10641
10905
|
var DashBoardWrapper$3 = /*#__PURE__*/styled.section(_templateObject3$Z || (_templateObject3$Z = /*#__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"])));
|
|
10642
10906
|
|
|
10643
10907
|
function ReturnClient() {
|
|
10908
|
+
var _selectedClientString;
|
|
10909
|
+
notification.config({
|
|
10910
|
+
top: 80
|
|
10911
|
+
});
|
|
10644
10912
|
var LoadingMessage = function LoadingMessage() {
|
|
10645
10913
|
return React.createElement("div", null, "Loading...");
|
|
10646
10914
|
};
|
|
10647
10915
|
var _useTableName = useTableName(),
|
|
10648
10916
|
selectedClient = _useTableName[0];
|
|
10649
10917
|
var navigate = useNavigate();
|
|
10918
|
+
var selectedClientString = selectedClient == null ? void 0 : selectedClient.replace(/\s+/g, '-');
|
|
10919
|
+
selectedClientString = (_selectedClientString = selectedClientString) == null ? void 0 : _selectedClientString.toLowerCase();
|
|
10920
|
+
console.log(selectedClientString, 'selectedClient');
|
|
10921
|
+
console.log("../filter/:" + selectedClientString);
|
|
10650
10922
|
useEffect(function () {
|
|
10651
|
-
if (!location.pathname.includes('/
|
|
10923
|
+
if (!location.pathname.includes('/filter')) {
|
|
10652
10924
|
localStorage.removeItem('clientName');
|
|
10653
10925
|
localStorage.removeItem('clientId');
|
|
10654
10926
|
}
|
|
10655
10927
|
}, [location.pathname]);
|
|
10656
10928
|
useEffect(function () {
|
|
10657
10929
|
if (selectedClient) {
|
|
10658
|
-
var
|
|
10659
|
-
navigate("
|
|
10930
|
+
var _selectedClientString2 = selectedClient.replace(/\s+/g, '-');
|
|
10931
|
+
navigate("filter/" + _selectedClientString2);
|
|
10660
10932
|
}
|
|
10661
|
-
}, [selectedClient
|
|
10933
|
+
}, [selectedClient]);
|
|
10662
10934
|
return React.createElement(Suspense, {
|
|
10663
10935
|
fallback: React.createElement(LoadingMessage, null)
|
|
10664
10936
|
}, React.createElement(Routes, null, React.createElement(Route, {
|
|
@@ -10671,13 +10943,8 @@ function ReturnClient() {
|
|
|
10671
10943
|
path: "order-return/:id",
|
|
10672
10944
|
element: React.createElement(OrderView, null)
|
|
10673
10945
|
}), React.createElement(Route, {
|
|
10674
|
-
path: "
|
|
10946
|
+
path: "filter/:clientName",
|
|
10675
10947
|
element: React.createElement(ReturnTable, null)
|
|
10676
|
-
}), React.createElement(Route, {
|
|
10677
|
-
path: "",
|
|
10678
|
-
element: selectedClient ? React.createElement(Navigate, {
|
|
10679
|
-
to: "return/" + selectedClient
|
|
10680
|
-
}) : React.createElement(ReturnMainTable, null)
|
|
10681
10948
|
})));
|
|
10682
10949
|
}
|
|
10683
10950
|
|