diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/StockTakingController.java b/src/main/java/com/dreamchaser/depository_manage/controller/StockTakingController.java index fe5114dc..e982ee15 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/StockTakingController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/StockTakingController.java @@ -289,6 +289,11 @@ public class StockTakingController { return CrudUtil.insertHandle(transfer, minIdList.size()); } + /** + * 用于暂存当前盘点记录 + * @param map 存储数据 + * @param request + */ @PostMapping("/temporaryStorageForTakingResult") public void temporaryStorageForTakingResult(@RequestBody Map map, HttpServletRequest request) { // 获取当前盘点人 @@ -306,6 +311,27 @@ public class StockTakingController { } + + /** + * 用于删除暂存盘点记录 + * @param map 删除数据 + * @param request + */ + @PostMapping("/delTemporaryStorageForTakingResult") + public RestResponse delTemporaryStorageForTakingResult(@RequestBody Map map,HttpServletRequest request){ + // 获取当前盘点人 + String token = request.getHeader("user-token"); + if (token == null) { + token = (String) request.getSession().getAttribute("userToken"); + } + UserByPort userToken = AuthenticationTokenPool.getUserToken(token); + String key = "wms_stockTaking_" + userToken.getId() + "_" + DateUtil.getNowTime() + "_" + map.get("id"); + redisPool.getRedisTemplateByDb(15).delete(key); + return new RestResponse(); + } + + + /** * 获取当前用户当前库存的盘点记录 * diff --git a/src/main/resources/static/js/stockTaking/stockTakingForLocationTable.js b/src/main/resources/static/js/stockTaking/stockTakingForLocationTable.js index 13e888ec..4c9e5a34 100644 --- a/src/main/resources/static/js/stockTaking/stockTakingForLocationTable.js +++ b/src/main/resources/static/js/stockTaking/stockTakingForLocationTable.js @@ -120,6 +120,7 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { {field: 'stockTakingQuantity', width: 100, title: '盘点数', edit: 'quantity'}, {field: 'takingResultString', width: 100, title: '盘点结果'}, {field: 'takingInventory', width: 100, title: '盈亏数量'}, + {title: '操作', width: 100, toolbar: '#currentTableBarForMaterial', align: "center"} ] ], limits: [10, 15, 20, 25, 50, 100], @@ -235,6 +236,20 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { //下拉菜单 } + else if(layEvent === "clear"){ + let req = {}; + req.id = obj.data.id + ""; + $.ajax({ + url: "/stockTaking/delTemporaryStorageForTakingResult", + dataType: "json", + data: JSON.stringify(req), + type: "POST", + contentType: "application/json;charset=utf-8", + success : function(){ + updateTableShowForLocation(); + } + }); + } }); // 用于计算盘点结果 diff --git a/src/main/resources/static/js/stockTaking/stockTakingForMaterial.js b/src/main/resources/static/js/stockTaking/stockTakingForMaterial.js index 39bf195b..5c60d131 100644 --- a/src/main/resources/static/js/stockTaking/stockTakingForMaterial.js +++ b/src/main/resources/static/js/stockTaking/stockTakingForMaterial.js @@ -174,6 +174,7 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { {field: 'stockTakingQuantity', width: 100, title: '盘点数', edit: 'quantity'}, {field: 'takingResultString', width: 100, title: '盘点结果'}, {field: 'takingInventory', width: 100, title: '盈亏数量'}, + {title: '操作', width: 100, toolbar: '#currentTableBarForLocation', align: "center"} ] ], limits: [10, 15, 20, 25, 50, 100], @@ -195,6 +196,8 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { }); + + // 用于打开负责人树形菜单 $("#selectdepartmentManagerForMaterial").on('click', function () { layer.open({ @@ -224,6 +227,8 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { + + table.on('edit(currentTableFilterForMaterial)', function (obj) { obj.update({stockTakingQuantity: obj.value});//修改当前行数据 calculateForMaterial(obj); @@ -257,6 +262,20 @@ layui.use(['form', 'step', 'flow', 'table', 'inputTag'], function () { //下拉菜单 } + else if(layEvent === "clear"){ + let req = {}; + req.id = obj.data.id + ""; + $.ajax({ + url: "/stockTaking/delTemporaryStorageForTakingResult", + dataType: "json", + data: JSON.stringify(req), + type: "POST", + contentType: "application/json;charset=utf-8", + success : function(){ + updateTableShowForMaterial(); + } + }); + } }); // 用于计算盘点结果 diff --git a/src/main/resources/templates/pages/stockTaking/stockTaking.html b/src/main/resources/templates/pages/stockTaking/stockTaking.html index 380dacc0..bb14aa05 100644 --- a/src/main/resources/templates/pages/stockTaking/stockTaking.html +++ b/src/main/resources/templates/pages/stockTaking/stockTaking.html @@ -434,6 +434,15 @@ + + + + +