From e6b2d108f49e2dc1d3c825704cb19e5557607420 Mon Sep 17 00:00:00 2001
From: skyouc
Date: 星期三, 06 八月 2025 10:11:35 +0800
Subject: [PATCH] PDA问题修复
---
pages/pakin/pakin.vue | 79 ++++++++++++++++++++++++++++++---------
1 files changed, 61 insertions(+), 18 deletions(-)
diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue
index 97f9cac..8d5e75a 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,
@@ -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,18 @@
// 鎼滅储鐗╂枡
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,
});
- }
+
},
checkMat(mat) {
@@ -340,7 +347,8 @@
this.messageToggle('error')
return;
}
- }
+ }
+
uni.request({
url: that.baseUrl + '/pda/comb/auth',
data: JSON.stringify({
@@ -355,12 +363,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 +386,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 +438,7 @@
resst() {
this.dataList = []
this.barcode = ''
+ this.matnr = ''
this.barcodeFocuss()
},
}
--
Gitblit v1.9.1