From 4e4414bc9d1604fd2a3ed443cb9484143eab7e2c Mon Sep 17 00:00:00 2001
From: zhou zhou <3272660260@qq.com>
Date: 星期四, 15 一月 2026 13:52:19 +0800
Subject: [PATCH] #

---
 pages/AGV/StartInTask.vue |  142 ++++++++++++++++++++++++++++------------------
 1 files changed, 86 insertions(+), 56 deletions(-)

diff --git a/pages/AGV/StartInTask.vue b/pages/AGV/StartInTask.vue
index 3214c5b..e49360d 100644
--- a/pages/AGV/StartInTask.vue
+++ b/pages/AGV/StartInTask.vue
@@ -1,17 +1,27 @@
 <template>
 	<view class="has-foot">
 		<form>
-			<view class="cu-form-group ">
-				<view class="title">鎺ラ┏绔�</view>
-				<input placeholder="璇锋壂鎻忔帴椹崇珯鏉$爜" v-model="barcode" ></input>
+			<view class="cu-form-group margin-top">
+				<view class="title">鎺ラ┏绔欑偣</view>
+				<input placeholder="璇锋壂鎻忔帴椹崇珯鐐规潯鐮�" v-model="agvStation" ></input>
+				<!-- <text class='cuIcon-search text-blue' @click="search"></text> -->
+			</view>	
+			<view class="cu-form-group">
+				<view class="title">瀹瑰櫒鍙�</view>
+				<input placeholder="璇锋壂鎻忓鍣ㄧ紪鐮�" v-model="barcode" ></input>
 				<text class='cuIcon-search text-blue' @click="search"></text>
-			</view>			
+			</view>	
+<!-- 			<view class="flex solid-bottom padding-sm justify-between">
+				<view class="text-blue margin-left">瀹瑰櫒鐮�:{{container}}</view>				
+			</view> -->
+			<view class="cu-form-group">
+				<view class="title">鐩爣搴撳尯</view>
+				<view style="width: 75%;">
+					<uni-data-select style="min-width: 50%; max-width: 100%;" v-model="whAreaId" :localdata="range"
+						placement="bottom" @change="selChange"></uni-data-select>
+				</view>
+			</view>
 		</form>
-		<view class="flex solid-bottom padding-sm justify-between">
-			<view class="text-blue">瀹瑰櫒鐮�:{{container}}</view>
-			
-		</view>
-
 
 
 		<view class="cu-list det menu sm-border  padding">
@@ -38,19 +48,9 @@
 						<text class="text-grey ">{{item.asnCode}}</text>
 					</view>
 				</view>
-
 				<view class="cu-item">
 					<view class="content">
-						<text class="text-black">渚涘簲鍟嗘壒娆�:</text>
-					</view>
-					<view class="action">
-						<text class="text-grey">{{item.splrBatch}}</text>
-					</view>
-				</view>
-
-				<view class="cu-item">
-					<view class="content">
-						<text class="text-black">搴撳瓨鎵规:</text>
+						<text class="text-black">鎵规:</text>
 					</view>
 					<view class="action">
 						<text class="text-grey ">{{item.batch}}</text>
@@ -72,31 +72,11 @@
 
 
 		<view class="cu-bar btn-group foot">
-			<button class="cu-btn text-blue line-blue shadow" @click="clear">娓呯┖</button>
-			<button class="cu-btn bg-blue shadow-blur" @click="confirm">瑙g粦</button>
+			<button v-if="hasButtonPermission('reset')" class="cu-btn text-blue line-blue shadow" @click="clear">娓呯┖</button>
+			<button v-if="hasButtonPermission('submit')" class="cu-btn bg-blue shadow-blur" :disabled="repeatClick" @click="confirm">鍏ュ簱</button>
 		</view>
 
