From 1e40a94e41a811a30b49150b5feabe9b7797948a Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期二, 14 五月 2024 08:23:06 +0800
Subject: [PATCH] #

---
 pages/phyz/AGV/AGVPakin3.vue |  134 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 102 insertions(+), 32 deletions(-)

diff --git a/pages/phyz/AGV/AGVPakin3.vue b/pages/phyz/AGV/AGVPakin3.vue
index 1f45943..9ee4977 100644
--- a/pages/phyz/AGV/AGVPakin3.vue
+++ b/pages/phyz/AGV/AGVPakin3.vue
@@ -6,9 +6,18 @@
 					@input="findOrder()">
 			</view>
 			<view class="item">
-				<input type="text" placeholder=" 鎵爜 / 杈撳叆 鏂欑鐮�" v-model="barcode" :focus="barcodeFocus"
+				<input type="text" placeholder=" 鎵爜 / 杈撳叆 璐ф灦鐮�" v-model="barcode" :focus="barcodeFocus"
 					@input="barcodeInput()">
 			</view>
+			<!-- <view class="item">
+				<view class="dropdown" @click="toggleDropdown()">
+					<input type="text" style="width: 650rpx;" v-model="containerType"  placeholder="璇烽�夋嫨璐ф灦绫诲瀷">
+					<uni-icons :type="isOpen ? 'top' : 'bottom'" color="#c1c1c1" style="margin-left: 10rpx;"></uni-icons>
+					<scroll-view scroll-y="ture" class="dropdown-content" v-if="isOpen">
+						<view class="dropdown-item" v-for="option in selects" @click="selected(option)">{{option}}</view>
+					</scroll-view>
+				</view>
+			</view> -->
 			<view class="item">
 				<input type="text" placeholder=" 鎵爜 / 杈撳叆 鏆傚瓨浣�" v-model="stationCode" :focus="stationCodeFocus"
 					@input="stationCodeInput()">
@@ -24,13 +33,19 @@
 						<view class="desc">No锛�</view>
 						<view class="left-item">{{i + 1}}</view>
 					</view>
-					<!-- <view class="list-left-item">
-						<view class="desc">绠辩爜锛�</view>
+					<view class="list-left-item">
+						<view class="desc">璁㈠崟鍙凤細</view>
 						<view class="left-item">
-							<input type="text" v-model="item.containerCode">
-							<uni-tag :text="item.containerCode" type="primary"></uni-tag>
+							<input type="text" v-model="item.csocode">
+							<!-- <uni-tag :text="item.csocode" type="primary"></uni-tag> -->
 						</view>
-					</view> -->
+					</view>
+					<view class="list-left-item">
+						<view class="desc">鑷敱椤癸細</view>
+						<view class="left-item">
+							<input type="text" v-model="item.isoseq">
+						</view>
+					</view>
 					<view class="list-left-item">
 						<view class="desc">缂栫爜锛�</view>
 						<view class="left-item">
@@ -58,6 +73,7 @@
 				</view>
 				<view class="list-right">
 					<uni-icons type="compose" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
+					<view style="width: 10rpx;"></view>
 					<uni-icons type="trash" color="#f58a8a" size="24" @click="remove(item,i,'warn')"></uni-icons>
 				</view>
 			</view>
@@ -89,7 +105,7 @@
 					<view class="popup-item">
 						<view class="popup-item-left">鏁伴噺:</view>
 						<view class="popup-item-right" style="border: none;justify-content: center;">
-							<uni-number-box :value="count" :step='0.01' :max="9999999" color="#747474" @change="changeValue" />
+							<uni-number-box :value="count" :step='1' :max="9999999" color="#747474" @change="changeValue" />
 						</view>
 					</view>
 					<view class="btn">
@@ -150,6 +166,7 @@
 				barcode: '',
 				orderNo: '',
 				stationCode: '',
+				containerType: '',
 				dataList: [],
 				count: 0,
 				rowNum: '',
@@ -170,8 +187,11 @@
 				devNo: [],
 				flag: 0,
 				tempOrderInfo: {csocode: '',isoseq: ''},
-				hide: true,
-				hidebg: 'kb-bgtr'
+				hide: false,
+				hidebg: 'kb-bgtr',
+				isOpen: false,
+				selects: [1,2,3,4],
+				kind: 'pakin'
 			}
 		},
 		onLoad() {
@@ -192,6 +212,9 @@
 			eventChannel.on('mats', function(data) {
 				console.log(data);
 				that.orderNo = data.mats[0].orderNo
+				for (let k of data.mats) {
+					k.anfme = 0
+				}
 				that.dataList = data.mats
 			})
 		},
@@ -210,6 +233,12 @@
 				} else {
 					this.hidebg = 'kb-bgfa'
 				}
