fix(transport) : décharge après volume (nouvelle ligne) + contenant Benne/FM en select (ERP-166)
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Successful in 3m1s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Has been cancelled

This commit is contained in:
2026-06-16 17:35:27 +02:00
parent f70e701854
commit 8cc2cea444
@@ -63,18 +63,9 @@
/>
</div>
<!-- RG-4.02 : Decharge visible et obligatoire si certification AUTRE.
L'upload reel (File → IRI via useUpload) arrive a ERP-171. -->
<!-- TODO ERP-171 : brancher useUpload pour resoudre le File en IRI
(main.dischargeDocumentIri). Le champ est deja visible/obligatoire. -->
<MalioInputUpload
v-if="showDischarge"
:label="t('transport.carriers.form.main.discharge')"
accept="application/pdf,image/*"
:required="true"
:readonly="mainLocked"
:error="mainErrors.errors.dischargeDocument"
/>
<!-- Espace réservé : laisse un trou en colonne 4 de la ligne 1 (xl)
pour pousser les champs conditionnels sur une nouvelle ligne. -->
<div v-if="showCharteredFields || showDischarge" class="hidden xl:block"></div>
<!-- RG-4.03 : champs d'affretement visibles + obligatoires si « Affreter ». -->
<template v-if="showCharteredFields">
@@ -86,33 +77,17 @@
:error="mainErrors.errors.indexationRate"
/>
<!-- Contenant : radio Benne / Fond mouvant (RG-4.03). -->
<div class="flex flex-col justify-center">
<span class="mb-1 text-sm font-medium text-m-muted">
{{ t('transport.carriers.form.main.containerType') }}<span class="text-m-danger"> *</span>
</span>
<div class="flex gap-4">
<MalioRadioButton
v-model="main.containerType"
name="container-type"
value="BENNE"
:label="t('transport.carriers.containerType.BENNE')"
:disabled="mainLocked"
group-class="mt-0"
/>
<MalioRadioButton
v-model="main.containerType"
name="container-type"
value="FOND_MOUVANT"
:label="t('transport.carriers.containerType.FOND_MOUVANT')"
:disabled="mainLocked"
group-class="mt-0"
/>
</div>
<p v-if="mainErrors.errors.containerType" class="mt-1 ml-[2px] text-xs text-m-danger">
{{ mainErrors.errors.containerType }}
</p>
</div>
<!-- Contenant : Benne / Fond mouvant (RG-4.03). -->
<MalioSelect
:model-value="main.containerType"
:options="containerOptions"
:label="t('transport.carriers.form.main.containerType')"
empty-option-label=""
:required="true"
:readonly="mainLocked"
:error="mainErrors.errors.containerType"
@update:model-value="(v: string | number | null) => main.containerType = v === null ? null : String(v)"
/>
<MalioInputNumber
v-model="main.volumeM3"
@@ -122,6 +97,20 @@
:error="mainErrors.errors.volumeM3"
/>
</template>
<!-- RG-4.02 : Decharge visible et obligatoire si certification AUTRE,
placée APRÈS le volume (col 4 ligne 2 si affrété, sinon col 1 ligne 2).
L'upload reel (File → IRI via useUpload) arrive a ERP-171. -->
<!-- TODO ERP-171 : brancher useUpload pour resoudre le File en IRI
(main.dischargeDocumentIri). Le champ est deja visible/obligatoire. -->
<MalioInputUpload
v-if="showDischarge"
:label="t('transport.carriers.form.main.discharge')"
accept="application/pdf,image/*"
:required="true"
:readonly="mainLocked"
:error="mainErrors.errors.dischargeDocument"
/>
</template>
</div>
@@ -293,6 +282,16 @@ const certificationOptions = computed<SelectOption[]>(() =>
})),
)
// Contenant (RG-4.03) : Benne / Fond mouvant — select simple.
const CONTAINER_TYPES = ['BENNE', 'FOND_MOUVANT'] as const
const containerOptions = computed<SelectOption[]>(() =>
CONTAINER_TYPES.map(code => ({
value: code,
label: t(`transport.carriers.containerType.${code}`),
})),
)
// Icone (Iconify) affichee dans chaque onglet, par cle.
const TAB_ICONS: Record<string, string> = {
qualimat: 'mdi:truck-check-outline',