refactor: 移除调试日志并优化仓库相关字段命名
移除category.js中的console.log调试语句并优化bomId检查逻辑 将warehouse相关字段统一改为actualWarehouse前缀以保持一致性
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user