forked from parth-r-patel/outpost-polymer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-form.html
161 lines (140 loc) · 6.17 KB
/
auto-form.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<link rel="import" href="bower_components/paper-button/paper-button.html">
<link rel="import" href="bower_components/core-label/core-label.html">
<polymer-element name="auto-form">
<template>
<style id="style">
.labels{
padding: 7px 7px 7px 7px;
height: 50px;
}
.labels > l
{
margin: 0;
position: relative;
top: 34%;
}
</style>
<bs-container>
<bs-row>
<bs-col xs="6">
<div><h4>Recycle Bins form Staging Zone</h4></div>
</bs-col>
<bs-col xs="6">
<div><h4>Totes form Staging Zone</h4></div>
</bs-col>
</bs-row>
<bs-row>
<bs-col xs="2">
<div class="labels"><l>Moved</l></div>
</bs-col>
<bs-col xs="4">
<number-counter id = "BinStagingMoved" values = [0] valueLimits = [3]></number-counter>
</bs-col>
<bs-col xs="2">
<div class="labels"><l>Moved</l></div>
</bs-col>
<bs-col xs="4">
<number-counter id = "TotesStagingMoved" values = [0] valueLimits = [3]></number-counter>
</bs-col>
</bs-row>
<bs-row>
<bs-col xs=2>
<div class="labels"><l>Scored</l></div>
</bs-col>
<bs-col xs="4">
<number-counter id = "BinStagingScored" values = [0] valueLimits = [3]></number-counter>
</bs-col>
<bs-col xs="2">
<div class="labels"><l>Scored</l></div>
</bs-col>
<bs-col xs="4">
<number-counter id = "TotesStagingScored" values = [0] valueLimits = [3]></number-counter>
</bs-col>
</bs-row>
<bs-row>
<bs-col xs="6"></bs-col>
<bs-col xs="2">
<div class="labels"><l>Stack Scored</l></div>
</bs-col>
<bs-col xs="4">
<paper-toggle-button id="stackScored" checked="{{StackScored}}" style="height: 50px; padding-top: 30px; padding-left: 25px"></paper-toggle-button>
</bs-col>
</bs-row>
<bs-row>
<bs-col xs="6"><h4>Recycle Bins from Step</h4></bs-col>
<bs-col xs="6"><div><h4>Mobility</h4></div></bs-col>
</bs-row>
<bs-row>
<bs-col xs="2">
<div class="labels"><l>Acquired</l></div>
</bs-col>
<bs-col xs="4">
<number-counter id = "BinsStep" values = [0] valueLimits = [4]></number-counter>
</bs-col>
<bs-col xs="2">
<div class="labels"><l>Auto Zone</l></div>
</bs-col>
<bs-col xs="4">
<paper-toggle-button id="mobility" checked="{{auto}}" style="height: 50px; padding-top: 25px ; padding-left: 25px">Auto Mobility</paper-toggle-button>
</bs-col>
</bs-row>
<bs-row>
<bs-col xs="6"><div><h4>Totes from Step</h4></div></bs-col>
<bs-col xs="6"><div><h4>Totes form Landfill</h4></div></bs-col>
</bs-row>
<bs-row>
<bs-col xs="2">
<div class="labels"><l>Acquired</l></div>
</bs-col>
<bs-col xs="4">
<paper-toggle-button id="totesStep" checked="{{TotesStep}}" style="height: 50px; padding-top: 25px; padding-left: 25px">Auto Mobility</paper-toggle-button>
</bs-col>
<bs-col xs="2">
<div class="labels"><l>Acquired</l></div>
</bs-col>
<bs-col xs="4">
<paper-toggle-button id="totesLandfill" checked="{{TotesLandfill}}" style="height: 50px; padding-top: 25px; padding-left: 25px"></paper-toggle-button>
</bs-col>
</bs-row>
<bs-col xs="12">
<paper-button raised on-click="{{submitData}}">Submit That Auto Data Doe</paper-button>
</bs-col>
</bs-container>
<paper-toast id="toast" text="{{msg}}" duration="3000"></paper-toast>
</template>
<script>
Polymer({
binsMoved: 0,
totesMoved: 0,
binsStep: 0,
auto: false,
TotesStep: false,
TotesLandfill: false,
StackScored: false,
submitData: function () {
if(this.$.BinStagingScored.values[0] > this.$.BinStagingMoved.values[0]){
this.msg = ("More Bins Scored than Acquired");
this.$.toast.show();
}
else if(this.$.TotesStagingScored.values[0] > this.$.TotesStagingScored.values[0]){
this.msg = ("More Totes Scored than Acquired");
this.$.toast.show();
}
else {
var AutoForm = {};
AutoForm["AutoMobility"] = this.auto ? 1 : 0;
AutoForm["AutoBinsMoved"] = this.$.BinStagingMoved.values[0];
AutoForm["AutoBinsScored"] = this.$.BinStagingScored.values[0];
AutoForm["AutoTotesMoved"] = this.$.TotesStagingMoved.values[0];
AutoForm["AutoTotesStacked"] = this.StackScored ? 1 : 0;
AutoForm["AutoTotesScored"] = this.$.TotesStagingScored.values[0];
AutoForm["LandfillTotesAcquired"] = this.TotesLandfill ? 1 : 0;
AutoForm["StepTotesAcquired"] = this.TotesStep ? 1 : 0;
AutoForm["StepBinsAcquired"] = this.$.BinsStep.values[0];
window.sessionStorage.setItem("autoForm", JSON.stringify(AutoForm));
document.querySelector('outpost-header /deep/ paper-tabs').selected++;
}
}
});
</script>
</polymer-element>