From 83f35c6890374a14270b297cb5645582a8107637 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 05 四月 2024 16:05:21 +0800
Subject: [PATCH] #

---
 pages/phyz/stationManage/stationDetl.vue   |  172 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 pages/phyz/stationManage/stationManage.vue |    5 -
 2 files changed, 167 insertions(+), 10 deletions(-)

diff --git a/pages/phyz/stationManage/stationDetl.vue b/pages/phyz/stationManage/stationDetl.vue
index c314871..7ae41fe 100644
--- a/pages/phyz/stationManage/stationDetl.vue
+++ b/pages/phyz/stationManage/stationDetl.vue
@@ -15,8 +15,16 @@
 			</view>
 		</view>
 		
+		
+		<!-- 宸ヤ綔妗� -->
+		<view class="wrkMast">
+			<view >宸ヤ綔鍙�</view>
+			<view>宸ヤ綔绫诲瀷</view>
+			<view>婧愬簱浣�</view>
+		</view>
+		
+		
 		<!-- 寮圭獥 -->
-		<!-- 淇敼鏁伴噺 -->
 		<view>
 			<uni-popup ref="emptyPakin" type="dialog">
 				<view class="popup">
@@ -34,13 +42,36 @@
 			</uni-popup>
 		</view>
 		
+		<!-- 寮圭獥 -->
+		<view>
+			<uni-popup ref="emptyOut" type="dialog">
+				<view class="popup">
+					<!-- 鏍囬 -->
+					<view class="title">璇烽�夋嫨璐ф灦绫诲瀷</view>
+					<view class="popup-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="btn">
+						<view class="btn-left" @click="emptyOutClose">鍙栨秷</view>
+						<view class="btn-right" @click="emptyOutConfirm()">鍑哄簱</view>
+					</view>
+				</view>
+			</uni-popup>
+		</view>
+		
 		
 		
 		
 		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
 		<view class="buttom">
 			<button size="mini" type="primary" @click="emptyPakin()" v-if="btnType == 'emptyPakin'">绌烘澘鍏ュ簱</button>
-			<button size="mini" type="primary" @click="emptyPakin()" v-if="btnType == 'emptyPakin'">绌烘澘鍏ュ簱</button>
+			<button size="mini" type="primary" @click="emptyOut()" v-if="btnType == 'emptyPakin'">鍛煎彨绌烘澘</button>
 			<button size="mini" type="primary" @click="containerMoveOut()" v-if="btnType == 'out'">纭鍑哄簱</button>
 			<button size="mini" type="primary" @click="pickIn()" v-if="btnType == 'pick'">宸叉嫞鏂欏洖搴�</button>
 		</view>
@@ -57,7 +88,11 @@
 					loadingText: '鏇存柊鐘舵��'
 				},
 				btnType: 'emptyPakin',
