Lint & refactor

This commit is contained in:
benguozakinci@gmail.com 2021-08-25 11:58:33 +03:00
parent e1d73a2fd4
commit b43b726587

View File

@ -202,7 +202,7 @@ export default {
data() { data() {
return { return {
item_list: [], item_list: [],
invoiceItems: [], selected_items: [],
search: '', // search column model search: '', // search column model
show: { show: {
item_selected: false, item_selected: false,
@ -323,7 +323,6 @@ export default {
await window.axios.get(url + '/common/items?search="' + this.search + '" limit:10') await window.axios.get(url + '/common/items?search="' + this.search + '" limit:10')
.then(response => { .then(response => {
this.item_list = []; this.item_list = [];
let items = response.data.data; let items = response.data.data;
items.forEach(function (item, index) { items.forEach(function (item, index) {
@ -350,10 +349,10 @@ export default {
}, },
addItem(item) { addItem(item) {
this.invoiceItems.push(item); this.selected_items.push(item);
this.$emit('item', item); this.$emit('item', item);
this.$emit('items', this.invoiceItems); this.$emit('items', this.selected_items);
this.show.item_selected = false; this.show.item_selected = false;
this.show.item_list = false; this.show.item_list = false;
@ -513,7 +512,7 @@ export default {
return this.sortItems(); return this.sortItems();
}, },
currentIndex() { currentIndex() {
return this.invoiceItems.length; return this.selected_items.length;
}, },
}, },