fix: 修复规格分割可能导致的undefined错误
处理多处规格(specification)分割时的空值情况,添加可选链操作符和默认值 修改wms报表合并查询参数,清空时间条件 调整acid页面容器样式
This commit is contained in:
@@ -251,8 +251,8 @@ export default {
|
||||
}
|
||||
|
||||
const [lossRes, outRes] = await Promise.all([
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: lossIds.join(',') || '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: lossIds.join(',') || '', startTime: '', endTime: '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '' }),
|
||||
]);
|
||||
this.lossList = lossRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
});
|
||||
this.outList = outRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
@@ -253,12 +253,12 @@ export default {
|
||||
}
|
||||
|
||||
const [lossRes, outRes] = await Promise.all([
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: lossIds.join(',') || '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: lossIds.join(',') || '', startTime: '', endTime: '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '', startTime: '', endTime: '' }),
|
||||
]);
|
||||
this.lossList = lossRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || []
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
|
||||
Reference in New Issue
Block a user