mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-02 21:51:51 +08:00
Merge pull request #7626 from rekonder/aj_SCI_9833
Fix small zebra print issues [SCI-9833]
This commit is contained in:
commit
596844cc07
2 changed files with 21 additions and 16 deletions
|
@ -201,23 +201,27 @@ var zebraPrint = (function() {
|
|||
});
|
||||
}
|
||||
|
||||
updateProgressModalData(progressModal, printData.printer_name, PRINTER_STATUS_SEARCH, PRINTER_STATUS_SEARCH);
|
||||
device = findDevice(printData.printer_name);
|
||||
if (dataZebra?.responseJSON?.labels?.length && printData.number_of_copies > 0) {
|
||||
updateProgressModalData(progressModal, printData.printer_name, PRINTER_STATUS_SEARCH, PRINTER_STATUS_SEARCH);
|
||||
device = findDevice(printData.printer_name);
|
||||
|
||||
getPrinterStatus(device).then((device) => {
|
||||
if (device.status === I18n.t('label_printers.modal_printing_status.printer_status.ready')) {
|
||||
print(
|
||||
device,
|
||||
progressModal,
|
||||
printData.number_of_copies,
|
||||
printData.printer_name,
|
||||
dataZebra.responseJSON.labels,
|
||||
0,
|
||||
);
|
||||
} else {
|
||||
updateProgressModalData(progressModal, printData.printer_name, PRINTER_STATUS_ERROR, PRINTER_STATUS_ERROR);
|
||||
}
|
||||
});
|
||||
getPrinterStatus(device).then((device) => {
|
||||
if (device.status === I18n.t('label_printers.modal_printing_status.printer_status.ready')) {
|
||||
print(
|
||||
device,
|
||||
progressModal,
|
||||
printData.number_of_copies,
|
||||
printData.printer_name,
|
||||
dataZebra.responseJSON.labels,
|
||||
0
|
||||
);
|
||||
} else {
|
||||
updateProgressModalData(progressModal, printData.printer_name, PRINTER_STATUS_ERROR, PRINTER_STATUS_ERROR);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
updateProgressModalData(progressModal, printData.printer_name, PRINTER_STATUS_ERROR, PRINTER_STATUS_ERROR);
|
||||
}
|
||||
}).fail(() => {
|
||||
HelperModule.flashAlertMsg(I18n.t('repository_row.modal_print_label.general_error'), 'danger');
|
||||
});
|
||||
|
|
|
@ -255,6 +255,7 @@ export default {
|
|||
});
|
||||
},
|
||||
initZebraPrinter() {
|
||||
this.printers = this.printers.filter((printer) => !printer.id.startsWith('zebra'));
|
||||
this.zebraPrinters = zebraPrint.init($('#LabelPrinterSelector'), {
|
||||
clearSelectorOnFirstDevice: false,
|
||||
appendDevice: (device) => {
|
||||
|
|
Loading…
Reference in a new issue