preparing stock module

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-12 19:16:50 +02:00
parent 0bbb6157e1
commit fea21872e3
7 changed files with 101 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
import ResetPw from "./routes/user/ResetPw.svelte";
import Search from "./routes/search/Search.svelte";
import SendDoc from "./routes/document/Send.svelte";
import Stock from './routes/stock/Index.svelte';
import TagUses from "./routes/tags/TagUses.svelte";
import TaskList from "./routes/task/Index.svelte";
import Times from "./routes/time/Index.svelte";
@@ -96,6 +97,7 @@
<Route path="/project/:id/kanban" component={Kanban} />
<Route path="/project/:id/view" component={ViewPrj} />
<Route path="/search" component={Search} />
<Route path="/stock" component={Stock} />
<Route path="/tags/use/:tag" component={TagUses} />
<Route path="/task" component={TaskList} />
<Route path="/task/:parent_task_id/add_subtask" component={AddTask} />

View File

@@ -63,6 +63,7 @@ onMount(fetchModules);
<a href="/time" {onclick}>{t('timetracking')}</a>
<a href="/wiki" {onclick}>{t('wiki')}</a>
<a href="/contact" {onclick}>{t('contacts')}</a>
<a href="/stock" {onclick}>{t('stock')}</a>
{#if user.id == 2}
<a href="https://svelte.dev/tutorial/svelte/state" target="_blank">{t('tutorial')}</a>
{/if}

View File

@@ -0,0 +1,66 @@
<script>
import Locations from './Locations.svelte';
import ItemList from './ItemList.svelte';
import ItemProps from './ItemProps.svelte';
import { t } from '../../translations.svelte';
let companies = [
{
id: 1,
name: 'SRSoftware',
locations:{
Langenorla:{
Hauptgebäude:{
Obergeschoss:{
},
Untergeschoss:{
Einliegerwohnung:{
Bad:{
},
Küche:{
},
Wohnzimmer:{
}
},
Flur:{
},
Küche:{
},
Studio:{
}
},
Werkstatt:{
}
},
Nebengebäude:{
},
Grundstück:{
}
}
}
},
{ id: 2, name: 'Alrauna', locations: {} }
]
</script>
<h2>{t('Stock')}</h2>
<table>
<tbody>
<tr>
<td class="locations">
{#each companies as company}
<h3>{company.name}</h3>
<Locations locations={company.locations} />
{/each}
</td>
<td class="items">
<ItemList />
</td>
<td class="properties">
<ItemProps />
</td>
</tr>
</tbody>
</table>

View File

@@ -0,0 +1,14 @@
<script>
import { t } from '../../translations.svelte';
</script>
<ul>
<li>
<button>
<span></span>
{t('add_object',{object:'item'})}
</button>
</li>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

View File

@@ -0,0 +1,5 @@
<ul>
<li>Prop 1</li>
<li>Prop 2</li>
<li>Prop 3</li>
</ul>

View File

@@ -0,0 +1,12 @@
<script>
let { locations } = $props();
</script>
<ul>
{#each Object.entries(locations) as [k,v]}
<li>
{k}
<svelte:self locations={v} />
</li>
{/each}
</ul>

View File

@@ -116,6 +116,7 @@
"IMPERSONATE": "Nutzer wechseln",
"index_page": "Aufgabenübersicht",
"invoice": "Rechnung",
"item": "Artikel",
"items": "Artikel",
"join_objects" : "{objects} zusammenführen",