From 087b9f6cea5b4d2eb1c9fa3959ac0dc5b09cf254 Mon Sep 17 00:00:00 2001 From: skyouc Date: 星期五, 08 八月 2025 17:03:59 +0800 Subject: [PATCH] no message --- pages/pakin/pakin.vue | 65 ++++++++++++++++++++++++++++---- 1 files changed, 56 insertions(+), 9 deletions(-) diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue index d37fb3e..b6f4150 100644 --- a/pages/pakin/pakin.vue +++ b/pages/pakin/pakin.vue @@ -126,6 +126,12 @@ <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content" @confirm="resetConfirm" @close="resetClose"></uni-popup-dialog> </uni-popup> + </view> + <!-- 骞冲簱搴撲綅鎺ㄨ崘 --> + <view> + <uni-popup ref="recommend" type="dialog"> + <uni-popup-dialog :type="msgType" mode="base" :cancelText="null" confirmText="纭" title="鎺ㄨ崘搴撲綅" :content="recomLoc"></uni-popup-dialog> + </uni-popup> </view> </view> </template> @@ -143,7 +149,8 @@ msgType1: 'success', msgType: 'success', messageText: '', - title: '', + title: '', + recomLoc: '', content: '', barcodeFocus: true, matFocus: false, @@ -207,18 +214,23 @@ // 鎼滅储鐗╂枡 findMat() { let that = this - if (that.matnr == null && that.matnr == '') { + if (that.matnr == null || that.matnr == '') { uni.showToast({ - title: "鐗╂枡鐮佷笉鑳戒负绌猴紒锛�", + title: "璁㈠崟鍙蜂笉鑳戒负绌猴紒锛�", icon: "none", position: "top" }) return; - } else { + } uni.navigateTo({ url: "../pakin/pakinSelector?barcode=" + that.matnr, + success:function(res){ + let matnrs = that.dataList.map(data => data.matnr); + console.log(matnrs); + res.eventChannel.emit('acceptOpenPager', matnrs) + } }); - } + }, checkMat(mat) { @@ -340,7 +352,8 @@ this.messageToggle('error') return; } - } + } + uni.request({ url: that.baseUrl + '/pda/comb/auth', data: JSON.stringify({ @@ -355,12 +368,15 @@ success(result) { var res = result.data if (res.code === 200) { - that.resst(); that.messageText = "缁勬墭鎴愬姛" that.messageToggle('success') const innerAudioContext = uni.createInnerAudioContext(); innerAudioContext.src = '/static/music/pakinOk.mp3'; - innerAudioContext.play() + innerAudioContext.play() + if (that.barcode.indexOf('PK') >= 0) { + that.recommendLocs(that) + } + that.resst(); } else if (res.code == 403) { that.messageText = res.msg that.messageToggle('error') @@ -375,7 +391,38 @@ } } }); - }, + }, + + recommendLocs(that) { + uni.request({ + url: that.baseUrl + '/pda/recommend/locs', + method: 'GET', + header: { + 'token': uni.getStorageSync('token') + }, + success(result) { + var res = result.data + if (res.code === 200) { + if (res.data != null && res.data != undefined ) { + that.recomLoc = '绯荤粺鎺ㄨ崘灏嗚揣鐗╂斁鑷�:' + res.data.locNo + that.$refs.recommend.open() + } + } else if (res.code == 403) { + that.messageText = res.msg + that.messageToggle('error') + setTimeout(() => { + uni.reLaunch({ + url: '../login/login' + }); + }, 1000); + } else { + that.messageText = res.msg + that.messageToggle('error') + } + } + }); + }, + reset(type) { this.msgType = type this.title = '璀﹀憡' -- Gitblit v1.9.1