From 97c21abaebf6cb6cf15f8a7e3830676533d90dac Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期三, 26 十一月 2025 13:06:31 +0800
Subject: [PATCH] 添加库存明细功能
---
rsf-admin/src/page/locItem/LocItemPanel.jsx | 195 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 195 insertions(+), 0 deletions(-)
diff --git a/rsf-admin/src/page/locItem/LocItemPanel.jsx b/rsf-admin/src/page/locItem/LocItemPanel.jsx
new file mode 100644
index 0000000..db99b1f
--- /dev/null
+++ b/rsf-admin/src/page/locItem/LocItemPanel.jsx
@@ -0,0 +1,195 @@
+import React, { useState, useRef, useEffect, useMemo } from "react";
+import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
+import {
+ useTranslate,
+ useRecordContext,
+} from 'react-admin';
+import PanelTypography from "../components/PanelTypography";
+import * as Common from '@/utils/common'
+
+const LocItemPanel = () => {
+ const record = useRecordContext();
+ if (!record) return null;
+ const translate = useTranslate();
+ return (
+ <>
+ <Card sx={{ width: { xs: 300, sm: 500, md: 600, lg: 800 }, margin: 'auto' }}>
+ <CardContent>
+ <Grid container spacing={2}>
+ <Grid item xs={12} sx={{ display: 'flex', justifyContent: 'space-between' }}>
+ <Typography variant="h6" gutterBottom align="left" sx={{
+ maxWidth: { xs: '100px', sm: '180px', md: '260px', lg: '360px' },
+ whiteSpace: 'nowrap',
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ }}>
+ {Common.camelToPascalWithSpaces(translate('table.field.locItem.id'))}: {record.id}
+ </Typography>
+ {/* inherit, primary, secondary, textPrimary, textSecondary, error */}
+ <Typography variant="h6" gutterBottom align="right" >
+ ID: {record.id}
+ </Typography>
+ </Grid>
+ </Grid>
+ <Grid container spacing={2}>
+ <Grid item xs={12} container alignContent="flex-end">
+ <Typography variant="caption" color="textSecondary" sx={{ wordWrap: 'break-word', wordBreak: 'break-all' }}>
+ {Common.camelToPascalWithSpaces(translate('common.field.memo'))}:{record.memo}
+ </Typography>
+ </Grid>
+ </Grid>
+ <Box height={20}> </Box>
+ <Grid container spacing={2}>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.locId"
+ property={record.locId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.locCode"
+ property={record.locCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.orderId"
+ property={record.orderId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.type"
+ property={record.type}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.orderItemId"
+ property={record.orderItemId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.wkType"
+ property={record.wkType}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.matnrId"
+ property={record.matnrId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.maktx"
+ property={record.maktx}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.platItemId"
+ property={record.platItemId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.platOrderCode"
+ property={record.platOrderCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.platWorkCode"
+ property={record.platWorkCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.projectCode"
+ property={record.projectCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.matnrCode"
+ property={record.matnrCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.trackCode"
+ property={record.trackCode}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.unit"
+ property={record.unit}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.anfme"
+ property={record.anfme}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.qty"
+ property={record.qty}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.workQty"
+ property={record.workQty}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.batch"
+ property={record.batch}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.splrBatch"
+ property={record.splrBatch}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.splrId"
+ property={record.splrId}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.spec"
+ property={record.spec}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.model"
+ property={record.model}
+ />
+ </Grid>
+ <Grid item xs={6}>
+ <PanelTypography
+ title="table.field.locItem.fieldsIndex"
+ property={record.fieldsIndex}
+ />
+ </Grid>
+
+ </Grid>
+ </CardContent>
+ </Card >
+ </>
+ );
+};
+
+export default LocItemPanel;
--
Gitblit v1.9.1