fix(logistique) : bloque la saisie manuelle poids/DSD à 5 chiffres
Masque front 5 chiffres sur la modale manuelle + Assert\LessThanOrEqual(99999) sur WeighbridgeReadingResource (weight/dsd, mode MANUAL) et backstop entité (validateManualEntryDigits). Le DSD auto (compteur de site) n'est pas contraint.
This commit is contained in:
@@ -161,14 +161,14 @@
|
||||
<div class="flex flex-col gap-2">
|
||||
<MalioInputText
|
||||
v-model="manualModal.weight"
|
||||
:mask="NUMERIC_MASK"
|
||||
:mask="MANUAL_NUMERIC_MASK"
|
||||
:label="t('logistique.weighingTickets.form.manual.weight')"
|
||||
:required="true"
|
||||
:error="manualModal.errors.weight"
|
||||
/>
|
||||
<MalioInputText
|
||||
v-model="manualModal.dsd"
|
||||
:mask="NUMERIC_MASK"
|
||||
:mask="MANUAL_NUMERIC_MASK"
|
||||
:label="t('logistique.weighingTickets.form.manual.dsd')"
|
||||
:required="true"
|
||||
:error="manualModal.errors.dsd"
|
||||
@@ -192,7 +192,7 @@ import { useWeighingTicketForm, type WeighingBlockState } from '~/modules/logist
|
||||
import { useWeighbridge } from '~/modules/logistique/composables/useWeighbridge'
|
||||
import { useWeighingTicket, type WeighingTicketDetail } from '~/modules/logistique/composables/useWeighingTicket'
|
||||
import { useWeighingTicketReferentials, type RefOption } from '~/modules/logistique/composables/useWeighingTicketReferentials'
|
||||
import { NUMERIC_MASK, PLATE_MASK, FREE_PLATE_MASK } from '~/modules/logistique/utils/weighingMasks'
|
||||
import { MANUAL_NUMERIC_MASK, PLATE_MASK, FREE_PLATE_MASK } from '~/modules/logistique/utils/weighingMasks'
|
||||
import { mapViolationsToRecord } from '~/shared/utils/api'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -151,14 +151,14 @@
|
||||
<div class="flex flex-col gap-2">
|
||||
<MalioInputText
|
||||
v-model="manualModal.weight"
|
||||
:mask="NUMERIC_MASK"
|
||||
:mask="MANUAL_NUMERIC_MASK"
|
||||
:label="t('logistique.weighingTickets.form.manual.weight')"
|
||||
:required="true"
|
||||
:error="manualModal.errors.weight"
|
||||
/>
|
||||
<MalioInputText
|
||||
v-model="manualModal.dsd"
|
||||
:mask="NUMERIC_MASK"
|
||||
:mask="MANUAL_NUMERIC_MASK"
|
||||
:label="t('logistique.weighingTickets.form.manual.dsd')"
|
||||
:required="true"
|
||||
:error="manualModal.errors.dsd"
|
||||
@@ -181,7 +181,7 @@ import { computed, onMounted, reactive, ref, watch } from 'vue'
|
||||
import { useWeighingTicketForm, type WeighingBlockState } from '~/modules/logistique/composables/useWeighingTicketForm'
|
||||
import { useWeighbridge } from '~/modules/logistique/composables/useWeighbridge'
|
||||
import { useWeighingTicketReferentials, type RefOption } from '~/modules/logistique/composables/useWeighingTicketReferentials'
|
||||
import { NUMERIC_MASK, PLATE_MASK, FREE_PLATE_MASK } from '~/modules/logistique/utils/weighingMasks'
|
||||
import { MANUAL_NUMERIC_MASK, PLATE_MASK, FREE_PLATE_MASK } from '~/modules/logistique/utils/weighingMasks'
|
||||
import { mapViolationsToRecord } from '~/shared/utils/api'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -15,6 +15,17 @@ export const NUMERIC_MASK: MaskInputOptions = {
|
||||
tokens: { D: { pattern: /[0-9]/, multiple: true } },
|
||||
}
|
||||
|
||||
/**
|
||||
* Masque « chiffres, maximum 5 » — SAISIE MANUELLE du poids et du DSD (modale de
|
||||
* pesée manuelle). Borne la saisie à 5 chiffres (≤ 99999) ; le garde-fou serveur
|
||||
* (Callback mode MANUAL) reste autoritaire. NE PAS utiliser pour l'AFFICHAGE des
|
||||
* valeurs (WeighingBlock) : un DSD auto-alloué peut dépasser 5 chiffres.
|
||||
*/
|
||||
export const MANUAL_NUMERIC_MASK: MaskInputOptions = {
|
||||
mask: 'DDDDD',
|
||||
tokens: { D: { pattern: /[0-9]/ } },
|
||||
}
|
||||
|
||||
/**
|
||||
* Masque plaque FR SIV `XX-000-XX` : 2 lettres, 3 chiffres, 2 lettres, majuscules
|
||||
* forcées. Utilisé quand « Tout format » n'est pas coché (RG-5.01).
|
||||
|
||||
Reference in New Issue
Block a user