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

Loading…
Cancel
Save