From 06d7fb698ce6d0efc7ff4224c6b68d2f50feb716 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期一, 21 四月 2025 16:23:46 +0800 Subject: [PATCH] DO单修改及优化 --- rsf-admin/src/page/deliveryItem/DeliveryItemPanel.jsx | 129 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 129 insertions(+), 0 deletions(-) diff --git a/rsf-admin/src/page/deliveryItem/DeliveryItemPanel.jsx b/rsf-admin/src/page/deliveryItem/DeliveryItemPanel.jsx new file mode 100644 index 0000000..d22337f --- /dev/null +++ b/rsf-admin/src/page/deliveryItem/DeliveryItemPanel.jsx @@ -0,0 +1,129 @@ +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 DeliveryItemPanel = () => { + 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.deliveryItem.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.deliveryItem.deliveryId" + property={record.deliveryId} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.platItemId" + property={record.platItemId} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.matnrCode" + property={record.matnrCode} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.matnrName" + property={record.matnrName} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.fieldsIndex" + property={record.fieldsIndex} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.unit" + property={record.unit} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.anfme" + property={record.anfme} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.qty" + property={record.qty} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.nromQty" + property={record.nromQty} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.printQty" + property={record.printQty} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.splrName" + property={record.splrName} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.splrCode" + property={record.splrCode} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.deliveryItem.splrBatch" + property={record.splrBatch} + /> + </Grid> + + </Grid> + </CardContent> + </Card > + </> + ); +}; + +export default DeliveryItemPanel; -- Gitblit v1.9.1