Commit 551457f1 authored by Babin Egor's avatar Babin Egor

upgrade form

parent 6e276fdd
...@@ -90,7 +90,8 @@ ...@@ -90,7 +90,8 @@
"object-fit-images": "^3.2.3", "object-fit-images": "^3.2.3",
"svg4everybody": "^2.1.8", "svg4everybody": "^2.1.8",
"vee-validate": "^3.0.3", "vee-validate": "^3.0.3",
"vue": "^2.6.10" "vue": "^2.6.10",
"vue-the-mask": "^0.11.1"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
......
...@@ -3,6 +3,9 @@ import { ValidationProvider, extend } from 'vee-validate'; ...@@ -3,6 +3,9 @@ import { ValidationProvider, extend } from 'vee-validate';
import { required, email } from 'vee-validate/dist/rules'; import { required, email } from 'vee-validate/dist/rules';
import $ from 'jquery'; import $ from 'jquery';
import axios from 'axios'; import axios from 'axios';
import 'vue-the-mask'
extend('required', required); extend('required', required);
extend('email', email); extend('email', email);
...@@ -748,6 +751,7 @@ Vue.component('app-registration-form', { ...@@ -748,6 +751,7 @@ Vue.component('app-registration-form', {
}, },
valdatePhone(phone) { valdatePhone(phone) {
phone = phone.replace(/[^0-9]/g, '');
var re = /^\d[\d\(\)\ -]{7,14}\d$/; var re = /^\d[\d\(\)\ -]{7,14}\d$/;
var valid = re.test(phone); var valid = re.test(phone);
return valid; return valid;
...@@ -821,13 +825,13 @@ Vue.component('app-registration-form', { ...@@ -821,13 +825,13 @@ Vue.component('app-registration-form', {
<!-- Debug ---> <!-- Debug --->
<!--
<div style="display: block; position: fixed; right: 0;top: 0%; background-color:#fff; z-index:1000; width: 300px; padding: 10px; border: 1px solid #999;"> <div style="display: block; position: fixed; right: 0;top: 0%; background-color:#fff; z-index:1000; width: 300px; padding: 10px; border: 1px solid #999;">
<pre> <pre>
{{ fieldsVal[currentPT] }} {{ fieldsVal[currentPT] }}
</pre> </pre>
</div> </div>
-->
<!-- end Debug ---> <!-- end Debug --->
...@@ -1146,7 +1150,7 @@ Vue.component('app-registration-form', { ...@@ -1146,7 +1150,7 @@ Vue.component('app-registration-form', {
<span class="field-text__input-wrap"> <span class="field-text__input-wrap">
<input type="text" <input type="text"
placeholder="Контактный телефон" placeholder="Контактный телефон"
v-mask="'##/##/####'" v-mask="'+7 (###) ###-##-##'"
class="field-text__input" class="field-text__input"
v-model="fieldsVal.juridical.companyContactPhone" v-model="fieldsVal.juridical.companyContactPhone"
> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment