From b4416d1e1c0c292875820a3a510a1bc3488cb1f7 Mon Sep 17 00:00:00 2001
From: whycq <123456>
Date: 星期四, 10 十一月 2022 12:37:41 +0800
Subject: [PATCH] #

---
 pages/basics/orderPakin.vue |   85 ++++++++++++++++++++++++++++++++----------
 1 files changed, 64 insertions(+), 21 deletions(-)

diff --git a/pages/basics/orderPakin.vue b/pages/basics/orderPakin.vue
index 8eadd85..dff88a9 100644
--- a/pages/basics/orderPakin.vue
+++ b/pages/basics/orderPakin.vue
@@ -21,8 +21,7 @@
 				</view>
 				<view class="square-content">
 					<view class="content-input">
-						<input readonly="value" v-model="locNo" type="text" placeholder="鎵爜 / 杈撳叆" 
-						>
+						<input readonly="value" v-model="locNo" type="text" placeholder="鎵爜 / 杈撳叆" >
 						<uni-icons type="closeempty" size="20" color="#dadada" @click="remove('locNo')"></uni-icons>
 					</view>
 				</view>
@@ -40,7 +39,7 @@
 				<view class="data-list-left">
 					<view class="matnr"><text style="width: 400rpx;">缂栫爜锛歿{item.matnr}}</text></view>
 					<view><text style="width: 400rpx;">鍝佸悕锛歿{item.maktx}}</text></view>
-					<view><text style="width: 400rpx;">鎵瑰彿锛歿{item.beBatch}}</text></view>
+					<view><text style="width: 400rpx;">鎵瑰彿锛歿{item.batch}}</text></view>
 					<view>
 						<text style="width: 400rpx;">鏁伴噺锛歿{item.anfme}}</text>
 					</view>
@@ -58,11 +57,7 @@
 			<view class="revise-box">
 				<view class="revise-box-top">
 					<view class="color-block-blue"></view>
-					<text class="title">淇敼鎵瑰彿/鏁伴噺</text>
-				</view>
-				<view class="" style="position: relative;left: 50px;margin-bottom: 20px;">
-					<text style="display: inline-block;float: left;width: 50px;">鎵瑰彿锛�</text>
-					<input type="text" style="width: 100px;border-bottom: 1px solid #9e9e9e;" v-model="beBatch">
+					<text class="title">淇敼</text>
 				</view>
 				<view class="changeBox">
 					<view class="num-box">
@@ -92,6 +87,12 @@
 				<button class="cu-btn bg-blue " @click="comb()">涓婃灦</button>
 			</label>
 		</view>
+		<view>
+			<!-- 鎻愮ず淇℃伅寮圭獥 -->
+			<uni-popup ref="message" type="message">
+				<uni-popup-message :type="msgType" :message="messageText" :duration="2000"></uni-popup-message>
+			</uni-popup>
+		</view>
 	</view>
 </template>
 
@@ -105,10 +106,9 @@
 				matData: '',
 				barcodeFocus:true,
 				count: 0,
-				beBatch: '',
-				
-				
-				
+				batch: '',
+				msgType: 'success',
+				messageText: '杩欐槸涓�鏉℃垚鍔熸彁绀�',
 			}
 		},
 		mounted(){
@@ -131,14 +131,21 @@
 			},
 			analysis() {
 				let that = this
-				console.log(this.orderNo);
 				let str = that.orderNo.split(';')
+				
 				that.orderNo = str[0]
-				console.log(str[0]);
+				if(that.matList.length>0) {
+					if(str[1] != that.matList[0].orderno){
+						uni.showToast({title: '璇风‘璁や笂鏋跺崟鍙�', icon: "none", position: 'top'});
+						return;
+					}
+				}
 				uni.request({
 				    url: that.commonUrl + '/mat/auth',
 				    data: {
-						matnr:str[1]
+						orderno:str[0],
+						matnr:str[1],
+						batch:str[2]
 				    },
 				    header: {
 						'token':uni.getStorageSync('token')
@@ -147,7 +154,8 @@
 						uni.vibrateShort();
 						let res = result.data
 						if (res.code === 200 && res.data) {
-							res.data.beBatch = str[2]
+							res.data['orderno'] = str[1]
+							res.data.batch = str[2]
 							that.matData = res.data
 							that.matnr = ''
 							uni.navigateTo({
@@ -155,16 +163,23 @@
 								events: {
 								    // 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
 								    matList: function(data) {
-										console.log(data);
 										that.matList.push(data.data)
 									},
 								},
 								success: function(res) {
 									// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
-									console.log(that.matData);
 									res.eventChannel.emit('matData', { data: that.matData })
 								},
 							});
+						} else if(res.code === 403) {
+							uni.showToast({title: res.msg, icon: "none", position: 'top'})
+							setTimeout(() => {
+								uni.reLaunch({
+									url: '../login/login'
+								});
+							}, 1000);
+						} else {
+							uni.showToast({title: res.msg, icon: "none",position: 'top'})
 						}
 						
 					}
@@ -172,6 +187,7 @@
 			},
 			revise(item,index) {
 				this.count = this.matList[index].anfme
+				this.batch = this.matList[index].batch
 				this.rowNum = index
 				this.eject()
 			},
@@ -185,7 +201,7 @@
 			},
 			confirm() {
 				this.matList[this.rowNum].anfme = this.count
-				this.matList[this.rowNum].beBatch = this.beBatch
+				this.matList[this.rowNum].batch = this.batch
 				this.$refs.revise.close()
 				this.$forceUpdate() // 寮哄埗鍒锋柊
 			},
@@ -204,9 +220,8 @@
 				combParam['locNo'] = that.locNo
 				combParam['orderNo'] = that.orderNo
 				combParam['combMats'] = that.matList
-				console.log(JSON.stringify(combParam));
 				uni.request({
-					url: that.commonUrl + '/mobile/mat/onSale/auth',
+					url: that.commonUrl + '/order/in',
 					data: JSON.stringify(combParam),
 					header: { 'token':uni.getStorageSync('token'),},
 					method:'POST',
@@ -227,6 +242,24 @@
 						}
 					}
 				})
+			},
+			// 閲嶇疆
+			resst() {
+				this.locNo = ''
+				this.orderNo = ''
+				this.matList = []
+			},
+			// 绉婚櫎鐗╂枡
+			removeItem(item,index) {
+				this.matList.splice(index,1)
+				// this.listLen = this.matList.length
+				this.messageToggle('success')
+				this.messageText = '绉婚櫎鎴愬姛'
+			},
+			messageToggle(type) {
+				this.msgType = type
+				this.messageText = ''
+				this.$refs.message.open()
 			},
 		}
 	}
@@ -316,4 +349,14 @@
 		line-height: 50rpx;
 		margin-top: 10rpx;
 	}
+	.changeBox {
+		width: 400rpx;
+		height: 100rpx;
+	}
+	.num-box {
+		margin-left: 100rpx;
+	}
+	.revise-box-buttom{
+		margin-left: 130rpx;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1