This commit is contained in:
seb
2026-10-14 15:00:31 +02:00
parent 4188d8f46f
commit b8fdef4e11
5 changed files with 87 additions and 96 deletions

View File

@@ -9,7 +9,6 @@ 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';
@@ -25,8 +24,7 @@ class ManifestLines extends PureComponent {
lines,
saving,
linesColor,
isLinesDirty = false,
dirtyLineKeys = [],
dirtyLineFields = {},
onLineChange,
onAddLine,
onRemoveLine,
@@ -68,28 +66,7 @@ class ManifestLines extends PureComponent {
wide={wide}
minHeight={280}
color={linesColor}
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>
}
title="Artikel"
sx={{
...(wide >= 4 ? { gridColumn: { xs: '1 / -1', sm: '1 / -1', md: 'span 4' } } : {}),
...(!hasArticles
@@ -139,11 +116,12 @@ 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}`);
const lineDirtyFields =
dirtyLineFields[lineKey] ||
(line.key != null ? dirtyLineFields[line.key] : null) ||
(line.id != null ? dirtyLineFields[`id-${line.id}`] : null) ||
dirtyLineFields[`idx-${index}`] ||
null;
return (
<ManifestFormLine
@@ -154,7 +132,7 @@ class ManifestLines extends PureComponent {
line={line.key != null ? line : { ...line, key: index }}
columns={columns}
saving={saving}
isDirty={Boolean(isDirty)}
dirtyFields={lineDirtyFields}
supplierArticle={matched}
loading={Boolean(isLineLoading)}
supplierArticleBusy={Boolean(busySupplierArticleLineKeys[lineKey])}