diff --git a/klp-ui/src/components/KLPService/BomPanel/index.vue b/klp-ui/src/components/KLPService/BomPanel/index.vue index 4e50a2c7..303f1d4f 100644 --- a/klp-ui/src/components/KLPService/BomPanel/index.vue +++ b/klp-ui/src/components/KLPService/BomPanel/index.vue @@ -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'); diff --git a/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue b/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue index 090f89ce..abc55126 100644 --- a/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue +++ b/klp-ui/src/components/KLPService/RawMaterialSelect/index.vue @@ -25,13 +25,13 @@ - - + + - - + + @@ -60,13 +60,10 @@