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

update choises and forms

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