From c8639415b9c5ec468d2210e5b5db8971836a5b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Tue, 4 Apr 2023 15:48:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=A3=E8=B4=9F=E5=80=BC?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/js/board/finalAssemblyProductionData.js | 12 ++++++------ .../src/main/resources/templates/broad/fp.html | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js b/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js index 0c38bc2..b2e81ae 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js +++ b/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js @@ -11,7 +11,7 @@ $(() => { // 目标 await $.post(url + "/selectProductInTarget", {}, data => { data = JSON.parse(data) - targetTop.tips = data.find(val => val.name == "进度目标").qty + targetTop.tips = data.find(val => val.name == "进度目标")?.qty }) // 终检一次不合格率目标 await $.post(url + "/selectOneBadRateMb", {}, data => { @@ -34,7 +34,7 @@ $(() => { }) // 产量 $.post(url + `/selectProductInByTeam/${yieldType}`, {}, data => { - data = JSON.parse(data) + data = JSON.parse(data || '{}') // 实际 targetTop.reality = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) total('#total', data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0)) @@ -52,8 +52,8 @@ $(() => { arr[0] = arr[0] - (arr.reduce((val1, val2) => val1 + val2, 0) - targetTop.tips) targetTop.targetArr = arr let num = 0 - arr.forEach((val,index) => { - if(data[index].qty){ + arr.forEach((val, index) => { + if (data[index].qty) { num += arr[index] } }) @@ -79,7 +79,7 @@ $(() => { } else { targetTop.rate = 0 } - targetTop.gap = targetTop.progress - targetTop.reality + targetTop.gap = targetTop.progress - targetTop.reality > 0 ? targetTop.progress - targetTop.reality : targetTop.reality - targetTop.progress barChartAndLineChartThree({ xName: xName, yDataOne: data.map(val => val.qty), @@ -235,4 +235,4 @@ const total = (el, val = 0) => { 合计:${val} ` $(el).html(html) -} \ No newline at end of file +} diff --git a/ruoyi-admin/src/main/resources/templates/broad/fp.html b/ruoyi-admin/src/main/resources/templates/broad/fp.html index 087f17b..3e6a4dd 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/fp.html +++ b/ruoyi-admin/src/main/resources/templates/broad/fp.html @@ -558,7 +558,7 @@ practical = eval(data.map(val => val.qty).join('+')) console.log(selectors) console.log(practical) - // updateSplitBlocks(1600 - practical, selectors[2]) + // updateSplitBlocks(totalNum - practical, selectors[2]) // updateSplitBlocks(eval(data.map(val => val.qty).join('+')), selectors[1]) total( Number((data.filter(val => val.status === '生产中').length / 28) * 100).toFixed(2) + '%',