stash
This commit is contained in:
parent
012cf00e8e
commit
b45841fff8
7 changed files with 322 additions and 99 deletions
|
|
@ -6,6 +6,13 @@
|
|||
<div class="card">
|
||||
<div class="card-header">Edit Item</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<ul>
|
||||
<li v-for="file in item.files" :key="file.name">
|
||||
{{ file.name }} ({{ file.hash }})
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name"
|
||||
|
|
@ -39,6 +46,10 @@
|
|||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="image" class="form-label">Image</label>
|
||||
<combined-file-field :item_files="item.files" :item_id="item.id" @change="addFiles"></combined-file-field>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%"
|
||||
@click="updateInventoryItem(item)">Update
|
||||
|
|
@ -106,6 +117,9 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
...mapActions(["fetchInventoryItems", "updateInventoryItem", "fetchInfo"]),
|
||||
addFiles(files) {
|
||||
this.inventory_items.find(item => item.id === parseInt(this.id)).files = files
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
await this.fetchInfo();
|
||||
|
|
|
|||
|
|
@ -6,6 +6,13 @@
|
|||
<div class="card">
|
||||
<div class="card-header">Create New Item</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<ul>
|
||||
<li v-for="file in item.files" :key="file.name">
|
||||
{{ file.name }} ({{ file.hash }})
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name"
|
||||
|
|
@ -47,6 +54,11 @@
|
|||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="image" class="form-label">Image</label>
|
||||
<combined-file-field :item_files="item.files" create
|
||||
@change="item.files = $event"></combined-file-field>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<button type="submit" class="btn btn-primary" style="width: 100%"
|
||||
@click="createInventoryItem(item).then(() => $router.push('/inventory'))">Add
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue