This commit is contained in:
2025-07-04 16:10:18 +08:00
parent 93765733bb
commit 1144633dfa

View File

@@ -55,11 +55,8 @@
<p>包装进度</p> <p>包装进度</p>
</div> </div>
<div class="content_wraper content_wraper_2"> <div class="content_wraper content_wraper_2">
<!-- <div class="pie_wraper pie_wraper1">
<div ref="echartsRef1" style="width: 100%; height: 100%;"></div>
</div> -->
<div class="pie_wraper pie_wraper2"> <div class="pie_wraper pie_wraper2">
<div ref="echartsRef3" style="width: 100%; height: 100%;"></div> <div ref="echartsRef1" style="width: 100%; height: 100%;"></div>
</div> </div>
</div> </div>
</div> </div>
@@ -120,9 +117,8 @@ export default {
loadList: [], // 当日车间上下料 loadList: [], // 当日车间上下料
dataList1: [], // 订单数据-滚动列表1 dataList1: [], // 订单数据-滚动列表1
dataList2: [], // 订单数据-滚动列表2 dataList2: [], // 订单数据-滚动列表2
myChart1: null,
myChart2: null, myChart2: null,
myChart3: null myChart1: null
} }
}, },
computed: { computed: {
@@ -155,22 +151,17 @@ export default {
this.refresh() this.refresh()
}, },
mounted () { mounted () {
// this.myChart1 = this.$echarts.init(this.$refs.echartsRef1)
this.myChart2 = this.$echarts.init(this.$refs.echartsRef2) this.myChart2 = this.$echarts.init(this.$refs.echartsRef2)
this.myChart3 = this.$echarts.init(this.$refs.echartsRef3) this.myChart1 = this.$echarts.init(this.$refs.echartsRef1)
}, },
destroyed () { destroyed () {
if (this.myChart1 !== null) {
this.myChart1.dispose()
this.myChart1 = null
}
if (this.myChart2 !== null) { if (this.myChart2 !== null) {
this.myChart2.dispose() this.myChart2.dispose()
this.myChart2 = null this.myChart2 = null
} }
if (this.myChart3 !== null) { if (this.myChart1 !== null) {
this.myChart3.dispose() this.myChart1.dispose()
this.myChart3 = null this.myChart1 = null
} }
if (this.timer !== null) { if (this.timer !== null) {
clearInterval(this.timer) clearInterval(this.timer)
@@ -214,66 +205,9 @@ export default {
this.curList = [...res.todaycpsituation] // 成品包装情况(柱状图) this.curList = [...res.todaycpsituation] // 成品包装情况(柱状图)
this.dataList1 = [...res.dddatebase] // 滚动1-订单数据 this.dataList1 = [...res.dddatebase] // 滚动1-订单数据
this.dataList2 = [...res.dddatebase] // 滚动2-(样品)包装发货进度 this.dataList2 = [...res.dddatebase] // 滚动2-(样品)包装发货进度
// this.setEchart1() this.setEchart1()
this.setEchart3()
console.log(1)
this.setEchart2() this.setEchart2()
console.log(3)
}, },
// setEchart1 () {
// let data = [
// {
// value: this.fhobj.enter_proportion,
// name: '入库'
// },
// {
// value: this.fhobj.out_proportion,
// name: '未入库'
// }
// ]
// var option = {
// legend: {
// // orient: 'vertical',
// orient: 'horizontal',
// top: '4%',
// // right: 0,
// textStyle: {
// color: '#fff',
// fontWeight: 'bold',
// fontSize: 12
// },
// itemGap: 10.86,
// itemWidth: 14.16,
// itemHeight: 7.38,
// // data: dataName
// data: ['入库', '未入库']
// },
// color: ['#0966E8', '#39E083', '#ffee0e', '#f975aa', '#32c5ff', '#f7b502'],
// series: [
// {
// type: 'pie',
// radius: ['38%', '70%'],
// label: {
// normal: {
// show: false,
// // position: 'inner',
// formatter: '{d}%',
// textStyle: {
// color: '#fff',
// fontWeight: 'bold',
// fontSize: 12
// }
// }
// },
// labelLine: {
// show: true
// },
// data: data
// }
// ]
// }
// this.myChart1.setOption(option, true)
// },
setEchart2 () { setEchart2 () {
let barName = [] let barName = []
let barData1 = [] let barData1 = []
@@ -305,7 +239,7 @@ export default {
itemGap: 10.86, itemGap: 10.86,
itemWidth: 14.16, itemWidth: 14.16,
itemHeight: 7.38, itemHeight: 7.38,
data: [{name: '入库', itemStyle: {color: '#67D470'}}, {name: '出库', itemStyle: {color: '#1980EA'}}] data: [{name: '计划重量', itemStyle: {color: '#67D470'}}, {name: '已完成重量', itemStyle: {color: '#1980EA'}}]
}, },
xAxis: { xAxis: {
type: 'category', type: 'category',
@@ -352,7 +286,7 @@ export default {
}, },
series: [ series: [
{ {
name: '入库', name: '计划重量',
type: 'bar', type: 'bar',
barWidth: '18', barWidth: '18',
itemStyle: { itemStyle: {
@@ -374,7 +308,7 @@ export default {
data: barData1 data: barData1
}, },
{ {
name: '出库', name: '已完成重量',
type: 'bar', type: 'bar',
barWidth: '18', barWidth: '18',
itemStyle: { itemStyle: {
@@ -418,7 +352,7 @@ export default {
this.myChart2.setOption(option, true) this.myChart2.setOption(option, true)
}, 2000) }, 2000)
}, },
setEchart3 () { setEchart1 () {
let data = [ let data = [
{ {
value: this.bzsituation[0].bz_proportion, value: this.bzsituation[0].bz_proportion,
@@ -474,7 +408,7 @@ export default {
} }
] ]
} }
this.myChart3.setOption(option, true) this.myChart1.setOption(option, true)
} }
} }
} }