feat(directory) : open detail page on row click, drop inline address from drawers
This commit is contained in:
@@ -21,21 +21,6 @@
|
|||||||
label="Téléphone"
|
label="Téléphone"
|
||||||
input-class="w-full"
|
input-class="w-full"
|
||||||
/>
|
/>
|
||||||
<MalioInputText
|
|
||||||
v-model="form.street"
|
|
||||||
label="Rue"
|
|
||||||
input-class="w-full"
|
|
||||||
/>
|
|
||||||
<MalioInputText
|
|
||||||
v-model="form.city"
|
|
||||||
label="Ville"
|
|
||||||
input-class="w-full"
|
|
||||||
/>
|
|
||||||
<MalioInputText
|
|
||||||
v-model="form.postalCode"
|
|
||||||
label="Code Postal"
|
|
||||||
input-class="w-full"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<div class="mt-6 flex justify-end">
|
<div class="mt-6 flex justify-end">
|
||||||
<MalioButton
|
<MalioButton
|
||||||
@@ -75,9 +60,6 @@ const form = reactive({
|
|||||||
name: '',
|
name: '',
|
||||||
email: '',
|
email: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
street: '',
|
|
||||||
city: '',
|
|
||||||
postalCode: '',
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const touched = reactive({
|
const touched = reactive({
|
||||||
@@ -91,16 +73,10 @@ watch(() => props.modelValue, (open) => {
|
|||||||
form.name = props.client.name ?? ''
|
form.name = props.client.name ?? ''
|
||||||
form.email = props.client.email ?? ''
|
form.email = props.client.email ?? ''
|
||||||
form.phone = props.client.phone ?? ''
|
form.phone = props.client.phone ?? ''
|
||||||
form.street = props.client.street ?? ''
|
|
||||||
form.city = props.client.city ?? ''
|
|
||||||
form.postalCode = props.client.postalCode ?? ''
|
|
||||||
} else {
|
} else {
|
||||||
form.name = ''
|
form.name = ''
|
||||||
form.email = ''
|
form.email = ''
|
||||||
form.phone = ''
|
form.phone = ''
|
||||||
form.street = ''
|
|
||||||
form.city = ''
|
|
||||||
form.postalCode = ''
|
|
||||||
}
|
}
|
||||||
touched.name = false
|
touched.name = false
|
||||||
touched.email = false
|
touched.email = false
|
||||||
@@ -119,9 +95,6 @@ async function handleSubmit() {
|
|||||||
name: form.name.trim(),
|
name: form.name.trim(),
|
||||||
email: form.email.trim() || null,
|
email: form.email.trim() || null,
|
||||||
phone: form.phone.trim() || null,
|
phone: form.phone.trim() || null,
|
||||||
street: form.street.trim() || null,
|
|
||||||
city: form.city.trim() || null,
|
|
||||||
postalCode: form.postalCode.trim() || null,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEditing.value && props.client) {
|
if (isEditing.value && props.client) {
|
||||||
|
|||||||
@@ -26,21 +26,6 @@
|
|||||||
:label="$t('prospects.fields.phone')"
|
:label="$t('prospects.fields.phone')"
|
||||||
input-class="w-full"
|
input-class="w-full"
|
||||||
/>
|
/>
|
||||||
<MalioInputText
|
|
||||||
v-model="form.street"
|
|
||||||
:label="$t('prospects.fields.street')"
|
|
||||||
input-class="w-full"
|
|
||||||
/>
|
|
||||||
<MalioInputText
|
|
||||||
v-model="form.city"
|
|
||||||
:label="$t('prospects.fields.city')"
|
|
||||||
input-class="w-full"
|
|
||||||
/>
|
|
||||||
<MalioInputText
|
|
||||||
v-model="form.postalCode"
|
|
||||||
:label="$t('prospects.fields.postalCode')"
|
|
||||||
input-class="w-full"
|
|
||||||
/>
|
|
||||||
<MalioSelect
|
<MalioSelect
|
||||||
v-model="form.status"
|
v-model="form.status"
|
||||||
:label="$t('prospects.fields.status')"
|
:label="$t('prospects.fields.status')"
|
||||||
@@ -121,9 +106,6 @@ const form = reactive<{
|
|||||||
company: string
|
company: string
|
||||||
email: string
|
email: string
|
||||||
phone: string
|
phone: string
|
||||||
street: string
|
|
||||||
city: string
|
|
||||||
postalCode: string
|
|
||||||
status: ProspectStatus
|
status: ProspectStatus
|
||||||
source: string
|
source: string
|
||||||
notes: string
|
notes: string
|
||||||
@@ -132,9 +114,6 @@ const form = reactive<{
|
|||||||
company: '',
|
company: '',
|
||||||
email: '',
|
email: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
street: '',
|
|
||||||
city: '',
|
|
||||||
postalCode: '',
|
|
||||||
status: 'new',
|
status: 'new',
|
||||||
source: '',
|
source: '',
|
||||||
notes: '',
|
notes: '',
|
||||||
@@ -151,9 +130,6 @@ watch(() => props.modelValue, (open) => {
|
|||||||
form.company = props.prospect.company ?? ''
|
form.company = props.prospect.company ?? ''
|
||||||
form.email = props.prospect.email ?? ''
|
form.email = props.prospect.email ?? ''
|
||||||
form.phone = props.prospect.phone ?? ''
|
form.phone = props.prospect.phone ?? ''
|
||||||
form.street = props.prospect.street ?? ''
|
|
||||||
form.city = props.prospect.city ?? ''
|
|
||||||
form.postalCode = props.prospect.postalCode ?? ''
|
|
||||||
form.status = props.prospect.status ?? 'new'
|
form.status = props.prospect.status ?? 'new'
|
||||||
form.source = props.prospect.source ?? ''
|
form.source = props.prospect.source ?? ''
|
||||||
form.notes = props.prospect.notes ?? ''
|
form.notes = props.prospect.notes ?? ''
|
||||||
@@ -162,9 +138,6 @@ watch(() => props.modelValue, (open) => {
|
|||||||
form.company = ''
|
form.company = ''
|
||||||
form.email = ''
|
form.email = ''
|
||||||
form.phone = ''
|
form.phone = ''
|
||||||
form.street = ''
|
|
||||||
form.city = ''
|
|
||||||
form.postalCode = ''
|
|
||||||
form.status = 'new'
|
form.status = 'new'
|
||||||
form.source = ''
|
form.source = ''
|
||||||
form.notes = ''
|
form.notes = ''
|
||||||
@@ -186,9 +159,6 @@ async function handleSubmit() {
|
|||||||
company: form.company.trim() || null,
|
company: form.company.trim() || null,
|
||||||
email: form.email.trim() || null,
|
email: form.email.trim() || null,
|
||||||
phone: form.phone.trim() || null,
|
phone: form.phone.trim() || null,
|
||||||
street: form.street.trim() || null,
|
|
||||||
city: form.city.trim() || null,
|
|
||||||
postalCode: form.postalCode.trim() || null,
|
|
||||||
status: form.status,
|
status: form.status,
|
||||||
source: form.source.trim() || null,
|
source: form.source.trim() || null,
|
||||||
notes: form.notes.trim() || null,
|
notes: form.notes.trim() || null,
|
||||||
|
|||||||
@@ -31,9 +31,6 @@
|
|||||||
<template #cell-phone="{ item }">
|
<template #cell-phone="{ item }">
|
||||||
{{ (item as Client).phone ?? '—' }}
|
{{ (item as Client).phone ?? '—' }}
|
||||||
</template>
|
</template>
|
||||||
<template #cell-city="{ item }">
|
|
||||||
{{ (item as Client).city ?? '—' }}
|
|
||||||
</template>
|
|
||||||
</MalioDataTable>
|
</MalioDataTable>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -142,7 +139,6 @@ const clientColumns = [
|
|||||||
{ key: 'name', label: t('prospects.fields.name') },
|
{ key: 'name', label: t('prospects.fields.name') },
|
||||||
{ key: 'email', label: t('prospects.fields.email') },
|
{ key: 'email', label: t('prospects.fields.email') },
|
||||||
{ key: 'phone', label: t('prospects.fields.phone') },
|
{ key: 'phone', label: t('prospects.fields.phone') },
|
||||||
{ key: 'city', label: t('prospects.fields.city') },
|
|
||||||
]
|
]
|
||||||
|
|
||||||
async function loadClients() {
|
async function loadClients() {
|
||||||
@@ -155,8 +151,7 @@ function openCreateClient() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openEditClient(item: Record<string, unknown>) {
|
function openEditClient(item: Record<string, unknown>) {
|
||||||
selectedClient.value = item as Client
|
navigateTo(`/directory/clients/${(item as Client).id}`)
|
||||||
clientDrawerOpen.value = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Prospects ---
|
// --- Prospects ---
|
||||||
@@ -215,8 +210,7 @@ function openCreateProspect() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function openEditProspect(item: Record<string, unknown>) {
|
function openEditProspect(item: Record<string, unknown>) {
|
||||||
selectedProspect.value = item as Prospect
|
navigateTo(`/directory/prospects/${(item as Prospect).id}`)
|
||||||
prospectDrawerOpen.value = true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function convertProspect(row: ProspectRow) {
|
async function convertProspect(row: ProspectRow) {
|
||||||
|
|||||||
@@ -4,16 +4,10 @@ export type Client = {
|
|||||||
name: string
|
name: string
|
||||||
email: string | null
|
email: string | null
|
||||||
phone: string | null
|
phone: string | null
|
||||||
street: string | null
|
|
||||||
city: string | null
|
|
||||||
postalCode: string | null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ClientWrite = {
|
export type ClientWrite = {
|
||||||
name: string
|
name: string
|
||||||
email: string | null
|
email: string | null
|
||||||
phone: string | null
|
phone: string | null
|
||||||
street: string | null
|
|
||||||
city: string | null
|
|
||||||
postalCode: string | null
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ export type Prospect = {
|
|||||||
company: string | null
|
company: string | null
|
||||||
email: string | null
|
email: string | null
|
||||||
phone: string | null
|
phone: string | null
|
||||||
street: string | null
|
|
||||||
city: string | null
|
|
||||||
postalCode: string | null
|
|
||||||
status: ProspectStatus
|
status: ProspectStatus
|
||||||
source: string | null
|
source: string | null
|
||||||
notes: string | null
|
notes: string | null
|
||||||
@@ -25,9 +22,6 @@ export type ProspectWrite = {
|
|||||||
company: string | null
|
company: string | null
|
||||||
email: string | null
|
email: string | null
|
||||||
phone: string | null
|
phone: string | null
|
||||||
street: string | null
|
|
||||||
city: string | null
|
|
||||||
postalCode: string | null
|
|
||||||
status: ProspectStatus
|
status: ProspectStatus
|
||||||
source: string | null
|
source: string | null
|
||||||
notes: string | null
|
notes: string | null
|
||||||
|
|||||||
Reference in New Issue
Block a user