Commit 9b4a5a3b40ab4ceff9d4b40fee262d1c08671dfa
1 parent
e48b2bde
优化入库,入库配盘可以在一个界面完成。
Showing
4 changed files
with
73 additions
and
19 deletions
src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
... | ... | @@ -652,10 +652,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea |
652 | 652 | condition.setWarehouseCode(ShiroUtils.getWarehouseCode()); |
653 | 653 | condition.setTaskId(taskHeader.getId()); |
654 | 654 | LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(condition); |
655 | - TaskDetail taskDetail = taskDetailService.getOne(taskDetailLambdaQueryWrapper); | |
656 | - if (taskDetail != null) { | |
657 | - taskDetail.setToLocation(location.getCode()); | |
658 | - taskDetailService.update(taskDetail, taskDetailLambdaQueryWrapper); | |
655 | + List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambdaQueryWrapper); | |
656 | + if(taskDetailList != null && taskDetailList.size() > 0) { | |
657 | + for(TaskDetail taskDetail : taskDetailList) { | |
658 | + if (taskDetail != null) { | |
659 | + taskDetail.setToLocation(location.getCode()); | |
660 | + taskDetailService.update(taskDetail, taskDetailLambdaQueryWrapper); | |
661 | + } | |
662 | + } | |
659 | 663 | } |
660 | 664 | } |
661 | 665 | //给任务分配库位 |
... | ... |
src/main/resources/templates/inventory/cycleCountHeader/cycleCountHeader.html
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | </a>--> |
73 | 73 | </div> |
74 | 74 | <table id="bootstrap-table" data-mobile-responsive="true" |
75 | - class="table table-bordered table-hover"></table> | |
75 | + class="table table-bordered table-hover text-nowrap"></table> | |
76 | 76 | </div> |
77 | 77 | <div class="tab-pane fade" id="tabDetail"></div> |
78 | 78 | </div> |
... | ... |
src/main/resources/templates/inventory/cycleCountHeader/cyclecountHeader.html
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | </a>--> |
73 | 73 | </div> |
74 | 74 | <table id="bootstrap-table" data-mobile-responsive="true" |
75 | - class="table table-bordered table-hover"></table> | |
75 | + class="table table-bordered table-hover text-nowrap"></table> | |
76 | 76 | </div> |
77 | 77 | <div class="tab-pane fade" id="tabDetail"></div> |
78 | 78 | </div> |
... | ... |
src/main/resources/templates/receipt/receiving/receiving.html
... | ... | @@ -52,6 +52,12 @@ |
52 | 52 | <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table> |
53 | 53 | </div> |
54 | 54 | <div class="col-sm-12 select-info table-striped-right"> |
55 | + <ul class="select-list"> | |
56 | + <li style="display: none">id:<input type="text" id="detailId" /></li> | |
57 | + <li>收货数量:<input type="text" id="receiveNum" /></li> | |
58 | + <li>容器编号:<input type="text" id="containerCode" /></li> | |
59 | + <li><button class="btn btn-sm btn-success" onclick="receipt()">组盘</button></li> | |
60 | + </ul> | |
55 | 61 | <div class="btn-group hidden-xs" id="toolbar1" role="group"> |
56 | 62 | <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()" shiro:hasPermission="receipt:receiptDetail:add"> |
57 | 63 | <i class="fa fa-map-pin"></i> 定位 |
... | ... | @@ -231,19 +237,25 @@ |
231 | 237 | onRefresh: function(){ |
232 | 238 | |
233 | 239 | }, |
234 | - columns: [ | |
235 | - { | |
236 | - field:'work', | |
237 | - title: '操作', | |
238 | - align: 'center', | |
239 | - events: "operateEvents", | |
240 | - formatter: function(value, row, index) { | |
241 | - var actions = []; | |
242 | - actions.push('<a id="qty" class="btn btn-success btn-xs ' + addFlag + '" href="#" onclick="" ><i class="fa fa-edit"></i>收货</a>'); | |
243 | - // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); | |
244 | - return actions.join(''); | |
240 | + onClickRow:function(row,ele,field){ | |
241 | + let code=$("#code").val(); | |
242 | + $("#detailId").val(row.id); | |
243 | + $("#receiveNum").val(row.totalQty-row.openQty); | |
244 | + $.ajax({ | |
245 | + url:prefix+'/getReceiptInfoByBill', | |
246 | + type:'post', | |
247 | + data:{ | |
248 | + code:code, | |
249 | + id:row.id | |
250 | + }, | |
251 | + success:res=>{ | |
252 | + $("#bootstrap-table1").bootstrapTable('load',res.data.list); | |
253 | + $("#bootstrap-table2").bootstrapTable('load',res.data.transactionList); | |
254 | + $("#bootstrap-table3").bootstrapTable('load',res.data.containerList); | |
245 | 255 | } |
246 | - }, | |
256 | + }) | |
257 | + }, | |
258 | + columns: [ | |
247 | 259 | // { |
248 | 260 | // field : 'id', |
249 | 261 | // title : 'id号' |
... | ... | @@ -551,7 +563,45 @@ |
551 | 563 | $.table.refresh("bootstrap-table1"); |
552 | 564 | } |
553 | 565 | |
554 | - function createTask() { | |
566 | + function receipt() { | |
567 | + let containerCode = $("#containerCode").val(); | |
568 | + let locationCode = ''; | |
569 | + Receiving(locationCode, containerCode); | |
570 | + } | |
571 | + | |
572 | + /** | |
573 | + * 组盘 | |
574 | + * @param locationCode | |
575 | + * @param containerCode | |
576 | + */ | |
577 | + function Receiving(locationCode,containerCode) { | |
578 | + let receiptCode=$("#code").val(); | |
579 | + let num=$("#receiveNum").val(); | |
580 | + let receiptDetailId=$("#detailId").val(); | |
581 | + $.ajax({ | |
582 | + url:ctx + "receipt/receiving/save", | |
583 | + type:'post', | |
584 | + data:{ | |
585 | + receiptCode:receiptCode, | |
586 | + qty: num, | |
587 | + receiptDetailId:receiptDetailId, | |
588 | + locationCode:locationCode, | |
589 | + containerCode:containerCode | |
590 | + }, | |
591 | + success:function (data) { | |
592 | + if(data.code===200){ | |
593 | + $.modal.msgSuccess('成功'); | |
594 | + initTable(); | |
595 | + } | |
596 | + else{ | |
597 | + $.modal.msg(data.msg); | |
598 | + } | |
599 | + } | |
600 | + }) | |
601 | + } | |
602 | + | |
603 | + | |
604 | + function createTask() { | |
555 | 605 | let rows=$("#bootstrap-table1").bootstrapTable('getSelections'); |
556 | 606 | if (rows.length == 0) { |
557 | 607 | $.modal.alertWarning("请至少选择一条记录"); |
... | ... |