fix : print affichage correctif
This commit is contained in:
@@ -12,10 +12,9 @@
|
|||||||
label: type.label
|
label: type.label
|
||||||
}))"
|
}))"
|
||||||
input-class="accent-primary-700 focus:ring-primary-700"
|
input-class="accent-primary-700 focus:ring-primary-700"
|
||||||
item-class="text-primary-700/50 [&:has(input:checked)]:text-primary-700"
|
|
||||||
option-label-class="uppercase"
|
option-label-class="uppercase"
|
||||||
wrapper-class="w-full uppercase"
|
wrapper-class="w-full uppercase"
|
||||||
group-class="grid grid-cols-[336px_336px_355px_200px] w-[160px_160px_200px_180px] mt-9 mb-7"
|
group-class="grid grid-cols-[336px_336px_355px_200px] w-[160px_160px_200px_180px] mt-9 mb-7"
|
||||||
:disabled="!auth.isAdmin"
|
:disabled="!auth.isAdmin"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<Icon @click="router.push('/')" name="gg:arrow-left-o" size="44" class="cursor-pointer text-primary-500"/>
|
<Icon @click="router.push('/')" name="gg:arrow-left-o" size="44" class="cursor-pointer text-primary-500"/>
|
||||||
</div>
|
</div>
|
||||||
<h1 class="font-bold text-4xl col-start-1 row-start-1 text-primary-500 uppercase">Réception {{ form.identificationNumber }}</h1>
|
<h1 class="font-bold text-4xl col-start-1 row-start-1 text-primary-500 uppercase">Réception {{ form.identificationNumber }}</h1>
|
||||||
<Icon @click="router.push('/')" name="mdi:printer-outline" size="44" class="cursor-pointer text-primary-500"/>
|
<Icon @click="printReceipt" name="mdi:printer-outline" size="44" class="cursor-pointer text-primary-500"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Nom de l'utilisateur -->
|
<!-- Nom de l'utilisateur -->
|
||||||
@@ -107,10 +107,11 @@
|
|||||||
label: driver.name
|
label: driver.name
|
||||||
}))"
|
}))"
|
||||||
:loading="isLoadingDrivers"
|
:loading="isLoadingDrivers"
|
||||||
wrapper-class="col-start-2 row-start-4"
|
wrapper-class="col-start-2 row-start-5"
|
||||||
|
v-if="isLiotCarrier"
|
||||||
/>
|
/>
|
||||||
<!-- Plaque d'immatriculation -->
|
<!-- Plaque d'immatriculation -->
|
||||||
<div v-if="!isLiotCarrier" class="col-start-2 row-start-5">
|
<div v-if="!isLiotCarrier" class="col-start-2 row-start-4">
|
||||||
<UiLicensePlateInput
|
<UiLicensePlateInput
|
||||||
:disabled="!auth.isAdmin"
|
:disabled="!auth.isAdmin"
|
||||||
v-model="form.licensePlate"
|
v-model="form.licensePlate"
|
||||||
@@ -129,7 +130,7 @@
|
|||||||
}))"
|
}))"
|
||||||
:loading="isLoadingVehicles"
|
:loading="isLoadingVehicles"
|
||||||
:disabled="(isLoadingVehicles || filteredVehicles.length === 0) && !auth.isAdmin"
|
:disabled="(isLoadingVehicles || filteredVehicles.length === 0) && !auth.isAdmin"
|
||||||
wrapper-class="col-start-2 row-start-5"
|
wrapper-class="col-start-2 row-start-4"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="formIsLoading">
|
<div v-if="formIsLoading">
|
||||||
@@ -203,6 +204,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import {usePdfPrinter} from "#imports"
|
||||||
import {useReceptionStore} from '~/stores/reception'
|
import {useReceptionStore} from '~/stores/reception'
|
||||||
import type {UserData} from '~/services/dto/user-data'
|
import type {UserData} from '~/services/dto/user-data'
|
||||||
import {getUsers} from '~/services/auth'
|
import {getUsers} from '~/services/auth'
|
||||||
@@ -244,7 +246,8 @@ const form = reactive<ReceptionFormData>({
|
|||||||
vehicleId: ''
|
vehicleId: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const activeTab = ref<'weights' | 'weightsEmpty' | 'merchandise'>('weights')
|
const { printPdf } = usePdfPrinter()
|
||||||
|
const activeTab = ref<'weightsEmpty' | 'weights' | 'merchandise'>('weightsEmpty')
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const receptionStore = useReceptionStore()
|
const receptionStore = useReceptionStore()
|
||||||
const allowAnyLicensePlate = ref(false)
|
const allowAnyLicensePlate = ref(false)
|
||||||
@@ -612,6 +615,20 @@ watch(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
const printReceipt = async () => {
|
||||||
|
if (!import.meta.client || !Number.isFinite(idReception) || idReception <= 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const supplierName =
|
||||||
|
suppliers.value.find((supplier) => String(supplier.id) === form.supplierId)?.name ??
|
||||||
|
'fournisseur'
|
||||||
|
const filename = `${form.identificationNumber || idReception}_${supplierName}_${form.licensePlate || 'immat'}.pdf`
|
||||||
|
await printPdf(`/receptions/${idReception}/receipt`, filename)
|
||||||
|
|
||||||
|
// Laisse le temps a la boite de dialogue d'impression de s'ouvrir.
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 600))
|
||||||
|
}
|
||||||
async function validate() {
|
async function validate() {
|
||||||
const normalizedLicensePlate = form.licensePlate.trim()
|
const normalizedLicensePlate = form.licensePlate.trim()
|
||||||
const normalizedReceptionDate = form.receptionDate.trim()
|
const normalizedReceptionDate = form.receptionDate.trim()
|
||||||
|
|||||||
Reference in New Issue
Block a user