diff --git a/pages/nongKe/gather/select_warehouse.vue b/pages/nongKe/gather/select_warehouse.vue index 7e250cd..4f82806 100644 --- a/pages/nongKe/gather/select_warehouse.vue +++ b/pages/nongKe/gather/select_warehouse.vue @@ -107,7 +107,6 @@ onLoad(e) { this.mer_id = e.mer_id this.stype = e.stype - console.log(this.stype); if (this.stype == 1) { return this.goodsData[0].name = '商品添加' } @@ -186,14 +185,31 @@ } }, navigato(type) { - type === 1 ? this.searchGoodsShow = true : this.scanCode(); + if (type === 1) { + if (this.stype == 1) { + uni.navigateTo({ + url: '/pages/product/addGoods/index' + }); + return; + } + + this.searchGoodsShow = true + } else { + this.scanCode(); + } }, scanCode() { const self = this uni.scanCode({ scanType: ["qrCode", "barCode", "datamatrix", "pdf417"], success(res) { - self.seachBarCode(res.result) + if (self.stype == 1) { + uni.navigateTo({ + url: `/pages/product/addGoods/index?mer_id=${self.mer_id}&code=${res.result}` + }) + } else { + self.seachBarCode(res.result) + } }, fail(res) {