Some Changes

This commit is contained in:
2024-07-09 21:35:19 +02:00
parent 101b8d3361
commit eb4b8a8d9b
13 changed files with 436 additions and 170 deletions

View File

@@ -12,6 +12,7 @@ console.log("1.")
console.log('Breakpoint updated:', oldBreakpoint, '->', newBreakpoint) console.log('Breakpoint updated:', oldBreakpoint, '->', newBreakpoint)
})*/ })*/
const dev = process.dev
@@ -42,9 +43,7 @@ useSeoMeta({
<NuxtPage/> <NuxtPage/>
</NuxtLayout> </NuxtLayout>
<!-- <UNotifications v-if="!dev"/>
<UNotifications/>
-->
<VitePwaManifest/> <VitePwaManifest/>

View File

@@ -0,0 +1,25 @@
import axios from 'axios'
export const useZebraStatus = async (relation,select = '*', sortColumn = null) => {
const {data} = await axios({
method:"get",
url:"http://192.168.2.161/config.html",
})
console.log(data)
}
export const useZebraPstPrnt = async (zpl) => {
try {
const {data} = await axios({
method: "post",
url:"http://192.168.2.161/pstprnt",
data: zpl
})
} catch (error) {
console.log(error)
}
}

View File

@@ -376,6 +376,10 @@ let links = computed(() => {
label: "Firmeneinstellungen", label: "Firmeneinstellungen",
to: "/settings/tenant", to: "/settings/tenant",
icon: "i-heroicons-clipboard-document-list" icon: "i-heroicons-clipboard-document-list"
},{
label: "Reparaturprozesse",
to: "/repairs/prozess/",
icon: "i-heroicons-bars-3-solid"
} }
] ]
}, },

View File

