feat: changes

This commit is contained in:
Ron
2025-05-29 08:32:13 +03:00
parent 867ba7746d
commit b4313dd815
11 changed files with 797 additions and 46 deletions

View File

@@ -1,30 +0,0 @@
<template>
<div class="embed">
<iframe
src="https://database.portnimara.com/dashboard/#/nc/view/ebf570e4-8329-424d-a43d-a775d2169ffc"
/>
</div>
</template>
<script lang="ts" setup>
useHead({
title: "Interest List",
});
</script>
<style scoped>
.embed {
position: relative;
overflow: hidden;
width: 100%;
height: 100vh;
}
.embed iframe {
width: 100%;
height: calc(100% + 46px);
border: 0;
position: absolute;
top: -46px;
}
</style>

View File

@@ -0,0 +1,296 @@
<template>
<div>
<v-container>
<v-btn @click="router.back()" variant="text">
<v-icon icon="mdi-arrow-left"></v-icon>
Back to Contacts
</v-btn>
<v-card flat>
<v-card-text>
<v-stepper
v-model="currentStep"
class="mb-6"
variant="flat"
alt-labels
>
<v-stepper-header>
<template
v-for="(level, index) in InterestSalesProcessLevelFlow"
:key="index"
>
<v-stepper-item
:step="index"
:complete="currentStep + 1 > index"
:title="level"
/>
<v-divider
v-if="index < InterestSalesProcessLevelFlow.length - 1"
></v-divider>
</template>
</v-stepper-header>
</v-stepper>
<v-form v-if="interest" @submit.prevent="saveInterest">
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Full Name']"
label="Full Name"
variant="outlined"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Yacht Name']"
label="Yacht Name"
variant="outlined"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest.Length"
label="Length"
variant="outlined"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest.Address"
label="Address"
variant="outlined"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Email Address']"
label="Email Address"
variant="outlined"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-select
v-model="interest['Sales Process Level']"
label="Sales Process Level"
variant="outlined"
:items="InterestSalesProcessLevelFlow"
></v-select>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Phone Number']"
label="Phone Number"
variant="outlined"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Extra Comments']"
label="Extra Comments"
variant="outlined"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Berth Size Desired']"
label="Berth Size Desired"
variant="outlined"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Berth Recommendations']"
label="Berth Recommendations"
variant="outlined"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Date Added']"
label="Date Added"
variant="outlined"
readonly
disabled
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest.Width"
label="Width"
variant="outlined"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest.Depth"
label="Depth"
variant="outlined"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Created At']"
label="Created At"
variant="outlined"
readonly
disabled
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest.Source"
label="Source"
variant="outlined"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Place of Residence']"
label="Place of Residence"
variant="outlined"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-select
v-model="interest['Contact Method Preferred']"
label="Contact Method Preferred"
variant="outlined"
:items="ContactMethodPreferredFlow"
></v-select>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Request Form Sent']"
label="Request Form Sent"
variant="outlined"
readonly
disabled
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Berth Number']"
label="Berth Number"
variant="outlined"
></v-text-field>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['EOI Time Sent']"
label="EOI Time Sent"
variant="outlined"
readonly
disabled
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" md="6">
<v-select
v-model="interest['Lead Category']"
label="Lead Category"
variant="outlined"
:items="InterestLeadCategoryFlow"
></v-select>
</v-col>
<v-col cols="12" md="6">
<v-text-field
v-model="interest['Time LOI Sent']"
label="Time LOI Sent"
variant="outlined"
readonly
disabled
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col cols="12" class="d-flex">
<v-btn @click="requestMoreInfoToSales" class="mr-2"
>Request More Info - To Sales</v-btn
>
<v-btn @click="requestMoreInformation" class="mr-2"
>Request More Information</v-btn
>
<v-btn @click="eoiSendToSales">EOI Send to Sales</v-btn>
<v-spacer />
<v-btn type="submit" color="primary" class="mr-2">Save</v-btn>
</v-col>
</v-row>
</v-form>
</v-card-text>
</v-card>
</v-container>
</div>
</template>
<script lang="ts" setup>
import { useRoute, useRouter } from "#app";
import { ref, computed, onMounted } from "vue";
import {
InterestSalesProcessLevelFlow,
InterestLeadCategoryFlow,
ContactMethodPreferredFlow,
} from "@/utils/types";
const router = useRouter();
const route = useRoute();
const { data: interest } = useFetch<Interest>("/api/get-interest-by-id", {
params: {
id: route.params.id,
},
});
const currentStep = computed(() => {
return InterestSalesProcessLevelFlow.indexOf(
interest.value?.["Sales Process Level"] || ""
);
});
const fetchInterest = async () => {
try {
} catch (error) {
console.error("Failed to fetch interest:", error);
}
};
const saveInterest = async () => {
if (interest.value) {
try {
alert("Interest saved successfully!");
} catch (error) {
console.error("Failed to save interest:", error);
}
}
};
const requestMoreInfoToSales = () => {
alert("Request More Info - To Sales");
};
const requestMoreInformation = () => {
alert("Request More Information");
};
const eoiSendToSales = () => {
alert("EOI Send to Sales");
};
</script>

