From 2e288a3c734f8a06b5986606615a97c502b9429c Mon Sep 17 00:00:00 2001
From: whycq <913841844@qq.com>
Date: 星期五, 05 四月 2024 11:29:12 +0800
Subject: [PATCH] #

---
 pages/phyz/stationManage/stationDetl.vue |   45 ++++++++++++++++++++++++++++++---------------
 1 files changed, 30 insertions(+), 15 deletions(-)

diff --git a/pages/phyz/stationManage/stationDetl.vue b/pages/phyz/stationManage/stationDetl.vue
index 08e615c..83aa8b4 100644
--- a/pages/phyz/stationManage/stationDetl.vue
+++ b/pages/phyz/stationManage/stationDetl.vue
@@ -11,7 +11,7 @@
 			<view>绔欑偣鐘舵�侊細{{station.locSts$}}</view>
 			<view class="mt-flex">
 				<view class="station-barcode" style="flex: 1">璐ф灦鐮侊細<text>{{station.barcode ? station.barcode : '--'}}</text></view>
-				<view v-if="station.barcode"><button size="mini" type="warn" @click="unbind">瑙i櫎缁戝畾</button></view>
+				<view v-if="station.barcode"><button size="mini" type="warn" @click="unbind()">瑙i櫎缁戝畾</button></view>
 			</view>
 		</view>
 		
@@ -22,8 +22,9 @@
 		
 		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
 		<view class="buttom">
-			<button size="mini" type="primary" @click="containerMoveOut(searchValue)">纭鍑哄簱</button>
-			<button size="mini" type="primary" @click="pickIn(searchValue)">宸叉嫞鏂欏洖搴�</button>
+			<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>
 		</view>
 	</view>
 </template>
@@ -36,7 +37,8 @@
 				reload: {
 					loading: false,
 					loadingText: '鏇存柊鐘舵��'
-				}
+				},
+				btnType: 'emptyPakin'
 			}
 		},
 		onLoad() {
@@ -60,11 +62,7 @@
 				uni.request({
 					url: `${_this.baseUrl}/agv/basDevp/list/auth`,
 					header: {'token': uni.getStorageSync('token')},
-					data: {
-						curr: 1,
-						limit: 1000,
-						dev_no: _this.station.devNo
-					},
+					data: { curr: 1, limit: 1000,  dev_no: _this.station.devNo },
 					method: 'GET',
 					success(res) {
 						res = res.data
@@ -83,11 +81,7 @@
 							},500)
 						} else if (res.code == 403) {
 							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
-							setTimeout(() => {
-								uni.reLaunch({
-									url: '../login/login'
-								});
-							}, 1000);
+							setTimeout(() => { uni.reLaunch({ url: '../login/login' }); }, 1000);
 						} else {
 							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
 						}
@@ -96,7 +90,28 @@
 			},
 			// 绔欑偣瑙g粦 
 			unbind() {
-				
+				let  _this = this
+				let data = {param: JSON.stringify(_this.station)}
+				uni.request({
+					url: `${_this.baseUrl}/agv/basDevp/unbind/auth`,
+					header: {
+						'token': uni.getStorageSync('token'),
+						'content-type': 'application/x-www-form-urlencoded'
+					},
+					data: data,
+					method: 'POST',
+					success(res) {
+						res = res.data
+						if (res.code === 200) {
+							_this.reloadStation()
+						} 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' })
+						}
+					}
+				})
 			}
 		}
 	}

--
Gitblit v1.9.1