更新
This commit is contained in:
@@ -70,7 +70,7 @@
|
||||
productName: '',
|
||||
productSkcIds: ''
|
||||
}, getProductList()">重置</el-button>
|
||||
<el-button type="primary" @click="search.page =1, getProductList()">查询</el-button>
|
||||
<el-button type="primary" @click="productPage.page =1, getProductList()">查询</el-button>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
@@ -284,7 +284,7 @@ import { Message } from 'element-ui'
|
||||
};
|
||||
})
|
||||
} else {
|
||||
Message.error("【拼多多】" + res.errorMsg)
|
||||
this.getProductList()
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -300,37 +300,42 @@ import { Message } from 'element-ui'
|
||||
return;
|
||||
}
|
||||
this.productIds.map((productSpu, index) => {
|
||||
setTimeout(() => {
|
||||
sendChromeAPIMessage({
|
||||
url: 'bg-visage-mms/product/query',
|
||||
needMallId: true,
|
||||
mallId: this.productPage.mallId,
|
||||
data: {
|
||||
productEditTaskUid: '',
|
||||
productId: productSpu
|
||||
}}).then((res) => {
|
||||
if (res.errorCode == 1000000) {
|
||||
let content = transform(res.result)
|
||||
let mallInfo = this.$store.state.mallList.filter(item => {
|
||||
return item.mallId == this.productPage.mallId
|
||||
})
|
||||
this.$http.post('/api/product/add', {
|
||||
mallId: mallInfo[0].mallId,
|
||||
mallName: mallInfo[0].mallName,
|
||||
productSpu: res.result.productId,
|
||||
productName: res.result.productName,
|
||||
content: content
|
||||
}).then(res1 => {
|
||||
if (res1.code == 0) {
|
||||
Message.success("商品【" + res.result.productName + "】成功添加为商品模板")
|
||||
if (index == this.productIds.length - 1) {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.saveTemplate(productSpu, index)
|
||||
}, 200 * index)
|
||||
})
|
||||
},
|
||||
saveTemplate(spu, index) {
|
||||
sendChromeAPIMessage({
|
||||
url: 'bg-visage-mms/product/query',
|
||||
needMallId: true,
|
||||
mallId: this.productPage.mallId,
|
||||
data: {
|
||||
productEditTaskUid: '',
|
||||
productId: spu
|
||||
}}).then((res) => {
|
||||
if (res.errorCode == 1000000) {
|
||||
let content = transform(res.result)
|
||||
let mallInfo = this.$store.state.mallList.filter(item => {
|
||||
return item.mallId == this.productPage.mallId
|
||||
})
|
||||
this.$http.post('/api/product/add', {
|
||||
mallId: mallInfo[0].mallId,
|
||||
mallName: mallInfo[0].mallName,
|
||||
productSpu: res.result.productId,
|
||||
productName: res.result.productName,
|
||||
content: content
|
||||
}).then(res1 => {
|
||||
if (res1.code == 0) {
|
||||
Message.success("商品【" + res.result.productName + "】成功添加为商品模板")
|
||||
if (index == this.productIds.length - 1) {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
})
|
||||
}, 200 * index)
|
||||
} else {
|
||||
this.saveTemplate(spu, index)
|
||||
}
|
||||
})
|
||||
},
|
||||
beforeAddToDraft() {
|
||||
|
||||
Reference in New Issue
Block a user