Added topm id and row number and ui changes.

This commit is contained in:
2026-02-07 19:08:13 +01:00
parent 05b073812c
commit 088734f237
11 changed files with 176 additions and 74 deletions
@@ -116,6 +116,14 @@
<v-card-text>
<v-row no-gutters>
<v-col cols="2" style="padding: 5px;">
<v-row no-gutters>
<v-text-field
v-model.trim="store.articleEdit.topm_id"
:readonly="!edit"
label="TopM ID"
:clearable="edit"
/>
</v-row>
<v-row no-gutters>
<v-checkbox
v-model="store.articleEdit.bio"
@@ -150,6 +158,7 @@
persistent-placeholder
persistent-hint
:readonly="!edit"
:clearable="edit"
/>
</v-row>
@@ -161,6 +170,7 @@
persistent-placeholder
persistent-hint
:readonly="!edit"
:clearable="edit"
/>
</v-row>
</v-col>
@@ -174,6 +184,7 @@
persistent-placeholder
persistent-hint
:readonly="!edit"
:clearable="edit"
/>
</v-row>
<v-row no-gutters>
@@ -205,6 +216,7 @@
persistent-placeholder
persistent-hint
:readonly="!edit"
:clearable="edit"
/>
</v-row>
<v-row no-gutters>
@@ -20,6 +20,7 @@
let bio_origin: Ref<string | null> = ref<string | null>(null);
let allergens_text: Ref<string | null> = ref<string | null>(null);
let bio_info: Ref<string | null> = ref<string | null>(null);
let topm_id: Ref<string | null> = ref<string | null>(null);
async function create() {
if (name.value != null && name.value.trim().length > 0 &&
@@ -30,7 +31,7 @@
const article: Article = new Article(0, name.value, bio.value, origin.value, description.value,
ingredients.value, default_unit.value, [],
mhd.value, bio_origin.value, allergens_text.value, bio_info.value);
mhd.value, bio_origin.value, allergens_text.value, bio_info.value, topm_id.value);
await store.createArticle(article);
@@ -53,6 +54,7 @@
bio_origin.value = null;
allergens_text.value = null;
bio_info.value = null;
topm_id.value = null;
loading.value = false;
}
@@ -63,7 +65,7 @@
v-model="dialog"
:scrollable="true"
width="800"
max-height="750"
max-height="850"
>
<template v-slot:activator="{ props }">
<v-btn
@@ -122,16 +124,25 @@
label="Standard Einheit"
></v-select>
</v-col>
<v-col>
<v-text-field
v-model.trim="topm_id"
label="TopM ID"
:clearable="true"
/>
</v-col>
</v-row>
<v-textarea
v-model.trim="description"
label="Beschreibung"
:clearable="true"
/>
<v-textarea
v-model.trim="ingredients"
label="Zutaten"
:clearable="true"
/>
<v-row>
@@ -140,6 +151,7 @@
v-model.trim="mhd"
label="MHD Text"
:hint="store.settings.mhd"
:clearable="true"
/>
</v-col>
<v-col>
@@ -147,6 +159,7 @@
v-model.trim="allergens_text"
label="Allergen Hinweis"
:hint="store.settings.allergens_text"
:clearable="true"
/>
</v-col>
</v-row>
@@ -157,6 +170,7 @@
v-model.trim="bio_origin"
label="BIO Prüfstelle"
:hint="store.settings.bio"
:clearable="true"
/>
</v-col>
<v-col>
@@ -164,6 +178,7 @@
v-model.trim="bio_info"
label="BIO Info Text"
:hint="store.settings.bio_info"
:clearable="true"
/>
</v-col>
</v-row>
@@ -18,6 +18,7 @@
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);
let topm_row: Ref<string | null> = ref<string | null>(null);
if (store.article != null) {
unit.value = store.article.default_unit;
@@ -30,7 +31,9 @@
) {
loading.value = true;
const variant: Variant = new Variant(0, weight.value, ean.value, name.value, description.value, ingredients.value, unit.value, label.value, variant_description.value);
const variant: Variant = new Variant(0, weight.value, ean.value, name.value,
description.value, ingredients.value, unit.value, label.value,
variant_description.value, topm_row.value);
await store.addVariant(variant);
@@ -44,11 +47,17 @@
}
function clearVariables() {
weight.value = null;
ean.value = null;
name.value = null;
description.value = null;
ingredients.value = null;
if (store.article != null) {
weight.value = null;
ean.value = null;
name.value = null;
unit.value = store.article.default_unit;
description.value = null;
ingredients.value = null;
label.value = null;
variant_description.value = null;
topm_row.value = null;
}
loading.value = false;
}
@@ -59,7 +68,7 @@
v-model="dialog"
:scrollable="true"
width="800"
max-height="750"
max-height="850"
>
<template v-slot:activator="{ props }">
<v-btn
@@ -91,15 +100,29 @@
<v-divider/>
<v-card-text>
<v-text-field
v-model.trim="variant_description"
label="Varianten Bezeichnung"
autofocus
/>
<v-row>
<v-col cols="8">
<v-text-field
v-model.trim="variant_description"
label="Varianten Bezeichnung"
autofocus
/>
</v-col>
<v-col>
<v-text-field
v-model.trim="topm_row"
label="TopM Zeile"
:clearable="true"
/>
</v-col>
</v-row>
<v-text-field
v-model.trim="name"
label="Produkt Bezeichnung"
:clearable="true"
:placeholder="(store.article != null)? ((store.article.name != null)? store.article.name : undefined) : undefined"
persistent-placeholder
/>
<v-row>
@@ -131,16 +154,23 @@
<v-text-field
v-model.trim="ean"
label="EAN-Code"
:clearable="true"
/>
<v-textarea
v-model.trim="description"
label="Beschreibung"
:clearable="true"
:placeholder="(store.article != null)? ((store.article.description != null)? store.article.description : undefined) : undefined"
persistent-placeholder
/>
<v-textarea
v-model.trim="ingredients"
label="Zutaten"
:clearable="true"
:placeholder="(store.article != null)? ((store.article.ingredients != null)? store.article.ingredients : undefined) : undefined"
persistent-placeholder
/>
</v-card-text>
+72 -53
View File
@@ -22,6 +22,7 @@
let ingredients: Ref<string | null> = ref<string | null>(JSON.parse(JSON.stringify(props.variant.ingredients)));
let label: Ref<Label | null> = ref<Label | null>(JSON.parse(JSON.stringify(props.variant.label)));
let variant_description: Ref<string | null> = ref<string | null>(JSON.parse(JSON.stringify(props.variant.variant_description)));
let topm_row: Ref<string | null> = ref<string | null>(JSON.parse(JSON.stringify(props.variant.topm_row)));
function toggleEdit() {
if (edit.value) {
@@ -43,13 +44,14 @@
unit.value = JSON.parse(JSON.stringify(props.variant.unit));
description.value = JSON.parse(JSON.stringify(props.variant.description));
ingredients.value = JSON.parse(JSON.stringify(props.variant.ingredients));
topm_row.value = JSON.parse(JSON.stringify(props.variant.topm_row));
}
async function updateVariant() {
if (weight.value != null && unit.value != null) {
let updateVariant: Variant = new Variant(props.variant.id, weight.value,
ean.value, name.value, description.value, ingredients.value,
unit.value, label.value, variant_description.value);
unit.value, label.value, variant_description.value, topm_row.value);
await store.updateVariant(updateVariant);
@@ -135,11 +137,17 @@
<v-divider/>
<v-card-text>
<v-row
align="start"
>
<v-col cols="2">
<v-row>
<v-row no-gutters>
<v-col cols="2" style="padding: 5px;">
<v-row no-gutters>
<v-text-field
v-model.trim="topm_row"
label="TopM Zeile"
:readonly="!edit"
:clearable="edit"
/>
</v-row>
<v-row no-gutters>
<v-select
v-model="label"
:items="store.labels"
@@ -149,17 +157,16 @@
item-title="name"
:clearable="edit"
no-data-text="Keine Etiketten Typen angelegt"
/>
</v-row>
<v-row>
<v-row no-gutters>
<v-text-field
v-model.trim="weight"
label="Gewicht"
:readonly="!edit"
/>
</v-row>
<v-row>
<v-row no-gutters>
<v-select
v-model="unit"
:items="store.units"
@@ -169,54 +176,66 @@
</v-row>
</v-col>
<v-col cols="5">
<v-text-field
v-model.trim="name"
:readonly="!edit"
label="Produkt Bezeichnung"
/>
<v-col cols="5" style="padding: 5px;">
<v-row no-gutters>
<v-text-field
v-model.trim="name"
:readonly="!edit"
label="Produkt Bezeichnung"
:clearable="edit"
/>
</v-row>
<v-textarea
v-model.trim="description"
:tile=true
label="Beschreibung"
counter
:persistentCounter=true
rows="6"
no-resize
:readonly="!edit"
:placeholder="(store.article != null)? ((store.article.ingredients != null)? store.article.ingredients : undefined) : undefined"
persistent-placeholder
>
<template v-slot:counter="{ counter }">
<span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span>
</template>
</v-textarea>
<v-row no-gutters>
<v-textarea
v-model.trim="description"
:tile=true
label="Beschreibung"
counter
:persistentCounter=true
rows="6"
no-resize
:readonly="!edit"
:placeholder="(store.article != null)? ((store.article.ingredients != null)? store.article.description : undefined) : undefined"
persistent-placeholder
:clearable="edit"
>
<template v-slot:counter="{ counter }">
<span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span>
</template>
</v-textarea>
</v-row>
</v-col>
<v-col cols="5">
<v-text-field
v-model.trim="ean"
label="EAN"
:readonly="!edit"
/>
<v-col cols="5" style="padding: 5px;">
<v-row no-gutters>
<v-text-field
v-model.trim="ean"
label="EAN"
:readonly="!edit"
:clearable="edit"
/>
</v-row>
<v-textarea
v-model.trim="ingredients"
:tile=true
label="Zutaten"
counter
:persistentCounter=true
rows="6"
no-resize
:readonly="!edit"
:placeholder="(store.article != null)? ((store.article.ingredients != null)? store.article.ingredients : undefined) : undefined"
persistent-placeholder
>
<template v-slot:counter="{ counter }">
<span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span>
</template>
</v-textarea>
<v-row no-gutters>
<v-textarea
v-model.trim="ingredients"
:tile=true
label="Zutaten"
counter
:persistentCounter=true
rows="6"
no-resize
:readonly="!edit"
:placeholder="(store.article != null)? ((store.article.ingredients != null)? store.article.ingredients : undefined) : undefined"
persistent-placeholder
:clearable="edit"
>
<template v-slot:counter="{ counter }">
<span>{{ counter }} von {{ store.ingredientsMaxChars }} Zeichen.</span>
</template>
</v-textarea>
</v-row>
</v-col>
</v-row>
</v-card-text>
+1
View File
@@ -292,6 +292,7 @@ export const useLabelEditorStore = defineStore('label_editor_store', {
this.article.bio_origin = updatedArticle.bio_origin;
this.article.bio_info = updatedArticle.bio_info;
this.article.allergens_text = updatedArticle.allergens_text;
this.article.topm_id = updatedArticle.topm_id;
this.addNotification(false, 'Artikel "' + article.name + '" aktualisiert');
} catch {
+4 -2
View File
@@ -15,11 +15,12 @@ export class Article {
bio_origin: string | null;
allergens_text: string | null;
bio_info: string | null;
topm_id: string | null;
constructor(id: number, name: string, bio: boolean, origin: Origin, description: string | null,
ingredients: string | null, default_unit: Unit, variants: Array<Variant> | null,
mhd: string | null, bio_origin: string | null, allergens_text: string | null, bio_info: string | null) {
mhd: string | null, bio_origin: string | null, allergens_text: string | null,
bio_info: string | null, topm_id: string | null) {
this.id = id;
this.name = name;
this.bio = bio;
@@ -38,5 +39,6 @@ export class Article {
this.bio_origin = bio_origin;
this.allergens_text = allergens_text;
this.bio_info = bio_info;
this.topm_id = topm_id;
}
}
+3 -1
View File
@@ -11,10 +11,11 @@ export class Variant {
unit: Unit;
label: Label | null;
variant_description: string | null;
topm_row: string | null;
constructor(id: number, weight: string, ean: string|null, name: string|null,
description:string|null, ingredients: string|null, unit: Unit,
label: Label | null, variant_description: string | null) {
label: Label | null, variant_description: string | null, topm_row: string | null) {
this.id = id;
this.weight = weight;
this.ean = ean;
@@ -24,5 +25,6 @@ export class Variant {
this.unit = unit;
this.label = label;
this.variant_description = variant_description;
this.topm_row = topm_row;
}
}