Revision 1213b27a
Von Hans Peter Schlaepfer vor etwa 5 Jahren hinzugefügt
templates/webpages/wh/warehouse_selection_assembly.html | ||
---|---|---|
7 | 7 |
|
8 | 8 |
<h1>[% title %]</h1> |
9 | 9 |
|
10 |
<script type="text/javascript"> |
|
11 |
<!-- |
|
12 |
warehouses = new Array(); |
|
13 |
[%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %] |
|
14 |
warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array(); |
|
15 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %]; |
|
16 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array(); |
|
17 |
[% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %] |
|
10 |
<script type="text/javascript"><!-- |
|
11 |
warehouses = new Array(); |
|
12 |
[% USE WAREHOUSES_it = Iterator(WAREHOUSES) %] |
|
13 |
[% FOREACH warehouse = WAREHOUSES_it %] |
|
14 |
warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array(); |
|
15 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %]; |
|
16 |
warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array(); |
|
17 |
[% USE BINS_it = Iterator(warehouse.BINS) %] |
|
18 |
[% FOREACH bin = BINS_it %] |
|
18 | 19 |
warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]] = new Array(); |
19 | 20 |
warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]"; |
20 | 21 |
warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %]; |
21 |
[% END %]
|
|
22 |
[% END %]
|
|
22 |
[% END %] |
|
23 |
[% END %] |
|
23 | 24 |
|
24 |
function warehouse_selected(warehouse_id, bin_id) {
|
|
25 |
var control = document.getElementById("bin_id");
|
|
25 |
function warehouse_selected(warehouse_id, bin_id) { |
|
26 |
var control = document.getElementById("bin_id"); |
|
26 | 27 |
|
27 |
for (var i = control.options.length - 1; i >= 0; i--) {
|
|
28 |
control.options[i] = null;
|
|
29 |
}
|
|
28 |
for (var i = control.options.length - 1; i >= 0; i--) { |
|
29 |
control.options[i] = null; |
|
30 |
} |
|
30 | 31 |
|
31 |
var warehouse_index = 0;
|
|
32 |
var warehouse_index = 0; |
|
32 | 33 |
|
33 |
for (i = 0; i < warehouses.length; i++)
|
|
34 |
if (warehouses[i]['id'] == warehouse_id) {
|
|
35 |
warehouse_index = i;
|
|
36 |
break;
|
|
37 |
}
|
|
34 |
for (i = 0; i < warehouses.length; i++) |
|
35 |
if (warehouses[i]['id'] == warehouse_id) { |
|
36 |
warehouse_index = i; |
|
37 |
break; |
|
38 |
} |
|
38 | 39 |
|
39 |
var warehouse = warehouses[warehouse_index];
|
|
40 |
var bin_index = 0;
|
|
40 |
var warehouse = warehouses[warehouse_index]; |
|
41 |
var bin_index = 0; |
|
41 | 42 |
|
42 |
for (i = 0; i < warehouse['bins'].length; i++)
|
|
43 |
if (warehouse['bins'][i]['id'] == bin_id) {
|
|
44 |
bin_index = i;
|
|
45 |
break;
|
|
46 |
}
|
|
43 |
for (i = 0; i < warehouse['bins'].length; i++) |
|
44 |
if (warehouse['bins'][i]['id'] == bin_id) { |
|
45 |
bin_index = i; |
|
46 |
break; |
|
47 |
} |
|
47 | 48 |
|
48 |
for (i = 0; i < warehouse['bins'].length; i++) {
|
|
49 |
control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
|
|
50 |
}
|
|
49 |
for (i = 0; i < warehouse['bins'].length; i++) { |
|
50 |
control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']); |
|
51 |
} |
|
51 | 52 |
|
52 | 53 |
|
53 |
control.options[bin_index].selected = true;
|
|
54 |
}
|
|
54 |
control.options[bin_index].selected = true; |
|
55 |
} |
|
55 | 56 |
|
56 |
$(function() { |
|
57 |
warehouse_selected([% warehouse_id %], [% bin_id %]); |
|
58 |
}) |
|
59 |
--> |
|
60 |
</script> |
|
57 |
$(function() { |
|
58 |
warehouse_selected([% warehouse_id %], [% bin_id %]); |
|
59 |
}) |
|
60 |
--></script> |
|
61 | 61 |
|
62 | 62 |
<form name="Form" method="post" action="wh.pl" id="form"> |
63 | 63 |
|
64 |
[% IF saved_message %]
|
|
64 |
[% IF saved_message %] |
|
65 | 65 |
<p>[% saved_message %]</p> |
66 |
[% END %]
|
|
66 |
[% END %] |
|
67 | 67 |
|
68 | 68 |
<p> |
69 | 69 |
<table> |
... | ... | |
84 | 84 |
</select> |
85 | 85 |
</td> |
86 | 86 |
</tr> |
87 |
|
|
88 | 87 |
<tr> |
89 | 88 |
<th align="right" nowrap>[% 'Destination bin' | $T8 %]:</th> |
90 | 89 |
<td><select id="bin_id" name="bin_id"></select></td> |
91 | 90 |
</tr> |
92 |
|
|
93 | 91 |
<tr> |
94 | 92 |
<th align="right" nowrap>[% 'Charge number' | $T8 %]</th> |
95 | 93 |
<td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td> |
... | ... | |
103 | 101 |
</td> |
104 | 102 |
</tr> |
105 | 103 |
[% END %] |
106 |
|
|
107 | 104 |
<tr> |
108 | 105 |
<th align="right" nowrap>[% 'Quantity' | $T8 %]</th> |
109 | 106 |
<td> |
... | ... | |
113 | 110 |
</select> |
114 | 111 |
</td> |
115 | 112 |
</tr> |
116 |
|
|
117 | 113 |
<tr> |
118 | 114 |
<th align="right" nowrap>[% 'Optional comment' | $T8 %]</th> |
119 | 115 |
<td><input name="comment" size="30" value="[% HTML.escape(comment) %]"></td> |
120 | 116 |
</tr> |
117 |
</tbody> |
|
118 |
</table> |
|
121 | 119 |
|
122 |
</table> |
|
123 |
</p> |
|
124 |
</form> |
|
120 |
</div> |
|
121 |
</form> |
|
125 | 122 |
|
126 | 123 |
<script type='text/javascript'> |
127 |
$(function(){ |
|
128 |
$('#parts_id').on('set_item:PartPicker', function(event, item) { |
|
129 |
if (!item.warehouse_id) |
|
130 |
return; |
|
131 |
|
|
132 |
$('#warehouse_id').val(item.warehouse_id); |
|
133 |
warehouse_selected(item.warehouse_id, item.bin_id); |
|
134 |
}); |
|
135 |
}) |
|
124 |
$(function(){
|
|
125 |
$('#parts_id').on('set_item:PartPicker', function(event, item) {
|
|
126 |
if (!item.warehouse_id)
|
|
127 |
return;
|
|
128 |
|
|
129 |
$('#warehouse_id').val(item.warehouse_id);
|
|
130 |
warehouse_selected(item.warehouse_id, item.bin_id);
|
|
131 |
});
|
|
132 |
})
|
|
136 | 133 |
</script> |
Auch abrufbar als: Unified diff
Design-4.0: Kosmetik: templates/webpages/wh/..: Einrückung/HTML
Neues kivitendo Design Aenderungen in templates/webpages/wh/..