diff --git a/resources/assets/js/components/AkauntingMoney.vue b/resources/assets/js/components/AkauntingMoney.vue new file mode 100644 index 000000000..b584299eb --- /dev/null +++ b/resources/assets/js/components/AkauntingMoney.vue @@ -0,0 +1,132 @@ + + + diff --git a/resources/assets/js/mixins/global.js b/resources/assets/js/mixins/global.js index a9a36d4a8..9e986c2b0 100644 --- a/resources/assets/js/mixins/global.js +++ b/resources/assets/js/mixins/global.js @@ -2,6 +2,7 @@ import axios from 'axios'; import AkauntingSearch from './../components/AkauntingSearch'; import AkauntingModal from './../components/AkauntingModal'; +import AkauntingMoney from './../components/AkauntingMoney'; import AkauntingModalAddNew from './../components/AkauntingModalAddNew'; import AkauntingRadioGroup from './../components/forms/AkauntingRadioGroup'; import AkauntingSelect from './../components/AkauntingSelect'; @@ -13,7 +14,6 @@ import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; import NProgressAxios from './../plugins/nprogress-axios'; -import {VMoney} from 'v-money'; import { Select, Option, Steps, Step, Button } from 'element-ui'; import Form from './../plugins/form'; @@ -24,6 +24,7 @@ export default { AkauntingRadioGroup, AkauntingSelect, AkauntingSelectRemote, + AkauntingMoney, AkauntingModal, AkauntingModalAddNew, AkauntingDate, @@ -37,32 +38,16 @@ export default { data: function () { return { - money: { - decimal: '.', - thousands: ',', - prefix: '$ ', - suffix: '', - precision: 2, - masked: false /* doesn't work with directive */ - }, component: '', } }, directives: { - money: VMoney + //money: VMoney }, mounted() { this.checkNotify(); - - if (aka_currency) { - this.money.decimal = aka_currency.decimal_mark; - this.money.thousands = aka_currency.thousands_separator; - this.money.prefix = (aka_currency.symbol_first) ? aka_currency.symbol : ''; - this.money.suffix = !(aka_currency.symbol_first) ? aka_currency.symbol : ''; - this.money.precision = aka_currency.precision; - } }, methods: { diff --git a/resources/views/partials/admin/head.blade.php b/resources/views/partials/admin/head.blade.php index bf036467e..223ff0781 100644 --- a/resources/views/partials/admin/head.blade.php +++ b/resources/views/partials/admin/head.blade.php @@ -43,8 +43,6 @@ 'csrfToken' => csrf_token(), ]); ?>; - var aka_currency = {!! !empty($currency) ? $currency : 'false' !!}; - var flash_notification = {!! (session()->has('flash_notification')) ? json_encode(session()->get('flash_notification')) : 'false' !!}; //--> diff --git a/resources/views/partials/auth/head.blade.php b/resources/views/partials/auth/head.blade.php index 333d688d9..573476d90 100644 --- a/resources/views/partials/auth/head.blade.php +++ b/resources/views/partials/auth/head.blade.php @@ -38,8 +38,6 @@ 'csrfToken' => csrf_token(), ]); ?>; - var aka_currency = 'false'; - var flash_notification = {!! (session()->has('flash_notification')) ? json_encode(session()->get('flash_notification')) : 'false' !!}; //--> diff --git a/resources/views/partials/form/money_group.blade.php b/resources/views/partials/form/money_group.blade.php index b4fe0a2a2..0db137599 100644 --- a/resources/views/partials/form/money_group.blade.php +++ b/resources/views/partials/form/money_group.blade.php @@ -1,38 +1,35 @@ @stack($name . '_input_start') -
- @if (!empty($text)) - {!! Form::label($name, $text, ['class' => 'form-control-label'])!!} + -
- - - -
- @php - if ($attributes['currency']) { - $value = number_format($value, $attributes['currency']->precision, $attributes['currency']->decimal_mark, $attributes['currency']->thousands_separator); - } else { - $value = number_format($value, 2); - } - @endphp - {!! Form::text($name, $value, array_merge([ - 'class' => 'form-control', - 'data-name' => $name, - 'data-value' => $value, - 'v-model.lazy' => !empty($attributes['v-model']) ? $attributes['v-model'] : (!empty($attributes['data-field']) ? 'form.' . $attributes['data-field'] . '.'. $name : 'form.' . $name), - 'v-money' => 'money', - ], $attributes)) !!} -
+ @if (isset($attributes['disabled'])) + :disabled="'{{ $attributes['disabled'] }}'" + @endif -
-
- + @if (isset($attributes['masked'])) + :masked="'{{ $attributes['masked'] }}'" + @endif + + :error="{{ isset($attributes['v-error']) ? $attributes['v-error'] : 'form.errors.get("' . $name . '")' }}" + :name="'{{ $name }}'" + :title="'{{ $text }}'" + :group_class="'{{ $group_class }}'" + :icon="'{{ $icon }}'" + :currency="{{ json_encode($attributes['currency']) }}" + :value="{{ $value }}" + + @if (!empty($attributes['v-model'])) + @interface="{{ $attributes['v-model'] . ' = $event' }}" + @elseif (!empty($attributes['data-field'])) + @interface="{{ 'form.' . $attributes['data-field'] . '.' . $name . ' = $event' }}" + @else + @interface="form.{{ $name }} = $event" + @endif + > @stack($name . '_input_end') diff --git a/resources/views/partials/modules/head.blade.php b/resources/views/partials/modules/head.blade.php index 3a865ee7f..8a2b3b2b0 100644 --- a/resources/views/partials/modules/head.blade.php +++ b/resources/views/partials/modules/head.blade.php @@ -41,8 +41,6 @@ 'csrfToken' => csrf_token(), ]); ?>; - var aka_currency = {!! !empty($currency) ? $currency : 'false' !!}; - var flash_notification = {!! (session()->has('flash_notification')) ? json_encode(session()->get('flash_notification')) : 'false' !!}; //--> diff --git a/resources/views/partials/portal/head.blade.php b/resources/views/partials/portal/head.blade.php index bdcad99ef..d6d121250 100644 --- a/resources/views/partials/portal/head.blade.php +++ b/resources/views/partials/portal/head.blade.php @@ -40,8 +40,6 @@ 'csrfToken' => csrf_token(), ]); ?>; - var aka_currency = {!! !empty($currency) ? $currency : 'false' !!}; - var flash_notification = {!! (session()->has('flash_notification')) ? json_encode(session()->get('flash_notification')) : 'false' !!}; //--> diff --git a/resources/views/partials/signed/head.blade.php b/resources/views/partials/signed/head.blade.php index bdcad99ef..d6d121250 100644 --- a/resources/views/partials/signed/head.blade.php +++ b/resources/views/partials/signed/head.blade.php @@ -40,8 +40,6 @@ 'csrfToken' => csrf_token(), ]); ?>; - var aka_currency = {!! !empty($currency) ? $currency : 'false' !!}; - var flash_notification = {!! (session()->has('flash_notification')) ? json_encode(session()->get('flash_notification')) : 'false' !!}; //--> diff --git a/resources/views/partials/wizard/head.blade.php b/resources/views/partials/wizard/head.blade.php index 5fba889c1..4e9272c4b 100644 --- a/resources/views/partials/wizard/head.blade.php +++ b/resources/views/partials/wizard/head.blade.php @@ -40,8 +40,6 @@ 'csrfToken' => csrf_token(), ]); ?>; - var aka_currency = {!! !empty($currency) ? $currency : 'false' !!}; - var flash_notification = {!! (session()->has('flash_notification')) ? json_encode(session()->get('flash_notification')) : 'false' !!}; //-->