diff --git a/src/api/wms/product.js b/src/api/wms/product.js index fb3c99b..94d6582 100644 --- a/src/api/wms/product.js +++ b/src/api/wms/product.js @@ -73,3 +73,11 @@ export function addProductAttached(data) { data: data }); } +// 手动同步物料 +export function syncProduct(data) { + return request({ + url: '/wms/product/sync', + method: 'post', + data: data + }); +} diff --git a/src/views/wms/product/index.vue b/src/views/wms/product/index.vue index 4037478..568b31e 100644 --- a/src/views/wms/product/index.vue +++ b/src/views/wms/product/index.vue @@ -130,6 +130,28 @@ >同步物料工艺 + + 同步单个物料信息 + + + + 同步所有物料信息 + + { + let inputValue = result.value; + if (inputValue.length < 18){ + inputValue = "0000000"+inputValue + } + syncProduct({ + matnr:inputValue, + werks:localStorage.getItem('USER_POOL_NAME_CURRENT').replace("ds_","") + }).then(res=>{ + if (res.code === 200){ + this.$message.success(`操作成功!`); + }else { + this.$message.error(`操作失败!`+res.msg); + } + }) + + }).catch(() => { + + }); + }, + handleSyncMultipleProduct(){ + this.$modal + .confirm( + '是否同步所有物料?' + ) + .then((res) => { + console.log(res) + if (res === "confirm"){ + syncProduct({ + werks:localStorage.getItem('USER_POOL_NAME_CURRENT').replace("ds_","") + }).then(()=>{ + this.$message.success(`操作成功!`); + }) + } + }) + .catch(() => {}); + } }, };