diff --git a/src/main/resources/templates/pages/application/application-in.html b/src/main/resources/templates/pages/application/application-in.html index 4d91f477..580ddbb8 100644 --- a/src/main/resources/templates/pages/application/application-in.html +++ b/src/main/resources/templates/pages/application/application-in.html @@ -1550,7 +1550,6 @@ childNodes[i].remove() } } - layer.close(loading2) } }; diff --git a/src/main/resources/templates/pages/group/group-add_back.html b/src/main/resources/templates/pages/group/group-add_back.html index 109fa3b1..48db81ae 100644 --- a/src/main/resources/templates/pages/group/group-add_back.html +++ b/src/main/resources/templates/pages/group/group-add_back.html @@ -413,6 +413,7 @@ var req = {}; req.qrCode = result; req.codeFlag = 1; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/qywxApplicationInScanBarCode", type: "post", @@ -454,12 +455,14 @@ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit)); } form.render(); + layer.close(loading2); } else { // 如果没有对应关系 layer.msg("对于编码:" + result + ",并未发现对应的物料", { icon: 0, time: 1000 //0.5秒关闭(如果不配置,默认是3秒) }, function () { + layer.close(loading2); }) } @@ -490,6 +493,7 @@ var req = {}; req.qrCode = result; req.codeFlag = 2; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/qywxApplicationInScanQrCode", type: "post", @@ -558,6 +562,7 @@ materialName.value = data.mname; materialId.value = data.mid; materialCode.value = data.code; + layer.close(loading2); } }) } @@ -601,6 +606,7 @@ }, end: function () { var mid = materialId.value; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); if (mid !== '') { $.ajax({ url: "/material/findMatrialById?mid=" + mid, @@ -652,6 +658,7 @@ } } form.render(); + layer.close(loading2); } }); } @@ -678,6 +685,7 @@ req.code = code; req.type = "in"; if (code !== "") { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/findMatrialByCode", type: "get", @@ -687,11 +695,13 @@ success: function (d) { var d = d.data; if (d == null) { - layer.msg("仓库中暂无该物料"); + layer.msg("仓库中暂无该物料",{icon:0,time:500},function () { + layer.close(loading2); materialName.value = ""; materialId.value = ""; obj.value = ""; $('#place' + objId).empty(); + }); } else { materialName.value = d.mname; @@ -734,6 +744,7 @@ barCode.empty(); } } + layer.close(loading2); } } }); @@ -759,6 +770,7 @@ data = data.split(",")[0]; if (data !== "") { req.mname = data; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/findMaterialByCondition", type: "post", @@ -767,15 +779,20 @@ contentType: "application/json;charset=utf-8", success: function (d) { if (d.count > 1) { - layer.msg("请点击右侧搜索确定物品"); + layer.msg("请点击右侧搜索确定物品",{icon:0,time:500},function () { materialId.value = ""; codeValue.value = ""; + layer.close(loading2); + }); return false; } else if (d.count === 0) { - layer.msg("没有该物品,请确认输入是否正确"); - materialId.value = ""; - codeValue.value = ""; - materialName.value = ""; + layer.msg("没有该物品,请确认输入是否正确",{icon:5,time:500},function () { + materialId.value = ""; + codeValue.value = ""; + materialName.value = ""; + layer.close(loading2); + }); + return false; } else { var idNumber = materialId.name.split("mid")[1]; @@ -821,6 +838,7 @@ materialName.value = material.mname; materialId.value = material.id; codeValue.value = material.code; + layer.close(loading2); } } });