-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
IBaylo
committed
Oct 15, 2022
1 parent
aef928f
commit 2647884
Showing
12 changed files
with
443 additions
and
105 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<template> | ||
<div> | ||
<v-col class="px-0"> | ||
<v-slider | ||
:messages="'от ' + data.amountLowerBound + ' до ' + data.amountUpperBound" | ||
label="Сумма кредита" | ||
class="align-center" | ||
v-model="sum" | ||
:max="data.amountUpperBound" | ||
:min="data.amountLowerBound" | ||
:step="10000" | ||
> | ||
<template v-slot:append> | ||
<v-text-field | ||
v-model="sum" | ||
class="mt-0 pt-0" | ||
hide-details | ||
single-line | ||
type="number" | ||
style="width: 90px" | ||
></v-text-field> | ||
</template> | ||
</v-slider> | ||
</v-col> | ||
<v-col class="px-0"> | ||
<v-slider | ||
:messages="'от ' + data.timeLimitMonthLower.value + ' месяцев до ' + data.timeLimitMonthUpper.value + ' месяцев'" | ||
label="Срок кредита" | ||
class="align-center" | ||
v-model="periodInMonth" | ||
:max="12" | ||
:min="data.timeLimitMonthLower.value" | ||
:step="1" | ||
> | ||
<template v-slot:append> | ||
<v-text-field | ||
v-model="periodInMonth" | ||
class="mt-0 pt-0" | ||
hide-details | ||
single-line | ||
type="number" | ||
style="width: 90px" | ||
></v-text-field> | ||
</template> | ||
</v-slider> | ||
</v-col> | ||
<v-col class="px-0"> | ||
Ставка: {{ data.percentage }}% | ||
Ежемесячный платеж: {{ Math.round(sum * (creditBase(data)* Math.pow((1+ creditBase(data)), periodInMonth)/(Math.pow((1+ creditBase(data)), periodInMonth)-1))) + ' ' + application.currency }} | ||
</v-col> | ||
</div> | ||
</template> | ||
<script> | ||
export default { | ||
props: ['data', 'application'], | ||
data: () => ({ | ||
periodInMonth: 0, | ||
sum: 0, | ||
}), | ||
methods: { | ||
creditBase(data) { | ||
return data.percentage / this.periodInMonth / 100 | ||
}, | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<template> | ||
<div> | ||
<v-toolbar color="indigo" dark> | ||
<!-- <v-app-bar-nav-icon></v-app-bar-nav-icon> --> | ||
|
||
<v-toolbar-title | ||
> | ||
{{'Сумма: ' + application.sum +' ' + application.currency}} | ||
</v-toolbar-title> | ||
<v-spacer></v-spacer> | ||
|
||
<!-- <v-btn icon> | ||
<v-icon>mdi-magnify</v-icon> | ||
</v-btn> --> | ||
</v-toolbar> | ||
<v-card-text class="text-left"> | ||
{{ 'Срок: ' + application.periodInMonth + ' месяцев' }} | ||
</v-card-text> | ||
|
||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-dialog | ||
v-model="dialog" | ||
persistent | ||
max-width="900" | ||
> | ||
<template v-slot:activator="{ on, attrs }"> | ||
<v-btn icon v-on="on" v-bind="attrs" @click="openDetails(application.id)"> | ||
<v-icon>mdi-clipboard-text-outline</v-icon> | ||
</v-btn> | ||
</template> | ||
<v-card> | ||
<template v-if="dialogData && dialogData.length"> | ||
<v-card-title class="text-h4"> | ||
Предложения | ||
</v-card-title> | ||
|
||
<v-card v-for="(data, i) in dialogData" :key="application.id + i" class="ma-5 pa-3"> | ||
<card :data="data" :application="application"></card> | ||
</v-card> | ||
</template> | ||
<v-card-title v-else class="text-h5"> | ||
Для данной заявки предложения отсутствуют | ||
</v-card-title> | ||
<v-card-actions> | ||
<v-spacer></v-spacer> | ||
<v-btn | ||
color="primary" | ||
text | ||
@click="dialog = false" | ||
> | ||
Закрыть | ||
</v-btn> | ||
</v-card-actions> | ||
</v-card> | ||
</v-dialog> | ||
<v-btn icon @click="removeApplication(application.id)"> | ||
<v-icon>mdi-delete</v-icon> | ||
</v-btn> | ||
</v-card-actions> | ||
</div> | ||
</template> | ||
<script> | ||
import Card from '../components/Card.vue'; | ||
import RequestService from "@/services/RequestService"; | ||
export default { | ||
components: { Card }, | ||
props: ['application'], | ||
data: () =>({ | ||
dialog: false, | ||
dialogData: [], | ||
}), | ||
methods: { | ||
async openDetails(id) { | ||
this.dialogData = await RequestService.loadApplicationDetails(id); | ||
}, | ||
async removeApplication(id) { | ||
this.$emit('removeApplication', id) | ||
} | ||
} | ||
} | ||
</script> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import Vue from 'vue' | ||
import Vuex from 'vuex'; | ||
|
||
Vue.use(Vuex); | ||
|
||
export default new Vuex.Store({ | ||
state: { | ||
sentApplications: [], | ||
}, | ||
|
||
getters: { | ||
sentApplications({ sentApplications }) { | ||
return sentApplications; | ||
}, | ||
}, | ||
|
||
mutations: { | ||
ADD_APPLICATION(state, { id }) { | ||
state.sentApplications = [...state.sentApplications, id]; | ||
}, | ||
|
||
REMOVE_APPLICATION(state, { id }) { | ||
state.sentApplications = state.sentApplications.filter(x => x !==id); | ||
}, | ||
}, | ||
|
||
actions: { | ||
addApplication({ commit }, { applicationId }) { | ||
commit({ | ||
type: 'ADD_APPLICATION', | ||
id: applicationId, | ||
}); | ||
}, | ||
|
||
removeApplication({ commit }, { applicationId }) { | ||
commit({ | ||
type: 'REMOVE_APPLICATION', | ||
id: applicationId, | ||
}); | ||
} | ||
} | ||
}); |
Oops, something went wrong.