+			},
+			toggleDropdown() {
+				this.isOpen = !this.isOpen
+			},
+			selected(option) {
+				this.containerType = option
 			},
 			findOrder() {
 				let that = this
@@ -267,7 +296,7 @@
 			stationCodeInput() {
 				setTimeout(() => {
 					var len = this.stationCode.length
-					if (len != 15) {
+					if (len != 7) {
 						this.stationCode = ''
 						this.stationCodeFocus = true
 						uni.showToast({
@@ -289,13 +318,19 @@
 				}, 200)
 			},
 			barcodeInput() {
-				// 涓嶈缃畾鏃跺櫒 浼氬嚭鐜版壂鍏ョ殑瀛楃涓蹭笉鍏�
-				if (this.barcode.split('_')[1]) {
-					this.barcode = this.barcode.split('_')[1]
-				} 
+				let val = this.barcode.substring(0,2)
+				if (val == '10') {
+					this.containerType = 1
+				} else if(val == '20') {
+					this.containerType = 2
+				} else if (val == '21') {
+					this.containerType = 3
+				} else if (val == '30') {
+					this.containerType = 4
+				}
 				setTimeout(() => {
 					var len = this.barcode.length
-					if (len != 10) {
+					if (len != 6) {
 						this.barcode = ''
 						this.barcodeFocus = true
 						uni.showToast({
@@ -528,14 +563,13 @@
 						return;
 					}
 				}
-				// console.log(that.dataList);
-				// return
 				uni.request({
 					url: that.baseUrl + '/agvMobile/comb/auth',
 					data: JSON.stringify({
 						orderNo: that.orderNo,
 						barcode: that.barcode,
 						locno: that.stationCode,
+						// containerType: this.containerType,
 						combMats: that.dataList
 					}),
 					method: 'POST',
@@ -550,9 +584,11 @@
 								that.resst();
 								that.messageText = "缁勬墭鎴愬姛"
 								that.messageToggle('success')
-								uni.navigateBack({
-									delta: 2
-								});
+								setTimeout(()=> {
+									uni.navigateBack({
+										delta: 2
+									});
+								},700)
 							}
 						} else if (res.code == 403) {
 							that.messageText = res.msg
@@ -623,24 +659,37 @@
 			},
  			start() {
 				let that = this
+				let params = []
+				if (this.kind == 'pakin') {
+					let param = {
+						devNo: this.stationCode,
+						containerCode: this.barcode,
+						// containerType: this.containerType,
+						}
+					params.push(param)
+				} else {
+					let param = {
+						devNo: this.stationCode,
+						containerType: this.containerType,
+						}
+					params.push(param)
+				}
 				uni.request({
-					url: that.baseUrl + '/agvMobile/pakin/auth',
-					data: JSON.stringify({
-						devNo: that.devNo
-					}),
+					url: that.baseUrl + '/agvMobile/pakin/empty/auth',
+					data: {pad: params},
 					method: 'POST',
-					header: {
-						'token': uni.getStorageSync('token')
-					},
+					header: {'token': uni.getStorageSync('token')},
 					success(result) {
 						var res = result.data
 						if (res.code === 200) {
 							that.resst();
 							that.messageText = "鍚姩鎴愬姛"
 							that.messageToggle('success')
-							uni.navigateBack({
-								delta: 2
-							});
+							setTimeout(()=>{
+								uni.navigateBack({
+									delta: 2
+								});
+							},700)
 						} else if (res.code == 403) {
 							that.messageText = res.msg
 							that.messageToggle('error')
@@ -687,9 +736,7 @@
 		height: 50rpx;
 		line-height: 50rpx;
 		/* font-family: PingFang SC; uniapp 榛樿瀛椾綋涓嶅眳涓� */
-		font-size: 36upx;
 		font-family: PingFang SC;
-		width: 55vw;
 
 	}
 
@@ -716,4 +763,27 @@
 		text-align: center;
 		box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.5);
 	}
+	.dropdown {
+		position: relative;
+		display: flex;
+		align-items: center;
+		padding: 0rpx 20rpx;
+	}
+	.dropdown-content {
+		position: absolute;
+		top: calc(100% + 15rpx);
+		left: 0;
+		width: calc(100% - 20rpx);
+		max-height: 300rpx;
+		background-color: #fff;
+		box-shadow: 0 0px 6px rgba(0, 0, 0, 0.3);
+		border-radius: 8rpx;
+		z-index: 10;
+	}
+	.dropdown-item {
+		padding: 12rpx;
+		line-height: 1.2;
+		font-size: 12rpx;
+		color: #3a3a3a;
+	}
 </style>
\ No newline at end of file

--
Gitblit v1.9.1