Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
E
ecouniversal
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Babin Egor
ecouniversal
Commits
8f5a8e14
Commit
8f5a8e14
authored
Mar 05, 2020
by
Babin Egor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoiding errors in console
parent
671a146a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
63 deletions
+60
-63
app-waste-utilisation-order-form.js
...tilisation-order-form/app-waste-utilisation-order-form.js
+44
-60
field-select-vue.js
src/blocks/field-select-vue/field-select-vue.js
+6
-0
field-select.scss
src/blocks/field-select/field-select.scss
+8
-0
script.js
src/js/script.js
+2
-3
No files found.
src/blocks/app-waste-utilisation-order-form/app-waste-utilisation-order-form.js
View file @
8f5a8e14
...
...
@@ -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
...
...
src/blocks/field-select-vue/field-select-vue.js
View file @
8f5a8e14
...
...
@@ -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"
...
...
src/blocks/field-select/field-select.scss
View file @
8f5a8e14
...
...
@@ -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
;
}
...
...
src/js/script.js
View file @
8f5a8e14
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment