From 7839d94fc246556baf6f05db92e3ae20bcf36245 Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 05 四月 2024 14:35:07 +0800
Subject: [PATCH] #

---
 pages/phyz/stationManage/stationDetl.vue |  141 ++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 134 insertions(+), 7 deletions(-)

diff --git a/pages/phyz/stationManage/stationDetl.vue b/pages/phyz/stationManage/stationDetl.vue
index 83aa8b4..c314871 100644
--- a/pages/phyz/stationManage/stationDetl.vue
+++ b/pages/phyz/stationManage/stationDetl.vue
@@ -1,7 +1,7 @@
 <template>
 	<view>
 		<!-- 绔欑偣璇︽儏 -->
-		<view class="station" :class="station.style" >
+		<view class="station" :class="station.style" v-if="station">
 			<view class="mt-flex">
 				<view class="station-title" style="flex: 1;">{{station.devNo}}</view>
 				<view><button size="mini" :loading="reload.loading" @click="reloadStation()">{{reload.loadingText}}</button></view>
@@ -15,16 +15,34 @@
 			</view>
 		</view>
 		
-		
+		<!-- 寮圭獥 -->
+		<!-- 淇敼鏁伴噺 -->
+		<view>
+			<uni-popup ref="emptyPakin" type="dialog">
+				<view class="popup">
+					<!-- 鏍囬 -->
+					<view class="title">璇疯緭鍏ョ┖璐ф灦鐮�</view>
+					<view class="popup-item">
+						<view class="popup-item-left">璐ф灦鐮�:</view>
+						<view class="popup-item-right"><input type="text" v-model="barcode"></view>
+					</view>
+					<view class="btn">
+						<view class="btn-left" @click="emptyPakinClose">鍙栨秷</view>
+						<view class="btn-right" @click="emptyPakinConfirm()">鍏ュ簱</view>
+					</view>
+				</view>
+			</uni-popup>
+		</view>
 		
 		
 		
 		
 		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
 		<view class="buttom">
-			<button size="mini" type="primary" @click="emptyPakin(searchValue)" v-if="btnType == 'emptyPakin'">绌烘澘鍏ュ簱</button>
-			<button size="mini" type="primary" @click="containerMoveOut(searchValue)" v-if="btnType == 'out'">纭鍑哄簱</button>
-			<button size="mini" type="primary" @click="pickIn(searchValue)" v-if="btnType == 'pick'">宸叉嫞鏂欏洖搴�</button>
+			<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="containerMoveOut()" v-if="btnType == 'out'">纭鍑哄簱</button>
+			<button size="mini" type="primary" @click="pickIn()" v-if="btnType == 'pick'">宸叉嫞鏂欏洖搴�</button>
 		</view>
 	</view>
 </template>
@@ -38,10 +56,11 @@
 					loading: false,
 					loadingText: '鏇存柊鐘舵��'
 				},
-				btnType: 'emptyPakin'
+				btnType: 'emptyPakin',
+				barcode: ''
 			}
 		},
-		onLoad() {
+		onShow() {
 			let _this = this
 			this.baseUrl = uni.getStorageSync('baseUrl');
 			this.token = uni.getStorageSync('token');
@@ -51,6 +70,7 @@
 			eventChannel.on('item', function(data) {
 				console.log(data);
 				_this.station = data.item
+				_this.reloadStation()
 			})
 		},
 		methods: {
@@ -67,6 +87,13 @@
 					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') {
+								_this.btnType = 'pakin' 
+							} else {
+								_this.btnType = 'working' 
+							}
 							setTimeout(()=>{
 								for  (let k of res.data.records) {
 									if (k.locSts != 'O') {
@@ -112,6 +139,41 @@
 						}
 					}
 				})
+			},
+			// 绌烘澘鍏ュ簱纭
+			emptyPakin() {
+				this.$refs.emptyPakin.open()
+			},
+			emptyPakinClose() {
+				this.$refs.emptyPakin.close()
+			},
+			emptyPakinConfirm() {
+				this.emptyPakinClose()
+				let _this = this;
+				let params = []
+				let param = { devNo: this.station.devNo, containerCode: this.barcode, }
+				params.push(param)
+				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
+						if (res.code === 200) {
+							setTimeout(()=> {
+								_this.barcode = ''
+								_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' })
+						}
+					}
+				});
 			}
 		}
 	}
@@ -141,4 +203,69 @@
 		background-color: #3eb689;
 		color: #fff;
 	}
+	
+	
+	.popup {
+		width: 80vw;
+		min-height: 100rpx;
+		background-color: #FFF;
+		border-radius: 25rpx;
+	}
+	.title {
+		height: 100rpx;
+		line-height: 100rpx;
+		width: 100%;
+		color: #606266;
+		text-align: center;
+		font-size: 16px;
+	}
+	.popup-item {
+		height: 80rpx;
+		line-height: 80rpx;
+		display: flex;
+		align-items: center;
+		font-size: 14px;
+	}
+	.popup-item-left {
+		width: 16vw;
+		padding-right: 20rpx;
+		text-align: right;
+		color: #606266;
+	}
+	.popup-item-right {
+		display: flex;
+		align-items: center;
+		width: 50vw;
+		height: 50rpx;
+		padding: 2px 5px;
+		border: 1px solid #E4E7ED;
+		border-radius: 5rpx;
+	}
+	.popup-item-right input{
+		color: #606266;
+	}
+	.btn {
+		display: flex;
+		height: 90rpx;
+		margin-top: 20rpx;
+		border-top: 1px solid #DCDFE6;
+		justify-content: center;
+		align-items: center;
+	}
+	.btn-left {
+		display: flex;
+		flex: 1;
+		height: 100%;
+		justify-content: center;
+		align-items: center;
+		color: #606266;
+		border-right: 1px solid #DCDFE6;
+	}
+	.btn-right {
+		display: flex;
+		flex: 1;
+		justify-content: center;
+		align-items: center;
+		color: #409EFF;
+	}
 </style>

--
Gitblit v1.9.1