|
@@ -22,7 +22,7 @@
|
|
|
<el-form-item>
|
|
|
<el-button type="primary" icon="Plus" @click="handleAdd(null)"
|
|
|
v-hasPermi="['business:accessories:add']">新增</el-button>
|
|
|
- <el-button type="primary" icon="Plus" @click="handleSync()"
|
|
|
+ <el-button type="primary" icon="Download" @click="handleSync()"
|
|
|
v-hasPermi="['business:accessories:sync']">拉取p2数据</el-button>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -300,6 +300,7 @@ function handleSave(row) {
|
|
|
proxy.$modal.msgError("请输入辅料类别")
|
|
|
return
|
|
|
}
|
|
|
+ loading.value = true;
|
|
|
if (row.id == null) {
|
|
|
addAccessories(row).then(afterSave)
|
|
|
} else {
|
|
@@ -322,6 +323,15 @@ function handleCancel(row) {
|
|
|
|
|
|
function handleSync() {
|
|
|
// pullP2Accessories
|
|
|
+ loading.value = true;
|
|
|
+ getP2Accessories().then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ getList()
|
|
|
+ proxy.$modal.msgSuccess("拉取成功")
|
|
|
+ } else {
|
|
|
+ proxy.$modal.msgError("拉取失败")
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
getList();
|