diff --git a/src/main/resources/templates/pages/application/application-in_back.html b/src/main/resources/templates/pages/application/application-in_back.html index 4b2c27fb..a9606d58 100644 --- a/src/main/resources/templates/pages/application/application-in_back.html +++ b/src/main/resources/templates/pages/application/application-in_back.html @@ -162,6 +162,8 @@ 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", @@ -171,13 +173,18 @@ success: function (d) { var d = d.data; if(d == null){ - layer.msg("没有该编码,请确认是否输入正确"); - $("#openSonByMaterial").val(""); - $("#mid").val(""); - $("#code").val(""); + layer.msg("没有该编码,请确认是否输入正确",{icon:5,time:500},function () { + layer.close(loading2); + $("#openSonByMaterial").val(""); + $("#mid").val(""); + $("#code").val(""); + }); + + }else{ $("#openSonByMaterial").val(d.mname); $("#mid").val(d.id); + layer.close(loading2); } } }); @@ -189,33 +196,44 @@ var data = $(this).val(); var req = {}; req.mname = data; - $.ajax({ - url: "/material/findMaterialByCondition", - type: "post", - dataType: 'json', - data:JSON.stringify(req), - contentType: "application/json;charset=utf-8", - success: function (d) { - if(d.count > 1){ - layer.msg("请点击右侧搜索确定物品"); - $("#mid").val(""); - $("#code").val(""); - return false; - }else if(d.count === 0){ - layer.msg("没有该物品,请确认输入是否正确"); - $("#mid").val(""); - $("#code").val(""); - $("#openSonByMaterial").val(""); - return false; - } - else{ - var material = d.data[0]; - $("#openSonByMaterial").val(material.mname) - $("#mid").val(material.id); - $("#code").val(material.code); + if(data !== ""){ + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ + url: "/material/findMaterialByCondition", + type: "post", + dataType: 'json', + data:JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + if(d.count > 1){ + layer.msg("请点击右侧搜索确定物品",{icon:0,time:500},function () { + $("#mid").val(""); + $("#code").val(""); + layer.close(loading2) + }); + + return false; + }else if(d.count === 0){ + layer.msg("没有该物品,请确认输入是否正确",{icon:5,time:500},function () { + $("#mid").val(""); + $("#code").val(""); + $("#openSonByMaterial").val(""); + layer.close(loading2) + }); + + return false; + } + else{ + var material = d.data[0]; + $("#openSonByMaterial").val(material.mname) + $("#mid").val(material.id); + $("#code").val(material.code); + layer.close(loading2) + } } - } - }); + }); + } + }) $('#openSonByDepository').on('click', function () { @@ -255,6 +273,8 @@ content: '/getMaterialAll?mname=' + mname + '&type=1', end: function () { var mid = $("#mid").val(); + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ url: "/material/findMatrialById?mid=" + mid, type: "get", @@ -265,7 +285,8 @@ if(code === undefined){ code = ""; } - $("#code").val(code) + $("#code").val(code); + layer.close(loading2) } }); diff --git a/src/main/resources/templates/pages/application/application-in_scanQrCode.html b/src/main/resources/templates/pages/application/application-in_scanQrCode.html index 8c3f7a2b..adbd5f83 100644 --- a/src/main/resources/templates/pages/application/application-in_scanQrCode.html +++ b/src/main/resources/templates/pages/application/application-in_scanQrCode.html @@ -622,6 +622,8 @@ 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", @@ -632,12 +634,15 @@ var d = d.data; var idNumber = materialId.name.split("mid")[1]; if (d == null) { - layer.msg("没有该编码,请确认是否输入正确"); - materialName.value = ""; - materialId.value = ""; - obj.value = ""; - $("#barCode" + idNumber).remove(); - form.render(); + layer.msg("没有该编码,请确认是否输入正确",{icon:5,time:500},function () { + materialName.value = ""; + materialId.value = ""; + obj.value = ""; + $("#barCode" + idNumber).remove(); + form.render(); + layer.close(loading2) + }); + } else { materialName.value = d.mname; materialId.value = d.id; @@ -672,12 +677,14 @@ $.each(materialAndBarCodeList, function (index, item) { $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素 }); + layer.close(loading2) form.render(); } else { var barCode = $("#barCode" + idNumber); if (barCode.length > 0) { barCode.empty(); } + layer.close(loading2) } } } @@ -726,6 +733,7 @@ end: function () { var mid = materialId.value; if (mid !== '') { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/findMatrialById?mid=" + mid, type: "get", @@ -774,6 +782,7 @@ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit)); } form.render(); + layer.close(loading2) } }); } @@ -800,6 +809,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", @@ -808,15 +818,20 @@ contentType: "application/json;charset=utf-8", success: function (d) { if (d.count > 1) { - layer.msg("请点击右侧搜索确定物品"); - materialId.value = ""; - codeValue.value = ""; + 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]; @@ -841,7 +856,7 @@ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit)); } form.render(); - + layer.close(loading2) } } }); @@ -859,6 +874,7 @@ var result = res.resultStr;//当needResult为1时返回处理结果 var req = {}; req.qrCode = result; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/qywxApplicationInScanBarCode", type: "post", @@ -910,12 +926,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) }) } } @@ -967,6 +985,7 @@ var result = res.resultStr;//当needResult为1时返回处理结果 var req = {}; req.qrCode = result; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/qywxApplicationInScanQrCode", type: "post", @@ -996,6 +1015,7 @@ icon: 0, time: 1000 //0.5秒关闭(如果不配置,默认是3秒) }, function () { + layer.close(loading2) }) } else { @@ -1039,6 +1059,7 @@ $("#unit" + idNumber).append(new Option(unitList[i].newUnit, unitList[i].newUnit)); } form.render(); + layer.close(loading2) } } }) @@ -1057,6 +1078,7 @@ var result = res.resultStr;//当needResult为1时返回处理结果 var req = {}; req.qrCode = result; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/place/qywxApplicationInScanQrCode", type: "post", @@ -1075,6 +1097,8 @@ layer.msg("并未查询到对应位置,请重新扫描",{ icon:0, time:1000 + },function () { + layer.close(loading2) }); } else if (flag === 1) { // 如果获取到的是库位 @@ -1082,6 +1106,7 @@ placeId.value = place.id; depositoryId.value = place.did; depositoryName.value = place.depositoryName; + layer.close(loading2) } else if (flag === 2) { // 如果获取到的是仓库 @@ -1089,6 +1114,7 @@ placeId.value = "0"; depositoryId.value = depository.id; depositoryName.value = depository.dname; + layer.close(loading2) } } }) diff --git a/src/main/resources/templates/pages/application/application-out.html b/src/main/resources/templates/pages/application/application-out.html index 52a65ca6..96e10b47 100644 --- a/src/main/resources/templates/pages/application/application-out.html +++ b/src/main/resources/templates/pages/application/application-out.html @@ -778,6 +778,7 @@ req.code = code; req.type = "out"; if (code !== "") { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/findMatrialByCode", type: "get", @@ -787,11 +788,13 @@ success: function (d) { var d = d.data; if (d == null) { - layer.msg("仓库中暂无该物料"); - materialName.value = ""; - materialId.value = ""; - obj.value = ""; - $('#place' + objId).empty(); + layer.msg("仓库中暂无该物料",{icon:5,time:500},function () { + materialName.value = ""; + materialId.value = ""; + obj.value = ""; + $('#place' + objId).empty(); + layer.close(loading2) + }); } else { materialName.value = d.mname; @@ -828,11 +831,13 @@ $("#barCode" + idNumber).append(new Option(item.bmcode, item.id));//往下拉菜单里添加元素 }); form.render(); + layer.close(loading2) } else { var barCode = $("#barCode" + idNumber); if (barCode.length > 0) { barCode.empty(); } + layer.close(loading2) } } } @@ -859,6 +864,7 @@ let req = {}; req.code = code; if (code !== "") { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/group/findGroupByCode", type: "post", @@ -881,6 +887,7 @@ childNodes[i].remove() } } + layer.close(loading2) }) } else { let childNodes = parent.childNodes; @@ -890,6 +897,7 @@ childNodes[i].remove() } } + layer.close(loading2) } // 赋值给gname gnameItem.value = data[0].gname; @@ -898,7 +906,7 @@ CoverpageForGroup(pid, data[i]); } element.init(); - + layer.close(loading2) } } }); @@ -942,6 +950,7 @@ iframeChildren.css('height', '100%'); }, end: function () { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); var mid = materialId.value; if (mid !== '') { $.ajax({ @@ -993,6 +1002,7 @@ barCode.empty(); } } + layer.close(loading2); form.render(); } }); @@ -1043,6 +1053,7 @@ end: function () { let gid = gidItem.value; if (gid !== '') { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); let req = {}; req.gid = gid; $.ajax({ @@ -1067,6 +1078,7 @@ childNodes[i].remove() } } + layer.close(loading2) }) } else { let childNodes = parent.childNodes; @@ -1083,7 +1095,7 @@ CoverpageForGroup(pid, data[i]); } element.init(); - + layer.close(loading2) } } }) @@ -1111,7 +1123,7 @@ if (gname !== '') { - + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); var req = {}; req.gname = gname; $.ajax({ @@ -1136,6 +1148,7 @@ childNodes[i].remove() } } + layer.close(loading2); }); } else if (d.count === 0) { // 如果当前组合名称不存在 @@ -1152,6 +1165,7 @@ childNodes[i].remove() } } + layer.close(loading2); }); } else { // 正常 @@ -1171,6 +1185,7 @@ CoverpageForGroup(pid, data[i]); } element.init(); + layer.close(loading2); } } @@ -1184,6 +1199,7 @@ childNodes[i].remove() } } + layer.close(loading2); } }; @@ -1207,6 +1223,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/findInventoryByCondition", type: "post", @@ -1215,15 +1232,19 @@ contentType: "application/json;charset=utf-8", success: function (d) { if (d.count > 1) { - layer.msg("请点击右侧搜索确定物品"); - materialId.value = ""; - codeValue.value = ""; + layer.msg("请点击右侧搜索确定物品",{icon:0,time:500},function () { + layer.close(loading2); + materialId.value = ""; + codeValue.value = ""; + }); 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]; @@ -1269,6 +1290,7 @@ materialName.value = material.mname; materialId.value = material.id; codeValue.value = material.code; + layer.close(loading2); } } }); @@ -1295,6 +1317,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/qywxApplicationOutScanBarCode", type: "post", @@ -1336,12 +1359,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); }) } @@ -1370,6 +1395,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/qywxApplicationOutScanQrCode", type: "post", @@ -1383,6 +1409,7 @@ icon: 0, time: 1000 //0.5秒关闭(如果不配置,默认是3秒) }, function () { + layer.close(loading2); }) } else { // 获取对应元素 @@ -1447,6 +1474,7 @@ materialName.value = data.mname; materialId.value = data.id; materialCode.value = data.code; + layer.close(loading2); } } }) @@ -1508,6 +1536,7 @@ var req = {}; req.gid = gid; req.quantity = val; + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/group/groupQuantityIsTrue", type: "post", @@ -1522,9 +1551,12 @@ icon: 0, time: 1000 }, function () { + layer.close(loading2); $("#quantityForGroup" + id).val(""); }); + }else{ + layer.close(loading2); } } }); diff --git a/src/main/resources/templates/pages/application/application-out_back.html b/src/main/resources/templates/pages/application/application-out_back.html index 8d1f82b2..b53f3437 100644 --- a/src/main/resources/templates/pages/application/application-out_back.html +++ b/src/main/resources/templates/pages/application/application-out_back.html @@ -159,7 +159,8 @@ var req = {}; req.code = code; req.type = "out"; - if(code !== ""){ + if (code !== "") { + let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/findMatrialByCode", type: "get", @@ -169,9 +170,12 @@ success: function (d) { var d = d.data; if (d == null) { - layer.msg("没有该编码,请确认是否输入正确"); - $("#mname").val(""); - $("#mid").val(""); + layer.msg("没有该编码,请确认是否输入正确", {icon: 0, time: 500}, function () { + $("#mname").val(""); + $("#mid").val(""); + layer.close(loading2); + }); + } else { req.mid = d.id; let unitItem = $("#unit"); @@ -183,6 +187,7 @@ $("#mname").val(d.mname); $("#mid").val(d.id); form.render(); + layer.close(loading2); } } }) @@ -194,37 +199,47 @@ var data = $(this).val(); var req = {}; req.mname = data; - $.ajax({ - url: "/material/findInventoryByCondition", - type: "post", - dataType: 'json', - data: JSON.stringify(req), - contentType: "application/json;charset=utf-8", - success: function (d) { - if (d.count > 1) { - layer.msg("请点击右侧搜索确定物品"); - $("#mid").val(""); - $("#code").val(""); - return false; - } else if (d.count === 0) { - layer.msg("没有该物品,请确认输入是否正确"); - $("#mid").val(""); - $("#code").val(""); - return false; - } else { - var material = d.data[0]; - $("#mname").val(material.mname); - $("#mid").val(material.id); - $("#code").val(material.code); - $("#unit").empty(); - $("#unit").append(new Option(material.baseUnit, "-1")); - $.each(material.splitInfoList, function (index, item) { - $("#unit").append(new Option(item.newUnit, item.newUnit)); - }); - form.render(); + if (data !== "") { + let loading2 = layer.open({type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); + $.ajax({ + url: "/material/findInventoryByCondition", + type: "post", + dataType: 'json', + data: JSON.stringify(req), + contentType: "application/json;charset=utf-8", + success: function (d) { + if (d.count > 1) { + layer.msg("请点击右侧搜索确定物品", {icon: 0, time: 500}, function () { + $("#mid").val(""); + $("#code").val(""); + layer.close(loading2); + }); + + return false; + } else if (d.count === 0) { + layer.msg("没有该物品,请确认输入是否正确", {icon: 0, time: 500}, function () { + layer.close(loading2); + $("#mid").val(""); + $("#code").val(""); + }); + return false; + } else { + var material = d.data[0]; + $("#mname").val(material.mname); + $("#mid").val(material.id); + $("#code").val(material.code); + $("#unit").empty(); + $("#unit").append(new Option(material.baseUnit, "-1")); + $.each(material.splitInfoList, function (index, item) { + $("#unit").append(new Option(item.newUnit, item.newUnit)); + }); + form.render(); + layer.close(loading2); + } } - } - }); + }); + } + }); $('#openSonByDepository').on('click', function () { @@ -271,6 +286,7 @@ }, end: function () { var mid = $("#mid").val(); + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/findMatrialById?mid=" + mid, type: "get", @@ -288,7 +304,7 @@ $("#unit").append(new Option(item.newUnit, item.newUnit)); }); form.render(); - + layer.close(loading2); } }); @@ -310,7 +326,7 @@ form.on('submit(formStep)', function (data) { - if(!flagForForm){ + if (!flagForForm) { flagForForm = true; data = data.field; var params = []; @@ -376,6 +392,7 @@ 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", @@ -387,8 +404,10 @@ if (!flag) { // 如果当前数目不合适 layer.msg("当前单仓库中物料数量不足", {icon: 0, time: 500}, function () { $("#quantity").val(""); + layer.close(loading2); }); - + }else{ + layer.close(loading2); } } }); diff --git a/src/main/resources/templates/pages/application/application-review.html b/src/main/resources/templates/pages/application/application-review.html index ddda4840..89ca83fd 100644 --- a/src/main/resources/templates/pages/application/application-review.html +++ b/src/main/resources/templates/pages/application/application-review.html @@ -240,7 +240,7 @@ flagForForm = true; let data = {}; data.id = $("#id").text(); - if (pass == 1) { + if (pass === 1) { data.departmentheadPass = 1; } else { data.departmentheadPass = 2; @@ -248,14 +248,13 @@ data.departmentheadMessage = $("#departmentheadMessageF").val(); send(data); } - }; check = function (pass) { if(!flagForForm) { flagForForm = true; let data = {}; data.id = $("#id").text(); - if (pass == 1) { + if (pass === 1) { data.depositoryManagerPass = 1; } else { data.depositoryManagerPass = 2; diff --git a/src/main/resources/templates/pages/application/application-transfer.html b/src/main/resources/templates/pages/application/application-transfer.html index 1f52e2c0..e3590cd8 100644 --- a/src/main/resources/templates/pages/application/application-transfer.html +++ b/src/main/resources/templates/pages/application/application-transfer.html @@ -12,172 +12,204 @@
- -