Merge pull request #2501 from sevannerse/company-forms

Company forms
This commit is contained in:
Cüneyt Şentürk 2022-07-01 00:55:39 +03:00 committed by GitHub
commit b396771888
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 8 deletions

View File

@ -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();
},
}
});

View File

@ -44,7 +44,7 @@
</x-slot>
<x-slot name="body">
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" v-model="form.address" />
<x-form.group.textarea name="address" label="{{ trans('general.address') }}" v-model="form.address" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ setting('company.city') }}" not-required />
@ -65,5 +65,11 @@
</x-form.container>
</x-slot>
@push('scripts_end')
<script type="text/javascript">
var country_validation_required_message = "{{ trans('validation.required', ['attribute' => trans_choice('general.countries', 1)]) }}";
</script>
@endpush
<x-script folder="common" file="companies" />
</x-layouts.admin>

View File

@ -69,5 +69,11 @@
</x-form.container>
</x-slot>
@push('scripts_end')
<script type="text/javascript">
var country_validation_required_message = "{{ trans('validation.required', ['attribute' => trans_choice('general.countries', 1)]) }}";
</script>
@endpush
<x-script folder="common" file="companies" />
</x-layouts.admin>

View File

@ -24,7 +24,7 @@
@endif
@if (! $hideCountry)
<x-form.group.country form-group-class="sm:col-span-3 el-select-tags-pl-38" />
<x-form.group.country form-group-class="sm:col-span-3 el-select-tags-pl-38" not-required />
@endif
</x-slot>
</x-form.section>

View File

@ -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 }}"
/>

View File

@ -72,7 +72,7 @@
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div>
</div>

View File

@ -72,7 +72,7 @@
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div>
</div>

View File

@ -72,7 +72,7 @@
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div>
</div>

View File

@ -72,7 +72,7 @@
<x-form.group.text name="state" label="{{ trans('general.state') }}" form-group-class="col-span-6" not-required />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" />
<x-form.group.country form-group-class="col-span-6 el-select-tags-pl-38" not-required />
</div>
</div>

View File

@ -48,7 +48,7 @@
<x-form.group.locale />
<x-form.group.country :selected="$user->contact->country" />
<x-form.group.country :selected="$user->contact->country" not-required />
<x-form.group.text name="city" label="{{ trans_choice('general.cities', 1) }}" value="{{ $user->contact->city }}" not-required />