From 12966b4ef9d35b25760fcd4fcdd569bef9aa8547 Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 30 七月 2025 14:10:30 +0800
Subject: [PATCH] #

---
 pages/basics/order.vue |   56 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 40 insertions(+), 16 deletions(-)

diff --git a/pages/basics/order.vue b/pages/basics/order.vue
index 0680ba2..3873330 100644
--- a/pages/basics/order.vue
+++ b/pages/basics/order.vue
@@ -23,7 +23,7 @@
 				</view>
 				<view class="square-content">
 					<view class="content-input">
-						<input v-model="matnr" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()"
+						<input v-model="matnr" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMatInput()"
 						:focus="focus" placeholder-style="line-height:  85rpx;">
 						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons>
 					</view>
@@ -58,6 +58,8 @@
 						<view><text style="width: 400rpx;">瑙勬牸锛歿{item.specs}}</text></view>
 					<!-- 	<view><text style="width: 400rpx;">鍨嬪彿锛歿{item.model}}</text></view> -->
 						<view><text style="width: 400rpx;">鎵规锛歿{item.batch}}</text></view>
+						<view style="width: 500rpx;"><text>鍨嬪彿锛歿{item.model}}</text></view>
+						<view><text style="width: 400rpx;">搴撳瓨鐘舵�侊細{{item.cstateid$}}</text></view>
 						<!-- <view><text style="width: 400rpx;">澶囨敞锛歿{item.memo}}</text></view> -->
 						<view>
 							<text style="width: 400rpx;">涓绘暟閲忥細{{item.anfme}}</text>
@@ -86,6 +88,9 @@
 			
 			<label class="label-btn" style="width: 150rpx;">
 				<button class="cu-btn" @click="resst()">閲嶇疆</button>
+			</label>
+			<label>
+				鎬昏杈呮暟閲忥細{{ countWeight }}
 			</label>
 			<label class="label-btn">
 				<button class="cu-btn bg-blue " @click="comb()">缁勬墭</button>
@@ -143,7 +148,9 @@
 				check:false,
 				checkText:'鍏ㄩ��',
 				checkedData:[],
-				batch:''
+				batch:'',
+				timeout: null,
+				countWeight: 0,
 			}
 		},
 		onShow() {
@@ -297,6 +304,12 @@
 				});
 				that.matnr = ''
 			},
+			findMatInput() {
+				clearTimeout(this.timeout)
+				this.timeout = setTimeout(() => {
+					this.findMat()
+				},600)
+			},
 			findMat() {
 				let that = this
 				uni.request({
@@ -312,13 +325,17 @@
 						let res = result.data
 						if (res.code === 200 && res.data) {
 							that.matData = res.data
+							
+							let tiaoma = that.matnr;
 							that.matnr = ''
 							uni.navigateTo({
 								url: "matQuery",
 								events: {
 								    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
 								    matList: function(data) {
-										that.checkMat(data.data)
+										let resultData = data.data;
+										resultData.tiaoma = tiaoma;
+										that.checkMat(resultData)
 										// that.matList.push(data.data)
 									},
 								},
@@ -350,18 +367,25 @@
 			checkMat(mat) {
 				var len = this.matList.length
 				var add = true
-				// for (var i = 0; i < len; i++) {
-				// 	if (mat.matnr == this.matList[i].tiaoma){
-				// 		uni.showToast({title: "鏉$爜閲嶅鎵簡", icon: "none", position: 'top'})
-				// 	}
-				// 	// if (mat.matnr == this.matList[i].matnr&&mat.batch == this.matList[i].batch&&mat.orderNo == this.matList[i].orderNo) {
-				// 	// 	this.matList[i].anfme += mat.anfme 
-				// 	// 	this.$forceUpdate() // 寮哄埗鍒锋柊
-				// 	// 	add = false
-				// 	// }
-				// }
+				for (var i = 0; i < len; i++) {
+					if (mat.tiaoma == this.matList[i].tiaoma){
+						uni.showToast({title: "鏉$爜閲嶅鎵簡", icon: "none", position: 'top'})
+						add = false
+					}
+					// if (mat.matnr == this.matList[i].matnr&&mat.batch == this.matList[i].batch&&mat.orderNo == this.matList[i].orderNo) {
+					// 	this.matList[i].anfme += mat.anfme 
+					// 	this.$forceUpdate() // 寮哄埗鍒锋柊
+					// 	add = false
+					// }
+				}
 				if (add) {
 					this.matList.unshift(mat)
+					
+					let count = 0;
+					this.matList.forEach((item) => {
+						count += item.weight;
+					})
+					this.countWeight = count;
 				}
 			},
 			change(e) {
@@ -558,7 +582,7 @@
 		color: #ffffff;
 		display: inline-block;
 		float: right;
-		width: 180rpx;
+		width: 480rpx;
 		height: 60rpx;
 		margin: 15rpx 15rpx 0rpx 15rpx;
 		line-height: 60rpx;
@@ -586,7 +610,7 @@
 	}
 	.data-list {
 		border-bottom: 1px solid #d8d8d8;
-		height: 280rpx;
+		height: 450rpx;
 		margin: 15rpx;
 		border-radius: 20rpx;
 	}
@@ -618,7 +642,7 @@
 		display: inline-block;
 		float: right;
 		height: 180rpx;
-		line-height: 180rpx;
+		line-height:480rpx;
 	}
 	/* display: inline-block;
 	float: right;

--
Gitblit v1.9.1