2018-11-30 07:42:04 +00:00
|
|
|
<template>
|
|
|
|
<div class="import">
|
|
|
|
<h1>Analyse</h1>
|
2018-11-30 14:15:23 +00:00
|
|
|
<b-container fluid>
|
|
|
|
<b-row class="date-selector">
|
|
|
|
<b-col sm="1"><label for="start"> Entre </label> </b-col>
|
2018-12-01 13:49:02 +00:00
|
|
|
<b-col sm="3">
|
|
|
|
<b-form-input id="start" type="date" :value="start" @input="set_start"></b-form-input>
|
|
|
|
</b-col>
|
2018-11-30 14:15:23 +00:00
|
|
|
<b-col sm="1"><label for="end"> et </label></b-col>
|
2018-12-01 13:49:02 +00:00
|
|
|
<b-col sm="3">
|
|
|
|
<b-form-input id="end" type="date" :value="end" @input="set_end"></b-form-input>
|
|
|
|
</b-col>
|
2018-11-30 14:15:23 +00:00
|
|
|
</b-row>
|
|
|
|
</b-container>
|
|
|
|
|
2018-11-30 17:36:30 +00:00
|
|
|
<b-card-group deck class="mb-3">
|
2018-12-01 13:49:02 +00:00
|
|
|
<box @click.native="set_poste('total')" postename="total"></box>
|
|
|
|
<box @click.native="set_poste('cash')" postename="cash"></box>
|
|
|
|
<box @click.native="set_poste('CB')" postename="CB"></box>
|
|
|
|
<box @click.native="set_poste('other')" postename="other"></box>
|
2018-11-30 17:36:30 +00:00
|
|
|
</b-card-group>
|
|
|
|
|
2018-12-03 08:49:36 +00:00
|
|
|
<b-table striped hover :items="filtered_rows(poste.words, poste.invert)" :fields='fields'>
|
|
|
|
<template slot="tags" slot-scope="data">
|
|
|
|
<div v-for="tag in data.item.tags">
|
|
|
|
<div v-if="tag.name !== 'Tout'">
|
|
|
|
<font-awesome-icon :icon="tag.icon" class="fa"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</b-table>
|
2018-11-30 07:42:04 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
2018-11-30 10:53:50 +00:00
|
|
|
|
|
|
|
<script>
|
2018-12-01 13:49:02 +00:00
|
|
|
import { mapGetters, mapActions } from 'vuex'
|
2018-11-30 17:36:30 +00:00
|
|
|
import box from '../components/box'
|
2018-11-30 10:53:50 +00:00
|
|
|
|
|
|
|
export default {
|
2018-11-30 14:47:13 +00:00
|
|
|
name: 'home',
|
2018-11-30 10:53:50 +00:00
|
|
|
components: {
|
2018-11-30 17:36:30 +00:00
|
|
|
box: box
|
2018-11-30 10:53:50 +00:00
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
2018-11-30 14:15:23 +00:00
|
|
|
fields: [
|
|
|
|
{
|
|
|
|
key: 'Date',
|
2018-11-30 15:34:05 +00:00
|
|
|
sortable: true,
|
|
|
|
formatter: this.table_date_format
|
2018-11-30 14:15:23 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'Montant',
|
|
|
|
sortable: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'Libellé',
|
|
|
|
sortable: true
|
2018-12-03 08:49:36 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
key: 'tags',
|
|
|
|
sortable: true
|
2018-11-30 14:15:23 +00:00
|
|
|
}
|
2018-11-30 14:56:18 +00:00
|
|
|
],
|
2018-12-01 14:03:38 +00:00
|
|
|
poste: {}
|
2018-11-30 10:53:50 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted: function () {
|
2018-12-02 17:02:44 +00:00
|
|
|
this.$store.dispatch('config/load')
|
2018-11-30 14:56:18 +00:00
|
|
|
this.$store.dispatch('datas/find_csv')
|
2018-11-30 10:53:50 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapGetters({
|
2018-11-30 14:56:18 +00:00
|
|
|
'csvs': 'datas/csvs',
|
2018-12-01 13:49:02 +00:00
|
|
|
'filtered_rows': 'datas/libelle_filter_rows',
|
|
|
|
'start': 'datas/start',
|
|
|
|
'end': 'datas/end',
|
2018-11-30 17:36:30 +00:00
|
|
|
'postes': 'config/postes'
|
2018-12-01 14:03:38 +00:00
|
|
|
})
|
2018-11-30 10:53:50 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2018-12-01 13:49:02 +00:00
|
|
|
...mapActions('datas', [
|
|
|
|
'set_start',
|
|
|
|
'set_end'
|
|
|
|
]),
|
|
|
|
update_start (e) {
|
|
|
|
},
|
2018-11-30 15:34:05 +00:00
|
|
|
table_date_format (date) {
|
|
|
|
return date
|
2018-11-30 14:15:23 +00:00
|
|
|
},
|
2018-11-30 21:07:08 +00:00
|
|
|
set_poste (postename) {
|
|
|
|
this.poste = this.postes[postename]
|
2018-11-30 15:34:05 +00:00
|
|
|
}
|
2018-11-30 10:53:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
2018-11-30 14:15:23 +00:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.date-selector {
|
|
|
|
padding: 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|