压制修改

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

View File

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