fix: 修复规格分割可能导致的undefined错误
处理多处规格(specification)分割时的空值情况,添加可选链操作符和默认值 修改wms报表合并查询参数,清空时间条件 调整acid页面容器样式
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="开始时间" align="center" prop="actualStartTime" width="160">
|
||||
<template slot-scope="scope">
|
||||
{{ parseTime(scope.row.actualStartTime || scope.row.planStartTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||
{{ parseTime(scope.row.actualStartTime, '{y}-{m}-{d} {h}:{i}') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束时间" align="center" prop="endTime" width="160">
|
||||
|
||||
@@ -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