Commit 7b04bbd8 by wangzhihui

```

fix(packageManage): 优化库存管控类型显示文本并修复数据访问问题

- 将库存管控类型的显示文本从"实物管控/虚拟管控"简化为"实物/虚拟"
- 移除不必要的isHide条件判断逻辑
- 修复formData中groundingGoodsList的数据访问问题,添加可选链操作符
- 修复merchantGoodsMap中的数据访问问题,统一使用可选链操作符确保
  数据安全性
```
1 parent 6c428d08
...@@ -55,8 +55,8 @@ ...@@ -55,8 +55,8 @@
width="120"> width="120">
<template #default="scope"> <template #default="scope">
<el-select v-model="scope.row.inventoryType" size="small"> <el-select v-model="scope.row.inventoryType" size="small">
<el-option label="实物管控" :value="2"></el-option> <el-option label="实物" :value="2"></el-option>
<el-option label="虚拟管控" :value="1"></el-option> <el-option label="虚拟" :value="1"></el-option>
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
...@@ -150,9 +150,6 @@ export default { ...@@ -150,9 +150,6 @@ export default {
}, },
methods: { methods: {
getIndex(index) { getIndex(index) {
if (!this.isHide) {
return index + 1;
}
// 当有合并单元格时,计算当前行在 spanArr 中是第几个非0项,从而得出正确的顺序序号 // 当有合并单元格时,计算当前行在 spanArr 中是第几个非0项,从而得出正确的顺序序号
let count = 0; let count = 0;
for (let i = 0; i <= index; i++) { for (let i = 0; i <= index; i++) {
......
...@@ -654,9 +654,10 @@ export default { ...@@ -654,9 +654,10 @@ export default {
} }
let _formData = []; let _formData = [];
this.formData.groundingGoodsList.forEach((item) => { this.formData.groundingGoodsList.forEach((item) => {
_formData.push({ _formData.push({
merchantGoodsId: item.id || item.upgradeGoods.id, merchantGoodsId: item?.id || item?.upgradeGoods?.id,
upgradeGoodsName: item.upgradeGoods?.upgradeGoodsName, upgradeGoodsName: item.upgradeGoods?.upgradeGoodsName,
inventoryType: item.inventoryType || 2, inventoryType: item.inventoryType || 2,
}); });
...@@ -957,9 +958,9 @@ export default { ...@@ -957,9 +958,9 @@ export default {
}; };
} }
merchantGoodsMap[item.merchantId].inventoryTypeRefList.push({ merchantGoodsMap[item.merchantId].inventoryTypeRefList.push({
merchantGoodsId: item.merchantGoodsId || item.upgradeGoods.id, merchantGoodsId: item?.merchantGoodsId || item?.upgradeGoods?.id,
merchantId: item.merchantId, merchantId: item?.merchantId,
merchantName: item.merchantName, merchantName: item?.merchantName,
inventoryType: item.inventoryType, inventoryType: item.inventoryType,
}); });
}); });
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!