Compare commits
2 Commits
e788c960d5
...
7fe9f90f2c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fe9f90f2c | ||
|
|
456389be1b |
@@ -9,6 +9,7 @@ import Grid from '@mui/material/Grid';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import PrintIcon from '@mui/icons-material/Print';
|
||||
import CheckCircleIcon from '@mui/icons-material/CheckCircle';
|
||||
import CancelScheduleSendOutlinedIcon from '@mui/icons-material/CancelScheduleSendOutlined';
|
||||
import { enqueueSnackbar } from 'notistack';
|
||||
|
||||
import { labeltemplate, printer, article } from '../../../api';
|
||||
@@ -147,6 +148,19 @@ export default class ArticleLabelTab extends PureComponent {
|
||||
}
|
||||
};
|
||||
|
||||
handleCancelAllJobs = async () => {
|
||||
const { selectedPrinterId, printers } = this.state;
|
||||
const p = (printers || []).find((item) => item.id === selectedPrinterId);
|
||||
const printerName = p ? getPrinterLabel(p) : 'Drucker';
|
||||
|
||||
try {
|
||||
await companyAutomat.actions.cancelAllPrinterJobs(selectedPrinterId || undefined);
|
||||
enqueueSnackbar(`Druckaufträge für ${printerName} abgebrochen.`, { variant: 'info' });
|
||||
} catch (err) {
|
||||
notifyError(err);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const {
|
||||
templates,
|
||||
@@ -316,6 +330,18 @@ export default class ArticleLabelTab extends PureComponent {
|
||||
>
|
||||
Etiketten drucken
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant="outlined"
|
||||
color="error"
|
||||
size="large"
|
||||
startIcon={<CancelScheduleSendOutlinedIcon />}
|
||||
onClick={this.handleCancelAllJobs}
|
||||
disabled={!selectedPrinterId}
|
||||
sx={{ height: 40 }}
|
||||
>
|
||||
Druckaufträge abbrechen
|
||||
</Button>
|
||||
</Box>
|
||||
</Box>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user