From 81f25b1e8c7db1db399fce8d1c9143bd489a7ee0 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 12 五月 2025 15:11:22 +0800
Subject: [PATCH] #AGV站点绑定

---
 pages/home/index.vue     |   14 +-
 pages.json               |    6 +
 pages/listing/labour.vue |    4 
 pages/AGV/AGVStaBind.vue |  272 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 287 insertions(+), 9 deletions(-)

diff --git a/pages.json b/pages.json
index 8255ecf..9c45260 100644
--- a/pages.json
+++ b/pages.json
@@ -31,6 +31,12 @@
 			}
 		},
 		{
+			"path": "pages/AGV/AGVStaBind",
+			"style": {
+				"navigationBarTitleText": "AGV绔欑偣缁戝畾"
+			}
+		},
+		{
 			"path": "pages/listing/matnrPalletising",
 			"style": {
 				"navigationBarTitleText": "鐗╂枡缁勭洏"
diff --git a/pages/AGV/AGVStaBind.vue b/pages/AGV/AGVStaBind.vue
new file mode 100644
index 0000000..7a96a2d
--- /dev/null
+++ b/pages/AGV/AGVStaBind.vue
@@ -0,0 +1,272 @@
+<template>
+	<view class="has-foot">
+		<form>
+			<view class="cu-form-group margin-top">
+				<view class="title">瀹瑰櫒缂栧彿</view>
+				<input placeholder="璇锋壂瀹瑰櫒缂栧彿" v-model="container"></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>
+			</view>
+		</form>
+
+
+
+		<view class="cu-list det menu sm-border  padding">
+			<block v-for="(item, index) in list" :key="index">
+				<view class="cu-bar bg-white solid-bottom margin-top-sm">
+					<view class="action">
+						<view class="index">
+							{{index+1}}
+						</view>
+						<view class="text-blue">
+							{{`${item.maktx}`}}
+						</view>
+					</view>
+					<!-- 	<view class="action" >
+						<text @click="remove(index)" class="cuIcon-close text-red" style="font-size: 24px;"></text>
+					</view> -->
+				</view>
+
+				<view class="cu-item">
+					<view class="content">
+						<text class="text-black">ASN:</text>
+					</view>
+					<view class="action">
+						<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>
+					</view>
+					<view class="action">
+						<text class="text-grey ">{{item.batch}}</text>
+					</view>
+				</view>
+
+
+				<view class="cu-item">
+					<view class="content">
+						<text class="text-black">鏀惰揣鏁伴噺:</text>
+					</view>
+					<view class="action">
+						<text class="text-grey ">{{item.anfme}}</text>
+					</view>
+				</view>
+
+			</block>
+		</view>
+
+
+		<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">缁戝畾</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>
+
+<script>
+	import {
+		request
+	} from '../../common/request.js'
+	import {
+		mapState,
+		mapMutations,
+		mapActions,
+		mapGetters
+	} from 'vuex';
+	export default {
+		data() {
+			return {
+				barcode: '',
+				areaName: '',
+				locCode: '',
+				container: '',
+				list: [],
+				range: [],
+				curCode: ''
+			}
+		},
+		computed: {
+			...mapState('user', ['dynamicFields']),
+		},
+		mounted() {},
+		methods: {
+			async search() {
+				const {
+					code,
+					data,
+					msg
+				} = await request('/stock/operate/list', {					
+					barcode: this.container,
+					sta: this.barcode
+				})
+				if (code === 200) {
+					// const find = this.list.find(el => el.id === data.id);
+					// !find &&
+					 this.list = data
+				} else {
+					uni.showToast({
+						title: msg,
+						icon: "none",
+					})
+				}
+			},
+
+			remove(index) {
+				this.list.splice(index, 1);
+			},
+			clear() {
+				this.list = []
+				
+				this.container = ''
+				this.barcode = ''
+			},
+
+			open() {
+				this.$refs.popup.open()
+			},
+
+			close() {
+				this.$refs.popup.close()
+			},
+
+			popupSubmit() {
+				this.$refs.popup.close()
+			},
+			itemChange(el) {
+				this.curCode = el
+			},
+
+			async confirm() {
+				if(this.container === '' || this.container ===null){
+					uni.showToast({
+						title: "瀹瑰櫒鐮佷笉鑳戒负绌�",
+						icon: "none",
+					})
+					return ;
+				}
+				if(this.barcode === '' || this.barcode ===null){
+					uni.showToast({
+						title: "鎺ラ┏绔欑爜涓嶈兘涓虹┖",
+						icon: "none",
+					})
+					return ;
+				}
+				const {
+					code,
+					data,
+					msg
+				} = await request('/AGV/staBind',{
+						barcode: this.container,
+						sta: this.barcode
+					}
+				)
+				if (code === 200) {
+					uni.showToast({
+						title: '缁戝畾鎴愬姛'
+					})
+					this.clear()
+				} else {
+					uni.showToast({
+						title: msg,
+						icon: "none",
+					})
+				}
+
+
+
+			},
+
+		}
+	}
+</script>
+
+<style>
+	.index {
+		border: 1px solid #e54d42;
+		color: #e54d42;
+		border-radius: 50%;
+		display: block;
+		width: 50rpx;
+		height: 50rpx;
+		line-height: 48rpx;
+		text-align: center;
+		margin-right: 20rpx;
+		font-size: 30rpx;
+	}
+
+	.text-blue {
+		color: #0081ff !important;
+
+	}
+
+	.item {
+		position: relative;
+		display: flex;
+		min-height: 80upx;
+		align-items: center;
+	}
+
+	.uni-file-picker {
+		width: 100%;
+		margin-bottom: 10px;
+	}
+
+	.uni-select__selector {
+		z-index: 999;
+	}
+
+	.tj {
+		height: auto;
+		padding: 6px 8px;
+		display: inline-block;
+		border-radius: 6px;
+	}
+
+	.item {
+		display: flex;
+		justify-content: center;
+	}
+
+	.item .cu-btn {
+		font-size: 26upx;
+	}
+</style>
\ No newline at end of file
diff --git a/pages/home/index.vue b/pages/home/index.vue
index 88e8cb9..70d6370 100644
--- a/pages/home/index.vue
+++ b/pages/home/index.vue
@@ -90,21 +90,21 @@
 					<text>浜哄伐涓婃灦</text>
 				</navigator>
 			</view>
-
-			<!-- <view class="cu-item">
-				<navigator hover-class='none' url="/pages/listing/upper" navigateTo>
+			
+			<view class="cu-item">
+				<navigator hover-class='none' url="/pages/AGV/AGVStaBind" navigateTo>
 					<view class="cuIcon-punch text-blue">
 					</view>
-					<text>涓婃灦</text>
+					<text>AGV绔欑偣缁戝畾</text>
 				</navigator>
 			</view>
 			<view class="cu-item">
-				<navigator hover-class='none' url="/pages/phyz/inStock/inStock" navigateTo>
+				<navigator hover-class='none' url="/pages/AGV/AGVStaBind" navigateTo>
 					<view class="cuIcon-punch text-blue">
 					</view>
-					<text>鍏ュ簱涓婃灦</text>
+					<text>AGV鍚姩鍏ュ簱</text>
 				</navigator>
-			</view> -->
+			</view>
 		</view>
 
 		<view class="cu-bar bg-white solid-bottom margin-top">
diff --git a/pages/listing/labour.vue b/pages/listing/labour.vue
index c03eaa4..5b27e05 100644
--- a/pages/listing/labour.vue
+++ b/pages/listing/labour.vue
@@ -2,8 +2,8 @@
 	<view class="has-foot">
 		<form>
 			<view class="cu-form-group ">
-				<view class="title">鎵樼洏</view>
-				<input placeholder="璇锋壂鎻忔墭鐩�" v-model="container"></input>
+				<view class="title">瀹瑰櫒鐮�</view>
+				<input placeholder="璇锋壂鎻忓鍣ㄧ爜" v-model="container"></input>
 				<text class='cuIcon-search text-blue' @click="search"></text>
 			</view>
 			<view class="cu-form-group">

--
Gitblit v1.9.1