Commit 1528b394 authored by Babin Egor's avatar Babin Egor

update choises and forms

parent 551457f1
......@@ -339,11 +339,9 @@ Vue.component('app-registration-form', {
.then(response => response.data)
.then(options => {
this.wGroupSelect.options = options;
//this.$set(this.wGroupSelect, 'options', options);
//this.localRecord.wGroup = options[0];
//this.transportUnitsLoad();
})
},
transportUnitsLoad(){
axios
.get(this.transportUnitsUrl(this.localRecord.wGroup.value))
......@@ -354,6 +352,7 @@ Vue.component('app-registration-form', {
//this.wUnitAmounts[0] = options[0];
})
},
fiasInit() {
let $this = this;
$.fias.token = 'tiyhha6YHyNi6EfeyfrRrdrDQkyehf59';
......@@ -430,9 +429,11 @@ Vue.component('app-registration-form', {
prevStage() {
this.currentStage --
},
nextStage() {
this.currentStage ++
},
sendform() {
let post_data = this.fieldsVal[this.currentPT];
......@@ -807,7 +808,6 @@ Vue.component('app-registration-form', {
}
},
valdatePass(pas, confpass) {
if ((pas.length >= 6) && (confpass.length >= 6) && (pas === confpass)) {
......@@ -816,8 +816,6 @@ Vue.component('app-registration-form', {
return false;
}
},
},
template: `
<div>
......@@ -858,12 +856,13 @@ Vue.component('app-registration-form', {
<div class="order-registration__stages-wrap">
<a href=""
:class="['order-registration__stages-item', (index === currentStage) ? 'active' : '']"
v-for="(stage, index) in stages[currentPT]"
:key="index"
@click.prevent="currentStage = index"
>
@click.prevent="currentStage = index">
<span class="order-registration__stages-num">{{ index + 1 }}</span>
<span class="order-registration__stages-caption">{{ stage }}</span>
</a>
......@@ -921,6 +920,7 @@ Vue.component('app-registration-form', {
placeholder="ИНН"
class="field-text__input"
v-model="fieldsVal.juridical.companyInn"
v-mask="['##########', '############']"
>
</span>
</label>
......@@ -936,6 +936,7 @@ Vue.component('app-registration-form', {
placeholder="КПП"
class="field-text__input"
v-model="fieldsVal.juridical.companyKpp"
v-mask="['#########']"
>
</span>
</label>
......@@ -1461,6 +1462,7 @@ Vue.component('app-registration-form', {
<span class="field-text__input-wrap">
<input type="text"
placeholder="+ 7 (___) ___ __ __"
v-mask="'+7 (###) ###-##-##'"
class="field-text__input"
v-model="fieldsVal.natural.personInfoPhone"
>
......@@ -1484,6 +1486,7 @@ Vue.component('app-registration-form', {
<span class="field-text__name">Серия <span style="color: red;">*</span></span>
<span class="field-text__input-wrap">
<input type="text"
v-mask="'####'"
placeholder="Серия"
class="field-text__input"
v-model="fieldsVal.natural.personPassportSeries"
......@@ -1497,6 +1500,7 @@ Vue.component('app-registration-form', {
<span class="field-text__name">Номер <span style="color: red;">*</span></span>
<span class="field-text__input-wrap">
<input type="text"
v-mask="'######'"
placeholder="Номер"
class="field-text__input"
v-model="fieldsVal.natural.personPassportNumber"
......@@ -1523,6 +1527,7 @@ Vue.component('app-registration-form', {
<span class="field-text__name">Дата выдачи <span style="color: red;">*</span></span>
<span class="field-text__input-wrap">
<input type="text"
v-mask="'##.##.####'"
placeholder="Дата выдачи"
class="field-text__input"
v-model="fieldsVal.natural.personPassportIssuedDate"
......
......@@ -32,7 +32,7 @@ Vue.component('app-waste-utilisation-order-form', {
noChoicesText: 'Пусто',
noResultsText: 'Ничего не найдено',
searchResultLimit: '5',
maxItemCount: '40'
maxItemCount: '40',
},
helptext: ''
......@@ -115,7 +115,8 @@ Vue.component('app-waste-utilisation-order-form', {
localRecord: {},
initValue: {
value: '0'
}
},
ShowDrop: 'false',
}
},
created() {
......@@ -195,10 +196,10 @@ Vue.component('app-waste-utilisation-order-form', {
wasteGroupUrl() {
//https://r52.ru/
return '/api/type/' + this.localRecord.wType.name + (this.localRecord.wMainGroup.value ? "/" + this.localRecord.wMainGroup.value : "/");
return 'https://r52.ru/api/type/' + this.localRecord.wType.name + (this.localRecord.wMainGroup.value ? "/" + this.localRecord.wMainGroup.value : "/");
},
wasteMainGroupUrl(){
return '/api/mainType/' + this.localRecord.wType.name
return 'https://r52.ru/api/mainType/' + this.localRecord.wType.name
},
// Открываем кнопку "сохранить"
formFilledRight() {
......@@ -515,6 +516,15 @@ Vue.component('app-waste-utilisation-order-form', {
// При изменении списка файлов
updateDocs(e) {
this.localRecord.wDocs = this.$children["4"].localFiles;
},
// открываем/закрываем выпадашку селектора
changeShowDrop() {
if (this.ShowDrop) {
this.ShowDrop = false;
} else {
this.ShowDrop = true;
}
}
},
template: `
......@@ -530,14 +540,15 @@ Vue.component('app-waste-utilisation-order-form', {
<!-- Debug --->
<!--
<div class="debug"
style="position: absolute; right: -270px;top: 500px; background-color:#fff; z-index:1000; width: 400px; height: 1000px; padding: 10px; border: 1px solid #999;">
<pre>
{{ localRecord }}
{{ ShowDrop }}
</pre>
</div>
-->
<!-- end Debug --->
--!>
<!-- end Debug -->
<!-- Form -->
<div class="col-lg-8">
......@@ -584,11 +595,13 @@ Vue.component('app-waste-utilisation-order-form', {
v-if="localRecord.wType['name'] == 'communal'">
<div class="block_orange-b">
<!-- Вид отхода. Список -->
<field-select
v-bind="wGroupSelect"
:init="localRecord.wGroup"
@change="localRecord.wGroup = $event"
@change="dateFromGroup"
:showDropProp="this.ShowDrop"
>
</field-select>
</div>
......@@ -609,25 +622,10 @@ Vue.component('app-waste-utilisation-order-form', {
</div>
<!--
<div class="block_cyan-b"
v-if="localRecord.wType['name'] != 'lamps'">
<label class="field-text">
<span class="field-text__name">Код отхода</span>
<span class="field-text__input-wrap">
<input
type="text"
placeholder="Введите код, слово или фразу"
class="field-text__input"
v-model="localRecord.wFKKO.code"
>
</span>
</label>
</div>
-->
<info-block v-if="localRecord.wType['name'] != 'lamps'">
Список содержит часто спрашиваемые виды отходов. Если Вы не нашли необходимый вид отхода, введите наименование отхода <a href=""> самостоятельно</a>
Список содержит часто спрашиваемые виды отходов. Если Вы не нашли необходимый вид отхода, введите наименование отхода
<a href="javascript:void(0)" @click="changeShowDrop"> самостоятельно</a>
</info-block>
<!-- /if not lamp -->
......
......@@ -19,26 +19,39 @@ Vue.component('field-select', {
},
init: {
type: Object
},
showDropProp: {
type: Boolean
}
},
model: {
prop: 'attrs.value',
event: 'change'
},
data: ()=> ({
choices: null
}),
data:
function () {
return {
choices: null,
showDrop: this.showDropProp,
}
},
mounted() {
this.choicesInit();
},
computed: {
},
watch: {
showDropProp: function() {
this.choices.showDropdown();
},
options: 'choicesUpdate', //отслеживаем изменение объекта с опциями
},
methods: {
showDrop() {
return this.showDrop;
},
choicesInit() {
this.choices = new Choices(this.$refs.select, this.settings)
this.choices = new Choices(this.$refs.select, this.settings);
},
choicesUpdate() {
......
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