Add External Link
Fix Plantafel
This commit is contained in:
@@ -51,6 +51,7 @@ const itemInfo = ref({
|
||||
dateOfPerformance: null,
|
||||
paymentDays: auth.activeTenantData.standardPaymentDays,
|
||||
payment_type: "transfer",
|
||||
availableInPortal: false,
|
||||
customSurchargePercentage: 0,
|
||||
created_by: auth.user.id,
|
||||
title: null,
|
||||
@@ -111,6 +112,18 @@ const serialIntervalItems = ['wöchentlich', '2 - wöchentlich', 'monatlich', 'v
|
||||
const serialDateDirectionItems = ['Rückwirkend', 'Im Voraus']
|
||||
const taxPercentItems = [19, 7, 0]
|
||||
const selectedCustomer = computed(() => customers.value.find(i => i.id === itemInfo.value.customer) || null)
|
||||
const normalizeExternalUrl = (value) => {
|
||||
if (!value || typeof value !== "string") return null
|
||||
|
||||
const trimmedValue = value.trim()
|
||||
if (!trimmedValue) return null
|
||||
|
||||
if (/^https?:\/\//i.test(trimmedValue)) return trimmedValue
|
||||
|
||||
return `https://${trimmedValue}`
|
||||
}
|
||||
|
||||
const getSelectedProduct = (row) => products.value.find((item) => item.id === row.product) || null
|
||||
const formatNumberLikeValue = (value) => {
|
||||
if (value === null || typeof value === 'undefined' || value === '') return '-'
|
||||
if (typeof value === 'string' || typeof value === 'number') return String(value)
|
||||
@@ -1438,7 +1451,8 @@ const saveSerialInvoice = async () => {
|
||||
contactPerson: itemInfo.value.contactPerson,
|
||||
serialConfig: itemInfo.value.serialConfig,
|
||||
letterhead: itemInfo.value.letterhead,
|
||||
taxType:itemInfo.value.taxType
|
||||
taxType:itemInfo.value.taxType,
|
||||
availableInPortal: itemInfo.value.availableInPortal
|
||||
}
|
||||
|
||||
let data = null
|
||||
@@ -1527,6 +1541,7 @@ const saveDocument = async (state, resetup = false) => {
|
||||
agriculture: itemInfo.value.agriculture,
|
||||
letterhead: itemInfo.value.letterhead,
|
||||
usedAdvanceInvoices: itemInfo.value.usedAdvanceInvoices,
|
||||
availableInPortal: itemInfo.value.availableInPortal,
|
||||
customSurchargePercentage: itemInfo.value.customSurchargePercentage,
|
||||
report: documentReport.value
|
||||
}
|
||||
@@ -2234,6 +2249,12 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
||||
class="w-full"
|
||||
/>
|
||||
</UFormField>
|
||||
<UFormField
|
||||
v-if="['invoices', 'advanceInvoices', 'cancellationInvoices'].includes(itemInfo.type)"
|
||||
label="Im Kundenportal anzeigen:"
|
||||
>
|
||||
<USwitch v-model="itemInfo.availableInPortal" />
|
||||
</UFormField>
|
||||
<UFormField
|
||||
label="Objekt:"
|
||||
>
|
||||
@@ -2589,24 +2610,39 @@ const setRowData = async (row, service = {sellingPriceComposed: {}}, product = {
|
||||
v-else-if="row.mode === 'normal'"
|
||||
>
|
||||
<InputGroup class="w-full">
|
||||
<USelectMenu
|
||||
:disabled="itemInfo.type === 'cancellationInvoices'"
|
||||
class="w-full min-w-0"
|
||||
:items="products"
|
||||
:color="row.product ? 'primary' : 'error'"
|
||||
label-key="name"
|
||||
value-key="id"
|
||||
:search-input="{ placeholder: 'Suche ...' }"
|
||||
:filter-fields="['name']"
|
||||
v-model="row.product"
|
||||
@update:model-value="() => setRowData(row)"
|
||||
>
|
||||
<template #default>
|
||||
<span class="truncate">{{
|
||||
products.find(i => i.id === row.product) ? products.find(i => i.id === row.product).name : "Kein Produkt ausgewählt"
|
||||
}}</span>
|
||||
</template>
|
||||
</USelectMenu>
|
||||
<div class="w-full min-w-0">
|
||||
<USelectMenu
|
||||
:disabled="itemInfo.type === 'cancellationInvoices'"
|
||||
class="w-full min-w-0"
|
||||
:items="products"
|
||||
:color="row.product ? 'primary' : 'error'"
|
||||
label-key="name"
|
||||
value-key="id"
|
||||
:search-input="{ placeholder: 'Suche ...' }"
|
||||
:filter-fields="['name']"
|
||||
v-model="row.product"
|
||||
@update:model-value="() => setRowData(row)"
|
||||
>
|
||||
<template #default>
|
||||
<span class="truncate">{{
|
||||
getSelectedProduct(row) ? getSelectedProduct(row).name : "Kein Produkt ausgewählt"
|
||||
}}</span>
|
||||
</template>
|
||||
</USelectMenu>
|
||||
<div
|
||||
v-if="normalizeExternalUrl(getSelectedProduct(row)?.supplier_link)"
|
||||
class="mt-1 text-xs"
|
||||
>
|
||||
<a
|
||||
:href="normalizeExternalUrl(getSelectedProduct(row)?.supplier_link)"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-primary hover:underline break-all"
|
||||
>
|
||||
Lieferantenlink öffnen
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<EntityModalButtons
|
||||
type="products"
|
||||
:id="row.product"
|
||||
|
||||
Reference in New Issue
Block a user