From a1f5c7974cb66943c2d0edd285902bc34c4294c8 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期二, 15 四月 2025 17:29:06 +0800 Subject: [PATCH] Merge branch 'devlop' of http://47.97.1.152:5880/r/wms-master into devlop --- rsf-admin/src/page/orders/order/OrderPanel.jsx | 87 +++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 87 insertions(+), 0 deletions(-) diff --git a/rsf-admin/src/page/orders/order/OrderPanel.jsx b/rsf-admin/src/page/orders/order/OrderPanel.jsx new file mode 100644 index 0000000..e33ead2 --- /dev/null +++ b/rsf-admin/src/page/orders/order/OrderPanel.jsx @@ -0,0 +1,87 @@ +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 OrderPanel = () => { + 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.order.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.order.code" + property={record.code} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.order.sourceCode" + property={record.sourceCode} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.order.sourceId" + property={record.sourceId} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.order.type" + property={record.type} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.order.wkType" + property={record.wkType} + /> + </Grid> + <Grid item xs={6}> + <PanelTypography + title="table.field.order.anfme" + property={record.anfme} + /> + </Grid> + + </Grid> + </CardContent> + </Card > + </> + ); +}; + +export default OrderPanel; -- Gitblit v1.9.1