diff --git a/hw-ui/public/index.html b/hw-ui/public/index.html
index 529f24e9..22b08426 100644
--- a/hw-ui/public/index.html
+++ b/hw-ui/public/index.html
@@ -4,6 +4,7 @@
+
-
-
1
-
0
-
0
-
0
-
-
1
-
0
-
0
-
0
-
-
1
-
0
-
0
-
0
-
-
1
-
0
-
0
-
0
-
-
1
-
0
-
0
-
0
+
{{ topData.num1[0] }}
+
{{ topData.num1[1] }}
+
{{ topData.num1[2] }}
+
{{ topData.num1[3] }}
+
{{ topData.num2[0] }}
+
{{ topData.num2[1] }}
+
{{ topData.num2[2] }}
+
{{ topData.num2[3] }}
+
{{ topData.num3[0] }}
+
{{ topData.num3[1] }}
+
{{ topData.num3[2] }}
+
{{ topData.num3[3] }}
@@ -161,6 +159,14 @@ 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/firstFloorWarehouse'
+import { parseTime } from '@/utils/ruoyi'
const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100
export default {
@@ -172,26 +178,31 @@ export default {
},
data() {
return {
+ topData: {
+ num1: [0, 0, 0, 0],
+ num2: [0, 0, 0, 0],
+ num3: [0, 0, 0, 0]
+ },
title: [
+ '原料库入库数量:',
'原料库出库数量:',
- '辅料库出库数量:',
- '半成品入库数量:',
- '辅料库出库数量:',
'半成品入库数量:',
+ ' ',
+ ' ',
'库存占比'
],
titlePosition: [
{
top: 11.5,
- left: 3.5
+ left: 7.5
},
{
top: 11.5,
- left: 22.5
+ left: 40.3
},
{
top: 11.5,
- left: 41.3
+ left: 72.8
},
{
top: 11.5,
@@ -214,341 +225,14 @@ export default {
openWatch: true, // 开启数据实时监控刷新dom
singleHeight: 0, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
- waitTime: 0,
+ waitTime: 0
},
- scrollTableData: Array(100).fill('').map(function (i, k) {
- return {
- value1: k + 1,
- value2: '出库',
- value3: '物料1',
- value4: '000' + k,
- value5: '2024.03.04',
- }
- }),
+ scrollTableData: [],
+ scrollTableData1: []
}
},
mounted() {
- this.$refs.chart1.setData({
- title: {
- text: '原料库存占比',
- style: {
- color: '#fff'
- }
- },
- credits: {
- enabled: false
- },
- chart: {
- type: 'pie',
- 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 + '
' + this.point.options.h + '%'
- }
- },
- showInLegend: false,
- point: {
- events: {
- legendItemClick: function(e) {
- return false // 直接 return false 即可禁用图例点击事件
- }
- }
- }
- }
- },
- series: [
- {
- type: 'pie',
- name: 'Browser share',
- data: [
- {
- 'name': '材料1',
- y: 30.0,
- h: 30.0
- },
- {
- name: '材料2',
- y: 26.8,
- h: 26.8
- },
- {
- 'name': '材料3',
- y: 15,
- h: 15
- },
- {
- name: '材料4',
- y: 12.8,
- h: 12.8
- },
- {
- 'name': '材料5',
- y: 8.5,
- h: 8.5
- },
- {
- 'name': '材料6',
- y: 6.2,
- h: 6.2
- },
- {
- 'name': '材料7',
- y: 0.7,
- h: 0.7
- }
- ].sort((a, b) => a.y - b.y)
- }]
- })
- 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 + '
' + this.point.options.h + '%'
- }
- },
- showInLegend: false,
- point: {
- events: {
- legendItemClick: function(e) {
- return false // 直接 return false 即可禁用图例点击事件
- }
- }
- }
- }
- },
- series: [
- {
- type: 'pie',
- name: 'Browser share',
- data: [
- {
- 'name': '材料1',
- y: 30.0,
- h: 30.0
- },
- {
- name: '材料2',
- y: 26.8,
- h: 26.8
- },
- {
- 'name': '材料3',
- y: 15,
- h: 15
- },
- {
- name: '材料4',
- y: 12.8,
- h: 12.8
- },
- {
- 'name': '材料5',
- y: 8.5,
- h: 8.5
- },
- {
- 'name': '材料6',
- y: 6.2,
- h: 6.2
- },
- {
- 'name': '材料7',
- y: 0.7,
- h: 0.7
- }
- ].sort((a, b) => a.y - b.y)
- }]
- })
- this.$refs.chart3.setData({
- tooltip: {
- trigger: "axis",
- axisPointer: {
- // 坐标轴指示器,坐标轴触发有效
- type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
- },
- },
- grid: {
- left: "2%",
- right: "4%",
- bottom: "14%",
- top: "16%",
- containLabel: true,
- },
- legend: {
- x: 'center',
- top: 12,
- textStyle: {
- color: "#fff",
- },
- itemWidth: 12,
- itemHeight: 10,
- // itemGap: 35
- },
- xAxis: {
- type: "category",
- data: ["01-01", "01-02", "01-03", "01-04", "01-05", "01-06", "01-07"],
- axisLine: {
- lineStyle: {
- color: "white",
- },
- },
- axisLabel: {
- // interval: 0,
- // rotate: 40,
- textStyle: {
- fontFamily: "Microsoft YaHei",
- },
- },
- },
-
- yAxis: {
- type: "value",
- max: "1200",
- axisLine: {
- show: false,
- lineStyle: {
- color: "white",
- },
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: "rgba(255,255,255,0.3)",
- },
- },
- axisLabel: {},
- },
- series: [
- {
- name: "入库",
- type: "bar",
- barWidth: "15%",
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: "#fccb05",
- },
- {
- offset: 1,
- color: "#f5804d",
- },
- ]),
- },
- },
- data: [400, 400, 300, 300, 300, 400, 400, 400, 300],
- },
- {
- name: "出库",
- type: "bar",
- barWidth: "15%",
- itemStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
- {
- offset: 0,
- color: "#8bd46e",
- },
- {
- offset: 1,
- color: "#09bcb7",
- },
- ]),
- },
- },
- data: [400, 500, 500, 500, 500, 400, 400, 500, 500],
- },
- ],
- })
+ this.getData()
window.onresize = () => {
this.$refs.chart1.resize()
@@ -556,7 +240,320 @@ export default {
this.$refs.chart3.resize()
}
},
- methods: {}
+ 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))
+ }
+ this.$refs.chart1.setData({
+ title: {
+ text: '原料库存占比',
+ style: {
+ color: '#fff'
+ }
+ },
+ credits: {
+ enabled: false
+ },
+ chart: {
+ type: 'pie',
+ 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 + '
' + this.point.options.h + '%'
+ }
+ },
+ showInLegend: false,
+ point: {
+ events: {
+ legendItemClick: function(e) {
+ return false // 直接 return false 即可禁用图例点击事件
+ }
+ }
+ }
+ }
+ },
+ series: [
+ {
+ type: 'pie',
+ name: '占比',
+ data: [
+ {
+ 'name': '已使用',
+ y: num2_1,
+ h: Math.min(num2_1, 50)
+ },
+ {
+ name: '未使用',
+ y: num3_1,
+ h: Math.min(num3_1, 50)
+ }
+ ].sort((a, b) => a.y - b.y)
+ }]
+ })
+ 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 + '
' + 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.$refs.chart3.setData({
+ tooltip: {
+ trigger: 'axis',
+ axisPointer: {
+ // 坐标轴指示器,坐标轴触发有效
+ type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
+ }
+ },
+ grid: {
+ left: '2%',
+ right: '4%',
+ bottom: '14%',
+ top: '16%',
+ containLabel: true
+ },
+ legend: {
+ x: 'center',
+ top: 12,
+ textStyle: {
+ color: '#fff'
+ },
+ itemWidth: 12,
+ itemHeight: 10
+ // itemGap: 35
+ },
+ xAxis: {
+ type: 'category',
+ data: e.data.map(v => parseTime(v.day, '{m}-{d}')),
+ axisLine: {
+ lineStyle: {
+ color: 'white'
+ }
+ },
+ axisLabel: {
+ // interval: 0,
+ // rotate: 40,
+ textStyle: {
+ fontFamily: 'Microsoft YaHei'
+ }
+ }
+ },
+
+ yAxis: {
+ type: 'value',
+ axisLine: {
+ show: false,
+ lineStyle: {
+ color: 'white'
+ }
+ },
+ splitLine: {
+ show: true,
+ lineStyle: {
+ color: 'rgba(255,255,255,0.3)'
+ }
+ },
+ axisLabel: {}
+ },
+ series: [
+ {
+ name: '入库',
+ type: 'bar',
+ barWidth: '15%',
+ itemStyle: {
+ normal: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ {
+ offset: 0,
+ color: '#fccb05'
+ },
+ {
+ offset: 1,
+ color: '#f5804d'
+ }
+ ])
+ }
+ },
+ data: e.data.map(v => v.instockAmount)
+ },
+ {
+ name: '出库',
+ type: 'bar',
+ barWidth: '15%',
+ itemStyle: {
+ normal: {
+ color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+ {
+ offset: 0,
+ color: '#8bd46e'
+ },
+ {
+ offset: 1,
+ color: '#09bcb7'
+ }
+ ])
+ }
+ },
+ data: e.data.map(v => v.outStockAmount)
+ }
+ ]
+ })
+ })
+ }
+ }
}
diff --git a/hw-ui/src/views/board/warehouse/secondFloor.vue b/hw-ui/src/views/board/warehouse/secondFloor.vue
index d430afd0..ca481462 100644
--- a/hw-ui/src/views/board/warehouse/secondFloor.vue
+++ b/hw-ui/src/views/board/warehouse/secondFloor.vue
@@ -3,25 +3,20 @@
京源智能仓储监控平台
+ class="title"
+ >
{{ i }}