preparing stock module
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -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} />
|
||||
|
||||
@@ -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}
|
||||
|
||||
66
frontend/src/routes/stock/Index.svelte
Normal file
66
frontend/src/routes/stock/Index.svelte
Normal 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>
|
||||
14
frontend/src/routes/stock/ItemList.svelte
Normal file
14
frontend/src/routes/stock/ItemList.svelte
Normal 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>
|
||||
5
frontend/src/routes/stock/ItemProps.svelte
Normal file
5
frontend/src/routes/stock/ItemProps.svelte
Normal file
@@ -0,0 +1,5 @@
|
||||
<ul>
|
||||
<li>Prop 1</li>
|
||||
<li>Prop 2</li>
|
||||
<li>Prop 3</li>
|
||||
</ul>
|
||||
12
frontend/src/routes/stock/Locations.svelte
Normal file
12
frontend/src/routes/stock/Locations.svelte
Normal 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>
|
||||
@@ -116,6 +116,7 @@
|
||||
"IMPERSONATE": "Nutzer wechseln",
|
||||
"index_page": "Aufgabenübersicht",
|
||||
"invoice": "Rechnung",
|
||||
"item": "Artikel",
|
||||
"items": "Artikel",
|
||||
|
||||
"join_objects" : "{objects} zusammenführen",
|
||||
|
||||
Reference in New Issue
Block a user