From 883302872614a2d862149f713018ae9c27c9c81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Mon, 3 Apr 2023 09:04:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=9E=E9=99=85?= =?UTF-8?q?=E4=BA=A7=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/templates/broad/fp.html | 12 +++++++----- .../src/main/resources/templates/broad/month.html | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/broad/fp.html b/ruoyi-admin/src/main/resources/templates/broad/fp.html index 217fc63..087f17b 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/fp.html +++ b/ruoyi-admin/src/main/resources/templates/broad/fp.html @@ -361,6 +361,7 @@ //夹具生产计划切换 let tableData = [] let classes = 0 + let totalNum = 0 let dayClass = ['工位', '型号', '状态', '目标', '计划', '累计', '达成率', '7:30', '8:30', '9:30', '10:30', '11:30', '12:30', '13:30', '14:30', '15:30', '16:30', '17:30', '18:30'] let nightClass = ['工位', '型号', '状态', '目标', '计划', '累计', '达成率', '19:30', '20:30', '21:30', '22:30', '23:30', '0:30', '1:30', '2:30', '3:30', '4:30', '5:30', '6:30'] let tableWidth = ["5%", '10%', "7%", "5%", "5%", "5%", "8%", "4%", "4%", "4%", "4%", "4%", "4%", "4%", "4%", "4%", "4%", "4%", "4%"] @@ -462,14 +463,13 @@ } $(async () => { - let totalNum = 0 area() // 当班计划/实际产量/当班差异 await autoUpdate('/broad/fp/selectFpOrderInfo', INTERVAL, data => { // let p = [data[1], data[0][2], data[0][3]] totalNum = data.find(val => val.name == '当班计划').qty - // let now = data.find(val => val.name == '实际产量').qty - let now = practical + let now = data.find(val => val.name == '实际产量').qty + // let now = practical let p = [totalNum, now, totalNum - now] console.log(p) for (let i in p) { @@ -556,8 +556,10 @@ } getTable(classes, dataOne) practical = eval(data.map(val => val.qty).join('+')) - updateSplitBlocks(1600 - practical, selectors[2]) - updateSplitBlocks(eval(data.map(val => val.qty).join('+')), selectors[1]) + console.log(selectors) + console.log(practical) + // updateSplitBlocks(1600 - 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) + '%', totalNum, diff --git a/ruoyi-admin/src/main/resources/templates/broad/month.html b/ruoyi-admin/src/main/resources/templates/broad/month.html index 7153f42..bebf270 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/month.html +++ b/ruoyi-admin/src/main/resources/templates/broad/month.html @@ -92,7 +92,7 @@ $(() => { safeTitle('#safeTitle') } day() - setCronTak(day, "0 * * * * * *"); + setCronTak(day, "0 0/30 * * * * *"); }) \ No newline at end of file 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 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=AD=A3=E8=B4=9F?= =?UTF-8?q?=E5=80=BC=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) + '%',