diff --git a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java index ad67d6fd..ab99b6e6 100644 --- a/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java +++ b/src/main/java/com/dreamchaser/depository_manage/service/impl/DepositoryRecordServiceImpl.java @@ -2414,7 +2414,8 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { redisPool.getRedisTemplateByDb(14).opsForHash().putAll(redisOutKey, stringObjectMap); redisPool.getRedisTemplateByDb(14).expire(redisOutKey, 72, TimeUnit.HOURS); }); - } else { + } + else { // 如果是通过仓库 @@ -3074,11 +3075,13 @@ public class DepositoryRecordServiceImpl implements DepositoryRecordService { // 获取所有仓库 List depositoryAll = depositoryMapper.findDepositoryAll(); for (Depository depositoryById : depositoryByIds) { - // 获取当前仓库的顶级仓库 Depository parentDepository = findParentDepository(depositoryById, depositoryAll); - if (parentDepository.getDname().contains("办公")) { - // 设置为true - flagForZXCWorkWarehouse = true; + if (!parentDepository.getDname().contains("前置仓")) { + // 如果不是前置仓下的仓库 + if (depositoryById.getDname().contains("办公")) { + // 如果是中心仓下的办公用品库 + flagForZXCWorkWarehouse = true; + } } } if (!flagForZXCWorkWarehouse) { diff --git a/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html b/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html index fb11621f..d41499fb 100644 --- a/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html +++ b/src/main/resources/templates/pages/applicationForStorageCenter/application-out.html @@ -122,7 +122,7 @@
-
@@ -1927,74 +1931,80 @@ form.on('select()', function (data) { let id = data.elem.id; - let idNum = id.split("unit")[1]; - let unit = ""; - let mcode = ""; - let depositoryId = "-1"; - // 用于标志是否为物料出库(默认为物料) - let flag = true; - if (id.indexOf('unit') !== -1) { - unit = data.value; - if (depositoryDisplay !== "none") { - depositoryId = $("#showDepository" + idNum).val(); + if(id.indexOf('outType') === -1){ + let idNum = id.split("unit")[1]; + let unit = ""; + let mcode = ""; + let depositoryId = "-1"; + // 用于标志是否为物料出库(默认为物料) + let flag = true; + if (id.indexOf('unit') !== -1) { + unit = data.value; + if (depositoryDisplay !== "none") { + depositoryId = $("#showDepository" + idNum).val(); + } } - } else if (id.indexOf('ForGroup') === -1) { - // 获取当前选中的仓库id是在物料出库下 - depositoryId = data.value; - idNum = id.split('showDepository')[1]; - unit = $("#unit" + idNum).val(); - } else if (id.indexOf("ForGroup") !== -1) { - depositoryId = data.value; - idNum = id.split('showDepositoryForGroup')[1]; - flag = false; - } - if (flag) { - mcode = $("#code" + idNum).val(); - if (mcode === "" || mcode === undefined || mcode === null) { - layer.msg("请输入物料的正确编码!", {icon: 0, time: 1000}, 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; - if (depositoryId !== "-1") { - req.depositoryId = depositoryId; - } - 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) - } - - } + else if (id.indexOf('ForGroup') === -1) { + // 获取当前选中的仓库id是在物料出库下 + depositoryId = data.value; + idNum = id.split('showDepository')[1]; + unit = $("#unit" + idNum).val(); + } + else if (id.indexOf("ForGroup") !== -1) { + depositoryId = data.value; + idNum = id.split('showDepositoryForGroup')[1]; + flag = false; + } + if (flag) { + mcode = $("#code" + idNum).val(); + if (mcode === "" || mcode === undefined || mcode === null) { + layer.msg("请输入物料的正确编码!", {icon: 0, time: 1000}, 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; + if (depositoryId !== "-1") { + req.depositoryId = depositoryId; + } + 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) + } + + } + }); + } } } - } else { - let elem = {}; - elem.id = "quantityForGroup" + idNum; - groupQuantityIsTrue(elem) + else { + let elem = {}; + elem.id = "quantityForGroup" + idNum; + groupQuantityIsTrue(elem) + } } + }); diff --git a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_admin.html b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_admin.html index 467dae0b..9181f7cf 100644 --- a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_admin.html +++ b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_admin.html @@ -109,7 +109,7 @@
-
@@ -1945,60 +1949,65 @@ form.on('select()', function (data) { let id = data.elem.id; - let idNum = id.split("unit")[1]; - let unit = ""; - let mcode = ""; - let depositoryId = "-1"; - if (id.indexOf('unit') !== -1) { - unit = data.value; - } else { - // 获取当前选中的仓库id - depositoryId = data.value; - idNum = id.split('showDepository')[1]; - unit = $("#unit" + idNum).val(); - - } - 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; - if (depositoryId !== "-1") { - req.depositoryId = depositoryId; - } - 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) - } + if(id.indexOf('outType') === -1){ + let idNum = id.split("unit")[1]; + let unit = ""; + let mcode = ""; + let depositoryId = "-1"; + if (id.indexOf('unit') !== -1) { + unit = data.value; + } + else { + // 获取当前选中的仓库id + depositoryId = data.value; + idNum = id.split('showDepository')[1]; + unit = $("#unit" + idNum).val(); - } + } + 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; + if (depositoryId !== "-1") { + req.depositoryId = depositoryId; + } + 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 cc0f9d59..aaebfa28 100644 --- a/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html +++ b/src/main/resources/templates/pages/applicationForStorageCenter/application-out_back.html @@ -104,7 +104,7 @@
-