diff --git a/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java b/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java index 8f05a469..6a2708b9 100644 --- a/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java +++ b/src/main/java/com/dreamchaser/depository_manage/controller/GroupController.java @@ -550,7 +550,7 @@ public class GroupController { // 执行结果 Integer integer = 0; // 实际结果 - Integer result = 0; + int result = 0; Integer gid = ObjectFormatUtil.toInteger(map.get("gid")); List groupInfoByGid = groupService.findGroupInfoByGid(gid); if (groupInfoByGid != null) { diff --git a/src/main/resources/templates/pages/application/application-out.html b/src/main/resources/templates/pages/application/application-out.html index 7aaef5c3..10d690d8 100644 --- a/src/main/resources/templates/pages/application/application-out.html +++ b/src/main/resources/templates/pages/application/application-out.html @@ -1566,7 +1566,50 @@ }); } } - } + }; + + form.on('select()', function (data) { + let unit = data.value; + let id = data.elem.id; + let idNum = id.split("unit")[1]; + let mcode = $("#code" + idNum).val(); + if (mcode === "" || mcode === undefined || mcode === null) { + layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () { + $("#quantity" + idNum).val("") + }); + } else { + let val = $("#quantity" + idNum).val(); + if (val !== null && val !== undefined && val !== '') { + var req = {}; + req.mcode = mcode; + req.quantity = val; + req.unit = unit; + req.placeId = -1; + let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ + url: "/material/MaterialQuantityIsTrue", + type: "post", + data: JSON.stringify(req), + dataType: 'json', + contentType: "application/json;charset=utf-8", + success: function (res) { + var flag = res.data; + if (!flag) { // 如果当前数目不合适 + layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { + layer.close(loading2); + $("#quantity" + idNum).val(""); + }, + ); + } else { + layer.close(loading2) + } + + } + }); + } + } + + }); }) diff --git a/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html b/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html index 0fb2ee81..9234e0de 100644 --- a/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html +++ b/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html @@ -1719,7 +1719,50 @@ iframeChildren.css('height', '100%'); } }); - } + }; + + form.on('select()', function (data) { + let unit = data.value; + let id = data.elem.id; + let idNum = id.split("unit")[1]; + let mcode = $("#code" + idNum).val(); + if (mcode === "" || mcode === undefined || mcode === null) { + layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () { + $("#quantity" + idNum).val("") + }); + } else { + let val = $("#quantity" + idNum).val(); + if (val !== null && val !== undefined && val !== '') { + var req = {}; + req.mcode = mcode; + req.quantity = val; + req.unit = unit; + req.placeId = -1; + let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ + url: "/material/MaterialQuantityIsTrue", + type: "post", + data: JSON.stringify(req), + dataType: 'json', + contentType: "application/json;charset=utf-8", + success: function (res) { + var flag = res.data; + if (!flag) { // 如果当前数目不合适 + layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { + layer.close(loading2); + $("#quantity" + idNum).val(""); + }, + ); + } else { + layer.close(loading2) + } + + } + }); + } + } + + }); }) diff --git a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html index c0d9b5cf..f26bd7f4 100644 --- a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html +++ b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html @@ -443,6 +443,8 @@ layer.close(loading2); }); + }else{ + layer.close(loading2); } } }); @@ -450,6 +452,48 @@ } }; + form.on('select()', function (data) { + let unit = data.value; + let id = data.elem.id; + let mcode = $("#code").val(); + if (mcode === "" || mcode === undefined || mcode === null) { + layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () { + $("#quantity" ).val("") + }); + } else { + let val = $("#quantity").val(); + if (val !== null && val !== undefined && val !== '') { + var req = {}; + req.mcode = mcode; + req.quantity = val; + req.unit = unit; + req.placeId = -1; + let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ + url: "/material/MaterialQuantityIsTrue", + type: "post", + data: JSON.stringify(req), + dataType: 'json', + contentType: "application/json;charset=utf-8", + success: function (res) { + var flag = res.data; + if (!flag) { // 如果当前数目不合适 + layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { + layer.close(loading2); + $("#quantity").val(""); + }, + ); + } else { + layer.close(loading2) + } + + } + }); + } + } + + }); + selectPost = function (obj) { let id = obj.id; diff --git a/src/test/java/com/dreamchaser/depository_manage/TestForOther.java b/src/test/java/com/dreamchaser/depository_manage/TestForOther.java index a8ce0a5d..93e1a43c 100644 --- a/src/test/java/com/dreamchaser/depository_manage/TestForOther.java +++ b/src/test/java/com/dreamchaser/depository_manage/TestForOther.java @@ -53,7 +53,8 @@ public class TestForOther { ApprovalInfo_Details_Approver approver = new ApprovalInfo_Details_Approver(); approver.setUserId("PangFuZhen"); approvalInfo.setApprover(approver); - depositoryRecordService.reviewByQyWxApprovalOut("1",approvalInfo,"460f46eaefb46bb0c171029f62e2cea6","2","202303210016", false,2); +// depositoryRecordService.reviewByQyWxApprovalOut("1",approvalInfo,"460f46eaefb46bb0c171029f62e2cea6","2","202303210016", false,2); + depositoryRecordService.reviewByQyWxApprovalIn("[1]",approvalInfo,"460f46eaefb46bb0c171029f62e2cea6","2","202303220009"); // UserByPort userByPort = LinkInterfaceUtil.FindUserById(78, null); // List s = excelService.writeExcelForPrint(2, 4,userByPort); } diff --git a/target/classes/templates/pages/application/application-out.html b/target/classes/templates/pages/application/application-out.html index 7aaef5c3..10d690d8 100644 --- a/target/classes/templates/pages/application/application-out.html +++ b/target/classes/templates/pages/application/application-out.html @@ -1566,7 +1566,50 @@ }); } } - } + }; + + form.on('select()', function (data) { + let unit = data.value; + let id = data.elem.id; + let idNum = id.split("unit")[1]; + let mcode = $("#code" + idNum).val(); + if (mcode === "" || mcode === undefined || mcode === null) { + layer.msg("请输入物料的正确编码!", {icon: 0, time: 500}, function () { + $("#quantity" + idNum).val("") + }); + } else { + let val = $("#quantity" + idNum).val(); + if (val !== null && val !== undefined && val !== '') { + var req = {}; + req.mcode = mcode; + req.quantity = val; + req.unit = unit; + req.placeId = -1; + let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ + url: "/material/MaterialQuantityIsTrue", + type: "post", + data: JSON.stringify(req), + dataType: 'json', + contentType: "application/json;charset=utf-8", + success: function (res) { + var flag = res.data; + if (!flag) { // 如果当前数目不合适 + layer.msg("当前单个仓库中物料数量不足", {icon: 0, time: 500}, function () { + layer.close(loading2); + $("#quantity" + idNum).val(""); + }, + ); + } else { + layer.close(loading2) + } + + } + }); + } + } + + }); })