@bjsdistribution/dms-client-return 0.0.10 → 0.0.12
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/common/fakedata.d.ts +4 -0
- package/dist/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.d.ts +1 -1
- package/dist/components/order-view/details-filters/left-side-filters/dropdowns/{PrintDropDown.d.ts → PrintDropDownReturn.d.ts} +2 -2
- package/dist/components/store.d.ts +6 -1
- package/dist/dms-client-return.cjs.development.js +289 -210
- 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 +290 -211
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/order-daily-overview/common/fakedata.tsx +4 -0
- package/src/components/order-daily-overview/header-filters/HeaderFilter.tsx +10 -1
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +15 -7
- package/src/components/order-daily-overview/index.tsx +1 -1
- package/src/components/order-daily-overview/return-after-table/table/OrderTable.tsx +4 -8
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +12 -14
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +41 -39
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnOrderTable.tsx +80 -37
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/returnstyles.ts +17 -0
- package/src/components/order-daily-overview/shared/utlis.ts +7 -1
- package/src/components/order-daily-overview/table-view/Pagination.tsx +15 -14
- package/src/components/order-view/details-filters/left-side-filters/dropdowns/{PrintDropDown.tsx → PrintDropDownReturn.tsx} +4 -4
- package/src/components/order-view/modalsPopup/CreateReturnModal.tsx +74 -36
- package/src/components/order-view/modalsPopup/ModalManager.tsx +47 -12
- package/src/components/store.ts +35 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useState, useMemo, useRef, Suspense } from 'react';
|
|
2
2
|
import { useLocation, useParams, NavLink, useNavigate, Routes, Route } from 'react-router-dom';
|
|
3
3
|
import styled, { css, keyframes } from 'styled-components';
|
|
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';
|
|
4
|
+
import { Label as Label$h, Input as Input$1, TextArea, FormSection, displayValueOrNA as displayValueOrNA$1, 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
|
|
7
|
+
import { DatePicker, notification, Skeleton, Upload, message, Input as Input$2, Select, Empty, Checkbox as Checkbox$2, Tabs } 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';
|
|
@@ -1351,8 +1351,8 @@ function ConsignmentNumber() {
|
|
|
1351
1351
|
return React.createElement(Container$d, null, React.createElement(Wrapper$8, null, React.createElement(Label$h, {
|
|
1352
1352
|
label: "Consignment Number"
|
|
1353
1353
|
}), React.createElement(CopyText, {
|
|
1354
|
-
text: displayValueOrNA(orderDetails.consignment)
|
|
1355
|
-
})), React.createElement(Consignment, null, displayValueOrNA(orderDetails.consignment)));
|
|
1354
|
+
text: displayValueOrNA$1(orderDetails.consignment)
|
|
1355
|
+
})), React.createElement(Consignment, null, displayValueOrNA$1(orderDetails.consignment)));
|
|
1356
1356
|
}
|
|
1357
1357
|
var Wrapper$8 = /*#__PURE__*/styled.div(_templateObject$g || (_templateObject$g = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n align-items: center;\n gap: 5px;\n"])));
|
|
1358
1358
|
var Consignment = /*#__PURE__*/styled.span(_templateObject2$e || (_templateObject2$e = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #249e45;\n font-family: 'Lato', sans-serif;\n font-size: 13px;\n font-style: normal;\n font-weight: 400;\n"])));
|
|
@@ -3143,7 +3143,7 @@ function GeneralHeader() {
|
|
|
3143
3143
|
var Section = /*#__PURE__*/styled.div(_templateObject$V || (_templateObject$V = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* display: flex;\n background: #ffffff;\n // padding: 15px;\n flex-direction: column;\n gap: 14px;\n border-radius: 12px;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n border: 1px solid #e0e0e0; */\n"])));
|
|
3144
3144
|
|
|
3145
3145
|
var _templateObject19, _templateObject20, _templateObject21;
|
|
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"])));
|
|
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 .custom-check {\n position: relative;\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 .awaiting {\n display: flex;\n min-width: 85px;\n padding: 6px 10px;\n justify-content: center;\n align-items: center;\n gap: 5px;\n border-radius: 22px;\n background: rgba(233, 82, 82, 0.15);\n color: #e95252;\n font-family: 'Open Sans';\n font-size: 12px;\n font-weight: 600;\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"])));
|
|
3147
3147
|
// Styled components
|
|
3148
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"])));
|
|
3149
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"])));
|
|
@@ -3178,6 +3178,11 @@ var locationData = /*#__PURE__*/atom([]);
|
|
|
3178
3178
|
var createReturnPayload = /*#__PURE__*/atom(CreateReturnInitial);
|
|
3179
3179
|
var newPayload = /*#__PURE__*/atom([]);
|
|
3180
3180
|
var grpPayload = /*#__PURE__*/atom([]);
|
|
3181
|
+
var statusOfOrder = /*#__PURE__*/atom([]);
|
|
3182
|
+
var selectedLocationConfirm = /*#__PURE__*/atom([]);
|
|
3183
|
+
var selectAll = /*#__PURE__*/atom(false);
|
|
3184
|
+
var postLoading = /*#__PURE__*/atom(false);
|
|
3185
|
+
var _final = /*#__PURE__*/atom([]);
|
|
3181
3186
|
var selectedOrderlList = /*#__PURE__*/atom([]);
|
|
3182
3187
|
function useSelectedOrders() {
|
|
3183
3188
|
return useAtom(selectedOrderlList);
|
|
@@ -3205,6 +3210,21 @@ function useNewReturnPayload() {
|
|
|
3205
3210
|
function useGroupedPayload() {
|
|
3206
3211
|
return useAtom(grpPayload);
|
|
3207
3212
|
}
|
|
3213
|
+
function useStatusOrderData() {
|
|
3214
|
+
return useAtom(statusOfOrder);
|
|
3215
|
+
}
|
|
3216
|
+
function useSelectedConfirmLoc() {
|
|
3217
|
+
return useAtom(selectedLocationConfirm);
|
|
3218
|
+
}
|
|
3219
|
+
function useSelectAll() {
|
|
3220
|
+
return useAtom(selectAll);
|
|
3221
|
+
}
|
|
3222
|
+
function usePostLoading() {
|
|
3223
|
+
return useAtom(postLoading);
|
|
3224
|
+
}
|
|
3225
|
+
function useFinalPayload() {
|
|
3226
|
+
return useAtom(_final);
|
|
3227
|
+
}
|
|
3208
3228
|
|
|
3209
3229
|
var ReturnProductTable = function ReturnProductTable() {
|
|
3210
3230
|
var _useSelectedOrders = useSelectedOrders(),
|
|
@@ -8335,6 +8355,12 @@ function SelectionFilter() {
|
|
|
8335
8355
|
setStoredCustomerId = _useState6[1];
|
|
8336
8356
|
var _useNewReturnPayload = useNewReturnPayload(),
|
|
8337
8357
|
setNewPayload = _useNewReturnPayload[1];
|
|
8358
|
+
var _useGroupedPayload = useGroupedPayload(),
|
|
8359
|
+
setGrouped = _useGroupedPayload[1];
|
|
8360
|
+
var _useSelectedOrders = useSelectedOrders(),
|
|
8361
|
+
setSelectedReturnOrder = _useSelectedOrders[1];
|
|
8362
|
+
var _useSelectAll = useSelectAll(),
|
|
8363
|
+
setSelectAll = _useSelectAll[1];
|
|
8338
8364
|
//client options
|
|
8339
8365
|
var clientOptions = customers == null ? void 0 : customers.map(function (option) {
|
|
8340
8366
|
var _option$customer_name, _option$customer_name2;
|
|
@@ -8357,7 +8383,7 @@ function SelectionFilter() {
|
|
|
8357
8383
|
var LocationOptions = locationData == null ? void 0 : locationData.map(function (option) {
|
|
8358
8384
|
return {
|
|
8359
8385
|
label: option == null ? void 0 : option.location_name,
|
|
8360
|
-
value: option == null ? void 0 : option.
|
|
8386
|
+
value: option == null ? void 0 : option.token
|
|
8361
8387
|
};
|
|
8362
8388
|
});
|
|
8363
8389
|
//client change
|
|
@@ -8383,7 +8409,6 @@ function SelectionFilter() {
|
|
|
8383
8409
|
customer_id: storedCustomerId
|
|
8384
8410
|
});
|
|
8385
8411
|
});
|
|
8386
|
-
console.log(selectedUuids, 'selectedUuids');
|
|
8387
8412
|
var filteredSubLocations = locationData == null ? void 0 : locationData.filter(function (subCat) {
|
|
8388
8413
|
return (subCat == null ? void 0 : subCat.customer_id) === selectedUuids;
|
|
8389
8414
|
}).map(function (subCat) {
|
|
@@ -8394,6 +8419,10 @@ function SelectionFilter() {
|
|
|
8394
8419
|
});
|
|
8395
8420
|
setFilteredLocationOptions(filteredSubLocations);
|
|
8396
8421
|
setUuid('');
|
|
8422
|
+
setSelectedReturnOrder([]);
|
|
8423
|
+
setNewPayload([]);
|
|
8424
|
+
setGrouped([]);
|
|
8425
|
+
setSelectAll(false);
|
|
8397
8426
|
};
|
|
8398
8427
|
useEffect(function () {
|
|
8399
8428
|
var accountNumberFromStorage = localStorage.getItem('account_number');
|
|
@@ -8417,8 +8446,7 @@ function SelectionFilter() {
|
|
|
8417
8446
|
//location change
|
|
8418
8447
|
var handleLocationChange = function handleLocationChange(value, option) {
|
|
8419
8448
|
var selectedLabel = option == null ? void 0 : option.label;
|
|
8420
|
-
|
|
8421
|
-
setSelectedLocationValue(selectedLabel);
|
|
8449
|
+
setSelectedLocationValue(value);
|
|
8422
8450
|
if (selectedLocationValue === selectedLabel) {
|
|
8423
8451
|
dispatch({
|
|
8424
8452
|
type: 'CLEAR_ALL_FILTERS',
|
|
@@ -8477,8 +8505,8 @@ function SelectionFilter() {
|
|
|
8477
8505
|
setIsButtonEnabled(false);
|
|
8478
8506
|
}
|
|
8479
8507
|
}, [storedName, selectedFilterValue, selectedLocationValue]);
|
|
8480
|
-
console.log(filteredLocationOptions, 'filteredLocationOptions');
|
|
8481
|
-
console.log('check', storedName, selectedFilterValue, selectedLocationValue);
|
|
8508
|
+
// console.log(filteredLocationOptions, 'filteredLocationOptions');
|
|
8509
|
+
// console.log('check', storedName, selectedFilterValue, selectedLocationValue);
|
|
8482
8510
|
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, {
|
|
8483
8511
|
options: clientOptions,
|
|
8484
8512
|
placeholder: "Select Client Name",
|
|
@@ -8520,6 +8548,8 @@ function HeaderFilter() {
|
|
|
8520
8548
|
setActionType = _useActionType[1];
|
|
8521
8549
|
var _useLocationData = useLocationData(),
|
|
8522
8550
|
setLocationData = _useLocationData[1];
|
|
8551
|
+
var _useStatusOrderData = useStatusOrderData(),
|
|
8552
|
+
setStatusOfOrders = _useStatusOrderData[1];
|
|
8523
8553
|
//API for client data
|
|
8524
8554
|
var _useApiHook = useApiHook({
|
|
8525
8555
|
endpoint: "/customers/",
|
|
@@ -8560,10 +8590,13 @@ function HeaderFilter() {
|
|
|
8560
8590
|
}, [loading, fetchedCustomerData]);
|
|
8561
8591
|
useEffect(function () {
|
|
8562
8592
|
if (fetchedStaticData && fetchedStaticData != null && fetchedStaticData.data) {
|
|
8563
|
-
var _fetchedStaticData$da;
|
|
8593
|
+
var _fetchedStaticData$da, _fetchedStaticData$da2;
|
|
8564
8594
|
setActionType(fetchedStaticData == null || (_fetchedStaticData$da = fetchedStaticData.data) == null ? void 0 : _fetchedStaticData$da.flatMap(function (i) {
|
|
8565
8595
|
return i == null ? void 0 : i.order_product_return_action;
|
|
8566
8596
|
}));
|
|
8597
|
+
setStatusOfOrders(fetchedStaticData == null || (_fetchedStaticData$da2 = fetchedStaticData.data) == null ? void 0 : _fetchedStaticData$da2.flatMap(function (i) {
|
|
8598
|
+
return i == null ? void 0 : i.order_stock_alias;
|
|
8599
|
+
}));
|
|
8567
8600
|
}
|
|
8568
8601
|
}, [actionLoading, fetchedStaticData]);
|
|
8569
8602
|
useEffect(function () {
|
|
@@ -8808,30 +8841,28 @@ var formatDate$1 = function formatDate(date) {
|
|
|
8808
8841
|
// const seconds = padZero(date.getSeconds());
|
|
8809
8842
|
return year + "-" + month + "-" + day;
|
|
8810
8843
|
};
|
|
8844
|
+
var displayValueOrNA = function displayValueOrNA(value) {
|
|
8845
|
+
var isBlankArray = Array.isArray(value) && value.length === 0;
|
|
8846
|
+
if (value === 0) {
|
|
8847
|
+
return 0;
|
|
8848
|
+
}
|
|
8849
|
+
if (value === 'NA' || value === undefined || value === null || isBlankArray) {
|
|
8850
|
+
return 'NA';
|
|
8851
|
+
}
|
|
8852
|
+
return value;
|
|
8853
|
+
};
|
|
8811
8854
|
|
|
8812
|
-
var
|
|
8813
|
-
icon: 'runSheet',
|
|
8814
|
-
label: 'Print Runsheet'
|
|
8815
|
-
}, {
|
|
8816
|
-
icon: 'loadSheet',
|
|
8817
|
-
label: 'Print Loadsheet'
|
|
8818
|
-
}, {
|
|
8855
|
+
var optionsForReturnPrint = [{
|
|
8819
8856
|
icon: 'deliveryLables',
|
|
8820
|
-
label: 'Print
|
|
8821
|
-
}, {
|
|
8822
|
-
icon: 'customerLables',
|
|
8823
|
-
label: 'Print Customer Labels'
|
|
8824
|
-
}, {
|
|
8825
|
-
icon: 'collectionLables',
|
|
8826
|
-
label: 'Print Collection Labels'
|
|
8857
|
+
label: 'Print Return Labels'
|
|
8827
8858
|
}];
|
|
8828
8859
|
|
|
8829
8860
|
var _templateObject$23, _templateObject2$1t;
|
|
8830
8861
|
// import { PrintIconMap } from '../utils';
|
|
8831
8862
|
// import { optionsPrint } from '../fakeData';
|
|
8832
8863
|
// import { PrintData } from '../interface';
|
|
8833
|
-
var options$2 =
|
|
8834
|
-
var
|
|
8864
|
+
var options$2 = optionsForReturnPrint;
|
|
8865
|
+
var PrintDropDownReturn = function PrintDropDownReturn() {
|
|
8835
8866
|
var downloadFiles = function downloadFiles() {};
|
|
8836
8867
|
return React.createElement(OptionsList, null, options$2.map(function (item, index) {
|
|
8837
8868
|
var IconComponent = PrintIconMap[item.icon];
|
|
@@ -8844,22 +8875,22 @@ var PrintDropDown = function PrintDropDown() {
|
|
|
8844
8875
|
var OptionsList = /*#__PURE__*/styled.ul(_templateObject$23 || (_templateObject$23 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0;\n padding: 0;\n list-style: none;\n box-sizing: border-box;\n border-radius: 6px;\n border: 1px solid rgba(224, 226, 231, 0.5);\n background: #fff;\n box-shadow: 0px 4px 30px 0px rgba(46, 45, 116, 0.05);\n width: 177px;\n padding: 5px 1px 3px 1px;\n position: absolute;\n top: 26px;\n right: 0;\n z-index: 99;\n min-width: 194px;\n"])));
|
|
8845
8876
|
var OptionsListLi = /*#__PURE__*/styled.li(_templateObject2$1t || (_templateObject2$1t = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n border-bottom: 1px solid #f0f2f2;\n padding: 8px 10px;\n display: flex;\n gap: 12px;\n align-items: center;\n font-size: 13px;\n cursor: pointer;\n &:last-child {\n border: none;\n }\n"])));
|
|
8846
8877
|
|
|
8847
|
-
var ReturnOrderTable = function ReturnOrderTable(
|
|
8848
|
-
var loadingskeleton = _ref.loadingskeleton;
|
|
8878
|
+
var ReturnOrderTable = function ReturnOrderTable() {
|
|
8849
8879
|
var _useAtom = useAtom(filtersReducerAtom),
|
|
8850
8880
|
state = _useAtom[0];
|
|
8851
8881
|
var _useSelectedOrders = useSelectedOrders(),
|
|
8852
8882
|
selectedReturnOrder = _useSelectedOrders[0],
|
|
8853
8883
|
setSelectedReturnOrder = _useSelectedOrders[1];
|
|
8854
|
-
var
|
|
8855
|
-
selectAll =
|
|
8856
|
-
setSelectAll =
|
|
8884
|
+
var _useSelectAll = useSelectAll(),
|
|
8885
|
+
selectAll = _useSelectAll[0],
|
|
8886
|
+
setSelectAll = _useSelectAll[1];
|
|
8857
8887
|
var filters = state['x-filters'],
|
|
8858
8888
|
pagination = state['x-pagination'];
|
|
8859
8889
|
var _useReturnData = useReturnData(),
|
|
8860
8890
|
returnData = _useReturnData[0],
|
|
8861
8891
|
setReturnData = _useReturnData[1];
|
|
8862
8892
|
var _useLoading = useLoading(),
|
|
8893
|
+
load = _useLoading[0],
|
|
8863
8894
|
setLoading = _useLoading[1];
|
|
8864
8895
|
var dropdownRefParent = useRef(null);
|
|
8865
8896
|
var dropdownRef = useRef(null);
|
|
@@ -8874,6 +8905,8 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8874
8905
|
setNewPayload = _useNewReturnPayload[1];
|
|
8875
8906
|
var _useGroupedPayload = useGroupedPayload(),
|
|
8876
8907
|
setGrouped = _useGroupedPayload[1];
|
|
8908
|
+
var _useLocationData = useLocationData(),
|
|
8909
|
+
locationData = _useLocationData[0];
|
|
8877
8910
|
var OpenDropDown = function OpenDropDown(index) {
|
|
8878
8911
|
setPrintToggle(function (prevIndex) {
|
|
8879
8912
|
return prevIndex === index ? null : index;
|
|
@@ -8898,56 +8931,75 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8898
8931
|
pagination: pagination
|
|
8899
8932
|
}),
|
|
8900
8933
|
fetchedOrderData = _useApiHook.data,
|
|
8901
|
-
|
|
8934
|
+
returnDataLoad = _useApiHook.loading;
|
|
8902
8935
|
useEffect(function () {
|
|
8903
|
-
setLoading(
|
|
8936
|
+
setLoading(returnDataLoad);
|
|
8904
8937
|
if (fetchedOrderData && fetchedOrderData != null && fetchedOrderData.data) {
|
|
8905
8938
|
setReturnData(fetchedOrderData == null ? void 0 : fetchedOrderData.data);
|
|
8906
8939
|
}
|
|
8907
|
-
}, [fetchedOrderData,
|
|
8940
|
+
}, [fetchedOrderData, returnDataLoad]);
|
|
8941
|
+
useEffect(function () {
|
|
8942
|
+
setLoading(returnDataLoad);
|
|
8943
|
+
if (fetchedOrderData && fetchedOrderData != null && fetchedOrderData.data && locationData) {
|
|
8944
|
+
var updatedReturnData = fetchedOrderData.data.map(function (returnItem) {
|
|
8945
|
+
var matchingLocation = locationData.find(function (location) {
|
|
8946
|
+
return (location == null ? void 0 : location.token) === (returnItem == null ? void 0 : returnItem.return_location);
|
|
8947
|
+
});
|
|
8948
|
+
return _extends({}, returnItem, {
|
|
8949
|
+
new_location: matchingLocation ? matchingLocation.location_name : null
|
|
8950
|
+
});
|
|
8951
|
+
});
|
|
8952
|
+
setReturnData(updatedReturnData);
|
|
8953
|
+
}
|
|
8954
|
+
}, [fetchedOrderData, returnDataLoad, locationData]);
|
|
8908
8955
|
var handleSelectAll = function handleSelectAll(e) {
|
|
8909
8956
|
setSelectAll(e.target.checked);
|
|
8910
8957
|
if (e.target.checked) {
|
|
8911
8958
|
setSelectedReturnOrder(returnData == null ? void 0 : returnData.map(function (loc) {
|
|
8912
|
-
var _loc$return_locations;
|
|
8913
8959
|
return {
|
|
8914
8960
|
id: loc.id,
|
|
8915
8961
|
return_locations: loc == null ? void 0 : loc.return_locations,
|
|
8916
8962
|
return_location: loc == null ? void 0 : loc.return_location,
|
|
8917
|
-
products: loc.
|
|
8963
|
+
products: loc == null ? void 0 : loc.legacy_product_id,
|
|
8918
8964
|
order_product_return_action: loc == null ? void 0 : loc.order_product_return_action,
|
|
8919
|
-
return_location_token: loc == null
|
|
8965
|
+
return_location_token: loc == null ? void 0 : loc.return_location,
|
|
8966
|
+
new_location: loc == null ? void 0 : loc.new_location
|
|
8920
8967
|
};
|
|
8921
8968
|
}));
|
|
8922
8969
|
setNewPayload(returnData == null ? void 0 : returnData.map(function (loc) {
|
|
8923
|
-
var _loc$order_product_re
|
|
8970
|
+
var _loc$order_product_re;
|
|
8924
8971
|
return {
|
|
8925
8972
|
id: loc.id,
|
|
8926
8973
|
account_number: createReturn == null ? void 0 : createReturn.account_number,
|
|
8927
|
-
customer_id: createReturn == null ? void 0 : createReturn.customer_id,
|
|
8928
|
-
products: loc.
|
|
8929
|
-
return_action:
|
|
8930
|
-
return_location_token:
|
|
8974
|
+
customer_id: +(createReturn == null ? void 0 : createReturn.customer_id),
|
|
8975
|
+
products: [loc == null ? void 0 : loc.legacy_product_id],
|
|
8976
|
+
return_action: [loc == null || (_loc$order_product_re = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re.type] || null,
|
|
8977
|
+
return_location_token: (loc == null ? void 0 : loc.return_location) || null,
|
|
8978
|
+
new_location: loc == null ? void 0 : loc.new_location
|
|
8931
8979
|
};
|
|
8932
8980
|
}));
|
|
8933
8981
|
} else {
|
|
8934
8982
|
setSelectedReturnOrder([]);
|
|
8983
|
+
setNewPayload([]);
|
|
8984
|
+
setGrouped([]);
|
|
8935
8985
|
}
|
|
8936
8986
|
};
|
|
8937
|
-
var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action) {
|
|
8987
|
+
var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action, new_location, legacy_product_id) {
|
|
8938
8988
|
setSelectedReturnOrder(function (prevSelectedLocations) {
|
|
8939
8989
|
var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (loc) {
|
|
8940
8990
|
return loc.id === id;
|
|
8941
8991
|
});
|
|
8992
|
+
console.log(new_location, 'new_location');
|
|
8942
8993
|
if (isSelected) {
|
|
8943
8994
|
var updatedSelectedLocations = prevSelectedLocations.filter(function (loc) {
|
|
8944
8995
|
return loc.id !== id;
|
|
8945
8996
|
});
|
|
8946
8997
|
setReturnPayload(function (prevState) {
|
|
8947
8998
|
return _extends({}, prevState, {
|
|
8948
|
-
products:
|
|
8999
|
+
products: legacy_product_id,
|
|
8949
9000
|
return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
|
|
8950
|
-
return_location_token:
|
|
9001
|
+
return_location_token: return_location || null,
|
|
9002
|
+
new_location: new_location
|
|
8951
9003
|
});
|
|
8952
9004
|
});
|
|
8953
9005
|
setNewPayload(function (prevPayload) {
|
|
@@ -8960,26 +9012,28 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8960
9012
|
var newReturnPayload = {
|
|
8961
9013
|
id: id,
|
|
8962
9014
|
account_number: createReturn == null ? void 0 : createReturn.account_number,
|
|
8963
|
-
customer_id: createReturn == null ? void 0 : createReturn.customer_id,
|
|
8964
|
-
products:
|
|
8965
|
-
return_action:
|
|
8966
|
-
return_location_token:
|
|
9015
|
+
customer_id: +(createReturn == null ? void 0 : createReturn.customer_id),
|
|
9016
|
+
products: [legacy_product_id],
|
|
9017
|
+
return_action: [order_product_return_action == null ? void 0 : order_product_return_action.type] || null,
|
|
9018
|
+
return_location_token: return_location || null
|
|
8967
9019
|
};
|
|
8968
9020
|
setNewPayload(function (prevPayload) {
|
|
8969
9021
|
return [].concat(prevPayload, [newReturnPayload]);
|
|
8970
9022
|
});
|
|
8971
9023
|
setReturnPayload(function (prevState) {
|
|
8972
9024
|
return _extends({}, prevState, {
|
|
8973
|
-
products:
|
|
9025
|
+
products: legacy_product_id,
|
|
8974
9026
|
return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
|
|
8975
|
-
return_location_token:
|
|
9027
|
+
return_location_token: return_location || null,
|
|
9028
|
+
new_location: new_location
|
|
8976
9029
|
});
|
|
8977
9030
|
});
|
|
8978
9031
|
return [].concat(prevSelectedLocations, [{
|
|
8979
9032
|
id: id,
|
|
8980
9033
|
return_location: return_location,
|
|
8981
9034
|
return_locations: return_locations,
|
|
8982
|
-
order_product_return_action: order_product_return_action
|
|
9035
|
+
order_product_return_action: order_product_return_action,
|
|
9036
|
+
new_location: new_location
|
|
8983
9037
|
}]);
|
|
8984
9038
|
}
|
|
8985
9039
|
});
|
|
@@ -9010,9 +9064,9 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
9010
9064
|
}, React.createElement(Checkbox$1, {
|
|
9011
9065
|
checked: selectAll,
|
|
9012
9066
|
onChange: handleSelectAll
|
|
9013
|
-
})), React.createElement("th", null, "Product Location"), React.createElement("th", null, "Return Location"), React.createElement("th", null, "Recipient"), React.createElement("th", null, "Code"), React.createElement("th", null, "
|
|
9067
|
+
})), React.createElement("th", null, "Product Location"), React.createElement("th", null, "Return Location"), React.createElement("th", null, "Recipient"), React.createElement("th", null, "Code"), React.createElement("th", null, "Description"), React.createElement("th", null, "Part"), React.createElement("th", null, "Weight"), React.createElement("th", null, "CBM"), React.createElement("th", null, "Return Reason"), React.createElement("th", null, "Collected"), React.createElement("th", null, "Collection Reason"), React.createElement("th", {
|
|
9014
9068
|
className: "emailInvoiceShare"
|
|
9015
|
-
}, "Labels"))), React.createElement("tbody", null,
|
|
9069
|
+
}, "Labels"))), React.createElement("tbody", null, load ? React.createElement("tr", null, React.createElement("td", {
|
|
9016
9070
|
colSpan: 6
|
|
9017
9071
|
}, React.createElement(Skeleton, {
|
|
9018
9072
|
active: true
|
|
@@ -9021,17 +9075,20 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
9021
9075
|
})) : (returnData == null ? void 0 : returnData.length) === 0 ? React.createElement("tr", null, React.createElement("td", {
|
|
9022
9076
|
colSpan: 14
|
|
9023
9077
|
}, React.createElement(EmptyDataContainer, null, React.createElement(Empty, null)))) : returnData == null ? void 0 : returnData.map(function (item, index) {
|
|
9024
|
-
var _item$orders_products, _item$order_data, _item$order_data2, _item$return_reasons, _item$collection_reas;
|
|
9078
|
+
var _item$orders_products, _item$orders_products2, _item$order_data, _item$order_data2, _item$return_reasons, _item$order_product_r, _item$collection_reas;
|
|
9025
9079
|
return React.createElement("tr", {
|
|
9026
9080
|
key: item.id
|
|
9027
9081
|
}, React.createElement("td", null, React.createElement(Checkbox$1, {
|
|
9082
|
+
className: "custom-check",
|
|
9028
9083
|
checked: selectedReturnOrder == null ? void 0 : selectedReturnOrder.some(function (selectedInvoice) {
|
|
9029
9084
|
return (selectedInvoice == null ? void 0 : selectedInvoice.id) === item.id;
|
|
9030
9085
|
}),
|
|
9031
9086
|
onChange: function onChange() {
|
|
9032
|
-
return handleSelectOrderReturn(item.id, item.return_location, item.return_locations, item.order_product_return_action);
|
|
9087
|
+
return handleSelectOrderReturn(item.id, item.return_location, item.return_locations, item.order_product_return_action, item.new_location, item.legacy_product_id);
|
|
9033
9088
|
}
|
|
9034
|
-
})), React.createElement("td", null,
|
|
9089
|
+
})), React.createElement("td", null, (item == null || (_item$orders_products = item.orders_products_stock) == null ? void 0 : _item$orders_products.location) !== null && (item == null || (_item$orders_products2 = item.orders_products_stock) == null ? void 0 : _item$orders_products2.location) !== undefined ? item.orders_products_stock.location : React.createElement("div", {
|
|
9090
|
+
className: "awaiting"
|
|
9091
|
+
}, "Awaiting")), React.createElement("td", null, " ", displayValueOrNA(item == null ? void 0 : item.new_location)), React.createElement("td", null, React.createElement("ul", {
|
|
9035
9092
|
style: {
|
|
9036
9093
|
listStyleType: 'none',
|
|
9037
9094
|
padding: 0
|
|
@@ -9046,7 +9103,7 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
9046
9103
|
style: {
|
|
9047
9104
|
color: '#888075'
|
|
9048
9105
|
}
|
|
9049
|
-
}, displayValueOrNA(item == null || (_item$order_data2 = item.order_data) == null || (_item$order_data2 = _item$order_data2.order_recipient) == null ? void 0 : _item$order_data2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.code)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.description)), React.createElement("td", null,
|
|
9106
|
+
}, displayValueOrNA(item == null || (_item$order_data2 = item.order_data) == null || (_item$order_data2 = _item$order_data2.order_recipient) == null ? void 0 : _item$order_data2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.code)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.description)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.parts_count)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), "KG"), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React.createElement("td", null, displayValueOrNA(item == null || (_item$return_reasons = item.return_reasons) == null ? void 0 : _item$return_reasons.reason)), React.createElement("td", null, displayValueOrNA(item == null || (_item$order_product_r = item.order_product_returns) == null ? void 0 : _item$order_product_r.collected_at)), React.createElement("td", null, displayValueOrNA(item == null || (_item$collection_reas = item.collection_reasons) == null ? void 0 : _item$collection_reas.reason)), React.createElement("td", null, React.createElement("ul", {
|
|
9050
9107
|
className: "actionbox"
|
|
9051
9108
|
}, React.createElement(CustomDrop, {
|
|
9052
9109
|
ref: dropdownRefParent,
|
|
@@ -9058,7 +9115,7 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
9058
9115
|
}
|
|
9059
9116
|
}, React.createElement(PrinterIcon, null), React.createElement(DownIcon, null), printToogle == index && React.createElement("div", {
|
|
9060
9117
|
ref: dropdownRef
|
|
9061
|
-
}, React.createElement(
|
|
9118
|
+
}, React.createElement(PrintDropDownReturn, null)))))));
|
|
9062
9119
|
})))));
|
|
9063
9120
|
};
|
|
9064
9121
|
|
|
@@ -9729,17 +9786,26 @@ var repackModal = function repackModal() {
|
|
|
9729
9786
|
var StyledConatiner$1 = /*#__PURE__*/styled.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* text-wrap: nowrap; */\n"])));
|
|
9730
9787
|
|
|
9731
9788
|
var _templateObject$2g, _templateObject2$1D, _templateObject3$X;
|
|
9789
|
+
var _excluded$2 = ["id"];
|
|
9732
9790
|
var CreateReturnModal = function CreateReturnModal() {
|
|
9733
|
-
var
|
|
9734
|
-
selectedlocation =
|
|
9735
|
-
setSelectedLocations =
|
|
9791
|
+
var _useSelectedConfirmLo = useSelectedConfirmLoc(),
|
|
9792
|
+
selectedlocation = _useSelectedConfirmLo[0],
|
|
9793
|
+
setSelectedLocations = _useSelectedConfirmLo[1];
|
|
9736
9794
|
var _useSelectedOrders = useSelectedOrders(),
|
|
9737
9795
|
selectedReturnOrder = _useSelectedOrders[0];
|
|
9796
|
+
var _usePostLoading = usePostLoading(),
|
|
9797
|
+
load = _usePostLoading[0];
|
|
9798
|
+
var _useGroupedPayload = useGroupedPayload(),
|
|
9799
|
+
groupedPayload = _useGroupedPayload[0];
|
|
9800
|
+
var _useSelectedConfirmLo2 = useSelectedConfirmLoc(),
|
|
9801
|
+
forDisabledCheck = _useSelectedConfirmLo2[0];
|
|
9802
|
+
var _useFinalPayload = useFinalPayload(),
|
|
9803
|
+
setNew = _useFinalPayload[1];
|
|
9738
9804
|
var handleSelectLocations = function handleSelectLocations(id) {
|
|
9739
9805
|
setSelectedLocations(function (prevSelectedLocations) {
|
|
9740
|
-
var isSelected = prevSelectedLocations.includes(id);
|
|
9806
|
+
var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.includes(id);
|
|
9741
9807
|
if (isSelected) {
|
|
9742
|
-
return prevSelectedLocations.filter(function (selectedId) {
|
|
9808
|
+
return prevSelectedLocations == null ? void 0 : prevSelectedLocations.filter(function (selectedId) {
|
|
9743
9809
|
return selectedId !== id;
|
|
9744
9810
|
});
|
|
9745
9811
|
} else {
|
|
@@ -9747,7 +9813,30 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9747
9813
|
}
|
|
9748
9814
|
});
|
|
9749
9815
|
};
|
|
9750
|
-
|
|
9816
|
+
var uniqueLocations = selectedReturnOrder == null ? void 0 : selectedReturnOrder.reduce(function (acc, current) {
|
|
9817
|
+
var x = acc.find(function (item) {
|
|
9818
|
+
return item.return_location === current.return_location;
|
|
9819
|
+
});
|
|
9820
|
+
if (!x) {
|
|
9821
|
+
acc.push(current);
|
|
9822
|
+
}
|
|
9823
|
+
return acc;
|
|
9824
|
+
}, []);
|
|
9825
|
+
useEffect(function () {
|
|
9826
|
+
if ((groupedPayload == null ? void 0 : groupedPayload.length) > 0 && (forDisabledCheck == null ? void 0 : forDisabledCheck.length) > 0) {
|
|
9827
|
+
var matchedItems = groupedPayload == null ? void 0 : groupedPayload.filter(function (item) {
|
|
9828
|
+
return forDisabledCheck.includes(item.id);
|
|
9829
|
+
});
|
|
9830
|
+
if (matchedItems.length > 0) {
|
|
9831
|
+
var finalPayload = matchedItems == null ? void 0 : matchedItems.map(function (_ref) {
|
|
9832
|
+
var rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
9833
|
+
return rest;
|
|
9834
|
+
});
|
|
9835
|
+
setNew(finalPayload);
|
|
9836
|
+
}
|
|
9837
|
+
}
|
|
9838
|
+
}, [forDisabledCheck]);
|
|
9839
|
+
return React.createElement(React.Fragment, null, load && React.createElement(Loader, null), React.createElement(Wrapper$l, null, React.createElement(Alert, {
|
|
9751
9840
|
onClose: function onClose() {},
|
|
9752
9841
|
description: "",
|
|
9753
9842
|
type: "info",
|
|
@@ -9758,7 +9847,7 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9758
9847
|
listStyle: 'none',
|
|
9759
9848
|
padding: 0
|
|
9760
9849
|
}
|
|
9761
|
-
},
|
|
9850
|
+
}, uniqueLocations == null ? void 0 : uniqueLocations.map(function (returnLoc) {
|
|
9762
9851
|
return React.createElement("li", {
|
|
9763
9852
|
key: returnLoc.id,
|
|
9764
9853
|
style: {
|
|
@@ -9767,7 +9856,7 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9767
9856
|
alignItems: 'center'
|
|
9768
9857
|
}
|
|
9769
9858
|
}, React.createElement(Checkbox$1, {
|
|
9770
|
-
checked: selectedlocation.includes(returnLoc.id),
|
|
9859
|
+
checked: selectedlocation == null ? void 0 : selectedlocation.includes(returnLoc.id),
|
|
9771
9860
|
onChange: function onChange() {
|
|
9772
9861
|
return handleSelectLocations(returnLoc.id);
|
|
9773
9862
|
}
|
|
@@ -9775,14 +9864,13 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9775
9864
|
style: {
|
|
9776
9865
|
marginLeft: '8px'
|
|
9777
9866
|
}
|
|
9778
|
-
}, returnLoc == null ? void 0 : returnLoc.
|
|
9779
|
-
}))));
|
|
9867
|
+
}, displayValueOrNA(returnLoc == null ? void 0 : returnLoc.new_location)));
|
|
9868
|
+
})))));
|
|
9780
9869
|
};
|
|
9781
9870
|
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
9871
|
var Container$1b = /*#__PURE__*/styled.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
9783
9872
|
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"])));
|
|
9784
9873
|
|
|
9785
|
-
var _excluded$2 = ["id"];
|
|
9786
9874
|
var ModalManager = function ModalManager() {
|
|
9787
9875
|
var _useAtom = useAtom(countReducerAtom),
|
|
9788
9876
|
popupName = _useAtom[0],
|
|
@@ -9806,9 +9894,21 @@ var ModalManager = function ModalManager() {
|
|
|
9806
9894
|
selectedTab = _useAtom3[0];
|
|
9807
9895
|
var _useState = useState(false),
|
|
9808
9896
|
setIsFormValid = _useState[1];
|
|
9897
|
+
var _useFinalPayload = useFinalPayload(),
|
|
9898
|
+
newGrouped = _useFinalPayload[0],
|
|
9899
|
+
setNewGrouped = _useFinalPayload[1];
|
|
9900
|
+
var _usePostLoading = usePostLoading(),
|
|
9901
|
+
SetPostLoading = _usePostLoading[1];
|
|
9902
|
+
var _useSelectedOrders = useSelectedOrders(),
|
|
9903
|
+
setSelectedReturnOrder = _useSelectedOrders[1];
|
|
9904
|
+
var _useSelectedConfirmLo = useSelectedConfirmLoc(),
|
|
9905
|
+
setCheck = _useSelectedConfirmLo[1];
|
|
9809
9906
|
var _useNewReturnPayload = useNewReturnPayload(),
|
|
9810
|
-
newPayload = _useNewReturnPayload[0],
|
|
9811
9907
|
setNewPayload = _useNewReturnPayload[1];
|
|
9908
|
+
var _useGroupedPayload = useGroupedPayload(),
|
|
9909
|
+
setGrouped = _useGroupedPayload[1];
|
|
9910
|
+
var _useSelectAll = useSelectAll(),
|
|
9911
|
+
setSelectAll = _useSelectAll[1];
|
|
9812
9912
|
console.log(orderProduct, 'abcabcabcabcabcabcabcabcabcabcabc');
|
|
9813
9913
|
var _closeModal = function closeModal() {
|
|
9814
9914
|
dispatch({
|
|
@@ -9984,23 +10084,40 @@ var ModalManager = function ModalManager() {
|
|
|
9984
10084
|
var _useApiHook3 = useApiHook({
|
|
9985
10085
|
endpoint: "return_orders/",
|
|
9986
10086
|
method: 'POST',
|
|
9987
|
-
body:
|
|
10087
|
+
body: newGrouped,
|
|
9988
10088
|
performAction: false
|
|
9989
10089
|
}),
|
|
9990
10090
|
response = _useApiHook3.data,
|
|
9991
|
-
setShouldPerformAction = _useApiHook3.setShouldPerformAction
|
|
10091
|
+
setShouldPerformAction = _useApiHook3.setShouldPerformAction,
|
|
10092
|
+
confirmLoading = _useApiHook3.loading;
|
|
10093
|
+
useEffect(function () {
|
|
10094
|
+
SetPostLoading(confirmLoading);
|
|
10095
|
+
}, [confirmLoading]);
|
|
10096
|
+
console.log(response);
|
|
10097
|
+
useEffect(function () {
|
|
10098
|
+
if (response === null || response && response != null && response.data) {
|
|
10099
|
+
dispatch({
|
|
10100
|
+
type: 'close'
|
|
10101
|
+
});
|
|
10102
|
+
setNewGrouped([]);
|
|
10103
|
+
setSelectedReturnOrder([]);
|
|
10104
|
+
setCheck([]);
|
|
10105
|
+
setNewPayload([]);
|
|
10106
|
+
setGrouped([]);
|
|
10107
|
+
setShouldPerformAction(false);
|
|
10108
|
+
setSelectAll(false);
|
|
10109
|
+
}
|
|
10110
|
+
}, [response]);
|
|
9992
10111
|
var handleConfirmReturn = function handleConfirmReturn() {
|
|
9993
|
-
|
|
9994
|
-
|
|
9995
|
-
return _extends({}, rest);
|
|
9996
|
-
});
|
|
9997
|
-
console.log(response);
|
|
9998
|
-
if (payloadWithoutId) {
|
|
9999
|
-
setNewPayload(payloadWithoutId);
|
|
10112
|
+
setShouldPerformAction(false);
|
|
10113
|
+
if (newGrouped.length > 0) {
|
|
10000
10114
|
setShouldPerformAction(true);
|
|
10001
10115
|
} else {
|
|
10002
10116
|
setShouldPerformAction(false);
|
|
10003
10117
|
}
|
|
10118
|
+
dispatch({
|
|
10119
|
+
type: 'close'
|
|
10120
|
+
});
|
|
10004
10121
|
};
|
|
10005
10122
|
return React.createElement(React.Fragment, null, (popupName == null ? void 0 : popupName.state) == 'create-return' && React.createElement(AntModal, {
|
|
10006
10123
|
openStatus: (popupName == null ? void 0 : popupName.state) == 'create-return' ? true : false,
|
|
@@ -10016,8 +10133,7 @@ var ModalManager = function ModalManager() {
|
|
|
10016
10133
|
name: 'Submit',
|
|
10017
10134
|
btnStyle: 'rounded',
|
|
10018
10135
|
onClick: handleConfirmReturn,
|
|
10019
|
-
type: 'button'
|
|
10020
|
-
disabled: !newPayload
|
|
10136
|
+
type: 'button'
|
|
10021
10137
|
}],
|
|
10022
10138
|
btnAlign: 'justifyEnd'
|
|
10023
10139
|
},
|
|
@@ -10290,7 +10406,7 @@ var OrderTable = function OrderTable(_ref) {
|
|
|
10290
10406
|
style: {
|
|
10291
10407
|
color: '#888075'
|
|
10292
10408
|
}
|
|
10293
|
-
}, displayValueOrNA(item == null || (_item$order_recipient2 = item.order_recipient) == null ? void 0 : _item$order_recipient2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null || (_item$customer_data = item.customer_data) == null ? void 0 : _item$customer_data.customer_name)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.consignment)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.order_number)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.box_count)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), "KG"), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React.createElement("td", null, React.createElement(AntSelect, {
|
|
10409
|
+
}, displayValueOrNA(item == null || (_item$order_recipient2 = item.order_recipient) == null ? void 0 : _item$order_recipient2.postcode)))), React.createElement("td", null, displayValueOrNA(item == null || (_item$customer_data = item.customer_data) == null ? void 0 : _item$customer_data.customer_name)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.consignment)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.order_number)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.box_count)), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), " KG"), React.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React.createElement("td", null, React.createElement(AntSelect, {
|
|
10294
10410
|
options: assigneOptions,
|
|
10295
10411
|
placeholder: "Select",
|
|
10296
10412
|
onChange: function onChange() {},
|
|
@@ -10320,7 +10436,7 @@ var OrderTable = function OrderTable(_ref) {
|
|
|
10320
10436
|
}
|
|
10321
10437
|
}, React.createElement(PrinterIcon, null), React.createElement(DownIcon, null), printToogle == index && React.createElement("div", {
|
|
10322
10438
|
ref: dropdownRef
|
|
10323
|
-
}, React.createElement(
|
|
10439
|
+
}, React.createElement(PrintDropDownReturn, null)))), React.createElement("li", {
|
|
10324
10440
|
className: "downloadcontainer"
|
|
10325
10441
|
}, React.createElement(LoadIcon, null)))));
|
|
10326
10442
|
})))));
|
|
@@ -10410,28 +10526,6 @@ var DateIcon = function DateIcon() {
|
|
|
10410
10526
|
}));
|
|
10411
10527
|
};
|
|
10412
10528
|
|
|
10413
|
-
var StatusIcon = function StatusIcon() {
|
|
10414
|
-
return React.createElement("svg", {
|
|
10415
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10416
|
-
width: "13",
|
|
10417
|
-
height: "12",
|
|
10418
|
-
viewBox: "0 0 13 12",
|
|
10419
|
-
fill: "none"
|
|
10420
|
-
}, React.createElement("path", {
|
|
10421
|
-
d: "M2.60002 6V4.83333C2.60002 3.90507 2.96877 3.01483 3.62514 2.35845C4.28152 1.70208 5.17176 1.33333 6.10002 1.33333C7.02827 1.33333 7.91851 1.70208 8.57489 2.35845C9.23127 3.01483 9.60002 3.90507 9.60002 4.83333V6M1.43335 9.5C1.43335 9.80941 1.55627 10.1062 1.77506 10.325C1.99385 10.5437 2.2906 10.6667 2.60002 10.6667C2.90944 10.6667 3.20618 10.5437 3.42497 10.325C3.64377 10.1062 3.76668 9.80941 3.76668 9.5C3.76668 9.19058 3.64377 8.89383 3.42497 8.67504C3.20618 8.45625 2.90944 8.33333 2.60002 8.33333C2.2906 8.33333 1.99385 8.45625 1.77506 8.67504C1.55627 8.89383 1.43335 9.19058 1.43335 9.5ZM8.43335 9.5C8.43335 9.80941 8.55627 10.1062 8.77506 10.325C8.99385 10.5437 9.2906 10.6667 9.60002 10.6667C9.90944 10.6667 10.2062 10.5437 10.425 10.325C10.6438 10.1062 10.7667 9.80941 10.7667 9.5C10.7667 9.19058 10.6438 8.89383 10.425 8.67504C10.2062 8.45625 9.90944 8.33333 9.60002 8.33333C9.2906 8.33333 8.99385 8.45625 8.77506 8.67504C8.55627 8.89383 8.43335 9.19058 8.43335 9.5Z",
|
|
10422
|
-
stroke: "#6D6B68",
|
|
10423
|
-
"stroke-width": "2",
|
|
10424
|
-
"stroke-linecap": "round",
|
|
10425
|
-
"stroke-linejoin": "round"
|
|
10426
|
-
}), React.createElement("path", {
|
|
10427
|
-
d: "M7.8501 4.25L9.6001 6L11.3501 4.25",
|
|
10428
|
-
stroke: "#6D6B68",
|
|
10429
|
-
"stroke-width": "2",
|
|
10430
|
-
"stroke-linecap": "round",
|
|
10431
|
-
"stroke-linejoin": "round"
|
|
10432
|
-
}));
|
|
10433
|
-
};
|
|
10434
|
-
|
|
10435
10529
|
var ClientIcon = function ClientIcon() {
|
|
10436
10530
|
return React.createElement("svg", {
|
|
10437
10531
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10445,28 +10539,6 @@ var ClientIcon = function ClientIcon() {
|
|
|
10445
10539
|
}));
|
|
10446
10540
|
};
|
|
10447
10541
|
|
|
10448
|
-
var AssigneIcon = function AssigneIcon() {
|
|
10449
|
-
return React.createElement("svg", {
|
|
10450
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10451
|
-
width: "15",
|
|
10452
|
-
height: "14",
|
|
10453
|
-
viewBox: "0 0 15 14",
|
|
10454
|
-
fill: "none"
|
|
10455
|
-
}, React.createElement("g", {
|
|
10456
|
-
"clip-path": "url(#clip0_504_13636)"
|
|
10457
|
-
}, React.createElement("path", {
|
|
10458
|
-
d: "M4.4751 1.16667H12.6418V6.70834H11.4751V2.33334H10.3084V5.61051L8.55843 4.7355L6.80843 5.61051V2.33334H5.64176V5.54167H4.4751V1.16667ZM7.9751 2.33334V3.72284L8.55843 3.43117L9.14176 3.72284V2.33334H7.9751ZM5.02051 7.72917C4.92474 7.72892 4.82985 7.74755 4.74127 7.78398C4.65269 7.82041 4.57215 7.87394 4.50426 7.9415L3.30843 9.13734V11.375H6.59085L9.97593 10.5292L12.0363 9.6495C12.1064 9.61158 12.1601 9.54908 12.1871 9.47399C12.214 9.3989 12.2123 9.31652 12.1822 9.24263C12.1521 9.16875 12.0958 9.10857 12.0241 9.07364C11.9524 9.0387 11.8703 9.03147 11.7936 9.05334L11.7819 9.05625L8.0416 9.91667H5.93343V8.75H7.75635C7.89172 8.75 8.02154 8.69623 8.11727 8.60051C8.21299 8.50479 8.26676 8.37496 8.26676 8.23959C8.26676 8.10422 8.21299 7.97439 8.11727 7.87867C8.02154 7.78295 7.89172 7.72917 7.75635 7.72917H5.02051ZM9.42585 8.40117L11.4978 7.92459C11.7185 7.86656 11.9496 7.85988 12.1732 7.90505C12.3969 7.95022 12.6072 8.04605 12.7881 8.18518C12.969 8.3243 13.1155 8.50302 13.2166 8.70762C13.3176 8.91221 13.3704 9.13724 13.3709 9.36542C13.3707 9.64241 13.2934 9.91388 13.1478 10.1495C13.0021 10.3851 12.7938 10.5755 12.5461 10.6995L12.5303 10.7077L10.3487 11.6381L6.73435 12.5417H0.100098V8.3125H2.4836L3.6806 7.1155C3.85696 6.93974 4.06622 6.80044 4.29643 6.70555C4.52663 6.61067 4.77327 6.56206 5.02226 6.5625H7.75635C7.99023 6.56247 8.22153 6.61136 8.4354 6.70603C8.64926 6.8007 8.84096 6.93905 8.99818 7.11221C9.15541 7.28536 9.27467 7.48948 9.34832 7.71146C9.42198 7.93345 9.44838 8.16838 9.42585 8.40117ZM2.14176 9.47917H1.26676V11.375H2.14176V9.47917Z",
|
|
10459
|
-
fill: "#6D6B68"
|
|
10460
|
-
})), React.createElement("defs", null, React.createElement("clipPath", {
|
|
10461
|
-
id: "clip0_504_13636"
|
|
10462
|
-
}, React.createElement("rect", {
|
|
10463
|
-
width: "14",
|
|
10464
|
-
height: "14",
|
|
10465
|
-
fill: "white",
|
|
10466
|
-
transform: "translate(0.100098)"
|
|
10467
|
-
}))));
|
|
10468
|
-
};
|
|
10469
|
-
|
|
10470
10542
|
var initialState$2 = {
|
|
10471
10543
|
'x-filters': [],
|
|
10472
10544
|
'x-pagination': {
|
|
@@ -10500,20 +10572,16 @@ var filterReducer$1 = function filterReducer(state, action) {
|
|
|
10500
10572
|
value: action.payload
|
|
10501
10573
|
}])
|
|
10502
10574
|
});
|
|
10503
|
-
|
|
10504
|
-
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
// value: action.payload,
|
|
10514
|
-
// },
|
|
10515
|
-
// ],
|
|
10516
|
-
// };
|
|
10575
|
+
case 'SET_STATUS_ORDER_FILTER':
|
|
10576
|
+
return _extends({}, state, {
|
|
10577
|
+
'x-filters': [].concat(state['x-filters'].filter(function (f) {
|
|
10578
|
+
return f.field !== 'status_id';
|
|
10579
|
+
}), [{
|
|
10580
|
+
field: 'status_id',
|
|
10581
|
+
op: '=',
|
|
10582
|
+
value: action.payload
|
|
10583
|
+
}])
|
|
10584
|
+
});
|
|
10517
10585
|
// case 'SET_LOCATION_FILTER':
|
|
10518
10586
|
// return {
|
|
10519
10587
|
// ...state,
|
|
@@ -10551,6 +10619,50 @@ var filtersReducerAtom$1 = /*#__PURE__*/atom(function (get) {
|
|
|
10551
10619
|
return set(filtersStateAtom$1, filterReducer$1(get(filtersStateAtom$1), action));
|
|
10552
10620
|
});
|
|
10553
10621
|
|
|
10622
|
+
var StatusIcon = function StatusIcon() {
|
|
10623
|
+
return React.createElement("svg", {
|
|
10624
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10625
|
+
width: "13",
|
|
10626
|
+
height: "12",
|
|
10627
|
+
viewBox: "0 0 13 12",
|
|
10628
|
+
fill: "none"
|
|
10629
|
+
}, React.createElement("path", {
|
|
10630
|
+
d: "M2.60002 6V4.83333C2.60002 3.90507 2.96877 3.01483 3.62514 2.35845C4.28152 1.70208 5.17176 1.33333 6.10002 1.33333C7.02827 1.33333 7.91851 1.70208 8.57489 2.35845C9.23127 3.01483 9.60002 3.90507 9.60002 4.83333V6M1.43335 9.5C1.43335 9.80941 1.55627 10.1062 1.77506 10.325C1.99385 10.5437 2.2906 10.6667 2.60002 10.6667C2.90944 10.6667 3.20618 10.5437 3.42497 10.325C3.64377 10.1062 3.76668 9.80941 3.76668 9.5C3.76668 9.19058 3.64377 8.89383 3.42497 8.67504C3.20618 8.45625 2.90944 8.33333 2.60002 8.33333C2.2906 8.33333 1.99385 8.45625 1.77506 8.67504C1.55627 8.89383 1.43335 9.19058 1.43335 9.5ZM8.43335 9.5C8.43335 9.80941 8.55627 10.1062 8.77506 10.325C8.99385 10.5437 9.2906 10.6667 9.60002 10.6667C9.90944 10.6667 10.2062 10.5437 10.425 10.325C10.6438 10.1062 10.7667 9.80941 10.7667 9.5C10.7667 9.19058 10.6438 8.89383 10.425 8.67504C10.2062 8.45625 9.90944 8.33333 9.60002 8.33333C9.2906 8.33333 8.99385 8.45625 8.77506 8.67504C8.55627 8.89383 8.43335 9.19058 8.43335 9.5Z",
|
|
10631
|
+
stroke: "#6D6B68",
|
|
10632
|
+
"stroke-width": "2",
|
|
10633
|
+
"stroke-linecap": "round",
|
|
10634
|
+
"stroke-linejoin": "round"
|
|
10635
|
+
}), React.createElement("path", {
|
|
10636
|
+
d: "M7.8501 4.25L9.6001 6L11.3501 4.25",
|
|
10637
|
+
stroke: "#6D6B68",
|
|
10638
|
+
"stroke-width": "2",
|
|
10639
|
+
"stroke-linecap": "round",
|
|
10640
|
+
"stroke-linejoin": "round"
|
|
10641
|
+
}));
|
|
10642
|
+
};
|
|
10643
|
+
|
|
10644
|
+
var AssigneIcon = function AssigneIcon() {
|
|
10645
|
+
return React.createElement("svg", {
|
|
10646
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10647
|
+
width: "15",
|
|
10648
|
+
height: "14",
|
|
10649
|
+
viewBox: "0 0 15 14",
|
|
10650
|
+
fill: "none"
|
|
10651
|
+
}, React.createElement("g", {
|
|
10652
|
+
"clip-path": "url(#clip0_504_13636)"
|
|
10653
|
+
}, React.createElement("path", {
|
|
10654
|
+
d: "M4.4751 1.16667H12.6418V6.70834H11.4751V2.33334H10.3084V5.61051L8.55843 4.7355L6.80843 5.61051V2.33334H5.64176V5.54167H4.4751V1.16667ZM7.9751 2.33334V3.72284L8.55843 3.43117L9.14176 3.72284V2.33334H7.9751ZM5.02051 7.72917C4.92474 7.72892 4.82985 7.74755 4.74127 7.78398C4.65269 7.82041 4.57215 7.87394 4.50426 7.9415L3.30843 9.13734V11.375H6.59085L9.97593 10.5292L12.0363 9.6495C12.1064 9.61158 12.1601 9.54908 12.1871 9.47399C12.214 9.3989 12.2123 9.31652 12.1822 9.24263C12.1521 9.16875 12.0958 9.10857 12.0241 9.07364C11.9524 9.0387 11.8703 9.03147 11.7936 9.05334L11.7819 9.05625L8.0416 9.91667H5.93343V8.75H7.75635C7.89172 8.75 8.02154 8.69623 8.11727 8.60051C8.21299 8.50479 8.26676 8.37496 8.26676 8.23959C8.26676 8.10422 8.21299 7.97439 8.11727 7.87867C8.02154 7.78295 7.89172 7.72917 7.75635 7.72917H5.02051ZM9.42585 8.40117L11.4978 7.92459C11.7185 7.86656 11.9496 7.85988 12.1732 7.90505C12.3969 7.95022 12.6072 8.04605 12.7881 8.18518C12.969 8.3243 13.1155 8.50302 13.2166 8.70762C13.3176 8.91221 13.3704 9.13724 13.3709 9.36542C13.3707 9.64241 13.2934 9.91388 13.1478 10.1495C13.0021 10.3851 12.7938 10.5755 12.5461 10.6995L12.5303 10.7077L10.3487 11.6381L6.73435 12.5417H0.100098V8.3125H2.4836L3.6806 7.1155C3.85696 6.93974 4.06622 6.80044 4.29643 6.70555C4.52663 6.61067 4.77327 6.56206 5.02226 6.5625H7.75635C7.99023 6.56247 8.22153 6.61136 8.4354 6.70603C8.64926 6.8007 8.84096 6.93905 8.99818 7.11221C9.15541 7.28536 9.27467 7.48948 9.34832 7.71146C9.42198 7.93345 9.44838 8.16838 9.42585 8.40117ZM2.14176 9.47917H1.26676V11.375H2.14176V9.47917Z",
|
|
10655
|
+
fill: "#6D6B68"
|
|
10656
|
+
})), React.createElement("defs", null, React.createElement("clipPath", {
|
|
10657
|
+
id: "clip0_504_13636"
|
|
10658
|
+
}, React.createElement("rect", {
|
|
10659
|
+
width: "14",
|
|
10660
|
+
height: "14",
|
|
10661
|
+
fill: "white",
|
|
10662
|
+
transform: "translate(0.100098)"
|
|
10663
|
+
}))));
|
|
10664
|
+
};
|
|
10665
|
+
|
|
10554
10666
|
var _templateObject$2j, _templateObject2$1G;
|
|
10555
10667
|
var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
10556
10668
|
var _useAtom = useAtom(filtersReducerAtom$1),
|
|
@@ -10560,22 +10672,15 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10560
10672
|
var _useState = useState(),
|
|
10561
10673
|
selectedDate = _useState[0],
|
|
10562
10674
|
setSelectedDate = _useState[1];
|
|
10563
|
-
var
|
|
10564
|
-
|
|
10565
|
-
|
|
10566
|
-
},
|
|
10567
|
-
|
|
10568
|
-
|
|
10569
|
-
},
|
|
10570
|
-
|
|
10571
|
-
|
|
10572
|
-
}, {
|
|
10573
|
-
label: 'Zone 4',
|
|
10574
|
-
value: 'zone4'
|
|
10575
|
-
}, {
|
|
10576
|
-
label: 'Zone 5',
|
|
10577
|
-
value: 'zone5'
|
|
10578
|
-
}];
|
|
10675
|
+
var _useStatusOrderData = useStatusOrderData(),
|
|
10676
|
+
statusOfOrder = _useStatusOrderData[0];
|
|
10677
|
+
// const zoneOptions = [
|
|
10678
|
+
// { label: 'Zone 1', value: 'zone1' },
|
|
10679
|
+
// { label: 'Zone 2', value: 'zone2' },
|
|
10680
|
+
// { label: 'Zone 3', value: 'zone3' },
|
|
10681
|
+
// { label: 'Zone 4', value: 'zone4' },
|
|
10682
|
+
// { label: 'Zone 5', value: 'zone5' },
|
|
10683
|
+
// ];
|
|
10579
10684
|
// date change here
|
|
10580
10685
|
var handleDateChange = function handleDateChange(date) {
|
|
10581
10686
|
setSelectedDate(date ? date == null ? void 0 : date.$d : null);
|
|
@@ -10598,6 +10703,14 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10598
10703
|
value: option == null ? void 0 : option.id
|
|
10599
10704
|
};
|
|
10600
10705
|
});
|
|
10706
|
+
//status of order
|
|
10707
|
+
var orderOptions = statusOfOrder == null ? void 0 : statusOfOrder.map(function (option) {
|
|
10708
|
+
var _option$status_type, _option$status_type2;
|
|
10709
|
+
return {
|
|
10710
|
+
label: (option == null || (_option$status_type = option.status_type) == null || (_option$status_type = _option$status_type.charAt(0)) == null ? void 0 : _option$status_type.toUpperCase()) + (option == null || (_option$status_type2 = option.status_type) == null ? void 0 : _option$status_type2.slice(1)),
|
|
10711
|
+
value: option == null ? void 0 : option.id
|
|
10712
|
+
};
|
|
10713
|
+
});
|
|
10601
10714
|
var handleClientChange = function handleClientChange(value) {
|
|
10602
10715
|
console.log(value, 'value');
|
|
10603
10716
|
dispatch({
|
|
@@ -10605,6 +10718,13 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10605
10718
|
payload: value
|
|
10606
10719
|
});
|
|
10607
10720
|
};
|
|
10721
|
+
var handleStatusOfOrder = function handleStatusOfOrder(value) {
|
|
10722
|
+
console.log(value, 'value');
|
|
10723
|
+
dispatch({
|
|
10724
|
+
type: 'SET_STATUS_ORDER_FILTER',
|
|
10725
|
+
payload: value
|
|
10726
|
+
});
|
|
10727
|
+
};
|
|
10608
10728
|
return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(StyledFIlterELements, null, React.createElement(LeftSideConatiner, null, React.createElement("div", {
|
|
10609
10729
|
className: "filtercontainer"
|
|
10610
10730
|
}, React.createElement("div", {
|
|
@@ -10630,25 +10750,14 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10630
10750
|
}, React.createElement("div", {
|
|
10631
10751
|
className: "dateiconcontainer"
|
|
10632
10752
|
}, React.createElement(StatusIcon, null)), React.createElement(StyledAntSelect$d, null, React.createElement(Select, {
|
|
10633
|
-
options:
|
|
10753
|
+
options: orderOptions,
|
|
10634
10754
|
className: "custom-select",
|
|
10635
10755
|
placeholder: "Status of Order",
|
|
10636
|
-
onChange:
|
|
10756
|
+
onChange: handleStatusOfOrder,
|
|
10637
10757
|
style: {
|
|
10638
|
-
minWidth: '
|
|
10758
|
+
minWidth: '130px'
|
|
10639
10759
|
},
|
|
10640
|
-
|
|
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
|
-
}
|
|
10760
|
+
allowClear: true
|
|
10652
10761
|
}))), React.createElement("div", {
|
|
10653
10762
|
className: "datefilter"
|
|
10654
10763
|
}, React.createElement("div", {
|
|
@@ -10659,49 +10768,19 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10659
10768
|
placeholder: "Client",
|
|
10660
10769
|
onChange: handleClientChange,
|
|
10661
10770
|
style: {
|
|
10662
|
-
width: '125px'
|
|
10771
|
+
width: '125px',
|
|
10772
|
+
border: 'none'
|
|
10663
10773
|
},
|
|
10664
|
-
|
|
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
|
-
}
|
|
10774
|
+
allowClear: true
|
|
10676
10775
|
}))), React.createElement("div", {
|
|
10677
10776
|
className: "datefilter"
|
|
10678
10777
|
}, React.createElement("div", {
|
|
10679
10778
|
className: "dateiconcontainer"
|
|
10680
|
-
}, React.createElement(AssigneIcon, null)), React.createElement(
|
|
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)));
|
|
10779
|
+
}, React.createElement(AssigneIcon, null))))), React.createElement(TableFilters, null)));
|
|
10701
10780
|
};
|
|
10702
10781
|
var StyledDatePicker = /*#__PURE__*/styled.div(_templateObject$2j || (_templateObject$2j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-datepicker {\n border: none;\n }\n"])));
|
|
10703
10782
|
// 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"])));
|
|
10783
|
+
var StyledAntSelect$d = /*#__PURE__*/styled.div(_templateObject2$1G || (_templateObject2$1G = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-select {\n border: none;\n width: 80px;\n }\n .ant-select-selector {\n border: 1px solid #ffffff !important;\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"])));
|
|
10705
10784
|
|
|
10706
10785
|
var _templateObject$2k, _templateObject2$1H;
|
|
10707
10786
|
var ReturnAfterTable = function ReturnAfterTable() {
|
|
@@ -10886,7 +10965,7 @@ function ReturnMainTable() {
|
|
|
10886
10965
|
}),
|
|
10887
10966
|
fetchedClientData = _useApiHook.data,
|
|
10888
10967
|
staticDataLoading = _useApiHook.loading;
|
|
10889
|
-
console.log('fetchedClientData', fetchedClientData
|
|
10968
|
+
// console.log('fetchedClientData', fetchedClientData?.data);
|
|
10890
10969
|
useEffect(function () {
|
|
10891
10970
|
setLoading(staticDataLoading);
|
|
10892
10971
|
if (fetchedClientData && fetchedClientData.data) {
|