From 51ff61a68be3db46dbaef2677986b396736b1198 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期四, 05 十二月 2024 08:19:48 +0800
Subject: [PATCH] #

---
 pages/order/orderPakin2.vue |  221 ++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 154 insertions(+), 67 deletions(-)

diff --git a/pages/order/orderPakin2.vue b/pages/order/orderPakin2.vue
index f34ba9d..21eb7bf 100644
--- a/pages/order/orderPakin2.vue
+++ b/pages/order/orderPakin2.vue
@@ -4,23 +4,28 @@
 			<view class="item">
 				<view class="code-decs">璁㈠崟鍙�:</view>
 				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="orderNo" :focus="orderNoFocus" @input="findOrder()">
-			</view>
-			<view class="item">
-				<view class="code-decs">鏈ㄧ绫诲瀷:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="boxType" :focus="boxTypeFocus">
-			</view>
-			<view class="item">
-				<view class="code-decs">鐮佸灈浣�:</view>
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="palletizingNo2" :focus="palletizingNo2Focus">
-				<view class="item-right">
-					<uni-icons type="right" color="#c1c1c1"></uni-icons>
+				<view class="item-right" @click="clearOrderNo()">
+					<uni-icons type="close" color="#c1c1c1"></uni-icons>
 				</view>
 			</view>
+			<!-- <view class="item">
+				<view class="code-decs">鏈ㄧ绫诲瀷:</view>
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="boxType" :focus="boxTypeFocus">
+			</view> -->
+			<!-- <view class="item">
+				<view class="code-decs">鐮佸灈浣�:</view>
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆" v-model="palletizingNo2" :focus="palletizingNo2Focus">
+				<view class="item-right" @click="selectPst()">
+					<uni-icons type="right" color="#c1c1c1"></uni-icons>
+				</view>
+			</view> -->
 		</view>
 		<view class="mat-list-title">
 			<view class="title-item"></view>
 			<view class="title-item">鍟嗗搧鍒楄〃</view>
-			<view class="title-item"><button size="mini" type="primary" @click="addMat()">娣诲姞</button></view>
+			<view class="title-item">
+				<button size="mini" type="primary" @click="orderSelect()">鎻愬彇</button>
+			</view>
 			
 		</view>
 		<u-empty v-show="dataList.length == 0" mode="list" icon="http://cdn.uviewui.com/uview/empty/list.png" style="position:fixed;top: 60%;left: 50%;transform: translate(-50%, -50%);">
@@ -60,7 +65,7 @@
 						<view class="left-item">{{item.anfme}}</view>
 					</view> -->
 					<view class="list-left-item">
-						<view class="desc">鎵瑰彿锛�</view>
+						<view class="desc">绠卞彿锛�</view>
 						<view class="left-item">
 							<uni-tag :text="item.batch" type="warning"></uni-tag>
 						</view>
@@ -136,6 +141,17 @@
 					@confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
 			</uni-popup>
 		</view>
+		<!-- 寮圭獥閫夋嫨 -->
+		<uni-popup ref="inputDialog" type="dialog">
+			<view class="pop">
+				<view class="pop-btn" @click="select('118')">
+					118鍙风爜鍨涗綅
+				</view>
+				<view class="pop-btn" @click="select('119')">
+					119鍙风爜鍨涗綅
+				</view>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
@@ -148,10 +164,11 @@
 				orderNo: '',
 				barcode: '',
 				palletizingNo: '',
+				palletizingNo2: '',
 				boxType: '',
 				createTime: '',
-				dataList: [{}],
-				count: 0,
+				dataList: [],
+				count: 1,
 				rowNum: '',
 				matnr: '',
 				batch: '',
@@ -163,7 +180,9 @@
 				title: '',
 				content: '',
 				barcodeFocus: true,
+				orderNoFocus: false,
 				palletizingNoFocus: false,
+				palletizingNo2Focus: false,
 				boxTypeFocus: false,
 				createTimeFocus: false,
 				matFocus: false,
