Skip to content

Commit

Permalink
Redirect to mete to add barcode on click
Browse files Browse the repository at this point in the history
  • Loading branch information
fupduck committed Dec 6, 2023
1 parent 5c3309f commit 5655489
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<el-main v-if="!mete">
<Register ref="register" />
</el-main>
<Mete v-if="mete" />
<Mete v-if="mete" :url='meteUrl' />
</el-container>
</template>

Expand All @@ -49,6 +49,7 @@ export default defineComponent({
return {
menu: false,
mete: false,
meteUrl: '/mete',
storno: false,
};
},
Expand Down Expand Up @@ -85,6 +86,14 @@ export default defineComponent({
goMete($event: Event) {
$event.preventDefault();
this.meteUrl = '/mete';
this.menu = false;
this.mete = true;
},
addNewBarCode($event: Event, barcode: str) {
$event.preventDefault();
this.meteUrl = '/mete/barcodes/new?id=' + encodeURIComponent(barcode);
this.menu = false;
this.mete = true;
},
Expand Down
8 changes: 7 additions & 1 deletion src/components/Mete.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<template>
<iframe ref="mete" class="meteframe" src="/mete" />
<iframe ref="mete" class="meteframe" :src="url" />
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
name: "Mete",
props: {
url: {
type: String,
required: true,
}
}
});
</script>
3 changes: 2 additions & 1 deletion src/components/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ export default defineComponent({
} else {
notify({
title: "Unbekannter Barcode!",
message: `Bitte den Barcode ${barcode} im Administrationsbereich hinterlegen!`,
message: `Klicke hier um den Barcode ${barcode} im Administrationsbereich zu hinterlegen!`,
type: "warning",
onClick:($event: Event) => { this.$root.addNewBarCode($event, barcode); }
});
}
},
Expand Down

0 comments on commit 5655489

Please sign in to comment.