Fix #4864 and relatred issues.

This commit is contained in:
James Cole
2021-06-20 18:39:15 +02:00
parent c9eeaf7e95
commit 2fa927266f
6 changed files with 14 additions and 25 deletions

View File

@@ -195,7 +195,7 @@ export default {
/** /**
* Grabbed from the store. * Grabbed from the store.
*/ */
...mapGetters('transactions/create', ['transactionType', 'transactions', 'groupTitle','defaultErrors']), ...mapGetters('transactions/create', ['transactionType', 'transactions', 'groupTitle', 'defaultErrors']),
...mapGetters('root', ['listPageSize']) ...mapGetters('root', ['listPageSize'])
}, },
watch: { watch: {
@@ -713,13 +713,20 @@ export default {
let current = array.tags[i]; let current = array.tags[i];
if (typeof current === 'object' && null !== current) { if (typeof current === 'object' && null !== current) {
currentSplit.tags.push(current.text); currentSplit.tags.push(current.text);
console.log('Add tag "' + current.text + '" from object.');
continue;
} }
if (typeof current === 'string') { if (typeof current === 'string') {
currentSplit.tags.push(current); currentSplit.tags.push(current);
console.log('Add tag "' + current + '" from string.');
continue;
}
console.log('Is neither.');
} }
} }
} }
} console.log('Current split tags is now: ');
console.log(currentSplit.tags);
// bills and piggy banks // bills and piggy banks
if (0 !== array.piggy_bank_id) { if (0 !== array.piggy_bank_id) {

View File

@@ -50,10 +50,10 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-lg-8 col-md-12 col-sm-12 col-xs-12"> <div class="col-lg-10 col-md-8 col-sm-12 col-xs-12">
<div class="card"> <div class="card">
<div class="card-body p-0"> <div class="card-body p-0">
<b-table id="my-table" striped hover responsive="md" primary-key="key" :no-local-sorting="false" <b-table id="my-table" small striped hover responsive="md" primary-key="key" :no-local-sorting="false"
:items="transactionRows" :items="transactionRows"
:fields="fields" :fields="fields"
:per-page="perPage" :per-page="perPage"
@@ -75,7 +75,7 @@
</span> </span>
</template> </template>
<template #cell(description)="data"> <template #cell(description)="data">
<span><span class="fas fa-angle-right" v-if="data.item.split && data.item.split_parent !== null"></span></span> <span class="fas fa-angle-right" v-if="data.item.split && data.item.split_parent !== null"></span>
<a :class="false === data.item.active ? 'text-muted' : ''" :href="'./transactions/show/' + data.item.id" :title="data.value">{{ <a :class="false === data.item.active ? 'text-muted' : ''" :href="'./transactions/show/' + data.item.id" :title="data.value">{{
data.value data.value
}}</a> }}</a>
@@ -139,7 +139,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col-lg-4"> <div class="col-lg-2 col-md-4">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
Box previous periods Box previous periods

View File

@@ -50,7 +50,6 @@ export default {
return { return {
billList: [], billList: [],
bill: this.value, bill: this.value,
emitEvent: true
} }
}, },
created() { created() {
@@ -93,11 +92,8 @@ export default {
this.bill = value; this.bill = value;
}, },
bill: function (value) { bill: function (value) {
if (true === this.emitEvent) {
this.$emit('set-field', {field: 'bill_id', index: this.index, value: value}); this.$emit('set-field', {field: 'bill_id', index: this.index, value: value});
} }
this.emitEvent = true;
}
}, },
} }
</script> </script>

View File

@@ -43,7 +43,6 @@ export default {
return { return {
notes: this.value, notes: this.value,
availableFields: this.customFields, availableFields: this.customFields,
emitEvent: true
} }
}, },
computed: { computed: {
@@ -56,18 +55,14 @@ export default {
}, },
watch: { watch: {
value: function (value) { value: function (value) {
this.emitEvent = false;
this.notes = value; this.notes = value;
}, },
customFields: function (value) { customFields: function (value) {
this.availableFields = value; this.availableFields = value;
}, },
notes: function (value) { notes: function (value) {
if (true === this.emitEvent) {
this.$emit('set-field', {field: 'notes', index: this.index, value: value}); this.$emit('set-field', {field: 'notes', index: this.index, value: value});
} }
this.emitEvent = true;
}
} }
} }
</script> </script>

View File

@@ -51,7 +51,6 @@ export default {
return { return {
piggyList: [], piggyList: [],
piggy_bank_id: this.value, piggy_bank_id: this.value,
emitEvent: true
} }
}, },
created() { created() {
@@ -90,13 +89,10 @@ export default {
}, },
watch: { watch: {
value: function (value) { value: function (value) {
this.emitEvent = false;
this.piggy_bank_id = value; this.piggy_bank_id = value;
}, },
piggy_bank_id: function (value) { piggy_bank_id: function (value) {
if (true === this.emitEvent) {
this.$emit('set-field', {field: 'piggy_bank_id', index: this.index, value: value}); this.$emit('set-field', {field: 'piggy_bank_id', index: this.index, value: value});
}
this.emitEvent = true; this.emitEvent = true;
} }
} }

View File

@@ -58,7 +58,6 @@ export default {
currentTag: '', currentTag: '',
updateTags: true, // the idea is that this is always true, except when the tags-function sets the value. updateTags: true, // the idea is that this is always true, except when the tags-function sets the value.
tagList: this.value, tagList: this.value,
emitEvent: true
}; };
}, },
created() { created() {
@@ -74,15 +73,11 @@ export default {
watch: { watch: {
'currentTag': 'initItems', 'currentTag': 'initItems',
value: function (value) { value: function (value) {
this.emitEvent = false;
this.tagList = value; this.tagList = value;
}, },
tagList: function (value) { tagList: function (value) {
// console.log('watch tagList'); // console.log('watch tagList');
if (true === this.emitEvent) {
this.$emit('set-field', {field: 'tags', index: this.index, value: value}); this.$emit('set-field', {field: 'tags', index: this.index, value: value});
}
this.emitEvent = true;
this.updateTags = false; this.updateTags = false;
this.tags = value; this.tags = value;
}, },