AGVconfirm.html
5.02 KB
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
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>
.grid{
display: inline-block;
width: 40px;
height: 40px;
border: 1px solid #0e9aef;
margin: 1px 2px;
font-size: 10px;
}
</style>
<body>
<div class="wrapper wrapper-content animated fadeInRight ibox-content" style="text-align: center">
<!--<form class="form-horizontal m">-->
<!--<div class="form-group">-->
<!--<label class="col-sm-3 control-label">X轴:</label>-->
<!--<div class="col-sm-8">-->
<!--<select id="row" name="row" class="form-control">-->
<!--<option value="">自动</option>-->
<!--</select>-->
<!--</div>-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<label class="col-sm-3 control-label">Y轴:</label>-->
<!--<div class="col-sm-8">-->
<!--<select id="line" name="line" class="form-control">-->
<!--<option value="">自动</option>-->
<!--</select>-->
<!--</div>-->
<!--</div>-->
<!--<div class="col-sm-12 select-info">-->
<!--style="width: 100%;overflow-x: scroll;white-space:nowrap"-->
<div id="borderCol">
<div class="location" id="location">
<!--<div class="grid"></div>-->
</div>
</div>
<div class="form-group">
<div class="form-control-static col-sm-offset-9">
<input type="button" onclick="removeSubmit()" class="btn btn-primary" value="自动回库">
<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
</div>
</div>
<!--</div>-->
<!--</form>-->
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "receipt/AgvReceiving";
var station=window.parent.station;
var row=0,line=0;
var stationCode=window.parent.$("#stationInfo").attr("data-station");
function removeSubmit() {
$.ajax({
url:prefix+'/TaskAssigns',
type:'post',
data:{
taskType:1,
station:stationCode
// row:row,
// line:line
},
success:function(res){
if(res.code===200){
$.modal.msgSuccess(res.msg);
}
else{
$.modal.msgError(res.msg);
}
}
})
}
function changeMargin(){
let box_width=document.getElementById("location").offsetWidth;
box_width=box_width-80;
let grid_width=box_width/line;
$(".grid").css({"width":grid_width,"height":grid_width});
}
function gridMsg(msg){
let $j=$(msg);
let row=$j.attr("data-row");
let line=$j.attr("data-line");
row=parseInt(row);
line=parseInt(line);
$.ajax({
url:prefix+'/TaskAssigns',
type:'post',
data:{
taskType:1,
row:row,
line:line,
station:stationCode
},
success:function(res){
if(res.code===200){
$.modal.msgSuccess(res.msg);
}
else{
$.modal.msgError(res.msg);
}
}
})
}
$(function () {
window.onresize = function(){
changeMargin();
};
changeMargin();
$.ajax({
url:prefix+'/address',
type:'post',
success:function(res){
if(res){
row=res.data.row;
line=res.data.line;
for (let j = row; j > 0; j--) {
$(".location").append("<br>");
for (let k = line; k > 0; k--) {
$(".location").append("<div data-row="+ j +" data-line="+k+" class='grid' onclick='gridMsg(this)'>"+ j +","+ k +"</div>");
}
}
$.ajax({
url:prefix+'/EmptyAddress' ,
type:'post' ,
success:function(res){
if(res){
for (let i = 0; i < res.data.length; i++) {
let dom=$("[data-row="+res.data[i].row+"][data-line="+res.data[i].line+"]");
dom.attr("style","background-color:rgb(100,168,24)");
}
}
}
})
}
}
})
})
</script>
</body>
</html>