u
This commit is contained in:
@@ -64,7 +64,6 @@ export default class ArticleLabelTab extends PureComponent {
|
|||||||
quantity: 1,
|
quantity: 1,
|
||||||
loading: true,
|
loading: true,
|
||||||
error: null,
|
error: null,
|
||||||
cancelling: false,
|
|
||||||
};
|
};
|
||||||
this.legacyPrinters = [];
|
this.legacyPrinters = [];
|
||||||
}
|
}
|
||||||
@@ -149,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() {
|
render() {
|
||||||
const {
|
const {
|
||||||
templates,
|
templates,
|
||||||
@@ -318,6 +330,18 @@ export default class ArticleLabelTab extends PureComponent {
|
|||||||
>
|
>
|
||||||
Etiketten drucken
|
Etiketten drucken
|
||||||
</Button>
|
</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>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
|||||||
Reference in New Issue
Block a user