diff --git a/src/main/resources/templates/pages/scanQrCode/ScanQrCode.html b/src/main/resources/templates/pages/scanQrCode/ScanQrCode.html index 54998897..85d80d04 100644 --- a/src/main/resources/templates/pages/scanQrCode/ScanQrCode.html +++ b/src/main/resources/templates/pages/scanQrCode/ScanQrCode.html @@ -66,6 +66,7 @@ outboundLogic = function (req) { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); layui.$.ajax({ url: "/material/qywxScanCodeOut", type: "post", @@ -77,6 +78,7 @@ // 获取标准 var flag = data.flag; if (flag === 0) { + layer.close(loading2); // 如果是无效码 layer.confirm("扫描失败,是否重新扫描", { btn: ["确定", "取消"] @@ -99,17 +101,20 @@ parent.layer.close(index); }) } else if (flag === 1) { + layer.close(loading2); // 如果是物料 material = data.material; window.location.href = "/toShowInventory?id="+material.id+"&type=m"; } else if (flag === 2) { + layer.close(loading2); // 如果扫描的为库位 place = data.place;// 将扫描结果保存到vue中 window.location.href = "/toShowInventory?id="+place.id+"&type=p"; } else if (flag === 3) { + layer.close(loading2); depository = data.depository;// 将扫描结果保存到vue中 window.location.href = "/toShowInventory?id="+depository.id+"&type=d"; diff --git a/src/main/resources/templates/pages/showInventory/showInventoryForLocation.html b/src/main/resources/templates/pages/showInventory/showInventoryForLocation.html index e94e79a5..bf3d0866 100644 --- a/src/main/resources/templates/pages/showInventory/showInventoryForLocation.html +++ b/src/main/resources/templates/pages/showInventory/showInventoryForLocation.html @@ -104,7 +104,7 @@ let type = $("#type").val(); $(function () { - + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/place/findLocationById", data: JSON.stringify({"id": id, "type": type}), @@ -138,6 +138,7 @@ } } }); + layer.close(loading2); }); table.render({ diff --git a/src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html b/src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html index b2de11cc..4e27fa43 100644 --- a/src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html +++ b/src/main/resources/templates/pages/showInventory/showInventoryForMaterial.html @@ -127,17 +127,15 @@ let id = $("#id").val(); $(function () { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); $.ajax({ url: "/material/findOnlyMaterialById", data: JSON.stringify({"id": id}), type: 'post', dataType: 'json', contentType: "application/json;charset=utf-8", - beforeSend: function () { - this.layerIndex = layer.load(0, {shade: [0.5, '#393D49']}); - }, success: function (res) { - layer.close(this.layerIndex); + let material = res.data; if (material === null) { layer.msg("该物料不存在,请重试", { @@ -157,6 +155,7 @@ } }); updateTableShowForMaterial(); + layer.close(loading2); }); table.render({ diff --git a/target/classes/templates/pages/scanQrCode/ScanQrCode.html b/target/classes/templates/pages/scanQrCode/ScanQrCode.html index 54998897..85d80d04 100644 --- a/target/classes/templates/pages/scanQrCode/ScanQrCode.html +++ b/target/classes/templates/pages/scanQrCode/ScanQrCode.html @@ -66,6 +66,7 @@ outboundLogic = function (req) { + let loading2 = layer.open({ type: 3, shade: [0.25, '#000'], icon: 2, speed: 0}); layui.$.ajax({ url: "/material/qywxScanCodeOut", type: "post", @@ -77,6 +78,7 @@ // 获取标准 var flag = data.flag; if (flag === 0) { + layer.close(loading2); // 如果是无效码 layer.confirm("扫描失败,是否重新扫描", { btn: ["确定", "取消"] @@ -99,17 +101,20 @@ parent.layer.close(index); }) } else if (flag === 1) { + layer.close(loading2); // 如果是物料 material = data.material; window.location.href = "/toShowInventory?id="+material.id+"&type=m"; } else if (flag === 2) { + layer.close(loading2); // 如果扫描的为库位 place = data.place;// 将扫描结果保存到vue中 window.location.href = "/toShowInventory?id="+place.id+"&type=p"; } else if (flag === 3) { + layer.close(loading2); depository = data.depository;// 将扫描结果保存到vue中 window.location.href = "/toShowInventory?id="+depository.id+"&type=d";