fix : on ne pèse plus automatiquement + fix message de création réception
Some checks failed
Auto Tag Develop / tag (push) Has been cancelled

This commit is contained in:
2026-03-18 10:38:11 +01:00
parent 82af4d4c1e
commit 2408ccab67
9 changed files with 63 additions and 67 deletions

View File

@@ -5,11 +5,11 @@
<!--@TODO Voir comment faire pour savoir si le pont-bascule et bien connecté + ajouter un icon comme sur la maquette-->
<p class="text-primary-500 uppercase text-2xl text-primary-500 mt-2">Pont-bascule connecté</p>
<div
v-if="showLoadingBox"
v-if="!displayWeight"
class="w-full flex flex-col items-center justify-center border border-black h-[90px] mt-12 mb-[86px]">
<UiLoadingDots />
</div>
<div v-else-if="displayWeight !== null" class="w-full">
<div v-else class="w-full">
<div
class="w-full flex flex-col items-center justify-center border border-black h-[90px] mt-12 mb-[25px] text-4xl text-primary-500">
{{ displayWeight }} kg
@@ -36,7 +36,7 @@
</template>
<script setup lang="ts">
import {computed, onMounted} from 'vue'
import {computed} from 'vue'
import { storeToRefs } from 'pinia'
import { useWeighing } from '~/composables/useWeighing'
import { usePdfPrinter } from '~/composables/usePdfPrinter'
@@ -92,10 +92,4 @@ const printReceipt = async () => {
await router.push('/')
}
// Récupère le poids dès l'arrivée sur l'écran
onMounted(() => {
if (displayWeight.value === null) {
fetchWeight()
}
})
</script>

View File

@@ -1,5 +1,5 @@
<template>
<div class="flex flex-col items-center gap-[118px]">
<div class="flex flex-col items-center gap-[150px]">
<h1 class="font-bold text-5xl uppercase text-primary-500">Chargement des bovins</h1>
<div
class="w-full flex flex-col items-center justify-center">

View File

@@ -5,13 +5,13 @@
<!--@TODO Voir comment faire pour savoir si le pont-bascule et bien connecté + ajouter un icon comme sur la maquette-->
<p class="text-primary-500 uppercase text-2xl mt-2">Pont-bascule connecté</p>
<div
v-if="showLoadingBox"
v-if="!displayWeight"
class="w-full flex flex-col items-center justify-center border border-black h-[90px] mt-12 mb-[86px]">
<UiLoadingDots />
</div>
<div v-else-if="displayWeight !== null" class="w-full">
<div v-else class="w-full">
<div
class="w-full flex flex-col items-center justify-center border border-primary-500 h-[90px] mt-12 mb-[25px] text-4xl text-primary-500">
class="w-full flex flex-col items-center justify-center border border-primary-500 h-[90px] mt-12 mb-[86px] text-4xl text-primary-500">
{{ displayWeight }} kg
</div>
</div>
@@ -36,7 +36,7 @@
</template>
<script setup lang="ts">
import { computed, onMounted } from 'vue'
import { computed } from 'vue'
import { storeToRefs } from 'pinia'
import { useWeighingShipment } from '~/composables/useWeighing'
import { usePdfPrinter } from '~/composables/usePdfPrinter'
@@ -92,10 +92,4 @@ const printReceipt = async () => {
await router.push('/')
}
// Récupère le poids dès l'arrivée sur l'écran
onMounted(() => {
if (displayWeight.value === null) {
fetchWeight()
}
})
</script>

View File

@@ -27,9 +27,7 @@ export const useWeighing = ({
const displayWeight = computed(() => weightData.value?.weight ?? currentWeightEntry.value?.weight ?? null)
const displayDsd = computed(() => weightData.value?.dsd ?? currentWeightEntry.value?.dsd ?? '-')
const title = computed(() => (mode === 'gross' ? 'Pesée à plein' : 'Pesée à vide'))
const showLoadingBox = computed(
() => isFetching.value || (displayWeight.value === null && currentWeightEntry.value === null)
)
const showLoadingBox = computed(() => isFetching.value)
const fetchWeight = async () => {
isFetching.value = true
@@ -111,9 +109,7 @@ export const useWeighingShipment = ({
const displayWeight = computed(() => weightData.value?.weight ?? currentWeightEntry.value?.weight ?? null)
const displayDsd = computed(() => weightData.value?.dsd ?? currentWeightEntry.value?.dsd ?? '-')
const title = computed(() => (modeShipment === 'gross' ? 'Pesée à vide' : 'Pesée à plein'))
const showLoadingBox = computed(
() => isFetching.value || (displayWeight.value === null && currentWeightEntry.value === null)
)
const showLoadingBox = computed(() => isFetching.value)
const fetchWeight = async () => {
isFetching.value = true

View File

@@ -109,9 +109,11 @@
},
"success": {
"reception": {
"create": "Réception créée avec succès",
"update": "Réception mise à jour avec succès."
},
"shipment": {
"create": "Éxpedition créée avec succès",
"update": "Éxpedition mise à jour avec succès."
},
"supplier": {

View File

@@ -134,7 +134,8 @@
class="inline-flex items-center py-2 -my-2 text-xl leading-none transition hover:opacity-80"
aria-haspopup="true"
>
<span class="capitalize font-bold">{{ userDisplayName }}</span>
<Icon name="mdi:account-circle-outline" class="self-center" size="36"/>
<span class="capitalize font-bold ml-4">{{ userDisplayName }}</span>
<span
class="ml-[6px] inline-flex items-center font-bold transition-transform group-hover:rotate-180 group-focus-within:rotate-180">
<Icon name="mdi:chevron-down" size="20"/>

View File

@@ -21,6 +21,7 @@ export async function getReception(id: number) {
export async function createReception(payload: ReceptionPayload = {}) {
const api = useApi()
return api.post<ReceptionData>('receptions', payload, {
toastSuccessKey: 'success.reception.create',
toastErrorKey: 'errors.reception.create'
})
}

View File

@@ -18,8 +18,10 @@ export async function getShipment(id: number) {
}
export async function createShipment(payload: ShipmentPayload = {}) {
console.log('test')
const api = useApi()
return api.post<ShipmentData>('shipments', payload, {
toastSuccessKey: 'success.shipment.create',
toastErrorKey: 'errors.shipment.create'
})
}