feat(wms): 新增报表导出文件管理功能
新增报表导出文件管理模块,包含后端接口和前端页面 在各类报表页面添加保存报表功能 优化CoilSelector和CoilCard组件显示 调整分页大小和表格高度 统一各产线报表配置 修复文件预览组件高度问题
This commit is contained in:
@@ -49,6 +49,7 @@
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
<el-button type="primary" @click="saveReport">保存报表</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -86,6 +87,8 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
import { saveReportFile } from "@/views/wms/report/js/reportFile";
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -158,6 +161,9 @@ export default {
|
||||
totalWeight: totalWeight.toFixed(2),
|
||||
avgWeight,
|
||||
}
|
||||
},
|
||||
coilIds() {
|
||||
return this.list.map(item => item.coilId).join(',')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -202,14 +208,14 @@ export default {
|
||||
coilIds: coilIds,
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
})
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
})
|
||||
})
|
||||
@@ -217,9 +223,28 @@ export default {
|
||||
// 导出
|
||||
exportData() {
|
||||
this.download('wms/materialCoil/export', {
|
||||
coilIds: this.list.map(item => item.coilId).join(',')
|
||||
coilIds: this.coilIds,
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
saveReport() {
|
||||
this.loading = true
|
||||
saveReportFile(this.coilIds, {
|
||||
reportParams: this.queryParams,
|
||||
reportType: '收货报表',
|
||||
}).then(res => {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success',
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message({
|
||||
message: '保存失败',
|
||||
type: 'error',
|
||||
})
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
|
||||
Reference in New Issue
Block a user