fix : order navbar + modification création fournisseur et client
This commit is contained in:
Generated
+17
-14
@@ -4,9 +4,12 @@
|
|||||||
<option name="autoReloadType" value="SELECTIVE" />
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="feat : ajout de l'api de l'état pour chercher les villes via le CP">
|
<list default="true" id="7c107abe-5995-4428-8429-b146aaca8386" name="Changes" comment="fix : script de déploiement + CI/CD build de l'app">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/scripts/deploy-release.sh" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/deploy-release.sh" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/config/reference.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/reference.php" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/frontend/layouts/default.vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/layouts/default.vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/frontend/pages/admin/customer/[[id]].vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/pages/admin/customer/[[id]].vue" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/frontend/pages/admin/supplier/[[id]].vue" beforeDir="false" afterPath="$PROJECT_DIR$/frontend/pages/admin/supplier/[[id]].vue" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
@@ -321,15 +324,7 @@
|
|||||||
<workItem from="1773215356754" duration="5754000" />
|
<workItem from="1773215356754" duration="5754000" />
|
||||||
<workItem from="1773756072697" duration="5450000" />
|
<workItem from="1773756072697" duration="5450000" />
|
||||||
<workItem from="1773766075191" duration="6202000" />
|
<workItem from="1773766075191" duration="6202000" />
|
||||||
<workItem from="1773824491213" duration="16281000" />
|
<workItem from="1773824491213" duration="20110000" />
|
||||||
</task>
|
|
||||||
<task id="LOCAL-00026" summary="fix : doc de déploiement">
|
|
||||||
<option name="closed" value="true" />
|
|
||||||
<created>1769094376813</created>
|
|
||||||
<option name="number" value="00026" />
|
|
||||||
<option name="presentableId" value="LOCAL-00026" />
|
|
||||||
<option name="project" value="LOCAL" />
|
|
||||||
<updated>1769094376813</updated>
|
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00027" summary="fix : doc et script de déploiement">
|
<task id="LOCAL-00027" summary="fix : doc et script de déploiement">
|
||||||
<option name="closed" value="true" />
|
<option name="closed" value="true" />
|
||||||
@@ -715,7 +710,15 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1773842791819</updated>
|
<updated>1773842791819</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="75" />
|
<task id="LOCAL-00075" summary="fix : script de déploiement + CI/CD build de l'app">
|
||||||
|
<option name="closed" value="true" />
|
||||||
|
<created>1773843922376</created>
|
||||||
|
<option name="number" value="00075" />
|
||||||
|
<option name="presentableId" value="LOCAL-00075" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1773843922377</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="76" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@@ -765,7 +768,6 @@
|
|||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="feat : ajout de colonne pour les Supplier, Address. Modification du numéro de réception et ajout de fixtures" />
|
|
||||||
<MESSAGE value="feat : mise à jour du bon de réception" />
|
<MESSAGE value="feat : mise à jour du bon de réception" />
|
||||||
<MESSAGE value="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)" />
|
<MESSAGE value="feat : Ajout de la sélection des bovins étape 3 d'une réception (WIP)" />
|
||||||
<MESSAGE value="feat : creer une nouvelle expedtion (WIP)" />
|
<MESSAGE value="feat : creer une nouvelle expedtion (WIP)" />
|
||||||
@@ -790,7 +792,8 @@
|
|||||||
<MESSAGE value="fix : on ne pèse plus automatiquement + fix message de création réception" />
|
<MESSAGE value="fix : on ne pèse plus automatiquement + fix message de création réception" />
|
||||||
<MESSAGE value="fix : correction des retours de la V0" />
|
<MESSAGE value="fix : correction des retours de la V0" />
|
||||||
<MESSAGE value="feat : ajout de l'api de l'état pour chercher les villes via le CP" />
|
<MESSAGE value="feat : ajout de l'api de l'état pour chercher les villes via le CP" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="feat : ajout de l'api de l'état pour chercher les villes via le CP" />
|
<MESSAGE value="fix : script de déploiement + CI/CD build de l'app" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="fix : script de déploiement + CI/CD build de l'app" />
|
||||||
</component>
|
</component>
|
||||||
<component name="XDebuggerManager">
|
<component name="XDebuggerManager">
|
||||||
<breakpoint-manager>
|
<breakpoint-manager>
|
||||||
|
|||||||
@@ -72,23 +72,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
|
||||||
<NuxtLink
|
|
||||||
v-if="auth.isAdmin"
|
|
||||||
to="/admin/carrier/carrier-list"
|
|
||||||
custom
|
|
||||||
v-slot="{ href, navigate }"
|
|
||||||
>
|
|
||||||
<a
|
|
||||||
:href="href"
|
|
||||||
@click="navigate"
|
|
||||||
:class="route.path.startsWith('/admin/carrier')
|
|
||||||
? 'opacity-100'
|
|
||||||
: 'opacity-65 hover:opacity-100 transition'"
|
|
||||||
>
|
|
||||||
Transporteurs
|
|
||||||
</a>
|
|
||||||
</NuxtLink>
|
|
||||||
|
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-if="auth.isAdmin"
|
v-if="auth.isAdmin"
|
||||||
to="/admin/customer/customer-list"
|
to="/admin/customer/customer-list"
|
||||||
@@ -106,6 +89,23 @@
|
|||||||
</a>
|
</a>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
|
|
||||||
|
<NuxtLink
|
||||||
|
v-if="auth.isAdmin"
|
||||||
|
to="/admin/carrier/carrier-list"
|
||||||
|
custom
|
||||||
|
v-slot="{ href, navigate }"
|
||||||
|
>
|
||||||
|
<a
|
||||||
|
:href="href"
|
||||||
|
@click="navigate"
|
||||||
|
:class="route.path.startsWith('/admin/carrier')
|
||||||
|
? 'opacity-100'
|
||||||
|
: 'opacity-65 hover:opacity-100 transition'"
|
||||||
|
>
|
||||||
|
Transporteurs
|
||||||
|
</a>
|
||||||
|
</NuxtLink>
|
||||||
|
|
||||||
<NuxtLink
|
<NuxtLink
|
||||||
v-if="auth.isAdmin"
|
v-if="auth.isAdmin"
|
||||||
to="/admin/bovin/bovin-list"
|
to="/admin/bovin/bovin-list"
|
||||||
|
|||||||
@@ -14,6 +14,19 @@
|
|||||||
<UiTextInput id="customer-phone" v-model="form.phone" label="Téléphone" :disabled="!auth.isAdmin" wrapper-class="w-[280px]" required/>
|
<UiTextInput id="customer-phone" v-model="form.phone" label="Téléphone" :disabled="!auth.isAdmin" wrapper-class="w-[280px]" required/>
|
||||||
<UiTextInput id="customer-email" v-model="form.email" label="Email" :disabled="!auth.isAdmin" wrapper-class="w-[280px]"/>
|
<UiTextInput id="customer-email" v-model="form.email" label="Email" :disabled="!auth.isAdmin" wrapper-class="w-[280px]"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="!customerId" class="flex flex-cols-3 justify-between mb-11">
|
||||||
|
<UiTextInput id="address-street" v-model="addressForm.street" label="Rue" wrapper-class="w-[280px]" required />
|
||||||
|
<UiTextInput id="address-street2" v-model="addressForm.street2" label="Complément" wrapper-class="w-[280px]" />
|
||||||
|
<UiTextInput id="address-country" v-model="addressForm.countryCode" label="Pays (code)" wrapper-class="w-[280px]" />
|
||||||
|
</div>
|
||||||
|
<div v-if="!customerId" class="flex flex-cols-3 justify-between mb-11">
|
||||||
|
<UiTextInput id="address-postalCode" v-model="addressForm.postalCode" label="Code postal" wrapper-class="w-[280px]" required />
|
||||||
|
<UiSelect id="address-city" v-model="addressForm.city" label="Ville"
|
||||||
|
:options="communeOptions" :loading="isLoadingCities"
|
||||||
|
wrapper-class="w-[280px]" required />
|
||||||
|
<div class="w-[280px]" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<UiButton
|
<UiButton
|
||||||
class="inline-flex mb-28 items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
|
class="inline-flex mb-28 items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
|
||||||
@@ -26,6 +39,7 @@
|
|||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<template v-if="customerId">
|
||||||
<div class="flex items-center justify-between mb-7">
|
<div class="flex items-center justify-between mb-7">
|
||||||
<h2 class="text-3xl text-primary-500 font-bold uppercase">Adresses du client</h2>
|
<h2 class="text-3xl text-primary-500 font-bold uppercase">Adresses du client</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -77,6 +91,7 @@
|
|||||||
Ajouter
|
Ajouter
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -84,6 +99,8 @@
|
|||||||
import {computed, reactive, ref, watch} from "vue"
|
import {computed, reactive, ref, watch} from "vue"
|
||||||
import {createCustomer, getCustomer, updateCustomer} from "~/services/customer"
|
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 {createAddress, type AddressPayload} from "~/services/address"
|
||||||
|
import {getCommunesByPostalCode, type CommuneData} from "~/services/geo"
|
||||||
import {useAuthStore} from "~/stores/auth"
|
import {useAuthStore} from "~/stores/auth"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -106,6 +123,30 @@ const form = reactive<CustomerFormData>({
|
|||||||
addresses: [],
|
addresses: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Address form (creation mode only)
|
||||||
|
const addressForm = reactive<AddressPayload>({
|
||||||
|
street: "", street2: null, postalCode: "", city: "", countryCode: "FR",
|
||||||
|
})
|
||||||
|
const communes = ref<CommuneData[]>([])
|
||||||
|
const isLoadingCities = ref(false)
|
||||||
|
const communeOptions = computed(() => communes.value.map(c => ({ value: c.nom, label: c.nom })))
|
||||||
|
|
||||||
|
let debounceTimer: ReturnType<typeof setTimeout> | null = null
|
||||||
|
watch(() => addressForm.postalCode, (cp) => {
|
||||||
|
if (debounceTimer) clearTimeout(debounceTimer)
|
||||||
|
if (!cp || cp.length < 5) { communes.value = []; addressForm.city = ''; return }
|
||||||
|
if (cp.length === 5) {
|
||||||
|
debounceTimer = setTimeout(async () => {
|
||||||
|
isLoadingCities.value = true
|
||||||
|
try {
|
||||||
|
communes.value = await getCommunesByPostalCode(cp)
|
||||||
|
if (communes.value.length === 1) addressForm.city = communes.value[0].nom
|
||||||
|
else addressForm.city = ''
|
||||||
|
} finally { isLoadingCities.value = false }
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const goToAddAddress = () => {
|
const goToAddAddress = () => {
|
||||||
if (customerId.value === null || !auth.isAdmin) return
|
if (customerId.value === null || !auth.isAdmin) return
|
||||||
router.push({
|
router.push({
|
||||||
@@ -187,8 +228,11 @@ async function validate() {
|
|||||||
await updateCustomer(customerId.value, customerPayload)
|
await updateCustomer(customerId.value, customerPayload)
|
||||||
targetId = customerId.value
|
targetId = customerId.value
|
||||||
} else {
|
} else {
|
||||||
|
const addressData = await createAddress({ ...addressForm })
|
||||||
|
const addressIRI = `/api/addresses/${addressData.id}`
|
||||||
const creationPayload = {
|
const creationPayload = {
|
||||||
...customerPayload,
|
...customerPayload,
|
||||||
|
addresses: [addressIRI],
|
||||||
...(auth.user?.id ? { createdBy: `/api/users/${auth.user.id}` } : {}),
|
...(auth.user?.id ? { createdBy: `/api/users/${auth.user.id}` } : {}),
|
||||||
}
|
}
|
||||||
const created = await createCustomer(creationPayload)
|
const created = await createCustomer(creationPayload)
|
||||||
|
|||||||
@@ -15,6 +15,19 @@
|
|||||||
<UiTextInput id="supplier-phone" v-model="form.phone" label="Téléphone" :disabled="!auth.isAdmin" wrapper-class="w-[280px]" required/>
|
<UiTextInput id="supplier-phone" v-model="form.phone" label="Téléphone" :disabled="!auth.isAdmin" wrapper-class="w-[280px]" required/>
|
||||||
<UiTextInput id="supplier-email" v-model="form.email" label="Email" :disabled="!auth.isAdmin" wrapper-class="w-[280px]"/>
|
<UiTextInput id="supplier-email" v-model="form.email" label="Email" :disabled="!auth.isAdmin" wrapper-class="w-[280px]"/>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="!supplierId" class="flex flex-cols-3 justify-between mb-11">
|
||||||
|
<UiTextInput id="address-street" v-model="addressForm.street" label="Rue" wrapper-class="w-[280px]" required />
|
||||||
|
<UiTextInput id="address-street2" v-model="addressForm.street2" label="Complément" wrapper-class="w-[280px]" />
|
||||||
|
<UiTextInput id="address-country" v-model="addressForm.countryCode" label="Pays (code)" wrapper-class="w-[280px]" />
|
||||||
|
</div>
|
||||||
|
<div v-if="!supplierId" class="flex flex-cols-3 justify-between mb-11">
|
||||||
|
<UiTextInput id="address-postalCode" v-model="addressForm.postalCode" label="Code postal" wrapper-class="w-[280px]" required />
|
||||||
|
<UiSelect id="address-city" v-model="addressForm.city" label="Ville"
|
||||||
|
:options="communeOptions" :loading="isLoadingCities"
|
||||||
|
wrapper-class="w-[280px]" required />
|
||||||
|
<div class="w-[280px]" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<UiButton
|
<UiButton
|
||||||
class="inline-flex mb-28 items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
|
class="inline-flex mb-28 items-center justify-center text-xl min-w-[194px] text-white uppercase bg-primary-500 h-[50px] rounded hover:opacity-80 justify-self-end"
|
||||||
@@ -27,6 +40,7 @@
|
|||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<template v-if="supplierId">
|
||||||
<div class="flex items-center justify-between mb-7">
|
<div class="flex items-center justify-between mb-7">
|
||||||
<h2 class="text-3xl text-primary-500 font-bold uppercase">Adresses du fournisseur</h2>
|
<h2 class="text-3xl text-primary-500 font-bold uppercase">Adresses du fournisseur</h2>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,6 +92,7 @@
|
|||||||
Ajouter
|
Ajouter
|
||||||
</UiButton>
|
</UiButton>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
</form>
|
</form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -85,6 +100,8 @@
|
|||||||
import {computed, reactive, ref, watch} from "vue"
|
import {computed, reactive, ref, watch} from "vue"
|
||||||
import {createSupplier, getSupplier, updateSupplier} from "~/services/supplier"
|
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 {createAddress, type AddressPayload} from "~/services/address"
|
||||||
|
import {getCommunesByPostalCode, type CommuneData} from "~/services/geo"
|
||||||
import {useAuthStore} from "~/stores/auth"
|
import {useAuthStore} from "~/stores/auth"
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
@@ -107,6 +124,30 @@ const form = reactive<SupplierFormData>({
|
|||||||
addresses: [],
|
addresses: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Address form (creation mode only)
|
||||||
|
const addressForm = reactive<AddressPayload>({
|
||||||
|
street: "", street2: null, postalCode: "", city: "", countryCode: "FR",
|
||||||
|
})
|
||||||
|
const communes = ref<CommuneData[]>([])
|
||||||
|
const isLoadingCities = ref(false)
|
||||||
|
const communeOptions = computed(() => communes.value.map(c => ({ value: c.nom, label: c.nom })))
|
||||||
|
|
||||||
|
let debounceTimer: ReturnType<typeof setTimeout> | null = null
|
||||||
|
watch(() => addressForm.postalCode, (cp) => {
|
||||||
|
if (debounceTimer) clearTimeout(debounceTimer)
|
||||||
|
if (!cp || cp.length < 5) { communes.value = []; addressForm.city = ''; return }
|
||||||
|
if (cp.length === 5) {
|
||||||
|
debounceTimer = setTimeout(async () => {
|
||||||
|
isLoadingCities.value = true
|
||||||
|
try {
|
||||||
|
communes.value = await getCommunesByPostalCode(cp)
|
||||||
|
if (communes.value.length === 1) addressForm.city = communes.value[0].nom
|
||||||
|
else addressForm.city = ''
|
||||||
|
} finally { isLoadingCities.value = false }
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const goToAddAddress = () => {
|
const goToAddAddress = () => {
|
||||||
if (supplierId.value === null || !auth.isAdmin) return
|
if (supplierId.value === null || !auth.isAdmin) return
|
||||||
router.push({
|
router.push({
|
||||||
@@ -190,8 +231,11 @@ async function validate() {
|
|||||||
await updateSupplier(supplierId.value, supplierPayload)
|
await updateSupplier(supplierId.value, supplierPayload)
|
||||||
targetId = supplierId.value
|
targetId = supplierId.value
|
||||||
} else {
|
} else {
|
||||||
|
const addressData = await createAddress({ ...addressForm })
|
||||||
|
const addressIRI = `/api/addresses/${addressData.id}`
|
||||||
const creationPayload = {
|
const creationPayload = {
|
||||||
...supplierPayload,
|
...supplierPayload,
|
||||||
|
addresses: [addressIRI],
|
||||||
...(auth.user?.id ? { createdBy: `/api/users/${auth.user.id}` } : {}),
|
...(auth.user?.id ? { createdBy: `/api/users/${auth.user.id}` } : {}),
|
||||||
}
|
}
|
||||||
const created = await createSupplier(creationPayload)
|
const created = await createSupplier(creationPayload)
|
||||||
|
|||||||
Reference in New Issue
Block a user