@bjsdistribution/dms-client-return 0.1.12-prod → 0.1.13-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dms-client-return.cjs.development.js +9 -18
- 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 +10 -19
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/client-portal/ReturnStatus.tsx +12 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect,
|
|
1
|
+
import React, { useState, useEffect, useMemo, useRef, Suspense } from 'react';
|
|
2
2
|
import { useSearchParams, useNavigate, useParams, NavLink, useLocation, Routes, Route, Navigate } from 'react-router-dom';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { Select, notification, Skeleton, Empty, DatePicker, Input as Input$3, Dropdown, Space } from 'antd';
|
|
@@ -1690,14 +1690,13 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1690
1690
|
endDate = _useEndDate[0];
|
|
1691
1691
|
var _useClientPortal = useClientPortal(),
|
|
1692
1692
|
clientPortal = _useClientPortal[0];
|
|
1693
|
-
var _useState = useState([]),
|
|
1694
|
-
modifiedFilters = _useState[0],
|
|
1695
|
-
setModifiedFilters = _useState[1];
|
|
1696
1693
|
var _useSearchText = useSearchText(),
|
|
1697
1694
|
debouncedSearchText = _useSearchText[0];
|
|
1698
1695
|
var _useSearchAfterText = useSearchAfterText(),
|
|
1699
1696
|
debouncedSearchAfterText = _useSearchAfterText[0];
|
|
1700
|
-
|
|
1697
|
+
//stats API
|
|
1698
|
+
var filters = useMemo(function () {
|
|
1699
|
+
if (!clientPortal) return [];
|
|
1701
1700
|
var stored = JSON.parse(localStorage.getItem('returnDate') || '{}');
|
|
1702
1701
|
var sDate = startDate != null && startDate.isValid != null && startDate.isValid() ? startDate : dayjs(stored == null ? void 0 : stored.startDate);
|
|
1703
1702
|
var eDate = endDate != null && endDate.isValid != null && endDate.isValid() ? endDate : stored != null && stored.endDate ? dayjs(stored == null ? void 0 : stored.endDate) : null;
|
|
@@ -1720,14 +1719,8 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1720
1719
|
value: sDate.format('YYYY-MM-DD')
|
|
1721
1720
|
}];
|
|
1722
1721
|
}
|
|
1723
|
-
return dateFilters;
|
|
1724
|
-
};
|
|
1725
|
-
useEffect(function () {
|
|
1726
|
-
if (!clientPortal) return;
|
|
1727
|
-
var dateFilters = getDateFilters(startDate, endDate);
|
|
1728
|
-
setModifiedFilters(dateFilters);
|
|
1729
|
-
}, [startDate, endDate]);
|
|
1730
|
-
//stats API
|
|
1722
|
+
return [].concat(dateFilters);
|
|
1723
|
+
}, [startDate, endDate, status]);
|
|
1731
1724
|
var _useAxios = useAxios({
|
|
1732
1725
|
endpoint: "v1/portal/return/stats/",
|
|
1733
1726
|
method: 'GET',
|
|
@@ -1735,7 +1728,7 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1735
1728
|
pagination: {
|
|
1736
1729
|
is_pagination: false
|
|
1737
1730
|
},
|
|
1738
|
-
filters:
|
|
1731
|
+
filters: filters
|
|
1739
1732
|
}),
|
|
1740
1733
|
statsData = _useAxios.data,
|
|
1741
1734
|
apiLoading = _useAxios.loading,
|
|
@@ -1756,8 +1749,6 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1756
1749
|
}
|
|
1757
1750
|
prevSearchAfterTextRef.current = debouncedSearchAfterText;
|
|
1758
1751
|
}, [debouncedSearchAfterText, startDate, endDate]);
|
|
1759
|
-
console.log(debouncedSearchText, 'debouncedSearchText');
|
|
1760
|
-
console.log(debouncedSearchAfterText, 'debouncedSearchAfterText');
|
|
1761
1752
|
useEffect(function () {
|
|
1762
1753
|
fetchData();
|
|
1763
1754
|
}, [startDate, endDate]);
|
|
@@ -1771,19 +1762,19 @@ var ReturnStatus = function ReturnStatus() {
|
|
|
1771
1762
|
id: 1,
|
|
1772
1763
|
icon: 'outstanding_return',
|
|
1773
1764
|
status: 'outstanding_return',
|
|
1774
|
-
count:
|
|
1765
|
+
count: count == null ? void 0 : count.outstanding_count,
|
|
1775
1766
|
label: 'Outstanding Return'
|
|
1776
1767
|
}, {
|
|
1777
1768
|
id: 2,
|
|
1778
1769
|
icon: 'scheduled_for_return',
|
|
1779
1770
|
status: 'scheduled_for_return',
|
|
1780
|
-
count:
|
|
1771
|
+
count: count == null ? void 0 : count.scheduled_count,
|
|
1781
1772
|
label: 'Scheduled For Return'
|
|
1782
1773
|
}, {
|
|
1783
1774
|
id: 3,
|
|
1784
1775
|
icon: 'return_completed',
|
|
1785
1776
|
status: 'return_completed',
|
|
1786
|
-
count:
|
|
1777
|
+
count: count == null ? void 0 : count.completed_count,
|
|
1787
1778
|
label: 'Return Completed'
|
|
1788
1779
|
}];
|
|
1789
1780
|
var navigate = useNavigate();
|