@@ -177,124 +177,228 @@ setupPage()
</template> </template>
</UTabs> </UTabs>
<UForm v-else-if="mode == 'edit' || mode == 'create'" class="p-5" > <UForm v-else-if="mode == 'edit' || mode == 'create'" class="p-5" >
<div class="mx-auto w-4/5">
<div class="flex flex-row justify-around">
<div class="w-1/2">
<UDivider>Vertragsdaten</UDivider>
<UFormGroup
label="Name:"
>
<UInput
v-model="itemInfo.name"
/>
</UFormGroup>
<UFormGroup <UFormGroup
label="Name:" label="Kunde:"
> >
<UInput <USelectMenu
v-model="itemInfo.name" v-model="itemInfo.customer"
/> option-attribute="name"
</UFormGroup> value-attribute="id"
:options="dataStore.customers"
@change="itemInfo.contact = null"
searchable
:search-attributes="['name']"
>
<template #label>
{{dataStore.getCustomerById(itemInfo.customer) ? dataStore.getCustomerById(itemInfo.customer).name : "Kein Kunde ausgewählt" }}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Ansprechpartner:"
v-if="itemInfo.customer"
>
<USelectMenu
v-model="itemInfo.contact"
option-attribute="fullName"
value-attribute="id"
:options="dataStore.getContactsByCustomerId(itemInfo.customer)"
searchable
:search-attributes="['name']"
>
<template #label>
{{dataStore.getContactById(itemInfo.contact) ? dataStore.getContactById(itemInfo.contact).fullName : "Kein Ansprechpartner ausgewählt" }}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup <InputGroup>
label="Kunde:" <UFormGroup
> label="Vertrag aktiv:"
<USelectMenu >
v-model="itemInfo.customer" <UCheckbox
option-attribute="name" v-model="itemInfo.active"
value-attribute="id" />
:options="dataStore.customers" </UFormGroup>
@change="itemInfo.contact = null" <UFormGroup
searchable label="Vertrag wiederkehrend:"
:search-attributes="['name']" >
<UCheckbox
v-model="itemInfo.recurring"
/>
</UFormGroup>
</InputGroup>
<InputGroup>
<UFormGroup
label="Vertragsstart:"
class="mt-2"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.startDate ? dayjs(itemInfo.startDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.startDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
<UFormGroup
label="Vertragsende(voraussichtlich):"
class="mt-2"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.endDate ? dayjs(itemInfo.endDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.endDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
</InputGroup>
<UFormGroup
label="mindest Vertragslaufzeit:"
>
<USelectMenu
:options="['12 Monate','24 Monate','36 Monate','48 Monate']"
v-model="itemInfo.duration"
/>
</UFormGroup>
<UFormGroup
label="Datum der Unterzeichnung:"
class="mt-2"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.signDate ? dayjs(itemInfo.signDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.signDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
</div>
<div class=" ml-5 w-1/2">
<UDivider>Abrechnung</UDivider>
<UFormGroup
label="Rechnungsversand:"
>
<USelectMenu
:options="['E-Mail', 'Post']"
v-model="itemInfo.invoiceDispatch"
>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Zahlungsart:"
>
<USelectMenu
:options="['Einzug', 'Überweisung']"
v-model="itemInfo.paymentType"
>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Sepa Mandat"
>
<InputGroup>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.sepaDate ? dayjs(itemInfo.sepaDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.sepaDate" @close="close" />
</template>
</UPopover>
<UInput
placeholder="Mandatsreferenz"
class="flex-auto"
v-model="itemInfo.sepaRef"
/>
</InputGroup>
</UFormGroup>
<UFormGroup
label="Kontodaten:"
>
<InputGroup>
<UInput
v-model="itemInfo.bankingIban"
placeholder="IBAN"
class="w-1/2"
/>
<UInput
v-model="itemInfo.bankingOwner"
class="w-1/2"
placeholder="Inhaber"
/>
</InputGroup>
</UFormGroup>
<UFormGroup
label="Bankdaten:"
>
<InputGroup>
<UInput
v-model="itemInfo.bankingName"
placeholder="Name"
class="w-1/2"
/>
<UInput
v-model="itemInfo.bankingBIC"
placeholder="BIC"
class="w-1/2"
/>
</InputGroup>
</UFormGroup>
</div>
</div>
<UFormGroup
label="Notizen:"
> >
<template #label> <UTextarea
{{dataStore.getCustomerById(itemInfo.customer) ? dataStore.getCustomerById(itemInfo.customer).name : "Kein Kunde ausgewählt" }} v-model="itemInfo.notes"
</template> rows="6"
</USelectMenu> maxrows="12"
</UFormGroup>
<UFormGroup
label="Ansprechpartner:"
v-if="itemInfo.customer"
>
<USelectMenu
v-model="itemInfo.contact"
option-attribute="fullName"
value-attribute="id"
:options="dataStore.getContactsByCustomerId(itemInfo.customer)"
searchable
:search-attributes="['name']"
>
<template #label>
{{dataStore.getContactById(itemInfo.contact) ? dataStore.getContactById(itemInfo.contact).fullName : "Kein Ansprechpartner ausgewählt" }}
</template>
</USelectMenu>
</UFormGroup>
<UFormGroup
label="Vertrag aktiv:"
>
<UCheckbox
v-model="itemInfo.active"
/>
</UFormGroup>
<UFormGroup
label="Vertragsstart:"
class="mt-2"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.startDate ? dayjs(itemInfo.startDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/> />
</UFormGroup>
</div>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.startDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
<UFormGroup
label="Vertragsende(voraussichtlich):"
class="mt-2"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.endDate ? dayjs(itemInfo.endDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.endDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
<UFormGroup
label="mindest Vertragslaufzeit:"
>
<USelectMenu
:options="['12 Monate','24 Monate','36 Monate','48 Monate']"
v-model="itemInfo.duration"
/>
</UFormGroup>
<UFormGroup
label="Datum der Unterzeichnung:"
class="mt-2"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.signDate ? dayjs(itemInfo.signDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.signDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
<UFormGroup
label="Notizen:"
>
<UTextarea
v-model="itemInfo.notes"
rows="6"
maxrows="12"
/>
</UFormGroup>
</UForm> </UForm>
</template> </template>

View File

@@ -41,7 +41,7 @@ const itemInfo = ref({
rows: [ rows: [
], ],
contactPerson: null, contactPerson: dataStore.activeProfile.id,
contactPersonName: null, contactPersonName: null,
contactTel: null, contactTel: null,
contactEMail: null, contactEMail: null,
@@ -108,6 +108,8 @@ const setDocumentTypeConfig = () => {
} }
const setCustomerData = () => { const setCustomerData = () => {
let customer = dataStore.getCustomerById(itemInfo.value.customer) let customer = dataStore.getCustomerById(itemInfo.value.customer)
itemInfo.value.contact = null itemInfo.value.contact = null
if(customer) { if(customer) {
@@ -118,13 +120,9 @@ const setCustomerData = () => {
} }
} }
const setContactPersonData = () => { const setContactPersonData = async () => {
let profile = dataStore.activeProfile console.log(itemInfo.value.contactPerson)
//console.log(profile) let profile = await useSupabaseSelectSingle("profiles",itemInfo.value.contactPerson, '*')
if(!itemInfo.value.contactPerson) itemInfo.value.contactPerson = profile.id
itemInfo.value.contactPersonName = profile.fullName itemInfo.value.contactPersonName = profile.fullName
itemInfo.value.contactTel = profile.mobileTel || profile.fixedTel || "" itemInfo.value.contactTel = profile.mobileTel || profile.fixedTel || ""
@@ -607,6 +605,21 @@ setupPage()
>Kunde</UButton> >Kunde</UButton>
</InputGroup> </InputGroup>
<UAlert
v-if="itemInfo.customer"
class="mt-2"
variant="solid"
color="white"
title="Info"
>
<template #description>
Kundennr: {{dataStore.getCustomerById(itemInfo.customer).customerNumber}}<br>
Typ: {{dataStore.getCustomerById(itemInfo.customer).isCompany ? 'Firma' : 'Privat'}}<br>
Notizen: <span class="truncate">{{dataStore.getCustomerById(itemInfo.customer).notes}}</span>
</template>
</UAlert>
</UFormGroup> </UFormGroup>
<UFormGroup <UFormGroup
label="Ansprechpartner:" label="Ansprechpartner:"
@@ -796,6 +809,13 @@ setupPage()
{{dataStore.getCustomerById(project.customer).name}} - {{project.name}} {{dataStore.getCustomerById(project.customer).name}} - {{project.name}}
</template> </template>
</USelectMenu> </USelectMenu>
<UButton
variant="outline"
color="rose"
v-if="itemInfo.project"
icon="i-heroicons-x-mark"
@click="itemInfo.project = null"
/>
<UButton <UButton
variant="outline" variant="outline"
v-if="itemInfo.project" v-if="itemInfo.project"

View File

@@ -1,5 +1,6 @@
<script setup> <script setup>
import HistoryDisplay from "~/components/HistoryDisplay.vue"; import HistoryDisplay from "~/components/HistoryDisplay.vue";
import dayjs from "dayjs";
definePageMeta({ definePageMeta({
middleware: "auth" middleware: "auth"
@@ -21,9 +22,9 @@ const itemInfo = ref({
}) })
//Functions //Functions
const setupPage = () => { const setupPage = async () => {
if(mode.value === "show" || mode.value === "edit"){ if(mode.value === "show" || mode.value === "edit"){
currentItem.value = dataStore.getInventoryItemById(Number(useRoute().params.id)) currentItem.value = await useSupabaseSelectSingle("inventoryitems", route.params.id, "*, vendor(*)")
} }
if(mode.value === "edit") itemInfo.value = currentItem.value if(mode.value === "edit") itemInfo.value = currentItem.value
@@ -82,6 +83,10 @@ setupPage()
<div class="text-wrap"> <div class="text-wrap">
<p v-if="currentItem.currentSpace">Lagerplatz: {{dataStore.getSpaceById(currentItem.currentSpace).spaceNumber}} - {{dataStore.getSpaceById(currentItem.currentSpace).description}}</p> <p v-if="currentItem.currentSpace">Lagerplatz: {{dataStore.getSpaceById(currentItem.currentSpace).spaceNumber}} - {{dataStore.getSpaceById(currentItem.currentSpace).description}}</p>
<p>Seriennummer: {{currentItem.serialNumber}}</p>
<p>Artikelnummer: {{currentItem.articleNumber}}</p>
<p>Lieferant: {{currentItem.vendor ? currentItem.vendor.name : ''}}</p>
<p>Kaufdatum: {{currentItem.purchaseDate}}</p>
<p>Beschreibung: {{currentItem.description}}</p> <p>Beschreibung: {{currentItem.description}}</p>
</div> </div>
</div> </div>
@@ -123,6 +128,47 @@ setupPage()
</template> </template>
</USelectMenu> </USelectMenu>
</UFormGroup> </UFormGroup>
<UFormGroup
label="Seriennummer:"
>
<UInput
v-model="itemInfo.serialNumber"
/>
</UFormGroup>
<UFormGroup
label="Artikelnummer:"
>
<UInput
v-model="itemInfo.articleNumber"
/>
</UFormGroup>
<UFormGroup
label="Lieferant:"
>
<USelectMenu
:options="dataStore.vendors"
option-attribute="name"
value-attribute="id"
searchable
:search-attributes="['name']"
v-model="itemInfo.vendor"
/>
</UFormGroup>
<UFormGroup
label="Kaufdatum:"
>
<UPopover :popper="{ placement: 'bottom-start' }">
<UButton
icon="i-heroicons-calendar-days-20-solid"
:label="itemInfo.purchaseDate ? dayjs(itemInfo.purchaseDate).format('DD.MM.YYYY') : 'Datum auswählen'"
variant="outline"
/>
<template #panel="{ close }">
<LazyDatePicker v-model="itemInfo.purchaseDate" @close="close" />
</template>
</UPopover>
</UFormGroup>
<UFormGroup <UFormGroup
label="Beschreibung:" label="Beschreibung:"
> >

View File

@@ -56,6 +56,18 @@ const cancelEditorCreate = () => {
} }
} }
const printLabel = async (content) => {
let label = await useSupabaseSelectSingle("labels",1,"*")
console.log(label)
let zpl = label.zpl.replace("{{barcodeContent}}",content)
await useZebraPstPrnt(zpl)
}
setupPage() setupPage()
</script> </script>
@@ -129,6 +141,8 @@ setupPage()
class="my-2" class="my-2"
/> />
<UButton @click="printLabel(itemInfo.ean)">Print Label</UButton>
<span v-if="itemInfo.manufacturer">Hersteller: {{itemInfo.manufacturer}}<br></span> <span v-if="itemInfo.manufacturer">Hersteller: {{itemInfo.manufacturer}}<br></span>
<span v-if="itemInfo.manufacturerNumber">Herstellernummer: {{itemInfo.manufacturerNumber}}<br></span> <span v-if="itemInfo.manufacturerNumber">Herstellernummer: {{itemInfo.manufacturerNumber}}<br></span>
<span v-if="itemInfo.description">Beschreibung: {{itemInfo.description}}<br></span> <span v-if="itemInfo.description">Beschreibung: {{itemInfo.description}}<br></span>

View File

@@ -10,6 +10,7 @@ dayjs.extend(isBetween)
const dataStore = useDataStore() const dataStore = useDataStore()
const route = useRoute() const route = useRoute()
const router = useRouter()
const itemInfo = ref({}) const itemInfo = ref({})
const oldItemInfo = ref({}) const oldItemInfo = ref({})
@@ -118,6 +119,21 @@ changeRange()
<UDashboardNavbar <UDashboardNavbar
:title="itemInfo.fullName" :title="itemInfo.fullName"
> >
<template #left>
<UButton
icon="i-heroicons-chevron-left"
variant="outline"
@click="router.push(`/profiles`)"
>
Mitarbeiter
</UButton>
</template>
<template #center>
<h1
v-if="itemInfo"
:class="['text-xl','font-medium'/*, ... true ? ['text-primary'] : ['text-rose-500']*/]"
>{{itemInfo ? `Mitarbeiter: ${itemInfo.fullName}` : ''}}</h1>
</template>
</UDashboardNavbar> </UDashboardNavbar>
<UTabs <UTabs

View File

@@ -3,14 +3,28 @@ definePageMeta({
middleware: "auth" middleware: "auth"
}) })
defineShortcuts({
'backspace': () => {
router.push("/services")
},
'arrowleft': () => {
if(openTab.value > 0){
openTab.value -= 1
}
},
'arrowright': () => {
if(openTab.value < 3) {
openTab.value += 1
}
},
})
const dataStore = useDataStore() const dataStore = useDataStore()
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()
const toast = useToast() const toast = useToast()
const id = ref(route.params.id ? route.params.id : null ) const id = ref(route.params.id ? route.params.id : null )
let currentItem = ref(null)
//Working //Working
const mode = ref(route.params.mode || "show") const mode = ref(route.params.mode || "show")
const itemInfo = ref({ const itemInfo = ref({
@@ -18,30 +32,20 @@ const itemInfo = ref({
tags: [] tags: []
}) })
const openTab = ref(0)
//Functions //Functions
const setupPage = () => { const setupPage = () => {
if(mode.value === "show" || mode.value === "edit"){ if(mode.value === "show" || mode.value === "edit"){
currentItem.value = dataStore.getServiceById(Number(useRoute().params.id)) itemInfo.value = dataStore.getServiceById(Number(useRoute().params.id))
}
if(mode.value === "edit") itemInfo.value = currentItem.value
}
const cancelEditorCreate = () => {
if(currentItem.value) {
router.push(`/services/show/${currentItem.value.id}`)
} else {
router.push(`/services/`)
} }
} }
setupPage() setupPage()
</script> </script>
<template> <template>
<UDashboardNavbar :title="currentItem ? currentItem.name : (mode === 'create' ? 'Leistung erstellen' : 'Leistung bearbeiten')"> <UDashboardNavbar :title="itemInfo ? itemInfo.name : (mode === 'create' ? 'Leistung erstellen' : 'Leistung bearbeiten')">
<template #right> <template #right>
<UButton <UButton
v-if="mode === 'edit'" v-if="mode === 'edit'"
@@ -56,7 +60,7 @@ setupPage()
Erstellen Erstellen
</UButton> </UButton>
<UButton <UButton
@click="cancelEditorCreate" @click="itemInfo.value ? router.push(`/services/show/${itemInfo.value.id}`) : router.push(`/services/`)"
color="red" color="red"
class="ml-2" class="ml-2"
v-if="mode === 'edit' || mode === 'create'" v-if="mode === 'edit' || mode === 'create'"
@@ -65,7 +69,7 @@ setupPage()
</UButton> </UButton>
<UButton <UButton
v-if="mode === 'show'" v-if="mode === 'show'"
@click="router.push(`/services/edit/${currentItem.id}`)" @click="router.push(`/services/edit/${itemInfo.id}`)"
> >
Bearbeiten Bearbeiten
</UButton> </UButton>
@@ -75,6 +79,7 @@ setupPage()
:items="[{label: 'Informationen'},{label: 'Logbuch'},{label: 'Dokumente'}]" :items="[{label: 'Informationen'},{label: 'Logbuch'},{label: 'Dokumente'}]"
v-if="mode === 'show'" v-if="mode === 'show'"
class="p-5" class="p-5"
v-model="openTab"
> >
<template #item="{item}"> <template #item="{item}">
<UCard class="mt-5"> <UCard class="mt-5">
@@ -82,9 +87,9 @@ setupPage()
v-if="item.label === 'Informationen'" v-if="item.label === 'Informationen'"
> >
<div class="truncate"> <div class="truncate">
<p v-if="currentItem.sellingPrice">Verkaufspreis: {{String(Number(currentItem.sellingPrice).toFixed(2)).replace(".",",")}} </p> <p v-if="itemInfo.sellingPrice">Verkaufspreis: {{String(Number(itemInfo.sellingPrice).toFixed(2)).replace(".",",")}} </p>
<p>Beschreibung:</p> <p>Beschreibung:</p>
<pre>{{currentItem.description}}</pre> <pre>{{itemInfo.description}}</pre>
</div> </div>
@@ -94,14 +99,14 @@ setupPage()
> >
<HistoryDisplay <HistoryDisplay
type="product" type="product"
v-if="currentItem" v-if="itemInfo"
:element-id="currentItem.id" :element-id="itemInfo.id"
/> />
</div> </div>
<div <div
v-if="item.label === 'Bestand'" v-if="item.label === 'Bestand'"
> >
Bestand: {{dataStore.getStockByProductId(currentItem.id)}} {{dataStore.units.find(unit => unit.id === currentItem.unit) ? dataStore.units.find(unit => unit.id === currentItem.unit).name : ""}} Bestand: {{dataStore.getStockByProductId(itemInfo.id)}} {{dataStore.units.find(unit => unit.id === itemInfo.unit) ? dataStore.units.find(unit => unit.id === itemInfo.unit).name : ""}}
</div> </div>
<div <div
@@ -110,12 +115,12 @@ setupPage()
<Toolbar> <Toolbar>
<DocumentUpload <DocumentUpload
type="product" type="product"
:element-id="currentItem.id" :element-id="itemInfo.id"
/> />
</Toolbar> </Toolbar>
<DocumentList :documents="dataStore.getDocumentsByProductId(currentItem.id)"/> <DocumentList :documents="dataStore.getDocumentsByProductId(itemInfo.id)"/>
</div> </div>
</UCard> </UCard>
</template> </template>

View File

@@ -45,6 +45,15 @@
@select="(i) => router.push(`/services/show/${i.id}`) " @select="(i) => router.push(`/services/show/${i.id}`) "
:empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Leistungen anzuzeigen' }" :empty-state="{ icon: 'i-heroicons-circle-stack-20-solid', label: 'Keine Leistungen anzuzeigen' }"
> >
<template #name-data="{row}">
<span
v-if="row === filteredRows[selectedItem]"
class="text-primary-500 font-bold">{{row.name}}</span>
<span v-else>
{{row.name}}
</span>
</template>
<template #sellingPrice-data="{row}"> <template #sellingPrice-data="{row}">
{{row.sellingPrice ? Number(row.sellingPrice).toFixed(2) + " €" : ""}} {{row.sellingPrice ? Number(row.sellingPrice).toFixed(2) + " €" : ""}}
</template> </template>
@@ -68,6 +77,26 @@ defineShortcuts({
}, },
'+': () => { '+': () => {
router.push("/services/create") router.push("/services/create")
},
'Enter': {
usingInput: true,
handler: () => {
router.push(`/services/show/${filteredRows.value[selectedItem.value].id}`)
}
},
'arrowdown': () => {
if(selectedItem.value < filteredRows.value.length - 1) {
selectedItem.value += 1
} else {
selectedItem.value = 0
}
},
'arrowup': () => {
if (selectedItem.value === 0) {
selectedItem.value = filteredRows.value.length - 1
} else {
selectedItem.value -= 1
}
} }
}) })
@@ -75,6 +104,16 @@ const dataStore = useDataStore()
const supabase = useSupabaseClient() const supabase = useSupabaseClient()
const router = useRouter() const router = useRouter()
const items = ref([])
const selectedItem = ref(0)
const setupPage = async () => {
items.value = await useSupabaseSelect("services","*")
}
setupPage()
const templateColumns = [ const templateColumns = [
{ {
key: "name", key: "name",
@@ -103,15 +142,9 @@ const columns = computed(() => templateColumns.filter((column) => selectedColumn
const searchString = ref('') const searchString = ref('')
const filteredRows = computed(() => { const filteredRows = computed(() => {
if(!searchString.value) {
return dataStore.services
}
return dataStore.services.filter(product => { return useSearch(searchString.value, items.value)
return Object.values(product).some((value) => {
return String(value).toLowerCase().includes(searchString.value.toLowerCase())
})
})
}) })
</script> </script>

View File

@@ -59,24 +59,23 @@ const checkBIC = async () => {
} }
const generateLink = async () => { const generateLink = async () => {
const {data,error} = await axios({ try {
url:`${axiosBaseUrl}/banking/link?tenant=${dataStore.currentTenant}&institution_id=${bankData.value.id}`, const {data} = await axios({
method: "POST", url:`${axiosBaseUrl}/banking/link?tenant=${dataStore.currentTenant}&institution_id=${bankData.value.id}`,
auth: { method: "POST",
username: "frontend", auth: {
password: "Xt9Zn9RDSpdbr" username: "frontend",
} password: "Xt9Zn9RDSpdbr"
}) }
})
console.log(data)
console.log(error)
if(data) {
await navigateTo(data.link, { await navigateTo(data.link, {
open: { open: {
target: "_blank" target: "_blank"
} }
}) })
} catch (error) {
console.log(error)
} }
} }

View File

@@ -11,8 +11,6 @@ const router = useRouter()
const toast = useToast() const toast = useToast()
const id = ref(route.params.id ? route.params.id : null ) const id = ref(route.params.id ? route.params.id : null )
const browserPrint = ZebraBrowserPrintWrapper();
let currentItem = ref(null) let currentItem = ref(null)
//Working //Working
@@ -58,12 +56,14 @@ function getSpaceProductCount(productId) {
return count return count
} }
/*
const printSpaceLabel = async () => { const printSpaceLabel = async () => {
axios axios
.post(`http://${dataStore.ownTenant.value.labelPrinterIp}/pstprnt`, `^XA^FO10,20^BCN,100^FD${currentItem.value.spaceNumber}^XZ` ) .post(`http://${dataStore.ownTenant.value.labelPrinterIp}/pstprnt`, `^XA^FO10,20^BCN,100^FD${currentItem.value.spaceNumber}^XZ` )
.then(console.log) .then(console.log)
.catch(console.log) .catch(console.log)
} }
*/
setupPage() setupPage()
@@ -155,7 +155,7 @@ setupPage()
</USelectMenu> </USelectMenu>
</UFormGroup> </UFormGroup>
<UFormGroup <UFormGroup
label="Beschreibung.:" label="Beschreibung:"
> >
<UTextarea <UTextarea
v-model="itemInfo.description" v-model="itemInfo.description"

View File

@@ -843,6 +843,7 @@ export const useDataStore = defineStore('data', () => {
if(supabaseError) { if(supabaseError) {
console.log(supabaseError) console.log(supabaseError)
toast.add({title: `Fehler beim Speichern`, color: 'rose'})
} else if(supabaseData) { } else if(supabaseData) {
await eval(dataType + '.value[' + dataType + '.value.findIndex(i => i.id === ' + JSON.stringify(data.id) + ')] = ' + JSON.stringify(supabaseData[0])) await eval(dataType + '.value[' + dataType + '.value.findIndex(i => i.id === ' + JSON.stringify(data.id) + ')] = ' + JSON.stringify(supabaseData[0]))
if(dataType === 'profiles') await fetchProfiles() if(dataType === 'profiles') await fetchProfiles()