fix the validation

This commit is contained in:
hastichavda
2019-11-12 11:00:35 +05:30
parent 80a761dbe0
commit 03d18065c6
10 changed files with 134 additions and 33 deletions

View File

@ -35,6 +35,8 @@
<div v-if="$v.formData.price.$error">
<span v-if="!$v.formData.price.required" class="text-danger">{{ $tc('validation.required') }}</span>
<span v-if="!$v.formData.price.numeric" class="text-danger">{{ $tc('validation.numbers_only') }}</span>
<span v-if="!$v.formData.price.maxLength" class="text-danger">{{ $t('validation.price_maxlength') }}</span>
<span v-if="!$v.formData.price.minValue" class="text-danger">{{ $t('validation.price_minValue') }}</span>
</div>
</div>
</div>
@ -138,7 +140,8 @@ export default {
price: {
required,
numeric,
minValue: minValue(0.1)
minValue: minValue(0.1),
maxLength: maxLength(10)
},
description: {
maxLength: maxLength(255)

View File

@ -189,7 +189,7 @@ export default {
response = await this.updateTaxType(this.formData)
}
if (response.data) {
window.toastr['success'](this.$t('settings.sales_taxes.created_message'))
window.toastr['success'](this.$t('settings.tax_types.created_message'))
window.hub.$emit('newTax', response.data.taxType)
this.closeTaxModal()
this.isLoading = false

View File

@ -521,7 +521,8 @@ export default {
preferences: 'Preferences',
notifications: 'Notifications',
tax_types: 'Tax Types',
expense_category: 'Expense Categories'
expense_category: 'Expense Categories',
mail_configuration: 'Mail Configuration'
},
title: 'Settings',
setting: 'Settings | Settings',
@ -644,6 +645,10 @@ export default {
select_time_zone: 'select Time Zone',
select_date_formate: 'select Date Formate',
select_financial_year: 'select financial year'
},
mail_configuration: {
mail_confiuration: 'Mail Configuration | Mail Configurations',
description: 'Below details will be used to create the main Administrator account. Also you can change the details anytime after logging in.'
}
},
wizard: {
@ -748,7 +753,9 @@ export default {
payment_greater_than_due_amount: 'Entered Payment is more than due amount of this invoice.',
quantity_maxlength: 'Quantity should not be greater than 10 characters.',
price_maxlength: 'Price should not be greater than 10 characters.',
price_minValue: 'Price should be greater than 0 digits',
amount_maxlength: 'Amount should not be greater than 10 characters.',
amount_minvalue: 'Amount should br greater than 0 digits',
description_maxlength: 'Description should not be greater than 255 characters.',
maximum_options_error: 'Maximum of {max} options selected. First remove a selected option to select another.',
notes_maxlength: 'Notes should not be greater than 255 characters.',

View File

@ -92,13 +92,14 @@
<money
v-model="amount"
v-bind="defaultCurrencyForInput"
:class="{'invalid' : $v.formData.amount.$error}"
class="input-field"
@input="$v.formData.amount.$touch()"
/>
</div>
<div v-if="$v.formData.amount.$error">
<span v-if="!$v.formData.amount.required" class="text-danger">{{ $t('validation.required') }}</span>
<span v-if="!$v.formData.amount.maxLength" class="text-danger">{{ $t('validation.amount_maxlength') }}</span>
<span v-if="!$v.formData.amount.maxValue" class="text-danger">{{ $t('validation.amount_minvalue') }}</span>
</div>
</div>
<div class="form-group col-sm-6">

View File

@ -34,16 +34,16 @@
<label>{{ $t('items.price') }}</label><span class="text-danger"> *</span>
<div class="base-input">
<money
:invalid="$v.formData.price.$error"
:class="{'invalid' : $v.formData.price.$error}"
v-model="price"
v-bind="defaultCurrencyForInput"
class="input-field"
@input="$v.formData.price.$touch()"
/>
</div>
<div v-if="$v.formData.price.$error">
<span v-if="!$v.formData.price.required" class="text-danger">{{ $t('validation.required') }} </span>
<span v-if="!$v.formData.price.maxLength" class="text-danger">{{ $t('validation.price_maxlength') }}</span>
<span v-if="!$v.formData.price.minValue" class="text-danger">{{ $t('validation.price_minValue') }}</span>
</div>
</div>
<div class="form-group">
@ -92,7 +92,8 @@
<script>
import { validationMixin } from 'vuelidate'
import { mapActions, mapGetters } from 'vuex'
const { required, minLength, numeric, alpha, minValue, maxLength} = require('vuelidate/lib/validators')
const { required, minLength, numeric, alpha, minValue, maxLength } = require('vuelidate/lib/validators')
export default {
mixins: {
validationMixin

View File

@ -113,7 +113,11 @@
<h3 class="page-title">{{ $t('settings.preferences.discount_setting') }}</h3>
<div class="flex-box">
<div class="left">
<base-switch v-model="discount_per_item" class="btn-switch" @change="setDiscount" />
<base-switch
v-model="discount_per_item"
class="btn-switch"
@change="setDiscount"
/>
</div>
<div class="right ml-15">
<p class="box-title"> {{ $t('settings.preferences.discount_per_item') }} </p>