From 9e52dcf4615e6b50cef57a56c37fd13b777d1051 Mon Sep 17 00:00:00 2001
From: whycq <you@example.com>
Date: 星期日, 02 四月 2023 18:25:45 +0800
Subject: [PATCH] #
---
pages/pakin/pakin.vue | 68 +++++++++++++++++++++++++++++----
1 files changed, 59 insertions(+), 9 deletions(-)
diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue
index 73ce360..b1d1a83 100644
--- a/pages/pakin/pakin.vue
+++ b/pages/pakin/pakin.vue
@@ -43,7 +43,7 @@
</view>
<view class="list-left-item">
<view class="desc">鏁伴噺锛�</view>
- <view class="left-item"><uni-tag :text="item.anfme"></uni-tag></view>
+ <view class="left-item">{{item.anfme}}</view>
</view>
</view>
<view class="list-right">
@@ -211,9 +211,8 @@
},
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
events: {
- dataList: function(data) {
+ matList: function(data) {
that.checkMat(data.data)
- // that.matList.push(data.data)
},
},
});
@@ -225,7 +224,6 @@
});
}, 1000);
} else {
- console.log(res);
uni.showToast({title: res.msg, icon: "none",position: 'top'})
}
@@ -235,12 +233,11 @@
},
selectMat() {
let that = this
- uni.vibrateShort();
uni.navigateTo({
url: "../mat/matQuery",
success: function(res) {
// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
- res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
+ res.eventChannel.emit('commonUrl', {commonUrl: '' })
},
events: {
// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹� 鍙﹀涓�涓〉闈紶杩囨潵鐨�
@@ -320,8 +317,55 @@
this.$refs.combConfirm.close()
},
comb() {
- this.messageText = "缁勬墭鎴愬姛"
- this.messageToggle('success')
+ uni.vibrateShort();
+ let that = this;
+ if (that.barcode === '') {
+ this.messageText = "璇锋壂鎻忔墭鐩樻潯鐮�"
+ this.messageToggle('error')
+ return;
+ }
+ if (that.dataList.length === 0) {
+ this.messageText = "璇锋坊鍔犲晢鍝佸垪琛�"
+ this.messageToggle('error')
+ return;
+ }
+ for (var i = 0; i < that.dataList.length; i++) {
+ if (that.dataList[i].anfme == 0 || that.dataList[i].anfme == '') {
+ this.messageText = that.dataList[i].matnr + '缁勬墭鏁伴噺涓嶈兘涓�0'
+ this.messageToggle('error')
+ return;
+ }
+ }
+ uni.request({
+ url: that.baseUrl + '/mobile/comb/auth',
+ data: JSON.stringify({
+ barcode: that.barcode,
+ combMats: that.dataList
+ }),
+ method: 'POST',
+ header: {
+ 'token':uni.getStorageSync('token')
+ },
+ success(result) {
+ var res = result.data
+ if (res.code === 200) {
+ that.resst();
+ that.messageText = "缁勬墭鎴愬姛"
+ that.messageToggle('success')
+ } 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
@@ -338,7 +382,13 @@
// 鍙栨秷閲嶇疆
resetClose() {
- }
+ },
+ // 娓呯┖
+ resst() {
+ this.dataList = []
+ this.barcode = ''
+ this.barcodeFocuss()
+ },
}
}
</script>
--
Gitblit v1.9.1