@@ -177,20 +196,91 @@
 			this.token = uni.getStorageSync('token');
 		},
 		methods: {
+			// clearOrderNo
+			clearOrderNo() {
+				this.orderNo = ''
+				this.orderNoFocus = false
+				setTimeout(()=>{
+					this.orderNoFocus = true
+				},100)
+			},
 			// 鑾峰彇閫�搴撳崟
 			findOrder() {
 				let _this = this 
 				uni.request({
-					url: `${_this.baseUrl}/order/search/orderNo/auth/v2`,
-					header: { 'token': uni.getStorageSync('token') },
-					data: { orderNo: _this.orderNo },
+					url: `${_this.baseUrl}/mobile/order/search/orderNo/auth/v2`,
+					header: { 
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {orderNo: _this.orderNo},
 					method: 'POST',
-					success(res) {
-						res = res.data
-						if (res.code === 200 && res.data) {
-							_this.dataList = res.data
+					success(result) {
+						result = result.data
+						if (result.code === 200 && result.data) {
+							uni.navigateTo({
+								url: "../order/orderDetls",
+								// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+								success: function(res) {
+									res.eventChannel.emit('orderDetls', {
+										data: result.data[0].combMats
+									})
+								},
+								// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+								events: {
+									detl: function(data) {
+										_this.dataList.push(data.data)
+									},
+								},
+							});
+							
 						} else {
-							uni.showToast({ title: res.msg, icon: "none", position: 'top' })
+							uni.showToast({ title: result.msg, icon: "none", position: 'top' })
+						}
+					}
+				})
+			},
+			// 閫夋嫨鐮佸灈浣�
+			selectPst() {
+				this.$refs.inputDialog.open()
+			},
+			select(e) {
+				this.palletizingNo2 = e
+				this.$refs.inputDialog.close()
+			},
+			// 鎻愬彇璁㈠崟
+			orderSelect() {
+				let _this = this
+				uni.request({
+					url: `${_this.baseUrl}/mobile/order/search/orderNo/auth/v2`,
+					header: { 
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: {orderNo: ''},
+					method: 'POST',
+					success(result) {
+						result = result.data
+						if (result.code === 200 && result.data) {
+							uni.navigateTo({
+								url: "../order/orderDetls2",
+								// 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+								success: function(res) {
+									res.eventChannel.emit('orderDetls', {
+										data: result.data
+									})
+								},
+								// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�佸埌褰撳墠椤甸潰鐨勬暟鎹�
+								events: {
+									detls: function(data) {
+										_this.orderNo = data.data.orderNo
+										_this.findOrder()
+									},
+								},
+							});
+							
+						} else {
+							uni.showToast({ title: result.msg, icon: "none", position: 'top' })
 						}
 					}
 				})
@@ -368,6 +458,7 @@
 				this.count = this.dataList[i].anfme
 				this.batch = this.dataList[i].batch
 				this.weight = this.dataList[i].weight
+				this.position = this.dataList[i].position
 				this.rowNum = i
 				this.eject()
 			},
@@ -397,6 +488,7 @@
 				this.dataList[this.rowNum].anfme = this.count
 				this.dataList[this.rowNum].batch = this.batch
 				this.dataList[this.rowNum].weight = this.weight
+				this.dataList[this.rowNum].position = this.position
 				this.matnr = ''
 				this.messageText = "淇敼鎴愬姛"
 				this.messageToggle('success')
@@ -419,15 +511,16 @@
 			},
 			comb() {
 				let that = this;
-				that.combCheck(that.palletizingNo,that.boxType,that.createTime);
+				that.combCheck(that.palletizingNo2,that.boxType,that.createTime);
 				if (that.checkFlag) {
 					return
 				}
 				uni.request({
-					url: that.baseUrl + '/mobile/truss/auth',
+					url: that.baseUrl + '/mobile/truss/order/auth',
 					data: JSON.stringify({
+						orderNo: that.orderNo,
 						barcode: that.barcode,
-						combMats: that.dataList
+						matList: that.dataList
 					}),
 					method: 'POST',
 					header: {
@@ -439,9 +532,6 @@
 							that.resst();
 							that.messageText = "閫�搴撴垚鍔�"
 							that.messageToggle('success')
-							const innerAudioContext = uni.createInnerAudioContext();
-							innerAudioContext.src = '/static/music/pakinOk.mp3';
-							innerAudioContext.play()
 						} else if (res.code == 403) {
 							that.messageText = res.msg
 							that.messageToggle('error')
@@ -458,46 +548,24 @@
 				});
 			},
 			// 鎻愪氦鏍¢獙
-			combCheck(palletizingNo,boxType,createTime) {
-				if (palletizingNo === '') {
-					this.messageText = "璇锋坊鍔犵爜鍨涗綅"
-					this.messageToggle('error')
-					this.checkFlag = true;
-					return
-				}
-				if (boxType === '') {
-					this.messageText = "璇锋坊鍔犳湪绠辩被鍨�"
-					this.messageToggle('error')
-					this.checkFlag = true;
-					return
-				}
-				if (createTime === '') {
-					this.messageText = "璇锋坊鍔犲垱寤烘椂闂�"
-					this.messageToggle('error')
-					this.checkFlag = true;
-					return
-				}
+			combCheck(palletizingNo2,boxType,createTime) {
+				// if (palletizingNo2 === '') {
+				// 	this.messageText = "璇锋坊鍔犵爜鍨涗綅"
+				// 	this.messageToggle('error')
+				// 	this.checkFlag = true;
+				// 	return
+				// }
+				// if (boxType === '') {
+				// 	this.messageText = "璇锋坊鍔犳湪绠辩被鍨�"
+				// 	this.messageToggle('error')
+				// 	this.checkFlag = true;
+				// 	return
+				// }
 				if (this.dataList.length === 0) {
 					this.messageText = "璇锋坊鍔犻��搴撳晢鍝�"
 					this.messageToggle('error')
 					this.checkFlag = true;
 					return
-				}
-				for (let i = 0; i < this.dataList.length; i++) {
-					if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') {
-						this.messageText = this.dataList[i].matnr + '閫�搴撴暟閲忎笉鑳戒负0'
-						this.messageToggle('error')
-						this.checkFlag = true;
-						return
-					}
-				}
-				for (let i = 0; i < this.dataList.length; i++) {
-					if (this.dataList[i].anfme == 0 || this.dataList[i].anfme == '') {
-						this.messageText = this.dataList[i].matnr + '閫�搴撴暟閲忎笉鑳戒负0'
-						this.messageToggle('error')
-						this.checkFlag = true;
-						return
-					}
 				}
 				this.checkFlag = false;
 			},
@@ -521,6 +589,7 @@
 			resst() {
 				this.dataList = []
 				this.barcode = ''
+				this.orderNo = ''
 				this.barcodeFocuss()
 			},
 		}
@@ -530,7 +599,7 @@
 <style>
 	@import url('../../static/css/wms.css/wms.css');
 	.list:first-child {
-		margin-top: 320rpx;
+		margin-top: 200rpx;
 	}
 	.empty-list {
 		height: 50%;
@@ -542,7 +611,7 @@
 	.code {
 		width: 100%;
 		position: fixed;
-		min-height: 200rpx;
+		min-height: 70rpx;
 		background-color: #FFF;
 		z-index: 10;
 	}
@@ -568,7 +637,7 @@
 
 	.code-decs {
 		width: 21vw;
-		font-size: 18px;
+		font-size: 14px;
 		color: #303133;
 		text-align: right;
 	}
@@ -590,7 +659,7 @@
 		width: 100%;
 		background-color: white;
 		position: fixed;
-		margin-top: 210rpx;
+		margin-top: 70rpx;
 		z-index: 9;
 		/* border-top: 1px solid #DCDFE6; */
 		text-align: center;
@@ -606,5 +675,23 @@
 		display: flex;
 		align-items: center;
 	}
+	
+	.pop {
+		min-height: 200rpx;
+		width: 80vw;
+		background-color: #55aaff;
+		border-radius: 20rpx;
+		color: #eee;
+	}
+	.pop-btn {
+		height: 100rpx;
+		line-height: 100rpx;
+		width: 100%;
+		text-align: center;
+		border-bottom: 1px solid #ccc;
+	}
+	.pop-btn:last-child {
+		border: none;
+	}
 </style>
 

--
Gitblit v1.9.1