Commit da8473e1c89907ff57fe0a1a5d67d3efc98a5edf
1 parent
d0a045de
出库单组盘
Showing
3 changed files
with
101 additions
and
251 deletions
src/main/java/com/huaheng/pc/inventory/inventoryDetail/domain/InventoryDetail.java
... | ... | @@ -246,35 +246,6 @@ public class InventoryDetail implements Serializable { |
246 | 246 | @TableField(value = "userDef3") |
247 | 247 | private String userDef3; |
248 | 248 | |
249 | - /** | |
250 | - * 自定义字段4 | |
251 | - */ | |
252 | - @TableField(value = "userDef4") | |
253 | - private String userDef4; | |
254 | - | |
255 | - /** | |
256 | - * 自定义字段5 | |
257 | - */ | |
258 | - @TableField(value = "userDef5") | |
259 | - private String userDef5; | |
260 | - | |
261 | - /** | |
262 | - * 自定义字段6 | |
263 | - */ | |
264 | - @TableField(value = "userDef6") | |
265 | - private String userDef6; | |
266 | - | |
267 | - /** | |
268 | - * 自定义字段7 | |
269 | - */ | |
270 | - @TableField(value = "userDef7") | |
271 | - private String userDef7; | |
272 | - | |
273 | - /** | |
274 | - * 自定义字段8 | |
275 | - */ | |
276 | - @TableField(value = "userDef8") | |
277 | - private String userDef8; | |
278 | 249 | |
279 | 250 | /** |
280 | 251 | * 处理标记 |
... | ... | @@ -360,15 +331,5 @@ public class InventoryDetail implements Serializable { |
360 | 331 | |
361 | 332 | public static final String COL_USERDEF3 = "userDef3"; |
362 | 333 | |
363 | - public static final String COL_USERDEF4 = "userDef4"; | |
364 | - | |
365 | - public static final String COL_USERDEF5 = "userDef5"; | |
366 | - | |
367 | - public static final String COL_USERDEF6 = "userDef6"; | |
368 | - | |
369 | - public static final String COL_USERDEF7 = "userDef7"; | |
370 | - | |
371 | - public static final String COL_USERDEF8 = "userDef8"; | |
372 | - | |
373 | 334 | public static final String COL_PROCESSSTAMP = "processStamp"; |
374 | 335 | } |
375 | 336 | \ No newline at end of file |
... | ... |
src/main/java/com/huaheng/pc/shipment/shipmentDetail/controller/ShipmentDetailController.java
... | ... | @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
4 | 4 | import com.baomidou.mybatisplus.core.metadata.IPage; |
5 | 5 | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
6 | 6 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
7 | -import com.huaheng.common.support.Convert; | |
8 | 7 | import com.huaheng.common.utils.StringUtils; |
9 | 8 | import com.huaheng.common.utils.security.ShiroUtils; |
10 | 9 | import com.huaheng.framework.aspectj.lang.annotation.Log; |
... | ... | @@ -14,8 +13,6 @@ import com.huaheng.framework.web.domain.AjaxResult; |
14 | 13 | import com.huaheng.framework.web.page.PageDomain; |
15 | 14 | import com.huaheng.framework.web.page.TableDataInfo; |
16 | 15 | import com.huaheng.framework.web.page.TableSupport; |
17 | -import com.huaheng.pc.config.zone.domain.Zone; | |
18 | -import com.huaheng.pc.general.material.domain.Material; | |
19 | 16 | import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; |
20 | 17 | import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; |
21 | 18 | import org.apache.shiro.authz.annotation.RequiresPermissions; |
... | ... | @@ -68,7 +65,6 @@ public class ShipmentDetailController extends BaseController |
68 | 65 | |
69 | 66 | lambdaQueryWrapper |
70 | 67 | .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()) |
71 | - .eq(ShipmentDetail::getEnable,true) | |
72 | 68 | .eq(StringUtils.isNotEmpty(shipmentDetail.getShipmentCode()),ShipmentDetail::getShipmentCode,shipmentDetail.getShipmentCode()) |
73 | 69 | .orderByAsc(ShipmentDetail::getId); |
74 | 70 | |
... | ... |
src/main/resources/templates/shipment/shippingCombination/shippingCombination.html
... | ... | @@ -55,6 +55,10 @@ |
55 | 55 | <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> |
56 | 56 | </div> |
57 | 57 | <div class="col-sm-12 select-info table-striped-right"> |
58 | + <ul class="select-list"> | |
59 | + <li style="display: none">id:<input type="text" id="detailId" /></li> | |
60 | + <li>出货数量:<input type="text" id="receiveNum" /></li> | |
61 | + </ul> | |
58 | 62 | <table id="bootstrap-table1" data-mobile-responsive="true" class="table table-bordered table-hover"></table> |
59 | 63 | </div> |
60 | 64 | </div> |
... | ... | @@ -64,52 +68,35 @@ |
64 | 68 | var addFlag = [[${@permission.hasPermi('shipment:shippingCombination:combination')}]]; |
65 | 69 | var cancelFlag = [[${@permission.hasPermi('shipment:shippingCombination:remove')}]]; |
66 | 70 | var taskTypeReal=[[${@dict.getType('taskType')}]]; |
67 | - var containerHeaderStatus = [[${@dict.getType('shipmentContainerHeaderStatus')}]] | |
68 | - var inventoryStatus = [[${@dict.getType('inventoryStatus')}]] | |
71 | + var containerHeaderStatus = [[${@dict.getType('shipmentContainerHeaderStatus')}]]; | |
72 | + var inventoryStatus = [[${@dict.getType('inventoryStatus')}]]; | |
69 | 73 | |
70 | 74 | var prefix = ctx + "shipment/shippingCombination"; |
71 | 75 | |
72 | 76 | var list_select=function(code) { |
73 | 77 | $("#bootstrap-table1").bootstrapTable('removeAll'); |
74 | 78 | $("#bootstrap-table").bootstrapTable('removeAll'); |
75 | - let ids=null; | |
76 | - let id=localStorage.getItem('shipids'); | |
77 | - if(id){ | |
78 | - ids=id; | |
79 | - } | |
80 | - // console.log(code); | |
81 | 79 | $.ajax({ |
82 | - url: prefix + "/listShipmentDetail?code="+code+"&ids="+ids, | |
80 | + url: prefix + "/listShipmentDetail?code="+code, | |
83 | 81 | type: 'get', |
84 | - // datatype: 'json', | |
85 | - // data: { | |
86 | - // code: code | |
87 | - // }, | |
88 | 82 | success: function (value) { |
89 | - // $("#bootstrap-table").bootstrapTable('load', value.data); | |
90 | - // console.log(value); | |
91 | - // $("#bootstrap-table1").bootstrapTable('removeAll'); | |
92 | - // $("#bootstrap-table").bootstrapTable('removeAll'); | |
93 | - var qty_shipment=0; | |
94 | - var qtyCompleted_shipment=0; | |
95 | - | |
96 | - for (var i=0;i<value.data.length;i++){ | |
97 | - if(value.data[i].qty>value.data[i].qtyCompleted){ | |
83 | + let qty_shipment=0; | |
84 | + let qtyCompleted_shipment=0; | |
85 | + for (let i=0;i<value.data.length;i++){ | |
86 | + if(value.data[i].shipQty>value.data[i].requestQty){ | |
98 | 87 | $("#bootstrap-table").bootstrapTable('insertRow',{index:0,row:{id:value.data[i].id, |
99 | - project:value.data[i].project, | |
100 | - //name:value.data[i].name, | |
101 | - receiptId:value.data[i].receiptId, | |
102 | - receiptCode:value.data[i].receiptCode, | |
88 | + shipmentId:value.data[i].shipmentId, | |
89 | + shipmentCode:value.data[i].shipmentCode, | |
103 | 90 | materialCode:value.data[i].materialCode, |
104 | 91 | materialName:value.data[i].materialName, |
105 | - specification:value.data[i].specification, | |
106 | - qty:value.data[i].qty, | |
107 | - qtyCompleted:value.data[i].qtyCompleted, | |
108 | - inventoryStatus:value.data[i].inventoryStatus, | |
109 | - unit:value.data[i].unit}}); | |
92 | + materialSpec:value.data[i].materialSpec, | |
93 | + shipQty:value.data[i].shipQty, | |
94 | + requestQty:value.data[i].requestQty, | |
95 | + inventorySts:value.data[i].inventorySts, | |
96 | + materialUnit:value.data[i].materialUnit}}); | |
110 | 97 | } |
111 | - qty_shipment = qty_shipment + value.data[i].qty; | |
112 | - qtyCompleted_shipment = qtyCompleted_shipment + value.data[i].qtyCompleted; | |
98 | + qty_shipment = qty_shipment + value.data[i].shipQty; | |
99 | + qtyCompleted_shipment = qtyCompleted_shipment + value.data[i].requestQty; | |
113 | 100 | |
114 | 101 | } |
115 | 102 | $("#shipment_length").text(value.data.length); |
... | ... | @@ -117,44 +104,10 @@ |
117 | 104 | $("#qtyCompleted_length").text(qtyCompleted_shipment); |
118 | 105 | } |
119 | 106 | }); |
120 | - $.ajax({ | |
121 | - url: prefix + "/listCombinationDetail?code="+code, | |
122 | - type: 'get', | |
123 | - // datatype: 'json', | |
124 | - // data: { | |
125 | - // code: code | |
126 | - // }, | |
127 | - success: function (value) { | |
128 | - $("#bootstrap-table1").bootstrapTable('load', value.data); | |
129 | - // for (var i=0;i<value.data.length;i++){ | |
130 | - // | |
131 | - // $("#bootstrap-table1").bootstrapTable('insertRow',{index:0, | |
132 | - // row:{ | |
133 | - // id:value.data[i].id, | |
134 | - // headId:value.data[i].headId, | |
135 | - // containerCode:value.data[i].containerCode, | |
136 | - // locationCode:value.data[i].locationCode, | |
137 | - // status:value.data[i].status, | |
138 | - // materialName:value.data[i].materialName, | |
139 | - // shipmentCode:value.data[i].shipmentCode, | |
140 | - // taskType:value.data[i].taskType, | |
141 | - // shipmentDetailId:value.data[i].shipmentDetailId, | |
142 | - // materialCode:value.data[i].materialCode, | |
143 | - // qty:value.data[i].qty, | |
144 | - // userName:value.data[i].userName | |
145 | - // }}); | |
146 | - // } | |
147 | - } | |
148 | - }) | |
149 | - localStorage.removeItem('shipids'); | |
150 | 107 | }; |
151 | 108 | |
152 | 109 | |
153 | 110 | $("#bootstrap-table").bootstrapTable({ |
154 | - // url: prefix + "/list", | |
155 | - createUrl: prefix + "/add", | |
156 | - updateUrl: prefix + "/edit/{id}", | |
157 | - removeUrl: prefix + "/remove", | |
158 | 111 | contentType: "application/x-www-form-urlencoded", |
159 | 112 | // search: true, //搜索 |
160 | 113 | // showRefresh: true,//刷新 |
... | ... | @@ -164,25 +117,29 @@ |
164 | 117 | // detailView:true, |
165 | 118 | // showExport: true, //导出 |
166 | 119 | // exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据 |
167 | - modalName: "入库组盘头", | |
120 | + modalName: "出库组盘头", | |
168 | 121 | // sidePagination: "server", |
169 | 122 | pagination: true, // 是否显示分页(*) |
170 | 123 | pageNumber: 1, // 初始化加载第一页,默认第一页 |
171 | - pageSize: 10, // 每页的记录行数(*) | |
172 | - pageList: [10, 25, 50], | |
173 | - columns: [ | |
174 | - { | |
175 | - field:'work', | |
176 | - title: '操作', | |
177 | - align: 'center', | |
178 | - events: "operateEvents", | |
179 | - formatter: function(value, row, index) { | |
180 | - var actions = []; | |
181 | - actions.push('<a id="qty" class="btn btn-success btn-xs ' + addFlag + '" href="#" onclick="" ><i class="fa fa-edit"></i>组盘</a>'); | |
182 | - // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); | |
183 | - return actions.join(''); | |
124 | + pageSize: 50, // 每页的记录行数(*) | |
125 | + pageList: [10, 25, 50,100], | |
126 | + onClickRow:function(row,ele,field){ | |
127 | + let code=$("#code").val(); | |
128 | + $("#detailId").val(row.id); | |
129 | + $("#receiveNum").val(row.shipQty-row.requestQty); | |
130 | + $.ajax({ | |
131 | + url:prefix+'/getInventory', | |
132 | + type:'post', | |
133 | + data:{ | |
134 | + code:code, | |
135 | + id:row.id | |
136 | + }, | |
137 | + success:res=>{ | |
138 | + $("#bootstrap-table1").bootstrapTable('load',res.data) | |
184 | 139 | } |
185 | - }, | |
140 | + }) | |
141 | + }, | |
142 | + columns: [ | |
186 | 143 | { |
187 | 144 | field : 'id', |
188 | 145 | title : '明细id' |
... | ... | @@ -196,155 +153,122 @@ |
196 | 153 | title:"物料名称" |
197 | 154 | }, |
198 | 155 | { |
199 | - field:'specification', | |
156 | + field:'materialSpec', | |
200 | 157 | title:"物料规格" |
201 | 158 | }, |
202 | 159 | { |
203 | - field : 'qty', | |
160 | + field : 'shipQty', | |
204 | 161 | title : '单据数量' |
205 | 162 | }, |
206 | 163 | { |
207 | - field : 'qtyCompleted', | |
164 | + field : 'requestQty', | |
208 | 165 | title : '已出数量' |
209 | 166 | }, |
210 | 167 | { |
211 | - field : 'inventoryStatus', | |
168 | + field : 'inventorySts', | |
212 | 169 | title : '库存状态', |
213 | 170 | formatter: function(value, row, index) { |
214 | 171 | return $.table.selectDictLabel(inventoryStatus, value); |
215 | 172 | }, |
216 | 173 | }, |
217 | 174 | { |
218 | - field : 'project', | |
219 | - title : '项目号' | |
220 | - }, | |
221 | - | |
222 | - { | |
223 | - field : 'unit', | |
175 | + field : 'materialUnit', | |
224 | 176 | title : '单位' |
225 | 177 | }, |
226 | 178 | ] |
227 | 179 | }); |
228 | 180 | |
229 | 181 | $("#bootstrap-table1").bootstrapTable({ |
230 | - // url: prefix + "/list", | |
231 | - createUrl: prefix + "/add", | |
232 | - updateUrl: prefix + "/edit/{id}", | |
233 | - removeUrl: prefix + "/remove", | |
234 | - // search: true, //搜索 | |
235 | - showRefresh: true, //刷新 | |
236 | - showToggle:true, //视图切换 | |
237 | 182 | clickToSelect: true, |
238 | 183 | showColumns:true, //列选择 |
239 | - // detailView:true, | |
240 | - showExport: true, //导出 | |
241 | - exportDataType: "all", //导出类型basic', 'all', 'selected'.当前页、所有数据、选中数据 | |
242 | - modalName: "入库组盘头", | |
184 | + modalName: "库存", | |
243 | 185 | iconSize: "outline", |
244 | 186 | toolbar: "#toolbar", |
245 | 187 | contentType: "application/x-www-form-urlencoded", |
246 | - // sidePagination: "server", | |
247 | 188 | pagination: true, // 是否显示分页(*) |
248 | 189 | pageNumber: 1, // 初始化加载第一页,默认第一页 |
249 | 190 | pageSize: 10, // 每页的记录行数(*) |
250 | 191 | pageList: [10, 25, 50], |
251 | - onRefresh: function(){ | |
252 | - list_select($("#code").val()); | |
253 | - }, | |
254 | 192 | columns: [ |
255 | 193 | { |
256 | - field : 'id', | |
257 | - title : '组盘明细id', | |
258 | - visible:false | |
194 | + title: '操作', | |
195 | + align: 'center', | |
196 | + events:'operateEvents', | |
197 | + formatter: function(value, row, index) { | |
198 | + let actions = []; | |
199 | + actions.push('<a id="cancel" class="btn btn-success btn-xs" style="background-color: #ac2925" href="#" onclick="Combination(\'' + row.id + '\')"><i class="fa fa-edit"></i>组盘</a> '); | |
200 | + return actions.join(''); | |
201 | + } | |
259 | 202 | }, |
260 | 203 | { |
261 | - field : 'headId', | |
262 | - title : '组盘头id' | |
204 | + field : 'id', | |
205 | + title : 'id' | |
263 | 206 | }, |
264 | 207 | { |
265 | - field : 'containerCode', | |
266 | - title : '容器编号' | |
208 | + field : 'companyCode', | |
209 | + title : '货主' | |
267 | 210 | }, |
268 | 211 | { |
269 | 212 | field : 'locationCode', |
270 | 213 | title : '库位编号' |
271 | 214 | }, |
272 | - // { | |
273 | - // field : 'shipmentCode', | |
274 | - // title : '出库单号' | |
275 | - // }, | |
276 | - { | |
277 | - field : 'materialCode', | |
278 | - title : '存货编码' | |
279 | - }, | |
280 | 215 | { |
281 | - field:"materialName", | |
282 | - title:"物料名称" | |
283 | - }, | |
284 | - { | |
285 | - field : 'taskTypeReal', | |
286 | - title : '预期任务类型', | |
287 | - formatter: function(value, row, index) { | |
288 | - return $.table.selectDictLabel(taskTypeReal, value); | |
289 | - }, | |
216 | + field : 'containerCode', | |
217 | + title : '容器编号' | |
290 | 218 | }, |
291 | 219 | { |
292 | 220 | field : 'qty', |
293 | - title : '配盘数量' | |
221 | + title : '数量' | |
294 | 222 | }, |
295 | 223 | { |
296 | - field : 'status', | |
297 | - title : '状态', | |
298 | - formatter: function(value, row, index) { | |
299 | - return $.table.selectDictLabel(containerHeaderStatus, value); | |
300 | - }, | |
224 | + field : 'materialCode', | |
225 | + title : '存货编码' | |
301 | 226 | }, |
302 | 227 | { |
303 | - field : 'project', | |
304 | - title : '项目号' | |
228 | + field : 'materialName', | |
229 | + title : '物料名称' | |
305 | 230 | }, |
306 | 231 | { |
307 | - field : 'shipmentDetailId', | |
308 | - title : '出库单明细id' | |
232 | + field : 'materialSpec', | |
233 | + title : '物料规格' | |
309 | 234 | }, |
310 | 235 | { |
311 | - field : 'userName', | |
312 | - title : '操作人' | |
236 | + field : 'supplierCode', | |
237 | + title : '供应商编码', | |
238 | + visible:false | |
313 | 239 | }, |
314 | 240 | { |
315 | - title: '操作', | |
241 | + field : 'inventorySts', | |
242 | + title : '库存状态' , | |
316 | 243 | align: 'center', |
317 | - events:'operateEvents', | |
318 | 244 | formatter: function(value, row, index) { |
319 | - var actions = []; | |
320 | - if (row.status == 0) { | |
321 | - actions.push('<a id="cancel" class="btn btn-danger btn-xs ' + cancelFlag + '" href="#" onclick="cancelCombination(\'' + row.id + '\')"><i class="fa fa-remove"></i>取消</a> '); | |
322 | - } | |
323 | - return actions.join(''); | |
245 | + return $.table.selectDictLabel(inventoryStatus, value); | |
324 | 246 | } |
325 | - } | |
247 | + }, | |
326 | 248 | ] |
327 | 249 | }); |
328 | 250 | |
329 | - window.operateEvents = { | |
330 | - 'click #qty': function (e, value, row, index) { | |
331 | - var url = prefix + '/combination?'; | |
332 | - jQuery.each(row, function(key, val) { | |
333 | - url = url + key + "=" + encodeURI(val) + "&"; | |
334 | - }); | |
335 | - open("添加出库组盘", url); | |
336 | - } | |
337 | - }; | |
338 | - | |
339 | - function cancelCombination(id) { | |
340 | - $.modal.confirm("确定删除该组盘?", function() { | |
341 | - var url = prefix + "/cancelCombination"; | |
342 | - var type = "post"; | |
343 | - var dataType = "json"; | |
344 | - var data = JSON.stringify([id]); | |
345 | - var contentType="application/json"; | |
346 | - submit(url,type,dataType, data,contentType); | |
347 | - }); | |
251 | + function Combination(id) { | |
252 | + let num=$("#receiveNum").val(); | |
253 | + let shipmentDetailId=$("#detailId").val(); | |
254 | + $.ajax({ | |
255 | + url:ctx + "shipment/shippingCombination/Addcombination", | |
256 | + type:'post', | |
257 | + data:{ | |
258 | + shipmentDetailId:shipmentDetailId, | |
259 | + inventoryId:id, | |
260 | + shipQty:num, | |
261 | + }, | |
262 | + success:function (response) { | |
263 | + if(response.code===200){ | |
264 | + $.modal.msgSuccess('成功'); | |
265 | + $("#list-btn").click(); | |
266 | + } | |
267 | + else { | |
268 | + $.modal.msg(response.msg) | |
269 | + } | |
270 | + } | |
271 | + }) | |
348 | 272 | } |
349 | 273 | |
350 | 274 | function submit(url, type, dataType, data,content) { |
... | ... | @@ -368,46 +292,15 @@ |
368 | 292 | $.ajax(config) |
369 | 293 | } |
370 | 294 | |
371 | - function open(title, url, width, height){ | |
372 | - if (navigator.userAgent.match(/(iPhone|iPod|Android|ios)/i)) { | |
373 | - width = 'auto'; | |
374 | - height = 'auto'; | |
375 | - } | |
376 | - if (title==null){ | |
377 | - title = false; | |
378 | - } | |
379 | - if (url==null){ | |
380 | - url="404.html"; | |
381 | - } | |
382 | - if ($.common.isEmpty(width)) { | |
383 | - width = 800; | |
384 | - // width = ($(window).width() - 100); | |
385 | - } | |
386 | - if ($.common.isEmpty(height)) { | |
387 | - height = ($(window).height() - 50); | |
388 | - } | |
389 | - layer.open({ | |
390 | - type: 2, | |
391 | - area: [width + 'px', height + 'px'], | |
392 | - fix: false, | |
393 | - //不固定 | |
394 | - maxmin: true, | |
395 | - shade: 0.3, | |
396 | - title: title, | |
397 | - content: url | |
398 | - // shadeClose: true, //点击遮罩关闭层 | |
399 | - }) | |
400 | - } | |
401 | - | |
402 | 295 | function initPage() { |
403 | - var auto = localStorage.getItem("auto"); | |
404 | - var shipmentCode = localStorage.getItem("shipmentCode"); | |
296 | + let auto = localStorage.getItem("auto"); | |
297 | + let shipmentCode = localStorage.getItem("shipmentCode"); | |
405 | 298 | $("#code").val(shipmentCode); |
406 | 299 | if (auto == "true") { |
407 | - var url = prefix + "/autoCombination"; | |
408 | - var type = "post"; | |
409 | - var dataType = "json"; | |
410 | - var data = {"shipmentCode" : shipmentCode}; | |
300 | + let url = prefix + "/autoCombination"; | |
301 | + let type = "post"; | |
302 | + let dataType = "json"; | |
303 | + let data = {"shipmentCode" : shipmentCode}; | |
411 | 304 | submit(url,type,dataType, data); |
412 | 305 | } |
413 | 306 | else{ |
... | ... | @@ -421,7 +314,7 @@ |
421 | 314 | |
422 | 315 | $("#list-btn").click(function () { |
423 | 316 | list_select($("#code").val()); |
424 | - }) | |
317 | + }); | |
425 | 318 | |
426 | 319 | initPage(); |
427 | 320 | }); |
... | ... |