refactor(wms/report): 重构报表模块数据获取逻辑,提取公共方法到fetch.js

feat(wms/report): 新增报表结果存储页面,支持JSON数据横向对比

style(wms/coil/do): 调整钢卷修正页面样式和代码格式

fix(wms/coil/do): 修复操作记录查询参数传递问题,优化钢卷选择逻辑
This commit is contained in:
砂糖
2026-03-27 16:37:59 +08:00
parent c294149274
commit cd00b9562d
7 changed files with 448 additions and 313 deletions

View File

@@ -40,7 +40,7 @@
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item prop="endTime">
<el-button type="primary" @click="getList">查询</el-button>
<el-button type="primary" @click="handleQuery">查询</el-button>
<el-button type="primary" @click="exportData">导出</el-button>
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
</el-form-item>
@@ -76,6 +76,8 @@ import MutiSelect from "@/components/MutiSelect";
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
import { fetchOutputList } from "@/views/wms/report/js/fetch";
export default {
name: 'OutTemplate',
@@ -160,7 +162,7 @@ export default {
handler(newVal, oldVal) {
if (newVal !== oldVal) {
this.warehouseIds = newVal.map(item => item.value)
this.getList()
this.handleQuery()
}
},
immediate: true,
@@ -186,40 +188,13 @@ export default {
},
// 统一查询入口
handleQuery() {
this.getList()
},
getList() {
this.loading = true
Promise.all([
listCoilWithIds({
selectType: 'raw_material',
itemType: 'raw_material',
warehouseIds: this.warehouseIds.join(','),
...this.queryParams,
...this.baseQueryParams,
}),
listCoilWithIds({
selectType: 'product',
itemType: 'product',
warehouseIds: this.warehouseIds.join(','),
...this.queryParams,
...this.baseQueryParams,
}),
]).then((resList) => {
console.log(resList)
const list = resList.flatMap(res => res.rows)
// 按照createTime 降序排序
this.list = list.sort(
(a, b) => new Date(b.createTime) - new Date(a.createTime)
).map(item => {
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
const [thickness, width] = item.specification.split('*')
return {
...item,
computedThickness: parseFloat(thickness),
computedWidth: parseFloat(width),
}
})
fetchOutputList({
...this.queryParams,
...this.baseQueryParams,
warehouseIds: this.warehouseIds.join(','),
}).then((resList) => {
this.list = resList
this.loading = false
})
},
@@ -231,7 +206,7 @@ export default {
},
},
mounted() {
this.getList()
this.handleQuery()
this.loadColumns()
}
}