diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 8197bf468..458014adf 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -419,13 +419,17 @@ export default { description: "Selectbox attribute name" }, value: { - type: String, + type: [String, Number], default: null, description: "Selectbox selected value" }, options: null, - model: null, + model: { + type: [String, Number], + default: null, + description: "Selectbox selected model" + }, icon: { type: String, @@ -605,7 +609,10 @@ export default { this.selectOptions = options; }, value: function (value) { - this.real_model = value; + this.real_model = value.toString(); + }, + model: function (value) { + this.real_model = value.toString(); } }, } diff --git a/resources/views/partials/form/date_group.blade.php b/resources/views/partials/form/date_group.blade.php index 3ea4cc986..179fc134e 100644 --- a/resources/views/partials/form/date_group.blade.php +++ b/resources/views/partials/form/date_group.blade.php @@ -9,11 +9,19 @@ :form-classes="[{'has-error': form.errors.get('{{ $name }}') }]" @endif - :icon="'fa fa-{{ $icon }}'" - :title="'{{ $text }}'" - :placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'" - :name="'{{ $name }}'" - :value="'{{ old($name, $value) }}'" + icon="fa fa-{{ $icon }}" + title="{{ $text }}" + placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}" + name="{{ $name }}" + + @if(old($name, $value)) + value="{{ old($name, $value) }}" + @endif + + @if (!empty($attributes['model'])) + :model="{{ $attributes['model'] }}" + @endif + :config="{ allowInput: true, @if (!empty($attributes['show-date-format'])) diff --git a/resources/views/partials/form/date_time_group.blade.php b/resources/views/partials/form/date_time_group.blade.php index 2fc8fcbcb..33afea947 100644 --- a/resources/views/partials/form/date_time_group.blade.php +++ b/resources/views/partials/form/date_time_group.blade.php @@ -9,11 +9,19 @@ :form-classes="[{'has-error': form.errors.get('{{ $name }}') }]" @endif - :icon="'fa fa-{{ $icon }}'" - :title="'{{ $text }}'" - :placeholder="'{{ trans('general.form.select.field', ['field' => $text]) }}'" - :name="'{{ $name }}'" - :value="'{{ old($name, $value) }}'" + icon="fa fa-{{ $icon }}" + title="{{ $text }}" + placeholder="{{ trans('general.form.select.field', ['field' => $text]) }}" + name="{{ $name }}" + + @if(old($name, $value)) + value="{{ old($name, $value) }}" + @endif + + @if (!empty($attributes['model'])) + :model="{{ $attributes['model'] }}" + @endif + :config="{ allowInput: true, @if (!empty($attributes['show-date-format'])) diff --git a/resources/views/partials/form/enabled_group.blade.php b/resources/views/partials/form/enabled_group.blade.php index aeb308f3b..a526ebdcc 100644 --- a/resources/views/partials/form/enabled_group.blade.php +++ b/resources/views/partials/form/enabled_group.blade.php @@ -3,7 +3,7 @@