-				barcode: ''
+				barcode: '',
+				containerType: '',
+				selects: [],
+				option: '',
+				isOpen: false
 			}
 		},
 		onShow() {
@@ -87,6 +122,7 @@
 					success(res) {
 						res = res.data
 						if (res.code === 200) {
+							
 							if (res.data.records[0].locSts == 'O') {
 								_this.btnType = 'emptyPakin' 
 							} else if (res.data.records[0].locSts == 'F') {
@@ -94,6 +130,7 @@
 							} else {
 								_this.btnType = 'working' 
 							}
+							
 							setTimeout(()=>{
 								for  (let k of res.data.records) {
 									if (k.locSts != 'O') {
@@ -105,7 +142,10 @@
 								_this.station = res.data.records[0]
 								_this.reload.loading = false
 								_this.reload.loadingText = '鏇存柊鐘舵��'
+								_this.getContainerType()
 							},500)
+							
+							_this.getWrkMast()
 						} else if (res.code == 403) {
 							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
 							setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000);
@@ -148,18 +188,22 @@
 				this.$refs.emptyPakin.close()
 			},
 			emptyPakinConfirm() {
-				this.emptyPakinClose()
 				let _this = this;
+				if (this.barcode.length != 6) {
+					uni.showToast({ title: '璐ф灦鏉$爜寮傚父', icon: "error", position: 'top' })
+					return
+				}
 				let params = []
 				let param = { devNo: this.station.devNo, containerCode: this.barcode, }
 				params.push(param)
+				this.emptyPakinClose()
 				uni.request({
 					url: `${_this.baseUrl}/agvMobile/pakin/empty/auth`,
 					data: { pad: params },
 					method: 'POST',
 					header: { 'token': uni.getStorageSync('token') },
 					success(res) {
-						var res = result.data
+						var res = res.data
 						if (res.code === 200) {
 							setTimeout(()=> {
 								_this.barcode = ''
@@ -174,7 +218,87 @@
 						}
 					}
 				});
-			}
+			},
+			emptyOut() {
+				this.$refs.emptyOut.open()
+			},
+			emptyOutClose() {
+				this.$refs.emptyOut.close()
+			},
+			emptyOutConfirm() {
+				this.emptyOutClose()
+				let _this = this;
+				let params = []
+				let param = { devNo: this.station.devNo, containerType: this.containerType, }
+				params.push(param)
+				uni.request({
+					url: `${_this.baseUrl}/agvMobile/pakout/empty/auth`,
+					data: { pad: params },
+					method: 'POST',
+					header: { 'token': uni.getStorageSync('token') },
+					success(res) {
+						var res = result.data
+						if (res.code === 200) {
+							setTimeout(()=> {
+								_this.containerType = ''
+								_this.reloadStation()
+							},1000)
+							uni.showToast({ title: '鍛煎彨鎴愬姛', icon: "success", position: 'top' })
+						} else if (res.code == 403) {
+							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+							setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000);
+						} else {
+							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
+						}
+					}
+				});
+			},
+			getContainerType() {
+				let _this = this
+				uni.request({
+					url: `${_this.baseUrl}/agvMobile/pakout/empty/container/selector/auth`,
+					header: {'token': uni.getStorageSync('token')},
+					data: JSON.stringify({devNo: _this.station.devNo}),
+					method: 'POST',
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							_this.selects = res.data
+						}
+						console.log(res);
+					}
+				})
+			},
+			// 寮�鍚� / 鍏抽棴涓嬫媺妗�
+			toggleDropdown() {
+				this.isOpen = !this.isOpen
+			},
+			// 閫夋嫨璐ф灦绫诲瀷
+			selected(option) {
+				this.containerType = option
+			},
+			// 鏌ヨ宸ヤ綔妗�
+			getWrkMast() {
+				let _this = this
+				uni.request({
+					url: `${_this.baseUrl}/agv/wrkMast/list/auth`,
+					header: {'token': uni.getStorageSync('token')},
+					data: {
+						curr: 1,
+						limit: 1000,
+						condition:  _this.station.devNo
+					},
+					method: 'GET',
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							for (let item of res.data.records) {
+								
+							}
+						}
+					}
+				})
+			},
 		}
 	}
 </script>
@@ -205,11 +329,21 @@
 	}
 	
 	
+	.wrkMast {
+		
+	}
+	
+	
+	
+	
+	
+	
 	.popup {
 		width: 80vw;
 		min-height: 100rpx;
 		background-color: #FFF;
 		border-radius: 25rpx;
+		position: relative;
 	}
 	.title {
 		height: 100rpx;
@@ -220,6 +354,7 @@
 		font-size: 16px;
 	}
 	.popup-item {
+		position: relative;
 		height: 80rpx;
 		line-height: 80rpx;
 		display: flex;
@@ -268,4 +403,29 @@
 		align-items: center;
 		color: #409EFF;
 	}
+	
+	.dropdown {
+		position: relative;
+		display: flex;
+		width: 93%;
+		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: 22px;
+		color: #3a3a3a;
+	}
 </style>
diff --git a/pages/phyz/stationManage/stationManage.vue b/pages/phyz/stationManage/stationManage.vue
index 77b6f92..04e4a5a 100644
--- a/pages/phyz/stationManage/stationManage.vue
+++ b/pages/phyz/stationManage/stationManage.vue
@@ -118,13 +118,10 @@
 				option: 'pick'
 			}
 		},
-		onLoad() {
+		onShow() {
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
 			this.getBasDevp('all')
-		},
-		onShow() {
-			
 		},
 		methods: {
 			searchValueInput() {

--
Gitblit v1.9.1