Fix InfoPanel for offers - supplier name and map point
Some checks failed
Build Docker Image / build (push) Has been cancelled
Some checks failed
Build Docker Image / build (push) Has been cancelled
- Show supplier name with loading state instead of "View Supplier" link - Fix offer coordinates on map (use locationLatitude/locationLongitude)
This commit is contained in:
@@ -41,15 +41,21 @@
|
||||
{{ formatPrice(entity.pricePerUnit) }} {{ entity.currency || 'RUB' }}/{{ entity.unit || 't' }}
|
||||
</p>
|
||||
|
||||
<!-- Supplier link for offer -->
|
||||
<button
|
||||
v-if="entityType === 'offer' && entity?.teamUuid"
|
||||
class="text-sm text-primary hover:underline flex items-center gap-1 mt-1"
|
||||
@click="emit('open-info', 'supplier', entity.teamUuid)"
|
||||
>
|
||||
<!-- Supplier for offer -->
|
||||
<div v-if="entityType === 'offer'" class="text-sm text-white/70 flex items-center gap-1 mt-1">
|
||||
<Icon name="lucide:factory" size="14" />
|
||||
{{ entity.supplierName || entity.teamName || $t('catalog.info.viewSupplier') }}
|
||||
</button>
|
||||
<span v-if="loadingSuppliers" class="loading loading-spinner loading-xs" />
|
||||
<span v-else-if="supplierDisplayName">
|
||||
{{ supplierDisplayName }}
|
||||
</span>
|
||||
<button
|
||||
v-else-if="entity?.teamUuid"
|
||||
class="text-primary hover:underline"
|
||||
@click="emit('open-info', 'supplier', entity.teamUuid)"
|
||||
>
|
||||
{{ $t('catalog.info.viewSupplier') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Products Section (for hub/supplier) -->
|
||||
@@ -209,6 +215,16 @@ const entityIcon = computed(() => {
|
||||
return 'lucide:info'
|
||||
})
|
||||
|
||||
// Supplier name for offer (from entity or relatedSuppliers)
|
||||
const supplierDisplayName = computed(() => {
|
||||
if (props.entity?.supplierName) return props.entity.supplierName
|
||||
if (props.entity?.teamName) return props.entity.teamName
|
||||
if (relatedSuppliers.value.length > 0 && relatedSuppliers.value[0]?.name) {
|
||||
return relatedSuppliers.value[0].name
|
||||
}
|
||||
return null
|
||||
})
|
||||
|
||||
// Format price
|
||||
const formatPrice = (price: number | string) => {
|
||||
const num = typeof price === 'string' ? parseFloat(price) : price
|
||||
|
||||
Reference in New Issue
Block a user