change function name and add function in add new modal

This commit is contained in:
Cüneyt Şentürk 2020-02-14 15:56:07 +03:00
parent 6d207b6106
commit b311fca666
8 changed files with 30 additions and 8 deletions

View File

@ -193,6 +193,28 @@ export default {
onChangeColorInput() {
this.color = this.form.color;
},
onChangeRate() {
this.form.rate = this.form.rate.replace(',', '.');
},
onChangeCode(code) {
axios.get(url + '/settings/currencies/config', {
params: {
code: code
}
})
.then(response => {
this.form.rate = response.data.rate;
this.form.precision = response.data.precision;
this.form.symbol = response.data.symbol;
this.form.symbol_first = response.data.symbol_first;
this.form.decimal_mark = response.data.decimal_mark;
this.form.thousands_separator = response.data.thousands_separator;
})
.catch(error => {
});
}
}
})

View File

@ -33,7 +33,7 @@ const app = new Vue({
},
methods:{
RateReplace(){
onChangeRate() {
this.form.rate = this.form.rate.replace(',', '.');
},

View File

@ -33,7 +33,7 @@ const app = new Vue({
},
methods: {
taxRateReplace() {
onChangeTaxRate() {
this.form.rate = this.form.rate.replace(',', '.');
},
}

View File

@ -49,8 +49,8 @@
@foreach($permissions as $action => $action_permissions)
@php $active_action_tab = ($action == 'read') ? 'active' : ''; @endphp
<div class="tab-pane fade show {{ $active_action_tab }}" id="tab-{{ $action }}" role="tabpanel">
<span class="btn btn-primary btn-sm" @click="select('{{ $action }}')">{{trans('general.select_all')}}</span>
<span class="btn btn-primary btn-sm" @click="unselect('{{ $action }}')">{{trans('general.unselect_all')}}</span>
<span class="btn btn-primary btn-sm" @click="select('{{ $action }}')">{{ trans('general.select_all') }}</span>
<span class="btn btn-primary btn-sm" @click="unselect('{{ $action }}')">{{ trans('general.unselect_all') }}</span>
@stack('permissions_input_start')

View File

@ -21,7 +21,7 @@
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, null, ['required' => 'required', 'change' => 'onChangeCode']) }}
{{ Form::textGroup('rate', trans('currencies.rate'), 'sliders-h', ['@input' => 'RateReplace', 'required' => 'required']) }}
{{ Form::textGroup('rate', trans('currencies.rate'), 'sliders-h', ['@input' => 'onChangeRate', 'required' => 'required']) }}
{{ Form::textGroup('precision', trans('currencies.precision'), 'dot-circle') }}

View File

@ -22,7 +22,7 @@
{{ Form::selectGroup('code', trans('currencies.code'), 'code', $codes, $currency->code, ['required' => 'required', 'change' => 'onChangeCode']) }}
{{ Form::textGroup('rate', trans('currencies.rate'), 'sliders-h', ['@input' => 'RateReplace', 'required' => 'required']) }}
{{ Form::textGroup('rate', trans('currencies.rate'), 'sliders-h', ['@input' => 'onChangeRate', 'required' => 'required']) }}
{{ Form::textGroup('precision', trans('currencies.precision'), 'dot-circle') }}

View File

@ -19,7 +19,7 @@
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent', ['@input' => 'taxRateReplace']) }}
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent', ['@input' => 'onChangeTaxRate']) }}
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, 'normal') }}

View File

@ -20,7 +20,7 @@
<div class="row">
{{ Form::textGroup('name', trans('general.name'), 'font') }}
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent', ['@input' => 'taxRateReplace']) }}
{{ Form::textGroup('rate', trans('taxes.rate'), 'percent', ['@input' => 'onChangeTaxRate']) }}
{{ Form::selectGroup('type', trans_choice('general.types', 1), 'bars', $types, $tax->type) }}