From 750f856006af98dffb7918ab80fdc689781ea017 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期三, 17 一月 2024 16:20:32 +0800
Subject: [PATCH] #

---
 pages/basics/pakin.vue |   43 +++++++++++++++++++++++++++++++++----------
 1 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/pages/basics/pakin.vue b/pages/basics/pakin.vue
index afa398f..7516a21 100644
--- a/pages/basics/pakin.vue
+++ b/pages/basics/pakin.vue
@@ -9,7 +9,7 @@
 				<view class="square-content">
 					<view class="content-input">
 						<input v-model="barcode" type="text" placeholder="鎵爜 / 杈撳叆" 
-						:focus="barcodeFocus" @confirm="barcodeInput()" placeholder-style="line-height:  85rpx;">
+						:focus="barcodeFocus" @input="barcodeInput()" placeholder-style="line-height:  85rpx;">
 						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeBarcode()"></uni-icons>
 					</view>
 				</view>
@@ -147,9 +147,9 @@
 				checkedData:[],
 				batch:'',
 				memo: '',
-				ck1: false,
-				ck2: true,
-				frozen: 0,
+				ck1: true,
+				ck2: false,
+				frozen: 1,
 			}
 		},
 		onShow() {
@@ -179,6 +179,7 @@
 				} else {
 					this.frozen = 0
 				}
+				console.log(this.frozen);
 			},
 			// 鑾峰彇url
 			getUrl() {
@@ -190,7 +191,7 @@
 				setTimeout(()=>{
 					var len = this.barcode.length
 					if (len != 8) {
-						uni.showToast({title: '鎵樼洏鐮佹湁璇閲嶈瘯', icon: "none", position: 'top'});
+						uni.showToast({title: '鎵樼洏鐮�'+this.barcode+'鏈夎璇烽噸璇�', icon: "none", position: 'top'});
 						this.barcodeFocuss()
 						return;
 					}
@@ -323,7 +324,25 @@
 				that.matnr = ''
 			},
 			findMat() {
-				let that = this
+				let that = this 
+				let len = that.matnr.length 
+				let bat = ''
+				let re = /\s+/g
+				that.matnr = that.matnr.replace(/\s+/g,'')
+				if (len == 26 || len == 25 || len == 27 || len == 28) {
+					bat = that.matnr.substring(18,22)
+					that.matnr = that.matnr.substring(3,17)
+				}
+				for (var i = 0; i < that.matList.length; i++) {
+					if (that.matnr == that.matList[i].matnr) {
+						uni.showToast({title: that.matnr + "褰撳墠鐗╂枡鎻愬彇锛岃鍕块噸澶嶆壂鎻�!", icon: "none",position: 'top'})
+						setTimeout(()=>{
+							that.matnr = '';
+							that.focus = true;
+						}, 100);
+						return;
+					}
+				}
 				uni.request({
 				    url: that.commonUrl + '/mat/auth',
 				    data: {
@@ -338,7 +357,7 @@
 						if (res.code === 200 && res.data) {
 							that.matData = res.data
 							that.matnr = ''
-							that.matData['batch'] = ''
+							that.matData['batch'] = bat
 							uni.navigateTo({
 								url: "matQuery",
 								events: {
@@ -361,12 +380,15 @@
 								});
 							}, 1000);
 						} else {
-							uni.showToast({title: res.msg, icon: "none",position: 'top'})
+							// setTimeout(()=>{
+							// 	that.matnr = '';
+							// 	that.focus = true;
+							// }, 100);
+							// uni.showToast({title: res.msg, icon: "none",position: 'top'})
 						}
 						
 					}
 				});
-				
 			},
 		
 			// 娣诲姞鍟嗗搧
@@ -380,7 +402,8 @@
 				var today = date.getFullYear() + '/' + (date.getMonth()+1) + '/' + date.getDate()
 				for (var i = 0; i < len; i++) {
 					if (mat.matnr == this.matList[i].matnr) {
-						this.matList[i].anfme += mat.anfme 
+						uni.showToast({title: mat.matnr + "褰撳墠鐗╂枡鎻愬彇锛岃鍕块噸澶嶆壂鎻�!", icon: "none",position: 'top'})
+						// this.matList[i].anfme += mat.anfme 
 						this.$forceUpdate() // 寮哄埗鍒锋柊
 						add = false
 					}

--
Gitblit v1.9.1