Updated ui for variant and label and fixed error with loading labe for variant.
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
<v-text-field
|
||||
v-model.trim="store.articleEdit.name"
|
||||
:readonly="!edit"
|
||||
label="Produkt Bezeichnung"
|
||||
/>
|
||||
|
||||
<v-spacer />
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
import {useLabelEditorStore} from "~/store/labelEditorStore";
|
||||
import { Variant } from "~/types/variant";
|
||||
import type {Unit} from "~/types/unit";
|
||||
import type {Label} from "~/types/label";
|
||||
|
||||
let store = useLabelEditorStore();
|
||||
|
||||
@@ -15,6 +16,8 @@
|
||||
let unit: Ref<Unit | null> = ref<Unit | null>(null);
|
||||
let description: Ref<string | null> = ref<string | null>(null);
|
||||
let ingredients: Ref<string | null> = ref<string | null>(null);
|
||||
let label: Ref<Label | null> = ref<Label | null>(null);
|
||||
let variant_description: Ref<string | null> = ref<string | null>(null);
|
||||
|
||||
if (store.article != null) {
|
||||
unit.value = store.article.default_unit;
|
||||
@@ -27,7 +30,7 @@
|
||||
) {
|
||||
loading.value = true;
|
||||
|
||||
const variant: Variant = new Variant(0, weight.value, ean.value, name.value, description.value, ingredients.value, unit.value);
|
||||
const variant: Variant = new Variant(0, weight.value, ean.value, name.value, description.value, ingredients.value, unit.value, label.value, variant_description.value);
|
||||
|
||||
await store.addVariant(variant);
|
||||
|
||||
@@ -89,12 +92,27 @@
|
||||
|
||||
<v-card-text>
|
||||
<v-text-field
|
||||
v-model.trim="name"
|
||||
label="Bezeichnung"
|
||||
v-model.trim="variant_description"
|
||||
label="Varianten Bezeichnung"
|
||||
autofocus
|
||||
/>
|
||||
|
||||
<v-text-field
|
||||
v-model.trim="name"
|
||||
label="Produkt Bezeichnung"
|
||||
/>
|
||||
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-select
|
||||
v-model="label"
|
||||
:items="store.labels"
|
||||
label="Etiketten Typ"
|
||||
:return-object="true"
|
||||
item-title="name"
|
||||
no-data-text="Keine Etiketten Typen angelegt"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col>
|
||||
<v-text-field
|
||||
v-model.trim="weight"
|
||||
@@ -110,7 +128,7 @@
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-textarea
|
||||
<v-text-field
|
||||
v-model.trim="ean"
|
||||
label="EAN-Code"
|
||||
/>
|
||||
|
||||
@@ -68,8 +68,9 @@
|
||||
<v-card-title>
|
||||
<v-row style="padding-top: 10px">
|
||||
<v-text-field
|
||||
v-model.trim="name"
|
||||
v-model.trim="variant_description"
|
||||
:readonly="!edit"
|
||||
label="Varianten Bezeichnung"
|
||||
/>
|
||||
|
||||
<v-spacer />
|
||||
@@ -138,6 +139,19 @@
|
||||
align="start"
|
||||
>
|
||||
<v-col cols="2">
|
||||
<v-row>
|
||||
<v-select
|
||||
v-model="label"
|
||||
:items="store.labels"
|
||||
label="Etiketten Typ"
|
||||
:readonly="!edit"
|
||||
:return-object="true"
|
||||
item-title="name"
|
||||
:clearable="edit"
|
||||
no-data-text="Keine Etiketten Typen angelegt"
|
||||
|
||||
/>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-text-field
|
||||
v-model.trim="weight"
|
||||
@@ -151,18 +165,17 @@
|
||||
:items="store.units"
|
||||
label="Einheit"
|
||||
:readonly="!edit"
|
||||
></v-select>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<v-text-field
|
||||
v-model.trim="ean"
|
||||
label="EAN"
|
||||
:readonly="!edit"
|
||||
/>
|
||||
</v-row>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="5">
|
||||
<v-text-field
|
||||
v-model.trim="name"
|
||||
:readonly="!edit"
|
||||
label="Produkt Bezeichnung"
|
||||
/>
|
||||
|
||||
<v-textarea
|
||||
v-model.trim="description"
|
||||
:tile=true
|
||||
@@ -182,6 +195,12 @@
|
||||
</v-col>
|
||||
|
||||
<v-col cols="5">
|
||||
<v-text-field
|
||||
v-model.trim="ean"
|
||||
label="EAN"
|
||||
:readonly="!edit"
|
||||
/>
|
||||
|
||||
<v-textarea
|
||||
v-model.trim="ingredients"
|
||||
:tile=true
|
||||
|
||||
@@ -187,6 +187,8 @@ export const useLabelEditorStore = defineStore('label_editor_store', {
|
||||
|
||||
// Article
|
||||
async loadArticle(articleID: number) {
|
||||
await this.loadLabels();
|
||||
|
||||
try {
|
||||
const article: Article = await $fetch<Article>(this.config.public.url + '/article/' + articleID, {
|
||||
method: 'GET',
|
||||
|
||||
Reference in New Issue
Block a user