HandTask.js
3.8 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
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 = 'HandTask';
var TableName = 'TaskDetail';
var vm = new Vue({
el: '#PalletForm'
});
var PalletIn = new Vue({
data: {}
});
var selector = {
};
var vml = new Array({
vm: vm,
});
$(document).ready(function () {
//var NewHtml = "<option value='SrmD01'>铜箔仓堆垛机</option>";
//NewHtml += "<option value='RgvD01_1'>铜箔1号RGV1号货叉</option>";
//NewHtml += "<option value='RgvD01_2'>铜箔1号RGV2号货叉</option>";
//$("#Stk").append(NewHtml);
////layui刷新select元素
//form.render('select');
});
Universal.BindSelector($, form, vml, selector);
form.on('select(device)', function (data) {
$("#Type").empty();
var device = data.value;
if (device == "RgvC01" || device == "RgvD01") {
var NewHtml = "<option value='Coun1'>重新下发1号货叉任务</option>";
NewHtml += "<option value='Coun2'>重新下发2号货叉任务</option>";
NewHtml += "<option value='Del'>删除RGV任务</option>";
NewHtml += "<option value='Unlock'>解锁双工位小车区域占用</option>";
$("#Type").append(NewHtml);
}
else if (device == "RgvB01" || device == "RgvB02") {
var NewHtml = "<option value='Coun1'>重新下发RGV任务</option>";
NewHtml += "<option value='Del'>删除RGV任务</option>";
$("#Type").append(NewHtml);
}
else if (device == "SrmD01" || device == "SrmC01" || device == "SrmB01") {
var NewHtml = "<option value='Coun'>继续执行堆垛机任务</option>";
NewHtml += "<option value='Req'>重新下发堆垛机任务</option>";
NewHtml += "<option value='Del'>删除堆垛机任务</option>";
$("#Type").append(NewHtml);
}
form.render('select');
})
$(document).on("click", "#BtnGo", function () {
var Stk = $("#Stk option:selected");
var Type = $("#Type option:selected");
var code = Stk.val();
var type = Type.val();
layer.open({
title: '确定信息',
area: '300px;',
type: 1,
content: "<h2 class='c1'>确定选择设备为:</h2><br><h2 class='c3'>" + Stk.text() + "<h2><br><h2 class='c1'>状态选择为:</h2><br><h2 class='c3'>" + Type.text()+"</h2>",
btn: ['确认'],
btnAlign: 'c', //按钮居中
yes: function (index) {
$.ajax({
async: false,
url: "/" + "HandTask" + "/" + "HandTask" + "/AbnormalRepair",
type: "post",
data: { code: code, type: type },
dataType: "json",
success: function (result) {
if (result.Code == 200) {
layer.close(index);
layer.msg("发送成功", { icon: 6, shade: 0.4, time: 1000 });
}
else {
layer.alert("失败:" + result.Message, { icon: 5, shadeClose: true, title: "错误信息" });
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
layer.alert(errorThrown, { icon: 2, title: '提示' });
}
});
}
});
});
});