修改发泡线生产统计数据表格

master
夜笙歌 2 years ago
parent 12bf2b39bf
commit 53ddfeb001

@ -364,22 +364,6 @@
<script src="../../static/js/auto-update.js" th:src="@{/js/auto-update.js}"></script> <script src="../../static/js/auto-update.js" th:src="@{/js/auto-update.js}"></script>
<script> <script>
//夹具生产计划切换
showalert();
window.setInterval(showalert, 1000 * 30);
function showalert() {
var myTransition = $('.my-transition');
var myTransition2 = $('.my-transition2');
if (myTransition.hasClass('my-click-transiton')) {
myTransition.removeClass('my-click-transiton');
$('.my-transition2').addClass('my-click-transiton');
} else {
myTransition2.removeClass('my-click-transiton');
$('.my-transition').addClass('my-click-transiton');
}
}
const orderInfColumns = [ const orderInfColumns = [
@ -463,12 +447,61 @@
} }
}).reduce((a, b) => a + b) }).reduce((a, b) => a + b)
} }
let title = ['编号', '型号', '状态', '目标', '计划', '累计', '达成率', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00']
let dataA = []
let dataB = []
let dataC = []
let dataIndex = 0
let first = true
let planInfoTime = 0
function showalert() {
if (planInfoTime % 2 === 0) {
dataB = [title]
dataC = [title]
dataB.push(...([...dataA].splice(dataIndex, 6)))
dataB.push([' ', '合计', '', totle([...dataB], 2), totle([...dataB], 3), totle([...dataB], 4), totle([...dataB], 3) === 0 ? '0%' : ((totle([...dataB], 4) / totle([...dataB], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataB], 6), totle([...dataB], 7), totle([...dataB], 8), totle([...dataB], 9), totle([...dataB], 10), totle([...dataB], 11), totle([...dataB], 12), totle([...dataB], 13), totle([...dataB], 14), totle([...dataB], 15), totle([...dataB], 16), totle([...dataB], 17)])
if (dataIndex + 6 > dataA.length) {
dataIndex = 0
} else {
dataIndex += 6
}
dataC.push(...([...dataA].splice(dataIndex, 6)))
dataC.push([' ', '合计', '', totle([...dataC], 2), totle([...dataC], 3), totle([...dataC], 4), totle([...dataC], 3) === 0 ? '0%' : ((totle([...dataC], 4) / totle([...dataC], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataC], 6), totle([...dataC], 7), totle([...dataC], 8), totle([...dataC], 9), totle([...dataC], 10), totle([...dataC], 11), totle([...dataC], 12), totle([...dataC], 13), totle([...dataC], 14), totle([...dataC], 15), totle([...dataC], 16), totle([...dataC], 17)])
if (dataIndex + 6 > dataA.length) {
dataIndex = 0
} else {
dataIndex += 6
}
console.log(dataB)
console.log(dataC)
planInfo.loadData([...dataB], 19, {
includeHead: true,
})
planInfo2.loadData([...dataC], 19, {
includeHead: true,
})
}
var myTransition = $('.my-transition');
var myTransition2 = $('.my-transition2');
if (myTransition.hasClass('my-click-transiton')) {
myTransition.removeClass('my-click-transiton');
$('.my-transition2').addClass('my-click-transiton');
} else {
myTransition2.removeClass('my-click-transiton');
$('.my-transition').addClass('my-click-transiton');
}
planInfoTime++
}
window.setInterval(showalert, 1000*30 );
//夹具生产计划切换
autoUpdate('/system/FoamerMes/getPlanHourInfo', INTERVAL, data => { autoUpdate('/system/FoamerMes/getPlanHourInfo', INTERVAL, data => {
let name = {} let name = {}
let dataInit = [] let dataInit = []
let title = ['编号', '型号', '状态', '目标', '计划', '累计', '达成率', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00'] let dataRes = []
let dataA = [title]
let dataB = [title]
data.forEach(e => { data.forEach(e => {
if (!Object.keys(name).includes(e.orderType)) { if (!Object.keys(name).includes(e.orderType)) {
name[e.orderType] = [e.deviceID] name[e.orderType] = [e.deviceID]
@ -492,45 +525,32 @@
}) })
}) })
let i = [] let i = []
dataInit.forEach((e,index)=> { dataInit.forEach((e, index) => {
if(e[0].orderType === '其他型号'){ if (e[0].orderType === '其他型号') {
i.push(index) i.push(index)
} }
}) })
i.forEach((e,index) => { i.forEach((e, index) => {
let a = dataInit.splice(e-index,1) let a = dataInit.splice(e - index, 1)
console.log(a)
dataInit.push(...a) dataInit.push(...a)
}) })
console.log(dataInit)
dataInit.forEach((val, index) => { dataInit.forEach((val, index) => {
if (index < 6) { let arr = val
let arr = val let plannedProduction = val[0].plannedProduction || 0
let plannedProduction = arr.map(e => e.plannedProduction).reduce((a, b) => a + b) || 0 let actualProduction = arr.map(e => e.actualProduction).reduce((a, b) => a + b) || 0
let actualProduction = arr.map(e => e.actualProduction).reduce((a, b) => a + b) || 0 dataRes.push([val[0].deviceID, val[0].orderType.split(',')[0], val[0].deviceState, arr[0].target, plannedProduction, actualProduction, plannedProduction === 0 ? '0%' : ((actualProduction / plannedProduction) * 100).toString().substr(0, 5) + '%', filter(arr, 'recordTime', 8, 'actualProduction') || 0, filter(arr, 'recordTime', 9, 'actualProduction') || 0, filter(arr, 'recordTime', 10, 'actualProduction') || 0, filter(arr, 'recordTime', 11, 'actualProduction') || 0, filter(arr, 'recordTime', 12, 'actualProduction') || 0, filter(arr, 'recordTime', 13, 'actualProduction') || 0, filter(arr, 'recordTime', 14, 'actualProduction') || 0, filter(arr, 'recordTime', 15, 'actualProduction') || 0, filter(arr, 'recordTime', 16, 'actualProduction') || 0, filter(arr, 'recordTime', 17, 'actualProduction') || 0, filter(arr, 'recordTime', 18, 'actualProduction') || 0, filter(arr, 'recordTime', 19, 'actualProduction') || 0])
dataA.push([val[0].deviceID, val[0].orderType.split(',')[0], '正常', arr[0].target, plannedProduction, actualProduction, plannedProduction === 0 ? '0%' : ((actualProduction / plannedProduction) * 100).toString().substr(0, 5) + '%', filter(arr, 'recordTime', 8, 'actualProduction') || 0, filter(arr, 'recordTime', 9, 'actualProduction') || 0, filter(arr, 'recordTime', 10, 'actualProduction') || 0, filter(arr, 'recordTime', 11, 'actualProduction') || 0, filter(arr, 'recordTime', 12, 'actualProduction') || 0, filter(arr, 'recordTime', 13, 'actualProduction') || 0, filter(arr, 'recordTime', 14, 'actualProduction') || 0, filter(arr, 'recordTime', 15, 'actualProduction') || 0, filter(arr, 'recordTime', 16, 'actualProduction') || 0, filter(arr, 'recordTime', 17, 'actualProduction') || 0, filter(arr, 'recordTime', 18, 'actualProduction') || 0, filter(arr, 'recordTime', 19, 'actualProduction') || 0])
} else {
let arr = val
let plannedProduction = arr.map(e => e.plannedProduction).reduce((a, b) => a + b) || 0
let actualProduction = arr.map(e => e.actualProduction).reduce((a, b) => a + b) || 0
dataB.push([val[0].deviceID, val[0].orderType.split(',')[0], '正常', arr[0].target, plannedProduction, actualProduction, plannedProduction === 0 ? '0%' : ((actualProduction / plannedProduction) * 100).toString().substr(0, 5) + '%', filter(arr, 'recordTime', 8, 'actualProduction') || 0, filter(arr, 'recordTime', 9, 'actualProduction') || 0, filter(arr, 'recordTime', 10, 'actualProduction') || 0, filter(arr, 'recordTime', 11, 'actualProduction') || 0, filter(arr, 'recordTime', 12, 'actualProduction') || 0, filter(arr, 'recordTime', 13, 'actualProduction') || 0, filter(arr, 'recordTime', 14, 'actualProduction') || 0, filter(arr, 'recordTime', 15, 'actualProduction') || 0, filter(arr, 'recordTime', 16, 'actualProduction') || 0, filter(arr, 'recordTime', 17, 'actualProduction') || 0, filter(arr, 'recordTime', 18, 'actualProduction') || 0, filter(arr, 'recordTime', 19, 'actualProduction') || 0])
}
}) })
dataA.push([' ', '合计', '', totle([...dataA], 2), totle([...dataA], 3), totle([...dataA], 4), totle(dataB, 3) === 0 ? '0%' : ((totle([...dataA], 4) / totle([...dataA], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataA], 6), totle([...dataA], 7), totle([...dataA], 8), totle([...dataA], 9), totle([...dataA], 10), totle([...dataA], 11), totle([...dataA], 12), totle([...dataA], 13), totle([...dataA], 14), totle([...dataA], 15), totle([...dataA], 16), totle([...dataA], 17)]) dataA = dataRes
dataB.push([' ', '合计', '', totle([...dataB], 2), totle([...dataB], 3), totle([...dataB], 4), totle([...dataB], 3) === 0 ? '0%' : ((totle([...dataB], 4) / totle([...dataB], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataB], 6), totle([...dataB], 7), totle([...dataB], 8), totle([...dataB], 9), totle([...dataB], 10), totle([...dataB], 11), totle([...dataB], 12), totle([...dataB], 13), totle([...dataB], 14), totle([...dataB], 15), totle([...dataB], 16), totle([...dataB], 17)])
if (first) {
planInfo.loadData([...dataA], 19, { console.log(dataInit)
includeHead: true, showalert();
})
if (dataB.length <= 2) {
dataB = dataA
} }
planInfo2.loadData([...dataB], 19, { first = false
includeHead: true,
})
}) })
autoUpdate('/system/FoamerMes/getProductPlanInfo', INTERVAL, data => { autoUpdate('/system/FoamerMes/getProductPlanInfo', INTERVAL, data => {
modelChart.setOption({ modelChart.setOption({
xAxis: { xAxis: {
@ -550,7 +570,6 @@
}) })
autoUpdate('/system/FoamerMes/getInventoryInfo', INTERVAL, data => { autoUpdate('/system/FoamerMes/getInventoryInfo', INTERVAL, data => {
console.log(data['xAxisInfo'].map(value => value.split(",").find(value => /^[Ss][Cc]/.test(value)) ?? value))
repertoryChart.setOption({ repertoryChart.setOption({
xAxis: { xAxis: {
data: data['xAxisInfo'], data: data['xAxisInfo'],
@ -589,7 +608,6 @@
const total = data[0] const total = data[0]
const flaw = data[1] const flaw = data[1]
const rate = flaw / total const rate = flaw / total
console.log(data)
rejectRatioChart.setOption({ rejectRatioChart.setOption({
series: [ series: [
{ {

@ -357,21 +357,6 @@
<script src="../../static/js/auto-update.js" th:src="@{/js/auto-update.js}"></script> <script src="../../static/js/auto-update.js" th:src="@{/js/auto-update.js}"></script>
<script> <script>
//夹具生产计划切换 //夹具生产计划切换
showalert();
window.setInterval(showalert, 1000 * 30);
function showalert() {
var myTransition = $('.my-transition');
var myTransition2 = $('.my-transition2');
if (myTransition.hasClass('my-click-transiton')) {
myTransition.removeClass('my-click-transiton');
$('.my-transition2').addClass('my-click-transiton');
} else {
myTransition2.removeClass('my-click-transiton');
$('.my-transition').addClass('my-click-transiton');
}
}
const orderInfColumns = [ const orderInfColumns = [
@ -455,12 +440,61 @@
} }
}).reduce((a, b) => a + b) }).reduce((a, b) => a + b)
} }
let title = ['编号', '型号', '状态', '目标', '计划', '累计', '达成率', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00']
let dataA = []
let dataB = []
let dataC = []
let dataIndex = 0
let first = true
let planInfoTime = 0
function showalert() {
if (planInfoTime % 2 === 0) {
dataB = [title]
dataC = [title]
dataB.push(...([...dataA].splice(dataIndex, 6)))
dataB.push([' ', '合计', '', totle([...dataB], 2), totle([...dataB], 3), totle([...dataB], 4), totle([...dataB], 3) === 0 ? '0%' : ((totle([...dataB], 4) / totle([...dataB], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataB], 6), totle([...dataB], 7), totle([...dataB], 8), totle([...dataB], 9), totle([...dataB], 10), totle([...dataB], 11), totle([...dataB], 12), totle([...dataB], 13), totle([...dataB], 14), totle([...dataB], 15), totle([...dataB], 16), totle([...dataB], 17)])
if (dataIndex + 6 > dataA.length) {
dataIndex = 0
} else {
dataIndex += 6
}
dataC.push(...([...dataA].splice(dataIndex, 6)))
dataC.push([' ', '合计', '', totle([...dataC], 2), totle([...dataC], 3), totle([...dataC], 4), totle([...dataC], 3) === 0 ? '0%' : ((totle([...dataC], 4) / totle([...dataC], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataC], 6), totle([...dataC], 7), totle([...dataC], 8), totle([...dataC], 9), totle([...dataC], 10), totle([...dataC], 11), totle([...dataC], 12), totle([...dataC], 13), totle([...dataC], 14), totle([...dataC], 15), totle([...dataC], 16), totle([...dataC], 17)])
if (dataIndex + 6 > dataA.length) {
dataIndex = 0
} else {
dataIndex += 6
}
console.log(dataB)
console.log(dataC)
planInfo.loadData([...dataB], 19, {
includeHead: true,
})
planInfo2.loadData([...dataC], 19, {
includeHead: true,
})
}
var myTransition = $('.my-transition');
var myTransition2 = $('.my-transition2');
if (myTransition.hasClass('my-click-transiton')) {
myTransition.removeClass('my-click-transiton');
$('.my-transition2').addClass('my-click-transiton');
} else {
myTransition2.removeClass('my-click-transiton');
$('.my-transition').addClass('my-click-transiton');
}
planInfoTime++
}
window.setInterval(showalert, 1000*30 );
//夹具生产计划切换
autoUpdate('/system/FoamerMes/getPlanHourInfo', INTERVAL, data => { autoUpdate('/system/FoamerMes/getPlanHourInfo', INTERVAL, data => {
let name = {} let name = {}
let dataInit = [] let dataInit = []
let title = ['编号', '型号', '状态', '目标', '计划', '累计', '达成率', '8:00', '9:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00'] let dataRes = []
let dataA = [title]
let dataB = [title]
data.forEach(e => { data.forEach(e => {
if (!Object.keys(name).includes(e.orderType)) { if (!Object.keys(name).includes(e.orderType)) {
name[e.orderType] = [e.deviceID] name[e.orderType] = [e.deviceID]
@ -484,43 +518,29 @@
}) })
}) })
let i = [] let i = []
dataInit.forEach((e,index)=> { dataInit.forEach((e, index) => {
if(e[0].orderType === '其他型号'){ if (e[0].orderType === '其他型号') {
i.push(index) i.push(index)
} }
}) })
i.forEach((e,index) => { i.forEach((e, index) => {
let a = dataInit.splice(e-index,1) let a = dataInit.splice(e - index, 1)
console.log(a)
dataInit.push(...a) dataInit.push(...a)
}) })
console.log(dataInit)
dataInit.forEach((val, index) => { dataInit.forEach((val, index) => {
if (index < 6) { let arr = val
let arr = val let plannedProduction = val[0].plannedProduction || 0
let plannedProduction = arr.map(e => e.plannedProduction).reduce((a, b) => a + b) || 0 let actualProduction = arr.map(e => e.actualProduction).reduce((a, b) => a + b) || 0
let actualProduction = arr.map(e => e.actualProduction).reduce((a, b) => a + b) || 0 dataRes.push([val[0].deviceID, val[0].orderType.split(',')[0], val[0].deviceState, arr[0].target, plannedProduction, actualProduction, plannedProduction === 0 ? '0%' : ((actualProduction / plannedProduction) * 100).toString().substr(0, 5) + '%', filter(arr, 'recordTime', 8, 'actualProduction') || 0, filter(arr, 'recordTime', 9, 'actualProduction') || 0, filter(arr, 'recordTime', 10, 'actualProduction') || 0, filter(arr, 'recordTime', 11, 'actualProduction') || 0, filter(arr, 'recordTime', 12, 'actualProduction') || 0, filter(arr, 'recordTime', 13, 'actualProduction') || 0, filter(arr, 'recordTime', 14, 'actualProduction') || 0, filter(arr, 'recordTime', 15, 'actualProduction') || 0, filter(arr, 'recordTime', 16, 'actualProduction') || 0, filter(arr, 'recordTime', 17, 'actualProduction') || 0, filter(arr, 'recordTime', 18, 'actualProduction') || 0, filter(arr, 'recordTime', 19, 'actualProduction') || 0])
dataA.push([val[0].deviceID, val[0].orderType.split(',')[0], '正常', arr[0].target, plannedProduction, actualProduction, plannedProduction === 0 ? '0%' : ((actualProduction / plannedProduction) * 100).toString().substr(0, 5) + '%', filter(arr, 'recordTime', 8, 'actualProduction') || 0, filter(arr, 'recordTime', 9, 'actualProduction') || 0, filter(arr, 'recordTime', 10, 'actualProduction') || 0, filter(arr, 'recordTime', 11, 'actualProduction') || 0, filter(arr, 'recordTime', 12, 'actualProduction') || 0, filter(arr, 'recordTime', 13, 'actualProduction') || 0, filter(arr, 'recordTime', 14, 'actualProduction') || 0, filter(arr, 'recordTime', 15, 'actualProduction') || 0, filter(arr, 'recordTime', 16, 'actualProduction') || 0, filter(arr, 'recordTime', 17, 'actualProduction') || 0, filter(arr, 'recordTime', 18, 'actualProduction') || 0, filter(arr, 'recordTime', 19, 'actualProduction') || 0])
} else {
let arr = val
let plannedProduction = arr.map(e => e.plannedProduction).reduce((a, b) => a + b) || 0
let actualProduction = arr.map(e => e.actualProduction).reduce((a, b) => a + b) || 0
dataB.push([val[0].deviceID, val[0].orderType.split(',')[0], '正常', arr[0].target, plannedProduction, actualProduction, plannedProduction === 0 ? '0%' : ((actualProduction / plannedProduction) * 100).toString().substr(0, 5) + '%', filter(arr, 'recordTime', 8, 'actualProduction') || 0, filter(arr, 'recordTime', 9, 'actualProduction') || 0, filter(arr, 'recordTime', 10, 'actualProduction') || 0, filter(arr, 'recordTime', 11, 'actualProduction') || 0, filter(arr, 'recordTime', 12, 'actualProduction') || 0, filter(arr, 'recordTime', 13, 'actualProduction') || 0, filter(arr, 'recordTime', 14, 'actualProduction') || 0, filter(arr, 'recordTime', 15, 'actualProduction') || 0, filter(arr, 'recordTime', 16, 'actualProduction') || 0, filter(arr, 'recordTime', 17, 'actualProduction') || 0, filter(arr, 'recordTime', 18, 'actualProduction') || 0, filter(arr, 'recordTime', 19, 'actualProduction') || 0])
}
}) })
dataA.push([' ', '合计', '', totle([...dataA], 2), totle([...dataA], 3), totle([...dataA], 4), totle(dataB, 3) === 0 ? '0%' : ((totle([...dataA], 4) / totle([...dataA], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataA], 6), totle([...dataA], 7), totle([...dataA], 8), totle([...dataA], 9), totle([...dataA], 10), totle([...dataA], 11), totle([...dataA], 12), totle([...dataA], 13), totle([...dataA], 14), totle([...dataA], 15), totle([...dataA], 16), totle([...dataA], 17)]) dataA = dataRes
dataB.push([' ', '合计', '', totle([...dataB], 2), totle([...dataB], 3), totle([...dataB], 4), totle([...dataB], 3) === 0 ? '0%' : ((totle([...dataB], 4) / totle([...dataB], 3)) * 100).toString().substr(0, 5) + '%', totle([...dataB], 6), totle([...dataB], 7), totle([...dataB], 8), totle([...dataB], 9), totle([...dataB], 10), totle([...dataB], 11), totle([...dataB], 12), totle([...dataB], 13), totle([...dataB], 14), totle([...dataB], 15), totle([...dataB], 16), totle([...dataB], 17)])
planInfo.loadData([...dataA], 19, { if (first) {
includeHead: true, console.log(dataInit)
}) showalert();
if (dataB.length <= 2) {
dataB = dataA
} }
planInfo2.loadData([...dataB], 19, { first = false
includeHead: true,
})
}) })
autoUpdate('/system/FoamerMes/getProductPlanInfo', INTERVAL, data => { autoUpdate('/system/FoamerMes/getProductPlanInfo', INTERVAL, data => {

Loading…
Cancel
Save