lkReceiving.html
5.01 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
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<style>
#form-lk-receiving {
padding: 10px 15px;
}
#form-lk-receiving .select-list ul li {
margin-right: 25px;
}
#form-lk-receiving .select-list ul li input {
width: 200px;
}
#form-lk-receiving .table-section {
display: block;
width: 100%;
clear: both;
margin-top: 10px;
}
#form-lk-receiving .table-title {
display: block;
width: 100%;
clear: both;
margin: 0 0 8px;
font-weight: bold;
}
#form-lk-receiving .btn-group-bottom {
margin-top: 15px;
text-align: right;
}
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form id="form-lk-receiving">
<input type="hidden" id="receiptId" name="receiptId" th:value="${receiptId}">
<input type="hidden" id="receiptCode" name="receiptCode" th:value="${receiptCode}">
<div class="select-list">
<ul>
<li>托盘号:<input id="containerCode" name="containerCode" type="text" placeholder="请输入托盘号"></li>
<li>materialId:<input id="materialId" name="materialId" type="text" placeholder="请输入materialId"></li>
</ul>
</div>
<div class="table-section">
<div class="table-title">入库明细</div>
<table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table>
</div>
<div class="btn-group-bottom">
<button onclick="$.modal.close()" class="btn btn-default" type="button">取消</button>
<button type="button" class="btn btn-primary" onclick="lkSubmit()">立库收货</button>
</div>
</form>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var prefix = ctx + "receipt/receiptHeader";
var detailPrefix = ctx + "receipt/receiptDetail";
var receiptId = [[${receiptId}]];
$(function () {
$("#bootstrap-table").bootstrapTable({
url: detailPrefix + "/list",
method: "post",
contentType: "application/x-www-form-urlencoded",
pagination: true,
pageSize: 10,
pageList: [10, 25, 50],
clickToSelect: true,
queryParams: function (params) {
return {
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
receiptId: receiptId
};
},
columns: [
{
radio: true
},
{
field: 'id',
title: '详情id'
},
{
field: 'materialCode',
title: '物料编码'
},
{
field: 'materialName',
title: '物料名称'
},
{
field: 'materialSpec',
title: '物料规格'
},
{
field: 'materialID',
title: '物料条码'
},
{
field: 'batch',
title: '批次'
},
{
field: 'lot',
title: '批号'
},
{
field: 'qty',
title: '单据数量'
},
{
field: 'taskQty',
title: '已收数量'
},
{
field: 'ctn',
title: 'ctn号'
}
]
});
});
function lkSubmit() {
var containerCode = $("#containerCode").val();
var materialId = $("#materialId").val();
if (!containerCode) {
$.modal.alertWarning("请输入托盘号");
return;
}
if (!materialId) {
$.modal.alertWarning("请输入materialId");
return;
}
var rows = $("#bootstrap-table").bootstrapTable('getSelections');
if (rows.length === 0) {
$.modal.alertWarning("请选择一条入库明细");
return;
}
$.ajax({
cache: true,
type: "POST",
url: prefix + "/lkAdd",
data: {
receiptCode: $("#receiptCode").val(),
receiptDetailId: rows[0].id,
containerCode: containerCode,
materialId: materialId
},
error: function () {
$.modal.alertError("请求失败!");
},
success: function (data) {
$.operate.saveSuccess(data);
}
});
}
</script>
</body>
</html>