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 d746d27..c712877 100644 --- a/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js +++ b/ruoyi-admin/src/main/resources/static/js/board/finalAssemblyProductionData.js @@ -1,6 +1,7 @@ $(() => { moduleTitle() LOSS() + jp() // 公共请求地址 let url = '/broad/zz' @@ -10,25 +11,18 @@ $(() => { // 目标 $.post(url + "/selectProductInByTeam/0", {}, data => { data = JSON.parse(data) - console.log(isFirst) - if (isFirst) { - let arr = [] - for (let i = 0; i < 12; i++) { - arr.push(Math.ceil(target.topTips/11)) - } - arr[2] = Math.ceil(target.topTips/22) - arr[7] = Math.ceil(target.topTips/22) - target.top = arr - target.topProgress = arr.reduce((val1,val2) => { - console.log(val1) - console.log(val2) - return val1 + val2 - } , 0) - // target.top = data.map(val => val.val) - // target.bottom = data.val - isFirst = false - request() - Tips('#Tips') + let arr = [] + for (let i = 0; i < 12; i++) { + arr.push(Math.ceil(target.topTips / 11)) + } + arr[2] = Math.ceil(target.topTips / 22) + arr[7] = Math.ceil(target.topTips / 22) + target.top = arr + target.topProgress = arr.reduce((val1, val2) => val1 + val2, 0) + Tips('#Tips') + if (isFirst){ + isFirst = false + request() } }) // LOSS(分类) @@ -40,9 +34,22 @@ $(() => { yData: [data.find(val => val.name == '2').qty, data.find(val => val.name == '3').qty, data.find(val => val.name == '4').qty], }, document.getElementById("LOSSClassify")); }) + // 标准节拍 + $.post(url + "/selectInStoreTag", {}, data => { + data = JSON.parse(data) + jp(data.qty) + }) // 产量 $.post(url + `/selectProductInByTeam/${yieldType}`, {}, data => { data = JSON.parse(data) + target.topReality = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) + target.topGap = target.topProgress - target.topReality + if (target.topProgress != 0){ + target.topRate = ((target.topGap / target.topProgress).toFixed(4) * 100 + '').substring(0, 5) + }else{ + target.topRate = 0 + } + Tips('#Tips') let oneTime = parseFloat(data[0].name.split(':')[0]) let xName = [] if (yieldType == 0) { @@ -62,7 +69,7 @@ $(() => { }) // 一次装配不合格率 - $.post(url + `/selectProductInByTeam/${yieldType}`, {}, data => { + $.post(url + `/selectOneBadRate/${yieldType}`, {}, data => { data = JSON.parse(data) let oneTime = parseFloat(data[0].name.split(':')[0]) let xName = [] @@ -73,11 +80,14 @@ $(() => { } else { xName = data.map(val => val.name) } + target.bottomReality = (data.map(val => val.rate).reduce((val1, val2) => val1 + val2, 0) / data.map(val => val.rate).length).toFixed(2) + target.bottomTotal = data.map(val => val.qty).reduce((val1, val2) => val1 + val2, 0) + Tips('#Tips') barChartAndLineChartFour({ xName: xName, yDataOne: data.map(val => val.qty), yDataOneName: "不良数", - yDataTwo: [9, 3, 7, 7, 7, 2, 7, 1, 6, 7, 2, 1, 5], + yDataTwo: data.map(val => val.rate), yDataTwoName: "一次不合格率", yDataThree: target.bottom, yDataThreeName: "目标", @@ -85,7 +95,7 @@ $(() => { }) //追踪事件轮询 - $.post("/broad/beforeLibrary/selectOrderInfo", {}, data => { + $.post(url + "/selectInStoreOrderInfo", {}, data => { data = JSON.parse(data) $('#trackEvents').remove() $('.trackEventsScrollTable').html('
') @@ -94,7 +104,7 @@ $(() => { rowNum: 5, timeout: 0, header: ["订单编号", '产品型号', "计划数量", "完成数量", "执行进度", "时间"], - data: data.map(value => [value.plan_code.slice(4, value.plan_code.length), '', value.plan_number, value.actual_number, value.plan_number - value.actual_number, value.day]), + data: data.map(value => [value.plan_code.slice(4, value.plan_code.length), value.name.split('-')[1], value.plan_number, value.actual_number, value.plan_number - value.actual_number, value.day]), index: false, fontColor: '#B4B7BF ', indexBGC: '#86F3FF', @@ -127,18 +137,25 @@ let target = { bottom: [3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3], topTips: 2000, bottomTips: 3.05, - topProgress:0, - topReality:0, - topGap:0, - topRate:0, + topProgress: 0, + topReality: 0, + topGap: 0, + topRate: 0, + bottomReality:0, + bottomTotal:0, } -const LOSS = (val1 = 0, val2 = 24) => { +const LOSS = (val = 0) => { const html = ` - ${val1} - ${val2} + ${val} ` $('#LOSS').html(html) } +const jp = (val = 0) => { + const html = ` + ${val} + ` + $('#jp').html(html) +} const moduleTitle = () => { const html = ` 成品入库及产品质量可视化平台 @@ -151,16 +168,16 @@ const moduleTitle = () => { ` $('body').append(html) } -const Tips = (el,top = { +const Tips = (el, top = { target: target.topTips, progress: target.topProgress, reality: target.topReality, gap: target.topGap, rate: target.topRate, -}, bottom = {target: target.bottomTips, reality: 0, total: 0}) => { +}, bottom = {target: target.bottomTips, reality: target.bottomReality, total: target.bottomTotal}) => { const html = ` 目标:${top.target} 进度目标:${top.progress} 实际:${top.reality} 差异:${top.gap} 达成率:${top.rate}% 目标:${bottom.target}% 实际:${bottom.reality}% 累计不良数:${bottom.total} ` - $(el).append(html) + $(el).html(html) } diff --git a/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html b/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html index 05a7175..3a8b412 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html +++ b/ruoyi-admin/src/main/resources/templates/broad/finalAssemblyProductionData.html @@ -41,6 +41,7 @@ + diff --git a/ruoyi-admin/src/main/resources/templates/broad/fp.html b/ruoyi-admin/src/main/resources/templates/broad/fp.html index bff58cc..7676c48 100644 --- a/ruoyi-admin/src/main/resources/templates/broad/fp.html +++ b/ruoyi-admin/src/main/resources/templates/broad/fp.html @@ -505,10 +505,10 @@ times++ } getTable(classes,dataOne) - total((data.filter(val => val.status === '生产中').length / 28).toFixed(4) * 100 + '%', + total(((data.filter(val => val.status === '生产中').length / 28).toFixed(4) * 100 + '').substring(0, 5) + '%', eval(data.map(val => val.plan_number).join('+')), eval(data.map(val => val.qty).join('+')), - ((eval(data.map(val => val.qty).join('+')) / eval(data.map(val => val.plan_number).join('+'))).toFixed(4) * 100 + '').substring(0, 3) + '%', + ((eval(data.map(val => val.qty).join('+')) / eval(data.map(val => val.plan_number).join('+'))).toFixed(4) * 100 + '').substring(0, 5) + '%', eval(data.map(val => val.h1).join('+')), eval(data.map(val => val.h2).join('+')), eval(data.map(val => val.h3).join('+')),