@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
|
@@ -3151,7 +3151,7 @@ function GeneralHeader() {
|
|
|
3151
3151
|
var Section = /*#__PURE__*/styled__default.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"])));
|
|
3152
3152
|
|
|
3153
3153
|
var _templateObject19, _templateObject20, _templateObject21;
|
|
3154
|
-
var StyledTable = /*#__PURE__*/styled__default.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"])));
|
|
3154
|
+
var StyledTable = /*#__PURE__*/styled__default.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"])));
|
|
3155
3155
|
// Styled components
|
|
3156
3156
|
var StyledTableWrapper = /*#__PURE__*/styled__default.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"])));
|
|
3157
3157
|
var CustomDrop = /*#__PURE__*/styled__default.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"])));
|
|
@@ -3186,6 +3186,11 @@ var locationData = /*#__PURE__*/jotai.atom([]);
|
|
|
3186
3186
|
var createReturnPayload = /*#__PURE__*/jotai.atom(CreateReturnInitial);
|
|
3187
3187
|
var newPayload = /*#__PURE__*/jotai.atom([]);
|
|
3188
3188
|
var grpPayload = /*#__PURE__*/jotai.atom([]);
|
|
3189
|
+
var statusOfOrder = /*#__PURE__*/jotai.atom([]);
|
|
3190
|
+
var selectedLocationConfirm = /*#__PURE__*/jotai.atom([]);
|
|
3191
|
+
var selectAll = /*#__PURE__*/jotai.atom(false);
|
|
3192
|
+
var postLoading = /*#__PURE__*/jotai.atom(false);
|
|
3193
|
+
var _final = /*#__PURE__*/jotai.atom([]);
|
|
3189
3194
|
var selectedOrderlList = /*#__PURE__*/jotai.atom([]);
|
|
3190
3195
|
function useSelectedOrders() {
|
|
3191
3196
|
return jotai.useAtom(selectedOrderlList);
|
|
@@ -3213,6 +3218,21 @@ function useNewReturnPayload() {
|
|
|
3213
3218
|
function useGroupedPayload() {
|
|
3214
3219
|
return jotai.useAtom(grpPayload);
|
|
3215
3220
|
}
|
|
3221
|
+
function useStatusOrderData() {
|
|
3222
|
+
return jotai.useAtom(statusOfOrder);
|
|
3223
|
+
}
|
|
3224
|
+
function useSelectedConfirmLoc() {
|
|
3225
|
+
return jotai.useAtom(selectedLocationConfirm);
|
|
3226
|
+
}
|
|
3227
|
+
function useSelectAll() {
|
|
3228
|
+
return jotai.useAtom(selectAll);
|
|
3229
|
+
}
|
|
3230
|
+
function usePostLoading() {
|
|
3231
|
+
return jotai.useAtom(postLoading);
|
|
3232
|
+
}
|
|
3233
|
+
function useFinalPayload() {
|
|
3234
|
+
return jotai.useAtom(_final);
|
|
3235
|
+
}
|
|
3216
3236
|
|
|
3217
3237
|
var ReturnProductTable = function ReturnProductTable() {
|
|
3218
3238
|
var _useSelectedOrders = useSelectedOrders(),
|
|
@@ -8343,6 +8363,12 @@ function SelectionFilter() {
|
|
|
8343
8363
|
setStoredCustomerId = _useState6[1];
|
|
8344
8364
|
var _useNewReturnPayload = useNewReturnPayload(),
|
|
8345
8365
|
setNewPayload = _useNewReturnPayload[1];
|
|
8366
|
+
var _useGroupedPayload = useGroupedPayload(),
|
|
8367
|
+
setGrouped = _useGroupedPayload[1];
|
|
8368
|
+
var _useSelectedOrders = useSelectedOrders(),
|
|
8369
|
+
setSelectedReturnOrder = _useSelectedOrders[1];
|
|
8370
|
+
var _useSelectAll = useSelectAll(),
|
|
8371
|
+
setSelectAll = _useSelectAll[1];
|
|
8346
8372
|
//client options
|
|
8347
8373
|
var clientOptions = customers == null ? void 0 : customers.map(function (option) {
|
|
8348
8374
|
var _option$customer_name, _option$customer_name2;
|
|
@@ -8365,7 +8391,7 @@ function SelectionFilter() {
|
|
|
8365
8391
|
var LocationOptions = locationData == null ? void 0 : locationData.map(function (option) {
|
|
8366
8392
|
return {
|
|
8367
8393
|
label: option == null ? void 0 : option.location_name,
|
|
8368
|
-
value: option == null ? void 0 : option.
|
|
8394
|
+
value: option == null ? void 0 : option.token
|
|
8369
8395
|
};
|
|
8370
8396
|
});
|
|
8371
8397
|
//client change
|
|
@@ -8391,7 +8417,6 @@ function SelectionFilter() {
|
|
|
8391
8417
|
customer_id: storedCustomerId
|
|
8392
8418
|
});
|
|
8393
8419
|
});
|
|
8394
|
-
console.log(selectedUuids, 'selectedUuids');
|
|
8395
8420
|
var filteredSubLocations = locationData == null ? void 0 : locationData.filter(function (subCat) {
|
|
8396
8421
|
return (subCat == null ? void 0 : subCat.customer_id) === selectedUuids;
|
|
8397
8422
|
}).map(function (subCat) {
|
|
@@ -8402,6 +8427,10 @@ function SelectionFilter() {
|
|
|
8402
8427
|
});
|
|
8403
8428
|
setFilteredLocationOptions(filteredSubLocations);
|
|
8404
8429
|
setUuid('');
|
|
8430
|
+
setSelectedReturnOrder([]);
|
|
8431
|
+
setNewPayload([]);
|
|
8432
|
+
setGrouped([]);
|
|
8433
|
+
setSelectAll(false);
|
|
8405
8434
|
};
|
|
8406
8435
|
React.useEffect(function () {
|
|
8407
8436
|
var accountNumberFromStorage = localStorage.getItem('account_number');
|
|
@@ -8425,8 +8454,7 @@ function SelectionFilter() {
|
|
|
8425
8454
|
//location change
|
|
8426
8455
|
var handleLocationChange = function handleLocationChange(value, option) {
|
|
8427
8456
|
var selectedLabel = option == null ? void 0 : option.label;
|
|
8428
|
-
|
|
8429
|
-
setSelectedLocationValue(selectedLabel);
|
|
8457
|
+
setSelectedLocationValue(value);
|
|
8430
8458
|
if (selectedLocationValue === selectedLabel) {
|
|
8431
8459
|
dispatch({
|
|
8432
8460
|
type: 'CLEAR_ALL_FILTERS',
|
|
@@ -8485,8 +8513,8 @@ function SelectionFilter() {
|
|
|
8485
8513
|
setIsButtonEnabled(false);
|
|
8486
8514
|
}
|
|
8487
8515
|
}, [storedName, selectedFilterValue, selectedLocationValue]);
|
|
8488
|
-
console.log(filteredLocationOptions, 'filteredLocationOptions');
|
|
8489
|
-
console.log('check', storedName, selectedFilterValue, selectedLocationValue);
|
|
8516
|
+
// console.log(filteredLocationOptions, 'filteredLocationOptions');
|
|
8517
|
+
// console.log('check', storedName, selectedFilterValue, selectedLocationValue);
|
|
8490
8518
|
return React__default.createElement(Wrapper$k, null, React__default.createElement(FilterRow, null, React__default.createElement(LeftColumn, null, React__default.createElement(FilterColumn, null, React__default.createElement(Label$g, null, "Clients"), React__default.createElement(StyledAntSelect$5, {
|
|
8491
8519
|
options: clientOptions,
|
|
8492
8520
|
placeholder: "Select Client Name",
|
|
@@ -8528,6 +8556,8 @@ function HeaderFilter() {
|
|
|
8528
8556
|
setActionType = _useActionType[1];
|
|
8529
8557
|
var _useLocationData = useLocationData(),
|
|
8530
8558
|
setLocationData = _useLocationData[1];
|
|
8559
|
+
var _useStatusOrderData = useStatusOrderData(),
|
|
8560
|
+
setStatusOfOrders = _useStatusOrderData[1];
|
|
8531
8561
|
//API for client data
|
|
8532
8562
|
var _useApiHook = dmsComponentLibrary.useApiHook({
|
|
8533
8563
|
endpoint: "/customers/",
|
|
@@ -8568,10 +8598,13 @@ function HeaderFilter() {
|
|
|
8568
8598
|
}, [loading, fetchedCustomerData]);
|
|
8569
8599
|
React.useEffect(function () {
|
|
8570
8600
|
if (fetchedStaticData && fetchedStaticData != null && fetchedStaticData.data) {
|
|
8571
|
-
var _fetchedStaticData$da;
|
|
8601
|
+
var _fetchedStaticData$da, _fetchedStaticData$da2;
|
|
8572
8602
|
setActionType(fetchedStaticData == null || (_fetchedStaticData$da = fetchedStaticData.data) == null ? void 0 : _fetchedStaticData$da.flatMap(function (i) {
|
|
8573
8603
|
return i == null ? void 0 : i.order_product_return_action;
|
|
8574
8604
|
}));
|
|
8605
|
+
setStatusOfOrders(fetchedStaticData == null || (_fetchedStaticData$da2 = fetchedStaticData.data) == null ? void 0 : _fetchedStaticData$da2.flatMap(function (i) {
|
|
8606
|
+
return i == null ? void 0 : i.order_stock_alias;
|
|
8607
|
+
}));
|
|
8575
8608
|
}
|
|
8576
8609
|
}, [actionLoading, fetchedStaticData]);
|
|
8577
8610
|
React.useEffect(function () {
|
|
@@ -8816,30 +8849,28 @@ var formatDate$1 = function formatDate(date) {
|
|
|
8816
8849
|
// const seconds = padZero(date.getSeconds());
|
|
8817
8850
|
return year + "-" + month + "-" + day;
|
|
8818
8851
|
};
|
|
8852
|
+
var displayValueOrNA = function displayValueOrNA(value) {
|
|
8853
|
+
var isBlankArray = Array.isArray(value) && value.length === 0;
|
|
8854
|
+
if (value === 0) {
|
|
8855
|
+
return 0;
|
|
8856
|
+
}
|
|
8857
|
+
if (value === 'NA' || value === undefined || value === null || isBlankArray) {
|
|
8858
|
+
return 'NA';
|
|
8859
|
+
}
|
|
8860
|
+
return value;
|
|
8861
|
+
};
|
|
8819
8862
|
|
|
8820
|
-
var
|
|
8821
|
-
icon: 'runSheet',
|
|
8822
|
-
label: 'Print Runsheet'
|
|
8823
|
-
}, {
|
|
8824
|
-
icon: 'loadSheet',
|
|
8825
|
-
label: 'Print Loadsheet'
|
|
8826
|
-
}, {
|
|
8863
|
+
var optionsForReturnPrint = [{
|
|
8827
8864
|
icon: 'deliveryLables',
|
|
8828
|
-
label: 'Print
|
|
8829
|
-
}, {
|
|
8830
|
-
icon: 'customerLables',
|
|
8831
|
-
label: 'Print Customer Labels'
|
|
8832
|
-
}, {
|
|
8833
|
-
icon: 'collectionLables',
|
|
8834
|
-
label: 'Print Collection Labels'
|
|
8865
|
+
label: 'Print Return Labels'
|
|
8835
8866
|
}];
|
|
8836
8867
|
|
|
8837
8868
|
var _templateObject$23, _templateObject2$1t;
|
|
8838
8869
|
// import { PrintIconMap } from '../utils';
|
|
8839
8870
|
// import { optionsPrint } from '../fakeData';
|
|
8840
8871
|
// import { PrintData } from '../interface';
|
|
8841
|
-
var options$2 =
|
|
8842
|
-
var
|
|
8872
|
+
var options$2 = optionsForReturnPrint;
|
|
8873
|
+
var PrintDropDownReturn = function PrintDropDownReturn() {
|
|
8843
8874
|
var downloadFiles = function downloadFiles() {};
|
|
8844
8875
|
return React__default.createElement(OptionsList, null, options$2.map(function (item, index) {
|
|
8845
8876
|
var IconComponent = PrintIconMap[item.icon];
|
|
@@ -8852,22 +8883,22 @@ var PrintDropDown = function PrintDropDown() {
|
|
|
8852
8883
|
var OptionsList = /*#__PURE__*/styled__default.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"])));
|
|
8853
8884
|
var OptionsListLi = /*#__PURE__*/styled__default.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"])));
|
|
8854
8885
|
|
|
8855
|
-
var ReturnOrderTable = function ReturnOrderTable(
|
|
8856
|
-
var loadingskeleton = _ref.loadingskeleton;
|
|
8886
|
+
var ReturnOrderTable = function ReturnOrderTable() {
|
|
8857
8887
|
var _useAtom = jotai.useAtom(filtersReducerAtom),
|
|
8858
8888
|
state = _useAtom[0];
|
|
8859
8889
|
var _useSelectedOrders = useSelectedOrders(),
|
|
8860
8890
|
selectedReturnOrder = _useSelectedOrders[0],
|
|
8861
8891
|
setSelectedReturnOrder = _useSelectedOrders[1];
|
|
8862
|
-
var
|
|
8863
|
-
selectAll =
|
|
8864
|
-
setSelectAll =
|
|
8892
|
+
var _useSelectAll = useSelectAll(),
|
|
8893
|
+
selectAll = _useSelectAll[0],
|
|
8894
|
+
setSelectAll = _useSelectAll[1];
|
|
8865
8895
|
var filters = state['x-filters'],
|
|
8866
8896
|
pagination = state['x-pagination'];
|
|
8867
8897
|
var _useReturnData = useReturnData(),
|
|
8868
8898
|
returnData = _useReturnData[0],
|
|
8869
8899
|
setReturnData = _useReturnData[1];
|
|
8870
8900
|
var _useLoading = useLoading(),
|
|
8901
|
+
load = _useLoading[0],
|
|
8871
8902
|
setLoading = _useLoading[1];
|
|
8872
8903
|
var dropdownRefParent = React.useRef(null);
|
|
8873
8904
|
var dropdownRef = React.useRef(null);
|
|
@@ -8882,6 +8913,8 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8882
8913
|
setNewPayload = _useNewReturnPayload[1];
|
|
8883
8914
|
var _useGroupedPayload = useGroupedPayload(),
|
|
8884
8915
|
setGrouped = _useGroupedPayload[1];
|
|
8916
|
+
var _useLocationData = useLocationData(),
|
|
8917
|
+
locationData = _useLocationData[0];
|
|
8885
8918
|
var OpenDropDown = function OpenDropDown(index) {
|
|
8886
8919
|
setPrintToggle(function (prevIndex) {
|
|
8887
8920
|
return prevIndex === index ? null : index;
|
|
@@ -8906,56 +8939,75 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8906
8939
|
pagination: pagination
|
|
8907
8940
|
}),
|
|
8908
8941
|
fetchedOrderData = _useApiHook.data,
|
|
8909
|
-
|
|
8942
|
+
returnDataLoad = _useApiHook.loading;
|
|
8910
8943
|
React.useEffect(function () {
|
|
8911
|
-
setLoading(
|
|
8944
|
+
setLoading(returnDataLoad);
|
|
8912
8945
|
if (fetchedOrderData && fetchedOrderData != null && fetchedOrderData.data) {
|
|
8913
8946
|
setReturnData(fetchedOrderData == null ? void 0 : fetchedOrderData.data);
|
|
8914
8947
|
}
|
|
8915
|
-
}, [fetchedOrderData,
|
|
8948
|
+
}, [fetchedOrderData, returnDataLoad]);
|
|
8949
|
+
React.useEffect(function () {
|
|
8950
|
+
setLoading(returnDataLoad);
|
|
8951
|
+
if (fetchedOrderData && fetchedOrderData != null && fetchedOrderData.data && locationData) {
|
|
8952
|
+
var updatedReturnData = fetchedOrderData.data.map(function (returnItem) {
|
|
8953
|
+
var matchingLocation = locationData.find(function (location) {
|
|
8954
|
+
return (location == null ? void 0 : location.token) === (returnItem == null ? void 0 : returnItem.return_location);
|
|
8955
|
+
});
|
|
8956
|
+
return _extends({}, returnItem, {
|
|
8957
|
+
new_location: matchingLocation ? matchingLocation.location_name : null
|
|
8958
|
+
});
|
|
8959
|
+
});
|
|
8960
|
+
setReturnData(updatedReturnData);
|
|
8961
|
+
}
|
|
8962
|
+
}, [fetchedOrderData, returnDataLoad, locationData]);
|
|
8916
8963
|
var handleSelectAll = function handleSelectAll(e) {
|
|
8917
8964
|
setSelectAll(e.target.checked);
|
|
8918
8965
|
if (e.target.checked) {
|
|
8919
8966
|
setSelectedReturnOrder(returnData == null ? void 0 : returnData.map(function (loc) {
|
|
8920
|
-
var _loc$return_locations;
|
|
8921
8967
|
return {
|
|
8922
8968
|
id: loc.id,
|
|
8923
8969
|
return_locations: loc == null ? void 0 : loc.return_locations,
|
|
8924
8970
|
return_location: loc == null ? void 0 : loc.return_location,
|
|
8925
|
-
products: loc.
|
|
8971
|
+
products: loc == null ? void 0 : loc.legacy_product_id,
|
|
8926
8972
|
order_product_return_action: loc == null ? void 0 : loc.order_product_return_action,
|
|
8927
|
-
return_location_token: loc == null
|
|
8973
|
+
return_location_token: loc == null ? void 0 : loc.return_location,
|
|
8974
|
+
new_location: loc == null ? void 0 : loc.new_location
|
|
8928
8975
|
};
|
|
8929
8976
|
}));
|
|
8930
8977
|
setNewPayload(returnData == null ? void 0 : returnData.map(function (loc) {
|
|
8931
|
-
var _loc$order_product_re
|
|
8978
|
+
var _loc$order_product_re;
|
|
8932
8979
|
return {
|
|
8933
8980
|
id: loc.id,
|
|
8934
8981
|
account_number: createReturn == null ? void 0 : createReturn.account_number,
|
|
8935
|
-
customer_id: createReturn == null ? void 0 : createReturn.customer_id,
|
|
8936
|
-
products: loc.
|
|
8937
|
-
return_action:
|
|
8938
|
-
return_location_token:
|
|
8982
|
+
customer_id: +(createReturn == null ? void 0 : createReturn.customer_id),
|
|
8983
|
+
products: [loc == null ? void 0 : loc.legacy_product_id],
|
|
8984
|
+
return_action: [loc == null || (_loc$order_product_re = loc.order_product_return_action) == null ? void 0 : _loc$order_product_re.type] || null,
|
|
8985
|
+
return_location_token: (loc == null ? void 0 : loc.return_location) || null,
|
|
8986
|
+
new_location: loc == null ? void 0 : loc.new_location
|
|
8939
8987
|
};
|
|
8940
8988
|
}));
|
|
8941
8989
|
} else {
|
|
8942
8990
|
setSelectedReturnOrder([]);
|
|
8991
|
+
setNewPayload([]);
|
|
8992
|
+
setGrouped([]);
|
|
8943
8993
|
}
|
|
8944
8994
|
};
|
|
8945
|
-
var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action) {
|
|
8995
|
+
var handleSelectOrderReturn = function handleSelectOrderReturn(id, return_location, return_locations, order_product_return_action, new_location, legacy_product_id) {
|
|
8946
8996
|
setSelectedReturnOrder(function (prevSelectedLocations) {
|
|
8947
8997
|
var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.some(function (loc) {
|
|
8948
8998
|
return loc.id === id;
|
|
8949
8999
|
});
|
|
9000
|
+
console.log(new_location, 'new_location');
|
|
8950
9001
|
if (isSelected) {
|
|
8951
9002
|
var updatedSelectedLocations = prevSelectedLocations.filter(function (loc) {
|
|
8952
9003
|
return loc.id !== id;
|
|
8953
9004
|
});
|
|
8954
9005
|
setReturnPayload(function (prevState) {
|
|
8955
9006
|
return _extends({}, prevState, {
|
|
8956
|
-
products:
|
|
9007
|
+
products: legacy_product_id,
|
|
8957
9008
|
return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
|
|
8958
|
-
return_location_token:
|
|
9009
|
+
return_location_token: return_location || null,
|
|
9010
|
+
new_location: new_location
|
|
8959
9011
|
});
|
|
8960
9012
|
});
|
|
8961
9013
|
setNewPayload(function (prevPayload) {
|
|
@@ -8968,26 +9020,28 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
8968
9020
|
var newReturnPayload = {
|
|
8969
9021
|
id: id,
|
|
8970
9022
|
account_number: createReturn == null ? void 0 : createReturn.account_number,
|
|
8971
|
-
customer_id: createReturn == null ? void 0 : createReturn.customer_id,
|
|
8972
|
-
products:
|
|
8973
|
-
return_action:
|
|
8974
|
-
return_location_token:
|
|
9023
|
+
customer_id: +(createReturn == null ? void 0 : createReturn.customer_id),
|
|
9024
|
+
products: [legacy_product_id],
|
|
9025
|
+
return_action: [order_product_return_action == null ? void 0 : order_product_return_action.type] || null,
|
|
9026
|
+
return_location_token: return_location || null
|
|
8975
9027
|
};
|
|
8976
9028
|
setNewPayload(function (prevPayload) {
|
|
8977
9029
|
return [].concat(prevPayload, [newReturnPayload]);
|
|
8978
9030
|
});
|
|
8979
9031
|
setReturnPayload(function (prevState) {
|
|
8980
9032
|
return _extends({}, prevState, {
|
|
8981
|
-
products:
|
|
9033
|
+
products: legacy_product_id,
|
|
8982
9034
|
return_action: (order_product_return_action == null ? void 0 : order_product_return_action.type) || null,
|
|
8983
|
-
return_location_token:
|
|
9035
|
+
return_location_token: return_location || null,
|
|
9036
|
+
new_location: new_location
|
|
8984
9037
|
});
|
|
8985
9038
|
});
|
|
8986
9039
|
return [].concat(prevSelectedLocations, [{
|
|
8987
9040
|
id: id,
|
|
8988
9041
|
return_location: return_location,
|
|
8989
9042
|
return_locations: return_locations,
|
|
8990
|
-
order_product_return_action: order_product_return_action
|
|
9043
|
+
order_product_return_action: order_product_return_action,
|
|
9044
|
+
new_location: new_location
|
|
8991
9045
|
}]);
|
|
8992
9046
|
}
|
|
8993
9047
|
});
|
|
@@ -9018,9 +9072,9 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
9018
9072
|
}, React__default.createElement(dmsComponentLibrary.Checkbox, {
|
|
9019
9073
|
checked: selectAll,
|
|
9020
9074
|
onChange: handleSelectAll
|
|
9021
|
-
})), React__default.createElement("th", null, "Product Location"), React__default.createElement("th", null, "Return Location"), React__default.createElement("th", null, "Recipient"), React__default.createElement("th", null, "Code"), React__default.createElement("th", null, "
|
|
9075
|
+
})), React__default.createElement("th", null, "Product Location"), React__default.createElement("th", null, "Return Location"), React__default.createElement("th", null, "Recipient"), React__default.createElement("th", null, "Code"), React__default.createElement("th", null, "Description"), React__default.createElement("th", null, "Part"), React__default.createElement("th", null, "Weight"), React__default.createElement("th", null, "CBM"), React__default.createElement("th", null, "Return Reason"), React__default.createElement("th", null, "Collected"), React__default.createElement("th", null, "Collection Reason"), React__default.createElement("th", {
|
|
9022
9076
|
className: "emailInvoiceShare"
|
|
9023
|
-
}, "Labels"))), React__default.createElement("tbody", null,
|
|
9077
|
+
}, "Labels"))), React__default.createElement("tbody", null, load ? React__default.createElement("tr", null, React__default.createElement("td", {
|
|
9024
9078
|
colSpan: 6
|
|
9025
9079
|
}, React__default.createElement(antd.Skeleton, {
|
|
9026
9080
|
active: true
|
|
@@ -9029,17 +9083,20 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
9029
9083
|
})) : (returnData == null ? void 0 : returnData.length) === 0 ? React__default.createElement("tr", null, React__default.createElement("td", {
|
|
9030
9084
|
colSpan: 14
|
|
9031
9085
|
}, React__default.createElement(EmptyDataContainer, null, React__default.createElement(antd.Empty, null)))) : returnData == null ? void 0 : returnData.map(function (item, index) {
|
|
9032
|
-
var _item$orders_products, _item$order_data, _item$order_data2, _item$return_reasons, _item$collection_reas;
|
|
9086
|
+
var _item$orders_products, _item$orders_products2, _item$order_data, _item$order_data2, _item$return_reasons, _item$order_product_r, _item$collection_reas;
|
|
9033
9087
|
return React__default.createElement("tr", {
|
|
9034
9088
|
key: item.id
|
|
9035
9089
|
}, React__default.createElement("td", null, React__default.createElement(dmsComponentLibrary.Checkbox, {
|
|
9090
|
+
className: "custom-check",
|
|
9036
9091
|
checked: selectedReturnOrder == null ? void 0 : selectedReturnOrder.some(function (selectedInvoice) {
|
|
9037
9092
|
return (selectedInvoice == null ? void 0 : selectedInvoice.id) === item.id;
|
|
9038
9093
|
}),
|
|
9039
9094
|
onChange: function onChange() {
|
|
9040
|
-
return handleSelectOrderReturn(item.id, item.return_location, item.return_locations, item.order_product_return_action);
|
|
9095
|
+
return handleSelectOrderReturn(item.id, item.return_location, item.return_locations, item.order_product_return_action, item.new_location, item.legacy_product_id);
|
|
9041
9096
|
}
|
|
9042
|
-
})), React__default.createElement("td", null,
|
|
9097
|
+
})), React__default.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__default.createElement("div", {
|
|
9098
|
+
className: "awaiting"
|
|
9099
|
+
}, "Awaiting")), React__default.createElement("td", null, " ", displayValueOrNA(item == null ? void 0 : item.new_location)), React__default.createElement("td", null, React__default.createElement("ul", {
|
|
9043
9100
|
style: {
|
|
9044
9101
|
listStyleType: 'none',
|
|
9045
9102
|
padding: 0
|
|
@@ -9050,11 +9107,11 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
9050
9107
|
fontWeight: 600,
|
|
9051
9108
|
paddingLeft: 0
|
|
9052
9109
|
}
|
|
9053
|
-
},
|
|
9110
|
+
}, displayValueOrNA(item == null || (_item$order_data = item.order_data) == null || (_item$order_data = _item$order_data.order_recipient) == null ? void 0 : _item$order_data.recipient_name)), React__default.createElement("li", {
|
|
9054
9111
|
style: {
|
|
9055
9112
|
color: '#888075'
|
|
9056
9113
|
}
|
|
9057
|
-
},
|
|
9114
|
+
}, 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__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.code)), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.description)), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.parts_count)), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), "KG"), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React__default.createElement("td", null, displayValueOrNA(item == null || (_item$return_reasons = item.return_reasons) == null ? void 0 : _item$return_reasons.reason)), React__default.createElement("td", null, displayValueOrNA(item == null || (_item$order_product_r = item.order_product_returns) == null ? void 0 : _item$order_product_r.collected_at)), React__default.createElement("td", null, displayValueOrNA(item == null || (_item$collection_reas = item.collection_reasons) == null ? void 0 : _item$collection_reas.reason)), React__default.createElement("td", null, React__default.createElement("ul", {
|
|
9058
9115
|
className: "actionbox"
|
|
9059
9116
|
}, React__default.createElement(CustomDrop, {
|
|
9060
9117
|
ref: dropdownRefParent,
|
|
@@ -9066,7 +9123,7 @@ var ReturnOrderTable = function ReturnOrderTable(_ref) {
|
|
|
9066
9123
|
}
|
|
9067
9124
|
}, React__default.createElement(PrinterIcon, null), React__default.createElement(DownIcon, null), printToogle == index && React__default.createElement("div", {
|
|
9068
9125
|
ref: dropdownRef
|
|
9069
|
-
}, React__default.createElement(
|
|
9126
|
+
}, React__default.createElement(PrintDropDownReturn, null)))))));
|
|
9070
9127
|
})))));
|
|
9071
9128
|
};
|
|
9072
9129
|
|
|
@@ -9737,17 +9794,26 @@ var repackModal = function repackModal() {
|
|
|
9737
9794
|
var StyledConatiner$1 = /*#__PURE__*/styled__default.div(_templateObject$2f || (_templateObject$2f = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n /* text-wrap: nowrap; */\n"])));
|
|
9738
9795
|
|
|
9739
9796
|
var _templateObject$2g, _templateObject2$1D, _templateObject3$X;
|
|
9797
|
+
var _excluded$2 = ["id"];
|
|
9740
9798
|
var CreateReturnModal = function CreateReturnModal() {
|
|
9741
|
-
var
|
|
9742
|
-
selectedlocation =
|
|
9743
|
-
setSelectedLocations =
|
|
9799
|
+
var _useSelectedConfirmLo = useSelectedConfirmLoc(),
|
|
9800
|
+
selectedlocation = _useSelectedConfirmLo[0],
|
|
9801
|
+
setSelectedLocations = _useSelectedConfirmLo[1];
|
|
9744
9802
|
var _useSelectedOrders = useSelectedOrders(),
|
|
9745
9803
|
selectedReturnOrder = _useSelectedOrders[0];
|
|
9804
|
+
var _usePostLoading = usePostLoading(),
|
|
9805
|
+
load = _usePostLoading[0];
|
|
9806
|
+
var _useGroupedPayload = useGroupedPayload(),
|
|
9807
|
+
groupedPayload = _useGroupedPayload[0];
|
|
9808
|
+
var _useSelectedConfirmLo2 = useSelectedConfirmLoc(),
|
|
9809
|
+
forDisabledCheck = _useSelectedConfirmLo2[0];
|
|
9810
|
+
var _useFinalPayload = useFinalPayload(),
|
|
9811
|
+
setNew = _useFinalPayload[1];
|
|
9746
9812
|
var handleSelectLocations = function handleSelectLocations(id) {
|
|
9747
9813
|
setSelectedLocations(function (prevSelectedLocations) {
|
|
9748
|
-
var isSelected = prevSelectedLocations.includes(id);
|
|
9814
|
+
var isSelected = prevSelectedLocations == null ? void 0 : prevSelectedLocations.includes(id);
|
|
9749
9815
|
if (isSelected) {
|
|
9750
|
-
return prevSelectedLocations.filter(function (selectedId) {
|
|
9816
|
+
return prevSelectedLocations == null ? void 0 : prevSelectedLocations.filter(function (selectedId) {
|
|
9751
9817
|
return selectedId !== id;
|
|
9752
9818
|
});
|
|
9753
9819
|
} else {
|
|
@@ -9755,7 +9821,30 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9755
9821
|
}
|
|
9756
9822
|
});
|
|
9757
9823
|
};
|
|
9758
|
-
|
|
9824
|
+
var uniqueLocations = selectedReturnOrder == null ? void 0 : selectedReturnOrder.reduce(function (acc, current) {
|
|
9825
|
+
var x = acc.find(function (item) {
|
|
9826
|
+
return item.return_location === current.return_location;
|
|
9827
|
+
});
|
|
9828
|
+
if (!x) {
|
|
9829
|
+
acc.push(current);
|
|
9830
|
+
}
|
|
9831
|
+
return acc;
|
|
9832
|
+
}, []);
|
|
9833
|
+
React.useEffect(function () {
|
|
9834
|
+
if ((groupedPayload == null ? void 0 : groupedPayload.length) > 0 && (forDisabledCheck == null ? void 0 : forDisabledCheck.length) > 0) {
|
|
9835
|
+
var matchedItems = groupedPayload == null ? void 0 : groupedPayload.filter(function (item) {
|
|
9836
|
+
return forDisabledCheck.includes(item.id);
|
|
9837
|
+
});
|
|
9838
|
+
if (matchedItems.length > 0) {
|
|
9839
|
+
var finalPayload = matchedItems == null ? void 0 : matchedItems.map(function (_ref) {
|
|
9840
|
+
var rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
9841
|
+
return rest;
|
|
9842
|
+
});
|
|
9843
|
+
setNew(finalPayload);
|
|
9844
|
+
}
|
|
9845
|
+
}
|
|
9846
|
+
}, [forDisabledCheck]);
|
|
9847
|
+
return React__default.createElement(React__default.Fragment, null, load && React__default.createElement(Loader, null), React__default.createElement(Wrapper$l, null, React__default.createElement(dmsComponentLibrary.Alert, {
|
|
9759
9848
|
onClose: function onClose() {},
|
|
9760
9849
|
description: "",
|
|
9761
9850
|
type: "info",
|
|
@@ -9766,7 +9855,7 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9766
9855
|
listStyle: 'none',
|
|
9767
9856
|
padding: 0
|
|
9768
9857
|
}
|
|
9769
|
-
},
|
|
9858
|
+
}, uniqueLocations == null ? void 0 : uniqueLocations.map(function (returnLoc) {
|
|
9770
9859
|
return React__default.createElement("li", {
|
|
9771
9860
|
key: returnLoc.id,
|
|
9772
9861
|
style: {
|
|
@@ -9775,7 +9864,7 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9775
9864
|
alignItems: 'center'
|
|
9776
9865
|
}
|
|
9777
9866
|
}, React__default.createElement(dmsComponentLibrary.Checkbox, {
|
|
9778
|
-
checked: selectedlocation.includes(returnLoc.id),
|
|
9867
|
+
checked: selectedlocation == null ? void 0 : selectedlocation.includes(returnLoc.id),
|
|
9779
9868
|
onChange: function onChange() {
|
|
9780
9869
|
return handleSelectLocations(returnLoc.id);
|
|
9781
9870
|
}
|
|
@@ -9783,14 +9872,13 @@ var CreateReturnModal = function CreateReturnModal() {
|
|
|
9783
9872
|
style: {
|
|
9784
9873
|
marginLeft: '8px'
|
|
9785
9874
|
}
|
|
9786
|
-
}, returnLoc == null ? void 0 : returnLoc.
|
|
9787
|
-
}))));
|
|
9875
|
+
}, displayValueOrNA(returnLoc == null ? void 0 : returnLoc.new_location)));
|
|
9876
|
+
})))));
|
|
9788
9877
|
};
|
|
9789
9878
|
var StyledText$1 = /*#__PURE__*/styled__default.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"])));
|
|
9790
9879
|
var Container$1b = /*#__PURE__*/styled__default.div(_templateObject2$1D || (_templateObject2$1D = /*#__PURE__*/_taggedTemplateLiteralLoose([""])));
|
|
9791
9880
|
var Wrapper$l = /*#__PURE__*/styled__default.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"])));
|
|
9792
9881
|
|
|
9793
|
-
var _excluded$2 = ["id"];
|
|
9794
9882
|
var ModalManager = function ModalManager() {
|
|
9795
9883
|
var _useAtom = jotai.useAtom(countReducerAtom),
|
|
9796
9884
|
popupName = _useAtom[0],
|
|
@@ -9814,9 +9902,21 @@ var ModalManager = function ModalManager() {
|
|
|
9814
9902
|
selectedTab = _useAtom3[0];
|
|
9815
9903
|
var _useState = React.useState(false),
|
|
9816
9904
|
setIsFormValid = _useState[1];
|
|
9905
|
+
var _useFinalPayload = useFinalPayload(),
|
|
9906
|
+
newGrouped = _useFinalPayload[0],
|
|
9907
|
+
setNewGrouped = _useFinalPayload[1];
|
|
9908
|
+
var _usePostLoading = usePostLoading(),
|
|
9909
|
+
SetPostLoading = _usePostLoading[1];
|
|
9910
|
+
var _useSelectedOrders = useSelectedOrders(),
|
|
9911
|
+
setSelectedReturnOrder = _useSelectedOrders[1];
|
|
9912
|
+
var _useSelectedConfirmLo = useSelectedConfirmLoc(),
|
|
9913
|
+
setCheck = _useSelectedConfirmLo[1];
|
|
9817
9914
|
var _useNewReturnPayload = useNewReturnPayload(),
|
|
9818
|
-
newPayload = _useNewReturnPayload[0],
|
|
9819
9915
|
setNewPayload = _useNewReturnPayload[1];
|
|
9916
|
+
var _useGroupedPayload = useGroupedPayload(),
|
|
9917
|
+
setGrouped = _useGroupedPayload[1];
|
|
9918
|
+
var _useSelectAll = useSelectAll(),
|
|
9919
|
+
setSelectAll = _useSelectAll[1];
|
|
9820
9920
|
console.log(orderProduct, 'abcabcabcabcabcabcabcabcabcabcabc');
|
|
9821
9921
|
var _closeModal = function closeModal() {
|
|
9822
9922
|
dispatch({
|
|
@@ -9992,23 +10092,40 @@ var ModalManager = function ModalManager() {
|
|
|
9992
10092
|
var _useApiHook3 = dmsComponentLibrary.useApiHook({
|
|
9993
10093
|
endpoint: "return_orders/",
|
|
9994
10094
|
method: 'POST',
|
|
9995
|
-
body:
|
|
10095
|
+
body: newGrouped,
|
|
9996
10096
|
performAction: false
|
|
9997
10097
|
}),
|
|
9998
10098
|
response = _useApiHook3.data,
|
|
9999
|
-
setShouldPerformAction = _useApiHook3.setShouldPerformAction
|
|
10099
|
+
setShouldPerformAction = _useApiHook3.setShouldPerformAction,
|
|
10100
|
+
confirmLoading = _useApiHook3.loading;
|
|
10101
|
+
React.useEffect(function () {
|
|
10102
|
+
SetPostLoading(confirmLoading);
|
|
10103
|
+
}, [confirmLoading]);
|
|
10104
|
+
console.log(response);
|
|
10105
|
+
React.useEffect(function () {
|
|
10106
|
+
if (response === null || response && response != null && response.data) {
|
|
10107
|
+
dispatch({
|
|
10108
|
+
type: 'close'
|
|
10109
|
+
});
|
|
10110
|
+
setNewGrouped([]);
|
|
10111
|
+
setSelectedReturnOrder([]);
|
|
10112
|
+
setCheck([]);
|
|
10113
|
+
setNewPayload([]);
|
|
10114
|
+
setGrouped([]);
|
|
10115
|
+
setShouldPerformAction(false);
|
|
10116
|
+
setSelectAll(false);
|
|
10117
|
+
}
|
|
10118
|
+
}, [response]);
|
|
10000
10119
|
var handleConfirmReturn = function handleConfirmReturn() {
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
return _extends({}, rest);
|
|
10004
|
-
});
|
|
10005
|
-
console.log(response);
|
|
10006
|
-
if (payloadWithoutId) {
|
|
10007
|
-
setNewPayload(payloadWithoutId);
|
|
10120
|
+
setShouldPerformAction(false);
|
|
10121
|
+
if (newGrouped.length > 0) {
|
|
10008
10122
|
setShouldPerformAction(true);
|
|
10009
10123
|
} else {
|
|
10010
10124
|
setShouldPerformAction(false);
|
|
10011
10125
|
}
|
|
10126
|
+
dispatch({
|
|
10127
|
+
type: 'close'
|
|
10128
|
+
});
|
|
10012
10129
|
};
|
|
10013
10130
|
return React__default.createElement(React__default.Fragment, null, (popupName == null ? void 0 : popupName.state) == 'create-return' && React__default.createElement(dmsComponentLibrary.AntModal, {
|
|
10014
10131
|
openStatus: (popupName == null ? void 0 : popupName.state) == 'create-return' ? true : false,
|
|
@@ -10024,8 +10141,7 @@ var ModalManager = function ModalManager() {
|
|
|
10024
10141
|
name: 'Submit',
|
|
10025
10142
|
btnStyle: 'rounded',
|
|
10026
10143
|
onClick: handleConfirmReturn,
|
|
10027
|
-
type: 'button'
|
|
10028
|
-
disabled: !newPayload
|
|
10144
|
+
type: 'button'
|
|
10029
10145
|
}],
|
|
10030
10146
|
btnAlign: 'justifyEnd'
|
|
10031
10147
|
},
|
|
@@ -10277,7 +10393,7 @@ var OrderTable = function OrderTable(_ref) {
|
|
|
10277
10393
|
onChange: function onChange() {
|
|
10278
10394
|
return handleSelectInvoice(item.id);
|
|
10279
10395
|
}
|
|
10280
|
-
})), React__default.createElement("td", null, formatDate$1(new Date(item == null ? void 0 : item.created_at))), React__default.createElement("td", null,
|
|
10396
|
+
})), React__default.createElement("td", null, formatDate$1(new Date(item == null ? void 0 : item.created_at))), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.return_locations)), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.pick_up_location)), React__default.createElement("td", {
|
|
10281
10397
|
onClick: function onClick() {
|
|
10282
10398
|
return setOrderId(item.id);
|
|
10283
10399
|
}
|
|
@@ -10294,11 +10410,11 @@ var OrderTable = function OrderTable(_ref) {
|
|
|
10294
10410
|
}
|
|
10295
10411
|
}, React__default.createElement(reactRouterDom.NavLink, {
|
|
10296
10412
|
to: "" + item.id
|
|
10297
|
-
},
|
|
10413
|
+
}, displayValueOrNA(item == null || (_item$order_recipient = item.order_recipient) == null ? void 0 : _item$order_recipient.recipient_name))), React__default.createElement("li", {
|
|
10298
10414
|
style: {
|
|
10299
10415
|
color: '#888075'
|
|
10300
10416
|
}
|
|
10301
|
-
},
|
|
10417
|
+
}, displayValueOrNA(item == null || (_item$order_recipient2 = item.order_recipient) == null ? void 0 : _item$order_recipient2.postcode)))), React__default.createElement("td", null, displayValueOrNA(item == null || (_item$customer_data = item.customer_data) == null ? void 0 : _item$customer_data.customer_name)), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.consignment)), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.order_number)), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.box_count)), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.weight), " KG"), React__default.createElement("td", null, displayValueOrNA(item == null ? void 0 : item.cube)), React__default.createElement("td", null, React__default.createElement(dmsComponentLibrary.AntSelect, {
|
|
10302
10418
|
options: assigneOptions,
|
|
10303
10419
|
placeholder: "Select",
|
|
10304
10420
|
onChange: function onChange() {},
|
|
@@ -10328,7 +10444,7 @@ var OrderTable = function OrderTable(_ref) {
|
|
|
10328
10444
|
}
|
|
10329
10445
|
}, React__default.createElement(PrinterIcon, null), React__default.createElement(DownIcon, null), printToogle == index && React__default.createElement("div", {
|
|
10330
10446
|
ref: dropdownRef
|
|
10331
|
-
}, React__default.createElement(
|
|
10447
|
+
}, React__default.createElement(PrintDropDownReturn, null)))), React__default.createElement("li", {
|
|
10332
10448
|
className: "downloadcontainer"
|
|
10333
10449
|
}, React__default.createElement(LoadIcon, null)))));
|
|
10334
10450
|
})))));
|
|
@@ -10418,28 +10534,6 @@ var DateIcon = function DateIcon() {
|
|
|
10418
10534
|
}));
|
|
10419
10535
|
};
|
|
10420
10536
|
|
|
10421
|
-
var StatusIcon = function StatusIcon() {
|
|
10422
|
-
return React__default.createElement("svg", {
|
|
10423
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10424
|
-
width: "13",
|
|
10425
|
-
height: "12",
|
|
10426
|
-
viewBox: "0 0 13 12",
|
|
10427
|
-
fill: "none"
|
|
10428
|
-
}, React__default.createElement("path", {
|
|
10429
|
-
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",
|
|
10430
|
-
stroke: "#6D6B68",
|
|
10431
|
-
"stroke-width": "2",
|
|
10432
|
-
"stroke-linecap": "round",
|
|
10433
|
-
"stroke-linejoin": "round"
|
|
10434
|
-
}), React__default.createElement("path", {
|
|
10435
|
-
d: "M7.8501 4.25L9.6001 6L11.3501 4.25",
|
|
10436
|
-
stroke: "#6D6B68",
|
|
10437
|
-
"stroke-width": "2",
|
|
10438
|
-
"stroke-linecap": "round",
|
|
10439
|
-
"stroke-linejoin": "round"
|
|
10440
|
-
}));
|
|
10441
|
-
};
|
|
10442
|
-
|
|
10443
10537
|
var ClientIcon = function ClientIcon() {
|
|
10444
10538
|
return React__default.createElement("svg", {
|
|
10445
10539
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -10453,28 +10547,6 @@ var ClientIcon = function ClientIcon() {
|
|
|
10453
10547
|
}));
|
|
10454
10548
|
};
|
|
10455
10549
|
|
|
10456
|
-
var AssigneIcon = function AssigneIcon() {
|
|
10457
|
-
return React__default.createElement("svg", {
|
|
10458
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
10459
|
-
width: "15",
|
|
10460
|
-
height: "14",
|
|
10461
|
-
viewBox: "0 0 15 14",
|
|
10462
|
-
fill: "none"
|
|
10463
|
-
}, React__default.createElement("g", {
|
|
10464
|
-
"clip-path": "url(#clip0_504_13636)"
|
|
10465
|
-
}, React__default.createElement("path", {
|
|
10466
|
-
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",
|
|
10467
|
-
fill: "#6D6B68"
|
|
10468
|
-
})), React__default.createElement("defs", null, React__default.createElement("clipPath", {
|
|
10469
|
-
id: "clip0_504_13636"
|
|
10470
|
-
}, React__default.createElement("rect", {
|
|
10471
|
-
width: "14",
|
|
10472
|
-
height: "14",
|
|
10473
|
-
fill: "white",
|
|
10474
|
-
transform: "translate(0.100098)"
|
|
10475
|
-
}))));
|
|
10476
|
-
};
|
|
10477
|
-
|
|
10478
10550
|
var initialState$2 = {
|
|
10479
10551
|
'x-filters': [],
|
|
10480
10552
|
'x-pagination': {
|
|
@@ -10508,20 +10580,16 @@ var filterReducer$1 = function filterReducer(state, action) {
|
|
|
10508
10580
|
value: action.payload
|
|
10509
10581
|
}])
|
|
10510
10582
|
});
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10518
|
-
|
|
10519
|
-
|
|
10520
|
-
|
|
10521
|
-
// value: action.payload,
|
|
10522
|
-
// },
|
|
10523
|
-
// ],
|
|
10524
|
-
// };
|
|
10583
|
+
case 'SET_STATUS_ORDER_FILTER':
|
|
10584
|
+
return _extends({}, state, {
|
|
10585
|
+
'x-filters': [].concat(state['x-filters'].filter(function (f) {
|
|
10586
|
+
return f.field !== 'status_id';
|
|
10587
|
+
}), [{
|
|
10588
|
+
field: 'status_id',
|
|
10589
|
+
op: '=',
|
|
10590
|
+
value: action.payload
|
|
10591
|
+
}])
|
|
10592
|
+
});
|
|
10525
10593
|
// case 'SET_LOCATION_FILTER':
|
|
10526
10594
|
// return {
|
|
10527
10595
|
// ...state,
|
|
@@ -10559,6 +10627,50 @@ var filtersReducerAtom$1 = /*#__PURE__*/jotai.atom(function (get) {
|
|
|
10559
10627
|
return set(filtersStateAtom$1, filterReducer$1(get(filtersStateAtom$1), action));
|
|
10560
10628
|
});
|
|
10561
10629
|
|
|
10630
|
+
var StatusIcon = function StatusIcon() {
|
|
10631
|
+
return React__default.createElement("svg", {
|
|
10632
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10633
|
+
width: "13",
|
|
10634
|
+
height: "12",
|
|
10635
|
+
viewBox: "0 0 13 12",
|
|
10636
|
+
fill: "none"
|
|
10637
|
+
}, React__default.createElement("path", {
|
|
10638
|
+
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",
|
|
10639
|
+
stroke: "#6D6B68",
|
|
10640
|
+
"stroke-width": "2",
|
|
10641
|
+
"stroke-linecap": "round",
|
|
10642
|
+
"stroke-linejoin": "round"
|
|
10643
|
+
}), React__default.createElement("path", {
|
|
10644
|
+
d: "M7.8501 4.25L9.6001 6L11.3501 4.25",
|
|
10645
|
+
stroke: "#6D6B68",
|
|
10646
|
+
"stroke-width": "2",
|
|
10647
|
+
"stroke-linecap": "round",
|
|
10648
|
+
"stroke-linejoin": "round"
|
|
10649
|
+
}));
|
|
10650
|
+
};
|
|
10651
|
+
|
|
10652
|
+
var AssigneIcon = function AssigneIcon() {
|
|
10653
|
+
return React__default.createElement("svg", {
|
|
10654
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10655
|
+
width: "15",
|
|
10656
|
+
height: "14",
|
|
10657
|
+
viewBox: "0 0 15 14",
|
|
10658
|
+
fill: "none"
|
|
10659
|
+
}, React__default.createElement("g", {
|
|
10660
|
+
"clip-path": "url(#clip0_504_13636)"
|
|
10661
|
+
}, React__default.createElement("path", {
|
|
10662
|
+
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",
|
|
10663
|
+
fill: "#6D6B68"
|
|
10664
|
+
})), React__default.createElement("defs", null, React__default.createElement("clipPath", {
|
|
10665
|
+
id: "clip0_504_13636"
|
|
10666
|
+
}, React__default.createElement("rect", {
|
|
10667
|
+
width: "14",
|
|
10668
|
+
height: "14",
|
|
10669
|
+
fill: "white",
|
|
10670
|
+
transform: "translate(0.100098)"
|
|
10671
|
+
}))));
|
|
10672
|
+
};
|
|
10673
|
+
|
|
10562
10674
|
var _templateObject$2j, _templateObject2$1G;
|
|
10563
10675
|
var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
10564
10676
|
var _useAtom = jotai.useAtom(filtersReducerAtom$1),
|
|
@@ -10568,22 +10680,15 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10568
10680
|
var _useState = React.useState(),
|
|
10569
10681
|
selectedDate = _useState[0],
|
|
10570
10682
|
setSelectedDate = _useState[1];
|
|
10571
|
-
var
|
|
10572
|
-
|
|
10573
|
-
|
|
10574
|
-
},
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
},
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
}, {
|
|
10581
|
-
label: 'Zone 4',
|
|
10582
|
-
value: 'zone4'
|
|
10583
|
-
}, {
|
|
10584
|
-
label: 'Zone 5',
|
|
10585
|
-
value: 'zone5'
|
|
10586
|
-
}];
|
|
10683
|
+
var _useStatusOrderData = useStatusOrderData(),
|
|
10684
|
+
statusOfOrder = _useStatusOrderData[0];
|
|
10685
|
+
// const zoneOptions = [
|
|
10686
|
+
// { label: 'Zone 1', value: 'zone1' },
|
|
10687
|
+
// { label: 'Zone 2', value: 'zone2' },
|
|
10688
|
+
// { label: 'Zone 3', value: 'zone3' },
|
|
10689
|
+
// { label: 'Zone 4', value: 'zone4' },
|
|
10690
|
+
// { label: 'Zone 5', value: 'zone5' },
|
|
10691
|
+
// ];
|
|
10587
10692
|
// date change here
|
|
10588
10693
|
var handleDateChange = function handleDateChange(date) {
|
|
10589
10694
|
setSelectedDate(date ? date == null ? void 0 : date.$d : null);
|
|
@@ -10606,6 +10711,14 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10606
10711
|
value: option == null ? void 0 : option.id
|
|
10607
10712
|
};
|
|
10608
10713
|
});
|
|
10714
|
+
//status of order
|
|
10715
|
+
var orderOptions = statusOfOrder == null ? void 0 : statusOfOrder.map(function (option) {
|
|
10716
|
+
var _option$status_type, _option$status_type2;
|
|
10717
|
+
return {
|
|
10718
|
+
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)),
|
|
10719
|
+
value: option == null ? void 0 : option.id
|
|
10720
|
+
};
|
|
10721
|
+
});
|
|
10609
10722
|
var handleClientChange = function handleClientChange(value) {
|
|
10610
10723
|
console.log(value, 'value');
|
|
10611
10724
|
dispatch({
|
|
@@ -10613,6 +10726,13 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10613
10726
|
payload: value
|
|
10614
10727
|
});
|
|
10615
10728
|
};
|
|
10729
|
+
var handleStatusOfOrder = function handleStatusOfOrder(value) {
|
|
10730
|
+
console.log(value, 'value');
|
|
10731
|
+
dispatch({
|
|
10732
|
+
type: 'SET_STATUS_ORDER_FILTER',
|
|
10733
|
+
payload: value
|
|
10734
|
+
});
|
|
10735
|
+
};
|
|
10616
10736
|
return React__default.createElement(React__default.Fragment, null, React__default.createElement(StyledFiter, null, React__default.createElement(StyledFIlterELements, null, React__default.createElement(LeftSideConatiner, null, React__default.createElement("div", {
|
|
10617
10737
|
className: "filtercontainer"
|
|
10618
10738
|
}, React__default.createElement("div", {
|
|
@@ -10638,25 +10758,14 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10638
10758
|
}, React__default.createElement("div", {
|
|
10639
10759
|
className: "dateiconcontainer"
|
|
10640
10760
|
}, React__default.createElement(StatusIcon, null)), React__default.createElement(StyledAntSelect$d, null, React__default.createElement(antd.Select, {
|
|
10641
|
-
options:
|
|
10761
|
+
options: orderOptions,
|
|
10642
10762
|
className: "custom-select",
|
|
10643
10763
|
placeholder: "Status of Order",
|
|
10644
|
-
onChange:
|
|
10764
|
+
onChange: handleStatusOfOrder,
|
|
10645
10765
|
style: {
|
|
10646
|
-
minWidth: '
|
|
10766
|
+
minWidth: '130px'
|
|
10647
10767
|
},
|
|
10648
|
-
|
|
10649
|
-
maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
|
|
10650
|
-
return React__default.createElement(antd.Tooltip, {
|
|
10651
|
-
overlayStyle: {
|
|
10652
|
-
pointerEvents: 'none'
|
|
10653
|
-
},
|
|
10654
|
-
title: omittedValues.map(function (_ref) {
|
|
10655
|
-
var label = _ref.label;
|
|
10656
|
-
return label;
|
|
10657
|
-
}).join(', ')
|
|
10658
|
-
}, React__default.createElement("span", null, omittedValues.length + " selected"));
|
|
10659
|
-
}
|
|
10768
|
+
allowClear: true
|
|
10660
10769
|
}))), React__default.createElement("div", {
|
|
10661
10770
|
className: "datefilter"
|
|
10662
10771
|
}, React__default.createElement("div", {
|
|
@@ -10667,49 +10776,19 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10667
10776
|
placeholder: "Client",
|
|
10668
10777
|
onChange: handleClientChange,
|
|
10669
10778
|
style: {
|
|
10670
|
-
width: '125px'
|
|
10779
|
+
width: '125px',
|
|
10780
|
+
border: 'none'
|
|
10671
10781
|
},
|
|
10672
|
-
|
|
10673
|
-
maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
|
|
10674
|
-
return React__default.createElement(antd.Tooltip, {
|
|
10675
|
-
overlayStyle: {
|
|
10676
|
-
pointerEvents: 'none'
|
|
10677
|
-
},
|
|
10678
|
-
title: omittedValues.map(function (_ref2) {
|
|
10679
|
-
var label = _ref2.label;
|
|
10680
|
-
return label;
|
|
10681
|
-
}).join(', ')
|
|
10682
|
-
}, React__default.createElement("span", null, omittedValues.length + " selected"));
|
|
10683
|
-
}
|
|
10782
|
+
allowClear: true
|
|
10684
10783
|
}))), React__default.createElement("div", {
|
|
10685
10784
|
className: "datefilter"
|
|
10686
10785
|
}, React__default.createElement("div", {
|
|
10687
10786
|
className: "dateiconcontainer"
|
|
10688
|
-
}, React__default.createElement(AssigneIcon, null)), React__default.createElement(
|
|
10689
|
-
options: zoneOptions,
|
|
10690
|
-
className: "custom-select",
|
|
10691
|
-
placeholder: "Asignee",
|
|
10692
|
-
onChange: function onChange() {},
|
|
10693
|
-
style: {
|
|
10694
|
-
minWidth: '100px'
|
|
10695
|
-
},
|
|
10696
|
-
maxTagCount: 0,
|
|
10697
|
-
maxTagPlaceholder: function maxTagPlaceholder(omittedValues) {
|
|
10698
|
-
return React__default.createElement(antd.Tooltip, {
|
|
10699
|
-
overlayStyle: {
|
|
10700
|
-
pointerEvents: 'none'
|
|
10701
|
-
},
|
|
10702
|
-
title: omittedValues.map(function (_ref3) {
|
|
10703
|
-
var label = _ref3.label;
|
|
10704
|
-
return label;
|
|
10705
|
-
}).join(', ')
|
|
10706
|
-
}, React__default.createElement("span", null, omittedValues.length + " selected"));
|
|
10707
|
-
}
|
|
10708
|
-
}))))), React__default.createElement(TableFilters, null)));
|
|
10787
|
+
}, React__default.createElement(AssigneIcon, null))))), React__default.createElement(TableFilters, null)));
|
|
10709
10788
|
};
|
|
10710
10789
|
var StyledDatePicker = /*#__PURE__*/styled__default.div(_templateObject$2j || (_templateObject$2j = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n .custom-datepicker {\n border: none;\n }\n"])));
|
|
10711
10790
|
// const DropdownContainer = styled.div``;
|
|
10712
|
-
var StyledAntSelect$d = /*#__PURE__*/styled__default.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"])));
|
|
10791
|
+
var StyledAntSelect$d = /*#__PURE__*/styled__default.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"])));
|
|
10713
10792
|
|
|
10714
10793
|
var _templateObject$2k, _templateObject2$1H;
|
|
10715
10794
|
var ReturnAfterTable = function ReturnAfterTable() {
|
|
@@ -10894,7 +10973,7 @@ function ReturnMainTable() {
|
|
|
10894
10973
|
}),
|
|
10895
10974
|
fetchedClientData = _useApiHook.data,
|
|
10896
10975
|
staticDataLoading = _useApiHook.loading;
|
|
10897
|
-
console.log('fetchedClientData', fetchedClientData
|
|
10976
|
+
// console.log('fetchedClientData', fetchedClientData?.data);
|
|
10898
10977
|
React.useEffect(function () {
|
|
10899
10978
|
setLoading(staticDataLoading);
|
|
10900
10979
|
if (fetchedClientData && fetchedClientData.data) {
|