| | |
| | | import NbChart from "./NbChart"; |
| | | import NbList from "./NbList"; |
| | | import NbCard from "./NbCard"; |
| | | import { orderBy } from 'lodash'; |
| | | import NbPie from './NbPie'; |
| | | |
| | | const styles = { |
| | | flex: { display: 'flex' }, |
| | |
| | | const notify = useNotify(); |
| | | const [statistic, setStatistic] = useState({}); |
| | | const [stock, setStock] = useState([]); |
| | | const [deadStock, setDeadStock] = useState([]); |
| | | |
| | | useEffect(() => { |
| | | getDashBoardHeader() |
| | |
| | | } |
| | | |
| | | const getRecentStocks = async () => { |
| | | await request.post('/asnOrder/dashbord/header').then(res => { |
| | | const { code, msg, data } = res.data?.data; |
| | | await request.post('/locItem/page', { current: 1, pageSize: 10, orderBy: 'create_time asc' }).then(res => { |
| | | const { code, msg, data } = res?.data; |
| | | if (code === 200) { |
| | | setStatistic(data); |
| | | setDeadStock(data?.records); |
| | | } else { |
| | | notify(msg, { type: 'error', messageArgs: { _: msg } }); |
| | | } |
| | |
| | | notify(error.message, { type: 'error', messageArgs: { _: error.message } }); |
| | | }) |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取库近一个月出入库信息 |
| | |
| | | }) |
| | | } |
| | | |
| | | const recentOrders = [ |
| | | { |
| | | id: 1, |
| | | name: 'a', |
| | | date: "2025-08-10T12:23:56.959Z", |
| | | total: 138.94, |
| | | inTotal: 254, |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: 'b', |
| | | date: "2025-08-03T07:45:00.304Z", |
| | | total: 214.66, |
| | | inTotal: 258, |
| | | }, |
| | | { |
| | | id: 3, |
| | | name: 'c', |
| | | date: "2025-07-28T00:20:10.968Z", |
| | | total: 68.19, |
| | | inTotal: 154, |
| | | }, |
| | | { |
| | | id: 4, |
| | | name: 'd', |
| | | date: "2025-07-22T20:39:00.293Z", |
| | | total: 36.56, |
| | | inTotal: 124, |
| | | }, |
| | | { |
| | | id: 5, |
| | | name: 'e', |
| | | date: "2025-07-16T17:40:24.791Z", |
| | | total: 100.82, |
| | | inTotal: 354, |
| | | }, |
| | | ] |
| | | |
| | | return ( |
| | | <> |
| | | <Grid container md={12}> |
| | | <Grid container md={12} item> |
| | | <Grid item md={8}> |
| | | <Box sx={{ display: "flex" }}> |
| | | <CardWithIcon |
| | |
| | | title={`${statistic?.membersTotalQua}`} |
| | | type={"out"} |
| | | statistic={statistic} |
| | | |
| | | /> |
| | | </Box> |
| | | <Spacer /> |
| | |
| | | <NbChart orders={stock} /> |
| | | </Box> |
| | | <Spacer /> |
| | | <Box> |
| | | <NbList orders={recentOrders} /> |
| | | <Box sx={{ display: 'flex' }}> |
| | | <NbList deadStock={deadStock} /> |
| | | <NbPie /> |
| | | </Box> |
| | | <Spacer /> |
| | | |
| | | </Grid> |
| | | <Grid item md={4}> |
| | | <Box sx={{ display: 'flex' }}> |
| | |
| | | filter: JSON.stringify({ status: 1 }), |
| | | }), |
| | | }} |
| | | list={recentOrders} |
| | | list={deadStock} |
| | | /> |
| | | </Box> |
| | | </Grid> |