From ca36e3b92acaa53f042fd8af1920930af782efc6 Mon Sep 17 00:00:00 2001
From: skyouc <creaycat@gmail.com>
Date: 星期四, 25 十二月 2025 12:43:16 +0800
Subject: [PATCH] Merge branch 'devlop_org' into devlop-phyz

---
 rsf-admin/src/page/dashboard/NbList.jsx |  198 ++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 152 insertions(+), 46 deletions(-)

diff --git a/rsf-admin/src/page/dashboard/NbList.jsx b/rsf-admin/src/page/dashboard/NbList.jsx
index 9bb7024..a2b879b 100644
--- a/rsf-admin/src/page/dashboard/NbList.jsx
+++ b/rsf-admin/src/page/dashboard/NbList.jsx
@@ -5,72 +5,178 @@
     ListItemSecondaryAction,
     ListItemAvatar,
     ListItemText,
+    Typography,
     Avatar,
     Box,
     ListItemButton,
     Card,
     CardHeader,
     List,
+    Grid,
 } from '@mui/material';
 import { Link } from 'react-router-dom';
 
-const NbList = (props) => {
-    const { orders = [] } = props;
+const NbList = ({ deadStock }) => {
     const translate = useTranslate();
-
     return (
-        <Card sx={{ flex: 1 }}>
-            <CardHeader title={translate('pos.dashboard.pending_orders')} />
-            <List dense={true}>
-                {orders.map(record => (
-                    <PendingOrder key={record.id} order={record} />
-                ))}
-            </List>
+        <Card sx={{
+            flex: 1,
+            boxShadow: 2,
+            maxWidth: 598,
+            marginTop: 1
+        }}>
+            <CardHeader 
+                title={translate('page.dashboard.list.stock')}
+                sx={{ 
+                    pb: 1,
+                    '& .MuiCardHeader-title': {
+                        fontSize: '1.1rem',
+                        fontWeight: 600,
+                    }
+                }} 
+            />
+            <Box sx={{ maxHeight: 500, overflowY: 'auto' }}>
+                <List dense={true} sx={{ py: 0 }}>
+                    {deadStock.map(record => (
+                        <PendingOrder 
+                            key={`${record?.id}_${Math.random().toString(36).substr(2, 9)}`} 
+                            order={record} 
+                        />
+                    ))}
+                </List>
+            </Box>
         </Card>
     );
 };
 
 export const PendingOrder = (props) => {
     const { order } = props;
-    console.log(order);
-
     const translate = useTranslate();
-    const { referenceRecord: customer, isPending } = useReference({
-        reference: 'customers',
-        id: order.customer_id,
-    });
 
     return (
-        <ListItem disablePadding>
-            <ListItemButton component={Link} to={`/orders/${order.id}`}>
-                {/* <ListItemAvatar>
-                    {isPending ? (
-                        <Avatar />
-                    ) : (
-                        <Avatar
-                            src={`${customer?.avatar}?size=32x32`}
-                            sx={{ bgcolor: 'background.paper' }}
-                            alt={`${customer?.first_name} ${customer?.last_name}`}
-                        />
-                    )}
-                </ListItemAvatar> */}
-                <ListItemText
-                    primary={new Date(order.date).toLocaleString('en-GB')}
-                    secondary={translate('pos.dashboard.order.items', {
-                        name: order.name
-                    })}
-                />
-                <ListItemSecondaryAction>
-                    <Box
-                        component="span"
-                        sx={{
-                            marginRight: '1em',
-                            color: 'text.primary',
-                        }}
-                    >
-                        {order.total}$
-                    </Box>
-                </ListItemSecondaryAction>
+        <ListItem 
+            disablePadding
+            sx={{
+                borderBottom: '1px solid',
+                borderColor: 'divider',
+                '&:last-child': {
+                    borderBottom: 'none',
+                }
+            }}
+        >
+            <ListItemButton 
+                sx={{
+                    py: 1.5,
+                    '&:hover': {
+                        backgroundColor: 'action.hover',
+                    }
+                }}
+            >
+                <Grid container spacing={1}>
+                    {/* 绗竴琛岋細鐗╂枡缂栫爜鍜屽悕绉� */}
+                    <Grid item xs={12} sx={{ display: 'flex', alignItems: 'center' }}>
+                        <Box sx={{ display: 'flex', alignItems: 'center', minWidth: 0, flex: 1 }}>
+                            <Typography 
+                                variant="body2" 
+                                sx={{ 
+                                    fontWeight: 600,
+                                    color: 'primary.main',
+                                    minWidth: '120px',
+                                    flexShrink: 0,
+                                }}
+                            >
+                                {translate("table.field.asnOrderItem.matnrCode")}锛�
+                            </Typography>
+                            <Typography 
+                                variant="body2" 
+                                sx={{ 
+                                    color: 'text.primary',
+                                    overflow: 'hidden',
+                                    textOverflow: 'ellipsis',
+                                    whiteSpace: 'nowrap',
+                                }}
+                            >
+                                {order?.matnrCode}
+                            </Typography>
+                        </Box>
+                        
+                        <Box sx={{ display: 'flex', alignItems: 'center', minWidth: 0, flex: 1 }}>
+                            <Typography 
+                                variant="body2" 
+                                sx={{ 
+                                    fontWeight: 600,
+                                    color: 'primary.main',
+                                    minWidth: '80px',
+                                    flexShrink: 0,
+                                }}
+                            >
+                                {translate("table.field.asnOrderItem.maktx")}锛�
+                            </Typography>
+                            <Typography 
+                                variant="body2" 
+                                sx={{ 
+                                    color: 'text.primary',
+                                    overflow: 'hidden',
+                                    textOverflow: 'ellipsis',
+                                    whiteSpace: 'nowrap',
+                                }}
+                                title={order?.maktx} // 娣诲姞title鎻愮ず瀹屾暣鍐呭
+                            >
+                                {order?.maktx}
+                            </Typography>
+                        </Box>
+                    </Grid>
+
+                    {/* 绗簩琛岋細鏁伴噺鍜屾棩鏈� */}
+                    <Grid item xs={12} sx={{ display: 'flex', alignItems: 'center' }}>
+                        <Box sx={{ display: 'flex', alignItems: 'center', minWidth: 0, flex: 1 }}>
+                            <Typography 
+                                variant="body2" 
+                                sx={{ 
+                                    fontWeight: 600,
+                                    color: 'primary.main',
+                                    minWidth: '120px',
+                                    flexShrink: 0,
+                                }}
+                            >
+                                {translate("table.field.asnOrderItem.anfme")}锛�
+                            </Typography>
+                            <Typography 
+                                variant="body2" 
+                                sx={{ 
+                                    color: 'text.primary',
+                                    fontWeight: 500,
+                                }}
+                            >
+                                {order?.anfme}
+                            </Typography>
+                        </Box>
+                        
+                        <Box sx={{ display: 'flex', alignItems: 'center', minWidth: 0, flex: 1 }}>
+                            <Typography 
+                                variant="body2" 
+                                sx={{ 
+                                    fontWeight: 600,
+                                    color: 'primary.main',
+                                    minWidth: '120px',
+                                    flexShrink: 0,
+                                }}
+                            >
+                                {translate("table.field.locItem.deadTime")}锛�
+                            </Typography>
+                            <Typography 
+                                variant="body2" 
+                                sx={{ 
+                                    color: order?.deadTime ? 'error.main' : 'text.secondary',
+                                    fontWeight: order?.deadTime ? 600 : 400,
+                                    fontFamily: 'monospace',
+                                }}
+                            >
+                                {order?.deadTime || '-'}
+                            </Typography>
+                        </Box>
+                    </Grid>
+                </Grid>
             </ListItemButton>
         </ListItem>
     );

--
Gitblit v1.9.1