From 7dc7fa23a6339a138942c59c656dfe5e51b5e8f3 Mon Sep 17 00:00:00 2001 From: A0010407 Date: Wed, 15 May 2024 17:08:57 +0800 Subject: [PATCH] =?UTF-8?q?2024-05-15=20=E5=9F=BA=E7=A1=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF-=E4=BA=A7=E5=93=81-=E4=BF=AE=E6=94=B9=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E9=99=84=E5=B1=9E=E5=B1=9E=E6=80=A72?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/product.js | 11 ++++++++++- src/views/wms/product/index.vue | 17 +++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/api/wms/product.js b/src/api/wms/product.js index f580eb9..fb3c99b 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 a8fa9e8..839c337 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(); + }); } } });