导入优化
This commit is contained in:
parent
4bd50eb5c9
commit
02ab3cdea7
@ -122,20 +122,23 @@
|
||||
addGoodsopen() {
|
||||
if (this.item) {
|
||||
post_product_import(this.item.product_id).then(e => {
|
||||
console.log(res);
|
||||
if (e.status == 200) {
|
||||
Toast(e.data.msg)
|
||||
this.addGoodsShow = false
|
||||
if (e.status == 400) {
|
||||
Toast(e.message)
|
||||
this.addGoodsShow = false
|
||||
}
|
||||
}
|
||||
this.addGoodsShow = false
|
||||
} else {
|
||||
console.log(e);
|
||||
Toast(e.message)
|
||||
this.addGoodsShow = false
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log(err);
|
||||
if (err == "已经导入过该商品了") {
|
||||
Toast('已经导入过该商品了')
|
||||
this.addGoodsShow = false
|
||||
}
|
||||
}else{
|
||||
Toast('导入出错')
|
||||
this.addGoodsShow = false
|
||||
}
|
||||
})
|
||||
}
|
||||
this.item = []
|
||||
@ -218,14 +221,13 @@
|
||||
mer_id: this.mer_id
|
||||
}).then(res=>{
|
||||
if(!res.data){
|
||||
// Toast(res.message)
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
duration: 3000,
|
||||
icon:'none',
|
||||
});
|
||||
}else{
|
||||
if (data.list.length < 1) {
|
||||
if (res.data.list.length < 1) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/product/addGoods/index?mer_id=${this.mer_id}&code=${code}`
|
||||
})
|
||||
@ -234,7 +236,6 @@
|
||||
this.goods = data.list
|
||||
}
|
||||
})
|
||||
console.log(data);
|
||||
|
||||
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user