|
|
@@ -113,7 +113,7 @@
|
|
|
<i class="fas fa-users text-purple-500 text-xl mr-3"></i>
|
|
|
<div>
|
|
|
<p class="text-sm font-medium text-gray-500">Passagers</p>
|
|
|
- <p class="text-lg font-semibold text-gray-900">{{ tripDetails.occupiedSeats }}/{{ tripDetails.totalSeats }}</p>
|
|
|
+ <p class="text-lg font-semibold text-gray-900">{{ tripDetails.passengers }}/{{ tripDetails.capacity }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -123,7 +123,7 @@
|
|
|
<i class="fas fa-bus text-yellow-500 text-xl mr-3"></i>
|
|
|
<div>
|
|
|
<p class="text-sm font-medium text-gray-500">Véhicule</p>
|
|
|
- <p class="text-lg font-semibold text-gray-900">{{ tripDetails.vehicle?.model || 'N/A' }} - {{ tripDetails.vehicle?.licensePlate || 'N/A' }}</p>
|
|
|
+ <p class="text-lg font-semibold text-gray-900">{{ tripDetails.vehicle?.model || 'N/A' }} - {{ tripDetails.vehicle?.immatriculation || 'N/A' }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -133,12 +133,12 @@
|
|
|
<div class="mt-6">
|
|
|
<div class="flex justify-between text-sm text-gray-600 mb-2">
|
|
|
<span>Taux d'occupation</span>
|
|
|
- <span>{{ Math.round((tripDetails.occupiedSeats / tripDetails.totalSeats) * 100) }}%</span>
|
|
|
+ <span>{{ Math.round((tripDetails.passengers / tripDetails.capacity) * 100) }}%</span>
|
|
|
</div>
|
|
|
<div class="w-full bg-gray-200 rounded-full h-3">
|
|
|
<div
|
|
|
class="bg-gradient-to-r from-blue-500 to-green-500 h-3 rounded-full transition-all duration-500"
|
|
|
- :style="{ width: `${(tripDetails.occupiedSeats / tripDetails.totalSeats) * 100}%` }"
|
|
|
+ :style="{ width: `${(tripDetails.passengers / tripDetails.capacity) * 100}%` }"
|
|
|
></div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -417,20 +417,19 @@ const filteredPassengers = computed(() => {
|
|
|
// Methods
|
|
|
const createTripDetailsObject = (tripData: any): AssignedTrip => ({
|
|
|
id: tripData.id,
|
|
|
- departure: tripData.departure,
|
|
|
- arrival: tripData.arrival,
|
|
|
- departureTime: tripData.departureTime,
|
|
|
- arrivalTime: tripData.arrivalTime,
|
|
|
- date: tripData.date,
|
|
|
+ departure: tripData.departStation?.name || '-',
|
|
|
+ arrival: tripData.arriveStation?.name || '-',
|
|
|
+ departureTime: tripData.departAt ? formatDateTime(tripData.departAt) : '-',
|
|
|
+ arrivalTime: tripData.arriveAt ? formatDateTime(tripData.arriveAt) : '-',
|
|
|
+ date: tripData.departAt,
|
|
|
status: tripData.status,
|
|
|
registrationClosed: tripData.registrationClosed || false,
|
|
|
- vehicle: tripData.vehicle,
|
|
|
+ vehicle: tripData.vehicule,
|
|
|
company: tripData.company,
|
|
|
route: tripData.route,
|
|
|
driver: tripData.driver,
|
|
|
- totalSeats: tripData.capacity || tripData.vehicle?.capacity || 0,
|
|
|
- occupiedSeats: tripData.passengers || 0,
|
|
|
- revenue: 0
|
|
|
+ capacity: tripData.vehicule?.number_places || 0,
|
|
|
+ passengers: tripData.passengers || 0
|
|
|
})
|
|
|
|
|
|
const loadTripDetails = async () => {
|
|
|
@@ -444,7 +443,7 @@ const loadTripDetails = async () => {
|
|
|
|
|
|
try {
|
|
|
const tripData = await EmployeeService.getTripDetails(props.trip.id)
|
|
|
-
|
|
|
+ console.log('lala =>', tripData?.vehicule)
|
|
|
if (tripData) {
|
|
|
tripDetails.value = createTripDetailsObject(tripData)
|
|
|
console.log('🔍 DEBUG - tripDetails après chargement API:', tripDetails.value)
|
|
|
@@ -466,6 +465,7 @@ const changePage = (page: number) => {
|
|
|
loadPassengers()
|
|
|
}
|
|
|
|
|
|
+
|
|
|
const getStatusColor = (status: string) => {
|
|
|
const colors = {
|
|
|
'scheduled': 'bg-blue-500',
|
|
|
@@ -547,8 +547,6 @@ const formatDateTime = (dateTime: string) => {
|
|
|
return new Date(dateTime).toLocaleString('fr-FR', {
|
|
|
hour: '2-digit',
|
|
|
minute: '2-digit',
|
|
|
- day: '2-digit',
|
|
|
- month: '2-digit'
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -693,6 +691,7 @@ onMounted(() => {
|
|
|
})
|
|
|
|
|
|
watch(() => props.trip, (newTrip) => {
|
|
|
+ console.log('props.trip change:', newTrip)
|
|
|
if (newTrip) {
|
|
|
loadTripDetails()
|
|
|
loadPassengers()
|