This commit is contained in:
猫猫guowen
2025-12-29 16:35:26 +08:00
parent bec185c139
commit dc8f2d329a
8 changed files with 379 additions and 284 deletions

View File

@@ -1,20 +1,21 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true">
<!-- <el-form-item label="仓库" prop="warehouseId"> &lt;!&ndash; 仓库 &ndash;&gt;-->
<!-- <el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable> &lt;!&ndash; 请选择仓库 &ndash;&gt;-->
<!-- <el-option-->
<!-- v-for="item in warehouseOptions"-->
<!-- :key="item.warehouseId"-->
<!-- :label="item.warehouseName"-->
<!-- :value="item.warehouseId"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="仓库" prop="warehouseId"> &lt;!&ndash; 仓库 &ndash;&gt;-->
<!-- <el-select v-model="queryParams.warehouseId" placeholder="请选择仓库" clearable> &lt;!&ndash; 请选择仓库 &ndash;&gt;-->
<!-- <el-option-->
<!-- v-for="item in warehouseOptions"-->
<!-- :key="item.warehouseId"-->
<!-- :label="item.warehouseName"-->
<!-- :value="item.warehouseId"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="时间范围" prop="dateRange"> <!-- 时间范围 -->
<el-date-picker
v-model="dateRange"
type="daterange"
unlink-panels
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
@@ -46,7 +47,7 @@ export default {
return {
// 查询参数
queryParams: {
warehouseId: undefined,
warehouseId: null,
startTime: '',
endTime: '',
inOut:'1'
@@ -67,7 +68,7 @@ export default {
queryWarehouseParam:{
pageNum: 1,
pageSize: 99,
typeData:[1,2]
typeData:[1]
}
}
},
@@ -115,56 +116,63 @@ export default {
},
/** 更新图表数据 */
updateChart() {
const option = {
title: {
text: '入库数量统计' // 入库数量统计(按巷道)
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
legend: {
data: this.chartData.series.map(item => item.name),
top: 25
},
grid: {
top: 80,
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: this.chartData.xAxis,
axisLabel: {
rotate: 0
}
},
yAxis: {
type: 'value',
name: '入库数量', // 入库数量
minInterval: 1
},
series: this.chartData.series.map((item, index) => ({
name: item.name,
type: 'line',
data: item.data,
smooth: true,
symbol: 'circle',
symbolSize: 6,
itemStyle: {
color: this.chartColors[index % this.chartColors.length]
// 在调用setOption前检查chart实例是否存在
if (this.chart && typeof this.chart.setOption === 'function') {
const option = {
title: {
text: '入库数量统计' // 入库数量统计(按巷道)
},
lineStyle: {
width: 2
}
}))
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
legend: {
data: this.chartData.series.map(item => item.name),
top: 25
},
grid: {
top: 80,
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: this.chartData.xAxis,
axisLabel: {
rotate: 0
}
},
yAxis: {
type: 'value',
name: '入库数量', // 入库数量
minInterval: 1
},
series: this.chartData.series.map((item, index) => ({
name: item.name,
type: 'line',
data: item.data,
smooth: true,
symbol: 'circle',
symbolSize: 6,
itemStyle: {
color: this.chartColors[index % this.chartColors.length]
},
lineStyle: {
width: 2
}
}))
}
this.chart.setOption(option, true)
} else {
console.warn('Chart instance is not ready yet');
}
this.chart.setOption(option, true)
},
/** 处理日期范围变化 */
handleDateRangeChange(val) {