1
2
<!DOCTYPE HTML>
<html lang= "zh" xmlns:th= "http://www.thymeleaf.org"
周鸿
authored
about a year ago
3
>
4
5
6
7
<meta charset= "utf-8" >
<head th:include= "include :: header" ></head>
<body class= "gray-bg" >
<style type= "text/css" >
8
#img_list li {
9
10
11
font-size: 10px;
/*width: 50px;*/
text-align: left;
12
margin: 5px 20px 5px 5px;
13
}
14
15
#img_list li img {
16
17
18
height: 35px;
width: 35px;
}
19
20
#info_list {
21
width: 100%;
22
display: inline-block;
23
}
24
25
26
#info_list li {
margin: 8px 3px 0 5px;
27
}
28
29
#info_list li span {
30
31
32
33
34
font-size: 12px;
display: inline-block;
/*width: 65px;*/
text-align: center;
}
35
36
.grid {
37
38
39
40
41
display: inline-block;
width: 50px;
height: 50px;
/*margin: 12px 6px;*/
margin-bottom: 6px;
42
background-size: cover;
43
44
background-image: url("../img/icon/空柜空闲.png");
}
45
46
#location span {
47
48
49
50
51
52
53
54
55
56
57
58
59
display: inline-block;
text-align: right;
width: 50px;
margin-right: 10px;
}
</style>
<div class= "container-div" >
<div class= "row" >
<div class= "col-sm-12 select-info" >
<form id= "container-form" >
<div class= "select-list" >
<ul id= "select_info" >
<li>
60
61
仓库:
<select id= "warehouseCode" name= "warehouseCode" >
62
<option value= "" > 所有</option>
周鸿
authored
about a year ago
63
64
65
<option value= "CS0001" th:selected= "${warehouseCode=='CS0001'}" > 长沙仓库</option>
<option value= "KS0001" th:selected= "${warehouseCode=='KS0001'}" > 昆山仓库</option>
<option value= "XZ0001" th:selected= "${warehouseCode=='XZ0001'}" > 徐州仓库</option>
66
67
68
</select>
</li>
<li>
69
<select id= "zoneCode" name= "zoneCode" style= "width: 100px" >
70
71
<option selected th:each= "item:${@zone.getZoneCodeList()}" th:value= "${item['code']}"
th:text= "${item['name']}" ></option>
72
73
74
75
76
77
78
79
80
81
82
83
84
85
</select>
</li>
<li>
第
<select id= "editable-num" name= "num" style= "width: 70px" >
</select>
</li>
<li>
<select id= "editable-select" name= "col" style= "width: 70px" >
<option value= "row" selected > 行</option>
<option value= "line" > 列</option>
<option value= "layer" > 层</option>
</select>
</li>
86
87
88
<!-- <li>货主编码:-->
<!-- <input type="text" name="receiptCompanyCode" id="receiptCompanyCode">-->
<!-- </li>-->
89
<li>
90
91
<a class= "btn btn-primary btn-rounded btn-sm" onclick= "Search()" ><i
class= "fa fa-search" ></i> 搜索</a>
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
</li>
</ul>
</div>
</form>
</div>
<div class= "col-sm-12 select-info" >
<form id= "receiptHeader-form" >
<div class= "select-list" >
<ul id= "img_list" style= "" >
<li>
空柜空闲:<img src= "../img/icon/空柜空闲.png" >
</li>
<li>
空盘空闲:<img src= "../img/icon/空盘空闲.png" >
</li>
<li>
半盘空闲:<img src= "../img/icon/半盘空闲.png" >
</li>
<li>
整盘空闲:<img src= "../img/icon/整盘空闲.png" >
</li>
<li>
空柜锁定:<img src= "../img/icon/空柜锁定.png" >
</li>
<li>
空盘锁定:<img src= "../img/icon/空盘锁定.png" >
</li>
<li>
半盘锁定:<img src= "../img/icon/半盘锁定.png" >
</li>
<li>
整盘锁定:<img src= "../img/icon/整盘锁定.png" >
</li>
<li>
空柜禁用:<img src= "../img/icon/空柜禁用.png" >
</li>
<li>
空盘禁用:<img src= "../img/icon/空盘禁用.png" >
</li>
<li>
半盘禁用:<img src= "../img/icon/半盘禁用.png" >
</li>
<li>
整盘禁用:<img src= "../img/icon/整盘禁用.png" >
</li>
137
<li><span style= "font-size: 12px" > 库位统计情况:</span>
138
<input style= "width: 400px; font-size: 12px" type= "text" id= "zone" disabled />
139
</li>
140
141
</ul>
<br><br>
142
143
144
145
<ul id= "info_list" >
<li><span> 库位:</span><input type= "text" id= "code" disabled /></li>
<li><span> 容器编码:</span><input type= "text" id= "containerCode" disabled /></li>
<li><span> 物料信息:<select id= "material" style= "width: auto" ><option> 无</option></select></span></li>
周鸿
authored
about a year ago
146
147
148
149
<!-- <li>-->
<!-- <a class="btn btn-success btn-rounded btn-sm" onclick="checkLocationCode()"-->
<!-- shiro:hasPermission="inventory:inventory:seeOut"><i class="fa fa-eye"></i> 出库查看</a>-->
<!-- </li>-->
150
</ul>
151
152
153
154
<!-- <ul>-->
<!-- <li style="float:left;margin-left: 40px"><button type="button" class="btn btn-sm btn-success" onclick="searchLocation()">查看库位</button></li>-->
<!-- <li style="float:left;margin-left: 20px"><button type="button" class="btn btn-sm btn-success" onclick="searchInventory()">查看库存</button></li>-->
<!-- </ul>-->
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
</div>
</form>
</div>
<div class= "col-sm-12 select-info" >
<!--style="width: 100%;overflow-x: scroll;white-space:nowrap"-->
<div id= "borderCol" style= "overflow-y: scroll;white-space:nowrap" >
<div class= "location" id= "location" >
<!--<div class="grid"></div>-->
</div>
</div>
</div>
</div>
</div>
<div th:include= "include :: footer" ></div>
<script th:inline= "javascript" >
170
var prefix = ctx + "config/location";
周鸿
authored
about a year ago
171
var prefix_task = ctx + "task/taskHeader";
172
var grid_row;
173
var grid_row_first;
174
175
176
var grid_line;
var grid_layer;
var list_info;
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
var grid_rest = "../img/icon/空柜空闲.png";
var grid_empty = "../img/icon/空盘空闲.png";
var grid_half = "../img/icon/半盘空闲.png";
var grid_all = "../img/icon/整盘空闲.png";
var grid_emp_waing = "../img/icon/空柜禁用.png";
var grid_empty_waring = "../img/icon/空盘禁用.png";
var grid_half_waring = "../img/icon/半盘禁用.png";
var grid_all_waring = "../img/icon/整盘禁用.png";
var grid_emp_lock = "../img/icon/空柜锁定.png";
var grid_empty_lock = "../img/icon/空盘锁定.png";
var grid_half_lock = "../img/icon/半盘锁定.png";
var grid_all_lock = "../img/icon/整盘锁定.png";
var rel_empty = "../img/icon/空.png";
var grid_num_1 = 0;
var grid_num_2 = 0;
var grid_num_3 = 0;
var grid_num_4 = 0;
var grid_num_5 = 0;
var grid_num_6 = 0;
var grid_num_7 = 0;
var grid_num_8 = 0;
var grid_num_9 = 0;
var grid_num_10 = 0;
var grid_num_11 = 0;
var grid_num_12 = 0;
202
var currentContainerCode;
203
204
205
var currentLocationCode = 0;
var currentMaterialCode = 0;
$(function () {
206
resetAjax("LK");
207
208
209
//库位类型和行列层选择
$("#editable-select").change(function () {
210
let num = $("#editable-select").val();
211
212
$("#editable-num").children().remove();
if (num === "row") {
213
for (let i = grid_row_first; i <= grid_row; i++) {
214
$("#editable-num").append("<option value='" + i + "'>" + i + "</option>")
215
}
216
} else if (num === "line") {
217
for (let i = 1; i <= grid_line; i++) {
218
$("#editable-num").append("<option value='" + i + "'>" + i + "</option>")
219
}
220
} else if (num === "layer") {
221
222
for (let i = grid_layer; i >= 1; i--) {
$("#editable-num").append("<option value='" + i + "'>" + i + "</option>")
223
}
224
225
226
/*for (let i = 1; i <= grid_layer; i++) {
$("#editable-num").append("<option value='"+i+"'>"+i+"</option>")
}*/
227
228
}
});
229
230
$("#zoneCode").change(function () {
231
232
233
let type = $("#zoneCode").val();
let warehouseCode = $("#warehouseCode").val();
resetAjax(warehouseCode, type);
234
235
236
});
//页面初始化请求
237
function resetAjax(warehouseCode, type) {
238
console.log(warehouseCode);
239
$.ajax({
240
241
242
243
244
url: prefix + "/getAllLocation",
type: "post",
data: {
warehouseCode: warehouseCode,
type: type
245
},
246
247
success: function (res) {
grid_row = res.data.maxRow;
248
grid_row_first = res.data.minRow;
249
250
grid_line = res.data.maxLine;
grid_layer = res.data.maxLayer;
251
252
253
254
255
256
//初始格子
$("#location").children().remove();
for (let i = 1; i <= grid_layer; i++) {
// var index=i+1;<span style='margin-top:30px'>第"+ index +"行</span>
$(".location").append("<br>");
for (let j = 1; j <= grid_line; j++) {
257
$(".location").append("<img data-i='1' data-j=" + j + " data-k=" + i + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
258
259
}
}
260
let num = $("#editable-select").val();
261
262
$("#editable-num").children().remove();
if (num === "row") {
263
for (let i = grid_row_first; i <= grid_row; i++) {
264
$("#editable-num").append("<option value='" + i + "'>" + i + "</option>")
265
}
266
} else if (num === "line") {
267
for (let i = 1; i <= grid_line; i++) {
268
$("#editable-num").append("<option value='" + i + "'>" + i + "</option>")
269
}
270
} else if (num === "layer") {
271
for (let i = 1; i <= grid_layer; i++) {
272
$("#editable-num").append("<option value='" + i + "'>" + i + "</option>")
273
}
274
275
}
changeMargin();
276
Search();
277
278
279
280
}
});
}
281
282
//监听浏览器宽度的改变
283
window.onresize = function () {
284
285
286
287
288
289
290
291
292
changeMargin();
border()
};
changeMargin();
border()
});
//边框高度
function border() {
293
294
295
let box_height = $("#borderCol").offset().top;
let window_height = $(window).height() - 20;
$("#borderCol").css({"height": window_height - box_height});
296
297
298
299
}
//格子宽度
function changeMargin() {
300
301
302
let box_width = document.getElementById("location").offsetWidth;
box_width = box_width - 80;
let num = $("#editable-select").val();
303
304
let grid_width;
if (num === "layer" || num === "row") {
305
306
307
grid_width = box_width / grid_line;
} else if (num === "line") {
grid_width = box_width / grid_row;
308
309
}
if (grid_width >= 50) {
310
311
312
313
314
$(".grid").css({"width": "50px", "height": "50px"});
} else if (grid_width <= 20) {
$(".grid").css({"width": "20px", "height": "20px"});
} else {
$(".grid").css({"width": grid_width, "height": grid_width});
315
316
317
318
319
}
}
//tips信息
function lays(x) {
320
321
322
323
324
325
326
let $j = $(x);
let row = $j.attr("data-i");
let line = $j.attr("data-j");
let layers = $j.attr("data-k");
row = parseInt(row);
line = parseInt(line);
layers = parseInt(layers);
327
328
if (list_info) {
for (let i = 0; i < list_info.length; i++) {
329
if (list_info[i].iRow === row && list_info[i].iColumn === line && list_info[i].iLayer === layers) {
330
331
let str_info = '';
let container_code = '';
332
if (list_info[i].containerCode) {
333
container_code = " 容器编码:" + list_info[i].containerCode + "";
334
335
if (list_info[i].materialName) {
for (let j = 0; j < list_info[i].materialName.length; j++) {
336
337
338
339
// let list_batch = list_info[i].batch[j] === null ? "无" : list_info[i].batch[j] === "" ? "无" : list_info[i].batch[j];
let list_days = list_info[i].days[j] === null ? "无" : list_info[i].days[j] === "" ? "无" : list_info[i].days[j];
str_info = str_info + "<br>库龄:" + list_days + ",物料名称:" + list_info[i].materialName[j] + ",物料编码:" + list_info[i].materialCode[j] +
",数量:" + list_info[i].qty[j] + ""
340
341
342
}
}
}
343
344
345
let code = list_info[i].code === null ? "无" : list_info[i].code;
layer.tips("第" + row + "行,第" + line + "列,第" + layers + "层<br>库位:" + code + container_code + str_info + ""
, $j, {tips: [1, "rgb(28,132,198)"], time: 0, area: 'auto', maxWidth: '1000'});
346
347
}
}
348
349
350
} else {
return ""
}
351
352
353
354
355
356
357
358
359
360
}
//关闭tips
function Mclose(x) {
let index = layer.tips();
layer.close(index);
}
//搜索平面库位
function Search() {
361
362
363
let index = $("#editable-select").val();
let num = $("#editable-num").val();
let zoneCode = $("#zoneCode").val();
364
365
$("#code").val("");
$("#containerCode").val("");
366
let warehouseCode = $("#warehouseCode").val();
367
368
369
$("#material").children().remove();
$("#material").append("<option>无</option>");
let data;
370
seachZone();
371
if (index === "row") {
372
data = {type: zoneCode, row: num, warehouseCode: warehouseCode};
373
$("#location").children().remove();
374
375
376
377
378
379
380
381
382
for (let i = grid_layer; i >= 1; i--) {
$(".location").append("<br><span>第" + i + "层</span>");
for (let j = 1; j <= grid_line; j++) {
$(".location").append("<img data-i=" + num + " data-j=" + j + " data-k=" + i + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
}
}
/*for (let i = 1; i <= grid_layer; i++) {
383
$(".location").append("<br><span>第"+ i+"层</span>");
384
385
386
387
for (let j = 1; j <= grid_line; j++) {
$(".location").append("<img data-i="+num+" data-j="+j+" data-k="+i+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
}
388
}*/
389
changeMargin();
390
391
392
ajaxGrid(index, data);
} else if (index === "line") {
data = {type: zoneCode, line: num, warehouseCode: warehouseCode};
393
$("#location").children().remove();
394
395
396
397
398
399
400
for (let k = grid_layer; k >= 1; k--) {
$(".location").append("<br><span>第" + k + "层</span>");
for (let l = 1; l <= grid_row; l++) {
$(".location").append("<img data-i=" + l + " data-j=" + num + " data-k=" + k + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
}
}
/*for (let k = 1; k <= grid_layer; k++) {
401
402
403
404
$(".location").append("<br><span>第"+ k+"层</span>");
for (let l = 1; l <= grid_row; l++) {
$(".location").append("<img data-i="+l+" data-j="+num+" data-k="+k+" class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
}
405
}*/
406
changeMargin();
407
408
409
ajaxGrid(index, data);
} else if (index === "layer") {
data = {type: zoneCode, layer: num, warehouseCode: warehouseCode};
410
411
$("#location").children().remove();
for (let m = 1; m <= grid_row; m++) {
412
$(".location").append("<br><span>第" + m + "行</span>");
413
for (let n = 1; n <= grid_line; n++) {
414
$(".location").append("<img data-i=" + m + " data-j=" + n + " data-k=" + num + " class='grid' onmouseover='lays(this)' onmouseout='Mclose(this)' onclick='gridMsg(this)'>");
415
416
417
}
}
changeMargin();
418
ajaxGrid(index, data);
419
420
}
}
421
422
423
//库位信息请求和状态显示
function ajaxGrid(x, info) {
424
let load = layer.msg('加载中', {icon: 16, shade: 0.4, time: false});
425
$.ajax({
426
427
428
429
430
url: prefix + "/getLocationInfo",
type: "post",
data: info,
success: function (res) {
if (res.code === 200 || res.data || res.msg === "成功") {
431
432
433
434
435
436
437
438
439
440
441
442
grid_num_1 = 0;
grid_num_2 = 0;
grid_num_3 = 0;
grid_num_4 = 0;
grid_num_5 = 0;
grid_num_6 = 0;
grid_num_7 = 0;
grid_num_8 = 0;
grid_num_9 = 0;
grid_num_10 = 0;
grid_num_11 = 0;
grid_num_12 = 0;
443
if (x === "row") {
444
console.log('grid_line', grid_line)
445
for (let i = 0; i < res.data.length; i++) {
446
447
448
449
//let index=res.data[i].iColumn+((res.data[i].iLayer-1)*grid_line);
let index = res.data[i].iColumn + ((grid_layer - res.data[i].iLayer) * grid_line);
index = index - 1;
resShow(res, index, i);
450
}
451
452
//console.log('grid_line',grid_line)
//console.log('grid_layer',grid_layer)
453
clearLocation(grid_line, grid_layer);
454
layer.close(load);
455
} else if (x === "line") {
456
for (let i = 0; i < res.data.length; i++) {
457
458
// let index=res.data[i].iRow+((res.data[i].iLayer-1)*grid_row);
let index = res.data[i].iRow + ((grid_layer - res.data[i].iLayer) * grid_row);
459
460
index = index - 1;
resShow(res, index, i);
461
}
462
clearLocation(grid_row, grid_layer);
463
layer.close(load);
464
} else if (x === "layer") {
465
for (let i = 0; i < res.data.length; i++) {
466
467
468
let index = res.data[i].iColumn + ((res.data[i].iRow - 1) * grid_line);
index = index - 1;
resShow(res, index, i);
469
}
470
clearLocation(grid_line, grid_row);
471
472
layer.close(load);
}
473
} else if (res.msg !== "成功" || res.code !== 200) {
474
475
476
477
478
479
layer.close(load);
layer.open({
title: '错误',
content: res.msg
});
}
480
list_info = res.data;
481
},
482
error: function (req, msg) {
483
484
485
486
487
488
console.log(msg);
}
})
}
//库位请求的结果显示
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
function resShow(res, index, i) {
if (res.data[i].deleted === false) {
if (res.data[i].userDef3 === "1") {
$(".grid").eq(index).attr({"src": grid_rest, "isTrue": 1});
grid_num_1 = grid_num_1 + 1;
} else if (res.data[i].userDef3 === "2") {
$(".grid").eq(index).attr({"src": grid_empty, "isTrue": 1});
grid_num_2 = grid_num_2 + 1;
} else if (res.data[i].userDef3 === "3") {
$(".grid").eq(index).attr({"src": grid_half, "isTrue": 1});
grid_num_3 = grid_num_3 + 1;
} else if (res.data[i].userDef3 === "4") {
$(".grid").eq(index).attr({"src": grid_all, "isTrue": 1});
grid_num_4 = grid_num_4 + 1;
} else if (res.data[i].userDef3 === "5") {
$(".grid").eq(index).attr({"src": grid_emp_lock, "isTrue": 1});
grid_num_5 = grid_num_5 + 1;
} else if (res.data[i].userDef3 === "6") {
$(".grid").eq(index).attr({"src": grid_empty_lock, "isTrue": 1});
grid_num_6 = grid_num_6 + 1;
} else if (res.data[i].userDef3 === "7") {
$(".grid").eq(index).attr({"src": grid_half_lock, "isTrue": 1});
grid_num_7 = grid_num_7 + 1;
} else if (res.data[i].userDef3 === "8") {
$(".grid").eq(index).attr({"src": grid_all_lock, "isTrue": 1});
grid_num_8 = grid_num_8 + 1;
} else if (res.data[i].userDef3 === "9") {
$(".grid").eq(index).attr({"src": grid_emp_waing, "isTrue": 1});
grid_num_9 = grid_num_9 + 1;
} else if (res.data[i].userDef3 === "10") {
$(".grid").eq(index).attr({"src": grid_empty_waring, "isTrue": 1});
grid_num_10 = grid_num_10 + 1;
} else if (res.data[i].userDef3 === "11") {
$(".grid").eq(index).attr({"src": grid_half_waring, "isTrue": 1});
grid_num_11 = grid_num_11 + 1;
} else if (res.data[i].userDef3 === "12") {
$(".grid").eq(index).attr({"src": grid_all_waring, "isTrue": 1});
grid_num_12 = grid_num_12 + 1;
}
} else if (res.data[i].deleted === true) {
$(".grid").eq(i).attr({"src": rel_empty, "onmouseover": "", "onclick": ""});
}
531
532
533
534
535
}
//清除将数据库中没有的库位
function clearLocation(x, y) {
for (let j = 0; j < x * y; j++) {
536
let sta = $(".grid").eq(j).attr("isTrue");
537
if (sta !== "1") {
538
$(".grid").eq(j).attr({"src": rel_empty, "onmouseover": "", "onclick": ""});
539
540
541
542
543
544
}
}
}
//点击显示当前库位信息
function gridMsg(msg) {
545
546
547
548
549
550
551
let $j = $(msg);
let row = $j.attr("data-i");
let line = $j.attr("data-j");
let layers = $j.attr("data-k");
row = parseInt(row);
line = parseInt(line);
layers = parseInt(layers);
552
553
if (list_info) {//缓存查询
for (let i = 0; i < list_info.length; i++) {
554
if (list_info[i].iRow === row && list_info[i].iColumn === line && list_info[i].iLayer === layers) {
555
556
557
if (list_info[i].materialName) {
$("#material").children().remove();
for (let j = 0; j < list_info[i].materialName.length; j++) {
558
559
560
561
562
// let list_batch = list_info[i].batch[j] === null ? "无" : list_info[i].batch[j] === "" ? "无" : list_info[i].batch[j];
let list_days = list_info[i].days[j] === null ? "无" : list_info[i].days[j] === "" ? "无" : list_info[i].days[j];
let str_info = "库龄:" + list_days + "/ 物料名称:" + list_info[i].materialName[j] + "/ 物料编码:" + list_info[i].materialCode[j] +
"/ 数量:" + list_info[i].qty[j] + "";
$("#material").append("<option>" + str_info + "</option>");
563
currentMaterialCode = list_info[i].materialCode[j]
564
}
565
} else {
566
567
568
569
$("#material").children().remove();
$("#material").append("<option>无</option>");
}
$("#code").val(list_info[i].code);
570
$("#containerCode").val(list_info[i].containerCode === "" ? "无" : list_info[i].containerCode);
571
572
currentContainerCode = $("#containerCode").val()
currentLocationCode = $("#code").val()
573
574
}
}
575
576
577
} else {
return ""
}
578
//接口查询
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
// $.ajax({
// url:prefix+"/getLocationInfo",
// type:"post",
// data:{
// type:"L",
// row:row,
// line:line,
// layer:layers,
// grid:1
// },
// success:function (res) {
// $("#row_info").val(res.data[0].row);
// $("#line_info").val(res.data[0].line);
// $("#layer_info").val(res.data[0].layer);
// $("#id").val(res.data[0].id);
// $("#code").val(res.data[0].code);
// $("#warehouseId").val(res.data[0].warehouseId);
// $("#warehouseCode").val(res.data[0].warehouseCode);
// $("#rowIndex").val(res.data[0].rowIndex);
// $("#roadway").val(res.data[0].roadway);
// $("#type").val(res.data[0].type);
// $("#containerId").val(res.data[0].containerId);
// $("#containerCode").val(res.data[0].containerCode);
// $("#zoneId").val(res.data[0].zoneId);
// $("#zoneCode").val(res.data[0].zoneCode);
// $("#status").val(res.data[0].userDef3);
// $("#lastCycleCountDate").val(res.data[0].lastCycleCountDate);
// $("#created").val(res.data[0].created);
// $("#createdBy").val(res.data[0].createdBy);
// $("#lastUpdated").val(res.data[0].lastUpdated);
// $("#lastUpdatedBy").val(res.data[0].lastUpdatedBy);
// $("#enable").val(res.data[0].enable);
// }
// });
613
614
615
616
617
618
619
620
}
//出库查看
function checkLocationCode() {
let data = $("#code").val();
if (data) {
$.modal.loading("正在处理中,请稍后...");
$.ajax({
周鸿
authored
about a year ago
621
url: prefix_task + "/checkLocationCode",
622
623
624
625
type: 'post',
datatype: 'json',
data: {
locationCode: data
626
627
628
},
success: function (result) {
if (result.code == web_status.SUCCESS) {
周鸿
authored
about a year ago
629
$.modal.alertSuccess(result.msg);
630
631
632
633
634
635
} else {
$.modal.alertError(result.msg)
}
$.modal.closeLoading()
}
})
636
637
} else {
layer.tips('请选择库位!', $("#code"), {tips: [1, "rgb(28,132,198)"], time: 3000, area: 'auto', maxWidth: '1000'})
638
639
}
}
640
641
642
function searchLocation() {
if (!currentLocationCode) {
643
$.modal.alertError("请选择库位")
644
645
646
} else {
localStorage.setItem("locationCode", currentLocationCode)
createMenuItem(ctx + "config/location", "库位管理")
647
}
648
649
650
}
function searchInventory() {
651
if (!currentLocationCode) {
652
653
654
$.modal.alertError("请选择库位")
return
}
655
656
localStorage.setItem("locationCode", currentLocationCode)
createMenuItem(ctx + "inventory/inventoryHeader", "库存查看")
657
}
658
659
function seachZone() {
660
$.ajax({
661
662
663
664
url: ctx + "config/zone/getStatus",
data: {
zoneCode: $("#zoneCode").val(),
warehouseCode: $("#warehouseCode").val()
665
},
666
667
668
669
670
success: function (response) {
if (response.code == 200) {
$("#zone").val("库位总数:" + response.data.location + ", 空闲库位:" + response.data.emptyLocation +
", 空托盘库位:" + response.data.haveContainLocation + ", 有货库位:" + response.data.haveInventoryLocation)
} else {
671
672
673
$.modal.alertError(response.msg)
}
},
674
error: function () {
675
676
677
678
$.modal.alertError("未知的错误")
}
})
}
679
680
681
682
683
684
685
686
687
688
$(function () {
layui.use('laydate', function () {
var laydate = layui.laydate;
laydate.render({elem: '#appointmentTime', min: 0, theme: 'molv', type: 'datetime'});
});
$("select[name='warehouseCode']").change(function (e) {
debugger;
let warehouseCode = $("select[name='warehouseCode'] option:selected").val();
689
if (!warehouseCode) {
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
return;
}
$.ajax({
url: ctx + "config/zone/findByWare",
type: 'post',
data: {warehouseCode: warehouseCode},
success: function (response) {
if (response.code === 200) {
$("select[name='zoneCode']").children().remove();
$("select[name='zoneCode']").append(`<option value="">所有</option>`);
for (let item of response.data) {
let option = `<option value="${item.code}">${item.name}</option>`;
$("select[name='zoneCode']").append(option);
}
} else {
$.modal.msgError(response.msg)
}
}
});
})
})
711
712
</script>
</body>
713
</html>