Commit c3e627b2 authored by Azrul Amir's avatar Azrul Amir

update page fine

parent 0b950a9f
...@@ -94,7 +94,10 @@ module.exports = function (/* ctx */) { ...@@ -94,7 +94,10 @@ module.exports = function (/* ctx */) {
// directives: [], // directives: [],
// Quasar plugins // Quasar plugins
plugins: [] plugins: [
'Loading',
'Notify'
]
}, },
// animations: 'all', // --- includes all animations // animations: 'all', // --- includes all animations
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
Borrow Borrow
</div> </div>
</q-banner> </q-banner>
<q-input bottom-slots v-model="borrower_id" ref="borrower_id" :rules="[val => !!val || 'Field is required']" label="borrower_id" dense> <q-input bottom-slots v-model="borrower_id" ref="borrower_id" :rules="[val => !!val || 'Field is required']" label="Staf/Student ID" dense>
<template v-slot:hint> <template v-slot:hint>
Borrower id 2016607348
</template> </template>
<template v-slot:append> <template v-slot:append>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
export default { export default {
data () { data () {
return { return {
borrower_id: '', borrower_id: '2016607348',
total_fines: .0, total_fines: .0,
columns: [ columns: [
{ {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
Fines Fines
</div> </div>
</q-banner> </q-banner>
<q-input bottom-slots v-model="borrower_id" ref="borrower_id" :rules="[val => !!val || 'Field is required']" label="borrower_id" dense> <q-input bottom-slots v-model="borrower_id" ref="borrower_id" :rules="[val => !!val || 'Field is required']" label="Student/Staff ID" dense>
<template v-slot:hint> <template v-slot:hint>
Borrower id Borrower id
</template> </template>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</template> </template>
</q-input> </q-input>
<div v-if="total_fines>0" class="q-pa-md fit row wrap justify-center q-gutter-md"> <div v-if="total_fines>0" class="q-pa-md fit row wrap justify-center q-gutter-md">
<q-avatar size="300px" color="red">{{ total_fines }}</q-avatar> <q-avatar size="70vw" color="green">{{ total_fines }}</q-avatar>
</div> </div>
</div> </div>
</q-page> </q-page>
...@@ -26,17 +26,25 @@ ...@@ -26,17 +26,25 @@
export default { export default {
data () { data () {
return { return {
borrower_id: '', borrower_id: '2016607348',
total_fines: .0 total_fines: .0
} }
}, },
methods: { methods: {
findFines() { findFines() {
this.$refs.borrower_id.validate() this.$refs.borrower_id.validate()
if (this.$refs.borrower_id.hasError){ if (this.$refs.borrower_id.hasError){
this.$q.notify({
message: 'Error. Please enter ID.',
icon: 'error',
color: 'red'
})
} }
else { else {
this.$q.loading.show({
delay: 10 // ms
})
this.$axios.get('wils/denda',{ this.$axios.get('wils/denda',{
params: { params: {
borrower_id: this.borrower_id borrower_id: this.borrower_id
...@@ -44,8 +52,21 @@ export default { ...@@ -44,8 +52,21 @@ export default {
}).then((response) => { }).then((response) => {
console.log(response) console.log(response)
this.total_fines = response.data.jumlah this.total_fines = response.data.jumlah
this.$q.notify({
message: 'Record was successfully retrieved.',
icon: 'check',
color: 'green'
})
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
this.$q.notify({
message: 'Error. please try again.',
icon: 'error',
color: 'red'
})
}).finally(()=>{
this.$q.loading.hide()
}) })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment