skyouc
16 小时以前 beb003f8e8cd5ae31a0ac55d0624ed2b2ad862bb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import * as React from 'react';
import { useTranslate, useReference } from 'react-admin';
import {
    ListItem,
    ListItemSecondaryAction,
    ListItemAvatar,
    ListItemText,
    Typography,
    Avatar,
    Box,
    ListItemButton,
    Card,
    CardHeader,
    List,
    Grid,
} from '@mui/material';
import { Link } from 'react-router-dom';
 
const NbList = ({ deadStock }) => {
    const translate = useTranslate();
    return (
        <Card sx={{ flex: 1 }}>
            <CardHeader title={translate('page.dashboard.list.stock')} />
            <List dense={true}>
                {deadStock.map(record => (
                    <PendingOrder key={`record?.id + ${Math.random().toString(36).substr(2, 9)} `} order={record} />
                ))}
            </List>
        </Card>
    );
};
 
export const PendingOrder = (props) => {
    const { order } = props;
    console.log(order);
    const translate = useTranslate();
    // const { referenceRecord: customer, isPending } = useReference({
    //     reference: 'customers',
    //     id: order.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.createTime).toLocaleString('en-GB')}
                    secondary={translate('page.dashboard.list.stock', {
                        name: order.maktx
                    })}
                >
       
                </ListItemText> */}
                <Grid container item md={12}>
                    <Box sx={{ display: 'flex' }}>
                        <Box sx={{ display: 'flex', padding: '1em' }}>
                            <Typography color="textSecondary">{translate("table.field.asnOrderItem.matnrCode")}:</Typography>
                            <Typography color="textSecondary">{order?.matnrCode}</Typography>
                        </Box>
                    </Box>
                    <Box sx={{ display: 'flex' }}>
                        <Box sx={{ display: 'flex', padding: '1em' }}>
                            <Typography color="textSecondary">{translate("table.field.asnOrderItem.maktx")}:</Typography>
                            <Typography color="textSecondary" maxWidth="200" overflow="hidden">{order?.maktx}</Typography>
                        </Box>
                    </Box>
                    <Box sx={{ display: 'flex' }}>
                        <Box sx={{ display: 'flex', padding: '1em' }}>
                            <Typography color="textSecondary">{translate("table.field.asnOrderItem.anfme")}:</Typography>
                            <Typography color="textSecondary">{order?.anfme}</Typography>
                        </Box>
                    </Box>
                    <Box sx={{ display: 'flex' }}>
                        <Box sx={{ display: 'flex', padding: '1em' }}>
                            <Typography color="textSecondary">{translate("table.field.locItem.deadTime")}:</Typography>
                            <Typography color="textSecondary">{order?.deadTime}</Typography>
                        </Box>
                    </Box>
                </Grid>
                {/* <ListItemSecondaryAction>
                    <Box
                        component="span"
                        sx={{
                            marginRight: '1em',
                            color: 'text.primary',
                        }}
                    >
                        {order.deadTime}
                    </Box>
                </ListItemSecondaryAction> */}
            </ListItemButton>
        </ListItem>
    );
};
 
export default NbList;