TTaskLift.js
2.44 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
layui.config({
base: "/js/"
}).use(['form', 'I18nPage', 'element', 'vue', 'layer', 'jquery', 'hhweb'], function () {
var form = layui.form,
layer = layui.layer,
element = layui.element,
$ = layui.jquery,
hhweb = layui.hhweb,
I18nPage = layui.I18nPage;
var AreaName = 'task';
var TableName = 'TTaskLift';
var Lang = I18nPage.GetLang();
var MessageContainer = {};
I18nPage.GetI18nMessage({
Type: "PM",
Code: "TTaskLift",
Container: MessageContainer,
});
I18nPage.GetI18nText({
Type: "LP",
Code: "TTaskLift",
});
if (Lang == "cn") {
$($(':radio[name="LiftNo"]')[0]).attr("title","W1区入库");
$($(':radio[name="LiftNo"]')[1]).attr("title","C1区");
$($(':radio[name="LiftNo"]')[2]).attr("title", "W1区备料");
}
else {
$($(':radio[name="LiftNo"]')[0]).attr("title","W1 Area In");
$($(':radio[name="LiftNo"]')[1]).attr("title","C1 Area");
$($(':radio[name="LiftNo"]')[2]).attr("title", "W1 Area Out");
}
$($(':radio[name="LiftNo"]')[0]).attr("value", "172.29.176.11");
$($(':radio[name="LiftNo"]')[1]).attr("value", "172.29.194.159");
$($(':radio[name="LiftNo"]')[2]).attr("value", "172.29.176.10");
form.render()
$("#SendTask").on('click', function () {
var liftNo = $(':radio[name="LiftNo"]:checked').val();
if (liftNo == undefined || liftNo == "") {
layer.alert(MessageContainer["LiftNoNotSelect"], { icon: 5, shadeClose: true, title: MessageContainer["ErrorInfo"] });
return;
}
var index = layer.load();
$.ajax({
url: "/" + AreaName + "/" + TableName + "/LiftChange",
type: "post",
data: { liftNo: liftNo },
dataType: "json",
success: function (result) {
layer.close(index);
if (result.Code == 200 && result.Status) {
layer.msg(MessageContainer["Success"]);
}
else {
layer.alert(result.Message, { icon: 5, shadeClose: true, title: MessageContainer["ErrorInfo"] });
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
layer.close(index);
layer.alert(errorThrown, { icon: 2, shadeClose: true, title: MessageContainer["ErrorInfo"] });
}
});
});
});