压制修改

This commit is contained in:
2024-04-28 09:39:20 +08:00
parent b3aaf570ff
commit 32edb15c99
2 changed files with 300 additions and 297 deletions

View File

@@ -3,211 +3,243 @@ export const cockpitpress = () => {
let res = {
'PressOrderList': [
{
'planQty': '6000',
'realQty': '6000',
'rate': '1',
'orderNumber': 'SY202401-04'
'planQty': '4000',
'realQty': '2016',
'rate': '0.50',
'orderNumber': 'SY202403-04'
},
{
'planQty': '1000',
'realQty': '756',
'planQty': '2000',
'realQty': '2772',
'rate': '1.39',
'orderNumber': 'sy02403-04'
},
{
'planQty': '2000',
'realQty': '1512',
'rate': '0.76',
'orderNumber': 'NY202401-03'
},
{
'planQty': '1000',
'realQty': '378',
'rate': '0.38',
'orderNumber': 'DX202401-01'
'orderNumber': 'SY202401-02'
}
],
'ProductionTask': [
{
'device': '压机01',
'workorderCode': '240123001',
'team': '白班',
'materialName': '004',
'customer': '实业股份',
'planproducestartDate': '2024-01-23 08:28:14',
'planQty': '1000',
'realQty': '1015',
'unqualifiedQty': '0',
'qualifiedRate': '10.0',
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-01-23 08:31:28',
'realproduceendDate': '-'
},
{
'device': '压机02',
'workorderCode': '240123002',
'workorderCode': '240317013',
'team': '白班',
'materialName': '004',
'materialName': 'ML-75B',
'customer': '实业股份',
'planproducestartDate': '2024-01-23 08:28:59',
'planproducestartDate': '2024-03-17 15:45:44',
'planQty': '1000',
'realQty': '1008',
'unqualifiedQty': '0',
'qualifiedRate': '10.0',
'realQty': '1764',
'unqualifiedQty': null,
'qualifiedRate': null,
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-01-23 08:31:36',
'realproduceendDate': '-'
},
{
'device': '压机03',
'workorderCode': '240123003',
'team': '白班',
'materialName': '004',
'customer': '实业股份',
'planproducestartDate': '2024-01-23 08:29:30',
'planQty': '1000',
'realQty': '1287',
'unqualifiedQty': '0',
'qualifiedRate': '10.0',
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-01-23 08:31:42',
'realproduceendDate': '-'
},
{
'device': '压机04',
'workorderCode': '240123004',
'team': '白班',
'materialName': '004',
'customer': '实业股份',
'planproducestartDate': '2024-01-23 08:29:55',
'planQty': '1000',
'realQty': '1260',
'unqualifiedQty': '0',
'qualifiedRate': '10.0',
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-01-23 08:31:50',
'realproducestartDate': '2024-03-17 15:45:42',
'realproduceendDate': '-'
},
{
'device': '压机05',
'workorderCode': '240123005',
'workorderCode': '240325003',
'team': '白班',
'materialName': '004',
'materialName': 'ML-70BD',
'customer': '实业股份',
'planproducestartDate': '2024-01-23 08:34:27',
'planproducestartDate': '2024-03-25 09:17:07',
'planQty': '1000',
'realQty': '1764',
'unqualifiedQty': '0',
'qualifiedRate': '10.0',
'unqualifiedQty': null,
'qualifiedRate': null,
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-01-23 08:40:05',
'realproduceendDate': '-'
},
{
'device': '压机06',
'workorderCode': '240123006',
'team': '白班',
'materialName': '004',
'customer': '实业股份',
'planproducestartDate': '2024-01-23 08:34:57',
'planQty': '1000',
'realQty': '1512',
'unqualifiedQty': '0',
'qualifiedRate': '10.0',
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-01-23 08:40:13',
'realproducestartDate': '2024-03-25 09:17:14',
'realproduceendDate': '-'
},
{
'device': '压机07',
'workorderCode': '240123007',
'workorderCode': '240325005',
'team': '白班',
'materialName': '003',
'customer': '镍业',
'planproducestartDate': '2024-01-23 08:37:14',
'materialName': 'BP-70A',
'customer': '实业股份',
'planproducestartDate': '2024-03-25 09:25:23',
'planQty': '1000',
'realQty': '756',
'unqualifiedQty': '0',
'qualifiedRate': '10.0',
'unqualifiedQty': null,
'qualifiedRate': null,
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-01-23 08:40:18',
'realproducestartDate': '2024-03-25 09:25:27',
'realproduceendDate': '-'
},
{
'device': '压机08',
'workorderCode': '240123008',
'workorderCode': '240325006',
'team': '白班',
'materialName': '001',
'customer': '鼎新',
'planproducestartDate': '2024-01-23 08:37:59',
'materialName': 'BP-65A',
'customer': '实业股份',
'planproducestartDate': '2024-03-25 09:26:39',
'planQty': '1000',
'realQty': '378',
'unqualifiedQty': '0',
'qualifiedRate': '10.0',
'realQty': '756',
'unqualifiedQty': null,
'qualifiedRate': null,
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-01-23 08:40:23',
'realproducestartDate': '2024-03-25 09:26:35',
'realproduceendDate': '-'
},
{
'device': '压机01',
'workorderCode': '240329002',
'team': '白班',
'materialName': 'ML-70BD',
'customer': '沙湾',
'planproducestartDate': '2024-03-29 10:24:01',
'planQty': '1000',
'realQty': '1008',
'unqualifiedQty': null,
'qualifiedRate': null,
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-03-29 10:24:26',
'realproduceendDate': '-'
},
{
'device': '压机06',
'workorderCode': '240330001',
'team': '白班',
'materialName': 'ML-75B',
'customer': '镍业',
'planproducestartDate': '2024-03-30 11:39:29',
'planQty': '1000',
'realQty': '252',
'unqualifiedQty': null,
'qualifiedRate': null,
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-03-30 11:39:37',
'realproduceendDate': '-'
},
{
'device': '压机04',
'workorderCode': '240330005',
'team': '白班',
'materialName': 'ML-75B',
'customer': '镍业',
'planproducestartDate': '2024-03-30 12:34:12',
'planQty': '1000',
'realQty': '0',
'unqualifiedQty': null,
'qualifiedRate': null,
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-03-30 12:34:09',
'realproduceendDate': '-'
},
{
'device': '压机03',
'workorderCode': '240401001',
'team': '白班',
'materialName': 'ML-75B',
'customer': '镍业',
'planproducestartDate': '2024-04-01 11:07:51',
'planQty': '1000',
'realQty': '0',
'unqualifiedQty': null,
'qualifiedRate': null,
'workorderStatus': '生产中',
'operator': '管理员',
'realproducestartDate': '2024-04-01 11:08:07',
'realproduceendDate': '-'
}
],
'DayShiftInfo': [
{
'planQty': '8000',
'realQty': '8980',
'unqualifiedQty': '0',
'qualifiedQty': '800',
'realQty': '6300',
'unqualifiedQty': '974',
'qualifiedQty': '5564',
'team': '白班'
}
],
'ShiftProductionList': [
{
'columnName': '压机01',
'qualifiedQty': '100',
'unqualifiedQty': '0',
'lastQty': '900'
'qualifiedQty': '600',
'unqualifiedQty': '77',
'lastQty': '323',
'workOrderCode': '240329002',
'pointCode': 'YJ01',
'planQty': '1000',
'qualifyRate': '0.60'
},
{
'columnName': '压机02',
'qualifiedQty': '100',
'qualifiedQty': '0',
'unqualifiedQty': '0',
'lastQty': '900'
'lastQty': '1000',
'workOrderCode': '240317013',
'pointCode': 'YJ02',
'planQty': '1000',
'qualifyRate': '0.00'
},
{
'columnName': '压机03',
'qualifiedQty': '100',
'unqualifiedQty': '0',
'lastQty': '900'
'qualifiedQty': '60',
'unqualifiedQty': '21',
'lastQty': '919',
'workOrderCode': '240401001',
'pointCode': 'YJ03',
'planQty': '1000',
'qualifyRate': '0.06'
},
{
'columnName': '压机04',
'qualifiedQty': '100',
'qualifiedQty': '0',
'unqualifiedQty': '0',
'lastQty': '900'
'lastQty': '1000',
'workOrderCode': '240330005',
'pointCode': 'YJ04',
'planQty': '1000',
'qualifyRate': '0.00'
},
{
'columnName': '压机05',
'qualifiedQty': '100',
'unqualifiedQty': '0',
'lastQty': '900'
'qualifiedQty': '1980',
'unqualifiedQty': '226',
'lastQty': '0',
'workOrderCode': '240325003',
'pointCode': 'YJ05',
'planQty': '1000',
'qualifyRate': '1.98'
},
{
'columnName': '压机06',
'qualifiedQty': '100',
'qualifiedQty': '0',
'unqualifiedQty': '0',
'lastQty': '900'
'lastQty': '1000',
'workOrderCode': '240330001',
'pointCode': 'YJ06',
'planQty': '1000',
'qualifyRate': '0.00'
},
{
'columnName': '压机07',
'qualifiedQty': '100',
'unqualifiedQty': '0',
'lastQty': '900'
'qualifiedQty': '1160',
'unqualifiedQty': '422',
'lastQty': '0',
'workOrderCode': '240325005',
'pointCode': 'YJ07',
'planQty': '1000',
'qualifyRate': '1.16'
},
{
'columnName': '压机08',
'qualifiedQty': '100',
'unqualifiedQty': '0',
'lastQty': '900'
'qualifiedQty': '1764',
'unqualifiedQty': '228',
'lastQty': '0',
'workOrderCode': '240325006',
'pointCode': 'YJ08',
'planQty': '1000',
'qualifyRate': '1.76'
}
]
}

View File

@@ -94,8 +94,8 @@
</template>
<script>
import { cockpitpress } from '@js/getData1'
// import {cockpitpress} from '@js/mork1.js'
// import { cockpitpress } from '@js/getData1'
import {cockpitpress} from '@js/mork1.js'
export default {
name: 'ProdCount',
data () {
@@ -213,11 +213,13 @@ export default {
let data1 = []
let data2 = []
let data3 = []
let data4 = []
let device = []
this.ShiftProductionList.map(e => {
data1.push(e.qualifiedQty)
data2.push(e.unqualifiedQty)
data3.push(e.lastQty)
data4.push(e.qualifyRate)
device.push(e.columnName)
})
let option = {
@@ -239,7 +241,7 @@ export default {
itemGap: 40.86,
itemWidth: 20.16,
itemHeight: 7.38,
data: [{name: '合格数', itemStyle: {color: '#33CCCC'}}, {name: '不合格数', itemStyle: {color: '#EAAD24'}}, {name: '剩余数', itemStyle: {color: '#0E90FD'}}]
data: [{name: '合格数', itemStyle: {color: '#33CCCC'}}, {name: '不合格数', itemStyle: {color: '#EAAD24'}}, {name: '剩余数', itemStyle: {color: '#0E90FD'}}, {name: '合格率', itemStyle: {color: '#cf66fc'}}]
},
xAxis: {
type: 'category',
@@ -377,6 +379,37 @@ export default {
}
},
data: data3
},
{
name: '合格率',
type: 'bar',
barWidth: '12',
label: {
show: true,
position: 'top', // 位置
color: '#A7D6F4',
fontSize: 14,
distance: 15, // 距离
formatter: '{c}' // 这里是数据展示的时候显示的数据
},
barGap: '200%',
itemStyle: {
normal: {
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 1,
color: 'rgba(96,112,128,0.10)',
opacity: 1
},
{
offset: 0,
color: '#cf66fc',
opacity: 0.1
}
])
}
},
data: data4
}
]
}
@@ -393,53 +426,44 @@ export default {
}
},
setEchart02 () {
let max = 1
// this.MonthlyWorkOrder.map(el => {
// if (Number(el.order_num) >= Number(max)) {
// max = Number(el.order_num)
// }
// })
this.PressOrderList.map(el => {
// if ((Number(el.planQty) + Number(el.realQty)) >= Number(max)) {
// max = Number(el.planQty) + Number(el.realQty)
// }
if (Number(el.planQty) >= Number(max)) {
max = Number(el.planQty)
}
let data1 = []
let data2 = []
let device = []
this.PressOrderList.map(e => {
data1.push(e.planQty)
data2.push(e.realQty)
device.push(e.orderNumber)
})
let option = {
grid: {
top: 0,
top: 50,
left: 0,
right: 58,
right: 0,
bottom: 0,
containLabel: true
},
dataZoom: [
{
show: false, // 为true滚动条出现
type: 'slider', // type:'inside',滚动条在最下面,鼠标点击滚动
orient: 'vertical',
startValue: 0, // 从头开始。
endValue: 3 // end百分比显示范围endValue具体显示几个数值
}
],
legend: {
icon: 'rect',
// right: 0,
textStyle: {
color: '#fff',
fontSize: 14,
lineHeight: 14
},
itemGap: 40.86,
itemWidth: 20.16,
itemHeight: 7.38,
data: [{name: '计划数量', itemStyle: {color: '#33CCCC'}}, {name: '生产数量', itemStyle: {color: '#EAAD24'}}]
},
xAxis: {
type: 'value',
min: 0,
max: max,
boundaryGap: false,
type: 'category',
axisTick: {
show: false
},
axisLine: {
show: false
},
splitLine: {
show: true,
lineStyle: {
type: [8, 4],
dashOffset: 4,
width: 2,
color: '#8FABBF'
}
},
@@ -448,20 +472,14 @@ export default {
textStyle: {
color: '#8FABBF',
fontSize: 16
// align: 'center'
}
},
formatter: '{value}'
data: device
},
yAxis: {
type: 'category',
inverse: true,
type: 'value',
axisLine: {
show: true,
lineStyle: {
width: 2,
color: '#8FABBF'
}
show: false
},
splitNumber: 2,
axisTick: {
@@ -473,150 +491,103 @@ export default {
fontSize: 14
}
},
// data: this.MonthlyWorkOrder.map((it) => it.name)
data: this.PressOrderList.map((it) => it.orderNumber)
splitLine: {
show: true,
lineStyle: {
type: [8, 4],
dashOffset: 4,
color: '#8FABBF'
}
}
},
series: [
{
name: '订单1',
name: '计划数量',
type: 'bar',
stack: '总量',
barWidth: 30,
barWidth: '12',
label: {
show: true,
position: 'top', // 位置
color: '#A7D6F4',
fontSize: 14,
distance: 15, // 距离
formatter: '{c}' // 这里是数据展示的时候显示的数据
},
itemStyle: {
normal: {
// color: new this.$echarts.graphic.LinearGradient(0, 0, 1, 0, [
// {
// offset: 0,
// // color: '#f6b643'
// color: '#ed7d39'
// // color: '#EAAD24'
// },
// {
// offset: 1,
// color: '#ed7d39'
// // color: '#EAAD24'
// }
// ], false),
label: {
color: '#fff',
show: true,
position: 'inside'
}
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#33CCCC',
opacity: 1
},
{
offset: 1,
color: 'rgba(31,89,89,0.25)',
opacity: 0.25
}
])
}
},
// data: [8, 10, 20, 20, 10, 10, 20],
// data: this.MonthlyWorkOrder.map((it) => it.guada_num)
data: this.PressOrderList.map((it) => it.planQty)
data: data1
},
{
name: '订单2',
name: '生产数量',
type: 'bar',
stack: '总量',
barWidth: '12',
barGap: '300%',
label: {
show: true,
position: 'top', // 位置
color: '#A7D6F4',
fontSize: 14,
distance: 15, // 距离
formatter: '{c}' // 这里是数据展示的时候显示的数据
},
itemStyle: {
normal: {
// color: new this.$echarts.graphic.LinearGradient(0, 0, 1, 0, [
// {
// offset: 0,
// color: '#94d153'
// // color: '#33CCCC'
// },
// {
// offset: 1,
// color: '#94d153'
// // color: '#33CCCC'
// }
// ], false),
label: {
color: '#333',
show: true,
position: 'inside'
// position: 'insideRight',
}
color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#B68845',
opacity: 1
},
{
offset: 1,
color: 'rgba(134,98,45,0.25)',
opacity: 0.25
}
])
}
},
// data: [10, 20, 10, 10, 20, 20, 20],
// data: this.MonthlyWorkOrder.map((it) => it.residue_num)
// data: this.PressOrderList.map((it) => it.realQty)
data: this.PressOrderList.map((it) => Number(it.planQty) - Number(it.realQty))
data: data2
}
// {
// type: 'bar',
// barWidth: '16',
// zlevel: 1,
// label: {
// show: true,
// position: 'right', // 位置
// color: '#A7D6F4',
// fontSize: 14,
// distance: 15, // 距离
// formatter: '{c}' // 这里是数据展示的时候显示的数据
// },
// itemStyle: {
// normal: {
// color: new this.$echarts.graphic.LinearGradient(0, 0, 1, 0, [
// {
// offset: 0,
// color: '#2DB796'
// },
// {
// offset: 1,
// color: '#6BBBA8'
// }
// ], false)
// }
// },
// data: this.MonthlyWorkOrder.map((it) => it.order_num)
// },
// {
// type: 'bar',
// barWidth: '16',
// zlevel: 1,
// label: {
// show: true,
// position: 'right', // 位置
// color: '#A7D6F4',
// fontSize: 14,
// distance: 15, // 距离
// formatter: '{c}' // 这里是数据展示的时候显示的数据
// },
// itemStyle: {
// normal: {
// color: new this.$echarts.graphic.LinearGradient(0, 0, 1, 0, [
// {
// offset: 0,
// color: '#f6b643'
// },
// {
// offset: 1,
// color: '#ed7d39'
// }
// ], false)
// }
// },
// data: this.MonthlyWorkOrder.map((it) => it.guada_num)
// }
]
}
let echart = document.getElementById('echart_d2')
this.myCharts02 = this.$echarts.init(echart)
this.myCharts02.setOption(option)
this.autoMove(option)
window.addEventListener('resize', () => {
this.myCharts02.resize()
})
},
autoMove (option) {
this.timeOut = setInterval(() => {
if (Number(option.dataZoom[0].endValue) === option.series[0].data.length - 1) {
option.dataZoom[0].endValue = 3
option.dataZoom[0].startValue = 0
} else {
option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1
option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1
}
// if (this.myCharts01 !== '') {
// this.myCharts01.dispose()
// }
if (echart !== null) {
this.myCharts02 = this.$echarts.init(echart)
this.myCharts02.setOption(option)
}, 2000)
window.addEventListener('resize', () => {
this.myCharts02.resize()
})
}
}
// autoMove (option) {
// this.timeOut = setInterval(() => {
// if (Number(option.dataZoom[0].endValue) === option.series[0].data.length - 1) {
// option.dataZoom[0].endValue = 3
// option.dataZoom[0].startValue = 0
// } else {
// option.dataZoom[0].endValue = option.dataZoom[0].endValue + 1
// option.dataZoom[0].startValue = option.dataZoom[0].startValue + 1
// }
// this.myCharts02.setOption(option)
// }, 2000)
// }
}
}
</script>