Commit 0d41a138 authored by Babin Egor's avatar Babin Egor

update form

parent 86ea9230
...@@ -31,7 +31,7 @@ Vue.component('app-registration-form', { ...@@ -31,7 +31,7 @@ Vue.component('app-registration-form', {
settings: { settings: {
searchEnabled: true, searchEnabled: true,
shouldSort: false, shouldSort: false,
noChoicesText: 'Пусто', noChoicesText: 'Пусто',
noResultsText: 'Ничего не найдено', noResultsText: 'Ничего не найдено',
}, },
helptext: '' helptext: ''
...@@ -86,6 +86,10 @@ Vue.component('app-registration-form', { ...@@ -86,6 +86,10 @@ Vue.component('app-registration-form', {
companyAuthLogin: '', companyAuthLogin: '',
companyAuthPass: '', companyAuthPass: '',
companyAuthPassRepeat: '', companyAuthPassRepeat: '',
companyTrans: '',
companyGovNum: '',
companyTransportCostPerKm: '',
}, },
natural: { natural: {
personInfoLastname: '', personInfoLastname: '',
...@@ -111,6 +115,10 @@ Vue.component('app-registration-form', { ...@@ -111,6 +115,10 @@ Vue.component('app-registration-form', {
personAuthLogin: '', personAuthLogin: '',
personAuthPass: '', personAuthPass: '',
personAuthPassRepeat: '', personAuthPassRepeat: '',
personTrans: '',
personGovNum: '',
personTransportCostPerKm: '',
} }
}, },
currentPT: this.personType, //текущий тип клиента currentPT: this.personType, //текущий тип клиента
...@@ -182,7 +190,7 @@ Vue.component('app-registration-form', { ...@@ -182,7 +190,7 @@ Vue.component('app-registration-form', {
return false; return false;
} }
} }
} else if (this.currentPT == "natural") { } else if (this.currentPT == "natural") {
if (this.currentStage == 0) { if (this.currentStage == 0) {
...@@ -225,13 +233,25 @@ Vue.component('app-registration-form', { ...@@ -225,13 +233,25 @@ Vue.component('app-registration-form', {
(this.valdateName(this.fieldsVal.juridical.companyContactLastName)) && (this.valdateName(this.fieldsVal.juridical.companyContactLastName)) &&
(this.valdateMail(this.fieldsVal.juridical.companyContactEmail)) && (this.valdateMail(this.fieldsVal.juridical.companyContactEmail)) &&
(this.valdatePhone(this.fieldsVal.juridical.companyContactPhone)) && (this.valdatePhone(this.fieldsVal.juridical.companyContactPhone))
(this.valdateLogin(this.fieldsVal.juridical.companyAuthLogin)) &&
(this.valdatePass(this.fieldsVal.juridical.companyAuthPass, this.fieldsVal.juridical.companyAuthPassRepeat))
) { ) {
return true; if (this.personRegType !== "executor") {
if (
(this.valdateLogin(this.fieldsVal.juridical.companyAuthLogin)) &&
(this.valdatePass(this.fieldsVal.juridical.companyAuthPass, this.fieldsVal.juridical.companyAuthPassRepeat))) {
return true;
}
} else {
if (
(this.valdateName(this.fieldsVal.juridical.companyTrans)) &&
(this.valdateName(this.fieldsVal.juridical.companyGovNum)) &&
(this.localRecord.wAddress.region.name !== '') &&
(this.valdateName(this.fieldsVal.juridical.companyTransportCostPerKm))
) {
return true;
}
}
} }
} else if (this.currentPT == "natural") { } else if (this.currentPT == "natural") {
...@@ -248,13 +268,28 @@ Vue.component('app-registration-form', { ...@@ -248,13 +268,28 @@ Vue.component('app-registration-form', {
(this.valdatePassNum(this.fieldsVal.natural.personPassportNumber)) && (this.valdatePassNum(this.fieldsVal.natural.personPassportNumber)) &&
(this.valdateName(this.fieldsVal.natural.personPassportIssuedBy)) && (this.valdateName(this.fieldsVal.natural.personPassportIssuedBy)) &&
(this.valdatePassDate(this.fieldsVal.natural.personPassportIssuedDate)) && (this.valdatePassDate(this.fieldsVal.natural.personPassportIssuedDate)) &&
(this.valdateName(this.fieldsVal.natural.personPassportDepartmentCode)) && (this.valdateName(this.fieldsVal.natural.personPassportDepartmentCode)) || 1
(this.valdateLogin(this.fieldsVal.natural.personAuthLogin)) &&
(this.valdatePass(this.fieldsVal.natural.personAuthPass, this.fieldsVal.natural.personAuthPassRepeat))
) { ) {
return true; if (this.personRegType !== "executor") {
if (
(this.valdateLogin(this.fieldsVal.natural.personAuthLogin)) &&
(this.valdatePass(this.fieldsVal.natural.personAuthPass, this.fieldsVal.natural.personAuthPassRepeat))
) {
return true;
}
} else {
if (
//(this.localRecord.wGroup != {}) &&
(this.valdateName(this.fieldsVal.natural.personTrans)) &&
(this.valdateName(this.fieldsVal.natural.personGovNum)) &&
(this.localRecord.wAddress.region.name !== '') &&
(this.valdateName(this.fieldsVal.natural.personTransportCostPerKm)) //&&
//(this.wUnitAmounts != [{}])
) {
return true;
}
}
} }
} }
...@@ -282,10 +317,10 @@ Vue.component('app-registration-form', { ...@@ -282,10 +317,10 @@ Vue.component('app-registration-form', {
this.transportUnitsLoad(); this.transportUnitsLoad();
}, },
addUnit(index){ addUnit(index){
alert(this.wUnitsSelect.options.length); //alert(this.wUnitsSelect.options.length);
this.wUnitAmounts.push({}); this.wUnitAmounts.push({});
}, },
test3(index,e){ addСapacity(index,e){
this.wUnitAmounts[index].value = e.value; this.wUnitAmounts[index].value = e.value;
this.wUnitAmounts[index].label = e.caption; this.wUnitAmounts[index].label = e.caption;
//alert(JSON.stringify(e)); //alert(JSON.stringify(e));
...@@ -309,7 +344,7 @@ Vue.component('app-registration-form', { ...@@ -309,7 +344,7 @@ Vue.component('app-registration-form', {
}, },
transportUnitsLoad(){ transportUnitsLoad(){
axios axios
.get(this.transportUnitsUrl()) .get(this.transportUnitsUrl(this.localRecord.wGroup.value))
.then(response => response.data) .then(response => response.data)
.then(options => { .then(options => {
this.$set(this.wUnitsSelect, 'options', options); this.$set(this.wUnitsSelect, 'options', options);
...@@ -371,6 +406,8 @@ Vue.component('app-registration-form', { ...@@ -371,6 +406,8 @@ Vue.component('app-registration-form', {
return "Добавить заказчика" return "Добавить заказчика"
} else if (this.personRegTypeProp == "executor") { } else if (this.personRegTypeProp == "executor") {
return "Добавить исполнителя" return "Добавить исполнителя"
} else if (this.personRegTypeProp == "neworder") {
return "Оформить заказ"
} }
}, },
...@@ -396,11 +433,13 @@ Vue.component('app-registration-form', { ...@@ -396,11 +433,13 @@ Vue.component('app-registration-form', {
}, },
sendform() { sendform() {
let post_data = this.fieldsVal[this.currentPT];
if (this.formFilledRight) { if (this.formFilledRight) {
$.ajax({ $.ajax({
url: "form.php", url: "form.php",
data: { data: {
"date": this.fieldsVal[this.currentPT], "date": post_data,
}, },
dataType: "html", dataType: "html",
type: "post", type: "post",
...@@ -775,10 +814,14 @@ Vue.component('app-registration-form', { ...@@ -775,10 +814,14 @@ 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;">
{{ buttonRegTxt }} <pre>
{{ fieldsVal[currentPT] }}
</pre>
</div> </div>
-->
<!-- end Debug ---> <!-- end Debug --->
<!-- Stages --> <!-- Stages -->
...@@ -1140,7 +1183,7 @@ Vue.component('app-registration-form', { ...@@ -1140,7 +1183,7 @@ Vue.component('app-registration-form', {
<input type="text" <input type="text"
placeholder="Транспорт" placeholder="Транспорт"
class="field-text__input" class="field-text__input"
v-model="fieldsVal.juridical.companyContactPhone" v-model="fieldsVal.juridical.companyTrans"
> >
</span> </span>
</label> </label>
...@@ -1155,7 +1198,7 @@ Vue.component('app-registration-form', { ...@@ -1155,7 +1198,7 @@ Vue.component('app-registration-form', {
<input type="text" <input type="text"
placeholder="Гос. номер" placeholder="Гос. номер"
class="field-text__input" class="field-text__input"
v-model="fieldsVal.juridical.companyContactPhone" v-model="fieldsVal.juridical.companyGovNum"
> >
</span> </span>
</label> </label>
...@@ -1255,7 +1298,7 @@ Vue.component('app-registration-form', { ...@@ -1255,7 +1298,7 @@ Vue.component('app-registration-form', {
<field-select <field-select
v-bind="wUnitsSelect" v-bind="wUnitsSelect"
:init="unitItem" :init="unitItem"
@change="test3(index,$event)" @change="addСapacity(index,$event)"
> >
</field-select> </field-select>
</span> </span>
...@@ -1263,7 +1306,7 @@ Vue.component('app-registration-form', { ...@@ -1263,7 +1306,7 @@ Vue.component('app-registration-form', {
</div> </div>
<div class="add-btn" <div class="add-btn"
v-if="((index === wUnitAmounts.length-1) && (index < (wUnitsSelect.options.length - 1)))"> v-if="((index === wUnitAmounts.length-1) && (index < (wUnitsSelect.options.length - 2)))">
<a class="btn btn_secondary btn_icon" <a class="btn btn_secondary btn_icon"
href="javascript:void(0);" href="javascript:void(0);"
@click="addUnit(index)"> @click="addUnit(index)">
...@@ -1590,7 +1633,7 @@ Vue.component('app-registration-form', { ...@@ -1590,7 +1633,7 @@ Vue.component('app-registration-form', {
<input type="text" <input type="text"
placeholder="Транспорт" placeholder="Транспорт"
class="field-text__input" class="field-text__input"
v-model="fieldsVal.juridical.companyContactPhone" v-model="fieldsVal.natural.personTrans"
> >
</span> </span>
</label> </label>
...@@ -1605,7 +1648,7 @@ Vue.component('app-registration-form', { ...@@ -1605,7 +1648,7 @@ Vue.component('app-registration-form', {
<input type="text" <input type="text"
placeholder="Гос. номер" placeholder="Гос. номер"
class="field-text__input" class="field-text__input"
v-model="fieldsVal.juridical.companyContactPhone" v-model="fieldsVal.natural.personGovNum"
> >
</span> </span>
</label> </label>
...@@ -1617,7 +1660,7 @@ Vue.component('app-registration-form', { ...@@ -1617,7 +1660,7 @@ Vue.component('app-registration-form', {
<textarea class="field-text__input" <textarea class="field-text__input"
name="comment" name="comment"
placeholder="Комментарий" placeholder="Комментарий"
v-model="fieldsVal.juridical.companyExtraComment" v-model="fieldsVal.natural.personExtraComment"
></textarea> ></textarea>
</span> </span>
</label> </label>
...@@ -1663,7 +1706,7 @@ Vue.component('app-registration-form', { ...@@ -1663,7 +1706,7 @@ Vue.component('app-registration-form', {
<input type="text" <input type="text"
placeholder="Стоимость транспортировки" placeholder="Стоимость транспортировки"
class="field-text__input" class="field-text__input"
v-model="fieldsVal.juridical.companyContactPhone" v-model="fieldsVal.natural.personTransportCostPerKm"
> >
</span> </span>
</label> </label>
...@@ -1705,7 +1748,7 @@ Vue.component('app-registration-form', { ...@@ -1705,7 +1748,7 @@ Vue.component('app-registration-form', {
<field-select <field-select
v-bind="wUnitsSelect" v-bind="wUnitsSelect"
:init="unitItem" :init="unitItem"
@change="test3(index,$event)" @change="addСapacity(index,$event)"
> >
</field-select> </field-select>
</span> </span>
...@@ -1713,7 +1756,7 @@ Vue.component('app-registration-form', { ...@@ -1713,7 +1756,7 @@ Vue.component('app-registration-form', {
</div> </div>
<div class="add-btn" <div class="add-btn"
v-if="(index < (wUnitsSelect.options.length - 2))"> v-if="((index === wUnitAmounts.length-1) && (index < (wUnitsSelect.options.length - 2)))">
<a class="btn btn_secondary btn_icon" <a class="btn btn_secondary btn_icon"
href="javascript:void(0);" href="javascript:void(0);"
@click="addUnit(index)"> @click="addUnit(index)">
......
...@@ -527,13 +527,16 @@ Vue.component('app-waste-utilisation-order-form', { ...@@ -527,13 +527,16 @@ Vue.component('app-waste-utilisation-order-form', {
> >
</waste-filter> </waste-filter>
</div> </div>
<!-- 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 }} {{ localRecord }}
</pre> </pre>
</div> </div>
-->
<!-- end Debug ---> <!-- end Debug --->
<!-- Form --> <!-- Form -->
......
...@@ -20,7 +20,7 @@ block page ...@@ -20,7 +20,7 @@ block page
h1.title!=title h1.title!=title
app-registration(:reg_info_from="'executor'") app-registration(:reg_info_from="'neworder'")
br br
br br
......
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