mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-31 05:31:10 -04:00 
			
		
		
		
	fix the validation
This commit is contained in:
		| @ -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"> | ||||
|  | ||||
| @ -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 | ||||
|  | ||||
| @ -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> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user