Commit 8e1037cfe98fd5bd433d5087f0228678b840018e

Authored by xqs
2 parents 6522352a 9b4a5a3b

Merge branch 'develop' of http://www.huahengrobot.com:90/wms/wms2 into develop

src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java
@@ -652,10 +652,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea @@ -652,10 +652,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea
652 condition.setWarehouseCode(ShiroUtils.getWarehouseCode()); 652 condition.setWarehouseCode(ShiroUtils.getWarehouseCode());
653 condition.setTaskId(taskHeader.getId()); 653 condition.setTaskId(taskHeader.getId());
654 LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(condition); 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/receipt/receiving/receiving.html
@@ -52,6 +52,12 @@ @@ -52,6 +52,12 @@
52 <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table> 52 <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table>
53 </div> 53 </div>
54 <div class="col-sm-12 select-info table-striped-right"> 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 <div class="btn-group hidden-xs" id="toolbar1" role="group"> 61 <div class="btn-group hidden-xs" id="toolbar1" role="group">
56 <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()" shiro:hasPermission="receipt:receiptDetail:add"> 62 <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()" shiro:hasPermission="receipt:receiptDetail:add">
57 <i class="fa fa-map-pin"></i> 定位 63 <i class="fa fa-map-pin"></i> 定位
@@ -231,19 +237,25 @@ @@ -231,19 +237,25 @@
231 onRefresh: function(){ 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 // field : 'id', 260 // field : 'id',
249 // title : 'id号' 261 // title : 'id号'
@@ -551,7 +563,45 @@ @@ -551,7 +563,45 @@
551 $.table.refresh("bootstrap-table1"); 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 let rows=$("#bootstrap-table1").bootstrapTable('getSelections'); 605 let rows=$("#bootstrap-table1").bootstrapTable('getSelections');
556 if (rows.length == 0) { 606 if (rows.length == 0) {
557 $.modal.alertWarning("请至少选择一条记录"); 607 $.modal.alertWarning("请至少选择一条记录");