conformContainer.html
9.73 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
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-task-emptyIn">
<span style="color:red;">*如果不勾选明细,则默认该库位明细全部转移到目的容器</span>
<div class="form-group">
<span style="font-size: 12px;font-weight:bolder;">货主:</span>
<select id="companyCode" name="companyCode" th:with="companyList=${@companyService.selectCompanyByCurrentUserId()}" style="padding: 5px; font-size: 12px;
font-weight:bolder;">
<option th:each="company : ${companyList}" th:text="${company['name']}" th:value="${company['code']}" th:attr=" code = ${company['code']}"></option>
</select>
<span style="font-size: 12px;font-weight:bolder;">u8仓:</span>
<select name="uWarehouseCode" id="uWarehouseCode" th:with="warehouse=${@warehouseWu.selectList()}" style="padding: 5px;font-size: 12px;
font-weight:bolder;">
<option value="">所有</option>
<option th:each="e : ${warehouse}" th:text="${e['uWarehouseName']}" th:value="${e['uWarehouseCode']}" th:attr=" code = ${e['uWarehouseCode']}"></option>
</select>
<span style="font-size: 12px;font-weight:bolder;">物料号:</span>
<input type="text" id="materialCode" name="materialCode"/>
<span style="font-size: 12px;font-weight:bolder;">托盘:</span>
<input type="text" id="containerCode" name="containerCode"/>
<!-- <input type="hidden" id="detailIdList" name="detailIdList">-->
</div>
<div class="form-group">
<label class="col-sm-9 control-label"></label>
<button type="button" class="btn btn-primary" onclick="selectMaterial()">选取明细</button>
<button type="button" class="btn btn-primary" onclick="clearSelect()">清空明细</button>
</div>
<div class="form-group">
<!-- <label class="col-sm-3 control-label">目的库位:</label>-->
<span style="font-size: 12px;font-weight:bolder;">目的托盘:</span>
<input id="destContainerCode" name="destContainerCode" type="text">
</div>
<div class="col-sm-12 select-info" id="selecttable" >
<div class="btn-group hidden-xs" id="toolbar1" role="group">
<span style="color:red;">*下面只查询出虚拟库存</span>
</div>
<table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table>
</div>
<div class="form-group">
<div class="form-control-static col-sm-offset-9">
<button type="submit" class="btn btn-primary">提交</button>
<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script th:inline="javascript">
var prefix = ctx + "inventory/inventoryDetail";
var prefix_header = ctx + "inventory/inventoryHeader";
var inventoryStatus = [[${@dict.getType('inventorySts')}]];
var inventoryLock = [[${@dict.getType('inventoryLock')}]];
var company =[[${@companyService.getCode()}]];
function clearSelect(){
$("#bootstrap-table").bootstrapTable('removeAll');
}
function selectMaterial(){
var companyCode=$("#companyCode").val();
var uWarehouseCode=$("#uWarehouseCode").val();
var materialCode=$("#materialCode").val();
var containerCode=$("#containerCode").val();
$.ajax({
url:prefix + '/inventoryDetailLook',
type:"post",
data:{
"companyCode":companyCode,
"uWarehouseCode":uWarehouseCode,
"materialCode":materialCode,
"containerCode":containerCode,
"zoneCode":"XN"
},
success:function (value) {
console.log(value)
if(value.data!=""){
$("#bootstrap-table").bootstrapTable('load',value.data);
}else {
$("#bootstrap-table").bootstrapTable('removeAll');
$.modal.msgError("没查询出来库存哦!");
}
}
});
}
$("#bootstrap-table").bootstrapTable({
// url: detailPrefix + "/list",
// search: true, //搜索
sortable: true, //排序
showRefresh: true, //刷新
showToggle:true, //视图切换
clickToSelect: true,
showColumns:true, //列选择
// detailView:true,
showExport: true, //导出
exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据
modalName: "入库明细",
sortName: "lastUpdated",
sortOrder: "desc",
iconSize: "outline",
toolbar: "#toolbar1",
contentType: "application/x-www-form-urlencoded",
pagination: true, // 是否显示分页(*)
pageNumber: 1, // 初始化加载第一页,默认第一页
pageSize: 10, // 每页的记录行数(*)
pageList: [10, 25, 50], // 可供选择的每页的行数(*)
onRefresh: function(){
loadDetail();
},
columns: [{
checkbox: true
},
/*{
title: '操作',
align: 'center',
events:'operateEvents',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="#" onclick="select(\'' + row.id+'\')"><i class="fa fa-edit"></i>选取</a> ');
return actions.join('');
}
},*/
{
field: 'id',
title: '明细ID',
sortable: false
},
{
field: 'inventoryHeaderId',
title: '库存头ID',
sortable: true
},
{
field: 'companyCode',
title: '货主',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
$.each(company, function(index, dict) {
if (dict.code == value) {
actions.push("<span class='badge badge-info'>" + dict.name + "</span>");
return false;
}
});
return actions.join('');
}
},
// {
// field : 'batteryPackageWeight',
// title : '电池包重量',
// },
{
field: 'locationCode',
title: '库位编号'
},
{
field: 'containerCode',
title: '容器编号'
},
{
field: 'materialCode',
title: '物料编码'
},
{
field: 'materialName',
title: '物料名称'
},
{
field: 'qty',
title: '库存数量'
},
{
field: 'taskQty',
title: '预定执行数量'
},
{
field: 'materialSpec',
title: '物料规格'
},
{
field: 'materialUnit',
title: '物料单位'
},
{
field: 'inventorySts',
title: '库存状态',
align: 'center',
formatter: function (value, row, index) {
return $.table.selectDictLabel(inventoryStatus, value);
}
}]
});
$("#form-task-emptyIn").validate({
submitHandler: function(form) {
var destContainerCode=$("#destContainerCode").val();
if(destContainerCode==''){
$.modal.alertError("请填写目的托盘编号");
return;
}
let rows = $("#bootstrap-table").bootstrapTable('getSelections');
//console.log(rows);
var ids = "";
for (var i = 0; i<rows.length; i++){
ids += rows[i].id;
ids += ",";
}
ids= ids.substring(0, ids.length-1);
$.ajax({
url:prefix_header + "/conformContainerSave",
type:"post",
data:{
"destContainerCode":destContainerCode,
"detailIdList":ids,
},
success:function (result) {
console.log(result)
if (result.code == web_status.SUCCESS) {
//layer.close()
//layer.close(index);
$.modal.close();
$.modal.alertSuccess(result.msg);
} else if (result.code == web_status.WARNING) {
//layer.close(index);
$.modal.enable();
$.modal.alertWarning(result.msg)
} else {
//layer.close(index);
$.modal.enable();
$.modal.alertError(result.msg);
}
}
});
}
});
</script>
</body>
</html>