|
@@ -2,7 +2,10 @@ import BarChartModule from '@/components/ManagementPage/BarChartModule';
|
|
|
import PieChartModule from '@/components/ManagementPage/PieChartModule';
|
|
|
import RadarChartModule from '@/components/ManagementPage/RadarChartModule';
|
|
|
import ModuleTitle from '@/components/ManagementPage/moduleTitle';
|
|
|
-import { queryMainChartList } from '@/services/StorageManagement';
|
|
|
+import {
|
|
|
+ queryMainChartList,
|
|
|
+ queryStoreGetWarning,
|
|
|
+} from '@/services/StorageManagement';
|
|
|
import { useNavigate, useRequest } from '@umijs/max';
|
|
|
import { Button, Empty, Spin } from 'antd';
|
|
|
import dayjs from 'dayjs';
|
|
@@ -36,6 +39,18 @@ const StorageOverview = ({ projectId }) => {
|
|
|
},
|
|
|
];
|
|
|
|
|
|
+ const { data: warningData, loading: loadingWarn } = useRequest(
|
|
|
+ queryStoreGetWarning,
|
|
|
+ {
|
|
|
+ defaultParams: [{ project_id: projectId * 1 }],
|
|
|
+ formatResult: (res) => {
|
|
|
+ const data = res.data;
|
|
|
+ const { check_notice, inventory_notice } = res.data;
|
|
|
+ return check_notice + inventory_notice;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ );
|
|
|
+
|
|
|
const { data, loading } = useRequest(
|
|
|
() =>
|
|
|
queryMainChartList({
|
|
@@ -128,7 +143,7 @@ const StorageOverview = ({ projectId }) => {
|
|
|
return (
|
|
|
<Spin className="content-title" spinning={loading}>
|
|
|
<div className={`card-box ${styles.tipContent}`}>
|
|
|
- <span>备品报告:当前库存状态良好,暫无需要补充货物。</span>
|
|
|
+ <span>备品报告:{warningData}</span>
|
|
|
<Button type="primary" onClick={goDetail}>
|
|
|
详情
|
|
|
</Button>
|