From 02ab3cdea74b2d80bc83308d03b7b080c1707237 Mon Sep 17 00:00:00 2001 From: THK3121 Date: Sat, 10 Jun 2023 18:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/nongKe/gather/select_warehouse.vue | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pages/nongKe/gather/select_warehouse.vue b/pages/nongKe/gather/select_warehouse.vue index 82c1243..2a2da96 100644 --- a/pages/nongKe/gather/select_warehouse.vue +++ b/pages/nongKe/gather/select_warehouse.vue @@ -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); },