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