feat(kpi): 调整库位分析与计划功能以支持按层数筛选
- 修改库位平面图查询逻辑,将巷道+排号筛选改为层数筛选 - 更新后端接口getPlatoons和getChartData,参数从roadwayId改为theFloor - 新增getFloors接口用于获取指定仓库的楼层数据 - 前端页面替换巷道/排号选择器为层数选择器 - 优化图表标题和提示信息显示逻辑,适配新的筛选方式 - 修复部分坐标轴标签生成逻辑,确保正确展示行列信息 - 调整物料编码字段宽度,改善表格布局 - 注释掉空间分析页面中的巷道筛选项 - 修正产品导入时字段映射错误的问题
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 巷道 -->
|
||||
<el-form-item label="巷道" prop="roadwayId">
|
||||
<!-- <el-form-item label="巷道" prop="roadwayId">
|
||||
<el-select v-model="queryParams.roadwayId" placeholder="请选择巷道" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="item in roadwayOptions"
|
||||
@@ -22,7 +22,7 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
<el-form-item>
|
||||
<!-- 【搜索】按钮 -->
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
|
||||
@@ -13,18 +13,18 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 巷道 -->
|
||||
<el-form-item label="巷道">
|
||||
<el-select v-model="queryParams.roadwayId" style="width: 150px" @change="handleRoadwayChange">
|
||||
<el-option v-for="item in roadwayOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
<!-- 层数 -->
|
||||
<el-form-item label="层数">
|
||||
<el-select v-model="queryParams.theFloor" style="width: 150px" @change="handleFloorChange">
|
||||
<el-option v-for="item in floorOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 排 -->
|
||||
<el-form-item label="排">
|
||||
<!-- <el-form-item label="排">
|
||||
<el-select v-model="queryParams.thePlatoon" style="width: 150px" @change="handlePlatoonChange">
|
||||
<el-option v-for="item in platoonOptions" :key="item.value" :label="item.label" :value="item.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts'
|
||||
import {getRoadways, getPlatoons, getChartData, getChartMag} from "@/api/kpi/spacePlan"
|
||||
import {getRoadways, getPlatoons, getChartData, getChartMag, getFloors} from "@/api/kpi/spacePlan"
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
import VueI18n from 'vue-i18n';
|
||||
|
||||
@@ -46,9 +46,10 @@ export default {
|
||||
return {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
warehouseId: '01',
|
||||
warehouseId: '1',
|
||||
roadwayId: '1',
|
||||
thePlatoon: '',
|
||||
theFloor: '1',
|
||||
platoon: '1',
|
||||
specifications: '',
|
||||
quantity_x: '',
|
||||
@@ -65,6 +66,7 @@ export default {
|
||||
warehouseOptions: [],
|
||||
// 巷道选项
|
||||
roadwayOptions: [],
|
||||
floorOptions: [],
|
||||
// 排号选项
|
||||
platoonOptions: [],
|
||||
// 图表实例
|
||||
@@ -116,34 +118,28 @@ this.getWarehouseList()
|
||||
// 重置巷道和排号
|
||||
this.queryParams.roadwayId = ''
|
||||
this.queryParams.thePlatoon = ''
|
||||
this.roadwayOptions = []
|
||||
this.floorOptions = []
|
||||
this.platoonOptions = []
|
||||
// 获取巷道列表
|
||||
getRoadways(this.queryParams).then(response => {
|
||||
const roadways = response.data.data
|
||||
if (roadways && roadways.length > 0) {
|
||||
this.roadwayOptions = roadways
|
||||
this.queryParams.roadwayId = roadways[0].value
|
||||
this.handleRoadwayChange()
|
||||
// 获取层数列表
|
||||
getFloors({ warehouseId: this.queryParams.warehouseId }).then(response => {
|
||||
const floors = response.data.data || []
|
||||
if (floors && floors.length > 0) {
|
||||
this.floorOptions = floors.map(f => {
|
||||
const lbl = f.label != null ? f.label : (f.name != null ? f.name : (f.title != null ? f.title : (f.value != null ? (String(f.value) + '排') : '')))
|
||||
const val = f.value != null ? String(f.value) : String((lbl || '').replace(/[^\d]/g, ''))
|
||||
return { label: lbl, value: val }
|
||||
})
|
||||
this.queryParams.theFloor = this.floorOptions[0].value
|
||||
this.loadChartData()
|
||||
} else {
|
||||
this.floorOptions = []
|
||||
this.queryParams.theFloor = null
|
||||
}
|
||||
})
|
||||
},
|
||||
// 巷道变化处理
|
||||
handleRoadwayChange() {
|
||||
// 重置排号
|
||||
this.queryParams.thePlatoon = ''
|
||||
this.platoonOptions = []
|
||||
// 获取排号列表
|
||||
getPlatoons(this.queryParams).then(response => {
|
||||
const platoons = response.data.data
|
||||
if (platoons && platoons.length > 0) {
|
||||
this.platoonOptions = platoons
|
||||
this.queryParams.thePlatoon = platoons[0].value
|
||||
this.loadChartData()
|
||||
}
|
||||
})
|
||||
},
|
||||
handlePlatoonChange() {
|
||||
handleFloorChange() {
|
||||
console.log( this.queryParams.theFloor)
|
||||
this.loadChartData()
|
||||
},
|
||||
// 加载普通仓库图表数据
|
||||
@@ -178,10 +174,11 @@ this.getWarehouseList()
|
||||
}
|
||||
},
|
||||
title: {
|
||||
// 标题:库位分布平面图
|
||||
text: '库位分布平面图',
|
||||
// 子标题:排
|
||||
subtext: this.queryParams.thePlatoon + '排'
|
||||
subtext: (() => {
|
||||
const sel = this.floorOptions.find(o => String(o.value) === String(this.queryParams.theFloor))
|
||||
return sel && sel.label ? sel.label : ''
|
||||
})()
|
||||
},
|
||||
grid: {
|
||||
width: '90%',
|
||||
@@ -327,35 +324,39 @@ this.getWarehouseList()
|
||||
if (params.seriesName !== '满位') {
|
||||
// 排
|
||||
if (this.$i18n.locale ==='zh-cn') {
|
||||
return params.seriesName + '<br>排' + this.queryParams.thePlatoon + '列' + (params.data[0] + 1) + '层' + (params.data[1] + 1);
|
||||
return params.seriesName + '<br>' + (params.data[1] + 1) + '排' + (params.data[0] + 1) + '列' + this.queryParams.theFloor+ '层';
|
||||
}
|
||||
else{
|
||||
return params.seriesName + '<br>' + this.queryParams.thePlatoon + '排 ' + (params.data[0] + 1) + '列 ' + (params.data[1] + 1) + '层';
|
||||
return params.seriesName + '<br>' + (params.data[1] + 1) + '排' + (params.data[0] + 1) + '列' + this.queryParams.theFloor+ '层';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const returnData = {
|
||||
"thePlatoon": this.queryParams.thePlatoon,
|
||||
"thePlatoon": params.data[1] + 1,
|
||||
"theColumn": params.data[0] + 1,
|
||||
"theFloor": params.data[1] + 1,
|
||||
"theFloor": this.queryParams.theFloor,
|
||||
"warehouseId": this.queryParams.warehouseId
|
||||
};
|
||||
|
||||
|
||||
// 生成唯一标识
|
||||
const key = `${params.seriesName}-${params.data[0]}-${params.data[1]}`;
|
||||
|
||||
// 如果已经在加载中,返回基本信息
|
||||
if (this.loadingKeys && this.loadingKeys[key]) {
|
||||
if (this.$i18n.locale === 'zh-cn') {
|
||||
return `${params.seriesName}<br>${this.queryParams.thePlatoon}排${params.data[0] + 1}列${params.data[1] + 1}层<br>加载中...`;
|
||||
return params.seriesName + '<br>' + (params.data[1] + 1) + '排' + (params.data[0] + 1) + '列' + this.queryParams.theFloor + '层';
|
||||
|
||||
} else {
|
||||
return `${params.seriesName}<br>${this.queryParams.thePlatoon}排 ${params.data[0] + 1}列 ${params.data[1] + 1}层<br>加载中...`;
|
||||
return params.seriesName + '<br>' + (params.data[1] + 1) + '排' + (params.data[0] + 1) + '列' + this.queryParams.theFloor+ '层';
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// 返回基本信息
|
||||
const baseStr = `${params.seriesName}<br>${this.queryParams.thePlatoon}排${params.data[0] + 1}列${params.data[1] + 1}层`;
|
||||
const baseStr = `${params.seriesName}<br>${(params.data[1] + 1)}排${params.data[0] + 1}列${this.queryParams.theFloor}层`;
|
||||
|
||||
// 设置加载状态
|
||||
if (!this.loadingKeys) this.loadingKeys = {};
|
||||
@@ -417,4 +418,3 @@ this.getWarehouseList()
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user