ot pdf download

This commit is contained in:
amazuecos
2025-03-30 14:22:43 +02:00
parent 50cd951755
commit bc969828b9
16 changed files with 1198 additions and 458 deletions

View File

@ -34,7 +34,7 @@ class OrdenTrabajoDatatable {
render: (d, t) => {
return `<div class="btn-group btn-group-sm">
<a type="button" href="/produccion/ordentrabajo/edit/${d}" class=" btn btn-outline ot-edit"><i class="ti ti-eye ti-sm mx-2"></i></a>
<a type="button" href="/produccion/ordentrabajo/pdf/${d}" class="btn btn-outline ot-pdf"><i class="ti ti-download ti-sm mx-2"></i></a>
<a type="button" target="_blank" href="/produccion/ordentrabajo/pdf/${d}" class="btn btn-outline ot-pdf"><i class="ti ti-download ti-sm mx-2"></i></a>
</div>`
}

View File

@ -0,0 +1,12 @@
$(() => {
console.log("PDF")
var opt = {
margin: 2,
filename: "PDF_OrdenTrabajo_" + $(".pdf-wrapper").data("id") + ".pdf",
image: { type: 'jpeg', quality: 1 },
html2canvas: { scale: 3 },
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' }
};
let elementToPdf = $('body')[0]
html2pdf().set(opt).from(elementToPdf).save()
})

View File

@ -217,7 +217,6 @@ class OrdenTrabajo {
}
handleSummaryError(error) { }
fillPreimpresionReview() {
console.log(this.summaryData.ot)
this.otForm.find("[name=fecha_entrega_warning]").prop("checked", this.summaryData.ot.fecha_entrega_warning)
this.otForm.find("[name=fecha_entrega_warning_revised]").prop("checked", this.summaryData.ot.fecha_entrega_warning_revised)
this.otForm.find("[name=revisar_formato]").prop("checked", this.summaryData.ot.revisar_formato)