-		<uni-popup ref="popup" class="cu-popup">
-			<view class="popup-content">
-				<view class="head">
-					<text>鎺ㄨ崘</text>
-					<text class='cuIcon-close text-red close' @click="close"></text>
-				</view>
-
-				<div class="body">
-					<view class="cu-list grid col-3 no-border">
-						<view class="item" v-for="el in range">
-							<view class="cu-btn round  sm" :class="[el===curCode?'bg-blue':'line-blue']"
-								@click="itemChange(el)">{{el}}</view>
-						</view>
-					</view>
-				</div>
-
-				<view class="cu-bar btn-group ">
-					<button class="cu-btn bg-blue shadow-blur" @click="popupSubmit">鎻愪氦</button>
-				</view>
-			</view>
-		</uni-popup>
+		
 
 	</view>
 </template>
@@ -120,14 +100,32 @@
 				container: '',
 				list: [],
 				range: [],
-				curCode: ''
+				curCode: '',
+				whAreaId:'',
+				repeatClick: false,
+				buttonPermissions: [] ,// 鎸夐挳鏉冮檺鍒楄〃
+				agvStation:''
+				
 			}
 		},
 		computed: {
 			...mapState('user', ['dynamicFields']),
 		},
-		mounted() {},
-		methods: {			
+		mounted() {
+			this.getRece()
+			this.whAreaId = uni.getStorageSync('whAreaId')
+			
+			// 鑾峰彇鎸夐挳鏉冮檺
+			this.buttonPermissions = uni.getStorageSync('buttonPermissions') || [];
+			console.log('褰撳墠椤甸潰鎸夐挳鏉冮檺:', this.buttonPermissions);
+		},
+		methods: {
+			hasButtonPermission(route) {
+				return this.buttonPermissions.includes(route);
+			},
+			selChange(val) {
+				uni.setStorageSync('whAreaId', val)
+			},
 			async search() {
 				let that = this
 				const {
@@ -141,7 +139,12 @@
 					if(data.list.length >0){
 						that.container = data.barcode						
 						that.list = data.list
-					}					
+					}
+					that.range = data.warehouseAreasList.map(item => ({
+						value: item.id,
+						text: item.name
+					}));
+					that.whAreaId = data.area
 				} else {
 					uni.showToast({
 						title: msg,
@@ -176,24 +179,40 @@
 			},
 
 			async confirm() {				
-				if(this.barcode === '' || this.barcode ===null){
+				if(this.agvStation === '' || this.agvStation ===null){
 					uni.showToast({
-						title: "鎺ラ┏绔欑爜涓嶈兘涓虹┖",
+						title: "鎺ラ┏绔欑偣涓嶈兘涓虹┖",
 						icon: "none",
 					})
 					return ;
 				}
+				if(this.barcode === '' || this.barcode ===null){
+					uni.showToast({
+						title: "瀹瑰櫒鍙蜂笉鑳戒负绌�",
+						icon: "none",
+					})
+					return ;
+				}
+				if(this.whAreaId === '' || this.whAreaId ===null){
+					uni.showToast({
+						title: "鐩爣搴撳尯涓嶈兘涓虹┖",
+						icon: "none",
+					})
+					return ;
+				} 
+				this.repeatClick = true
 				const {
 					code,
 					data,
 					msg
-				} = await request('/AGV/staUnBind',{						
-						sta: this.barcode
+				} = await request('/AGV/task/start',{						
+						sta: this.barcode,
+						area: this.whAreaId
 					}
 				)
 				if (code === 200) {
 					uni.showToast({
-						title: '瑙g粦鎴愬姛'
+						title: '鍚姩鎴愬姛'
 					})
 					this.clear()
 				} else {
@@ -202,11 +221,22 @@
 						icon: "none",
 					})
 				}
-
-
-
+				this.repeatClick = false
 			},
-
+			
+			async getRece() {				
+				const {
+					code,
+					data,
+					msg
+				} = await request('/areas/user/all', {}, 'get')
+				if (code === 200) {
+					this.range = data.map(item => ({
+						value: item.id,
+						text: item.warehouseId$ + "-- " + item.name
+					}));
+				}
+			},
 		}
 	}
 </script>

--
Gitblit v1.9.1