|
|
|
@ -8,12 +8,12 @@
|
|
|
|
|
{{ i }}
|
|
|
|
|
</div>
|
|
|
|
|
<div class="chart1">
|
|
|
|
|
<!-- <HighChart key="chart1" ref="chart1"></HighChart>-->
|
|
|
|
|
<!-- <HighChart key="chart1" ref="chart1"></HighChart>-->
|
|
|
|
|
<Chart key="chart1" ref="chart1"></Chart>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="chart2">-->
|
|
|
|
|
<!-- <HighChart key="chart2" ref="chart2"></HighChart>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <div class="chart2">-->
|
|
|
|
|
<!-- <HighChart key="chart2" ref="chart2"></HighChart>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<div class="chart3">
|
|
|
|
|
<Chart key="chart3" ref="chart3"></Chart>
|
|
|
|
|
</div>
|
|
|
|
@ -160,13 +160,7 @@ import vueSeamlessScroll from 'vue-seamless-scroll'
|
|
|
|
|
import Chart from '@/components/board/Chart'
|
|
|
|
|
import HighChart from '@/components/board/HighChart'
|
|
|
|
|
import * as echarts from 'echarts'
|
|
|
|
|
import {
|
|
|
|
|
bomInfo,
|
|
|
|
|
inAndOutInfo,
|
|
|
|
|
productInAndOutInfo,
|
|
|
|
|
purchaseInfo,
|
|
|
|
|
stockPercentage
|
|
|
|
|
} from '@/api/board/fourthFloorWarehouse'
|
|
|
|
|
import {} from '@/api/board/fourthFloorWarehouse'
|
|
|
|
|
import { parseTime } from '@/utils/ruoyi'
|
|
|
|
|
|
|
|
|
|
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
|
|
|
|
@ -237,31 +231,21 @@ export default {
|
|
|
|
|
|
|
|
|
|
window.onresize = () => {
|
|
|
|
|
this.$refs.chart1.resize()
|
|
|
|
|
this.$refs.chart2.resize()
|
|
|
|
|
this.$refs.chart3.resize()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getData() {
|
|
|
|
|
inAndOutInfo().then(e => {
|
|
|
|
|
console.log(e)
|
|
|
|
|
this.topData.num1= [...[0, 0, 0, 0], ...(e.data.inStocks.find(v=>v.warehouseId===111)?.outstockAmount || 0).toString().split('')].slice(-4)
|
|
|
|
|
this.topData.num2= [...[0, 0, 0, 0], ...(e.data.rawOutstocks?.find(v=>v.warehouseId===111)?.outstockAmount || 0).toString().split('')].slice(-4)
|
|
|
|
|
this.topData.num3= [...[0, 0, 0, 0], ...(e.data.inStocks.find(v=>v.warehouseId===131)?.outstockAmount || 0).toString().split('')].slice(-4)
|
|
|
|
|
})
|
|
|
|
|
stockPercentage().then(e => {
|
|
|
|
|
let num1 = e.data.nostockAmount + e.data.stockAmount
|
|
|
|
|
let num2 = e.data.stockAmount
|
|
|
|
|
let num2_1
|
|
|
|
|
let num3 = e.data.nostockAmount
|
|
|
|
|
let num3_1
|
|
|
|
|
if (num1 === 0) {
|
|
|
|
|
num2_1 = 50
|
|
|
|
|
num3_1 = 50
|
|
|
|
|
} else {
|
|
|
|
|
num2_1 = parseFloat(((num2 / num1) * 100).toFixed(2))
|
|
|
|
|
num3_1 = parseFloat(((num3 / num1) * 100).toFixed(2))
|
|
|
|
|
let e = {
|
|
|
|
|
data: {
|
|
|
|
|
'rawInstockAmount': 28,
|
|
|
|
|
'rawOutstockAmount': 14,
|
|
|
|
|
'productInstockAmount': 8
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.topData.num1 = [...[0, 0, 0, 0], ...(e.data.rawInstockAmount || 0).toString().split('')].slice(-4)
|
|
|
|
|
this.topData.num2 = [...[0, 0, 0, 0], ...(e.data.rawOutstockAmount || 0).toString().split('')].slice(-4)
|
|
|
|
|
this.topData.num3 = [...[0, 0, 0, 0], ...(e.data.productInstockAmount || 0).toString().split('')].slice(-4)
|
|
|
|
|
this.$refs.chart1.setData({
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'item'
|
|
|
|
@ -299,7 +283,7 @@ export default {
|
|
|
|
|
width: 2
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data: [1,2,3]
|
|
|
|
|
data: [1, 2, 3]
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'value',
|
|
|
|
@ -350,7 +334,7 @@ export default {
|
|
|
|
|
false
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
data:[11,22,3]
|
|
|
|
|
data: [11, 22, 3]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '',
|
|
|
|
@ -364,115 +348,12 @@ export default {
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#138dd7'
|
|
|
|
|
},
|
|
|
|
|
data:[11,22,3]
|
|
|
|
|
data: [11, 22, 3]
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
let num11 = e.data.noProductstockAmount + e.data.productstockAmount
|
|
|
|
|
let num12 = e.data.productstockAmount
|
|
|
|
|
let num12_1
|
|
|
|
|
let num13 = e.data.noProductstockAmount
|
|
|
|
|
let num13_1
|
|
|
|
|
if (num11 === 0) {
|
|
|
|
|
num12_1 = 50
|
|
|
|
|
num13_1 = 50
|
|
|
|
|
} else {
|
|
|
|
|
num12_1 = parseFloat(((num12 / num11) * 100).toFixed(2))
|
|
|
|
|
num13_1 = parseFloat(((num13 / num11) * 100).toFixed(2))
|
|
|
|
|
}
|
|
|
|
|
this.$refs.chart2.setData({
|
|
|
|
|
title: {
|
|
|
|
|
text: '成品库存占比',
|
|
|
|
|
style: {
|
|
|
|
|
color: '#fff'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
credits: {
|
|
|
|
|
enabled: false
|
|
|
|
|
},
|
|
|
|
|
chart: {
|
|
|
|
|
type: 'pie',
|
|
|
|
|
startAngle: Math.PI / 6,
|
|
|
|
|
animation: false,
|
|
|
|
|
backgroundColor: null,
|
|
|
|
|
events: {
|
|
|
|
|
load: function() {
|
|
|
|
|
let each = Highcharts.each,
|
|
|
|
|
points = this.series[0].points
|
|
|
|
|
each(points, function(p, i) {
|
|
|
|
|
p.graphic.attr({
|
|
|
|
|
translateY: -p.shapeArgs.ran
|
|
|
|
|
})
|
|
|
|
|
p.graphic.side1.attr({
|
|
|
|
|
translateY: -p.shapeArgs.ran
|
|
|
|
|
})
|
|
|
|
|
p.graphic.side2.attr({
|
|
|
|
|
translateY: -p.shapeArgs.ran
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
options3d: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
alpha: 60,
|
|
|
|
|
beta: 0
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
legend: {
|
|
|
|
|
reversed: true,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
color: '#fff'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
plotOptions: {
|
|
|
|
|
pie: {
|
|
|
|
|
allowPointSelect: false,
|
|
|
|
|
cursor: 'pointer',
|
|
|
|
|
depth: 35,
|
|
|
|
|
startAngle: 45,
|
|
|
|
|
size: 200,
|
|
|
|
|
dataLabels: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
formatter: function() {
|
|
|
|
|
return this.point.options.name + '<br>' + this.point.options.h + '%'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
showInLegend: false,
|
|
|
|
|
point: {
|
|
|
|
|
events: {
|
|
|
|
|
legendItemClick: function(e) {
|
|
|
|
|
return false // 直接 return false 即可禁用图例点击事件
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
type: 'pie',
|
|
|
|
|
name: '占比',
|
|
|
|
|
data: [
|
|
|
|
|
{
|
|
|
|
|
'name': '已使用',
|
|
|
|
|
y: num12_1,
|
|
|
|
|
h: num12_1
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: '未使用',
|
|
|
|
|
y: num12_1,
|
|
|
|
|
h: num12_1
|
|
|
|
|
}
|
|
|
|
|
].sort((a, b) => a.y - b.y)
|
|
|
|
|
}]
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
purchaseInfo().then(e => {
|
|
|
|
|
this.scrollTableData = e.data
|
|
|
|
|
})
|
|
|
|
|
bomInfo().then(e => {
|
|
|
|
|
this.scrollTableData1 = e.data
|
|
|
|
|
})
|
|
|
|
|
productInAndOutInfo().then(e => {
|
|
|
|
|
this.scrollTableData = []
|
|
|
|
|
this.scrollTableData1 = []
|
|
|
|
|
this.$refs.chart3.setData({
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
@ -574,7 +455,6 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|