fix: 修复产品选择组件和原材料选择组件的数据验证问题

修复产品选择和原材料选择组件中当返回数据为空时仍尝试添加的问题,增加对res.data的验证
调整发货计划列表和运单页面的样式,优化高度计算和表单内边距
This commit is contained in:
砂糖
2026-04-08 13:50:49 +08:00
parent c68a4573dc
commit 6b0fa81224
4 changed files with 4 additions and 4 deletions

View File

@@ -275,7 +275,7 @@ export default {
// 选中项不在列表则追加,保证选中高亮
if (this.selectedId && !this.productList.some(item => item.productId === this.selectedId)) {
const res = await getProduct(this.selectedId);
res.code === 200 && this.productList.push(res.data);
res.code === 200 && res.data && this.productList.push(res.data);
}
}
} catch (error) {

View File

@@ -360,7 +360,7 @@ export default {
// 选中的项不在列表中则追加进去,保证选中高亮
if (this.selectedId && !this.rawMaterialList.some(item => item.rawMaterialId === this.selectedId)) {
const res = await getRawMaterial(this.selectedId);
res.code === 200 && this.rawMaterialList.push(res.data);
res.code === 200 && res.data && this.rawMaterialList.push(res.data);
}
}
} catch (error) {

View File

@@ -17,7 +17,7 @@
:props="planTreeProps"
@node-click="handlePlanSelect"
default-expand-all
style="margin-top: 10px; height: 800px; overflow: auto;"
style="margin-top: 10px; height: calc(100vh - 220px); overflow: auto;"
>
<template slot-scope="{ node, data }">
<span

View File

@@ -26,7 +26,7 @@
<el-empty description="请先选择发货计划" />
</div>
<div v-else>
<el-form style="position: sticky; left: 0; top: 0;" :model="queryParams" ref="queryForm" size="small"
<el-form style="position: sticky; left: 0; top: 0; padding: 10px;" :model="queryParams" ref="queryForm" size="small"
:inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="发货单名称" prop="waybillName">
<el-input v-model="queryParams.waybillName" placeholder="请输入发货单名称" clearable