StationHandTask.js
3.65 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
layui.config({
base: "/js/"
}).use(['form', 'element', 'vue', 'layer', 'laydate', 'jquery','hhweb', 'table', 'utils', 'Universal'], function () {
var form = layui.form,
layer = layui.layer,
element = layui.element,
laydate = layui.laydate,
$ = layui.jquery,
table = layui.table,
Universal = layui.Universal;
var AreaName = 'StationHandTask';
var TableName = 'StationHandTask';
var vm = new Vue({
el: '#PalletForm'
});
var PalletIn = new Vue({
data: {}
});
var selector = {
};
var vml = new Array({
vm: vm,
});
Universal.BindSelector($, form, vml, selector);
var list;
//请求可以被清除的站台
function ReStation() {
var html = "<option class='select_Station' value=''>请选择需要清空的站台</option>";;
$.ajax({
async: true,
type: "post",
url: "/HandTask/HandTask/RequestStation",
dataType: "json",
success: function (result) {
if (result.code == 200) {
list = result.data;
for (var i = 0; i < list.length; i++)
{
html += "<option class='select_Station'value='" + i + "'>站台号: " + list[i].Name + "</option>";
}
$("#Station").html(html);
form.render();
}
else if (result.code == 300) {
layer.alert(result.msg, { icon: 5, shade: 0.4,});
return;
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
layer.alert(errorThrown, { icon: 2, title: '提示' });
}
});
};
//点击清除按钮
$(document).on("click", "#BtnGo", function () {
var Stk = $("#Station option:selected");
var a = Stk.val();
var Pallet = list[a];
layer.open({
title: '确定信息',
area: '300px;',
type: 1,
content: "<h2 class='c1'>清空站台为:</h2><br><h2 class='c3'>" + Pallet.Name + "<h2><br><h2 class='c1'>该站台上的托盘号为:</h2><br><h2 class='c3'>" + Pallet.Containercode + "</h2>",
btn: ['确认'],
btnAlign: 'c', //按钮居中
yes: function (index) {
layer.alert("确定清除站台数据??", { icon: 3, shadeClose: true, title: "提示信息" }, function (index) {
$.ajax({
async: false,
url: "/" + "HandTask" + "/" + "HandTask" + "/EmptyStation",
type: "post",
data: { code: Pallet.Code },
dataType: "json",
success: function (result) {
if (result.code == 200) {
layer.closeAll();
layer.msg(result.msg, { icon: 6, shade: 0.4, time: 1000 });
ReStation();
}
else {
layer.alert("失败:" + result.msg, { icon: 5, shadeClose: true, title: "错误信息" });
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
layer.alert(errorThrown, { icon: 2, title: '提示' });
}
});
});
}
});
});
$(document).ready(function () {
ReStation();
})
});