diff --git a/resources/assets/js/views/common/companies.js b/resources/assets/js/views/common/companies.js index a6d7affbc..c43366979 100644 --- a/resources/assets/js/views/common/companies.js +++ b/resources/assets/js/views/common/companies.js @@ -30,5 +30,22 @@ const app = new Vue({ form: new Form('company'), bulk_action: new BulkAction('companies') } + }, + + methods: { + // Form Submit + onSubmit() { + this.form.loading = true; + + if (this.form.country === "") { + this.form.errors.set('country', [country_validation_required_message]); + + this.form.loading = false; + + return; + } + + this.form.submit(); + }, } }); diff --git a/resources/views/common/companies/create.blade.php b/resources/views/common/companies/create.blade.php index de716fea0..272842883 100644 --- a/resources/views/common/companies/create.blade.php +++ b/resources/views/common/companies/create.blade.php @@ -44,7 +44,7 @@ - + @@ -65,5 +65,11 @@ + @push('scripts_end') + + @endpush + diff --git a/resources/views/common/companies/edit.blade.php b/resources/views/common/companies/edit.blade.php index 5b3220c24..db24f1977 100644 --- a/resources/views/common/companies/edit.blade.php +++ b/resources/views/common/companies/edit.blade.php @@ -69,5 +69,11 @@ + @push('scripts_end') + + @endpush + diff --git a/resources/views/components/contacts/form/address.blade.php b/resources/views/components/contacts/form/address.blade.php index af75dbdfe..901bbe9a3 100644 --- a/resources/views/components/contacts/form/address.blade.php +++ b/resources/views/components/contacts/form/address.blade.php @@ -24,7 +24,7 @@ @endif @if (! $hideCountry) - + @endif diff --git a/resources/views/components/form/group/country.blade.php b/resources/views/components/form/group/country.blade.php index d6a2a178b..4b7dc4732 100644 --- a/resources/views/components/form/group/country.blade.php +++ b/resources/views/components/form/group/country.blade.php @@ -3,7 +3,8 @@ label="{!! trans_choice('general.countries', 1) !!}" :options="trans('countries')" :selected="setting('company.country')" - not-required + required="{{ $required }}" + not-required="{{ $notRequired }}" model="form.country" form-group-class="{{ $formGroupClass }}" /> diff --git a/resources/views/modals/customers/create.blade.php b/resources/views/modals/customers/create.blade.php index 635760be7..466672633 100644 --- a/resources/views/modals/customers/create.blade.php +++ b/resources/views/modals/customers/create.blade.php @@ -72,7 +72,7 @@ - + diff --git a/resources/views/modals/customers/edit.blade.php b/resources/views/modals/customers/edit.blade.php index 2f5edb840..f2344bc83 100644 --- a/resources/views/modals/customers/edit.blade.php +++ b/resources/views/modals/customers/edit.blade.php @@ -72,7 +72,7 @@ - + diff --git a/resources/views/modals/vendors/create.blade.php b/resources/views/modals/vendors/create.blade.php index acf33f18a..8a7d39c57 100644 --- a/resources/views/modals/vendors/create.blade.php +++ b/resources/views/modals/vendors/create.blade.php @@ -72,7 +72,7 @@ - + diff --git a/resources/views/modals/vendors/edit.blade.php b/resources/views/modals/vendors/edit.blade.php index 8e1fc92e6..db5f67459 100644 --- a/resources/views/modals/vendors/edit.blade.php +++ b/resources/views/modals/vendors/edit.blade.php @@ -72,7 +72,7 @@ - + diff --git a/resources/views/portal/profile/edit.blade.php b/resources/views/portal/profile/edit.blade.php index 27344f74b..e68f5d28e 100644 --- a/resources/views/portal/profile/edit.blade.php +++ b/resources/views/portal/profile/edit.blade.php @@ -48,7 +48,7 @@ - +