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) {
|
if (!itemType || !itemId) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
console.log('itemType', itemType, 'itemId', itemId)
|
|
||||||
let map = {}
|
let map = {}
|
||||||
if (itemType === 'product') {
|
if (itemType === 'product') {
|
||||||
map = state.productMap;
|
map = state.productMap;
|
||||||
@@ -107,13 +106,14 @@ export function findItemWithBom(itemType, itemId) {
|
|||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
console.log('map', map)
|
|
||||||
const item = map[itemId];
|
const item = map[itemId];
|
||||||
const bomId = item.bomId
|
|
||||||
if (!item) {
|
if (!item) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
console.log('bomId', bomId, item)
|
const bomId = item.bomId
|
||||||
|
if (!bomId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
const bomItems = state.bomMap[bomId];
|
const bomItems = state.bomMap[bomId];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
v-if="refreshTable"
|
v-if="refreshTable"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="warehouseList"
|
:data="warehouseList"
|
||||||
row-key="warehouseId"
|
row-key="actualWarehouseId"
|
||||||
:default-expand-all="isExpandAll"
|
:default-expand-all="isExpandAll"
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
>
|
>
|
||||||
@@ -239,8 +239,8 @@ export default {
|
|||||||
delete node.children;
|
delete node.children;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
id: node.warehouseId,
|
id: node.actualWarehouseId,
|
||||||
label: node.warehouseName,
|
label: node.actualWarehouseName,
|
||||||
children: node.children
|
children: node.children
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -248,8 +248,8 @@ export default {
|
|||||||
getTreeselect() {
|
getTreeselect() {
|
||||||
listActualWarehouse().then(response => {
|
listActualWarehouse().then(response => {
|
||||||
this.warehouseOptions = [];
|
this.warehouseOptions = [];
|
||||||
const data = { warehouseId: 0, warehouseName: '顶级节点', children: [] };
|
const data = { actualWarehouseId: 0, actualWarehouseName: '顶级节点', children: [] };
|
||||||
data.children = this.handleTree(response.data, "warehouseId", "parentId");
|
data.children = this.handleTree(response.data, "actualWarehouseId", "parentId");
|
||||||
this.warehouseOptions.push(data);
|
this.warehouseOptions.push(data);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -261,7 +261,7 @@ export default {
|
|||||||
// 表单重置
|
// 表单重置
|
||||||
reset() {
|
reset() {
|
||||||
this.form = {
|
this.form = {
|
||||||
warehouseId: null,
|
actualWarehouseId: null,
|
||||||
parentId: null,
|
parentId: null,
|
||||||
actualWarehouseCode: null,
|
actualWarehouseCode: null,
|
||||||
actualWarehouseName: null,
|
actualWarehouseName: null,
|
||||||
@@ -290,8 +290,8 @@ export default {
|
|||||||
handleAdd(row) {
|
handleAdd(row) {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
if (row != null && row.warehouseId) {
|
if (row != null && row.actualWarehouseId) {
|
||||||
this.form.parentId = row.warehouseId;
|
this.form.parentId = row.actualWarehouseId;
|
||||||
} else {
|
} else {
|
||||||
this.form.parentId = 0;
|
this.form.parentId = 0;
|
||||||
}
|
}
|
||||||
@@ -312,9 +312,9 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
this.getTreeselect();
|
this.getTreeselect();
|
||||||
if (row != null) {
|
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.loading = false;
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user