View File

@@ -0,0 +1,124 @@
<template>
<div>
<v-container>
<v-text-field
v-model="search"
label="Search contacts"
prepend-inner-icon="mdi-magnify"
variant="outlined"
class="mb-4"
clearable
></v-text-field>
<v-data-table
:headers="headers"
:items="filteredInterests"
:search="search"
:sort-by="[{ key: 'Full Name', order: 'asc' }]"
must-sort
hover
:loading="loading"
loading-text="Loading... Please wait"
:items-per-page="50"
:items-per-page-options="[10, 20, 50, 100]"
>
<template #item="{ item }">
<tr @click="handleRowClick(item)" class="cursor-pointer">
<td>{{ item["Full Name"] }}</td>
<td>{{ item["Yacht Name"] }}</td>
<td>{{ item.Length }}</td>
<td>{{ item.Width }}</td>
<td>{{ item.Depth }}</td>
<td>{{ item["Berth Number"] }}</td>
<td>
<InterestSalesBadge
:salesProcessLevel="item['Sales Process Level']"
/>
</td>
<td>{{ item["Phone Number"] }}</td>
<td>{{ item["Email Address"] }}</td>
<td><LeadCategoryBadge :leadCategory="item['Lead Category']" /></td>
<td>
<v-tooltip bottom>
<template #activator="{ props }">
<v-icon v-if="item['Extra Comments']" v-bind="props"
>mdi-comment</v-icon
>
</template>
<span>{{ item["Extra Comments"] }}</span>
</v-tooltip>
</td>
</tr>
</template>
</v-data-table>
</v-container>
</div>
</template>
<script lang="ts" setup>
import LeadCategoryBadge from "~/components/LeadCategoryBadge.vue";
import InterestSalesBadge from "~/components/InterestSalesBadge.vue";
import { useFetch } from "#app";
import { ref, computed } from "vue";
useHead({
title: "Interest List",
});
const user = useDirectusUser();
const router = useRouter();
const loading = ref(true);
const { data: interests } = useFetch<InterestsResponse>("/api/get-interests", {
headers: {
"x-tag": user.value?.email ? "094ut234" : "pjnvü1230",
},
onResponse() {
loading.value = false;
},
onResponseError() {
loading.value = false;
},
});
const search = ref("");
const handleRowClick = (interest: Interest) => {
router.push(`/dashboard/interest-list/${interest.Id}`);
};
const headers = [
{ title: "Full Name", key: "Full Name", sortable: true },
{ title: "Yacht Name", key: "Yacht Name", sortable: true },
{ title: "Length", key: "Length", sortable: true },
{ title: "Width", key: "Width", sortable: true },
{ title: "Depth", key: "Depth", sortable: true },
{ title: "Berth Number", key: "Berth Number", sortable: true },
{ title: "Sales Process Level", key: "Sales Process Level", sortable: true },
{ title: "Phone", key: "Phone Number", sortable: false },
{ title: "Email", key: "Email Address", sortable: false },
{ title: "Lead Category", key: "Lead Category", sortable: true },
{ title: "Comments", key: "Extra Comments", sortable: false }, // New column for comments
];
const filteredInterests = computed(() => {
if (!interests.value?.list) return [];
return interests.value.list.filter((item) => {
const searchLower = search.value?.toLowerCase() || "";
return Object.values(item).some((value) =>
String(value).toLowerCase().includes(searchLower)
);
});
});
</script>
<style scoped>
tr:hover {
background-color: #f5f5f5;
}
.cursor-pointer {
cursor: pointer;
}
</style>

