diff --git a/index.html b/index.html index f658118..de9efc5 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + Unilab diff --git a/public/watermark-orig.ico b/public/watermark-orig.ico new file mode 100644 index 0000000..adc1f05 Binary files /dev/null and b/public/watermark-orig.ico differ diff --git a/public/watermark-orig.png b/public/watermark-orig.png new file mode 100644 index 0000000..75fbeae Binary files /dev/null and b/public/watermark-orig.png differ diff --git a/src/App.vue b/src/App.vue index 626a5ac..a9d8dd7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -79,8 +79,13 @@
Lo sperimentatore
- Dott. Ing. Giacomo Calussi + {{ intestazione.sperimentatore }}
+ +
+ Pagina 1 di 1 +
+
Il Direttore del Laboratorio
Dott. Ing. Paolo Neri @@ -327,8 +332,8 @@ header { .section-title { padding: 4px; font-weight: bold; - margin-top: 16px; - margin-bottom: 2px; + margin-top: 8px; + margin-bottom: 8px; text-align: center; } @@ -433,11 +438,11 @@ footer .signatures { } footer .sign1{ - font-size: 0.9em; + font-size: 0.85em; } footer .sign2{ - font-size: 0.8em; + font-size: 0.75em; } footer .signblock{ @@ -457,4 +462,11 @@ footer .signblock{ font-size: 0.7em; margin: 0; } + +.pagecount { + align-self: end; + font-size: 0.7em; + border-bottom: none; +} + diff --git a/src/components/risultati/A_CIL.vue b/src/components/risultati/A_CIL.vue index 2011b7c..1c15782 100644 --- a/src/components/risultati/A_CIL.vue +++ b/src/components/risultati/A_CIL.vue @@ -16,7 +16,7 @@ {{ row.idProvino }} {{ row.contrassegno }} {{ row.verbale }} - {{ formatDate(row.dataPrelievo) }} + {{ fmtDDMMYY(row.dataPrelievo) }} {{ formatNumber(row.rck, 0) }} {{ row.area }} @@ -61,7 +61,7 @@ {{ row.idProvino }} - {{ formatDate(row.dataProva) }} + {{ fmtDDMMYY(row.dataProva) }} {{ formatNumber(row.dimA, 2) }} {{ formatNumber(row.dimH, 2) }} {{ formatNumber(row.massaVolumica, 0) }} @@ -82,6 +82,8 @@ intestazione: Object }) + import{fmtDDMMYY} from '../../utils/dateformat.js' + function formatDate(dateStr) { return new Date(dateStr).toLocaleDateString('it-IT') } diff --git a/src/components/risultati/A_CUB.vue b/src/components/risultati/A_CUB.vue index b8d5d9f..f705681 100644 --- a/src/components/risultati/A_CUB.vue +++ b/src/components/risultati/A_CUB.vue @@ -16,7 +16,7 @@ {{ row.idProvino }} {{ row.contrassegno }} {{ row.verbale }} - {{ formatDate(row.dataPrelievo) }} + {{ fmtDDMMYY(row.dataPrelievo) }} {{ formatNumber(row.rck, 0) }} {{ row.area }} @@ -63,7 +63,7 @@ {{ row.idProvino }} - {{ formatDate(row.dataProva) }} + {{ fmtDDMMYY(row.dataProva) }} {{ formatNumber(row.dimA, 2) }} {{ formatNumber(row.dimB, 2) }} {{ formatNumber(row.dimH, 2) }} @@ -85,6 +85,8 @@ intestazione: Object }) + import{fmtDDMMYY} from '../../utils/dateformat.js' + function formatDate(dateStr) { return new Date(dateStr).toLocaleDateString('it-IT') } diff --git a/src/components/risultati/B_BAR.vue b/src/components/risultati/B_BAR.vue index 0e7927d..1f79d67 100644 --- a/src/components/risultati/B_BAR.vue +++ b/src/components/risultati/B_BAR.vue @@ -27,7 +27,7 @@ {{ row.idProvino }} {{ row.contrassegno }} {{ row.verbale }} - {{ formatDate(row.dataPrelievo) }} + {{ fmtDDMMYY(row.dataPrelievo) }} {{ formatNumber(row.diaNom,0) }} {{ formatNumber(row.lunBase,0) }} {{ formatNumber(row.masG,1) }} @@ -82,6 +82,8 @@ intestazione: Object }) + import{fmtDDMMYY} from '../../utils/dateformat.js' + function formatDate(dateStr) { return new Date(dateStr).toLocaleDateString('it-IT') } diff --git a/src/components/risultati/B_RET.vue b/src/components/risultati/B_RET.vue index 7dd704b..ba996ca 100644 --- a/src/components/risultati/B_RET.vue +++ b/src/components/risultati/B_RET.vue @@ -27,7 +27,7 @@ {{ row.idProvino }} {{ row.contrassegno }} {{ row.verbale }} - {{ formatDate(row.dataPrelievo) }} + {{ fmtDDMMYY(row.dataPrelievo) }} {{ formatNumber(row.diaNom,0) }} {{ formatNumber(row.lunBase,2) }} {{ formatNumber(row.masG,2) }} @@ -85,6 +85,8 @@ intestazione: Object }) + import{fmtDDMMYY} from '../../utils/dateformat.js' + function formatDate(dateStr) { return new Date(dateStr).toLocaleDateString('it-IT') } diff --git a/src/utils/dateformat.js b/src/utils/dateformat.js new file mode 100644 index 0000000..0bfbbaf --- /dev/null +++ b/src/utils/dateformat.js @@ -0,0 +1,48 @@ +/** + * Format a date to "DD/MM/YY". + * Accepts Date, ISO/string, or timestamp (ms). + * + * @param {Date|string|number|null|undefined} input + * @param {{ utc?: boolean, placeholder?: string }} opts + * @returns {string} + */ +export function fmtDDMMYY(input, opts = {}) { + const { utc = false, placeholder = '' } = opts; + if (input == null || input === '') return placeholder; + + let d = null; + + if (input instanceof Date) { + d = new Date(input.getTime()); + } else if (typeof input === 'number') { + d = new Date(input); + } else if (typeof input === 'string') { + const s = input.trim(); + + // Try DD/MM/YYYY or DD-MM-YYYY (also accepts 1/1/24 etc.) + const m = /^(\d{1,2})[\/-](\d{1,2})[\/-](\d{2}|\d{4})$/.exec(s); + if (m) { + let dd = Number(m[1]), mm = Number(m[2]), yy = m[3]; + let yyyy = yy.length === 2 ? twoDigitYearToFull(Number(yy)) : Number(yy); + d = new Date(yyyy, mm - 1, dd); + } else { + // Fallback: let Date parse ISO-like strings (e.g., "2025-11-13T10:15:00") + const parsed = new Date(s); + if (!isNaN(parsed)) d = parsed; + } + } + + if (!d || isNaN(d)) return placeholder; + + const get = utc ? 'getUTC' : 'get'; + const dd = String(d[`${get}Date`]()).padStart(2, '0'); + const mm = String(d[`${get}Month`]() + 1).padStart(2, '0'); + const yy = String(d[`${get}FullYear`]()).slice(-2); + + return `${dd}/${mm}/${yy}`; +} + +/** Map 2-digit year to full year: 00–68 → 2000–2068, 69–99 → 1969–1999 */ +function twoDigitYearToFull(yy) { + return yy <= 68 ? 2000 + yy : 1900 + yy; +}