fix(transport) : consultation — disposition du bloc principal alignée sur l'ajout (LIOT, décharge col 3, affréter col 4) (ERP-170)
This commit is contained in:
@@ -43,34 +43,52 @@
|
|||||||
<p v-else-if="error" class="mt-12 text-center text-m-danger">{{ t('transport.carriers.consultation.notFound') }}</p>
|
<p v-else-if="error" class="mt-12 text-center text-m-danger">{{ t('transport.carriers.consultation.notFound') }}</p>
|
||||||
|
|
||||||
<template v-else-if="carrier">
|
<template v-else-if="carrier">
|
||||||
<!-- ── Bloc principal (lecture seule) ─────────────────────────────── -->
|
<!-- ── Bloc principal (lecture seule) — même disposition que l'ajout ── -->
|
||||||
<div class="mt-[48px] grid grid-cols-3 xl:grid-cols-4 gap-x-[44px] gap-y-4">
|
<div class="mt-[48px] grid grid-cols-3 xl:grid-cols-4 gap-x-[44px] gap-y-4">
|
||||||
<MalioInputText :model-value="main.name" :label="t('transport.carriers.form.main.name')" readonly />
|
<MalioInputText :model-value="main.name" :label="t('transport.carriers.form.main.name')" readonly />
|
||||||
<MalioInputText
|
|
||||||
v-if="main.certificationType"
|
<!-- Cas LIOT : seul le champ immatriculations. -->
|
||||||
:model-value="certificationLabel"
|
|
||||||
:label="t('transport.carriers.form.main.certificationType')"
|
|
||||||
readonly
|
|
||||||
/>
|
|
||||||
<MalioInputText
|
<MalioInputText
|
||||||
v-if="isLiot"
|
v-if="isLiot"
|
||||||
:model-value="main.liotPlates"
|
:model-value="main.liotPlates"
|
||||||
:label="t('transport.carriers.form.main.liotPlates')"
|
:label="t('transport.carriers.form.main.liotPlates')"
|
||||||
readonly
|
readonly
|
||||||
/>
|
/>
|
||||||
<div class="flex h-12 items-center">
|
|
||||||
<MalioCheckbox
|
<!-- Cas standard : certification + décharge (col 3 réservée) + affrètement (col 4). -->
|
||||||
id="carrier-view-chartered"
|
<template v-if="!isLiot">
|
||||||
:label="t('transport.carriers.form.main.isChartered')"
|
<MalioInputText
|
||||||
:model-value="main.isChartered"
|
:model-value="certificationLabel"
|
||||||
|
:label="t('transport.carriers.form.main.certificationType')"
|
||||||
readonly
|
readonly
|
||||||
:reserve-message-space="false"
|
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
<template v-if="main.isChartered">
|
<!-- Colonne 3 réservée à la décharge (si AUTRE), sinon vide (xl). -->
|
||||||
<MalioInputText :model-value="main.indexationRate" :label="t('transport.carriers.form.main.indexationRate')" readonly />
|
<MalioInputText
|
||||||
<MalioInputText :model-value="containerLabel" :label="t('transport.carriers.form.main.containerType')" readonly />
|
v-if="main.certificationType === 'AUTRE'"
|
||||||
<MalioInputText :model-value="main.volumeM3" :label="t('transport.carriers.form.main.volumeM3')" readonly />
|
:model-value="dischargeLabel"
|
||||||
|
:label="t('transport.carriers.form.main.discharge')"
|
||||||
|
readonly
|
||||||
|
/>
|
||||||
|
<div v-else class="hidden xl:block"></div>
|
||||||
|
|
||||||
|
<!-- Affréter : colonne 4, centré (h-12) comme à l'ajout. -->
|
||||||
|
<div class="flex h-12 items-center">
|
||||||
|
<MalioCheckbox
|
||||||
|
id="carrier-view-chartered"
|
||||||
|
:label="t('transport.carriers.form.main.isChartered')"
|
||||||
|
:model-value="main.isChartered"
|
||||||
|
readonly
|
||||||
|
:reserve-message-space="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Champs d'affrètement (ligne 2) si affrété. -->
|
||||||
|
<template v-if="main.isChartered">
|
||||||
|
<MalioInputText :model-value="indexationDisplay" :label="t('transport.carriers.form.main.indexationRate')" readonly />
|
||||||
|
<MalioInputText :model-value="containerLabel" :label="t('transport.carriers.form.main.containerType')" readonly />
|
||||||
|
<MalioInputText :model-value="main.volumeM3" :label="t('transport.carriers.form.main.volumeM3')" readonly />
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -237,6 +255,17 @@ const certificationLabel = computed(() => main.value.certificationType
|
|||||||
const containerLabel = computed(() => main.value.containerType
|
const containerLabel = computed(() => main.value.containerType
|
||||||
? t(`transport.carriers.containerType.${main.value.containerType}`)
|
? t(`transport.carriers.containerType.${main.value.containerType}`)
|
||||||
: '')
|
: '')
|
||||||
|
// Indexation affichée avec le « % » (comme l'icône du champ amount de l'ajout).
|
||||||
|
const indexationDisplay = computed(() => main.value.indexationRate ? `${main.value.indexationRate} %` : '')
|
||||||
|
// Décharge : nom du fichier embarqué si présent (sinon vide ; la colonne reste réservée).
|
||||||
|
const dischargeLabel = computed(() => {
|
||||||
|
const doc = carrier.value?.dischargeDocument
|
||||||
|
if (doc && typeof doc !== 'string') {
|
||||||
|
const meta = doc as Record<string, unknown>
|
||||||
|
return String(meta.originalFilename ?? meta.name ?? '')
|
||||||
|
}
|
||||||
|
return ''
|
||||||
|
})
|
||||||
|
|
||||||
// ── Onglets : Adresses · Contacts · Prix (ouvre sur Adresses, pas de Qualimat) ──
|
// ── Onglets : Adresses · Contacts · Prix (ouvre sur Adresses, pas de Qualimat) ──
|
||||||
const activeTab = ref('addresses')
|
const activeTab = ref('addresses')
|
||||||
|
|||||||
Reference in New Issue
Block a user