|
|
|
|
@ -130,6 +130,28 @@
|
|
|
|
|
>同步物料工艺
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleSyncSingleProduct"
|
|
|
|
|
v-hasPermi="['wms:product:edit']"
|
|
|
|
|
>同步单个物料信息
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-download"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleSyncMultipleProduct"
|
|
|
|
|
v-hasPermi="['wms:product:edit']"
|
|
|
|
|
>同步所有物料信息
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar
|
|
|
|
|
:showSearch.sync="showSearch"
|
|
|
|
|
@queryTable="getList"
|
|
|
|
|
@ -687,7 +709,7 @@ import {
|
|
|
|
|
addProduct,
|
|
|
|
|
updateProduct,
|
|
|
|
|
updateProductAttached,
|
|
|
|
|
addProductAttached,
|
|
|
|
|
addProductAttached, syncProduct,
|
|
|
|
|
} from "@/api/wms/product";
|
|
|
|
|
import { syncProductSAP } from "@/api/technology/proroute";
|
|
|
|
|
|
|
|
|
|
@ -1054,6 +1076,54 @@ export default {
|
|
|
|
|
this.form.height = null;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleSyncSingleProduct(){
|
|
|
|
|
this.$prompt(
|
|
|
|
|
'请输入物料编码',
|
|
|
|
|
{
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
inputPlaceholder: '请输入物料编码...',
|
|
|
|
|
inputPattern: /^.{11}$|^.{18}$/,
|
|
|
|
|
inputErrorMessage: '请输入正确的物料编码!',
|
|
|
|
|
closeOnClickModal: false,
|
|
|
|
|
}
|
|
|
|
|
).then((result) => {
|
|
|
|
|
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(() => {});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|