feat(wms): 新增报表导出文件管理功能

新增报表导出文件管理模块,包含后端接口和前端页面
在各类报表页面添加保存报表功能
优化CoilSelector和CoilCard组件显示
调整分页大小和表格高度
统一各产线报表配置
修复文件预览组件高度问题
This commit is contained in:
砂糖
2026-04-11 15:36:50 +08:00
parent 848ad2c3cd
commit 3020a4244d
78 changed files with 1697 additions and 160 deletions

View File

@@ -40,6 +40,8 @@
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
<el-button type="primary" @click="saveOutputReport">保存产出报表</el-button>
<el-button type="primary" @click="saveLossReport">保存消耗报表</el-button>
</el-form-item>
</el-form>
</el-row>
@@ -130,6 +132,7 @@ import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
import { fetchLossList, fetchOutputList } from "@/views/wms/report/js/fetch";
import { saveReportFile } from "@/views/wms/report/js/reportFile";
export default {
name: 'YearTemplate',
@@ -159,7 +162,11 @@ export default {
warehouseOptions: {
type: Array,
default: () => []
}
},
productionLine: {
type: String,
default: '',
},
},
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
data() {
@@ -303,6 +310,48 @@ export default {
actionIds: this.actionIds
}, `materialCoil_${this.queryParams.date}_${new Date().getTime()}.xlsx`)
},
// 保存产出报表
saveOutputReport() {
this.loading = true
saveReportFile(this.list.map(item => item.coilId).join(','), {
reportParams: this.queryParams,
reportType: '产出报表,年报表',
productionLine: this.productionLine,
}).then(res => {
this.$message({
message: '保存成功',
type: 'success',
})
}).catch(err => {
this.$message({
message: '保存失败',
type: 'error',
})
}).finally(() => {
this.loading = false
})
},
// 保存消耗报表
saveLossReport() {
this.loading = true
saveReportFile(this.lossList.map(item => item.coilId).join(','), {
reportParams: this.queryParams,
reportType: '消耗报表,年报表',
productionLine: this.productionLine,
}).then(res => {
this.$message({
message: '保存成功',
type: 'success',
})
}).catch(err => {
this.$message({
message: '保存失败',
type: 'error',
})
}).finally(() => {
this.loading = false
})
},
},
mounted() {
this.handleQuery()