Merge pull request #4509 from rekonder/aj_SCI_7315

Fix selected printer for printing [SCI-7315]
This commit is contained in:
Alex Kriuchykhin 2022-10-10 15:59:29 +02:00 committed by GitHub
commit 4ac46f876a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,30 +216,32 @@
})
},
submitPrint() {
if (this.selectedPrinter.attributes.type_of === 'zebra') {
this.zebraPrinters.print(
this.urls.zebraProgress,
'.label-printing-progress-modal',
'#modal-print-repository-row-label',
{
printer_name: this.selectedPrinter.attributes.name,
number_of_copies: this.copies,
this.$nextTick(() => {
if (this.selectedPrinter.attributes.type_of === 'zebra') {
this.zebraPrinters.print(
this.urls.zebraProgress,
'.label-printing-progress-modal',
'#modal-print-repository-row-label',
{
printer_name: this.selectedPrinter.attributes.name,
number_of_copies: this.copies,
label_template_id: this.selectedTemplate.id,
rows: this.row_ids
}
);
} else {
$.post(this.urls.print, {
rows: this.row_ids,
label_printer_id: this.selectedPrinter.id,
label_template_id: this.selectedTemplate.id,
rows: this.row_ids
}
);
} else {
$.post(this.urls.print, {
rows: this.row_ids,
label_printer_id: this.selectedPrinter.id,
label_template_id: this.selectedTemplate.id,
copies: this.copies
}, (data) => {
$(this.$refs.modal).modal('hide');
this.$emit('close');
PrintProgressModal.init(data);
})
}
copies: this.copies
}, (data) => {
$(this.$refs.modal).modal('hide');
this.$emit('close');
PrintProgressModal.init(data);
})
}
});
},
initZebraPrinter() {
this.zebraPrinters = zebraPrint.init($('#LabelPrinterSelector'), {