From 15a71f30d03e47a9fddb690ee4f9462b47e82707 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 05 十月 2023 08:42:11 +0800
Subject: [PATCH] #

---
 pages/pakin/pakin.vue |   60 +++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 47 insertions(+), 13 deletions(-)

diff --git a/pages/pakin/pakin.vue b/pages/pakin/pakin.vue
index eecc8d7..6988352 100644
--- a/pages/pakin/pakin.vue
+++ b/pages/pakin/pakin.vue
@@ -8,7 +8,7 @@
 			</view>
 			<view class="item">
 				<view class="code-decs">鐗╂枡鐮�:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matnr" :focus="matFocus" @input="findMat()">
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="matNo" :focus="matFocus" @input="findMat()">
 				<view class="item-right">
 					<button></button>
 					<text style="text-align: right;color: #409EFF;" @click="selectMat()">鎻愬彇+</text>
@@ -84,7 +84,7 @@
 					<view class="popup-item">
 						<view class="popup-item-left">缂栫爜:</view>
 						<view class="popup-item-right">
-							<input type="text" v-model="matnr" disabled="true"
+							<input type="text" v-model="matNo" disabled="true"
 								style="background-color: #f7f7f7;padding: 0;color: #d5d5d5;">
 						</view>
 					</view>
@@ -152,7 +152,7 @@
 				dataList: [],
 				count: 0,
 				rowNum: '',
-				matnr: '',
+				matNo: '',
 				batch: '',
 				weight: '',
 				msgType1: 'success',
@@ -209,7 +209,7 @@
 			focuss() {
 				this.focus = false;
 				setTimeout(() => {
-					this.matnr = '';
+					this.matNo = '';
 					this.matFocus = true;
 				}, 100);
 			},
@@ -219,7 +219,7 @@
 				uni.request({
 					url: that.baseUrl + '/matCode/list/auth',
 					data: {
-						mat_no: that.matnr
+						mat_no: that.matNo
 					},
 					header: {
 						'token': uni.getStorageSync('token')
@@ -228,7 +228,7 @@
 						result = result.data
 						if (result.code === 200 && result.data) {
 							that.matData = result.data
-							that.matnr = ''
+							that.matNo = ''
 							that.matData['batch'] = ''
 							uni.navigateTo({
 								url: "../mat/matSelected",
@@ -282,20 +282,54 @@
 					events: {
 						// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
 						acceptDataFromOpenedPage: function(data) {
-							that.matnr = data.data
-							that.findMat(that.matnr)
+							that.matNo = data.data
+							that.findMat(that.matNo)
 						},
 					},
 
 
 				});
-				that.matnr = ''
+				that.matNo = ''
 			},
+			// checkMat(mat) {
+			// 	var len = this.dataList.length
+			// 	var add = true ,sameItem = false
+			// 	for (var i = 0; i < len; i++) {
+			// 		if (mat.matno == this.dataList[i].matno) {
+			// 			for (var j = 0; j < len; j++) {
+			// 				if (mat.batch == this.dataList[j].batch) {
+			// 					sameItem = true
+			// 				}
+			// 			}
+			// 			// 鐩稿悓鐗╂枡 涓嶅悓鎵瑰彿  鏂板姞鍒楄〃
+			// 			if (mat.batch != this.dataList[i].batch) {
+			// 				this.$forceUpdate() // 寮哄埗鍒锋柊
+			// 				if (sameItem) {
+			// 					add = false
+			// 				} else {
+			// 					add = true
+			// 				}
+							
+			// 			} else {
+			// 				// 鐩稿悓鐗╂枡鐩稿悓鎵瑰彿 鏁伴噺绱姞
+			// 				this.dataList[i].anfme += mat.anfme
+			// 				this.$forceUpdate() // 寮哄埗鍒锋柊
+			// 				add = false
+			// 			}
+			// 		}
+			// 	}
+			// 	if (add) {
+			// 		this.dataList.unshift(mat)
+			// 	}
+			// },
 			checkMat(mat) {
 				var len = this.dataList.length
 				var add = true ,sameItem = false
 				for (var i = 0; i < len; i++) {
-					if (mat.matnr == this.dataList[i].matnr) {
+					console.log(i);
+					console.log(mat);
+					console.log(this.dataList[i].matNo);
+					if (mat.matNo == this.dataList[i].matNo) {
 						for (var j = 0; j < len; j++) {
 							if (mat.batch == this.dataList[j].batch) {
 								sameItem = true
@@ -324,7 +358,7 @@
 			},
 			// 淇敼鎵瑰彿
 			revise(item, i) {
-				this.matnr = this.dataList[i].matnr
+				this.matNo = this.dataList[i].matNo
 				this.count = this.dataList[i].anfme
 				this.batch = this.dataList[i].batch
 				this.weight = this.dataList[i].weight
@@ -359,7 +393,7 @@
 				this.dataList[this.rowNum].batch = this.batch
 				this.dataList[this.rowNum].weight = this.weight
 				this.dataList[this.rowNum].appeTime$ = this.appeTime$
-				this.matnr = ''
+				this.matNo = ''
 				this.messageText = "淇敼鎴愬姛"
 				this.messageToggle('success')
 				this.$refs.revise.close()
@@ -394,7 +428,7 @@
 				}
 				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.messageText = that.dataList[i].matNo + '缁勬墭鏁伴噺涓嶈兘涓�0'
 						this.messageToggle('error')
 						return;
 					}

--
Gitblit v1.9.1