u
This commit is contained in:
@@ -9,6 +9,7 @@ import TableContainer from '@mui/material/TableContainer';
|
||||
import TableHead from '@mui/material/TableHead';
|
||||
import TableRow from '@mui/material/TableRow';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import Chip from '@mui/material/Chip';
|
||||
import AddIcon from '@mui/icons-material/Add';
|
||||
import SearchIcon from '@mui/icons-material/Search';
|
||||
import DeleteSweepOutlinedIcon from '@mui/icons-material/DeleteSweepOutlined';
|
||||
@@ -24,6 +25,8 @@ class ManifestLines extends PureComponent {
|
||||
lines,
|
||||
saving,
|
||||
linesColor,
|
||||
isLinesDirty = false,
|
||||
dirtyLineKeys = [],
|
||||
onLineChange,
|
||||
onAddLine,
|
||||
onRemoveLine,
|
||||
@@ -65,7 +68,28 @@ class ManifestLines extends PureComponent {
|
||||
wide={wide}
|
||||
minHeight={280}
|
||||
color={linesColor}
|
||||
title="Artikel"
|
||||
title={
|
||||
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1 }}>
|
||||
<span>Artikel</span>
|
||||
{isLinesDirty && (
|
||||
<Chip
|
||||
size="small"
|
||||
color="warning"
|
||||
variant="filled"
|
||||
label="Geändert"
|
||||
sx={{
|
||||
height: 20,
|
||||
fontSize: '0.68rem',
|
||||
fontWeight: 700,
|
||||
bgcolor: 'rgba(237, 108, 2, 0.15)',
|
||||
color: 'warning.dark',
|
||||
border: '1px solid',
|
||||
borderColor: 'warning.main',
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
}
|
||||
sx={{
|
||||
...(wide >= 4 ? { gridColumn: { xs: '1 / -1', sm: '1 / -1', md: 'span 4' } } : {}),
|
||||
...(!hasArticles
|
||||
@@ -115,6 +139,11 @@ class ManifestLines extends PureComponent {
|
||||
(supplierArticlesLoading && !matched)
|
||||
: false;
|
||||
const ledgerLine = line.id != null ? ledgerLinesById[line.id] : null;
|
||||
const isDirty =
|
||||
dirtyLineKeys.includes(lineKey) ||
|
||||
(line.key != null && dirtyLineKeys.includes(line.key)) ||
|
||||
(line.id != null && dirtyLineKeys.includes(`id-${line.id}`)) ||
|
||||
dirtyLineKeys.includes(`idx-${index}`);
|
||||
|
||||
return (
|
||||
<ManifestFormLine
|
||||
@@ -125,6 +154,7 @@ class ManifestLines extends PureComponent {
|
||||
line={line.key != null ? line : { ...line, key: index }}
|
||||
columns={columns}
|
||||
saving={saving}
|
||||
isDirty={Boolean(isDirty)}
|
||||
supplierArticle={matched}
|
||||
loading={Boolean(isLineLoading)}
|
||||
supplierArticleBusy={Boolean(busySupplierArticleLineKeys[lineKey])}
|
||||
|
||||
Reference in New Issue
Block a user