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 AddIcon from '@mui/icons-material/Add';
|
||||
import SearchIcon from '@mui/icons-material/Search';
|
||||
import DeleteSweepOutlinedIcon from '@mui/icons-material/DeleteSweepOutlined';
|
||||
import { PanelTile } from 'dashgui/panels';
|
||||
import { LINE_COLUMNS, hasArticleLines } from './manifestConfig';
|
||||
@@ -17,6 +18,7 @@ import ManifestFormLine from './ManifestFormLine';
|
||||
class ManifestLines extends PureComponent {
|
||||
render() {
|
||||
const {
|
||||
kind = 'delivery',
|
||||
lines,
|
||||
saving,
|
||||
linesColor,
|
||||
@@ -86,17 +88,21 @@ class ManifestLines extends PureComponent {
|
||||
lines.map((line, index) => {
|
||||
const lineKey = line.key ?? index;
|
||||
const rawSku = line.sku != null ? String(line.sku).trim() : '';
|
||||
const matched =
|
||||
supplierArticlesByLineKey[lineKey] ||
|
||||
(rawSku ? supplierArticlesMap[rawSku.toLowerCase()] || supplierArticlesMap[rawSku] : null);
|
||||
const isLineLoading =
|
||||
loadingLineKeys[lineKey] ||
|
||||
(supplierArticlesLoading && !matched);
|
||||
const isDelivery = kind === 'delivery';
|
||||
const matched = isDelivery
|
||||
? supplierArticlesByLineKey[lineKey] ||
|
||||
(rawSku ? supplierArticlesMap[rawSku.toLowerCase()] || supplierArticlesMap[rawSku] : null)
|
||||
: null;
|
||||
const isLineLoading = isDelivery
|
||||
? loadingLineKeys[lineKey] ||
|
||||
(supplierArticlesLoading && !matched)
|
||||
: false;
|
||||
const ledgerLine = line.id != null ? ledgerLinesById[line.id] : null;
|
||||
|
||||
return (
|
||||
<ManifestFormLine
|
||||
key={lineKey}
|
||||
kind={kind}
|
||||
line={line.key != null ? line : { ...line, key: index }}
|
||||
columns={columns}
|
||||
saving={saving}
|
||||
@@ -126,6 +132,16 @@ class ManifestLines extends PureComponent {
|
||||
>
|
||||
Zeile
|
||||
</Button>
|
||||
{onSearchArticle && (
|
||||
<Button
|
||||
size="small"
|
||||
startIcon={<SearchIcon />}
|
||||
disabled={saving}
|
||||
onClick={() => onSearchArticle(null)}
|
||||
>
|
||||
Artikel suchen
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
size="small"
|
||||
color="error"
|
||||
|
||||
Reference in New Issue
Block a user