From eb4b8a8d9b1171f6b93fdf4c3d4841e7b88f5077 Mon Sep 17 00:00:00 2001 From: flfeders Date: Tue, 9 Jul 2024 21:35:19 +0200 Subject: [PATCH] Some Changes --- app.vue | 5 +- composables/useZebraPrinter.js | 25 ++ layouts/default.vue | 4 + pages/contracts/[mode]/[[id]].vue | 322 ++++++++++++++++--------- pages/createDocument/edit/[[id]].vue | 36 ++- pages/inventoryitems/[mode]/[[id]].vue | 50 +++- pages/products/[mode]/[[id]].vue | 14 ++ pages/profiles/show/[id].vue | 16 ++ pages/services/[mode]/[[id]].vue | 55 +++-- pages/services/index.vue | 49 +++- pages/settings/banking/index.vue | 23 +- pages/spaces/[mode]/[[id]].vue | 6 +- stores/data.js | 1 + 13 files changed, 436 insertions(+), 170 deletions(-) create mode 100644 composables/useZebraPrinter.js diff --git a/app.vue b/app.vue index b9becef..5989d1a 100644 --- a/app.vue +++ b/app.vue @@ -12,6 +12,7 @@ console.log("1.") console.log('Breakpoint updated:', oldBreakpoint, '->', newBreakpoint) })*/ +const dev = process.dev @@ -42,9 +43,7 @@ useSeoMeta({ - + diff --git a/composables/useZebraPrinter.js b/composables/useZebraPrinter.js new file mode 100644 index 0000000..8f1ee9e --- /dev/null +++ b/composables/useZebraPrinter.js @@ -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) + } +} + diff --git a/layouts/default.vue b/layouts/default.vue index 2f6e34d..b9330f7 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -376,6 +376,10 @@ let links = computed(() => { label: "Firmeneinstellungen", to: "/settings/tenant", icon: "i-heroicons-clipboard-document-list" + },{ + label: "Reparaturprozesse", + to: "/repairs/prozess/", + icon: "i-heroicons-bars-3-solid" } ] }, diff --git a/pages/contracts/[mode]/[[id]].vue b/pages/contracts/[mode]/[[id]].vue index 2d691a5..df6f291 100644 --- a/pages/contracts/[mode]/[[id]].vue +++ b/pages/contracts/[mode]/[[id]].vue @@ -177,124 +177,228 @@ setupPage() +
+
+
+ Vertragsdaten + + + - - - + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Abrechnung + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ - - - - - - - - - - - - - - - + +
- - - - - - - - - - - - - - - - - - - - -
diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 2e9c2e5..3e831b1 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -41,7 +41,7 @@ const itemInfo = ref({ rows: [ ], - contactPerson: null, + contactPerson: dataStore.activeProfile.id, contactPersonName: null, contactTel: null, contactEMail: null, @@ -108,6 +108,8 @@ const setDocumentTypeConfig = () => { } const setCustomerData = () => { + + let customer = dataStore.getCustomerById(itemInfo.value.customer) itemInfo.value.contact = null if(customer) { @@ -118,13 +120,9 @@ const setCustomerData = () => { } } -const setContactPersonData = () => { - let profile = dataStore.activeProfile - //console.log(profile) - - if(!itemInfo.value.contactPerson) itemInfo.value.contactPerson = profile.id - - +const setContactPersonData = async () => { + console.log(itemInfo.value.contactPerson) + let profile = await useSupabaseSelectSingle("profiles",itemInfo.value.contactPerson, '*') itemInfo.value.contactPersonName = profile.fullName itemInfo.value.contactTel = profile.mobileTel || profile.fixedTel || "" @@ -607,6 +605,21 @@ setupPage() >Kunde + + + + + + import HistoryDisplay from "~/components/HistoryDisplay.vue"; +import dayjs from "dayjs"; definePageMeta({ middleware: "auth" @@ -21,9 +22,9 @@ const itemInfo = ref({ }) //Functions -const setupPage = () => { +const setupPage = async () => { 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 @@ -82,6 +83,10 @@ setupPage()

Lagerplatz: {{dataStore.getSpaceById(currentItem.currentSpace).spaceNumber}} - {{dataStore.getSpaceById(currentItem.currentSpace).description}}

+

Seriennummer: {{currentItem.serialNumber}}

+

Artikelnummer: {{currentItem.articleNumber}}

+

Lieferant: {{currentItem.vendor ? currentItem.vendor.name : ''}}

+

Kaufdatum: {{currentItem.purchaseDate}}

Beschreibung: {{currentItem.description}}

@@ -123,6 +128,47 @@ setupPage()
+ + + + + + + + + + + + + + + + diff --git a/pages/products/[mode]/[[id]].vue b/pages/products/[mode]/[[id]].vue index 54f6d17..fce6462 100644 --- a/pages/products/[mode]/[[id]].vue +++ b/pages/products/[mode]/[[id]].vue @@ -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() @@ -129,6 +141,8 @@ setupPage() class="my-2" /> + Print Label + Hersteller: {{itemInfo.manufacturer}}
Herstellernummer: {{itemInfo.manufacturerNumber}}
Beschreibung: {{itemInfo.description}}
diff --git a/pages/profiles/show/[id].vue b/pages/profiles/show/[id].vue index a36e0c6..f324a33 100644 --- a/pages/profiles/show/[id].vue +++ b/pages/profiles/show/[id].vue @@ -10,6 +10,7 @@ dayjs.extend(isBetween) const dataStore = useDataStore() const route = useRoute() +const router = useRouter() const itemInfo = ref({}) const oldItemInfo = ref({}) @@ -118,6 +119,21 @@ changeRange() + + { + router.push("/services") + }, + 'arrowleft': () => { + if(openTab.value > 0){ + openTab.value -= 1 + } + }, + 'arrowright': () => { + if(openTab.value < 3) { + openTab.value += 1 + } + }, +}) + const dataStore = useDataStore() const route = useRoute() const router = useRouter() const toast = useToast() const id = ref(route.params.id ? route.params.id : null ) -let currentItem = ref(null) - //Working const mode = ref(route.params.mode || "show") const itemInfo = ref({ @@ -18,30 +32,20 @@ const itemInfo = ref({ tags: [] }) +const openTab = ref(0) + //Functions const setupPage = () => { if(mode.value === "show" || mode.value === "edit"){ - currentItem.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/`) + itemInfo.value = dataStore.getServiceById(Number(useRoute().params.id)) } } - - setupPage()