Skip to content

Commit

Permalink
Price
Browse files Browse the repository at this point in the history
  • Loading branch information
yannivain committed Mar 27, 2022
1 parent 8c4e073 commit fcca72b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
16 changes: 7 additions & 9 deletions app/src/components/DocumentCreationSteps.vue
Expand Up @@ -72,14 +72,10 @@
</v-stepper-content>

<v-stepper-step step="4">
Deed
Price
</v-stepper-step>
<v-stepper-content step="4">
<v-card
color="grey lighten-1"
class="mb-12"
height="200px"
></v-card>
<price-form v-model="document.price"></price-form>
<v-btn
color="primary"
@click="step = 5"
Expand Down Expand Up @@ -115,20 +111,22 @@

<script>
import {cloneDeep} from "lodash"
import {DEFAULT_LOT, DEFAULT_PERSON} from "@/util/const"
import {DEFAULT_LOT, DEFAULT_PERSON, DEFAULT_PRICE} from "@/util/const"
import PersonForm from "@/components/PersonForm"
import LotForm from "@/components/LotForm"
import PriceForm from "@/components/PriceForm"
export default {
name: 'DocumentCreationSteps',
components: {LotForm, PersonForm},
components: {PriceForm, LotForm, PersonForm},
data: () => ({
step: 1,
document: {
seller: cloneDeep(DEFAULT_PERSON),
buyer: cloneDeep(DEFAULT_PERSON),
lot: cloneDeep(DEFAULT_LOT)
lot: cloneDeep(DEFAULT_LOT),
price: cloneDeep(DEFAULT_PRICE)
}
}),
watch: {
Expand Down
35 changes: 35 additions & 0 deletions app/src/components/PriceForm.vue
@@ -0,0 +1,35 @@
<template>
<div v-if="value">
<v-container>
<v-text-field label="Price" type="number" v-model="price.amount"></v-text-field>
<v-select label="Currency" v-model="price.currency" :items="currencyItems"></v-select>
</v-container>
</div>
</template>

<script>
export default {
name: 'PriceForm',
props: {
value: {type: Object, required: true}
},
data: () => ({
currencyItems: ["CHF", "EURO", "USD"]
}),
computed: {
price: {
get() {
return this.value;
},
set(v) {
this.$emit('input', v)
}
}
},
};
</script>

<style scoped>
</style>
13 changes: 4 additions & 9 deletions app/src/util/const.js
Expand Up @@ -40,21 +40,16 @@ export const DEFAULT_LEGAL = {
type_: PERSON_TYPES.LEGAL,
...cloneDeep(DEFAULT_LEGAL_PERSON)
}
/*
<lot>
<egrid>TBD</egrid>
<register>
<name>TBD</name>
<lot-id>TBD</lot-id>
</register>
</lot>
*/
export const DEFAULT_LOT = {
egrid: "",
register: {
name: "",
lotID: ""
}
}
export const DEFAULT_PRICE = {
amount: 0,
currency: "",
}


0 comments on commit fcca72b

Please sign in to comment.