Compare commits

..

No commits in common. "50184e54d06dd209a3cf1274e11cdc33862ee62a" and "69b0c8281ff8dd2dba4a5529e50062842c73adba" have entirely different histories.

4 changed files with 71 additions and 241 deletions

View File

@ -1,16 +1,14 @@
<template> <template>
<div> <div>
<button class="pdf-button" @click="exportPdf(intestazione.nomefile ? `${intestazione.nomefile}.pdf` : 'certificato-prova.pdf')">Esporta PDF</button> <button class="pdf-button" @click="exportPdf">Esporta PDF</button>
<div class="report" ref="printable" contenteditable="true"> <div class="report" ref="printable" contenteditable="true">
<header> <header>
<img src="/report_header.png" alt="Intestazione Unilab" class="report-header-image" /> <img src="/report_header.png" alt="Intestazione Unilab" class="report-header-image" />
</header> </header>
<div class="header-row"> <h3 class="section-title">{{ intestazione.intest1 }}</h3>
<h5 class="section-title">{{ intestazione.intest1 }}</h5>
<div class="modreport">{{ intestazione.modreport }}</div> <div>{{intestazione.modreport}}</div>
</div>
<h3 class="section-title">{{ intestazione.intest2 }}</h3> <h3 class="section-title">{{ intestazione.intest2 }}</h3>
@ -70,16 +68,9 @@
<footer> <footer>
<div class="notepp">{{ intestazione.notapp }}</div>
<div class="signatures"> <div class="signatures">
<div class="signblock"> <p>Lo sperimentatore<br>Dott. Ing. Giacomo Calussi</p>
<span class="sign1">Lo sperimentatore</span><br> <p>Il Direttore del Laboratorio<br>Dott. Ing. Paolo Neri</p>
<span class="sign2">Dott. Ing. Giacomo Calussi</span>
</div>
<div class="signblock">
<span class="sign1">Il Direttore del Laboratorio</span><br>
<span class="sign2">Dott. Ing. Paolo Neri</span>
</div>
</div> </div>
</footer> </footer>
</div> </div>
@ -91,14 +82,11 @@ import { ref, onMounted, watch } from 'vue'
import html2pdf from 'html2pdf.js' import html2pdf from 'html2pdf.js'
import A_CUB from './components/risultati/A_CUB.vue' import A_CUB from './components/risultati/A_CUB.vue'
import A_CIL from './components/risultati/A_CIL.vue' import A_CIL from './components/risultati/A_CIL.vue'
import B_BAR from './components/risultati/B_BAR.vue'
import B_RET from './components/risultati/B_RET.vue'
const componentMap = { const componentMap = {
'A_CUB': A_CUB, 'A_CUB': A_CUB,
'A_CIL': A_CIL, 'A_CIL': A_CIL,
'B_BAR':B_BAR, 'B_BAR':B_BAR
'B_RET':B_RET
} }
const printable = ref(null) const printable = ref(null)
@ -133,7 +121,7 @@ onMounted(async () => {
const data = await fetchReportDataWithToken(token, pSERCER); const data = await fetchReportDataWithToken(token, pSERCER);
intestazione.value = data.intestazione intestazione.value = data.intestazione
datiacc_info.value = data.datiacc_info datiacc_info.value = capitalizeAllFields(data.datiacc_info)
datiacc_data.value = data.datiacc_data datiacc_data.value = data.datiacc_data
risult_data.value = calcolaMediaRcPerGruppo(data.risult_data) risult_data.value = calcolaMediaRcPerGruppo(data.risult_data)
note.value = data.note ?? [] note.value = data.note ?? []
@ -203,11 +191,11 @@ function capitalizeEachWord(str) {
} }
function exportPdf(filename = 'certificato-prova.pdf') { function exportPdf() {
html2pdf() html2pdf()
.from(printable.value) .from(printable.value)
.set({ .set({
filename, filename: `certificato-prova.pdf`,
html2canvas: { scale: 2 }, html2canvas: { scale: 2 },
jsPDF: { jsPDF: {
unit: 'mm', unit: 'mm',
@ -269,37 +257,16 @@ body {
padding: 2px; padding: 2px;
} }
.header-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 8px; /* opzionale, spazio sotto la riga */
}
.header-row .section-title {
margin: 0;
text-align: left;
}
.modreport {
font-weight: normal;
text-align: right;
margin: 0;
}
.report-header-image { .report-header-image {
width: 100%; width: 100%;
height: auto; height: auto;
margin-bottom: 8px; margin-bottom: 10px;
display: block; display: block;
} }
.report { .report {
/* Assicuriamoci che .report abbia altezza A4 e posizionamento relativo */ width: 100%;
position: relative;
max-width: 210mm; max-width: 210mm;
min-height: 289mm;
padding: 4mm; padding: 4mm;
margin: 0 auto; margin: 0 auto;
background: white; background: white;
@ -308,7 +275,7 @@ body {
header { header {
margin-bottom: 4px; margin-bottom: 8px;
} }
.center { .center {
@ -318,15 +285,14 @@ header {
} }
.section-title { .section-title {
padding: 4px; padding: 6px;
font-weight: bold; font-weight: bold;
margin-top: 16px; margin-top: 10px;
margin-bottom: 2px;
text-align: center; text-align: center;
} }
.sub-header { .sub-header {
padding: 4px; padding: 6px;
text-align: center; text-align: center;
} }
@ -339,7 +305,7 @@ table {
th, th,
td { td {
border: 1px solid #000; border: 1px solid #000;
padding: 1px; padding: 2px;
font-size: 0.85em; font-size: 0.85em;
text-align: center; text-align: center;
} }
@ -347,7 +313,8 @@ td {
.info-table { .info-table {
width: 80%; width: 80%;
border: 2px solid black; border: 2px solid black;
margin: 0 auto; margin-left: auto;
margin-right: auto;
border-collapse: collapse; border-collapse: collapse;
} }
@ -366,7 +333,7 @@ td {
} }
.note-section { .note-section {
margin-top: 2px; margin-top: 10px;
} }
.note-table { .note-table {
@ -381,6 +348,13 @@ td {
text-align: left; text-align: left;
} }
.signatures {
display: flex;
justify-content: space-between;
margin-top: 40px;
font-weight: bold;
}
.pdf-button { .pdf-button {
position: fixed; position: fixed;
top: 20px; top: 20px;
@ -397,51 +371,4 @@ td {
.pdf-button:hover { .pdf-button:hover {
background-color: #0056b3; background-color: #0056b3;
} }
footer {
/* Posizione assoluta in fondo al contenitore .report */
position: absolute;
bottom: 4mm; /* distanza dal bordo inferiore */
left: 4mm; /* stesso padding orizzontale di .report */
right: 4mm;
}
footer .signatures {
/* Manteniamo le firme in orizzontale ma riduciamo margine sopra se serve */
margin-top: 0;
display: flex;
justify-content: space-between;
text-align: center;
padding-left: 80px;
padding-right: 80px;
border-top: 1px solid #000;
}
footer .sign1{
font-size: 0.75em;
}
footer .sign2{
font-size: 0.65em;
}
footer .signblock{
border-bottom: 1px solid #000;
padding-bottom: 12mm;
}
/* Stilizzo il div di notepp (assumo classe .modreport o ne crei una nuova) */
.modreport {
font-size: 0.7em; /* carattere piccolo */
margin: 0; /* rimuovo margini inutili */
text-align: right;
}
/* Se la sezione delle notepp ha una sua classe, ad esempio .notepp: */
.notepp {
font-size: 0.7em;
margin: 0;
}
</style> </style>

View File

@ -5,7 +5,7 @@
<tr> <tr>
<th>ID<br>Provino</th> <th>ID<br>Provino</th>
<th>Contrassegno</th> <th>Contrassegno</th>
<th>Verbale di<br>prelievo n.</th> <th>Verbale<br>di prelievo n.</th>
<th>Data<br>prelievo</th> <th>Data<br>prelievo</th>
<th>R<sub>CK</sub></th> <th>R<sub>CK</sub></th>
<th>Area o elemento strutturale</th> <th>Area o elemento strutturale</th>

View File

@ -3,22 +3,12 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th rowspan="2">ID<br>Provino</th> <th>ID<br>Provino</th>
<th rowspan="2">Contrass.</th> <th>Contrassegno</th>
<th rowspan="2">Verbale<br>di prelievo n.</th> <th>Verbale<br>di prelievo n.</th>
<th rowspan="2">Data<br>prelievo</th> <th>Data<br>prelievo</th>
<th>Diametro<br>Nominale</th> <th>R<sub>CK</sub></th>
<th>Lungh.</th> <th>Area o elemento strutturale</th>
<th>Massa</th>
<th>Diametro<br>Effettivo</th>
<th rowspan="2">Marchio</th>
<th rowspan="2">Struttura di<br>riferimento</th>
</tr>
<tr>
<th>[mm]</th>
<th>[mm]</th>
<th>[g]</th>
<th>[mm]</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -27,11 +17,7 @@
<td>{{ row.contrassegno }}</td> <td>{{ row.contrassegno }}</td>
<td>{{ row.verbale }}</td> <td>{{ row.verbale }}</td>
<td>{{ formatDate(row.dataPrelievo) }}</td> <td>{{ formatDate(row.dataPrelievo) }}</td>
<td>{{ formatNumber(row.diaNom,0) }}</td> <td>{{ formatNumber(row.rck, 0) }}</td>
<td>{{ formatNumber(row.dimA,0) }}</td>
<td>{{ formatNumber(row.masG,1) }}</td>
<td>{{ formatNumber(row.diaEff,2) }}</td>
<td>{{ row.ferriera }}</td>
<td v-if="row.rowspanArea > 0" :rowspan="row.rowspanArea">{{ row.area }}</td> <td v-if="row.rowspanArea > 0" :rowspan="row.rowspanArea">{{ row.area }}</td>
</tr> </tr>
</tbody> </tbody>
@ -44,30 +30,45 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<th>ID<br>Provino</th> <th colspan="5">DATI PRELIMINARI ALLA PROVA</th>
<th>Carico di<br>snevamento<br>F<sub>y</sub><br>[kN]</th> <th colspan="5">RESISTENZA ALLA COMPRESSIONE</th>
<th>Tensione di<br>snevamento<br>f<sub>y</sub><br>[N/mm²]</th> </tr>
<th>Carico di<br>rottura<br>F<sub>t</sub><br>[kN]</th> <tr>
<th>Tensione di<br>rottura<br>f<sub>t</sub><br>[N/mm²]</th> <th rowspan="3">ID<br>Provino</th>
<th>Allungamento<br>a rottura<br>A<sub>gt</sub><br>[%]</th> <th rowspan="3">Data<br>prova</th>
<th>f<sub>t</sub>/f<sub>y</sub></th> <th colspan="2">Dimensioni</th>
<th>f<sub>t</sub>/f<sub>ynom</sub></th> <th rowspan="2">Massa<br>volumica</th>
<th>Mandrino<br><br>D<br>[mm]</th> <th rowspan="2">F</th>
<th>Esito<br>Piega*</th> <th rowspan="2">R<sub>c</sub></th>
<th rowspan="2">R<sub>PRELIEVO</sub></th>
<th rowspan="3">R**</th>
<th rowspan="3">P***</th>
</tr>
<tr>
<th>D</th>
<th>h</th>
</tr>
<tr>
<th>[mm]</th>
<th>[mm]</th>
<th>[kg/]</th>
<th>[kN]</th>
<th>[N/mm²]</th>
<th>[N/mm²]</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="row in risult_data" :key="row.idProvino"> <tr v-for="row in risult_data" :key="row.idProvino">
<td>{{ row.idProvino }}</td> <td>{{ row.idProvino }}</td>
<td>{{ formatNumber(row.carsne,2) }}</td> <td>{{ formatDate(row.dataProva) }}</td>
<td>{{ formatNumber(row.tensne,1) }}</td> <td>{{ formatNumber(row.dimA, 2) }}</td>
<td>{{ formatNumber(row.carot,2) }}</td> <td>{{ formatNumber(row.dimH, 2) }}</td>
<td>{{ formatNumber(row.tenrot,1) }}</td> <td>{{ formatNumber(row.massaVolumica, 0) }}</td>
<td>{{ formatNumber(row.agt,1) }}</td> <td>{{ formatNumber(row.f, 1) }}</td>
<td>{{ formatNumber(row.ftFy,2) }}</td> <td>{{ formatNumber(row.rc, 2) }}</td>
<td>{{ formatNumber(row.ftFyNom,2) }}</td> <td v-if="row.rowspanRprelievo > 0" :rowspan="row.rowspanRprelievo">{{ row.rprelievo }}</td>
<td>{{ formatNumber(row.mandrino,0) }}</td> <td>{{ row.rType }}</td>
<td>{{ row.esipie }}</td> <td>{{ row.pType }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -93,4 +94,5 @@
: '—' : '—'
} }
</script> </script>

View File

@ -1,99 +0,0 @@
<template>
<h3 class="section-title">DATI PRELIMINARI DI PROVA</h3>
<table>
<thead>
<tr>
<th rowspan="2">ID<br>Provino</th>
<th rowspan="2">Contrass.</th>
<th rowspan="2">Verbale<br>di prelievo n.</th>
<th rowspan="2">Data<br>prelievo</th>
<th>Diametro<br>Nominale</th>
<th>Lungh.</th>
<th>Massa</th>
<th>Diametro<br>Effettivo</th>
<th rowspan="2">Marchio</th>
<th rowspan="2">Struttura di<br>riferimento</th>
</tr>
<tr>
<th>[mm]</th>
<th>[mm]</th>
<th>[g]</th>
<th>[mm]</th>
</tr>
</thead>
<tbody>
<tr v-for="(row, index) in datiacc_data" :key="row.idProvino">
<td>{{ row.idProvino }}</td>
<td>{{ row.contrassegno }}</td>
<td>{{ row.verbale }}</td>
<td>{{ formatDate(row.dataPrelievo) }}</td>
<td>{{ formatNumber(row.diaNom,0) }}</td>
<td>{{ formatNumber(row.dimA,0) }}</td>
<td>{{ formatNumber(row.masG,1) }}</td>
<td>{{ formatNumber(row.diaEff,2) }}</td>
<td>{{ row.ferriera }}</td>
<td v-if="row.rowspanArea > 0" :rowspan="row.rowspanArea">{{ row.area }}</td>
</tr>
</tbody>
</table>
<!-- RISULTATI -->
<div class="section-title">{{ intestazione.prova1 }}</div>
<div class="sub-header">{{ intestazione.prova2 }}</div>
<table>
<thead>
<tr>
<th rowspan="2">ID<br>Provino</th>
<th rowspan="2">Carico di<br>snevamento<br>F<sub>y</sub><br>[kN]</th>
<th rowspan="2">Tensione di<br>snevamento<br>f<sub>y</sub><br>[N/mm²]</th>
<th rowspan="2">Carico di<br>rottura<br>F<sub>t</sub><br>[kN]</th>
<th rowspan="2">Tensione di<br>rottura<br>f<sub>t</sub><br>[N/mm²]</th>
<th rowspan="2">Allungamento<br>a rottura<br>A<sub>gt</sub><br>[%]</th>
<th rowspan="2">f<sub>t</sub>/f<sub>y</sub></th>
<th rowspan="2">f<sub>t</sub>/f<sub>ynom</sub></th>
<th colspan="2">Carico di rottura<br>nodo saldato</th>
</tr>
<tr>
<th>[kN]</th>
<th>Tipo*</th>
</tr>
</thead>
<tbody>
<tr v-for="row in risult_data" :key="row.idProvino">
<td>{{ row.idProvino }}</td>
<td>{{ formatNumber(row.carsne,2) }}</td>
<td>{{ formatNumber(row.tensne,1) }}</td>
<td>{{ formatNumber(row.carot,2) }}</td>
<td>{{ formatNumber(row.tenrot,1) }}</td>
<td>{{ formatNumber(row.agt,1) }}</td>
<td>{{ formatNumber(row.ftFy,2) }}</td>
<td>{{ formatNumber(row.ftFyNom,2) }}</td>
<td>{{ formatNumber(row.disnod,2) }}</td>
<td>{{ row.tipdis }}</td>
</tr>
</tbody>
</table>
</template>
<script setup>
defineProps({
risult_data: Array,
datiacc_data: Array,
intestazione: Object
})
function formatDate(dateStr) {
return new Date(dateStr).toLocaleDateString('it-IT')
}
function formatNumber(val, decimals) {
return val != null
? Number(val).toLocaleString('it-IT', {
minimumFractionDigits: decimals,
maximumFractionDigits: decimals
})
: '—'
}
</script>