| Numéro du ticket | Titre du ticket | |------------------|-----------------| | 334 | Correctifs | ## Description de la PR ## Modification du .env ## Check list - [x] Pas de régression - [ ] TU/TI/TF rédigée - [x] TU/TI/TF OK - [x] CHANGELOG modifié Reviewed-on: #32 Co-authored-by: Matteo <matteo@yuno.malio.fr> Co-committed-by: Matteo <matteo@yuno.malio.fr>
This commit was merged in pull request #32.
This commit is contained in:
@@ -51,7 +51,7 @@ Ajouter dans le fichier .env du frontend
|
|||||||
* Creation page admin ajout/modification bovins
|
* Creation page admin ajout/modification bovins
|
||||||
* [#331] Mettre à jour l'entité Shipment et bovin_shipment
|
* [#331] Mettre à jour l'entité Shipment et bovin_shipment
|
||||||
* [#278] Plan du site
|
* [#278] Plan du site
|
||||||
|
* [#334] Correctifs
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -8,11 +8,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
type="submit"
|
type="submit"
|
||||||
:disabled="isLoading"
|
:disabled="isLoading"
|
||||||
>
|
>
|
||||||
{{ props.address? "Sauvegarder" : "Ajouter" }}
|
<Icon :name="props.address ? 'mdi:check' : 'mdi:plus'" size="28" />
|
||||||
|
{{ props.address? "Valider" : "Ajouter" }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -22,7 +23,7 @@
|
|||||||
<UiTextInput id="address-street2" v-model="form.street2" label="Complément" />
|
<UiTextInput id="address-street2" v-model="form.street2" label="Complément" />
|
||||||
<UiTextInput id="address-postalCode" v-model="form.postalCode" label="Code postal" />
|
<UiTextInput id="address-postalCode" v-model="form.postalCode" label="Code postal" />
|
||||||
<UiTextInput id="address-city" v-model="form.city" label="Ville" />
|
<UiTextInput id="address-city" v-model="form.city" label="Ville" />
|
||||||
<UiTextInput id="address-country" v-model="form.countryCode" label="Pays" />
|
<UiTextInput id="address-country" v-model="form.countryCode" label="Pays (code)" />
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -27,11 +27,14 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<div class="flex justify-center">
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
<UiButton
|
||||||
|
type="submit"
|
||||||
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px] justify-self-end"
|
||||||
@click="goNext"
|
@click="goNext"
|
||||||
>Valider
|
>Valider
|
||||||
</button>
|
</UiButton>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|||||||
@@ -64,11 +64,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<div class="flex justify-center">
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
<UiButton
|
||||||
|
type="submit"
|
||||||
|
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px] justify-self-end"
|
||||||
@click="goNext"
|
@click="goNext"
|
||||||
>Valider
|
>Valider
|
||||||
</button>
|
</UiButton>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
<!-- Plaque d'immatriculation (hors LIOT) -->
|
<!-- Plaque d'immatriculation (hors LIOT) -->
|
||||||
<div v-if="!isLiotCarrier" class="col-start-2 row-start-4">
|
<div v-if="!isLiotCarrier" class="col-start-2 row-start-4">
|
||||||
<UiLicensePlateInput
|
<UiLicensePlateInput
|
||||||
v-model="form.licencePlate"
|
v-model="form.licensePlate"
|
||||||
v-model:allowAny="allowAnyLicensePlate"
|
v-model:allowAny="allowAnyLicensePlate"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -193,7 +193,7 @@ const form = reactive<ShipmentFormData>({
|
|||||||
carrierId: '',
|
carrierId: '',
|
||||||
driverId: '',
|
driverId: '',
|
||||||
vehicleId: '',
|
vehicleId: '',
|
||||||
licencePlate: '',
|
licensePlate: '',
|
||||||
})
|
})
|
||||||
// Adresses liées au client sélectionné
|
// Adresses liées au client sélectionné
|
||||||
const customerAddresses = computed<AddressData[]>(() => {
|
const customerAddresses = computed<AddressData[]>(() => {
|
||||||
@@ -315,7 +315,7 @@ watch(
|
|||||||
() => shipmentStore.current,
|
() => shipmentStore.current,
|
||||||
(shipment) => {
|
(shipment) => {
|
||||||
isHydrating.value = true
|
isHydrating.value = true
|
||||||
form.licencePlate = shipment?.licencePlate ?? ''
|
form.licensePlate = shipment?.licensePlate ?? ''
|
||||||
form.shipmentDate = shipment?.shipmentDate ?? new Date().toISOString().slice(0, 10)
|
form.shipmentDate = shipment?.shipmentDate ?? new Date().toISOString().slice(0, 10)
|
||||||
form.userId = shipment?.user?.id ? String(shipment.user.id) :
|
form.userId = shipment?.user?.id ? String(shipment.user.id) :
|
||||||
form.userId
|
form.userId
|
||||||
@@ -441,19 +441,19 @@ watch(
|
|||||||
(vehicle) => String(vehicle.id) === form.vehicleId
|
(vehicle) => String(vehicle.id) === form.vehicleId
|
||||||
)
|
)
|
||||||
if (selected) {
|
if (selected) {
|
||||||
form.licencePlate = selected.plate
|
form.licensePlate = selected.plate
|
||||||
allowAnyLicensePlate.value = false
|
allowAnyLicensePlate.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
watch(
|
watch(
|
||||||
() => [form.licencePlate, form.carrierId, vehicles.value],
|
() => [form.licensePlate, form.carrierId, vehicles.value],
|
||||||
() => {
|
() => {
|
||||||
if (!isLiotCarrier.value || form.vehicleId) {
|
if (!isLiotCarrier.value || form.vehicleId) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const match = filteredVehicles.value.find(
|
const match = filteredVehicles.value.find(
|
||||||
(vehicle) => vehicle.plate === form.licencePlate
|
(vehicle) => vehicle.plate === form.licensePlate
|
||||||
)
|
)
|
||||||
if (match) {
|
if (match) {
|
||||||
form.vehicleId = String(match.id)
|
form.vehicleId = String(match.id)
|
||||||
@@ -462,7 +462,7 @@ watch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const buildPayload = () => {
|
const buildPayload = () => {
|
||||||
const normalizedLicensePlate = form.licencePlate.trim()
|
const normalizedLicensePlate = form.licensePlate.trim()
|
||||||
const normalizedShipmentDate = form.shipmentDate.trim()
|
const normalizedShipmentDate = form.shipmentDate.trim()
|
||||||
const normalizedCustomerId = form.customerId.trim()
|
const normalizedCustomerId = form.customerId.trim()
|
||||||
const normalizedTruckId = form.truckId.trim()
|
const normalizedTruckId = form.truckId.trim()
|
||||||
@@ -498,7 +498,7 @@ const buildPayload = () => {
|
|||||||
Math.trunc(rawQuantity)) : 0
|
Math.trunc(rawQuantity)) : 0
|
||||||
|
|
||||||
return {
|
return {
|
||||||
licencePlate: normalizedLicensePlate,
|
licensePlate: normalizedLicensePlate,
|
||||||
shipmentDate: normalizedShipmentDate,
|
shipmentDate: normalizedShipmentDate,
|
||||||
customer: customerIri,
|
customer: customerIri,
|
||||||
truck: truckIri,
|
truck: truckIri,
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ const printReceipt = async () => {
|
|||||||
|
|
||||||
await saveWeight()
|
await saveWeight()
|
||||||
const shipment = shipmentStore.current
|
const shipment = shipmentStore.current
|
||||||
const filename = `${shipment.identificationNumber ?? shipment.id}_${shipment.customer?.label ?? 'client'}_${shipment.licencePlate ?? 'immat'}.pdf`
|
const filename = `${shipment.identificationNumber ?? shipment.id}_${shipment.customer?.label ?? 'client'}_${shipment.licensePlate ?? 'immat'}.pdf`
|
||||||
await printPdf(`/shipments/${shipment.id}/receipt`, filename)
|
await printPdf(`/shipments/${shipment.id}/receipt`, filename)
|
||||||
|
|
||||||
// Laisse le temps a la boite de dialogue d'impression de s'ouvrir.
|
// Laisse le temps a la boite de dialogue d'impression de s'ouvrir.
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ export const useWeighingShipment = ({
|
|||||||
|
|
||||||
const displayWeight = computed(() => weightData.value?.weight ?? currentWeightEntry.value?.weight ?? null)
|
const displayWeight = computed(() => weightData.value?.weight ?? currentWeightEntry.value?.weight ?? null)
|
||||||
const displayDsd = computed(() => weightData.value?.dsd ?? currentWeightEntry.value?.dsd ?? '-')
|
const displayDsd = computed(() => weightData.value?.dsd ?? currentWeightEntry.value?.dsd ?? '-')
|
||||||
const title = computed(() => (modeShipment === 'gross' ? 'Pesée à plein' : 'Pesée à vide'))
|
const title = computed(() => (modeShipment === 'gross' ? 'Pesée à vide' : 'Pesée à plein'))
|
||||||
const showLoadingBox = computed(
|
const showLoadingBox = computed(
|
||||||
() => isFetching.value || (displayWeight.value === null && currentWeightEntry.value === null)
|
() => isFetching.value || (displayWeight.value === null && currentWeightEntry.value === null)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
<UiButton
|
<UiButton
|
||||||
type="submit"
|
type="submit"
|
||||||
:disabled="isLoading || isHydrating"
|
:disabled="isLoading || isHydrating"
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px] hover:opacity-80"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
>
|
>
|
||||||
<Icon name="mdi:check" size="28" />
|
<Icon :name="isEdit ? 'mdi:check' : 'mdi:plus'" size="28" />
|
||||||
{{ isEdit ? 'Modifier' : 'Ajouter' }}
|
{{ isEdit ? 'Valider' : 'Ajouter' }}
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,10 @@
|
|||||||
|
|
||||||
<UiButton
|
<UiButton
|
||||||
type="submit"
|
type="submit"
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px] justify-self-end"
|
class="inline-flex 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"
|
||||||
>Enregistrer
|
>
|
||||||
|
<Icon name="mdi:check" size="28" />
|
||||||
|
Valider
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -52,10 +54,6 @@ const form = reactive<CarrierFormData>({
|
|||||||
name:''
|
name:''
|
||||||
})
|
})
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
layout: 'default'
|
|
||||||
})
|
|
||||||
|
|
||||||
const hydrateFromUser = (carrier: CarrierData | null) => {
|
const hydrateFromUser = (carrier: CarrierData | null) => {
|
||||||
if (!carrier) {
|
if (!carrier) {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<h1 class="text-3xl font-bold uppercase text-primary-500">listes des transporteurs</h1>
|
<h1 class="text-3xl font-bold uppercase text-primary-500">listes des transporteurs</h1>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
to="/admin/carrier"
|
to="/admin/carrier"
|
||||||
class="inline-flex items-center justify-center gap-2 text-xl uppercase bg-primary-500 text-white h-[50px] px-8 rounded"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
>
|
>
|
||||||
<Icon name="mdi:plus" size="28" />
|
<Icon name="mdi:plus" size="28" />
|
||||||
Ajouter
|
Ajouter
|
||||||
@@ -43,10 +43,6 @@ const goToCarrier = (id: number) => {
|
|||||||
router.push(`/admin/carrier/${id}`)
|
router.push(`/admin/carrier/${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
definePageMeta({
|
|
||||||
layout: 'default'
|
|
||||||
})
|
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
carrierList.value = await getCarrierList(false)
|
carrierList.value = await getCarrierList(false)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,11 +6,12 @@
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<UiButton
|
<UiButton
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
type="submit"
|
type="submit"
|
||||||
:disabled="isLoading || !auth.isAdmin"
|
:disabled="isLoading || !auth.isAdmin"
|
||||||
>
|
>
|
||||||
{{ customerId ? "Sauvegarder" : "Ajouter" }}
|
<Icon :name="customerId ? 'mdi:check' : 'mdi:plus'" size="28" />
|
||||||
|
{{ customerId ? "Valider" : "Ajouter" }}
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -25,10 +26,11 @@
|
|||||||
<h2 class="text-3xl font-bold uppercase">Adresses client</h2>
|
<h2 class="text-3xl font-bold uppercase">Adresses client</h2>
|
||||||
<UiButton
|
<UiButton
|
||||||
type="button"
|
type="button"
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
:disabled="customerId === null || !auth.isAdmin"
|
:disabled="customerId === null || !auth.isAdmin"
|
||||||
@click="goToAddAddress"
|
@click="goToAddAddress"
|
||||||
>
|
>
|
||||||
|
<Icon name="mdi:plus" size="28" />
|
||||||
Ajouter
|
Ajouter
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,8 +82,6 @@ import {createCustomer, getCustomer, updateCustomer} from "~/services/customer"
|
|||||||
import type {CustomerData, CustomerFormData, CustomerPayload} from "~/services/dto/customer-data"
|
import type {CustomerData, CustomerFormData, CustomerPayload} from "~/services/dto/customer-data"
|
||||||
import {useAuthStore} from "~/stores/auth"
|
import {useAuthStore} from "~/stores/auth"
|
||||||
|
|
||||||
definePageMeta({layout: "default"})
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import { createAddress, getAddress, updateAddress } from "~/services/address"
|
|||||||
import { getCustomer, updateCustomer } from "~/services/customer"
|
import { getCustomer, updateCustomer } from "~/services/customer"
|
||||||
import type { CustomerData } from "~/services/dto/customer-data"
|
import type { CustomerData } from "~/services/dto/customer-data"
|
||||||
|
|
||||||
definePageMeta({ layout: "default" })
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const customerId = computed(() => Number(route.query.customerId))
|
const customerId = computed(() => Number(route.query.customerId))
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<h1 class="text-3xl font-bold uppercase text-primary-500">Liste des Clients</h1>
|
<h1 class="text-3xl font-bold uppercase text-primary-500">Liste des Clients</h1>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
to="/admin/customer"
|
to="/admin/customer"
|
||||||
class="inline-flex items-center justify-center gap-2 text-xl uppercase bg-primary-500 text-white h-[50px] px-8 rounded-md"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
:class="auth.isAdmin ? '' : 'cursor-not-allowed opacity-60'"
|
:class="auth.isAdmin ? '' : 'cursor-not-allowed opacity-60'"
|
||||||
@click="handleAddClick"
|
@click="handleAddClick"
|
||||||
>
|
>
|
||||||
@@ -94,8 +94,6 @@ import { getCustomerList } from "~/services/customer"
|
|||||||
import type { CustomerData } from "~/services/dto/customer-data"
|
import type { CustomerData } from "~/services/dto/customer-data"
|
||||||
import { useAuthStore } from "~/stores/auth"
|
import { useAuthStore } from "~/stores/auth"
|
||||||
|
|
||||||
definePageMeta({ layout: "default" })
|
|
||||||
|
|
||||||
const customerList = ref<CustomerData[]>([])
|
const customerList = ref<CustomerData[]>([])
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
<template>
|
|
||||||
</template>
|
|
||||||
<script setup lang="ts">
|
|
||||||
definePageMeta({
|
|
||||||
layout: 'default'
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
@@ -6,11 +6,12 @@
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<UiButton
|
<UiButton
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
type="submit"
|
type="submit"
|
||||||
:disabled="isLoading || !auth.isAdmin"
|
:disabled="isLoading || !auth.isAdmin"
|
||||||
>
|
>
|
||||||
{{ supplierId ? "Sauvegarder" : "Ajouter" }}
|
<Icon :name="supplierId ? 'mdi:check' : 'mdi:plus'" size="28" />
|
||||||
|
{{ supplierId ? "Valider" : "Ajouter" }}
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -25,10 +26,11 @@
|
|||||||
<h2 class="text-3xl font-bold uppercase">Adresses fournisseur</h2>
|
<h2 class="text-3xl font-bold uppercase">Adresses fournisseur</h2>
|
||||||
<UiButton
|
<UiButton
|
||||||
type="button"
|
type="button"
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
:disabled="supplierId === null || !auth.isAdmin"
|
:disabled="supplierId === null || !auth.isAdmin"
|
||||||
@click="goToAddAddress"
|
@click="goToAddAddress"
|
||||||
>
|
>
|
||||||
|
<Icon name="mdi:plus" size="28" />
|
||||||
Ajouter
|
Ajouter
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,8 +82,6 @@ import {createSupplier, getSupplier, updateSupplier} from "~/services/supplier"
|
|||||||
import type {SupplierData, SupplierFormData, SupplierPayload} from "~/services/dto/supplier-data"
|
import type {SupplierData, SupplierFormData, SupplierPayload} from "~/services/dto/supplier-data"
|
||||||
import {useAuthStore} from "~/stores/auth"
|
import {useAuthStore} from "~/stores/auth"
|
||||||
|
|
||||||
definePageMeta({layout: "default"})
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import {createAddress, getAddress, updateAddress} from "~/services/address";
|
|||||||
import {getSupplier, updateSupplier} from "~/services/supplier";
|
import {getSupplier, updateSupplier} from "~/services/supplier";
|
||||||
import type {SupplierData} from "~/services/dto/supplier-data";
|
import type {SupplierData} from "~/services/dto/supplier-data";
|
||||||
|
|
||||||
definePageMeta({ layout: "default" })
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const supplierId = computed(() => { return Number(route.query.supplierId) })
|
const supplierId = computed(() => { return Number(route.query.supplierId) })
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<h1 class="text-3xl font-bold uppercase text-primary-500">Liste des fournisseurs</h1>
|
<h1 class="text-3xl font-bold uppercase text-primary-500">Liste des fournisseurs</h1>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
to="/admin/supplier"
|
to="/admin/supplier"
|
||||||
class="inline-flex items-center justify-center gap-2 text-xl uppercase bg-primary-500 text-white h-[50px] px-8 rounded"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
:class="auth.isAdmin ? '' : 'cursor-not-allowed opacity-60'"
|
:class="auth.isAdmin ? '' : 'cursor-not-allowed opacity-60'"
|
||||||
@click="handleAddClick"
|
@click="handleAddClick"
|
||||||
>
|
>
|
||||||
@@ -90,8 +90,6 @@ import { getSupplierList } from "~/services/supplier"
|
|||||||
import type { SupplierData } from "~/services/dto/supplier-data"
|
import type { SupplierData } from "~/services/dto/supplier-data"
|
||||||
import { useAuthStore } from "~/stores/auth"
|
import { useAuthStore } from "~/stores/auth"
|
||||||
|
|
||||||
definePageMeta({ layout: "default" })
|
|
||||||
|
|
||||||
const supplierList = ref<SupplierData[]>([])
|
const supplierList = ref<SupplierData[]>([])
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
|
|||||||
@@ -6,10 +6,11 @@
|
|||||||
{{ userId ? "Modifications de l'utilisateur" : "Ajout d'un utilisateur" }}
|
{{ userId ? "Modifications de l'utilisateur" : "Ajout d'un utilisateur" }}
|
||||||
</h1>
|
</h1>
|
||||||
<UiButton
|
<UiButton
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px]"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
type="submit"
|
type="submit"
|
||||||
>
|
>
|
||||||
{{ userId ? 'Sauvegarder' : 'Ajouter' }}
|
<Icon :name="userId ? 'mdi:check' : 'mdi:plus'" size="28" />
|
||||||
|
{{ userId ? 'Valider' : 'Ajouter' }}
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -38,10 +39,6 @@
|
|||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
definePageMeta({
|
|
||||||
layout: 'default'
|
|
||||||
})
|
|
||||||
|
|
||||||
import {computed, reactive, ref, watch} from 'vue'
|
import {computed, reactive, ref, watch} from 'vue'
|
||||||
import {ROLE} from '~/utils/constants'
|
import {ROLE} from '~/utils/constants'
|
||||||
import {createUser, updateUser, getUser} from '~/services/auth'
|
import {createUser, updateUser, getUser} from '~/services/auth'
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<h1 class="text-3xl font-bold uppercase text-primary-500">Liste des utilisateurs</h1>
|
<h1 class="text-3xl font-bold uppercase text-primary-500">Liste des utilisateurs</h1>
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
class="inline-flex items-center justify-center gap-2 text-xl uppercase bg-primary-500 text-white h-[50px] px-8 rounded-md"
|
to="/admin/user"
|
||||||
@click="router.push('/admin/user/')"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2"
|
||||||
>
|
>
|
||||||
<Icon name="mdi:plus" size="28" />
|
<Icon name="mdi:plus" size="28" />
|
||||||
Ajouter
|
Ajouter
|
||||||
@@ -38,10 +38,6 @@
|
|||||||
|
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
definePageMeta({
|
|
||||||
layout: 'default'
|
|
||||||
})
|
|
||||||
|
|
||||||
import type {UserData} from "~/services/dto/user-data";
|
import type {UserData} from "~/services/dto/user-data";
|
||||||
import {getAdminUsers} from "~/services/auth";
|
import {getAdminUsers} from "~/services/auth";
|
||||||
import {ROLE} from "~/utils/constants";
|
import {ROLE} from "~/utils/constants";
|
||||||
|
|||||||
@@ -118,10 +118,10 @@
|
|||||||
<UiButton
|
<UiButton
|
||||||
v-if="auth.isAdmin"
|
v-if="auth.isAdmin"
|
||||||
type="submit"
|
type="submit"
|
||||||
class="text-xl uppercase bg-primary-500 text-white h-[50px] w-[272px] mb-16"
|
class="inline-flex items-center justify-center text-xl text-white uppercase bg-primary-500 h-[50px] px-8 rounded hover:opacity-80 gap-2 mb-16"
|
||||||
|
|
||||||
>
|
>
|
||||||
Enregistrer
|
<Icon name="mdi:check" size="28" />
|
||||||
|
Valider
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-evenly gap-y-8 gap-x-40 mb-8 border-b border-slate-400">
|
<div class="flex justify-evenly gap-y-8 gap-x-40 mb-8 border-b border-slate-400">
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ shipment.carrier?.name }}</div>
|
<div>{{ shipment.carrier?.name }}</div>
|
||||||
<div>{{ shipment.licencePlate }}</div>
|
<div>{{ shipment.licensePlate }}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ export interface ShipmentTypeData {
|
|||||||
export type ShipmentData = {
|
export type ShipmentData = {
|
||||||
id: number
|
id: number
|
||||||
identificationNumber?: string | null
|
identificationNumber?: string | null
|
||||||
licencePlate: string | null
|
licensePlate: string | null
|
||||||
shipmentDate: string
|
shipmentDate: string
|
||||||
currentStep: number
|
currentStep: number
|
||||||
isValid: boolean
|
isValid: boolean
|
||||||
@@ -43,11 +43,11 @@ export type ShipmentFormData = {
|
|||||||
carrierId: string,
|
carrierId: string,
|
||||||
driverId: string,
|
driverId: string,
|
||||||
vehicleId: string,
|
vehicleId: string,
|
||||||
licencePlate: string,
|
licensePlate: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ShipmentPayload = {
|
export type ShipmentPayload = {
|
||||||
licencePlate?: string | null
|
licensePlate?: string | null
|
||||||
shipmentDate?: string
|
shipmentDate?: string
|
||||||
currentStep?: number
|
currentStep?: number
|
||||||
isValid?: boolean
|
isValid?: boolean
|
||||||
|
|||||||
26
migrations/Version20260225110000.php
Normal file
26
migrations/Version20260225110000.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
final class Version20260225110000 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Rename shipment.licence_plate to license_plate';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE shipment RENAME COLUMN licence_plate TO license_plate');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE shipment RENAME COLUMN license_plate TO licence_plate');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -80,7 +80,7 @@ class Shipment
|
|||||||
|
|
||||||
#[ORM\Column(length: 255)]
|
#[ORM\Column(length: 255)]
|
||||||
#[Groups(['shipment:read', 'shipment:write'])]
|
#[Groups(['shipment:read', 'shipment:write'])]
|
||||||
private ?string $licencePlate = null;
|
private ?string $licensePlate = null;
|
||||||
|
|
||||||
#[ORM\Column(length: 20, unique: true, nullable: true)]
|
#[ORM\Column(length: 20, unique: true, nullable: true)]
|
||||||
#[Groups(['shipment:read'])]
|
#[Groups(['shipment:read'])]
|
||||||
@@ -162,14 +162,14 @@ class Shipment
|
|||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLicencePlate(): ?string
|
public function getLicensePlate(): ?string
|
||||||
{
|
{
|
||||||
return $this->licencePlate;
|
return $this->licensePlate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLicencePlate(?string $licencePlate): void
|
public function setLicensePlate(?string $licensePlate): void
|
||||||
{
|
{
|
||||||
$this->licencePlate = $licencePlate;
|
$this->licensePlate = $licensePlate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getIdentificationNumber(): ?string
|
public function getIdentificationNumber(): ?string
|
||||||
|
|||||||
@@ -275,7 +275,7 @@
|
|||||||
<div class="meta">
|
<div class="meta">
|
||||||
<p>Transporteur : {{ shipment.carrier ? shipment.carrier.name : '-' }}</p>
|
<p>Transporteur : {{ shipment.carrier ? shipment.carrier.name : '-' }}</p>
|
||||||
<p>Mode d'expédition : {{ shipment.truck ? shipment.truck.name : '-' }}</p>
|
<p>Mode d'expédition : {{ shipment.truck ? shipment.truck.name : '-' }}</p>
|
||||||
<p>Immatriculation : {{ shipment.licencePlate ?? '-' }}</p>
|
<p>Immatriculation : {{ shipment.licensePlate ?? '-' }}</p>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user