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 | 114 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 86 insertions(+), 28 deletions(-) diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue index 4c5a965..b6f4150 100644 --- a/pages/pakin/pakin.vue +++ b/pages/pakin/pakin.vue @@ -14,10 +14,10 @@ <text style="text-align: right;color: #409EFF;" @click="findMat()">鎻愬彇+</text> <uni-icons type="right" color="#c1c1c1"></uni-icons> </view> - </view> + </view> + <uni-section title="鍟嗗搧鍒楄〃" type="line" class="mat-list-title"></uni-section> </view> - <view class="mat-list-title"> - <div>鍟嗗搧鍒楄〃</div> + <view class="list-view"> <scroll-view> <view class="list" v-for="(item,i) in dataList" :key="i"> <view class="list-left"> @@ -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, @@ -175,15 +182,15 @@ // 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏� setTimeout(() => { var len = this.barcode.length - if (len != 8) { - uni.showToast({ - title: '鎵樼洏鐮佹湁璇閲嶈瘯', - icon: "none", - position: 'top' - }); - // this.barcodeFocuss() - return; - } + // if (len != 8) { + // uni.showToast({ + // title: '鎵樼洏鐮佹湁璇閲嶈瘯', + // icon: "none", + // position: 'top' + // }); + // // this.barcodeFocuss() + // return; + // } // this.focuss() }, 200) }, @@ -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 = '璀﹀憡' @@ -396,6 +443,7 @@ resst() { this.dataList = [] this.barcode = '' + this.matnr = '' this.barcodeFocuss() }, } @@ -403,17 +451,30 @@ </script> <style> - @import url('../../static/css/wms.css/wms.css'); + @import url('../../static/css/wms.css/wms.css'); + + .uni-section { + margin-top: 0rpx; + + .uni-section__content-title { + font-size: 16px !important; + } + } .list { border-radius: unset; margin: auto; margin-top: 20rpx; padding: 10rpx; + } + + .list-view { + width: 100%; + position: relative; } .list:first-child { - margin-top: 20rpx; + margin-top: 320rpx; } .code { width: 100%; @@ -457,11 +518,8 @@ line-height: 80rpx; width: 100%; background-color: white; - position: fixed; - margin-top: 200rpx; + position: relative; + font-weight: 500; z-index: 9; - /* border-top: 1px solid #DCDFE6; */ - text-align: center; - /* box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.2); */ } </style> -- Gitblit v1.9.1