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
7555f666
Commit
7555f666
authored
Dec 19, 2019
by
Babin Egor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update vue order form
parent
8beabd44
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
30 deletions
+54
-30
app-waste-utilisation-order-form.js
...tilisation-order-form/app-waste-utilisation-order-form.js
+54
-30
No files found.
src/blocks/app-waste-utilisation-order-form/app-waste-utilisation-order-form.js
View file @
7555f666
...
@@ -34,27 +34,14 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -34,27 +34,14 @@ Vue.component('app-waste-utilisation-order-form', {
},
},
helptext
:
''
helptext
:
''
},
},
w
GroupSelect2
:
{
w
MainGroupSelect
:
{
title
:
'Вид отходов'
,
title
:
'Вид отходов'
,
attrs
:
{
attrs
:
{
name
:
'waste-group'
,
name
:
'waste-group'
,
id
:
'waste-group'
,
id
:
'waste-group'
,
required
:
true
required
:
true
},
},
options
:
[
options
:
[],
{
option
:
"1"
,
label
:
"прочие отходы"
},
{
option
:
"1"
,
label
:
"отходы металла, стекла, дерева, текстиля"
},
{
option
:
"1"
,
label
:
"Промышленные стоки"
}
],
settings
:
{
settings
:
{
searchEnabled
:
true
,
searchEnabled
:
true
,
shouldSort
:
false
,
shouldSort
:
false
,
...
@@ -129,6 +116,7 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -129,6 +116,7 @@ Vue.component('app-waste-utilisation-order-form', {
name
:
'communal'
,
name
:
'communal'
,
caption
:
'Сбор коммунальных отходов'
,
caption
:
'Сбор коммунальных отходов'
,
},
},
wMainGroup
:
{},
wGroup
:
{},
wGroup
:
{},
wDangerClass
:
{},
wDangerClass
:
{},
wFKKO
:
{
wFKKO
:
{
...
@@ -187,12 +175,18 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -187,12 +175,18 @@ Vue.component('app-waste-utilisation-order-form', {
//console.log("Режим создания новой записи")
//console.log("Режим создания новой записи")
}
}
// Подгружаем группы отходов
this
.
wasteMainGroupsLoad
();
this
.
wasteGroupsLoad
();
this
.
wasteGroupsLoad
();
this
.
fiasInit
();
this
.
fiasInit
();
},
},
computed
:
{
computed
:
{
wasteGroupUrl
()
{
wasteGroupUrl
()
{
return
'/api/type/'
+
this
.
localRecord
.
wType
.
name
return
'https://r52.ru/api/type/'
+
this
.
localRecord
.
wType
.
name
},
wasteMainGroupUrl
(){
return
'https://r52.ru/api/mainType/'
+
this
.
localRecord
.
wType
.
name
},
},
// Открываем кнопку "сохранить"
// Открываем кнопку "сохранить"
formFilledRight
()
{
formFilledRight
()
{
...
@@ -206,6 +200,7 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -206,6 +200,7 @@ Vue.component('app-waste-utilisation-order-form', {
},
},
methods
:
{
methods
:
{
// Вводи кода отхода вручную
codeUp
(){
codeUp
(){
this
.
localRecord
.
wGroup
=
{};
this
.
localRecord
.
wGroup
=
{};
...
@@ -242,6 +237,7 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -242,6 +237,7 @@ Vue.component('app-waste-utilisation-order-form', {
return
Object
.
keys
(
obj
).
length
===
0
return
Object
.
keys
(
obj
).
length
===
0
},
},
// КЛАДР
fiasInit
()
{
fiasInit
()
{
let
$this
=
this
;
let
$this
=
this
;
...
@@ -337,6 +333,30 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -337,6 +333,30 @@ Vue.component('app-waste-utilisation-order-form', {
// Отключаем проверку введённых данных для строений
// Отключаем проверку введённых данных для строений
// $building.fias('verify', false);
// $building.fias('verify', false);
},
},
// Подгрузка селектора гнлавных групп отходов
wasteMainGroupsLoad
(){
axios
.
get
(
this
.
wasteMainGroupUrl
)
.
then
(
response
=>
response
.
data
)
.
then
(
options
=>
{
// новый бланк/старый
this
.
initValue
.
value
=
!
this
.
isEditing
?
this
.
initValue
.
value
:
this
.
localRecord
.
wMainGroup
.
value
;
let
groupsArr
=
[];
for
(
var
k
in
options
){
if
(
options
[
k
][
"group"
])
{
groupsArr
.
push
(
options
[
k
][
"group"
]);
}
}
this
.
$set
(
this
.
wMainGroupSelect
,
'options'
,
groupsArr
);
this
.
dateFromGroup
();
})
},
// Подгрузка селектора группы отходов
wasteGroupsLoad
()
{
wasteGroupsLoad
()
{
axios
axios
.
get
(
this
.
wasteGroupUrl
)
.
get
(
this
.
wasteGroupUrl
)
...
@@ -355,15 +375,16 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -355,15 +375,16 @@ Vue.component('app-waste-utilisation-order-form', {
this
.
$set
(
this
.
wGroupSelect
,
'options'
,
groupsArr
);
this
.
$set
(
this
.
wGroupSelect
,
'options'
,
groupsArr
);
this
.
dateFromGroup
();
this
.
dateFromGroup
();
})
})
},
dateFromMainGroup
()
{
},
},
dateFromGroup
()
{
dateFromGroup
()
{
axios
axios
.
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
(
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"
]){
...
@@ -439,7 +460,7 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -439,7 +460,7 @@ Vue.component('app-waste-utilisation-order-form', {
amount
:
this
.
localRecord
.
wAmount
,
amount
:
this
.
localRecord
.
wAmount
,
group
:
this
.
localRecord
.
wGroup
[
"value"
]
group
:
this
.
localRecord
.
wGroup
[
"value"
]
},
},
url
:
"/api/transport/getPrice/"
url
:
"
https://r52.ru
/api/transport/getPrice/"
}).
then
(
response
=>
response
.
data
)
}).
then
(
response
=>
response
.
data
)
.
then
(
options
=>
{
.
then
(
options
=>
{
this
.
localRecord
.
wTransportCost
[
"value"
]
=
parseFloat
(
options
[
"price"
]).
toFixed
(
2
);
this
.
localRecord
.
wTransportCost
[
"value"
]
=
parseFloat
(
options
[
"price"
]).
toFixed
(
2
);
...
@@ -451,12 +472,15 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -451,12 +472,15 @@ Vue.component('app-waste-utilisation-order-form', {
this
.
localRecord
.
wType
=
e
;
this
.
localRecord
.
wType
=
e
;
this
.
localRecord
.
wMainGroup
=
{}
this
.
localRecord
.
wGroup
=
{};
this
.
localRecord
.
wGroup
=
{};
this
.
localRecord
.
wDangerClass
=
{};
this
.
localRecord
.
wDangerClass
=
{};
this
.
localRecord
.
wUnit
=
{};
this
.
localRecord
.
wUnit
=
{};
this
.
localRecord
.
wFKKO
=
{};
this
.
localRecord
.
wFKKO
=
{};
this
.
localRecord
.
wAmount
=
""
;
this
.
localRecord
.
wAmount
=
""
;
this
.
wasteMainGroupsLoad
();
this
.
wasteGroupsLoad
();
this
.
wasteGroupsLoad
();
},
},
...
@@ -491,7 +515,7 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -491,7 +515,7 @@ Vue.component('app-waste-utilisation-order-form', {
</waste-filter>
</waste-filter>
</div>
</div>
<!-- Debug --->
<!-- Debug --->
<div style="
display: none;
position: absolute; right: -130px;top: 0px; background-color:#fff; z-index:1000; width: 400px; height: 1000px; padding: 10px; border: 1px solid #999;">
<div style="position: absolute; right: -130px;top: 0px; background-color:#fff; z-index:1000; width: 400px; height: 1000px; padding: 10px; border: 1px solid #999;">
<pre>
<pre>
{{ localRecord }}
{{ localRecord }}
</pre>
</pre>
...
@@ -531,10 +555,10 @@ Vue.component('app-waste-utilisation-order-form', {
...
@@ -531,10 +555,10 @@ Vue.component('app-waste-utilisation-order-form', {
<div class="block_orange-b">
<div class="block_orange-b">
<!-- Вид отхода. Список -->
<!-- Вид отхода. Список -->
<field-select
<field-select
v-bind="w
GroupSelect2
"
v-bind="w
MainGroupSelect
"
:init="localRecord.wGroup"
:init="localRecord.w
Main
Group"
@change="localRecord.wGroup = $event"
@change="localRecord.w
Main
Group = $event"
@change="dateFromGroup"
@change="dateFrom
Main
Group"
>
>
</field-select>
</field-select>
</div>
</div>
...
...
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