🐞 fix: 修复原材料无法创建BOM
This commit is contained in:
@@ -114,9 +114,12 @@ export default {
|
||||
|
||||
try {
|
||||
this.createLoading = true;
|
||||
// 添加一个semi类型
|
||||
const bomName = (this.type == 'product' ? '产品BOM' : (this.type == 'raw_material' ? '原材料BOM' : '半成品BOM')) + new Date().getTime();
|
||||
const bomCode = (this.type == 'product' ? 'P' : (this.type == 'raw_material' ? 'R' : 'S')) + new Date().getTime();
|
||||
const bomResponse = await addBom({
|
||||
bomName: (this.type == 'product' ? '产品BOM' : '原材料BOM') + new Date().getTime(),
|
||||
bomCode: (this.type == 'product' ? 'P' : 'R') + new Date().getTime()
|
||||
bomName,
|
||||
bomCode
|
||||
});
|
||||
|
||||
this.$message.success('创建BOM成功');
|
||||
@@ -133,6 +136,11 @@ export default {
|
||||
rawMaterialId: this.itemId,
|
||||
bomId: bomData.bomId
|
||||
});
|
||||
} else if (this.type == 'semi' && this.itemId) {
|
||||
await updateProduct({
|
||||
productId: this.itemId,
|
||||
bomId: bomData.bomId
|
||||
});
|
||||
}
|
||||
this.$store.dispatch('category/getBomMap');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user