From 3af8c99e61c0248a02990e62fb25cfa9e9f3a43b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Wed, 2 Nov 2022 17:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=93=9D=E5=86=85=E8=83=86?= =?UTF-8?q?=E6=88=90=E5=9E=8B=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/static/js/storage/index.js | 84 +++++++++---------- .../resources/static/js/tankShell/index.js | 2 +- 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/productionboard/src/main/resources/static/js/storage/index.js b/productionboard/src/main/resources/static/js/storage/index.js index 2e5a934..41e9952 100644 --- a/productionboard/src/main/resources/static/js/storage/index.js +++ b/productionboard/src/main/resources/static/js/storage/index.js @@ -1,4 +1,3 @@ - $(() => { let fun2 = () => { //生产计划 @@ -34,59 +33,60 @@ $(() => { let fun = () => { //当前库存统计 - $.getJSON(`/storage/getStoreStatistics?ids=${ids}`, function (result) { - multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"), 2); - }); + // $.getJSON(`/storage/getStoreStatistics?ids=${ids}`, function (result) { + // multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory"), 2); + // }); //库位参数 $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { //单日出入库统计 storageStatistics(result[0] == null ? 0 : result[0], result[1] == null ? 0 : result[1], result[2] == null ? 0 : result[2], result[3] == null ? 0 : result[3]); - //当前库存统计 - $.getJSON('/tankShell/getMaterialStoreJson', function (result) { - multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory")); - }); - //库位参数 - $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { + }) + //当前库存统计 + $.getJSON('/tankShell/getMaterialStoreJson', function (result) { + multipleThreeDimensionalCylindrical(result, document.getElementById("theCurrentInventory")); + }); + + //库位参数 + $.getJSON(`/storage/getParamJson?ids=${ids}`, function (result) { - console.log(result); + console.log(result); - //单日出入库统计 - storageStatistics(result.inStoreLeftCount, result.outStoreLeftCount, result.inStoreRightCount, result.outStoreRightCount); + //单日出入库统计 + storageStatistics(result.inStoreLeftCount, result.outStoreLeftCount, result.inStoreRightCount, result.outStoreRightCount); - //库存统计 - // $("#emptyLocation-left").text(result[4] == null ? 0 : result[4]); - // $("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]); - // $("#emptyLocation-right").text(result[5] == null ? 0 : result[6]); - // $("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]); - //库存统计 - $("#emptyLocation-left").text(result.freeStoreLeftCount); - $("#haveUsedLocation-left").text(result.useStoreLeftCount); - $("#emptyLocation-right").text(result.freeStoreRightCount); - $("#haveUsedLocation-right").text(result.useStoreRightCount); + //库存统计 + // $("#emptyLocation-left").text(result[4] == null ? 0 : result[4]); + // $("#haveUsedLocation-left").text(result[6] == null ? 0 : result[5]); + // $("#emptyLocation-right").text(result[5] == null ? 0 : result[6]); + // $("#haveUsedLocation-right").text(result[7] == null ? 0 : result[7]); + //库存统计 + $("#emptyLocation-left").text(result.freeStoreLeftCount); + $("#haveUsedLocation-left").text(result.useStoreLeftCount); + $("#emptyLocation-right").text(result.freeStoreRightCount); + $("#haveUsedLocation-right").text(result.useStoreRightCount); - //库位占比 - // $("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]); - // $("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]); - // $("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]); - // $("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]); - //库位占比 - $("#emptyLocationNumber").text(result.freeStoreCount); - $("#emptyLocationRatio").text(GetPercent(result.freeStoreCount, 312)); - $("#haveUsedLocationNumber").text(result.useStoreCount); - $("#haveUsedLocationRatio").text(GetPercent(result.useStoreCount, 312)); + //库位占比 + // $("#emptyLocationNumber").text(result[8] == null ? 0 : result[8]); + // $("#emptyLocationRatio").text(result[9] == null ? 0 : result[9]); + // $("#haveUsedLocationNumber").text(result[10] == null ? 0 : result[10]); + // $("#haveUsedLocationRatio").text(result[11] == null ? 0 : result[11]); + //库位占比 + $("#emptyLocationNumber").text(result.freeStoreCount); + $("#emptyLocationRatio").text(GetPercent(result.freeStoreCount, 312)); + $("#haveUsedLocationNumber").text(result.useStoreCount); + $("#haveUsedLocationRatio").text(GetPercent(result.useStoreCount, 312)); //百分比 - function GetPercent(num, total) { - num = parseFloat(num); - total = parseFloat(total); - if (isNaN(num) || isNaN(total)) { - return "-"; - } - return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00) + "%"; + function GetPercent(num, total) { + num = parseFloat(num); + total = parseFloat(total); + if (isNaN(num) || isNaN(total)) { + return "-"; } - }); - }) + return total <= 0 ? "0%" : (Math.round(num / total * 10000) / 100.00) + "%"; + } + }); setTimeout(fun, 10000) } fun() diff --git a/productionboard/src/main/resources/static/js/tankShell/index.js b/productionboard/src/main/resources/static/js/tankShell/index.js index 73da6a3..ea1d8e3 100644 --- a/productionboard/src/main/resources/static/js/tankShell/index.js +++ b/productionboard/src/main/resources/static/js/tankShell/index.js @@ -18,7 +18,7 @@ $(() => { //库存统计 $.getJSON('/tankShell/getMaterialStoreJson', function (result) { - multipleThreeDimensionalCylindrical(result, document.getElementById("inventoryStatistics"),2); + multipleThreeDimensionalCylindrical(result, document.getElementById("inventoryStatistics"),); }); setTimeout(fun, 10000) }