fendanlist.jsp
8.9 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!doctype html>
<html lang="zh">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>进港原始分批业务挂分单</title>
<script src="<%=basePath%>static/easyui/jquery.min.js"></script>
<link href="<%=basePath%>static/layui2.4.5/css/layui.css"
rel="stylesheet">
<script src="<%=basePath%>static/layui2.4.5/layui.js"></script>
<script type="text/javascript"
src="<%=basePath%>static/layer-v3.0.3/layer/layer.js"></script>
<script src="<%=basePath%>static/DataTableExtend.js"></script>
<style>
body {
}
</style>
</head>
<body>
<br />
<blockquote class="layui-elem-quote" align="left">挂分担</blockquote>
<div class="layui-inline">
<div class="layui-inline">
<label class="layui-form-label"
style="font-weight: bold; font-size: 15px; width: 70px;">运单号:</label>
<div class="layui-input-inline">
<input type="text" name="waybillnomaster" autocomplete="off"
class="layui-input" id="waybillnomaster" />
</div>
</div>
</div>
<div class="layui-inline">
<button class="layui-btn layui-btn-radius" lay-submit=""
id="searchBtn" data-type="getInfo">查询</button>
</div>
<br />
<br />
<blockquote class="layui-elem-quote" align="left">运单明细</blockquote>
<table class="layui-hide" id="test" lay-filter="test"></table>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<button class="layui-btn layui-btn-radius layui-btn-sm" lay-event="getCheckData">挂分单</button>
</div>
</script>
<script type="text/html" id="barDemo">
<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" >删除</a>
</script>
<!-- 注意:如果你直接复制所有代码到本地,上述js路径需要改成你本地的 -->
<script>
layui.use('table', function() {
var table = layui.table;
table.render({
elem : '#test',
url : '<%=basePath%>fendanList2',
toolbar : '#toolbarDemo',
title : '用户数据表',
cols : [ [ {
type : 'checkbox',
fixed : 'left'
}, {
field : 'flightno',
title : '航班号',
width : 300,
edit : 'text'
},{
field : 'flightDate',
title : '航班日期',
width : 300,
edit : 'text'
}, {
field : 'param',
title : '分单号',
width : 300,
edit : 'text'
}
] ],
page : true,
done: function (res, curr, count) {// 表格渲染完成之后的回调
$(".layui-table th").css("font-weight", "bold");
LayUIDataTable.SetJqueryObj($);
var currentRowDataList = LayUIDataTable.ParseDataTable(function (index, currentData, rowData) {})
console.log(currentRowDataList);
console.log(currentRowDataList);
$.each(currentRowDataList, function (index, obj) {
/* LayUIDataTable.HideField('param'); */
if (obj['param'] && obj['param'].value == '') {
obj['param'].row.css({"background-color": "#CAE1FF"});
}else{
obj['param'].row.css({"background-color": "#CD6090"});
}
});
}
});
//头工具栏事件
table.on('toolbar(test)', function(obj) {
var checkStatus = table.checkStatus(obj.config.id);
switch (obj.event) {
case 'getCheckData':
var data = checkStatus.data;
console.log(data[0].waybillnomaster);
/* var autoid=data[0].autoid;
var flightno=data[0].flightno;
console.log(autoid);
console.log(flightno); */
layer.confirm('您确定要挂单吗', function(index){
$.ajax({
type : "post",
url : "<%=basePath%>fendanupdate",
data : JSON.stringify(data),
contentType:"application/json",
success: function(data){
if(data.success){
layer.alert( data.msg, function () {
var index = parent.layer.getFrameIndex(window.name);
console.log(index);
layer.closeAll();
var waybillnomaster=$('#waybillnomaster').val();
setTimeout(function(){
table.reload('test', { //表格的id
url:'<%=basePath%>fendanselectByParam',
page:{
curr:1 //从第一页开始
},
where: {
'waybillnomaster':$.trim(waybillnomaster),
}
});});
});
}
},
<%-- $('#waybillnomaster').val(data[0].waybillnomaster);
var flightno=$('#waybillnomaster').val();
setTimeout(function(){
table.reload('test', { //表格的id
url:'<%=basePath%>fendanselectByParam',
page:{
curr:1 //从第一页开始
},
where: {
'waybillnomaster':$.trim(waybillnomaster),
}
});}); --%>
error: function() {
layer.alert("更改失败,请重试");
}
});
});
break;
case 'getCheckLength':
var data = checkStatus.data;
var datalength = data.length;
if(datalength>1){
layer.alert("不能同时修改两个");
}else{
var id = data.id;
layer.open({
type: 2,
title: "落装申请",
shade: 0.8,
id: (new Date()).valueOf(), //设定一个id,防止重复弹出 时间戳1280977330748
moveType: 1, //拖拽模式,0或者1
type: 2,
skin: 'layui-layer-rim', //加上边框
area: ['450px', '400px'],
maxmin: true, //开启最大化最小化按钮
content: "<%=basePath%>edit?id="+id,
success: function (layero, index) {
// 获取子页面的iframe
var iframe = window['layui-layer-iframe' + index];
// 向子页面的全局函数child传参
iframe.child(data);
}
});
}
break;
case 'isAll':
layer.msg(checkStatus.isAll ? '全选' : '未全选');
break;
}
;
});
//监听行工具事件
table.on('tool(test)', function(obj) {
var data = obj.data;
//console.log(obj)
if (obj.event === 'del') {
layer.confirm('真的删除行么', function(index) {
obj.del();
layer.close(index);
});
} else if (obj.event === 'edit') {
layer.prompt({
formType : 2,
value : data.email
}, function(value, index) {
obj.update({
email : value
});
layer.close(index);
});
}
});
$('#searchBtn').on('click',function(){
var type = $(this).data('type');
console.log(type);
active[type] ? active[type].call(this) : '';
});
// 点击获取数据
var active = {
getInfo: function () {
var waybillnomaster=$('#waybillnomaster').val();
/* if (flightno) { */
var index = layer.msg('查询中,请稍候...',{icon: 16,time:false,shade:0});
setTimeout(function(){
table.reload('test', { //表格的id
url:'<%=basePath%>fendanselectByParam',
page:{
curr:1 //从第一页开始
},
where: {
'waybillnomaster':$.trim(waybillnomaster)
}
});
layer.close(index);
},800);
/* } else {
layer.msg("请输入航班号");
} */
},
};
});
</script>
<script type="text/javascript">
layui.use(['form', 'laydate'], function(){
var form = layui.form
,laydate = layui.laydate;
//日期
laydate.render({
elem: '#flightdate'
});
});
</script>
</body>
</html>