Commit 8f5a8e14 authored by Babin Egor's avatar Babin Egor

avoiding errors in console

parent 671a146a
......@@ -9,7 +9,7 @@ Vue.component('app-waste-utilisation-order-form', {
type: Object
},
address: {
type: Object
type: Array
},
docs: {
type: Object
......@@ -116,7 +116,8 @@ Vue.component('app-waste-utilisation-order-form', {
initValue: {
value: '0'
},
serverUrl: 'https://r52.ru/',
serverUrl: '/',
//serverUrl: 'https://r52.ru/',
}
},
created() {
......@@ -197,16 +198,21 @@ Vue.component('app-waste-utilisation-order-form', {
// следим на ссылкой на группы отходов
wasteGroupUrl() {
return this.serverUrl + 'api/type/' + this.localRecord.wType.name + (this.localRecord.wMainGroup.value ? "/" + this.localRecord.wMainGroup.value : "/");
return this.serverUrl + 'api/type/' + this.localRecord.wType.name + (this.localRecord.wMainGroup.value ? "/" + this.localRecord.wMainGroup.value + '/' : "/");
},
// следим за ссылкой на виды отходов
wasteMainGroupUrl(){
return this.serverUrl + 'api/mainType/' + this.localRecord.wType.name
return this.serverUrl + 'api/kind/' + this.localRecord.wType.name + '/';
},
groupSelStyle() {
if (this.wDangerClassSelect.options.length) {
let classSel = this.wDangerClassSelect.options;
//alert(classSel);
if (classSel) {
return 'col-md-9';
} else {
return 'col-md-12';
......@@ -215,7 +221,9 @@ Vue.component('app-waste-utilisation-order-form', {
DangerClassActive() {
if (this.wDangerClassSelect.options.length) {
let classSel = this.wDangerClassSelect.options;
if (classSel) {
return true;
} else {
return false;
......@@ -227,42 +235,6 @@ Vue.component('app-waste-utilisation-order-form', {
methods: {
// Ввод кода отхода вручную
/*
codeUp(){
this.localRecord.wGroup = {};
if ((this.localRecord.wFKKO.code).length > 3) {
for (let i in this.wGroupSelect.options) {
if (((this.wGroupSelect.options[i]["label"]).includes(this.localRecord.wFKKO.code)) ||
((this.wGroupSelect.options[i]["value"]).includes(this.localRecord.wFKKO.code)) ||
((this.localRecord.wFKKO.code).includes(this.wGroupSelect.options[i]["value"])) ||
((this.localRecord.wFKKO.code).includes(this.wGroupSelect.options[i]["label"]))) {
this.localRecord.wGroup = {
"value": this.wGroupSelect.options[i]["label"],
"caption": this.wGroupSelect.options[i]["value"]
};
if ((this.localRecord.wFKKO.code).length == 11) {
this.localRecorf.wDangerClass = {
"value": (this.localRecord.wFKKO.code).slice(-1),
"caption": (this.localRecord.wFKKO.code).slice(-1)
};
}
}
}
}
},
*/
objEmty(obj) {
return Object.keys(obj).length === 0
},
......@@ -381,7 +353,10 @@ Vue.component('app-waste-utilisation-order-form', {
groupsArr.push(options[k]["group"]);
}
}
this.$set(this.wMainGroupSelect, 'options', groupsArr);
//this.$set(this.wMainGroupSelect, 'options', groupsArr);
this.wMainGroupSelect.options = groupsArr;
this.dateFromGroup();
})
},
......@@ -400,7 +375,11 @@ Vue.component('app-waste-utilisation-order-form', {
groupsArr.push(options[k]["group"]);
}
}
this.$set(this.wGroupSelect, 'options', groupsArr);
//this.$set(this.wGroupSelect, 'options', groupsArr);
this.wGroupSelect.options = groupsArr;
this.dateFromGroup();
})
},
......@@ -418,12 +397,16 @@ Vue.component('app-waste-utilisation-order-form', {
for(var k in options){
if (this.localRecord.wGroup["value"] !== undefined){
if (options[k]["group"]["value"] == this.localRecord.wGroup["value"]){
this.$set(this.wDangerClassSelect, 'options', options[k]["class"]);
this.$set(this.wUnitSelect, 'options', options[k]["price_units"]);
//this.$set(this.wDangerClassSelect, 'options', options[k]["class"]);
//this.$set(this.wUnitSelect, 'options', options[k]["price_units"]);
this.wDangerClassSelect.options = options[k]["class"];
this.wUnitSelect.options = options[k]["price_units"];
}
} else {
this.$set(this.wDangerClassSelect, 'options', {});
this.$set(this.wUnitSelect, 'options', {});
//this.$set(this.wDangerClassSelect, 'options', {});
//this.$set(this.wUnitSelect, 'options', {});
}
}
......@@ -435,14 +418,16 @@ Vue.component('app-waste-utilisation-order-form', {
.get(this.wasteGroupUrl)
.then(response => response.data)
.then(options => {
this.initValue.value = !this.isEditing ?
this.initValue.value :
this.localRecord.wGroup.value;
this.initValue.value = !this.isEditing ? this.initValue.value : this.localRecord.wGroup.value;
for(var k in options){
if (options[k]["group"]["value"] == this.localRecord.wGroup["value"]){
this.$set(this.wDangerClassSelect, 'options', options[k]["class"]);
this.$set(this.wUnitSelect, 'options', options[k]["price_units"]);
//this.$set(this.wDangerClassSelect, 'options', options[k]["class"]);
//this.$set(this.wUnitSelect, 'options', options[k]["price_units"]);
this.wDangerClassSelect.options = options[k]["class"];
this.wUnitSelect.options = options[k]["price_units"];
options[k]["price_units"].forEach(element => {
if (element["value"] == this.localRecord.wUnit["value"]){
......@@ -579,8 +564,7 @@ Vue.component('app-waste-utilisation-order-form', {
<field-select
v-bind="wMainGroupSelect"
:init="localRecord.wMainGroup"
@change="localRecord.wMainGroup = $event"
@change="dateFromMainGroup"
@change="(localRecord.wMainGroup = $event, dateFromMainGroup())"
>
</field-select>
</div>
......@@ -592,8 +576,7 @@ Vue.component('app-waste-utilisation-order-form', {
<field-select
v-bind="wGroupSelect"
:init="localRecord.wGroup"
@change="localRecord.wGroup = $event"
@change="dateFromGroup"
@change="(localRecord.wGroup = $event, dateFromGroup())"
>
</field-select>
</div>
......@@ -654,13 +637,14 @@ Vue.component('app-waste-utilisation-order-form', {
<field-select
v-bind="wUnitSelect"
:init="localRecord.wUnit"
@change="localRecord.wUnit = $event"
@change="priceFromSelect"
@change="(localRecord.wUnit = $event, priceFromSelect())"
>
</field-select>
</div>
</div>
</div>
<field-file
......
......@@ -29,6 +29,7 @@ Vue.component('field-select', {
function () {
return {
choices: null,
showDrop: this.showDropProp,
}
},
mounted() {
......@@ -37,6 +38,9 @@ Vue.component('field-select', {
computed: {
},
watch: {
showDropProp: function() {
this.choices.showDropdown();
},
options: 'choicesUpdate', //отслеживаем изменение объекта с опциями
},
methods: {
......@@ -84,6 +88,8 @@ Vue.component('field-select', {
<template v-if="option.choices">
<optgroup v-bind:label="option.label">
{{ option.choices }}
<option v-for="childOption in option.choices"
:value="childOption.value"
:selected="childOption.selected"
......
......@@ -127,6 +127,14 @@
display: none;
}
#choices--danger-class-item-choice-1 {
display: none;
}
#choices--waste-units-item-choice-1 {
display: none;
}
#choices--trans-types-item-choice-1 {
display: none;
}
......
......@@ -3,11 +3,10 @@ import "@babel/polyfill";
import $ from 'jquery';
import html2canvas from "html2canvas";
let orderPdf = document.querySelector('#orderPdf');
let orderPdf = $('#orderPdf');
let tableResult = $('#table-content');
orderPdf.addEventListener('click', function(e)
{
orderPdf.click( function(){
document.body.scrollTop = 0; // For Safari
document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera
......
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