TT#46179 Send Fax number input validation

Change-Id: I2f30419df760e36eee59c244deba96afc96a7d8f
(cherry picked from commit 8fd55c345b)
changes/16/25816/2
raxelsen 7 years ago committed by Hans-Peter Herzog
parent 1cd349901c
commit c26c0becff

@ -7,12 +7,13 @@
<div class="title"> <div class="title">
{{ $t('communication.sendFax') }} {{ $t('communication.sendFax') }}
</div> </div>
<q-field> <csc-call-input
<q-input v-if="showFaxModal"
type="text" :label="$t('communication.label.destination')"
v-model="form.destination" v-model="form.destination"
:float-label="$t('communication.label.destination')" /> @submit="sendFax"
</q-field> @error="error"
/>
<q-field> <q-field>
<q-select <q-select
v-model="form.quality" v-model="form.quality"
@ -53,6 +54,7 @@
</template> </template>
<script> <script>
import CscCallInput from './form/CscCallInput'
import { import {
QModal, QModal,
QBtn, QBtn,
@ -76,10 +78,12 @@
{ label: this.$t('communication.quality.fine'), value: 'fine' }, { label: this.$t('communication.quality.fine'), value: 'fine' },
{ label: this.$t('communication.quality.super'), value: 'super' } { label: this.$t('communication.quality.super'), value: 'super' }
], ],
isMobile: this.$q.platform.is.mobile isMobile: this.$q.platform.is.mobile,
destinationError: false
} }
}, },
components: { components: {
CscCallInput,
QModal, QModal,
QBtn, QBtn,
QField, QField,
@ -88,13 +92,15 @@
}, },
computed: { computed: {
formDisabled() { formDisabled() {
return !(this.form.destination && return !(!this.destinationError &&
this.form.data && this.form.quality) ? true : false; this.form.data && this.form.quality) ? true : false;
} }
}, },
methods: { methods: {
sendFax() { sendFax() {
this.$store.dispatch('communication/createFax', this.form); if (!this.destinationError) {
this.$store.dispatch('communication/createFax', this.form);
}
}, },
showModal() { showModal() {
this.form = { this.form = {
@ -107,6 +113,9 @@
}, },
hideModal() { hideModal() {
this.showFaxModal = false; this.showFaxModal = false;
},
error(state) {
this.destinationError = state;
} }
} }
} }

Loading…
Cancel
Save