Show supplier/origin in offer cards
Some checks failed
Build Docker Image / build (push) Failing after 7m43s

This commit is contained in:
Ruslan Bakiev
2026-02-05 20:21:36 +07:00
parent adf2a7765c
commit 05c91ca352
9 changed files with 41 additions and 3 deletions

View File

@@ -20,6 +20,7 @@
<OfferResultCard
v-for="(option, index) in productRouteOptions"
:key="option.sourceUuid ?? index"
:supplier-name="getSupplierName(option.sourceUuid)"
:location-name="getOfferData(option.sourceUuid)?.locationName"
:product-name="productName"
:price-per-unit="parseFloat(getOfferData(option.sourceUuid)?.pricePerUnit || '0') || null"
@@ -226,6 +227,14 @@ const getKycProfileUuid = (offerUuid?: string | null) => {
return supplier?.kycProfileUuid || null
}
const getSupplierName = (offerUuid?: string | null) => {
if (!offerUuid) return null
const offer = offersData.value.get(offerUuid)
if (!offer?.teamUuid) return null
const supplier = suppliersData.value.get(offer.teamUuid)
return supplier?.name || null
}
// Navigate to offer detail page
const navigateToOffer = (offerUuid?: string | null) => {
if (!offerUuid) return

View File

@@ -84,6 +84,7 @@
<OfferResultCard
v-for="(offer, index) in offersWithPrice"
:key="offer.uuid ?? index"
:supplier-name="offer.supplierName"
:location-name="offer.locationName || offer.locationCountry"
:product-name="offer.productName"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
@@ -127,6 +128,7 @@ interface Offer {
productUuid?: string | null
productName?: string | null
categoryName?: string | null
supplierName?: string | null
locationUuid?: string | null
locationName?: string | null
locationCountry?: string | null

View File

@@ -40,6 +40,7 @@
<OfferResultCard
v-for="(offer, index) in offersWithPrice"
:key="offer.uuid ?? index"
:supplier-name="offer.supplierName"
:location-name="offer.locationName"
:product-name="offer.productName || offer.title || undefined"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
@@ -86,6 +87,7 @@ interface Offer {
title?: string | null
productName?: string | null
locationName?: string | null
supplierName?: string | null
status?: string | null
latitude?: number | null
longitude?: number | null

View File

@@ -16,6 +16,7 @@
<OfferResultCard
v-for="(offer, index) in offersWithPrice"
:key="offer.uuid ?? index"
:supplier-name="offer.supplierName"
:location-name="offer.locationName"
:product-name="offer.title || undefined"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
@@ -51,6 +52,7 @@ interface Offer {
uuid?: string | null
title?: string | null
locationName?: string | null
supplierName?: string | null
status?: string | null
validUntil?: string | null
lines?: (OfferLine | null)[] | null

View File

@@ -144,6 +144,7 @@
<OfferResultCard
v-for="(offer, index) in offersWithPrice"
:key="offer.uuid ?? index"
:supplier-name="offer.supplierName"
:location-name="offer.locationName || offer.locationCountry || offer.locationName"
:product-name="offer.productName"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"

View File

@@ -3,7 +3,10 @@
<!-- Header: Location + Price -->
<div class="flex items-start justify-between mb-3">
<div>
<Text weight="semibold">{{ locationName || 'Локация' }}</Text>
<Text weight="semibold">{{ supplierDisplay }}</Text>
<Text tone="muted" size="sm">
{{ t('catalogOfferCard.labels.origin_label') }}: {{ originDisplay }}
</Text>
<Text v-if="productName" tone="muted" size="sm">{{ productName }}</Text>
</div>
<Text v-if="priceDisplay" weight="semibold" class="text-primary text-lg">
@@ -29,6 +32,7 @@ import type { RouteStage } from './RouteStepper.vue'
const props = withDefaults(defineProps<{
locationName?: string
supplierName?: string
productName?: string
pricePerUnit?: number | null
currency?: string | null
@@ -45,6 +49,16 @@ defineEmits<{
select: []
}>()
const { t } = useI18n()
const supplierDisplay = computed(() => {
return props.supplierName || t('catalogOfferCard.labels.supplier_unknown')
})
const originDisplay = computed(() => {
return props.locationName || t('catalogOfferCard.labels.origin_unknown')
})
const priceDisplay = computed(() => {
if (!props.pricePerUnit) return null
const currSymbol = getCurrencySymbol(props.currency)

View File

@@ -27,6 +27,7 @@
@click="emit('select-offer', offer)"
>
<OfferResultCard
:supplier-name="offer.supplierName"
:location-name="offer.locationName || offer.locationCountry"
:product-name="offer.productName"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
@@ -45,6 +46,7 @@ interface Offer {
uuid: string
productName?: string | null
productUuid?: string | null
supplierName?: string | null
quantity?: number | string | null
unit?: string | null
pricePerUnit?: number | string | null

View File

@@ -3,7 +3,10 @@
"labels": {
"quantity_with_unit": "{quantity} {unit}",
"default_unit": "t",
"country_unknown": "Not specified"
"country_unknown": "Not specified",
"supplier_unknown": "Supplier",
"origin_label": "From",
"origin_unknown": "Origin not specified"
}
}
}

View File

@@ -3,7 +3,10 @@
"labels": {
"quantity_with_unit": "{quantity} {unit}",
"default_unit": "т",
"country_unknown": "Не указана"
"country_unknown": "Не указана",
"supplier_unknown": "Поставщик",
"origin_label": "Откуда",
"origin_unknown": "Откуда не указано"
}
}
}