diff --git a/src/api/wms/product.js b/src/api/wms/product.js index f580eb96..fb3c99bd 100644 --- a/src/api/wms/product.js +++ b/src/api/wms/product.js @@ -56,7 +56,7 @@ export function delProduct(productId) { }); } -// 修改物料信息 +// 修改物料附属信息 export function updateProductAttached(data) { return request({ url: '/wms/attached', @@ -64,3 +64,12 @@ export function updateProductAttached(data) { data: data }); } + +// 新增物料附属信息 +export function addProductAttached(data) { + return request({ + url: '/wms/attached', + method: 'post', + data: data + }); +} diff --git a/src/views/wms/product/index.vue b/src/views/wms/product/index.vue index a8fa9e8b..839c3377 100644 --- a/src/views/wms/product/index.vue +++ b/src/views/wms/product/index.vue @@ -71,7 +71,7 @@ :disabled="single" @click="handleUpdateAttached" v-hasPermi="['wms:attached:edit']" - >修改附属属性新增/修改附属属性 @@ -559,6 +559,7 @@ import { addProduct, updateProduct, updateProductAttached, + addProductAttached, } from "@/api/wms/product"; import { syncProductSAP } from "@/api/technology/proroute"; @@ -814,8 +815,14 @@ export default { this.form.id = response.data.id; this.form.iei = response.data.iei; this.form.manStandar = response.data.manStandar; + this.form.productCode = response.data.productCode.slice(7,18); + console.log(this.form.productCode); this.openAttached = true; - this.title = "查看产品信息"; + if(this.form.id == null){ + this.title = "新增产品附属信息"; + }else{ + this.title = "修改产品附属信息"; + } }); }, @@ -831,6 +838,12 @@ export default { this.openAttached = false; this.getList(); }); + }else { + addProductAttached(this.form).then((response) => { + this.$modal.msgSuccess("新增产品附属信息成功"); + this.openAttached = false; + this.getList(); + }); } } });