refactor(ui): 将BOM相关术语统一修改为参数

修改所有界面中的BOM、SKU等术语为"参数",包括标签、提示信息、表格列名等。涉及多个组件和视图文件,确保术语一致性。
This commit is contained in:
砂糖
2025-11-13 13:29:19 +08:00
parent 6bde071842
commit 754d6d762a
37 changed files with 812 additions and 124 deletions

View File

@@ -73,7 +73,7 @@
@pagination="getList"
/>
<!-- 添加或修改BOM 明细存放属性值对话框 -->
<!-- 添加或修改参数 明细存放属性值对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="属性名称" prop="attrKey">
@@ -119,7 +119,7 @@ export default {
showSearch: true,
// 总条数
total: 0,
// BOM 明细,存放属性–值表格数据
// 参数 明细,存放属性–值表格数据
bomItemList: [],
// 弹出层标题
title: "",
@@ -144,7 +144,7 @@ export default {
this.getList();
},
methods: {
/** 查询BOM 明细,存放属性–值列表 */
/** 查询参数 明细,存放属性–值列表 */
getList() {
this.loading = true;
listBomItem(this.queryParams).then(response => {
@@ -189,7 +189,7 @@ export default {
handleAdd() {
this.reset();
this.open = true;
this.title = "添加BOM 明细,存放属性–值";
this.title = "添加参数 明细,存放属性–值";
},
/** 修改按钮操作 */
handleUpdate(row) {
@@ -200,7 +200,7 @@ export default {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改BOM 明细,存放属性–值";
this.title = "修改参数 明细,存放属性–值";
});
},
/** 提交按钮 */
@@ -231,7 +231,7 @@ export default {
/** 删除按钮操作 */
handleDelete(row) {
const itemIds = row.itemId || this.ids;
this.$modal.confirm('是否确认删除BOM 明细,存放属性–值编号为"' + itemIds + '"的数据项?').then(() => {
this.$modal.confirm('是否确认删除参数 明细,存放属性–值编号为"' + itemIds + '"的数据项?').then(() => {
this.loading = true;
return delBomItem(itemIds);
}).then(() => {

View File

@@ -10,7 +10,7 @@
class="create-button"
>
<template v-if="!createLoading">
<i class="el-icon-plus"></i> 创建BOM
<i class="el-icon-plus"></i> 创建参数
</template>
<template v-else>
创建中...
@@ -32,10 +32,10 @@
<div v-if="data && !loading">
<el-form label-width="100px">
<el-form-item label="BOM名称">
<el-form-item label="参数名称">
<el-input v-model="info.bomName" @blur="handleUpdateBom"/>
</el-form-item>
<el-form-item label="BOM编码">
<el-form-item label="参数编码">
<el-input v-model="info.bomCode" @blur="handleUpdateBom"/>
</el-form-item>
</el-form>
@@ -102,7 +102,7 @@ export default {
this.info = response2.data;
} catch (err) {
this.error = err.message || '请求失败,请重试';
console.error('获取BOM详情失败:', err);
console.error('获取参数详情失败:', err);
} finally {
this.loading = false;
}
@@ -115,14 +115,14 @@ export default {
try {
this.createLoading = true;
// 添加一个semi类型
const bomName = (this.type == 'product' ? '产品BOM' : (this.type == 'raw_material' ? '原材料BOM' : '半成品BOM')) + new Date().getTime();
const bomName = (this.type == 'product' ? '产品参数' : (this.type == 'raw_material' ? '原材料参数' : '半成品参数')) + new Date().getTime();
const bomCode = (this.type == 'product' ? 'P' : (this.type == 'raw_material' ? 'R' : 'S')) + new Date().getTime();
const bomResponse = await addBom({
bomName,
bomCode
});
this.$message.success('创建BOM成功');
this.$message.success('创建参数成功');
const bomData = bomResponse.data;
// 根据类型更新产品/原材料
@@ -155,13 +155,13 @@ export default {
},
handleUpdateBom() {
this.$message.warning('正在更新BOM...');
this.$message.warning('正在更新参数...');
updateBom({
bomId: this.id,
bomName: this.info.bomName,
bomCode: this.info.bomCode
}).then(_ => {
this.$message.success('更新BOM成功');
this.$message.success('更新参数成功');
this.$store.dispatch('category/getBomMap');
})
},

View File

@@ -22,8 +22,8 @@
<el-steps align-center :active="activeStep" finish-status="success">
<!-- 新增产品的步骤 -->
<el-step title="创建产品"></el-step>
<!-- 创建BOM的步骤 -->
<el-step title="填写BOM信息"></el-step>
<!-- 创建参数的步骤 -->
<el-step title="填写参数信息"></el-step>
</el-steps>
<el-form ref="form" v-if="activeStep === 0" :model="addForm" :rules="rules" label-width="120px">
@@ -146,7 +146,7 @@ export default {
});
},
getLabel(item) {
// 产品名称[规格](SKU),如果有则写,没有则省略
// 产品名称[规格](参数),如果有则写,没有则省略
if (!item.specification) {
return `${item.productName}(${this.getSku(item)})`
}
@@ -154,9 +154,9 @@ export default {
},
getSku(item) {
const boms = item.bomItems || [];
console.log(boms, '产品BOM');
console.log(boms, '产品参数');
if (!boms.length) {
return '暂无BOM信息';
return '暂无参数信息';
}
// 查找attrKey为'规格'的attrvalue
const specification = boms.find(p => p.attrKey === '规格');
@@ -179,7 +179,7 @@ export default {
if (material) {
sku += '材质:' + material.attrValue + '';
}
console.log(sku, item, boms, '产品SKU');
console.log(sku, item, boms, '产品参数');
return sku;
},
onChange(val) {

View File

@@ -21,8 +21,8 @@
<el-steps align-center :active="activeStep" finish-status="success">
<!-- 新增原材料的步骤 -->
<el-step title="创建原材料"></el-step>
<!-- 创建BOM的步骤 -->
<el-step title="填写BOM信息"></el-step>
<!-- 创建参数的步骤 -->
<el-step title="填写参数信息"></el-step>
</el-steps>
<el-form ref="form" v-if="activeStep === 0" :model="addForm" :rules="rules" label-width="120px">
@@ -150,7 +150,7 @@ export default {
this.$emit('change', rawMaterial);
},
getLabel(item) {
// 原材料名称[规格](SKU),如果有则写,没有则省略
// 原材料名称[规格](参数),如果有则写,没有则省略
if (!item.specification) {
return `${item.rawMaterialName}(${this.getSku(item)})`
}
@@ -159,7 +159,7 @@ export default {
getSku(item) {
const boms = item.bomItems;
if (!boms || boms.length === 0) {
return '暂无BOM信息';
return '暂无参数信息';
}
// 查找attrKey为'规格'的attrvalue
const specification = boms.find(p => p.attrKey === '规格');

View File

@@ -6,7 +6,7 @@
</el-descriptions-item>
</el-descriptions>
<div v-else>
<el-empty description="暂无BOM信息" />
<el-empty description="暂无参数信息" />
</div>
</div>
</template>

View File

@@ -19,8 +19,8 @@
<el-steps align-center :active="activeStep" finish-status="success">
<!-- 新增半成品的步骤 -->
<el-step title="创建半成品"></el-step>
<!-- 创建BOM的步骤 -->
<el-step title="填写BOM信息"></el-step>
<!-- 创建参数的步骤 -->
<el-step title="填写参数信息"></el-step>
</el-steps>
<el-form ref="form" v-if="activeStep === 0" :model="addForm" :rules="rules" label-width="120px">