mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix various issues and remove debug comments.
This commit is contained in:
parent
219c3c11f9
commit
f32bdd6c76
@ -275,8 +275,8 @@ export default {
|
|||||||
this.hasAttachments = false;
|
this.hasAttachments = false;
|
||||||
},
|
},
|
||||||
uploadedAttachments: function (e) {
|
uploadedAttachments: function (e) {
|
||||||
console.log('Response to event uploaded-attachments');
|
// console.log('Response to event uploaded-attachments');
|
||||||
console.log(e);
|
// console.log(e);
|
||||||
this.finishSubmission();
|
this.finishSubmission();
|
||||||
},
|
},
|
||||||
submitForm: function (e) {
|
submitForm: function (e) {
|
||||||
|
@ -177,13 +177,9 @@
|
|||||||
import {mapGetters, mapMutations} from "vuex";
|
import {mapGetters, mapMutations} from "vuex";
|
||||||
import Sortable from "sortablejs";
|
import Sortable from "sortablejs";
|
||||||
import format from "date-fns/format";
|
import format from "date-fns/format";
|
||||||
// import {setup} from 'axios-cache-adapter';
|
|
||||||
// import {cacheAdapterEnhancer} from 'axios-extensions';
|
|
||||||
import {configureAxios} from "../../shared/forageStore";
|
import {configureAxios} from "../../shared/forageStore";
|
||||||
|
|
||||||
|
|
||||||
// get all and cache, dont keep the table busy.
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Index",
|
name: "Index",
|
||||||
props: {
|
props: {
|
||||||
|
@ -80,8 +80,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import TransactionListLarge from "../transactions/TransactionListLarge";
|
import TransactionListLarge from "../transactions/TransactionListLarge";
|
||||||
import format from "date-fns/format";
|
|
||||||
import {mapGetters} from "vuex";
|
import {mapGetters} from "vuex";
|
||||||
|
import format from "date-fns/format";
|
||||||
import {configureAxios} from "../../shared/forageStore";
|
import {configureAxios} from "../../shared/forageStore";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -147,32 +147,36 @@ export default {
|
|||||||
this.updatePageTitle();
|
this.updatePageTitle();
|
||||||
},
|
},
|
||||||
getTransactions: function () {
|
getTransactions: function () {
|
||||||
|
// console.log('getTransactions()');
|
||||||
if (this.showReady && !this.loading) {
|
if (this.showReady && !this.loading) {
|
||||||
|
// console.log('Show ready, not loading, go for download');
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
this.rawTransactions = [];
|
||||||
configureAxios().then(async (api) => {
|
configureAxios().then(async (api) => {
|
||||||
// console.log('Now getTransactions() x Start');
|
// console.log('Now getTransactions() x Start');
|
||||||
let startStr = format(this.start, 'y-MM-dd');
|
let startStr = format(this.start, 'y-MM-dd');
|
||||||
let endStr = format(this.end, 'y-MM-dd');
|
let endStr = format(this.end, 'y-MM-dd');
|
||||||
this.rawTransactions = [];
|
let url = './api/v1/accounts/' + this.accountId + '/transactions?page=' + this.currentPage + '&limit=' + this.perPage + '&start=' + startStr + '&end=' + endStr + '&cache=' + this.cacheKey;
|
||||||
|
|
||||||
let url = './api/v1/accounts/' + this.accountId + '/transactions?page=1&limit=' + this.perPage + '&start=' + startStr + '&end=' + endStr + '&cache=' + this.cacheKey;
|
|
||||||
|
|
||||||
api.get(url)
|
api.get(url)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// console.log('Now getTransactions() DONE!');
|
// console.log('Now getTransactions() DONE!');
|
||||||
this.total = parseInt(response.data.meta.pagination.total);
|
this.total = parseInt(response.data.meta.pagination.total);
|
||||||
|
let transactions = response.data.data;
|
||||||
|
// console.log('Have downloaded ' + transactions.length + ' transactions');
|
||||||
|
// console.log(response.data);
|
||||||
this.rawTransactions = response.data.data;
|
this.rawTransactions = response.data.data;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
jumpToPage: function (event) {
|
jumpToPage: function (event) {
|
||||||
// console.log('noticed a change!');
|
// console.log('noticed a change in account/show!');
|
||||||
this.currentPage = event.page;
|
this.currentPage = event.page;
|
||||||
this.downloadTransactionList(event.page);
|
this.getTransactions();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -23,6 +23,23 @@
|
|||||||
<Alert :message="errorMessage" type="danger"/>
|
<Alert :message="errorMessage" type="danger"/>
|
||||||
<Alert :message="successMessage" type="success"/>
|
<Alert :message="successMessage" type="success"/>
|
||||||
<form @submit="submitForm" autocomplete="off">
|
<form @submit="submitForm" autocomplete="off">
|
||||||
|
<div class="col">
|
||||||
|
<!-- tabs -->
|
||||||
|
<ul class="nav nav-tabs ml-auto p-2" id="subscriptionTabs">
|
||||||
|
<li>
|
||||||
|
<li class="nav-item"><a class="nav-link active" href="#subscription" data-toggle="pill">
|
||||||
|
Subscription
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<li class="nav-item"><a class="nav-link" href="#rule" data-toggle="pill">
|
||||||
|
Rule
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="tab-content" id="subscriptionTabContent">
|
||||||
|
<div class="tab-pane show active" id="subscription" role="tabpanel" aria-labelledby="subscription-tab">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12">
|
<div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12">
|
||||||
<div class="card card-primary">
|
<div class="card card-primary">
|
||||||
@ -77,7 +94,8 @@
|
|||||||
<GenericTextInput :disabled="submitting" v-model="skip" field-name="skip" :errors="errors.skip" :title="$t('form.skip')"
|
<GenericTextInput :disabled="submitting" v-model="skip" field-name="skip" :errors="errors.skip" :title="$t('form.skip')"
|
||||||
v-on:set-field="storeField($event)"/>
|
v-on:set-field="storeField($event)"/>
|
||||||
|
|
||||||
<GenericGroup :disabled="submitting" v-model="group_title" field-name="group_title" :errors="errors.group_title" :title="$t('form.object_group')"
|
<GenericGroup :disabled="submitting" v-model="group_title" field-name="group_title" :errors="errors.group_title"
|
||||||
|
:title="$t('form.object_group')"
|
||||||
v-on:set-field="storeField($event)"/>
|
v-on:set-field="storeField($event)"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -111,6 +129,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="tab-pane show" id="rule" role="tabpanel" aria-labelledby="rule-tab">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-xs-12">
|
||||||
|
<div class="card card-primary">
|
||||||
|
<div class="card-header">
|
||||||
|
<h3 class="card-title">
|
||||||
|
Title
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
In the future here you can set rule info for the new subscription.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -269,10 +269,10 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
downloadBills: function (page) {
|
downloadBills: function (page) {
|
||||||
console.log('downloadBills');
|
// console.log('downloadBills');
|
||||||
console.log(this.indexReady);
|
// console.log(this.indexReady);
|
||||||
console.log(this.loading);
|
// console.log(this.loading);
|
||||||
console.log(this.downloaded);
|
// console.log(this.downloaded);
|
||||||
this.resetGroups();
|
this.resetGroups();
|
||||||
// console.log('getAccountList()');
|
// console.log('getAccountList()');
|
||||||
if (this.indexReady && !this.loading && !this.downloaded) {
|
if (this.indexReady && !this.loading && !this.downloaded) {
|
||||||
|
@ -215,16 +215,16 @@ export default {
|
|||||||
let pctOrange = 0;
|
let pctOrange = 0;
|
||||||
let pctRed = 0;
|
let pctRed = 0;
|
||||||
//console.log('Collected "' + period + '" budget limit #' + currentId + ' (part of budget #' + budgetId + ')');
|
//console.log('Collected "' + period + '" budget limit #' + currentId + ' (part of budget #' + budgetId + ')');
|
||||||
console.log('Spent ' + spentFloatPos + ' of ' + amount);
|
// console.log('Spent ' + spentFloatPos + ' of ' + amount);
|
||||||
|
|
||||||
// remove budget info from rawBudgets if it's there:
|
// remove budget info from rawBudgets if it's there:
|
||||||
this.filterBudgets(budgetId, currencyId);
|
this.filterBudgets(budgetId, currencyId);
|
||||||
let name = this.budgets[current.attributes.budget_id].name;
|
let name = this.budgets[current.attributes.budget_id].name;
|
||||||
// spent within budget:
|
// spent within budget:
|
||||||
if (0.0 !== spentFloat && spentFloatPos < amount) {
|
if (0.0 !== spentFloat && spentFloatPos < amount) {
|
||||||
console.log('Spent ' + name + ' in budget');
|
// console.log('Spent ' + name + ' in budget');
|
||||||
pctGreen = (spentFloatPos / amount) * 100;
|
pctGreen = (spentFloatPos / amount) * 100;
|
||||||
console.log('pctGreen is ' + pctGreen);
|
// console.log('pctGreen is ' + pctGreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
// spent over budget
|
// spent over budget
|
||||||
|
@ -97,22 +97,22 @@ export default {
|
|||||||
// });
|
// });
|
||||||
|
|
||||||
// new code
|
// new code
|
||||||
console.log('start of new');
|
// console.log('start of new');
|
||||||
let files = this.$refs.att.files;
|
let files = this.$refs.att.files;
|
||||||
this.uploads = files.length;
|
this.uploads = files.length;
|
||||||
// loop all files and create attachments.
|
// loop all files and create attachments.
|
||||||
for (let i in files) {
|
for (let i in files) {
|
||||||
if (files.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
if (files.hasOwnProperty(i) && /^0$|^[1-9]\d*$/.test(i) && i <= 4294967294) {
|
||||||
console.log('Now at file ' + (parseInt(i) + 1) + ' / ' + files.length);
|
// console.log('Now at file ' + (parseInt(i) + 1) + ' / ' + files.length);
|
||||||
// read file into file reader:
|
// read file into file reader:
|
||||||
let current = files[i];
|
let current = files[i];
|
||||||
let fileReader = new FileReader();
|
let fileReader = new FileReader();
|
||||||
let theParent = this; // dont ask me why i need to do this.
|
let theParent = this; // dont ask me why i need to do this.
|
||||||
fileReader.onloadend = evt => {
|
fileReader.onloadend = evt => {
|
||||||
if (evt.target.readyState === FileReader.DONE) {
|
if (evt.target.readyState === FileReader.DONE) {
|
||||||
console.log('I am done reading file ' + (parseInt(i) + 1));
|
// console.log('I am done reading file ' + (parseInt(i) + 1));
|
||||||
this.createAttachment(current.name).then(response => {
|
this.createAttachment(current.name).then(response => {
|
||||||
console.log('Created attachment. Now upload (1)');
|
// console.log('Created attachment. Now upload (1)');
|
||||||
return theParent.uploadAttachment(response.data.data.id, new Blob([evt.target.result]));
|
return theParent.uploadAttachment(response.data.data.id, new Blob([evt.target.result]));
|
||||||
}).then(theParent.countAttachment);
|
}).then(theParent.countAttachment);
|
||||||
}
|
}
|
||||||
@ -121,7 +121,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (0 === files.length) {
|
if (0 === files.length) {
|
||||||
console.log('No files to upload. Emit event!');
|
// console.log('No files to upload. Emit event!');
|
||||||
this.$emit('uploaded-attachments', this.transaction_journal_id);
|
this.$emit('uploaded-attachments', this.transaction_journal_id);
|
||||||
}
|
}
|
||||||
// Promise.all(promises).then(response => {
|
// Promise.all(promises).then(response => {
|
||||||
@ -138,15 +138,15 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
countAttachment: function () {
|
countAttachment: function () {
|
||||||
this.uploaded++;
|
this.uploaded++;
|
||||||
console.log('Uploaded ' + this.uploaded + ' / ' + this.uploads);
|
// console.log('Uploaded ' + this.uploaded + ' / ' + this.uploads);
|
||||||
if (this.uploaded >= this.uploads) {
|
if (this.uploaded >= this.uploads) {
|
||||||
console.log('All files uploaded. Emit event for ' + this.uploadObjectId);
|
// console.log('All files uploaded. Emit event for ' + this.uploadObjectId);
|
||||||
this.$emit('uploaded-attachments', this.uploadObjectId);
|
this.$emit('uploaded-attachments', this.uploadObjectId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
uploadAttachment: function (attachmentId, data) {
|
uploadAttachment: function (attachmentId, data) {
|
||||||
this.created++;
|
this.created++;
|
||||||
console.log('Now in uploadAttachment()');
|
// console.log('Now in uploadAttachment()');
|
||||||
const uploadUri = './api/v1/attachments/' + attachmentId + '/upload';
|
const uploadUri = './api/v1/attachments/' + attachmentId + '/upload';
|
||||||
return axios.post(uploadUri, data)
|
return axios.post(uploadUri, data)
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
const lodashClonedeep = require('lodash.clonedeep');
|
const lodashClonedeep = require('lodash.clonedeep');
|
||||||
|
|
||||||
import {getDefaultTransaction, getDefaultErrors} from '../../../../shared/transactions';
|
import {getDefaultErrors, getDefaultTransaction} from '../../../../shared/transactions';
|
||||||
|
|
||||||
// initial state
|
// initial state
|
||||||
const state = () => ({
|
const state = () => ({
|
||||||
@ -100,6 +100,7 @@ const mutations = {
|
|||||||
state.transactions[payload.index].errors = lodashClonedeep(state.defaultErrors);
|
state.transactions[payload.index].errors = lodashClonedeep(state.defaultErrors);
|
||||||
},
|
},
|
||||||
resetTransactions(state) {
|
resetTransactions(state) {
|
||||||
|
// console.log('Store: Record call to resetTransactions :(');
|
||||||
state.transactions = [];
|
state.transactions = [];
|
||||||
},
|
},
|
||||||
setGroupTitle(state, payload) {
|
setGroupTitle(state, payload) {
|
||||||
@ -109,12 +110,13 @@ const mutations = {
|
|||||||
state.customDateFields = payload;
|
state.customDateFields = payload;
|
||||||
},
|
},
|
||||||
deleteTransaction(state, payload) {
|
deleteTransaction(state, payload) {
|
||||||
|
// console.log('Record call to deleteTransaction!');
|
||||||
state.transactions.splice(payload.index, 1);
|
state.transactions.splice(payload.index, 1);
|
||||||
// console.log('Deleted transaction ' + payload.index);
|
// console.log('Deleted transaction ' + payload.index);
|
||||||
// console.log(state.transactions);
|
// console.log(state.transactions);
|
||||||
if (0 === state.transactions.length) {
|
// if (0 === state.transactions.length) {
|
||||||
// console.log('array is empty!');
|
// console.log('array is empty!');
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
setTransactionType(state, transactionType) {
|
setTransactionType(state, transactionType) {
|
||||||
state.transactionType = transactionType;
|
state.transactionType = transactionType;
|
||||||
|
@ -221,7 +221,7 @@ export default {
|
|||||||
]
|
]
|
||||||
),
|
),
|
||||||
addTransactionArray: function (event) {
|
addTransactionArray: function (event) {
|
||||||
console.log('Record call to addTransactionArray');
|
// console.log('Record call to addTransactionArray');
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.addTransaction();
|
this.addTransaction();
|
||||||
},
|
},
|
||||||
@ -229,8 +229,8 @@ export default {
|
|||||||
* Removes a split from the array.
|
* Removes a split from the array.
|
||||||
*/
|
*/
|
||||||
removeTransaction: function (payload) {
|
removeTransaction: function (payload) {
|
||||||
console.log('Record call to removeTransaction');
|
// console.log('Record call to removeTransaction');
|
||||||
console.log('Triggered to remove transaction ' + payload.index);
|
// console.log('Triggered to remove transaction ' + payload.index);
|
||||||
window.$('#tab_split_' + (payload.index - 1)).click();
|
window.$('#tab_split_' + (payload.index - 1)).click();
|
||||||
this.$store.commit('transactions/create/deleteTransaction', payload);
|
this.$store.commit('transactions/create/deleteTransaction', payload);
|
||||||
},
|
},
|
||||||
|
@ -153,7 +153,7 @@ export default {
|
|||||||
this.getTransactionList();
|
this.getTransactionList();
|
||||||
},
|
},
|
||||||
jumpToPage: function (event) {
|
jumpToPage: function (event) {
|
||||||
console.log('noticed a change in transactions/index.vue!');
|
// console.log('noticed a change in transactions/index.vue!');
|
||||||
this.currentPage = event.page;
|
this.currentPage = event.page;
|
||||||
this.downloadTransactionList(event.page);
|
this.downloadTransactionList(event.page);
|
||||||
},
|
},
|
||||||
|
@ -209,6 +209,7 @@
|
|||||||
<TransactionTags
|
<TransactionTags
|
||||||
v-model="transaction.tags"
|
v-model="transaction.tags"
|
||||||
v-on="$listeners"
|
v-on="$listeners"
|
||||||
|
ref="tags"
|
||||||
:errors="transaction.errors.tags"
|
:errors="transaction.errors.tags"
|
||||||
:index="index"
|
:index="index"
|
||||||
/>
|
/>
|
||||||
@ -381,12 +382,13 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
removeTransaction: function () {
|
removeTransaction: function () {
|
||||||
// console.log('Will remove transaction ' + this.index);
|
// console.log('Will remove transaction ' + this.index);
|
||||||
|
|
||||||
this.$emit('remove-transaction', {index: this.index});
|
this.$emit('remove-transaction', {index: this.index});
|
||||||
},
|
},
|
||||||
triggerNextAccount: function(e) {
|
triggerNextAccount: function(e) {
|
||||||
//alert(e);
|
//alert(e);
|
||||||
if('source' === e) {
|
if('source' === e) {
|
||||||
console.log('Jump to destination!');
|
// console.log('Jump to destination!');
|
||||||
this.$refs.destinationAccount.giveFocus();
|
this.$refs.destinationAccount.giveFocus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,12 +19,16 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<div>
|
||||||
|
<span>Length: {{ this.transactions.length }}</span>
|
||||||
|
|
||||||
<div v-if="transactions.length > 1" class="row">
|
<div v-if="transactions.length > 1" class="row">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<!-- tabs -->
|
<!-- tabs -->
|
||||||
<ul class="nav nav-pills ml-auto p-2" id="transactionTabs">
|
<ul class="nav nav-pills ml-auto p-2" id="transactionTabs">
|
||||||
<li v-for="(transaction, index) in this.transactions" class="nav-item"><a :class="'nav-link' + (0 === index ? ' active' : '')"
|
<li v-for="(transaction, index) in this.transactions" class="nav-item"><a :class="'nav-link' + (0 === index ? ' active' : '')"
|
||||||
:href="'#split_' + index"
|
:href="'#split_' + index"
|
||||||
|
:id="'tab_split_' + index"
|
||||||
data-toggle="pill">
|
data-toggle="pill">
|
||||||
<span v-if="'' !== transaction.description">{{ transaction.description }}</span>
|
<span v-if="'' !== transaction.description">{{ transaction.description }}</span>
|
||||||
<span v-if="'' === transaction.description">Split {{ index + 1 }}</span>
|
<span v-if="'' === transaction.description">Split {{ index + 1 }}</span>
|
||||||
@ -32,6 +36,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -116,15 +116,22 @@ export default {
|
|||||||
// console.log('TransactionAccount::created() direction=' + this.direction + ', type=' + this.transactionType + ' , name="' + this.accountName + '"');
|
// console.log('TransactionAccount::created() direction=' + this.direction + ', type=' + this.transactionType + ' , name="' + this.accountName + '"');
|
||||||
this.selectedAccountTrigger = true;
|
this.selectedAccountTrigger = true;
|
||||||
},
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
if (0 === this.index) {
|
||||||
|
this.$refs.inputThing.$refs.input.tabIndex = 2;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getACURL: function (types, query) {
|
getACURL: function (types, query) {
|
||||||
return './api/v1/autocomplete/accounts?types=' + types.join(',') + '&query=' + query;
|
return './api/v1/autocomplete/accounts?types=' + types.join(',') + '&query=' + query;
|
||||||
},
|
},
|
||||||
giveFocus: function () {
|
giveFocus: function () {
|
||||||
console.log('I want focus! now OK: ' + this.direction + ' l: ' + this.accounts.length);
|
//console.log('I want focus! now OK: ' + this.direction + ' l: ' + this.accounts.length);
|
||||||
//console.log(this.$refs.inputThing.$refs.input.value);
|
//console.log(this.$refs.inputThing.$refs.input.value);
|
||||||
this.$refs.inputThing.$refs.input.focus();
|
this.$refs.inputThing.$refs.input.focus();
|
||||||
console.log(this.$refs.inputThing.isFocused);
|
//console.log(this.$refs.inputThing.isFocused);
|
||||||
},
|
},
|
||||||
userSelectedAccount: function (event) {
|
userSelectedAccount: function (event) {
|
||||||
// console.log('userSelectedAccount!');
|
// console.log('userSelectedAccount!');
|
||||||
|
@ -69,6 +69,13 @@ export default {
|
|||||||
this.transactionAmount = this.formatNumber(this.amount);
|
this.transactionAmount = this.formatNumber(this.amount);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
if (0 === this.index) {
|
||||||
|
this.$refs.input.tabIndex = 3;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatNumber(str) {
|
formatNumber(str) {
|
||||||
return parseFloat(str).toFixed(this.fractionDigits);
|
return parseFloat(str).toFixed(this.fractionDigits);
|
||||||
|
@ -52,6 +52,11 @@ export default {
|
|||||||
bill: this.value,
|
bill: this.value,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$refs.bill.tabIndex = 9;
|
||||||
|
})
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.collectData();
|
this.collectData();
|
||||||
},
|
},
|
||||||
|
@ -52,6 +52,11 @@ export default {
|
|||||||
emitEvent: true
|
emitEvent: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$refs.budget.tabIndex = 8;
|
||||||
|
})
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.collectData();
|
this.collectData();
|
||||||
},
|
},
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
inputName="category[]"
|
inputName="category[]"
|
||||||
@hit="selectedCategory = $event"
|
@hit="selectedCategory = $event"
|
||||||
@input="lookupCategory"
|
@input="lookupCategory"
|
||||||
|
ref="input"
|
||||||
>
|
>
|
||||||
<template slot="append">
|
<template slot="append">
|
||||||
<div class="input-group-append">
|
<div class="input-group-append">
|
||||||
@ -64,7 +65,11 @@ export default {
|
|||||||
category: this.value
|
category: this.value
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$refs.input.$refs.input.tabIndex = 10;
|
||||||
|
})
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
//console.log('Created category(' + this.index + ') "' + this.value + '"');
|
//console.log('Created category(' + this.index + ') "' + this.value + '"');
|
||||||
// initial list of accounts:
|
// initial list of accounts:
|
||||||
|
@ -67,7 +67,14 @@ export default {
|
|||||||
let parts = this.date.split('T');
|
let parts = this.date.split('T');
|
||||||
this.dateStr = parts[0];
|
this.dateStr = parts[0];
|
||||||
this.timeStr = parts[1];
|
this.timeStr = parts[1];
|
||||||
|
},
|
||||||
|
mounted: function () {
|
||||||
|
if (0 === this.index) {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$refs.date.tabIndex = 6;
|
||||||
|
this.$refs.time.tabIndex = 7;
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
name="foreign_amount[]"
|
name="foreign_amount[]"
|
||||||
type="number"
|
type="number"
|
||||||
|
ref="input"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<span v-if="errors.length > 0">
|
<span v-if="errors.length > 0">
|
||||||
@ -66,6 +67,11 @@ export default {
|
|||||||
this.amount = this.formatNumber(this.amount);
|
this.amount = this.formatNumber(this.amount);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$refs.input.tabIndex = 5;
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatNumber(str) {
|
formatNumber(str) {
|
||||||
return parseFloat(str).toFixed(this.fractionDigits);
|
return parseFloat(str).toFixed(this.fractionDigits);
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
<div v-if="isVisible" class="form-group">
|
<div v-if="isVisible" class="form-group">
|
||||||
<div class="text-xs"> </div>
|
<div class="text-xs"> </div>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<select v-model="selectedCurrency" class="form-control" name="foreign_currency_id[]">
|
<select v-model="selectedCurrency" class="form-control" ref="input" name="foreign_currency_id[]">
|
||||||
<option v-for="currency in selectableCurrencies" :label="currency.name" :value="currency.id">{{ currency.name }}</option>
|
<option v-for="currency in selectableCurrencies" :label="currency.name" :value="currency.id">{{ currency.name }}</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -77,6 +77,11 @@ export default {
|
|||||||
// console.log('Created TransactionForeignCurrency');
|
// console.log('Created TransactionForeignCurrency');
|
||||||
this.getAllCurrencies();
|
this.getAllCurrencies();
|
||||||
},
|
},
|
||||||
|
mounted: function () {
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.$refs.input.tabIndex = 4;
|
||||||
|
})
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
lockCurrency: function () {
|
lockCurrency: function () {
|
||||||
// console.log('Lock currency (' + this.transactionType + ')');
|
// console.log('Lock currency (' + this.transactionType + ')');
|
||||||
|
@ -225,12 +225,12 @@ export default {
|
|||||||
this.$emit('jump-page', {page: value});
|
this.$emit('jump-page', {page: value});
|
||||||
},
|
},
|
||||||
entries: function (value) {
|
entries: function (value) {
|
||||||
console.log('detected new transactions! (' + value.length + ')');
|
// console.log('detected new transactions! (' + value.length + ')');
|
||||||
this.parseTransactions();
|
this.parseTransactions();
|
||||||
},
|
},
|
||||||
value: function (value) {
|
// value: function (value) {
|
||||||
console.log('Watch value!');
|
// // console.log('Watch value!');
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations('root', ['refreshCacheKey',]),
|
...mapMutations('root', ['refreshCacheKey',]),
|
||||||
@ -239,10 +239,10 @@ export default {
|
|||||||
// console.log('Start of parseTransactions. Count of entries is ' + this.entries.length + ' and page is ' + this.page);
|
// console.log('Start of parseTransactions. Count of entries is ' + this.entries.length + ' and page is ' + this.page);
|
||||||
// console.log('Reported total is ' + this.total);
|
// console.log('Reported total is ' + this.total);
|
||||||
if (0 === this.entries.length) {
|
if (0 === this.entries.length) {
|
||||||
console.log('Will not render now because length is 0.');
|
// console.log('Will not render now because length is 0.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('Now have ' + this.transactions.length + ' transactions');
|
// console.log('Now have ' + this.transactions.length + ' transactions');
|
||||||
for (let i = 0; i < this.total; i++) {
|
for (let i = 0; i < this.total; i++) {
|
||||||
this.transactions.push({dummy: true, type: 'x'});
|
this.transactions.push({dummy: true, type: 'x'});
|
||||||
// console.log('Push dummy to index ' + i);
|
// console.log('Push dummy to index ' + i);
|
||||||
@ -270,7 +270,7 @@ export default {
|
|||||||
},
|
},
|
||||||
newCacheKey: function () {
|
newCacheKey: function () {
|
||||||
this.refreshCacheKey();
|
this.refreshCacheKey();
|
||||||
console.log('Cache key is now ' + this.cacheKey);
|
// console.log('Cache key is now ' + this.cacheKey);
|
||||||
this.$emit('refreshed-cache-key');
|
this.$emit('refreshed-cache-key');
|
||||||
},
|
},
|
||||||
updateFieldList: function () {
|
updateFieldList: function () {
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
:add-only-from-autocomplete="false"
|
:add-only-from-autocomplete="false"
|
||||||
:autocomplete-items="autocompleteItems"
|
:autocomplete-items="autocompleteItems"
|
||||||
:tags="tags"
|
:tags="tags"
|
||||||
|
ref="input"
|
||||||
:title="$t('firefly.tags')"
|
:title="$t('firefly.tags')"
|
||||||
v-bind:placeholder="$t('firefly.tags')"
|
v-bind:placeholder="$t('firefly.tags')"
|
||||||
@tags-changed="newTags => this.tags = newTags"
|
@tags-changed="newTags => this.tags = newTags"
|
||||||
|
Loading…
Reference in New Issue
Block a user