From e59dc198187db08cf208ba5e23deb722b13d8f3a Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期二, 01 七月 2025 14:03:54 +0800
Subject: [PATCH] 波次界面,添加查看订单关联信息--展开

---
 rsf-admin/src/page/orders/wave/WavePanel.jsx |  129 ++++++++++++++++++++----------------------
 1 files changed, 61 insertions(+), 68 deletions(-)

diff --git a/rsf-admin/src/page/orders/wave/WavePanel.jsx b/rsf-admin/src/page/orders/wave/WavePanel.jsx
index e64f444..2c9d80c 100644
--- a/rsf-admin/src/page/orders/wave/WavePanel.jsx
+++ b/rsf-admin/src/page/orders/wave/WavePanel.jsx
@@ -1,85 +1,78 @@
 import React, { useState, useRef, useEffect, useMemo } from "react";
 import { Box, Card, CardContent, Grid, Typography, Tooltip } from '@mui/material';
 import {
-    useTranslate,
+    List,
+    DatagridConfigurable,
     useRecordContext,
+    useTranslate,
+    TextField,
+    NumberField,
+    DateField,
+    BooleanField,
+    ReferenceField,
 } from 'react-admin';
 import PanelTypography from "../../components/PanelTypography";
 import * as Common from '@/utils/common'
+import { styled } from '@mui/material/styles';
+
+const StyledDatagrid = styled(DatagridConfigurable)(({ theme }) => ({
+    '& .css-1vooibu-MuiSvgIcon-root': {
+        height: '.9em'
+    },
+    '& .RaDatagrid-row': {
+        cursor: 'auto'
+    },
+    '& .column-name': {
+    },
+    '& .opt': {
+        width: 200
+    },
+}));
 
 const WavePanel = () => {
     const record = useRecordContext();
     if (!record) return null;
     const translate = useTranslate();
+    const [createDialog, setCreateDialog] = useState(false);
+    const [drawerVal, setDrawerVal] = useState(false);
     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.wave.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}>&nbsp;</Box>
-                    <Grid container spacing={2}>
-                        <Grid item xs={6}>
-                            <PanelTypography
-                                title="table.field.wave.code" 
-                                property={record.code}
-                            />
-                        </Grid>
-                        <Grid item xs={6}>
-                            <PanelTypography
-                                title="table.field.wave.type" 
-                                property={record.type$}
-                            />
-                        </Grid>
-                        <Grid item xs={6}>
-                            <PanelTypography
-                                title="table.field.wave.exceStatus" 
-                                property={record.exceStatus$}
-                            />
-                        </Grid>
-                        <Grid item xs={6}>
-                            <PanelTypography
-                                title="table.field.wave.anfme" 
-                                property={record.anfme}
-                            />
-                        </Grid>
-                        <Grid item xs={6}>
-                            <PanelTypography
-                                title="table.field.wave.qty" 
-                                property={record.qty}
-                            />
-                        </Grid>
-                        <Grid item xs={6}>
-                            <PanelTypography
-                                title="table.field.wave.orderNum" 
-                                property={record.orderNum}
-                            />
-                        </Grid>
-
-                    </Grid>
-                </CardContent>
-            </Card >
+            <Box display="flex">
+                <List resource="waveOrderRela"
+                    sx={{
+                        flexGrow: 1,
+                        transition: (theme) =>
+                            theme.transitions.create(['all'], {
+                                duration: theme.transitions.duration.enteringScreen,
+                            }),
+                        marginRight: !!drawerVal ? `${PAGE_DRAWER_WIDTH}px` : 0,
+                    }}
+                    filter={{ waveId: record.id }}
+                    pagination={false}
+                    empty={false}
+                    actions={false}
+                >
+                    <StyledDatagrid
+                        preferenceKey='waveOrderRela'
+                        bulkActionButtons={false}
+                        rowClick={false}
+                        expandSingle
+                        omit={['id', 'createTime', 'createBy', 'memo', 'taskId', 'orderId', 'orderItemId', 'matnrId']}
+                    >
+                        <NumberField source="id" />,
+                        <TextField source="asnCode" label="table.field.asnOrderItem.asnCode" />
+                        <TextField source="matnrCode" label="table.field.asnOrderItem.matnrCode" />
+                        <TextField source="maktx" label="table.field.asnOrderItem.maktx" />
+                        <TextField source="splrBatch" label="table.field.asnOrderItem.splrBatch" />
+                        <TextField source="platOrderCode" label="table.field.asnOrderItem.platOrderCode" />
+                        <TextField source="spec" label="table.field.asnOrderItem.spec" />
+                        <TextField source="model" label="table.field.asnOrderItem.model" />
+                        <NumberField source="anfme" label="table.field.asnOrderItem.anfme" />
+                        <TextField source="stockUnit" label="table.field.asnOrderItem.stockUnit" />
+                        <TextField source="splrName" label="table.field.asnOrderItem.splrName" />
+                    </StyledDatagrid>
+                </List>
+            </Box>
         </>
     );
 };

--
Gitblit v1.9.1