feat(wms): 新增分条报表配置及功能优化
- 添加分条报表相关配置及视图组件 - 优化标签打印尺寸及布局 - 增加实测厚度字段及相关展示逻辑 - 重构报表数据获取逻辑,统一处理异常情况 - 完善分条操作表单,增加异常信息管理
This commit is contained in:
@@ -130,6 +130,7 @@ import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary, calcMSummary } from "@/views/wms/report/js/calc";
|
||||
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";
|
||||
|
||||
export default {
|
||||
name: 'DayTemplate',
|
||||
@@ -255,86 +256,20 @@ export default {
|
||||
},
|
||||
// 统一查询入口(兼容回车和按钮点击)
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
// this.getLossList()
|
||||
},
|
||||
// 核心查询逻辑
|
||||
getList() {
|
||||
this.loading = true
|
||||
Promise.all([
|
||||
listCoilWithIds({
|
||||
selectType: 'raw_material',
|
||||
itemType: 'raw_material',
|
||||
warehouseIds: this.warehouseIds.join(','),
|
||||
fetchLossList(this.actionTypes, {
|
||||
...this.queryParams,
|
||||
...this.actionQueryParams
|
||||
}),
|
||||
fetchOutputList({
|
||||
...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),
|
||||
}
|
||||
})
|
||||
this.getLossList()
|
||||
})
|
||||
},
|
||||
async getLossList() {
|
||||
this.loading = true
|
||||
const resultList = await Promise.all(this.actionTypes.map(actionType => {
|
||||
return listPendingAction({
|
||||
actionStatus: 2,
|
||||
warehouseId: this.queryParams.planId,
|
||||
actionType,
|
||||
pageSize: 9999,
|
||||
pageNum: 1,
|
||||
startTime: this.queryParams.byCreateTimeStart,
|
||||
endTime: this.queryParams.byCreateTimeEnd,
|
||||
...this.actionQueryParams,
|
||||
})
|
||||
}))
|
||||
const actions = resultList.flatMap(item => item.rows)
|
||||
const coilIds = actions.map(item => item.coilId).join(',')
|
||||
console.log(coilIds)
|
||||
if (!coilIds) {
|
||||
this.$message({
|
||||
message: '暂无数据',
|
||||
type: 'warning',
|
||||
})
|
||||
this.lossList = []
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
listCoilWithIds({
|
||||
...this.queryParams,
|
||||
byCreateTimeStart: undefined,
|
||||
byCreateTimeEnd: undefined,
|
||||
coilIds: coilIds,
|
||||
}).then(res => {
|
||||
this.lossList = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
})
|
||||
]).then(([lossList, outputList]) => {
|
||||
this.lossList = lossList
|
||||
this.list = outputList
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
@@ -359,8 +294,7 @@ export default {
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
// this.getLossList()
|
||||
this.handleQuery()
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user