View File

@@ -1,30 +1,142 @@
<template>
<div class="embed">
<iframe
src="https://database.portnimara.com/dashboard/#/nc/kanban/2fe9125c-9051-4b49-93ff-745159528425"
/>
</div>
<v-card>
<v-card-text>
<v-row class="overflow-x-auto flex-nowrap">
<v-col
v-for="level in InterestSalesProcessLevelFlow"
:key="level"
class="v-col-auto"
>
<v-card v-if="groupedInterests[level].length" color="grey-lighten-5">
<v-card-title>
<InterestSalesBadge
:sales-process-level="(level as InterestSalesProcessLevel)"
/>
</v-card-title>
<v-card-text class="overflow-y-auto" style="max-height: 90vh">
<v-card
v-for="interest in groupedInterests[level]"
:key="interest.Id"
class="mx-3 my-6"
variant="flat"
@click="handleInterestClick(interest.Id)"
style="cursor: pointer"
>
<v-card-title>{{ interest["Full Name"] }}</v-card-title>
<v-card-text>
<v-list bg-color="transparent">
<v-list-item>
<v-list-item-title>Yacht Name</v-list-item-title>
<v-list-item-subtitle>{{
interest["Yacht Name"] || "-"
}}</v-list-item-subtitle>
</v-list-item>
<v-list-item>
<v-list-item-title>Email Address</v-list-item-title>
<v-list-item-subtitle>{{
interest["Email Address"] || "-"
}}</v-list-item-subtitle>
</v-list-item>
<v-list-item>
<v-list-item-title>Berth Number</v-list-item-title>
<v-list-item-subtitle>{{
interest["Berth Number"] || "-"
}}</v-list-item-subtitle>
</v-list-item>
<v-list-item>
<v-list-item-title>Phone Number</v-list-item-title>
<v-list-item-subtitle>{{
interest["Phone Number"] || "-"
}}</v-list-item-subtitle>
</v-list-item>
<v-list-item>
<v-list-item-title>Berth Size Desired</v-list-item-title>
<v-list-item-subtitle>{{
interest["Berth Size Desired"] || "-"
}}</v-list-item-subtitle>
</v-list-item>
</v-list>
</v-card-text>
</v-card>
</v-card-text>
</v-card>
</v-col>
</v-row>
</v-card-text>
</v-card>
</template>
<script lang="ts" setup>
import { useFetch } from "#app";
import { ref, computed } from "vue";
import { useRouter } from "#app";
const router = useRouter();
useHead({
title: "Interest Status",
});
const loading = ref(true);
const { data: interests } = useFetch<InterestsResponse>("/api/get-interests", {
onResponse() {
loading.value = false;
},
onResponseError() {
loading.value = false;
},
});
const groupedInterests = computed(() => {
const groups: Record<string, Interest[]> = {};
InterestSalesProcessLevelFlow.forEach((level) => {
groups[level] = [];
});
interests.value?.list.forEach((interest) => {
const level = interest["Sales Process Level"];
if (groups[level]) {
groups[level].push(interest);
}
});
// Sort each group by "Full Name"
for (const level in groups) {
groups[level].sort((a, b) => {
if (a["Full Name"] < b["Full Name"]) return -1;
if (a["Full Name"] > b["Full Name"]) return 1;
return 0;
});
}
return groups;
});
const handleInterestClick = (id: number) => {
router.push(`/dashboard/interest-list/${id}`);
};
</script>
<style scoped>
.embed {
position: relative;
overflow: hidden;
width: 100%;
height: 100vh;
.v-card {
border-radius: 8px;
}
.embed iframe {
width: 100%;
height: calc(100% + 46px);
border: 0;
position: absolute;
top: -46px;
.v-card-title {
font-weight: bold;
}
.v-list-item {
padding: 0;
}
.v-list-item-content {
padding: 0;
}
.v-list-item-subtitle {
white-space: normal;
}
</style>