u
This commit is contained in:
@@ -5,7 +5,6 @@ import WarehouseIcon from '@mui/icons-material/Warehouse';
|
|||||||
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
import EditOutlinedIcon from '@mui/icons-material/EditOutlined';
|
||||||
import LocalShippingOutlinedIcon from '@mui/icons-material/LocalShippingOutlined';
|
import LocalShippingOutlinedIcon from '@mui/icons-material/LocalShippingOutlined';
|
||||||
import Tooltip from '@mui/material/Tooltip';
|
import Tooltip from '@mui/material/Tooltip';
|
||||||
import Chip from '@mui/material/Chip';
|
|
||||||
import { PanelTile } from 'dashgui/panels';
|
import { PanelTile } from 'dashgui/panels';
|
||||||
import { formatStock } from '../searchFormat';
|
import { formatStock } from '../searchFormat';
|
||||||
import ArticleStockAdjustDialog from '../ArticleStockAdjustDialog';
|
import ArticleStockAdjustDialog from '../ArticleStockAdjustDialog';
|
||||||
@@ -145,40 +144,6 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
this.setState({ adjustOpen: false });
|
this.setState({ adjustOpen: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
renderIncomingChip(totalIncoming, incomingItems, unit) {
|
|
||||||
const tooltipText = `${formatStock(totalIncoming)}${unit ? ` ${unit}` : ''} im Zulauf aus ${
|
|
||||||
incomingItems.length === 1
|
|
||||||
? 'einer offenen Lieferung'
|
|
||||||
: `${incomingItems.length} offenen Lieferungen`
|
|
||||||
}`;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Tooltip title={tooltipText} arrow placement="top-start">
|
|
||||||
<Chip
|
|
||||||
size="small"
|
|
||||||
icon={
|
|
||||||
<LocalShippingOutlinedIcon
|
|
||||||
sx={{ fontSize: '14px !important', transform: 'scaleX(-1)' }}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
label={`+${formatStock(totalIncoming)}${unit ? ` ${unit}` : ''} im Zulauf`}
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
sx={{
|
|
||||||
fontWeight: 600,
|
|
||||||
fontSize: '0.75rem',
|
|
||||||
height: 22,
|
|
||||||
backgroundColor: VEIL_PANEL,
|
|
||||||
cursor: 'default',
|
|
||||||
'& .MuiChip-icon': {
|
|
||||||
color: 'text.secondary',
|
|
||||||
ml: '6px',
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { article: articleData } = this.props;
|
const { article: articleData } = this.props;
|
||||||
const { adjustOpen } = this.state;
|
const { adjustOpen } = this.state;
|
||||||
@@ -280,8 +245,8 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
</Typography>
|
</Typography>
|
||||||
|
|
||||||
{isParent ? (
|
{isParent ? (
|
||||||
<Box sx={{ my: 0.75 }}>
|
anyVariantTracksStock || totalVariantsStock > 0 ? (
|
||||||
{anyVariantTracksStock || totalVariantsStock > 0 ? (
|
<Box sx={{ my: 0.75 }}>
|
||||||
<Typography
|
<Typography
|
||||||
component="div"
|
component="div"
|
||||||
sx={{
|
sx={{
|
||||||
@@ -293,74 +258,12 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
>
|
>
|
||||||
Alle Varianten zusammen: {formatStock(totalVariantsStock)}
|
Alle Varianten zusammen: {formatStock(totalVariantsStock)}
|
||||||
</Typography>
|
</Typography>
|
||||||
) : null}
|
</Box>
|
||||||
{hasIncoming ? (
|
) : null
|
||||||
<Box sx={{ mt: 0.75 }}>
|
|
||||||
{this.renderIncomingChip(totalIncoming, incomingItems, unit)}
|
|
||||||
</Box>
|
|
||||||
) : null}
|
|
||||||
</Box>
|
|
||||||
) : isStueckliste ? (
|
) : isStueckliste ? (
|
||||||
<Box sx={{ my: 0.5 }}>
|
<Tooltip title="Virtueller Bestand – Anpassung erfolgt an den einzelnen Komponenten" arrow placement="top-start">
|
||||||
<Tooltip title="Virtueller Bestand – Anpassung erfolgt an den einzelnen Komponenten" arrow placement="top-start">
|
<Box sx={{ my: 0.5 }}>
|
||||||
<Box>
|
<Box sx={{ display: 'inline-flex', alignItems: 'baseline', gap: 0.75 }}>
|
||||||
<Box sx={{ display: 'inline-flex', alignItems: 'baseline', gap: 0.75 }}>
|
|
||||||
<Typography
|
|
||||||
component="div"
|
|
||||||
sx={{
|
|
||||||
fontSize: '2.4rem',
|
|
||||||
fontWeight: 700,
|
|
||||||
lineHeight: 1.1,
|
|
||||||
letterSpacing: '-0.02em',
|
|
||||||
color: totalStock > 0 ? 'text.primary' : 'text.secondary',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{formatStock(totalStock)}
|
|
||||||
</Typography>
|
|
||||||
{unit ? (
|
|
||||||
<Typography
|
|
||||||
variant="body2"
|
|
||||||
color="text.secondary"
|
|
||||||
sx={{ fontWeight: 500 }}
|
|
||||||
>
|
|
||||||
{unit}
|
|
||||||
</Typography>
|
|
||||||
) : null}
|
|
||||||
</Box>
|
|
||||||
<Typography
|
|
||||||
variant="caption"
|
|
||||||
color="text.secondary"
|
|
||||||
sx={{ display: 'block', mt: 0.25 }}
|
|
||||||
>
|
|
||||||
Virtueller Bestand (aus Komponenten)
|
|
||||||
</Typography>
|
|
||||||
</Box>
|
|
||||||
</Tooltip>
|
|
||||||
{hasIncoming ? (
|
|
||||||
<Box sx={{ mt: 0.75 }}>
|
|
||||||
{this.renderIncomingChip(totalIncoming, incomingItems, unit)}
|
|
||||||
</Box>
|
|
||||||
) : null}
|
|
||||||
</Box>
|
|
||||||
) : isTrackStock ? (
|
|
||||||
<Box sx={{ my: 0.5 }}>
|
|
||||||
<Tooltip title="Klicken, um Bestand anzupassen" arrow placement="top-start">
|
|
||||||
<Box
|
|
||||||
onClick={this.handleOpenAdjust}
|
|
||||||
sx={{
|
|
||||||
display: 'inline-flex',
|
|
||||||
alignItems: 'baseline',
|
|
||||||
gap: 0.75,
|
|
||||||
cursor: 'pointer',
|
|
||||||
borderRadius: 1,
|
|
||||||
px: 0.5,
|
|
||||||
mx: -0.5,
|
|
||||||
transition: 'background-color 0.15s ease',
|
|
||||||
'&:hover': {
|
|
||||||
backgroundColor: TINT_ROW_HOVER,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Typography
|
<Typography
|
||||||
component="div"
|
component="div"
|
||||||
sx={{
|
sx={{
|
||||||
@@ -383,18 +286,24 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
</Typography>
|
</Typography>
|
||||||
) : null}
|
) : null}
|
||||||
</Box>
|
</Box>
|
||||||
</Tooltip>
|
<Typography
|
||||||
{hasIncoming ? (
|
variant="caption"
|
||||||
<Box sx={{ mt: 0.75 }}>
|
color="text.secondary"
|
||||||
{this.renderIncomingChip(totalIncoming, incomingItems, unit)}
|
sx={{ display: 'block', mt: 0.25 }}
|
||||||
</Box>
|
>
|
||||||
) : null}
|
Virtueller Bestand (aus Komponenten)
|
||||||
</Box>
|
</Typography>
|
||||||
) : (
|
</Box>
|
||||||
<Box sx={{ my: 0.75 }}>
|
</Tooltip>
|
||||||
|
) : isTrackStock ? (
|
||||||
|
<Tooltip title="Klicken, um Bestand anzupassen" arrow placement="top-start">
|
||||||
<Box
|
<Box
|
||||||
onClick={this.handleOpenAdjust}
|
onClick={this.handleOpenAdjust}
|
||||||
sx={{
|
sx={{
|
||||||
|
display: 'inline-flex',
|
||||||
|
alignItems: 'baseline',
|
||||||
|
gap: 0.75,
|
||||||
|
my: 0.5,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
borderRadius: 1,
|
borderRadius: 1,
|
||||||
px: 0.5,
|
px: 0.5,
|
||||||
@@ -408,27 +317,59 @@ export default class ArticleViewStock extends PureComponent {
|
|||||||
<Typography
|
<Typography
|
||||||
component="div"
|
component="div"
|
||||||
sx={{
|
sx={{
|
||||||
fontSize: '1.25rem',
|
fontSize: '2.4rem',
|
||||||
fontWeight: 700,
|
fontWeight: 700,
|
||||||
lineHeight: 1.2,
|
lineHeight: 1.1,
|
||||||
color: 'text.secondary',
|
letterSpacing: '-0.02em',
|
||||||
|
color: totalStock > 0 ? 'text.primary' : 'text.secondary',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Keine Erfassung
|
{formatStock(totalStock)}
|
||||||
</Typography>
|
|
||||||
<Typography
|
|
||||||
variant="caption"
|
|
||||||
color="text.secondary"
|
|
||||||
sx={{ display: 'block', mt: 0.25 }}
|
|
||||||
>
|
|
||||||
Bestand wird nicht überwacht
|
|
||||||
</Typography>
|
</Typography>
|
||||||
|
{unit ? (
|
||||||
|
<Typography
|
||||||
|
variant="body2"
|
||||||
|
color="text.secondary"
|
||||||
|
sx={{ fontWeight: 500 }}
|
||||||
|
>
|
||||||
|
{unit}
|
||||||
|
</Typography>
|
||||||
|
) : null}
|
||||||
</Box>
|
</Box>
|
||||||
{hasIncoming ? (
|
</Tooltip>
|
||||||
<Box sx={{ mt: 0.75 }}>
|
) : (
|
||||||
{this.renderIncomingChip(totalIncoming, incomingItems, unit)}
|
<Box
|
||||||
</Box>
|
onClick={this.handleOpenAdjust}
|
||||||
) : null}
|
sx={{
|
||||||
|
my: 0.75,
|
||||||
|
cursor: 'pointer',
|
||||||
|
borderRadius: 1,
|
||||||
|
px: 0.5,
|
||||||
|
mx: -0.5,
|
||||||
|
transition: 'background-color 0.15s ease',
|
||||||
|
'&:hover': {
|
||||||
|
backgroundColor: TINT_ROW_HOVER,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
component="div"
|
||||||
|
sx={{
|
||||||
|
fontSize: '1.25rem',
|
||||||
|
fontWeight: 700,
|
||||||
|
lineHeight: 1.2,
|
||||||
|
color: 'text.secondary',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Keine Erfassung
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
variant="caption"
|
||||||
|
color="text.secondary"
|
||||||
|
sx={{ display: 'block', mt: 0.25 }}
|
||||||
|
>
|
||||||
|
Bestand wird nicht überwacht
|
||||||
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user