homebox/frontend/pages/item/new.vue

98 lines
3.1 KiB
Vue
Raw Permalink Normal View History

2022-09-02 17:46:20 +00:00
<script setup>
definePageMeta({
layout: "home",
2022-09-02 17:46:20 +00:00
});
const show = reactive({
identification: true,
purchase: false,
sold: false,
extras: false,
});
const form = reactive({
name: "",
description: "",
notes: "",
2022-09-02 17:46:20 +00:00
// Item Identification
serialNumber: "",
modelNumber: "",
manufacturer: "",
2022-09-02 17:46:20 +00:00
// Purchase Information
purchaseTime: "",
purchasePrice: "",
purchaseFrom: "",
2022-09-02 17:46:20 +00:00
// Sold Information
soldTime: "",
soldPrice: "",
soldTo: "",
soldNotes: "",
2022-09-02 17:46:20 +00:00
});
function submit() {
console.log("Submitted!");
}
2022-09-02 17:46:20 +00:00
</script>
<template>
<BaseContainer cmp="section">
2022-09-02 17:46:20 +00:00
<BaseSectionHeader> Add an Item To Your Inventory </BaseSectionHeader>
<form class="max-w-3xl mx-auto my-5 space-y-6" @submit.prevent="submit">
2022-09-02 17:46:20 +00:00
<div class="divider collapse-title px-0 cursor-pointer">Required Information</div>
<div class="bg-base-200 card">
<div class="card-body">
<FormTextField v-model="form.name" label="Name" />
<FormTextArea v-model="form.description" label="Description" limit="1000" />
2022-09-02 17:46:20 +00:00
</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">
2022-09-02 17:46:20 +00:00
<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" />
2022-09-02 17:46:20 +00:00
</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">
2022-09-02 17:46:20 +00:00
<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" />
2022-09-02 17:46:20 +00:00
</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">
2022-09-02 17:46:20 +00:00
<div class="card-body">
<div class="grid md:grid-cols-2 gap-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" />
2022-09-02 17:46:20 +00:00
</div>
<FormTextArea v-model="form.soldNotes" label="Sold Notes" limit="1000" />
2022-09-02 17:46:20 +00:00
</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">
2022-09-02 17:46:20 +00:00
<div class="card-body">
<FormTextArea v-model="form.notes" label="Notes" limit="1000" />
2022-09-02 17:46:20 +00:00
</div>
</div>
</form>
</BaseContainer>
</template>