From 966b6800c0366e71789daab181f07d1313ac8a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 30 Dec 2020 11:11:39 +0300 Subject: [PATCH] change selectbox vue files.. --- .../assets/js/components/AkauntingSelect.vue | 15 +++- .../js/components/AkauntingSelectRemote.vue | 90 +++++++++++++------ .../documents/form/totals.blade.php | 36 ++++---- .../views/partials/form/file_group.blade.php | 2 +- 4 files changed, 97 insertions(+), 46 deletions(-) diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 693c8876c..5a9fb0548 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -15,7 +15,13 @@ :multiple="multiple" :readonly="readonly" :collapse-tags="collapse" + :loading="loading" > +
+

+ {{ loadingText }} +

+

@@ -81,7 +87,7 @@ - +

@@ -245,6 +251,12 @@ export default { description: "Selectbox collapse status" }, + loadingText: { + type: String, + default: 'Loading...', + description: "Selectbox loading message" + }, + noDataText: { type: String, default: 'No Data', @@ -275,6 +287,7 @@ export default { form: {}, sort_options: [], new_options: {}, + loading: false, } }, diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index e69466d9e..ed67ff1a8 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -18,8 +18,13 @@ :remote-method="remoteMethod" :loading="loading" > +
+

+ {{ loadingText }} +

+
-
+

{{ noMatchingDataText }}

@@ -36,7 +41,7 @@
-
+

{{ noDataText }}

@@ -70,11 +75,11 @@ @@ -83,7 +88,7 @@ - +
@@ -114,8 +119,13 @@ :remote-method="remoteMethod" :loading="loading" > +
+

+ {{ loadingText }} +

+
-
+

{{ noMatchingDataText }}

@@ -132,7 +142,7 @@
-
+

{{ noDataText }}

@@ -166,7 +176,7 @@ - +
@@ -818,25 +828,55 @@ export default { if (!this.multiple) { this.selected = selected.toString(); } else { - let is_string = false; - let pre_value = []; + if (Array.isArray(this.selected) && !this.selected.length) { + this.selected = selected; + } else { + let is_string = false; + let pre_value = []; - selected.forEach(item => { - if (typeof item != 'string') { - is_string = true; - pre_value.push(item.toString()); + selected.forEach(item => { + if (typeof item != 'string') { + is_string = true; + pre_value.push(item.toString()); + } + }); + + if (is_string) { + this.selected = pre_value; } - }); - - if (is_string) { - this.selected = pre_value; } } }, value: function (selected) { if (!this.multiple) { - this.selected = selected; + this.selected = selected.toString(); + } else { + if (Array.isArray(this.selected) && !this.selected.length) { + this.selected = selected; + } else { + let is_string = false; + let pre_value = []; + + selected.forEach(item => { + if (typeof item != 'string') { + is_string = true; + pre_value.push(item.toString()); + } + }); + + if (is_string) { + this.selected = pre_value; + } + } + } + + this.change(); + }, + + model: function (selected) { + if (!this.multiple) { + this.selected = selected.toString(); } else { let is_string = false; let pre_value = []; @@ -855,12 +895,6 @@ export default { this.change(); }, - - model: function (selected) { - this.selected = selected; - - this.change(); - }, }, } @@ -874,6 +908,10 @@ export default { padding: 10px 0 0 !important; } + .el-select-dropdown__empty.loading { + padding: 10px 0 !important; + } + .el-select__footer { text-align: center; border-top: 1px solid #dee2e6; diff --git a/resources/views/components/documents/form/totals.blade.php b/resources/views/components/documents/form/totals.blade.php index e90b56aa7..2b0be6ab3 100644 --- a/resources/views/components/documents/form/totals.blade.php +++ b/resources/views/components/documents/form/totals.blade.php @@ -27,16 +27,16 @@ @if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both'])) @stack('item_discount_td_start') - - + + {{ trans('invoices.item_discount') }} - +
{{ Form::moneyGroup('item_discount', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.item_discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
- + @stack('item_discount_td_end') @endif @@ -44,8 +44,8 @@ @if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both'])) @stack('add_discount_td_start') - - + + - +
{{ Form::moneyGroup('discount_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.discount', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!} - + @stack('add_discount_td_end') @endif @@ -100,8 +100,8 @@ @stack('tax_total_td_start') - - + + @@ -109,30 +109,30 @@ {{ Form::moneyGroup('tax_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'tax.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
- + @stack('tax_total_td_end') @stack('grand_total_td_start') - - + + {{ trans('invoices.total') }} {{ Form::selectGroup('currency_code', '', 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'model' => 'form.currency_code', 'change' => 'onChangeCurrency'], 'document-total-currency') }} - +
{{ Form::moneyGroup('grand_total', '', '', ['disabled' => 'true' , 'row-input' => 'true', 'v-model' => 'totals.total', 'currency' => $currency, 'dynamic-currency' => 'currency', 'money-class' => 'text-right disabled-money'], 0.00, 'text-right disabled-money') }}
- + @stack('grand_total_td_end') @stack('currency_conversion_td_start') - - + + - + @stack('currency_conversion_td_end') diff --git a/resources/views/partials/form/file_group.blade.php b/resources/views/partials/form/file_group.blade.php index dd8f65470..82871ff93 100644 --- a/resources/views/partials/form/file_group.blade.php +++ b/resources/views/partials/form/file_group.blade.php @@ -7,7 +7,7 @@ {!! Form::label($name, $text, ['class' => 'form-control-label'])!!} @endif -
+