@bjsdistribution/dms-client-return 0.0.40 → 0.0.42
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/store/store.d.ts +1 -1
- package/dist/dms-client-return.cjs.development.js +302 -137
- 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 +303 -138
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/common/services-slider/ServiceSlider.tsx +1 -1
- package/src/components/order-daily-overview/header-filters/SelectionFilter.tsx +122 -79
- package/src/components/order-daily-overview/index.tsx +6 -4
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnFilterStore.ts +60 -16
- package/src/components/order-daily-overview/return-after-table/table-filters/ReturnOrderFilter.tsx +70 -20
- package/src/components/order-daily-overview/return-order-table/ReturnTable.tsx +8 -1
- package/src/components/order-daily-overview/return-order-table/return-orders-filters/ReturnFilter.tsx +13 -2
- package/src/components/order-daily-overview/store/store.ts +1 -1
- package/src/components/order-daily-overview/table/ReturnTable.tsx +55 -22
- package/src/components/order-view/hooks/useGetEventNotes.tsx +1 -1
- package/src/components/order-view/modalsPopup/ModalManager.tsx +5 -4
- package/src/components/order-view/order-details/expanded-content/services-section/ServiceLevel.tsx +1 -2
- package/src/index.tsx +15 -18
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState, useMemo, useRef, Suspense } from 'react';
|
|
2
|
-
import { useLocation, useNavigate, NavLink, Routes, Route } from 'react-router-dom';
|
|
2
|
+
import { useLocation, useNavigate, useSearchParams, NavLink, Routes, Route } from 'react-router-dom';
|
|
3
3
|
import styled, { keyframes, css } from 'styled-components';
|
|
4
4
|
import { Label as Label$h, Input as Input$1, TextArea, FormSection, displayValueOrNA as displayValueOrNA$1, SelectDropdown, dropdownStyles, RadioButtonGroup as RadioButtonGroup$1, Switch, getBaseEndpoint, Button, useApiHook, formatDateTime, Checkbox as Checkbox$1, SectionHeader, CrossIcon, AntSelect, Alert, CustomRating, AntTable, CancelationModal, CancelAndCompleteAction, filterDropdownStyles, BackgroundModal as BackgroundModal$1, AntModal } from '@bjsdistribution/dms-component-library';
|
|
5
5
|
import { useAtom, atom } from 'jotai';
|
|
@@ -2041,7 +2041,7 @@ function ServiceLevel() {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
var Container$o = /*#__PURE__*/styled.div(_templateObject$x || (_templateObject$x = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex: 1;\n\n ", "\n\n > fieldset {\n > div {\n > div {\n > label {\n text-transform: capitalize;\n }\n }\n }\n }\n"])), function (_ref) {
|
|
2043
2043
|
var disabled = _ref.disabled;
|
|
2044
|
-
return disabled && "\n
|
|
2044
|
+
return disabled && "\n pointer-events: none;\n\n > * {\n pointer-events: none;\n }\n ";
|
|
2045
2045
|
});
|
|
2046
2046
|
|
|
2047
2047
|
var _templateObject$y;
|
|
@@ -2178,7 +2178,7 @@ function ServiceSlider(props) {
|
|
|
2178
2178
|
}
|
|
2179
2179
|
var ServiceName = /*#__PURE__*/styled.span(_templateObject$z || (_templateObject$z = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: #6a7378;\n font-family: 'Roboto', sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n text-transform: capitalize;\n"])));
|
|
2180
2180
|
var ServiceIcon = /*#__PURE__*/styled.img(_templateObject2$q || (_templateObject2$q = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n min-width: 28px;\n height: 28px;\n"])));
|
|
2181
|
-
var Container$q = /*#__PURE__*/styled.div(_templateObject3$a || (_templateObject3$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 10px;\n align-items: center;\n cursor: not-allowed
|
|
2181
|
+
var Container$q = /*#__PURE__*/styled.div(_templateObject3$a || (_templateObject3$a = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n display: flex;\n gap: 10px;\n align-items: center;\n /* cursor: not-allowed; */\n flex: 1;\n"])));
|
|
2182
2182
|
|
|
2183
2183
|
var _templateObject$A;
|
|
2184
2184
|
function OrderServices() {
|
|
@@ -3109,7 +3109,7 @@ function useGetEventNotes() {
|
|
|
3109
3109
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
3110
3110
|
while (1) switch (_context.prev = _context.next) {
|
|
3111
3111
|
case 0:
|
|
3112
|
-
endpoint = getBaseEndpoint() + "
|
|
3112
|
+
endpoint = getBaseEndpoint() + "events/get/event_information/"; // setLoading(true);
|
|
3113
3113
|
_context.prev = 1;
|
|
3114
3114
|
headers = {
|
|
3115
3115
|
accept: 'application/json',
|
|
@@ -3928,14 +3928,6 @@ var selectedClient = /*#__PURE__*/atom(null);
|
|
|
3928
3928
|
function useSelectedClient() {
|
|
3929
3929
|
return useAtom(selectedClient);
|
|
3930
3930
|
}
|
|
3931
|
-
var clientTableId = /*#__PURE__*/atom(null);
|
|
3932
|
-
function useIdForTableName() {
|
|
3933
|
-
return useAtom(clientTableId);
|
|
3934
|
-
}
|
|
3935
|
-
var clientTableName = /*#__PURE__*/atom(null);
|
|
3936
|
-
function useTableName() {
|
|
3937
|
-
return useAtom(clientTableName);
|
|
3938
|
-
}
|
|
3939
3931
|
// Paginations
|
|
3940
3932
|
var atomPaginationData = /*#__PURE__*/atom({
|
|
3941
3933
|
firstPage: 1,
|
|
@@ -8857,8 +8849,6 @@ function SelectionFilter() {
|
|
|
8857
8849
|
var _useSelectedClient = useSelectedClient(),
|
|
8858
8850
|
selectedClient = _useSelectedClient[0],
|
|
8859
8851
|
setSelectedClient = _useSelectedClient[1];
|
|
8860
|
-
var _useIdForTableName = useIdForTableName(),
|
|
8861
|
-
setClientIdForTable = _useIdForTableName[1];
|
|
8862
8852
|
var _useState = useState(false),
|
|
8863
8853
|
isButtonEnabled = _useState[0],
|
|
8864
8854
|
setIsButtonEnabled = _useState[1];
|
|
@@ -8866,8 +8856,6 @@ function SelectionFilter() {
|
|
|
8866
8856
|
setReturnPayload = _useReturnPayload[1];
|
|
8867
8857
|
var _useLoading = useLoading(),
|
|
8868
8858
|
load = _useLoading[0];
|
|
8869
|
-
var _useTableName = useTableName(),
|
|
8870
|
-
setTableName = _useTableName[1];
|
|
8871
8859
|
var _useClearState = useClearState(),
|
|
8872
8860
|
clearState = _useClearState[0],
|
|
8873
8861
|
setClear = _useClearState[1];
|
|
@@ -8877,6 +8865,17 @@ function SelectionFilter() {
|
|
|
8877
8865
|
var _useLocationOptions = useLocationOptions(),
|
|
8878
8866
|
locationOptions = _useLocationOptions[0],
|
|
8879
8867
|
setLocationOptions = _useLocationOptions[1];
|
|
8868
|
+
var _useSearchParams = useSearchParams(),
|
|
8869
|
+
searchParams = _useSearchParams[0];
|
|
8870
|
+
var navigate = useNavigate();
|
|
8871
|
+
//new codee
|
|
8872
|
+
var urlCustomerId = searchParams.get('customerId');
|
|
8873
|
+
var urlActiontype = searchParams.get('type');
|
|
8874
|
+
var selectedCustomer = customers == null ? void 0 : customers.find(function (customer) {
|
|
8875
|
+
return (customer == null ? void 0 : customer.customer_id.toString()) === urlCustomerId;
|
|
8876
|
+
});
|
|
8877
|
+
var accountNumber = selectedCustomer == null ? void 0 : selectedCustomer.account_number;
|
|
8878
|
+
//customer name
|
|
8880
8879
|
var clientOptions = customers == null ? void 0 : customers.filter(function (option) {
|
|
8881
8880
|
return 'customer_id' in option && option.customer_id != null;
|
|
8882
8881
|
}).map(function (option) {
|
|
@@ -8891,55 +8890,60 @@ function SelectionFilter() {
|
|
|
8891
8890
|
});
|
|
8892
8891
|
//client change
|
|
8893
8892
|
var handleClientChange = function handleClientChange(value, option) {
|
|
8894
|
-
// console.log(value, 'value');
|
|
8895
8893
|
setSelectedClient(value);
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8894
|
+
var filteredClient = clientOptions == null ? void 0 : clientOptions.find(function (client) {
|
|
8895
|
+
return (client == null ? void 0 : client.value) == value;
|
|
8896
|
+
});
|
|
8897
|
+
if (filteredClient) {
|
|
8898
|
+
var _filteredClient$actio, _filteredClient$retur;
|
|
8899
|
+
var mappedActions = Array.isArray(filteredClient == null ? void 0 : filteredClient.actions) ? filteredClient == null || (_filteredClient$actio = filteredClient.actions) == null ? void 0 : _filteredClient$actio.map(function (action) {
|
|
8900
|
+
return {
|
|
8901
|
+
label: action,
|
|
8902
|
+
value: action
|
|
8903
|
+
};
|
|
8904
|
+
}) : [];
|
|
8905
|
+
setActionTypeOptions(mappedActions);
|
|
8906
|
+
var mappedLocations = Array.isArray(filteredClient == null ? void 0 : filteredClient.return_locations) ? filteredClient == null || (_filteredClient$retur = filteredClient.return_locations) == null ? void 0 : _filteredClient$retur.map(function (location) {
|
|
8907
|
+
return {
|
|
8908
|
+
label: location == null ? void 0 : location.location_name,
|
|
8909
|
+
value: location == null ? void 0 : location.token
|
|
8910
|
+
};
|
|
8911
|
+
}) : [];
|
|
8912
|
+
setLocationOptions(mappedLocations);
|
|
8913
|
+
}
|
|
8899
8914
|
//set payload
|
|
8900
8915
|
setReturnPayload(function (prevState) {
|
|
8901
8916
|
return _extends({}, prevState, {
|
|
8902
8917
|
account_number: option == null ? void 0 : option.account_number,
|
|
8903
|
-
customer_id: value
|
|
8918
|
+
customer_id: +value
|
|
8904
8919
|
});
|
|
8905
8920
|
});
|
|
8906
8921
|
};
|
|
8907
|
-
var storedName = localStorage.getItem('clientName');
|
|
8908
|
-
var storedClientId = localStorage.getItem('clientId');
|
|
8909
|
-
var storedAccountNumber = localStorage.getItem('account_number');
|
|
8910
8922
|
useEffect(function () {
|
|
8911
|
-
if (
|
|
8912
|
-
localStorage.removeItem('clientDetails');
|
|
8913
|
-
localStorage.removeItem('clientActions');
|
|
8914
|
-
localStorage.removeItem('clientLocations');
|
|
8915
|
-
}
|
|
8916
|
-
}, [storedClientId]);
|
|
8917
|
-
useEffect(function () {
|
|
8918
|
-
if (storedClientId && storedAccountNumber) {
|
|
8923
|
+
if (urlCustomerId && accountNumber) {
|
|
8919
8924
|
setReturnPayload(function (prevState) {
|
|
8920
8925
|
return _extends({}, prevState, {
|
|
8921
|
-
account_number:
|
|
8922
|
-
customer_id:
|
|
8926
|
+
account_number: accountNumber,
|
|
8927
|
+
customer_id: +urlCustomerId
|
|
8923
8928
|
});
|
|
8924
8929
|
});
|
|
8925
8930
|
}
|
|
8926
|
-
}, [
|
|
8931
|
+
}, [accountNumber, urlCustomerId]);
|
|
8927
8932
|
useEffect(function () {
|
|
8928
|
-
|
|
8929
|
-
if (storedClientId && (clientOptions == null ? void 0 : clientOptions.length) > 0) {
|
|
8933
|
+
if (urlCustomerId && (clientOptions == null ? void 0 : clientOptions.length) > 0) {
|
|
8930
8934
|
var filteredClient = clientOptions == null ? void 0 : clientOptions.find(function (client) {
|
|
8931
|
-
return (client == null ? void 0 : client.value) ==
|
|
8935
|
+
return (client == null ? void 0 : client.value) == urlCustomerId;
|
|
8932
8936
|
});
|
|
8933
8937
|
if (filteredClient) {
|
|
8934
|
-
var _filteredClient$
|
|
8935
|
-
var mappedActions = Array.isArray(filteredClient == null ? void 0 : filteredClient.actions) ? filteredClient == null || (_filteredClient$
|
|
8938
|
+
var _filteredClient$actio2, _filteredClient$retur2;
|
|
8939
|
+
var mappedActions = Array.isArray(filteredClient == null ? void 0 : filteredClient.actions) ? filteredClient == null || (_filteredClient$actio2 = filteredClient.actions) == null ? void 0 : _filteredClient$actio2.map(function (action) {
|
|
8936
8940
|
return {
|
|
8937
8941
|
label: action,
|
|
8938
8942
|
value: action
|
|
8939
8943
|
};
|
|
8940
8944
|
}) : [];
|
|
8941
8945
|
setActionTypeOptions(mappedActions);
|
|
8942
|
-
var mappedLocations = Array.isArray(filteredClient == null ? void 0 : filteredClient.return_locations) ? filteredClient == null || (_filteredClient$
|
|
8946
|
+
var mappedLocations = Array.isArray(filteredClient == null ? void 0 : filteredClient.return_locations) ? filteredClient == null || (_filteredClient$retur2 = filteredClient.return_locations) == null ? void 0 : _filteredClient$retur2.map(function (location) {
|
|
8943
8947
|
return {
|
|
8944
8948
|
label: location == null ? void 0 : location.location_name,
|
|
8945
8949
|
value: location == null ? void 0 : location.token
|
|
@@ -8960,10 +8964,10 @@ function SelectionFilter() {
|
|
|
8960
8964
|
//Apply filters
|
|
8961
8965
|
var applyFilters = function applyFilters() {
|
|
8962
8966
|
if (selectedClient) {
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
+
var queryParams = new URLSearchParams({
|
|
8968
|
+
customerId: selectedClient == null ? void 0 : selectedClient.toString()
|
|
8969
|
+
});
|
|
8970
|
+
navigate("/filter?" + queryParams.toString());
|
|
8967
8971
|
}
|
|
8968
8972
|
var selectedClientValue = clientOptions == null ? void 0 : clientOptions.find(function (client) {
|
|
8969
8973
|
return (client == null ? void 0 : client.value) === selectedClient;
|
|
@@ -8983,10 +8987,10 @@ function SelectionFilter() {
|
|
|
8983
8987
|
};
|
|
8984
8988
|
}) : []);
|
|
8985
8989
|
//client value
|
|
8986
|
-
if (
|
|
8990
|
+
if (urlCustomerId) {
|
|
8987
8991
|
dispatch({
|
|
8988
8992
|
type: 'SET_CLIENT_FILTER',
|
|
8989
|
-
payload:
|
|
8993
|
+
payload: urlCustomerId
|
|
8990
8994
|
});
|
|
8991
8995
|
dispatch({
|
|
8992
8996
|
type: 'SET_PAGE',
|
|
@@ -9021,22 +9025,13 @@ function SelectionFilter() {
|
|
|
9021
9025
|
});
|
|
9022
9026
|
}
|
|
9023
9027
|
};
|
|
9024
|
-
// const storedName = localStorage.getItem('clientName');
|
|
9025
|
-
useEffect(function () {
|
|
9026
|
-
if (storedClientId) {
|
|
9027
|
-
dispatch({
|
|
9028
|
-
type: 'SET_CLIENT_FILTER',
|
|
9029
|
-
payload: storedClientId
|
|
9030
|
-
});
|
|
9031
|
-
}
|
|
9032
|
-
}, []);
|
|
9033
9028
|
useEffect(function () {
|
|
9034
|
-
if (
|
|
9029
|
+
if (selectedClient || selectedFilterValue || selectedLocationValue) {
|
|
9035
9030
|
setIsButtonEnabled(true);
|
|
9036
9031
|
} else {
|
|
9037
9032
|
setIsButtonEnabled(false);
|
|
9038
9033
|
}
|
|
9039
|
-
}, [
|
|
9034
|
+
}, [selectedClient, selectedFilterValue, selectedLocationValue]);
|
|
9040
9035
|
useEffect(function () {}, [location.pathname]);
|
|
9041
9036
|
useEffect(function () {
|
|
9042
9037
|
if (!selectedFilterValue || selectedFilterValue === null) {
|
|
@@ -9052,7 +9047,9 @@ function SelectionFilter() {
|
|
|
9052
9047
|
}, [selectedFilterValue, selectedLocationValue]);
|
|
9053
9048
|
var handleClear = function handleClear() {
|
|
9054
9049
|
setClear(false);
|
|
9055
|
-
|
|
9050
|
+
dispatch({
|
|
9051
|
+
type: 'CLEAR_CLIENT'
|
|
9052
|
+
});
|
|
9056
9053
|
setClear(true);
|
|
9057
9054
|
};
|
|
9058
9055
|
useEffect(function () {
|
|
@@ -9063,25 +9060,64 @@ function SelectionFilter() {
|
|
|
9063
9060
|
window.location.href = '/returnclient';
|
|
9064
9061
|
}
|
|
9065
9062
|
}, [clearState]);
|
|
9063
|
+
useEffect(function () {
|
|
9064
|
+
if (urlCustomerId && urlActiontype) {
|
|
9065
|
+
dispatch({
|
|
9066
|
+
type: 'SET_CLIENT_FILTER',
|
|
9067
|
+
payload: urlCustomerId
|
|
9068
|
+
});
|
|
9069
|
+
setSelectedClient(+urlCustomerId);
|
|
9070
|
+
dispatch({
|
|
9071
|
+
type: 'SET_ACTIONS_FILTER',
|
|
9072
|
+
payload: urlActiontype
|
|
9073
|
+
});
|
|
9074
|
+
setSelectedFilterValue(urlActiontype);
|
|
9075
|
+
dispatch({
|
|
9076
|
+
type: 'SET_PAGE',
|
|
9077
|
+
payload: 1
|
|
9078
|
+
});
|
|
9079
|
+
} else if (urlCustomerId) {
|
|
9080
|
+
dispatch({
|
|
9081
|
+
type: 'SET_CLIENT_FILTER',
|
|
9082
|
+
payload: urlCustomerId
|
|
9083
|
+
});
|
|
9084
|
+
setSelectedClient(+urlCustomerId);
|
|
9085
|
+
dispatch({
|
|
9086
|
+
type: 'SET_PAGE',
|
|
9087
|
+
payload: 1
|
|
9088
|
+
});
|
|
9089
|
+
}
|
|
9090
|
+
}, [urlCustomerId]);
|
|
9091
|
+
var handleClearAction = function handleClearAction() {
|
|
9092
|
+
dispatch({
|
|
9093
|
+
type: 'CLEAR_ACTION'
|
|
9094
|
+
});
|
|
9095
|
+
var searchParams = new URLSearchParams(window.location.search);
|
|
9096
|
+
searchParams["delete"]('type');
|
|
9097
|
+
navigate("?" + searchParams.toString(), {
|
|
9098
|
+
replace: true
|
|
9099
|
+
});
|
|
9100
|
+
};
|
|
9066
9101
|
return React.createElement(Wrapper$j, null, React.createElement(FilterRow, null, React.createElement(LeftColumn, null, React.createElement(FilterColumn, null, React.createElement(Label$g, null, "Clients"), React.createElement(StyledAntSelect$2, {
|
|
9067
9102
|
options: clientOptions,
|
|
9068
9103
|
placeholder: "Select Client Name",
|
|
9069
9104
|
onChange: handleClientChange,
|
|
9070
9105
|
style: {
|
|
9071
|
-
minWidth: '
|
|
9106
|
+
minWidth: '150px'
|
|
9072
9107
|
},
|
|
9073
|
-
value:
|
|
9108
|
+
value: selectedClient,
|
|
9074
9109
|
allowClear: true,
|
|
9075
9110
|
onClear: handleClear
|
|
9076
|
-
})), React.createElement(
|
|
9111
|
+
})), React.createElement(FilterColumn, null, React.createElement(Label$g, null, "Action Type"), React.createElement(StyledAntSelect$2, {
|
|
9077
9112
|
options: actionTypeOptions,
|
|
9078
9113
|
placeholder: "Select Action Type",
|
|
9079
9114
|
value: selectedFilterValue,
|
|
9080
9115
|
onChange: handleActionClick,
|
|
9081
9116
|
style: {
|
|
9082
|
-
minWidth: '
|
|
9117
|
+
minWidth: '150px'
|
|
9083
9118
|
},
|
|
9084
|
-
allowClear: true
|
|
9119
|
+
allowClear: true,
|
|
9120
|
+
onClear: handleClearAction
|
|
9085
9121
|
})), React.createElement(FilterColumn, null, React.createElement(Label$g, null, "Location "), React.createElement(StyledAntSelect$2, {
|
|
9086
9122
|
options: locationOptions,
|
|
9087
9123
|
value: selectedLocationValue,
|
|
@@ -9092,7 +9128,7 @@ function SelectionFilter() {
|
|
|
9092
9128
|
},
|
|
9093
9129
|
allowClear: true,
|
|
9094
9130
|
mode: "multiple"
|
|
9095
|
-
})))
|
|
9131
|
+
}))), React.createElement(RightColumn$1, null, React.createElement(ApplyButton, {
|
|
9096
9132
|
onClick: applyFilters,
|
|
9097
9133
|
disabled: !isButtonEnabled
|
|
9098
9134
|
}, "Apply"))));
|
|
@@ -9201,8 +9237,17 @@ var Container$13 = /*#__PURE__*/styled.div(_templateObject$1T || (_templateObjec
|
|
|
9201
9237
|
var ButtonText = /*#__PURE__*/styled.button(_templateObject2$1n || (_templateObject2$1n = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n color: white;\n font-size: 14px;\n font-style: normal;\n font-weight: 600;\n\n display: flex;\n padding: 7px 12px;\n justify-content: center;\n align-items: center;\n gap: 2px;\n border-radius: 15px;\n background: #3a3630;\n font-family: 'Lato';\n cursor: pointer;\n border: none;\n\n &:disabled {\n border-radius: 15px;\n background: rgba(136, 128, 117, 0.35);\n color: #888075;\n cursor: not-allowed;\n }\n"])));
|
|
9202
9238
|
|
|
9203
9239
|
var ReturnFilter = function ReturnFilter() {
|
|
9204
|
-
var
|
|
9205
|
-
|
|
9240
|
+
var _useCustomerData = useCustomerData(),
|
|
9241
|
+
customers = _useCustomerData[0];
|
|
9242
|
+
var queryParams = new URLSearchParams(location.search);
|
|
9243
|
+
var customerId = queryParams.get('customerId');
|
|
9244
|
+
var selectedCustomer = customers == null ? void 0 : customers.find(function (customer) {
|
|
9245
|
+
var _customer$customer_id;
|
|
9246
|
+
return (customer == null || (_customer$customer_id = customer.customer_id) == null ? void 0 : _customer$customer_id.toString()) === customerId;
|
|
9247
|
+
});
|
|
9248
|
+
var customerName = selectedCustomer == null ? void 0 : selectedCustomer.customer_name;
|
|
9249
|
+
// const accountNumber = selectedCustomer?.account_number;
|
|
9250
|
+
return React.createElement(React.Fragment, null, React.createElement(StyledFiter, null, React.createElement(Text$8, null, customerName), React.createElement(StyledFIlterELements, null, React.createElement(StyledTableFilter, null)), React.createElement(RightFilters, null)));
|
|
9206
9251
|
};
|
|
9207
9252
|
|
|
9208
9253
|
var _templateObject$1U, _templateObject2$1o, _templateObject3$Q, _templateObject4$u, _templateObject34, _templateObject35, _templateObject36, _templateObject37;
|
|
@@ -9994,7 +10039,6 @@ var ModalManager = function ModalManager() {
|
|
|
9994
10039
|
response = _useApiHook.data,
|
|
9995
10040
|
setShouldPerformAction = _useApiHook.setShouldPerformAction,
|
|
9996
10041
|
confirmLoading = _useApiHook.loading,
|
|
9997
|
-
apiError = _useApiHook.error,
|
|
9998
10042
|
setError = _useApiHook.setError;
|
|
9999
10043
|
useEffect(function () {
|
|
10000
10044
|
SetPostLoading(confirmLoading);
|
|
@@ -10011,11 +10055,12 @@ var ModalManager = function ModalManager() {
|
|
|
10011
10055
|
};
|
|
10012
10056
|
useEffect(function () {
|
|
10013
10057
|
// @ts-ignore
|
|
10014
|
-
if (
|
|
10058
|
+
if (response && (response == null ? void 0 : response.code) == 500) {
|
|
10059
|
+
// @ts-ignore
|
|
10015
10060
|
notification.error({
|
|
10016
10061
|
message: 'Failure',
|
|
10017
10062
|
// @ts-ignore
|
|
10018
|
-
description: "" + (
|
|
10063
|
+
description: "" + (response == null ? void 0 : response.message)
|
|
10019
10064
|
});
|
|
10020
10065
|
dispatch({
|
|
10021
10066
|
type: 'close'
|
|
@@ -10048,7 +10093,7 @@ var ModalManager = function ModalManager() {
|
|
|
10048
10093
|
// for dev
|
|
10049
10094
|
navigate('/returnclient/order-return');
|
|
10050
10095
|
}
|
|
10051
|
-
}, [
|
|
10096
|
+
}, [postLoading]);
|
|
10052
10097
|
return React.createElement(React.Fragment, null, (popupName == null ? void 0 : popupName.state) === 'create-return' && React.createElement(React.Fragment, null, React.createElement(AntModal, {
|
|
10053
10098
|
openStatus: (popupName == null ? void 0 : popupName.state) == 'create-return' ? true : false,
|
|
10054
10099
|
closeModal: function closeModal() {
|
|
@@ -10217,6 +10262,7 @@ var Pagination = function Pagination(_ref) {
|
|
|
10217
10262
|
};
|
|
10218
10263
|
|
|
10219
10264
|
var _templateObject$1Z, _templateObject2$1t;
|
|
10265
|
+
// import { useLocation } from 'react-router-dom';
|
|
10220
10266
|
var ReturnTable = function ReturnTable() {
|
|
10221
10267
|
var _UsePaginationData = UsePaginationData(),
|
|
10222
10268
|
paginationObj = _UsePaginationData[0];
|
|
@@ -10225,6 +10271,7 @@ var ReturnTable = function ReturnTable() {
|
|
|
10225
10271
|
var _useItemsPerPage = useItemsPerPage(),
|
|
10226
10272
|
itemsPerPage = _useItemsPerPage[0],
|
|
10227
10273
|
setItemsPerPage = _useItemsPerPage[1];
|
|
10274
|
+
// const location = useLocation();
|
|
10228
10275
|
var page = paginationObj.page,
|
|
10229
10276
|
total = paginationObj.total;
|
|
10230
10277
|
var handlePageChange = function handlePageChange(page) {
|
|
@@ -10233,6 +10280,10 @@ var ReturnTable = function ReturnTable() {
|
|
|
10233
10280
|
var handleItemsPerPageChange = function handleItemsPerPageChange(itemsPerPage) {
|
|
10234
10281
|
setItemsPerPage(itemsPerPage);
|
|
10235
10282
|
};
|
|
10283
|
+
// useEffect(() => {
|
|
10284
|
+
// const queryParams = new URLSearchParams(location.search);
|
|
10285
|
+
// const clientId = queryParams.get('customerId');
|
|
10286
|
+
// }, [location]);
|
|
10236
10287
|
return React.createElement("div", null, React.createElement(DashBoardWrapper$1, null, React.createElement("div", {
|
|
10237
10288
|
className: "Tableconatiner"
|
|
10238
10289
|
}, React.createElement(HeaderFilter, null), React.createElement(Container$15, null, React.createElement(ReturnFilter, null), React.createElement(ReturnOrderTable, null), total > 0 && React.createElement(Pagination, {
|
|
@@ -10695,24 +10746,64 @@ var filterReducer$1 = function filterReducer(state, action) {
|
|
|
10695
10746
|
}])
|
|
10696
10747
|
});
|
|
10697
10748
|
case 'SET_CLIENT_FILTER':
|
|
10749
|
+
if (action.payload) {
|
|
10750
|
+
return _extends({}, state, {
|
|
10751
|
+
'x-filters': [].concat(state['x-filters'].filter(function (f) {
|
|
10752
|
+
return f.field !== 'customer_id';
|
|
10753
|
+
}), [{
|
|
10754
|
+
field: 'customer_id',
|
|
10755
|
+
op: '=',
|
|
10756
|
+
value: action.payload
|
|
10757
|
+
}])
|
|
10758
|
+
});
|
|
10759
|
+
} else {
|
|
10760
|
+
return _extends({}, state, {
|
|
10761
|
+
'x-filters': state['x-filters'].filter(function (f) {
|
|
10762
|
+
return f.field !== 'customer_id';
|
|
10763
|
+
})
|
|
10764
|
+
});
|
|
10765
|
+
}
|
|
10766
|
+
case 'CLEAR_CLIENT_FILTER':
|
|
10698
10767
|
return _extends({}, state, {
|
|
10699
|
-
'x-filters':
|
|
10768
|
+
'x-filters': state['x-filters'].filter(function (f) {
|
|
10700
10769
|
return f.field !== 'customer_id';
|
|
10701
|
-
})
|
|
10702
|
-
field: 'customer_id',
|
|
10703
|
-
op: '=',
|
|
10704
|
-
value: action.payload
|
|
10705
|
-
}])
|
|
10770
|
+
})
|
|
10706
10771
|
});
|
|
10707
10772
|
case 'SET_STATUS_ORDER_FILTER':
|
|
10773
|
+
if (action.payload) {
|
|
10774
|
+
return _extends({}, state, {
|
|
10775
|
+
'x-filters': [].concat(state['x-filters'].filter(function (f) {
|
|
10776
|
+
return f.field !== 'status_id';
|
|
10777
|
+
}), [{
|
|
10778
|
+
field: 'status_id',
|
|
10779
|
+
op: '=',
|
|
10780
|
+
value: action.payload
|
|
10781
|
+
}])
|
|
10782
|
+
});
|
|
10783
|
+
} else {
|
|
10784
|
+
return _extends({}, state, {
|
|
10785
|
+
'x-filters': state['x-filters'].filter(function (f) {
|
|
10786
|
+
return f.field !== 'status_id';
|
|
10787
|
+
})
|
|
10788
|
+
});
|
|
10789
|
+
}
|
|
10790
|
+
case 'SET_ASSIGNEE_FILTER':
|
|
10708
10791
|
return _extends({}, state, {
|
|
10709
|
-
'x-filters': [].concat(state['x-filters'].filter(function (f) {
|
|
10710
|
-
return f.field !== '
|
|
10792
|
+
'x-filters': action.payload !== null ? [].concat(state['x-filters'].filter(function (f) {
|
|
10793
|
+
return f.field !== 'bjs_delivery';
|
|
10711
10794
|
}), [{
|
|
10712
|
-
field: '
|
|
10795
|
+
field: 'bjs_delivery',
|
|
10713
10796
|
op: '=',
|
|
10714
10797
|
value: action.payload
|
|
10715
|
-
}])
|
|
10798
|
+
}]) : state['x-filters'].filter(function (f) {
|
|
10799
|
+
return f.field !== 'bjs_delivery';
|
|
10800
|
+
})
|
|
10801
|
+
});
|
|
10802
|
+
case 'CLEAR_STATUS_ORDER_FILTER':
|
|
10803
|
+
return _extends({}, state, {
|
|
10804
|
+
'x-filters': state['x-filters'].filter(function (f) {
|
|
10805
|
+
return f.field !== 'status_id';
|
|
10806
|
+
})
|
|
10716
10807
|
});
|
|
10717
10808
|
// case 'CLEAR_CLIENT':
|
|
10718
10809
|
// return {
|
|
@@ -10776,22 +10867,11 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10776
10867
|
var _useState3 = useState(),
|
|
10777
10868
|
statusOrder = _useState3[0],
|
|
10778
10869
|
setStatusOfOrder = _useState3[1];
|
|
10779
|
-
var
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
10784
|
-
value: 'zone2'
|
|
10785
|
-
}, {
|
|
10786
|
-
label: 'Zone 3',
|
|
10787
|
-
value: 'zone3'
|
|
10788
|
-
}, {
|
|
10789
|
-
label: 'Zone 4',
|
|
10790
|
-
value: 'zone4'
|
|
10791
|
-
}, {
|
|
10792
|
-
label: 'Zone 5',
|
|
10793
|
-
value: 'zone5'
|
|
10794
|
-
}];
|
|
10870
|
+
var _useState4 = useState(),
|
|
10871
|
+
selectedAssignee = _useState4[0],
|
|
10872
|
+
setSelectedAssignee = _useState4[1];
|
|
10873
|
+
var _useAssignData = useAssignData(),
|
|
10874
|
+
assignData = _useAssignData[0];
|
|
10795
10875
|
// date change here
|
|
10796
10876
|
var handleDateChange = function handleDateChange(date) {
|
|
10797
10877
|
setSelectedDate(date ? date == null ? void 0 : date.$d : null);
|
|
@@ -10851,14 +10931,54 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10851
10931
|
payload: 1
|
|
10852
10932
|
});
|
|
10853
10933
|
};
|
|
10934
|
+
var handleAssigneeChange = function handleAssigneeChange(value) {
|
|
10935
|
+
var _assignData$find;
|
|
10936
|
+
var bjsDeliveryValue = (_assignData$find = assignData.find(function (client) {
|
|
10937
|
+
return client.id === value;
|
|
10938
|
+
})) == null ? void 0 : _assignData$find.bjs_delivery;
|
|
10939
|
+
if (bjsDeliveryValue === undefined) return;
|
|
10940
|
+
setSelectedAssignee(value);
|
|
10941
|
+
dispatch({
|
|
10942
|
+
type: 'SET_ASSIGNEE_FILTER',
|
|
10943
|
+
payload: bjsDeliveryValue
|
|
10944
|
+
});
|
|
10945
|
+
dispatch({
|
|
10946
|
+
type: 'SET_PAGE',
|
|
10947
|
+
payload: 1
|
|
10948
|
+
});
|
|
10949
|
+
};
|
|
10950
|
+
var handleClearAssignee = function handleClearAssignee() {
|
|
10951
|
+
setSelectedAssignee(null);
|
|
10952
|
+
dispatch({
|
|
10953
|
+
type: 'SET_ASSIGNEE_FILTER',
|
|
10954
|
+
payload: null
|
|
10955
|
+
});
|
|
10956
|
+
dispatch({
|
|
10957
|
+
type: 'SET_PAGE',
|
|
10958
|
+
payload: 1
|
|
10959
|
+
});
|
|
10960
|
+
};
|
|
10854
10961
|
var handleClearAll = function handleClearAll() {
|
|
10855
10962
|
setSelectedDate(null);
|
|
10856
10963
|
setSelectedClient(null);
|
|
10857
10964
|
setStatusOfOrder(null);
|
|
10965
|
+
setSelectedAssignee(null);
|
|
10858
10966
|
dispatch({
|
|
10859
10967
|
type: 'CLEAR_ALL_FILTER'
|
|
10860
10968
|
});
|
|
10861
10969
|
};
|
|
10970
|
+
var handleClear = function handleClear() {
|
|
10971
|
+
dispatch({
|
|
10972
|
+
type: 'CLEAR_STATUS_ORDER_FILTER'
|
|
10973
|
+
});
|
|
10974
|
+
setStatusOfOrder(null);
|
|
10975
|
+
};
|
|
10976
|
+
var handleClearClient = function handleClearClient() {
|
|
10977
|
+
dispatch({
|
|
10978
|
+
type: 'CLEAR_CLIENT_FILTER'
|
|
10979
|
+
});
|
|
10980
|
+
setSelectedClient(null);
|
|
10981
|
+
};
|
|
10862
10982
|
//clearing filters
|
|
10863
10983
|
useEffect(function () {
|
|
10864
10984
|
if (selectedDate === null) {
|
|
@@ -10900,7 +11020,9 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10900
11020
|
style: {
|
|
10901
11021
|
minWidth: '130px'
|
|
10902
11022
|
},
|
|
10903
|
-
value: statusOrder
|
|
11023
|
+
value: statusOrder,
|
|
11024
|
+
onClear: handleClear,
|
|
11025
|
+
allowClear: true
|
|
10904
11026
|
}))), React.createElement("div", {
|
|
10905
11027
|
className: "datefilter"
|
|
10906
11028
|
}, React.createElement("div", {
|
|
@@ -10914,25 +11036,30 @@ var ReturnOrderFilter = function ReturnOrderFilter() {
|
|
|
10914
11036
|
style: {
|
|
10915
11037
|
width: '125px',
|
|
10916
11038
|
border: 'none'
|
|
10917
|
-
}
|
|
11039
|
+
},
|
|
11040
|
+
allowClear: true,
|
|
11041
|
+
onClear: handleClearClient
|
|
10918
11042
|
}))), React.createElement("div", {
|
|
10919
|
-
className: "datefilter"
|
|
10920
|
-
style: {
|
|
10921
|
-
pointerEvents: 'none',
|
|
10922
|
-
opacity: 0.5
|
|
10923
|
-
}
|
|
11043
|
+
className: "datefilter"
|
|
10924
11044
|
}, React.createElement("div", {
|
|
10925
11045
|
className: "dateiconcontainer"
|
|
10926
11046
|
}, React.createElement(AssigneIcon, null)), React.createElement(StyledAntSelect$4, null, React.createElement(Select, {
|
|
10927
|
-
options:
|
|
11047
|
+
options: assignData == null ? void 0 : assignData.map(function (client) {
|
|
11048
|
+
return {
|
|
11049
|
+
label: client.type,
|
|
11050
|
+
value: client.id
|
|
11051
|
+
};
|
|
11052
|
+
}),
|
|
10928
11053
|
className: "custom-select",
|
|
10929
|
-
placeholder: "
|
|
10930
|
-
onChange:
|
|
11054
|
+
placeholder: "Assignee",
|
|
11055
|
+
onChange: handleAssigneeChange,
|
|
11056
|
+
value: selectedAssignee,
|
|
10931
11057
|
style: {
|
|
10932
11058
|
minWidth: '100px'
|
|
10933
11059
|
},
|
|
10934
|
-
|
|
10935
|
-
|
|
11060
|
+
allowClear: true,
|
|
11061
|
+
onClear: handleClearAssignee
|
|
11062
|
+
}))), selectedDate || statusOrder || selectedClient || selectedAssignee ? React.createElement(React.Fragment, null, React.createElement(ClearAll, {
|
|
10936
11063
|
onClick: handleClearAll
|
|
10937
11064
|
}, React.createElement(StyledFilterBtnIcon, null, React.createElement("i", {
|
|
10938
11065
|
className: "cross"
|
|
@@ -11208,6 +11335,7 @@ var ReturnTable$1 = function ReturnTable() {
|
|
|
11208
11335
|
var navigate = useNavigate();
|
|
11209
11336
|
var _useCustomerData = useCustomerData(),
|
|
11210
11337
|
customers = _useCustomerData[0];
|
|
11338
|
+
// const [searchParams] = useSearchParams();
|
|
11211
11339
|
//sorting
|
|
11212
11340
|
var _useState2 = useState(null),
|
|
11213
11341
|
sortConfig = _useState2[0],
|
|
@@ -11256,7 +11384,6 @@ var ReturnTable$1 = function ReturnTable() {
|
|
|
11256
11384
|
fetchedStaticData = _useApiHook.data,
|
|
11257
11385
|
staticDataLoading = _useApiHook.loading;
|
|
11258
11386
|
useEffect(function () {
|
|
11259
|
-
// setLoading(staticDataLoading);
|
|
11260
11387
|
if (fetchedStaticData && fetchedStaticData.data) {
|
|
11261
11388
|
var result = fetchedStaticData == null ? void 0 : fetchedStaticData.data;
|
|
11262
11389
|
setOrderStaticData(result[0]);
|
|
@@ -11275,10 +11402,7 @@ var ReturnTable$1 = function ReturnTable() {
|
|
|
11275
11402
|
setUpdatedData(updatedClientData);
|
|
11276
11403
|
}, [customers, clientData]);
|
|
11277
11404
|
//handle Redirect
|
|
11278
|
-
var handleRedirect = function handleRedirect(
|
|
11279
|
-
localStorage.setItem('clientName', customerName);
|
|
11280
|
-
localStorage.setItem('clientId', customerId == null ? void 0 : customerId.toString());
|
|
11281
|
-
localStorage.setItem('account_number', account_number);
|
|
11405
|
+
var handleRedirect = function handleRedirect(customerId) {
|
|
11282
11406
|
if (customerId) {
|
|
11283
11407
|
dispatch({
|
|
11284
11408
|
type: 'SET_CLIENT_FILTER',
|
|
@@ -11294,12 +11418,40 @@ var ReturnTable$1 = function ReturnTable() {
|
|
|
11294
11418
|
payload: []
|
|
11295
11419
|
});
|
|
11296
11420
|
}
|
|
11421
|
+
var queryParams = new URLSearchParams({
|
|
11422
|
+
customerId: customerId == null ? void 0 : customerId.toString()
|
|
11423
|
+
});
|
|
11297
11424
|
//for dev
|
|
11298
|
-
navigate("filter
|
|
11425
|
+
navigate("filter?" + queryParams.toString());
|
|
11299
11426
|
//for local
|
|
11300
|
-
//
|
|
11427
|
+
//navigate(`/filter?${queryParams.toString()}`);
|
|
11428
|
+
};
|
|
11429
|
+
//for RTS
|
|
11430
|
+
var handleRedirectRTS = function handleRedirectRTS(customerId, RTS) {
|
|
11431
|
+
if (customerId) {
|
|
11432
|
+
dispatch({
|
|
11433
|
+
type: 'SET_CLIENT_FILTER',
|
|
11434
|
+
payload: customerId
|
|
11435
|
+
});
|
|
11436
|
+
dispatch({
|
|
11437
|
+
type: 'SET_PAGE',
|
|
11438
|
+
payload: 1
|
|
11439
|
+
});
|
|
11440
|
+
} else {
|
|
11441
|
+
dispatch({
|
|
11442
|
+
type: 'SET_CLIENT_FILTER',
|
|
11443
|
+
payload: []
|
|
11444
|
+
});
|
|
11445
|
+
}
|
|
11446
|
+
var queryParams = new URLSearchParams({
|
|
11447
|
+
customerId: customerId == null ? void 0 : customerId.toString(),
|
|
11448
|
+
type: RTS
|
|
11449
|
+
});
|
|
11450
|
+
//for dev
|
|
11451
|
+
navigate("filter?" + queryParams.toString());
|
|
11452
|
+
//for local
|
|
11453
|
+
//navigate(`/filter?${queryParams.toString()}`);
|
|
11301
11454
|
};
|
|
11302
|
-
console.log(statsLoading, 'statsLoading');
|
|
11303
11455
|
return React.createElement(React.Fragment, null, statsLoading && React.createElement(Loader, null), React.createElement(StyledTableWrapper$2, {
|
|
11304
11456
|
id: "tableScrolling"
|
|
11305
11457
|
}, React.createElement(StyledTable$3, null, React.createElement("thead", null, React.createElement("tr", null, [{
|
|
@@ -11360,14 +11512,27 @@ var ReturnTable$1 = function ReturnTable() {
|
|
|
11360
11512
|
key: index
|
|
11361
11513
|
}, React.createElement("td", null, key == null ? void 0 : key.trading_as), React.createElement("td", {
|
|
11362
11514
|
onClick: function onClick() {
|
|
11363
|
-
return handleRedirect(key == null ? void 0 : key.
|
|
11515
|
+
return handleRedirect(key == null ? void 0 : key.customer_id);
|
|
11364
11516
|
},
|
|
11365
11517
|
style: {
|
|
11366
11518
|
color: '#0099ff',
|
|
11367
11519
|
fontWeight: 600,
|
|
11368
11520
|
cursor: 'pointer'
|
|
11369
11521
|
}
|
|
11370
|
-
}, React.createElement("span", null, key == null ? void 0 : key.customer_name)), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.orders))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React.createElement("td",
|
|
11522
|
+
}, React.createElement("span", null, key == null ? void 0 : key.customer_name)), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.orders))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.return_order_products))), React.createElement("td", {
|
|
11523
|
+
style: {
|
|
11524
|
+
color: (key == null ? void 0 : key.RTS) > 0 ? '#0099ff' : 'inherit',
|
|
11525
|
+
fontWeight: (key == null ? void 0 : key.RTS) > 0 ? 600 : 'normal',
|
|
11526
|
+
cursor: (key == null ? void 0 : key.RTS) > 0 ? 'pointer' : 'default'
|
|
11527
|
+
},
|
|
11528
|
+
onClick: function onClick() {
|
|
11529
|
+
return handleRedirectRTS(key == null ? void 0 : key.customer_id, 'RTS');
|
|
11530
|
+
}
|
|
11531
|
+
}, React.createElement(ColumStyle, null, React.createElement(GreyBox, {
|
|
11532
|
+
style: {
|
|
11533
|
+
backgroundColor: (key == null ? void 0 : key.RTS) > 0 ? 'rgba(99, 150, 229, 0.1)' : 'rgba(153, 153, 153, 0.1)'
|
|
11534
|
+
}
|
|
11535
|
+
}, key == null ? void 0 : key.RTS))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.PENDING))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.DISPOSE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-ALLOCATE']), ' ')), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key['RE-DEL']))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.RECYCLE))), React.createElement("td", null, React.createElement(ColumStyle, null, React.createElement(GreyBox, null, key == null ? void 0 : key.UNKNOWN))));
|
|
11371
11536
|
})))));
|
|
11372
11537
|
};
|
|
11373
11538
|
|
|
@@ -11443,8 +11608,9 @@ function ReturnMainTable() {
|
|
|
11443
11608
|
setLoading = _useStatsLoading[1];
|
|
11444
11609
|
var _useClientData = useClientData(),
|
|
11445
11610
|
setClientData = _useClientData[1];
|
|
11446
|
-
|
|
11447
|
-
|
|
11611
|
+
// const [tableName] = useTableName();
|
|
11612
|
+
var queryParams = new URLSearchParams(location.search);
|
|
11613
|
+
var customerId = queryParams.get('customerId');
|
|
11448
11614
|
var handlePageChange = function handlePageChange(page) {
|
|
11449
11615
|
setCurrentPage(page);
|
|
11450
11616
|
};
|
|
@@ -11481,7 +11647,7 @@ function ReturnMainTable() {
|
|
|
11481
11647
|
className: " " + (isScrolled ? 'stickyTableHead' : '')
|
|
11482
11648
|
}, React.createElement("div", {
|
|
11483
11649
|
className: "Tableconatiner"
|
|
11484
|
-
}, React.createElement(HeaderFilter, null), React.createElement(Container$18, null, React.createElement(Row$7, null, React.createElement(Text$8, null, "Client Return"),
|
|
11650
|
+
}, React.createElement(HeaderFilter, null), React.createElement(Container$18, null, React.createElement(Row$7, null, React.createElement(Text$8, null, "Client Return"), customerId ? React.createElement(ReturnFilter, null) : React.createElement(Filters, null)), React.createElement(ReturnTable$1, null)), total > 0 && React.createElement(Pagination, {
|
|
11485
11651
|
currentPage: page,
|
|
11486
11652
|
totalItems: total,
|
|
11487
11653
|
itemsPerPage: itemsPerPage,
|
|
@@ -11537,9 +11703,6 @@ function ReturnClient() {
|
|
|
11537
11703
|
var LoadingMessage = function LoadingMessage() {
|
|
11538
11704
|
return React.createElement("div", null, "Loading...");
|
|
11539
11705
|
};
|
|
11540
|
-
var _useIdForTableName = useIdForTableName(),
|
|
11541
|
-
selectedClientId = _useIdForTableName[0];
|
|
11542
|
-
var navigate = useNavigate();
|
|
11543
11706
|
var _useCustomerData = useCustomerData(),
|
|
11544
11707
|
setCustomers = _useCustomerData[1];
|
|
11545
11708
|
var _useActionType = useActionType(),
|
|
@@ -11554,8 +11717,12 @@ function ReturnClient() {
|
|
|
11554
11717
|
setActionTypeOptions = _useActionTypeOptions[1];
|
|
11555
11718
|
var _useLocationOptions = useLocationOptions(),
|
|
11556
11719
|
setLocationOptions = _useLocationOptions[1];
|
|
11557
|
-
var
|
|
11558
|
-
|
|
11720
|
+
var _useSelectedAction = useSelectedAction(),
|
|
11721
|
+
setSelectedFilterValue = _useSelectedAction[1];
|
|
11722
|
+
var _useSelectedClient = useSelectedClient(),
|
|
11723
|
+
setSelectedClient = _useSelectedClient[1];
|
|
11724
|
+
var _useSearchParams = useSearchParams(),
|
|
11725
|
+
searchParams = _useSearchParams[0];
|
|
11559
11726
|
var splitPath = function splitPath(str) {
|
|
11560
11727
|
var _str$split;
|
|
11561
11728
|
var parts = str == null || (_str$split = str.split('/')) == null ? void 0 : _str$split.filter(function (part) {
|
|
@@ -11566,19 +11733,17 @@ function ReturnClient() {
|
|
|
11566
11733
|
var paths = splitPath(location.pathname);
|
|
11567
11734
|
useEffect(function () {
|
|
11568
11735
|
if (paths[paths.length - 1] === 'returnclient') {
|
|
11569
|
-
localStorage.removeItem('clientName');
|
|
11570
|
-
localStorage.removeItem('clientId');
|
|
11571
|
-
localStorage.removeItem('account_number');
|
|
11572
11736
|
setActionTypeOptions([]);
|
|
11573
11737
|
setLocationOptions([]);
|
|
11574
|
-
|
|
11738
|
+
setSelectedClient(null);
|
|
11739
|
+
setSelectedFilterValue(null);
|
|
11575
11740
|
}
|
|
11576
|
-
}, [location.pathname]);
|
|
11577
|
-
useEffect(
|
|
11578
|
-
|
|
11579
|
-
|
|
11580
|
-
|
|
11581
|
-
}, [selectedClientId]);
|
|
11741
|
+
}, [location.pathname, searchParams]);
|
|
11742
|
+
// useEffect(() => {
|
|
11743
|
+
// if (selectedClientId) {
|
|
11744
|
+
// navigate(`filter/${selectedClientId}`);
|
|
11745
|
+
// }
|
|
11746
|
+
// }, [selectedClientId]);
|
|
11582
11747
|
//API for client data
|
|
11583
11748
|
var _useApiHook = useApiHook({
|
|
11584
11749
|
endpoint: "/return_orders/customers/",
|
|
@@ -11645,7 +11810,7 @@ function ReturnClient() {
|
|
|
11645
11810
|
path: "order-return/:id",
|
|
11646
11811
|
element: React.createElement(OrderView, null)
|
|
11647
11812
|
}), React.createElement(Route, {
|
|
11648
|
-
path: "filter
|
|
11813
|
+
path: "filter",
|
|
11649
11814
|
element: React.createElement(ReturnTable, null)
|
|
11650
11815
|
}))));
|
|
11651
11816
|
}
|