[#327] Afficher modifier une expédition terminée #34
@@ -12,7 +12,7 @@
|
|||||||
type="submit"
|
type="submit"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
>
|
>
|
||||||
<Icon :name="props.address ? 'mdi:check' : 'mdi:plus'" size="28" />
|
<Icon :name="props.address ? '' : 'mdi:plus'" size="28" />
|
||||||
{{ props.address? "Valider" : "Ajouter" }}
|
{{ props.address? "Valider" : "Ajouter" }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -190,7 +190,6 @@
|
|||||||
type="submit"
|
type="submit"
|
||||||
class="inline-flex mb-16 items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2 justify-self-end"
|
class="inline-flex mb-16 items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2 justify-self-end"
|
||||||
>
|
>
|
||||||
<Icon name="mdi:check" size="28" />
|
|
||||||
Valider
|
Valider
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -256,13 +256,19 @@ const selectedCarrier = computed(() =>
|
|||||||
carriers.value.find((carrier) => String(carrier.id) === form.carrierId) ?? null
|
carriers.value.find((carrier) => String(carrier.id) === form.carrierId) ?? null
|
||||||
)
|
)
|
||||||
const isLiotCarrier = computed(() => selectedCarrier.value?.code === SUPPLIER_CODE.LIOT)
|
const isLiotCarrier = computed(() => selectedCarrier.value?.code === SUPPLIER_CODE.LIOT)
|
||||||
|
const isAddressData = (value: unknown): value is AddressData =>
|
||||||
|
typeof value === 'object' &&
|
||||||
|
value !== null &&
|
||||||
|
'id' in value &&
|
||||||
|
'fullAddress' in value
|
||||||
|
|
||||||
const customerAddresses = computed<AddressData[]>(() => {
|
const customerAddresses = computed<AddressData[]>(() => {
|
||||||
|
if (!form.customerId) return []
|
||||||
const customerId = Number(form.customerId)
|
const customerId = Number(form.customerId)
|
||||||
if (!Number.isFinite(customerId)) {
|
if (!Number.isFinite(customerId) || customerId <= 0) return []
|
||||||
return []
|
|
||||||
}
|
const addresses = customers.value.find((c) => c.id === customerId)?.addresses ?? []
|
||||||
return customers.value.find((customer) => customer.id === customerId)?.addresses ?? []
|
return addresses.filter(isAddressData)
|
||||||
})
|
})
|
||||||
|
|
||||||
const customerAddressOptions = computed(() =>
|
const customerAddressOptions = computed(() =>
|
||||||
|
|||||||
Reference in New Issue
Block a user