feat(仓库管理): 优化仓库树组件和产品类型显示
调整仓库树组件逻辑,使用两级树结构并修改节点属性 增加产品类型列宽度以更好显示内容 修改实际仓库管理页面,允许新增顶级节点并优化表单逻辑 在库存列表中添加产品/原材料信息映射逻辑
This commit is contained in:
@@ -36,7 +36,7 @@
|
||||
<dict-tag :options="dict.type.stock_item_type" :value="scope.row.itemType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="产品类型" align="center" prop="itemName" width="220">
|
||||
<el-table-column label="产品类型" align="center" prop="itemName" width="250">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product' || scope.row.itemType == 'semi'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
@@ -231,7 +231,33 @@ export default {
|
||||
});
|
||||
} else {
|
||||
listStock(this.queryParams).then(response => {
|
||||
this.stockList = response.rows;
|
||||
this.stockList = response.rows.map(item => {
|
||||
const itemType = item.itemType
|
||||
if (itemType === 'raw_material') {
|
||||
item.rawMaterial = {
|
||||
rawMaterialId: item.itemId,
|
||||
rawMaterialName: item.itemName,
|
||||
rawMaterialCode: item.itemCode,
|
||||
specification: item.specification,
|
||||
material: item.material,
|
||||
surfaceTreatment: item.surfaceTreatment,
|
||||
zincLayer: item.zincLayer,
|
||||
manufacturer: item.manufacturer,
|
||||
}
|
||||
} else if (itemType === 'product') {
|
||||
item.product = {
|
||||
productId: item.itemId,
|
||||
productName: item.itemName,
|
||||
productCode: item.itemCode,
|
||||
specification: item.specification,
|
||||
material: item.material,
|
||||
surfaceTreatment: item.surfaceTreatment,
|
||||
zincLayer: item.zincLayer,
|
||||
manufacturer: item.manufacturer,
|
||||
}
|
||||
}
|
||||
return item
|
||||
});
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user