Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | #278 | Plan du site | ## Description de la PR [#278] Plan du site ## Modification du .env ## Check list - [ ] Pas de régression - [x] TU/TI/TF rédigée - [x] TU/TI/TF OK - [ ] CHANGELOG modifié Co-authored-by: Matteo <matteo@yuno.malio.fr> Reviewed-on: #33 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
28 lines
802 B
Vue
28 lines
802 B
Vue
<template>
|
|
<div class="flex justify-center items-center">
|
|
<UiButton
|
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
|
:disabled="!hasCaseId"
|
|
@click="printCaseReport"
|
|
>
|
|
Imprimer case {{ caseId || '-' }}
|
|
</UiButton>
|
|
</div>
|
|
</template>
|
|
<script setup lang="ts">
|
|
const route = useRoute()
|
|
const { printPdf } = usePdfPrinter()
|
|
|
|
const caseId = computed(() => Number(route.query.id))
|
|
const hasCaseId = computed(() => Number.isFinite(caseId.value) && caseId.value > 0)
|
|
|
|
const printCaseReport = async () => {
|
|
if (!hasCaseId.value) {
|
|
return
|
|
}
|
|
|
|
const filename = `tableau_poids_case_${caseId.value}.pdf`
|
|
await printPdf(`/building_cases/${caseId.value}/weights-report`, filename)
|
|
}
|
|
</script>
|