diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java index b7aad90..e6c93f9 100644 --- a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java @@ -652,10 +652,14 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea condition.setWarehouseCode(ShiroUtils.getWarehouseCode()); condition.setTaskId(taskHeader.getId()); LambdaQueryWrapper<TaskDetail> taskDetailLambdaQueryWrapper = Wrappers.lambdaQuery(condition); - TaskDetail taskDetail = taskDetailService.getOne(taskDetailLambdaQueryWrapper); - if (taskDetail != null) { - taskDetail.setToLocation(location.getCode()); - taskDetailService.update(taskDetail, taskDetailLambdaQueryWrapper); + List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambdaQueryWrapper); + if(taskDetailList != null && taskDetailList.size() > 0) { + for(TaskDetail taskDetail : taskDetailList) { + if (taskDetail != null) { + taskDetail.setToLocation(location.getCode()); + taskDetailService.update(taskDetail, taskDetailLambdaQueryWrapper); + } + } } } //给任务分配库位 diff --git a/src/main/resources/templates/receipt/receiving/receiving.html b/src/main/resources/templates/receipt/receiving/receiving.html index be01e67..0ed6b26 100644 --- a/src/main/resources/templates/receipt/receiving/receiving.html +++ b/src/main/resources/templates/receipt/receiving/receiving.html @@ -52,6 +52,12 @@ <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover text-nowrap"></table> </div> <div class="col-sm-12 select-info table-striped-right"> + <ul class="select-list"> + <li style="display: none">id:<input type="text" id="detailId" /></li> + <li>收货数量:<input type="text" id="receiveNum" /></li> + <li>容器编号:<input type="text" id="containerCode" /></li> + <li><button class="btn btn-sm btn-success" onclick="receipt()">组盘</button></li> + </ul> <div class="btn-group hidden-xs" id="toolbar1" role="group"> <a class="btn btn-outline btn-success btn-rounded" onclick="positioning()" shiro:hasPermission="receipt:receiptDetail:add"> <i class="fa fa-map-pin"></i> 定位 @@ -231,19 +237,25 @@ onRefresh: function(){ }, - columns: [ - { - field:'work', - title: '操作', - align: 'center', - events: "operateEvents", - formatter: function(value, row, index) { - var actions = []; - actions.push('<a id="qty" class="btn btn-success btn-xs ' + addFlag + '" href="#" onclick="" ><i class="fa fa-edit"></i>收货</a>'); - // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); - return actions.join(''); + onClickRow:function(row,ele,field){ + let code=$("#code").val(); + $("#detailId").val(row.id); + $("#receiveNum").val(row.totalQty-row.openQty); + $.ajax({ + url:prefix+'/getReceiptInfoByBill', + type:'post', + data:{ + code:code, + id:row.id + }, + success:res=>{ + $("#bootstrap-table1").bootstrapTable('load',res.data.list); + $("#bootstrap-table2").bootstrapTable('load',res.data.transactionList); + $("#bootstrap-table3").bootstrapTable('load',res.data.containerList); } - }, + }) + }, + columns: [ // { // field : 'id', // title : 'id号' @@ -551,7 +563,45 @@ $.table.refresh("bootstrap-table1"); } - function createTask() { + function receipt() { + let containerCode = $("#containerCode").val(); + let locationCode = ''; + Receiving(locationCode, containerCode); + } + + /** + * 组盘 + * @param locationCode + * @param containerCode + */ + function Receiving(locationCode,containerCode) { + let receiptCode=$("#code").val(); + let num=$("#receiveNum").val(); + let receiptDetailId=$("#detailId").val(); + $.ajax({ + url:ctx + "receipt/receiving/save", + type:'post', + data:{ + receiptCode:receiptCode, + qty: num, + receiptDetailId:receiptDetailId, + locationCode:locationCode, + containerCode:containerCode + }, + success:function (data) { + if(data.code===200){ + $.modal.msgSuccess('成功'); + initTable(); + } + else{ + $.modal.msg(data.msg); + } + } + }) + } + + + function createTask() { let rows=$("#bootstrap-table1").bootstrapTable('getSelections'); if (rows.length == 0) { $.modal.alertWarning("请至少选择一条记录");