From 019a83aab02d22616ea68d55a83d1925b6e94102 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期六, 02 三月 2024 16:16:07 +0800
Subject: [PATCH] #

---
 pages/basics/order.vue |   82 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 71 insertions(+), 11 deletions(-)

diff --git a/pages/basics/order.vue b/pages/basics/order.vue
index 47dd66d..80f81af 100644
--- a/pages/basics/order.vue
+++ b/pages/basics/order.vue
@@ -36,12 +36,12 @@
 				</view>
 				<view class="square-content">
 					<view class="content-input-btn">
-						<input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findMat()"
+						<input v-model="order" type="text" placeholder="鎵爜 / 杈撳叆" @input="findOrder()"
 						:focus="focus" placeholder-style="line-height:  85rpx;">
-						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeMatnr()"></uni-icons>
+						<uni-icons type="closeempty" size="20" color="#dadada" @click="removeOrder()"></uni-icons>
 					</view>
 					<view class="content-btn">
-						<button class="cu-btn bg-blue pda-btn" @click="selectMat()">+鎻愬彇</button>
+						<button class="cu-btn bg-blue pda-btn" @click="selectOrder()">+鎻愬彇</button>
 					</view>
 				</view>
 			</view>
@@ -76,6 +76,8 @@
 					<view class="data-list-left">
 						<view class="matnr"><text style="width: 700rpx;">缂栫爜锛歿{item.matnr}}</text></view>
 						<view><text style="width: 700rpx;">鍝佸悕锛歿{item.maktx}}</text></view>
+						<view><text style="width: 700rpx;">鍚堝悓鍙凤細{{item.model}}</text></view>
+						<view><text style="width: 700rpx;">绠卞彿锛歿{item.xh}}</text></view>
 						<view><text style="width: 700rpx;">鎵瑰彿锛歿{item.batch}}</text></view>
 						<view>
 							<text style="width: 700rpx;">鏁伴噺锛歿{item.anfme}}</text>
@@ -123,7 +125,7 @@
 						<view class="num-box">
 							<uni-number-box v-model="count" :min="minCount" :max="maxCount" color="#747474"  @change="changeValue"/>
 						</view> 
-						<button class="cu-btn" @click="changeMax">max</button>
+						<!-- <button class="cu-btn" @click="changeMax">max</button> -->
 					</view>
 					<view class="revise-box-buttom">
 						<view>
@@ -161,6 +163,7 @@
 				check:false,
 				checkText:'鍏ㄩ��',
 				checkedData:[],
+				matData: ''
 			}
 		},
 		mounted(){
@@ -176,6 +179,60 @@
 			// 鑾峰彇url
 			getUrl() {
 				this.commonUrl = this.baseHttp + this.baseIP + ':' +this.basePORT + "/" +this.baseUrl
+			},
+			selectOrder() {
+				let that = this
+				uni.vibrateShort();
+				uni.navigateTo({
+					url: "orderSelect",
+					events: {
+					    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�  鍙﹀涓�涓〉闈紶杩囨潵鐨�
+					    acceptDataFromOpenedPage: function(data) {
+							that.matData = data.data
+							setTimeout(()=> {
+								that.findMat1()
+							},100)
+					    },
+					},
+					success: function(res) {
+					    // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�   鍚戝彟澶栦竴涓〉闈紶閫掑�肩殑
+					    res.eventChannel.emit('commonUrl', {commonUrl:that.commonUrl })
+					},
+					
+				});
+				that.matnr = ''
+			},
+			findMat1() {
+				let that = this
+				uni.navigateTo({
+					url: "orderQuery",
+					events: {
+					    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+					    matList1: function(data) {
+							that.checkMat(data.data)
+							// that.matList.push(data.data)
+						},
+					},
+					success: function(res) {
+						// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+						res.eventChannel.emit('matData', { data: that.matData })
+					},
+				});
+				
+			},
+			checkMat(mat) {
+				var len = this.matList.length
+				var add = true
+				for (var i = 0; i < len; i++) {
+					if (mat.matnr == this.matList[i].matnr) {
+						this.matList[i].anfme += mat.anfme 
+						this.$forceUpdate() // 寮哄埗鍒锋柊
+						add = false
+					}
+				}
+				if (add) {
+					this.matList.unshift(mat)
+				}
 			},
 			// barcode input 浜嬩欢
 			barcodeInput() {
@@ -356,11 +413,14 @@
 						let res = result.data
 						if (res.code === 200) {
 							if(res.data) {
-									uni.showLoading();
-								that.matList = res.data;
+								uni.showLoading();
+								// res.data[0].combMats
+								for (let k in res.data[0].combMats) {
+									res.data[0].combMats[k]['id'] = k + 1
+								}
+								that.matList = res.data[0].combMats;
 								that.orderNo = that.order
 								that.initAnfme()
-								console.log(that.matList)
 							}
 						} else if (res.code == 403) {
 							uni.showToast({title: res.msg, icon: "none", position: 'top'})
@@ -559,7 +619,7 @@
 	}
 	.data-list {
 		border-bottom: 1px solid #d8d8d8;
-		height: 180rpx;
+		height: 250rpx;
 		margin: 15rpx;
 		border-radius: 20rpx;
 	}
@@ -584,13 +644,13 @@
 		height: 100%;
 		width: 100rpx;
 		text-align: center;
-		line-height: 170rpx;
+		line-height: 250rpx;
 	}
 	.data-list-left {
 		/* background-color: #ffff7f; */
 		display: inline-block;
 		float: left;
-		height: 180rpx;
+		height: 250rpx;
 		width: 500rpx;
 		color: #676767;
 	}
@@ -603,7 +663,7 @@
 		float: right;
 		width: 100rpx;
 		height: 180rpx;
-		line-height: 180rpx;
+		line-height: 250rpx;
 	}
 	.data-list-right label {
 		display: inline-block;

--
Gitblit v1.9.1