From e01dae65d8ea58d2cf8519aaac4ceba79b9c82a0 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 22 七月 2024 10:10:51 +0800
Subject: [PATCH] #

---
 pages/phyz/stationManage/pickAgain.vue |   30 ++++++++++++++++++++++++------
 1 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/pages/phyz/stationManage/pickAgain.vue b/pages/phyz/stationManage/pickAgain.vue
index 446135c..7d6f2f3 100644
--- a/pages/phyz/stationManage/pickAgain.vue
+++ b/pages/phyz/stationManage/pickAgain.vue
@@ -36,7 +36,7 @@
 		</view>
 		<!-- 搴曢儴鎿嶄綔鎸夐挳 -->
 		<view class="buttom">
-			<button size="mini" type="primary" @click="confirmPick('warn')">纭鎷f枡</button>
+			<button size="mini" type="primary" @click="confirmPick('warn')" :disabled="pickAgaDis">纭鎷f枡</button>
 		</view>
 	</view>
 </template>
@@ -53,7 +53,8 @@
 				maxCount: 0,
 				wrkNo: '',
 				locNo: '',
-				pickedAnfme: 0
+				pickedAnfme: 0,
+				pickAgaDis: false
 			}
 		},
 		onShow() {
@@ -73,6 +74,7 @@
 		},
 		methods: {
 			getLocDetl(locNo) {
+				
 				let _this = this
 				uni.request({
 					url: `${_this.baseUrl}/agv/locDetl/list/auth/v2`,
@@ -120,7 +122,7 @@
 						} else {
 							uni.showToast({ title: res.msg, icon: "error", position: 'top' })
 						}
-					}
+					},
 				})
 			},
 			// 宸查�夋嫞鏂欏垪琛�
@@ -155,10 +157,21 @@
 				// 鍒ゆ柇娣诲姞鐨勫晢鍝佹槸鍚﹀拰宸茬粡娣诲姞鐨勯噸澶�
 				let dataList = this.dataList
 				this.index = index
-				if (this.dataList[index].stock > this.dataList[index].anfme) {
-					this.maxCount = this.dataList[index].anfme
+				let orderCount = this.dataList[index].stock
+				let locCount = this.dataList[index].anfme
+				let pickedAnfme = this.dataList[index].pickedAnfme
+				// 棰勮鏈�澶ц鍑哄簱
+				let ftCount = pickedAnfme + orderCount
+				
+				if (orderCount > locCount) {
+					this.maxCount = locCount - pickedAnfme
 				} else {
-					this.maxCount = this.dataList[index].stock
+					if (ftCount > locCount) {
+						this.maxCount = locCount -pickedAnfme
+					} else {
+						this.maxCount = orderCount 
+					}
+					
 				}
 				
 				this.$refs.addItem.open()
@@ -176,6 +189,7 @@
 			},
 			// 纭鍐嶆鎷f枡
 			confirmPick() {
+				this.pickAgaDis = true
 				let _this = this
 				uni.request({
 					url: `${_this.baseUrl}/agvMobile/pick/again/auth`,
@@ -187,6 +201,7 @@
 					}),
 					method: 'POST',
 					success(res) {
+						_this.pickAgaDis = false
 						res = res.data
 						console.log(res);
 						if  (res.code === 200) {
@@ -202,6 +217,9 @@
 						}
 					}
 				})
+			},
+			fail(res) {
+				_this.pickAgaDis = false
 			}
 		}
 	}

--
Gitblit v1.9.1