From 2e33eafd33dc6e415f724f60c6b86d27af739cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Fri, 7 Nov 2025 14:35:51 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E6=97=A5=E5=BF=97=E5=B9=B6=E4=BC=98=E5=8C=96=E4=BB=93?= =?UTF-8?q?=E5=BA=93=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除category.js中的console.log调试语句并优化bomId检查逻辑 将warehouse相关字段统一改为actualWarehouse前缀以保持一致性 --- klp-ui/src/store/modules/category.js | 8 ++++---- klp-ui/src/views/wms/warehouse/real.vue | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/klp-ui/src/store/modules/category.js b/klp-ui/src/store/modules/category.js index 9cb17a74..f7a0cdfa 100644 --- a/klp-ui/src/store/modules/category.js +++ b/klp-ui/src/store/modules/category.js @@ -98,7 +98,6 @@ export function findItemWithBom(itemType, itemId) { if (!itemType || !itemId) { return null; } - console.log('itemType', itemType, 'itemId', itemId) let map = {} if (itemType === 'product') { map = state.productMap; @@ -107,13 +106,14 @@ export function findItemWithBom(itemType, itemId) { } else { return null; } - console.log('map', map) const item = map[itemId]; - const bomId = item.bomId if (!item) { return null; } - console.log('bomId', bomId, item) + const bomId = item.bomId + if (!bomId) { + return null; + } const bomItems = state.bomMap[bomId]; return { diff --git a/klp-ui/src/views/wms/warehouse/real.vue b/klp-ui/src/views/wms/warehouse/real.vue index 938f816a..a059a5a7 100644 --- a/klp-ui/src/views/wms/warehouse/real.vue +++ b/klp-ui/src/views/wms/warehouse/real.vue @@ -65,7 +65,7 @@ v-if="refreshTable" v-loading="loading" :data="warehouseList" - row-key="warehouseId" + row-key="actualWarehouseId" :default-expand-all="isExpandAll" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" > @@ -239,8 +239,8 @@ export default { delete node.children; } return { - id: node.warehouseId, - label: node.warehouseName, + id: node.actualWarehouseId, + label: node.actualWarehouseName, children: node.children }; }, @@ -248,8 +248,8 @@ export default { getTreeselect() { listActualWarehouse().then(response => { this.warehouseOptions = []; - const data = { warehouseId: 0, warehouseName: '顶级节点', children: [] }; - data.children = this.handleTree(response.data, "warehouseId", "parentId"); + const data = { actualWarehouseId: 0, actualWarehouseName: '顶级节点', children: [] }; + data.children = this.handleTree(response.data, "actualWarehouseId", "parentId"); this.warehouseOptions.push(data); }); }, @@ -261,7 +261,7 @@ export default { // 表单重置 reset() { this.form = { - warehouseId: null, + actualWarehouseId: null, parentId: null, actualWarehouseCode: null, actualWarehouseName: null, @@ -290,8 +290,8 @@ export default { handleAdd(row) { this.reset(); this.getTreeselect(); - if (row != null && row.warehouseId) { - this.form.parentId = row.warehouseId; + if (row != null && row.actualWarehouseId) { + this.form.parentId = row.actualWarehouseId; } else { this.form.parentId = 0; } @@ -312,9 +312,9 @@ export default { this.reset(); this.getTreeselect(); if (row != null) { - this.form.parentId = row.warehouseId; + this.form.parentId = row.actualWarehouseId; } - getActualWarehouse(row.warehouseId).then(response => { + getActualWarehouse(row.actualWarehouseId).then(response => { this.loading = false; this.form = response.data; this.open = true;