-
-
Notifications
You must be signed in to change notification settings - Fork 123
/
Copy pathnew.vue
97 lines (88 loc) · 3.13 KB
/
new.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<script setup>
definePageMeta({
middleware: ["auth"],
});
const show = reactive({
identification: true,
purchase: false,
sold: false,
extras: false,
});
const form = reactive({
name: "",
description: "",
notes: "",
// Item Identification
serialNumber: "",
modelNumber: "",
manufacturer: "",
// Purchase Information
purchaseTime: "",
purchasePrice: "",
purchaseFrom: "",
// Sold Information
soldTime: "",
soldPrice: "",
soldTo: "",
soldNotes: "",
});
function submit() {
console.log("Submitted!");
}
</script>
<template>
<BaseContainer cmp="section">
<BaseSectionHeader> Add an Item To Your Inventory </BaseSectionHeader>
<form class="mx-auto my-5 max-w-3xl space-y-6" @submit.prevent="submit">
<div class="collapse-title divider cursor-pointer px-0">Required Information</div>
<div class="card bg-base-200">
<div class="card-body">
<FormTextField v-model="form.name" label="Name" />
<FormTextArea v-model="form.description" label="Description" limit="1000" />
</div>
</div>
<div class="divider">
<button class="btn btn-sm" @click="show.identification = !show.identification">Product Information</button>
</div>
<div v-if="show.identification" class="card bg-base-200">
<div class="card-body grid md:grid-cols-2">
<FormTextField v-model="form.serialNumber" label="Serial Number" />
<FormTextField v-model="form.modelNumber" label="Model Number" />
<FormTextField v-model="form.manufacturer" label="Manufacturer" />
</div>
</div>
<div class="">
<button class="btn btn-sm" @click="show.purchase = !show.purchase">Purchase Information</button>
<div class="divider"></div>
</div>
<div v-if="show.purchase" class="card bg-base-200">
<div class="card-body grid md:grid-cols-2">
<FormTextField v-model="form.purchaseTime" label="Purchase Time" />
<FormTextField v-model="form.purchasePrice" label="Purchase Price" />
<FormTextField v-model="form.purchaseFrom" label="Purchase From" />
</div>
</div>
<div class="divider">
<button class="btn btn-sm" @click="show.sold = !show.sold">Sold Information</button>
</div>
<div v-if="show.sold" class="card bg-base-200">
<div class="card-body">
<div class="grid gap-2 md:grid-cols-2">
<FormTextField v-model="form.soldTime" label="Sold Time" />
<FormTextField v-model="form.soldPrice" label="Sold Price" />
<FormTextField v-model="form.soldTo" label="Sold To" />
</div>
<FormTextArea v-model="form.soldNotes" label="Sold Notes" limit="1000" />
</div>
</div>
<div class="divider">
<button class="btn btn-sm" @click="show.extras = !show.extras">Extras</button>
</div>
<div v-if="show.extras" class="card bg-base-200">
<div class="card-body">
<FormTextArea v-model="form.notes" label="Notes" limit="1000" />
</div>
</div>
</form>
</BaseContainer>
</template>