change selectbox vue files..
This commit is contained in:
parent
bc4735d178
commit
966b6800c0
@ -15,7 +15,13 @@
|
|||||||
:multiple="multiple"
|
:multiple="multiple"
|
||||||
:readonly="readonly"
|
:readonly="readonly"
|
||||||
:collapse-tags="collapse"
|
:collapse-tags="collapse"
|
||||||
|
:loading="loading"
|
||||||
>
|
>
|
||||||
|
<div v-if="loading" class="el-select-dropdown__wrap" slot="empty">
|
||||||
|
<p class="el-select-dropdown__empty loading">
|
||||||
|
{{ loadingText }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="addNew.status && options.length != 0" class="el-select-dropdown__wrap" slot="empty">
|
<div v-if="addNew.status && options.length != 0" class="el-select-dropdown__wrap" slot="empty">
|
||||||
<p class="el-select-dropdown__empty">
|
<p class="el-select-dropdown__empty">
|
||||||
@ -81,7 +87,7 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-option-group>
|
</el-option-group>
|
||||||
|
|
||||||
<el-option v-if="addNew.status && options.length != 0" class="el-select__footer" :disabled="true" :value="add_new">
|
<el-option v-if="!loading && addNew.status && options.length != 0" class="el-select__footer" :disabled="disabled" :value="add_new">
|
||||||
<div @click="onAddItem">
|
<div @click="onAddItem">
|
||||||
<i class="fas fa-plus"></i>
|
<i class="fas fa-plus"></i>
|
||||||
<span>
|
<span>
|
||||||
@ -245,6 +251,12 @@ export default {
|
|||||||
description: "Selectbox collapse status"
|
description: "Selectbox collapse status"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadingText: {
|
||||||
|
type: String,
|
||||||
|
default: 'Loading...',
|
||||||
|
description: "Selectbox loading message"
|
||||||
|
},
|
||||||
|
|
||||||
noDataText: {
|
noDataText: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'No Data',
|
default: 'No Data',
|
||||||
@ -275,6 +287,7 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
sort_options: [],
|
sort_options: [],
|
||||||
new_options: {},
|
new_options: {},
|
||||||
|
loading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -18,8 +18,13 @@
|
|||||||
:remote-method="remoteMethod"
|
:remote-method="remoteMethod"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
>
|
>
|
||||||
|
<div v-if="loading" class="el-select-dropdown__wrap" slot="empty">
|
||||||
|
<p class="el-select-dropdown__empty loading">
|
||||||
|
{{ loadingText }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="addNew.status && options.length != 0" class="el-select-dropdown__wrap" slot="empty">
|
<div v-if="!loading && addNew.status && options.length != 0" class="el-select-dropdown__wrap" slot="empty">
|
||||||
<p class="el-select-dropdown__empty">
|
<p class="el-select-dropdown__empty">
|
||||||
{{ noMatchingDataText }}
|
{{ noMatchingDataText }}
|
||||||
</p>
|
</p>
|
||||||
@ -36,7 +41,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="addNew.status && options.length == 0" slot="empty">
|
<div v-else-if="!loading && addNew.status && options.length == 0" slot="empty">
|
||||||
<p class="el-select-dropdown__empty">
|
<p class="el-select-dropdown__empty">
|
||||||
{{ noDataText }}
|
{{ noDataText }}
|
||||||
</p>
|
</p>
|
||||||
@ -70,11 +75,11 @@
|
|||||||
<el-option-group
|
<el-option-group
|
||||||
v-if="group"
|
v-if="group"
|
||||||
v-for="(group_options, group_index) in sortOptions"
|
v-for="(group_options, group_index) in sortOptions"
|
||||||
:key="group_options.key"
|
:key="group_index"
|
||||||
:label="group_options.key">
|
:label="group_options.key">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(option, option_index) in group_options.value"
|
v-for="(option, option_index) in group_options.value"
|
||||||
:key="option.option_index"
|
:key="option_index"
|
||||||
:disabled="disabledOptions.includes(option.key)"
|
:disabled="disabledOptions.includes(option.key)"
|
||||||
:label="option.value"
|
:label="option.value"
|
||||||
:value="option.key">
|
:value="option.key">
|
||||||
@ -83,7 +88,7 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-option-group>
|
</el-option-group>
|
||||||
|
|
||||||
<el-option v-if="addNew.status && options.length != 0" class="el-select__footer" :disabled="true" :value="add_new">
|
<el-option v-if="!loading && addNew.status && options.length != 0" class="el-select__footer" :disabled="disabled" :value="add_new">
|
||||||
<div @click="onAddItem">
|
<div @click="onAddItem">
|
||||||
<i class="fas fa-plus"></i>
|
<i class="fas fa-plus"></i>
|
||||||
<span>
|
<span>
|
||||||
@ -114,8 +119,13 @@
|
|||||||
:remote-method="remoteMethod"
|
:remote-method="remoteMethod"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
>
|
>
|
||||||
|
<div v-if="loading" class="el-select-dropdown__wrap" slot="empty">
|
||||||
|
<p class="el-select-dropdown__empty loading">
|
||||||
|
{{ loadingText }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="addNew.status && options.length != 0" class="el-select-dropdown__wrap" slot="empty">
|
<div v-if="!loading && addNew.status && options.length != 0" class="el-select-dropdown__wrap" slot="empty">
|
||||||
<p class="el-select-dropdown__empty">
|
<p class="el-select-dropdown__empty">
|
||||||
{{ noMatchingDataText }}
|
{{ noMatchingDataText }}
|
||||||
</p>
|
</p>
|
||||||
@ -132,7 +142,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else-if="addNew.status && options.length == 0" slot="empty">
|
<div v-else-if="!loading && addNew.status && options.length == 0" slot="empty">
|
||||||
<p class="el-select-dropdown__empty">
|
<p class="el-select-dropdown__empty">
|
||||||
{{ noDataText }}
|
{{ noDataText }}
|
||||||
</p>
|
</p>
|
||||||
@ -166,7 +176,7 @@
|
|||||||
<el-option-group
|
<el-option-group
|
||||||
v-if="group"
|
v-if="group"
|
||||||
v-for="(group_options, group_index) in sortOptions"
|
v-for="(group_options, group_index) in sortOptions"
|
||||||
:key="group_options.key"
|
:key="group_index"
|
||||||
:label="group_options.key">
|
:label="group_options.key">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="(option, option_index) in group_options.value"
|
v-for="(option, option_index) in group_options.value"
|
||||||
@ -179,7 +189,7 @@
|
|||||||
</el-option>
|
</el-option>
|
||||||
</el-option-group>
|
</el-option-group>
|
||||||
|
|
||||||
<el-option v-if="addNew.status && options.length != 0" class="el-select__footer" :disabled="true" :value="add_new">
|
<el-option v-if="!loading && addNew.status && options.length != 0" class="el-select__footer" :disabled="disabled" :value="add_new">
|
||||||
<div @click="onAddItem">
|
<div @click="onAddItem">
|
||||||
<i class="fas fa-plus"></i>
|
<i class="fas fa-plus"></i>
|
||||||
<span>
|
<span>
|
||||||
@ -818,25 +828,55 @@ export default {
|
|||||||
if (!this.multiple) {
|
if (!this.multiple) {
|
||||||
this.selected = selected.toString();
|
this.selected = selected.toString();
|
||||||
} else {
|
} else {
|
||||||
let is_string = false;
|
if (Array.isArray(this.selected) && !this.selected.length) {
|
||||||
let pre_value = [];
|
this.selected = selected;
|
||||||
|
} else {
|
||||||
|
let is_string = false;
|
||||||
|
let pre_value = [];
|
||||||
|
|
||||||
selected.forEach(item => {
|
selected.forEach(item => {
|
||||||
if (typeof item != 'string') {
|
if (typeof item != 'string') {
|
||||||
is_string = true;
|
is_string = true;
|
||||||
pre_value.push(item.toString());
|
pre_value.push(item.toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (is_string) {
|
||||||
|
this.selected = pre_value;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
if (is_string) {
|
|
||||||
this.selected = pre_value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
value: function (selected) {
|
value: function (selected) {
|
||||||
if (!this.multiple) {
|
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 {
|
} else {
|
||||||
let is_string = false;
|
let is_string = false;
|
||||||
let pre_value = [];
|
let pre_value = [];
|
||||||
@ -855,12 +895,6 @@ export default {
|
|||||||
|
|
||||||
this.change();
|
this.change();
|
||||||
},
|
},
|
||||||
|
|
||||||
model: function (selected) {
|
|
||||||
this.selected = selected;
|
|
||||||
|
|
||||||
this.change();
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -874,6 +908,10 @@ export default {
|
|||||||
padding: 10px 0 0 !important;
|
padding: 10px 0 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.el-select-dropdown__empty.loading {
|
||||||
|
padding: 10px 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.el-select__footer {
|
.el-select__footer {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border-top: 1px solid #dee2e6;
|
border-top: 1px solid #dee2e6;
|
||||||
|
@ -27,16 +27,16 @@
|
|||||||
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
@if (in_array(setting('localisation.discount_location', 'total'), ['item', 'both']))
|
||||||
@stack('item_discount_td_start')
|
@stack('item_discount_td_start')
|
||||||
<tr id="tr-subtotal">
|
<tr id="tr-subtotal">
|
||||||
<td class="border-top-0 pb-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pb-0">
|
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0">
|
||||||
<strong>{{ trans('invoices.item_discount') }}</strong>
|
<strong>{{ trans('invoices.item_discount') }}</strong>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0">
|
<td class="text-right border-top-0 border-bottom-0 long-texts pt-0 pb-0">
|
||||||
<div>
|
<div>
|
||||||
{{ 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') }}
|
{{ 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') }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="border-top-0 pb-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
</tr>
|
</tr>
|
||||||
@stack('item_discount_td_end')
|
@stack('item_discount_td_end')
|
||||||
@endif
|
@endif
|
||||||
@ -44,8 +44,8 @@
|
|||||||
@if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both']))
|
@if (in_array(setting('localisation.discount_location', 'total'), ['total', 'both']))
|
||||||
@stack('add_discount_td_start')
|
@stack('add_discount_td_start')
|
||||||
<tr id="tr-discount">
|
<tr id="tr-discount">
|
||||||
<td class="border-top-0 pb-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pb-0">
|
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0">
|
||||||
<el-popover
|
<el-popover
|
||||||
popper-class="p-0 h-0"
|
popper-class="p-0 h-0"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
@ -86,13 +86,13 @@
|
|||||||
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
|
<el-link slot="reference" type="primary" v-if="totals.discount_text" v-html="totals.discount_text"></el-link>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right border-top-0 border-bottom-0 pb-0">
|
<td class="text-right border-top-0 border-bottom-0 pt-0 pb-0">
|
||||||
<div>
|
<div>
|
||||||
{{ 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::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') }}
|
||||||
</div>
|
</div>
|
||||||
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
|
{!! Form::hidden('discount', null, ['id' => 'discount', 'class' => 'form-control text-right', 'v-model' => 'form.discount']) !!}
|
||||||
</td>
|
</td>
|
||||||
<td class="border-top-0 pb-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
</tr>
|
</tr>
|
||||||
@stack('add_discount_td_end')
|
@stack('add_discount_td_end')
|
||||||
@endif
|
@endif
|
||||||
@ -100,8 +100,8 @@
|
|||||||
@stack('tax_total_td_start')
|
@stack('tax_total_td_start')
|
||||||
<tr v-for="(tax, tax_index) in totals.taxes"
|
<tr v-for="(tax, tax_index) in totals.taxes"
|
||||||
:index="tax_index">
|
:index="tax_index">
|
||||||
<td class="border-top-0 pb-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pb-0">
|
<td class="text-right border-top-0 border-right-0 border-bottom-0 align-middle pt-0 pb-0">
|
||||||
<strong v-html="tax.name"></strong>
|
<strong v-html="tax.name"></strong>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0">
|
<td class="text-right border-top-0 border-bottom-0 long-texts pb-0">
|
||||||
@ -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') }}
|
{{ 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') }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="border-top-0 pb-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
</tr>
|
</tr>
|
||||||
@stack('tax_total_td_end')
|
@stack('tax_total_td_end')
|
||||||
|
|
||||||
@stack('grand_total_td_start')
|
@stack('grand_total_td_start')
|
||||||
<tr id="tr-total">
|
<tr id="tr-total">
|
||||||
<td class="border-top-0 pb-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
<td class="text-right border-top-0 border-right-0 align-middle pb-0">
|
<td class="text-right border-top-0 border-right-0 align-middle pt-0 pb-0">
|
||||||
<strong class="document-total-span">{{ trans('invoices.total') }}</strong>
|
<strong class="document-total-span">{{ trans('invoices.total') }}</strong>
|
||||||
{{ Form::selectGroup('currency_code', '', 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'model' => 'form.currency_code', 'change' => 'onChangeCurrency'], 'document-total-currency') }}
|
{{ Form::selectGroup('currency_code', '', 'exchange-alt', $currencies, setting('default.currency'), ['required' => 'required', 'model' => 'form.currency_code', 'change' => 'onChangeCurrency'], 'document-total-currency') }}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-right border-top-0 long-texts pb-0">
|
<td class="text-right border-top-0 long-texts pt-0 pb-0">
|
||||||
<div>
|
<div>
|
||||||
{{ 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') }}
|
{{ 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') }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="border-top-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
</tr>
|
</tr>
|
||||||
@stack('grand_total_td_end')
|
@stack('grand_total_td_end')
|
||||||
|
|
||||||
@stack('currency_conversion_td_start')
|
@stack('currency_conversion_td_start')
|
||||||
<tr id="tr-currency-conversion" class="d-none" :class="[{'d-table-row': (('{{ setting('default.currency') }}' != form.currency_code) && totals.total)}]">
|
<tr id="tr-currency-conversion" class="d-none" :class="[{'d-table-row': (('{{ setting('default.currency') }}' != form.currency_code) && totals.total)}]">
|
||||||
<td class="border-top-0 pb-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
<td class="text-right border-top-0 border-right-0 align-middle pb-0" colspan="2">
|
<td class="text-right border-top-0 border-right-0 align-middle pt-0 pb-0" colspan="2">
|
||||||
<akaunting-currency-conversion
|
<akaunting-currency-conversion
|
||||||
currency-conversion-text="{{ trans('currencies.conversion') }}"
|
currency-conversion-text="{{ trans('currencies.conversion') }}"
|
||||||
:price="(totals.total / form.currency_rate).toFixed(2)"
|
:price="(totals.total / form.currency_rate).toFixed(2)"
|
||||||
@ -140,7 +140,7 @@
|
|||||||
:currency-rate="form.currency_rate"
|
:currency-rate="form.currency_rate"
|
||||||
></akaunting-currency-conversion>
|
></akaunting-currency-conversion>
|
||||||
</td>
|
</td>
|
||||||
<td class="border-top-0"></td>
|
<td class="border-top-0 pt-0 pb-0"></td>
|
||||||
</tr>
|
</tr>
|
||||||
@stack('currency_conversion_td_end')
|
@stack('currency_conversion_td_end')
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
{!! Form::label($name, $text, ['class' => 'form-control-label'])!!}
|
{!! Form::label($name, $text, ['class' => 'form-control-label'])!!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<div class="custom-file">
|
<div class="input-group input-group-merge">
|
||||||
<dropzone-file-upload
|
<dropzone-file-upload
|
||||||
@if (!empty($attributes['options']))
|
@if (!empty($attributes['options']))
|
||||||
options={{ json_encode($attributes['options']) }}
|
options={{ json_encode($attributes['options']) }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user