From 72390e0230b64cd43fedf0ba8e17aba097568a4a Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期四, 26 六月 2025 16:36:13 +0800
Subject: [PATCH] 1

---
 代码管理/ZhongHePDA/pages/task/AgvTask.vue |  155 ++++++++++++++++++++++++---------------------------
 1 files changed, 73 insertions(+), 82 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/ZhongHePDA/pages/task/AgvTask.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/ZhongHePDA/pages/task/AgvTask.vue"
index 5cace51..10b40ab 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/ZhongHePDA/pages/task/AgvTask.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/ZhongHePDA/pages/task/AgvTask.vue"
@@ -5,40 +5,32 @@
 		<view v-show="current === 0">
 			<view style="padding: 5%;">
 				<uni-forms label-width="120">
-					<uni-forms-item label="鎵樼洏鏁伴噺">
-						<uni-easyinput type="text" :focus="istrue" @input="carNoInputChange" v-model="PalletCode"
-							placeholder="璇疯緭鍏ユ墭鐩樻暟閲�" ref='midInput' />
+					<uni-forms-item label="缁堢偣">
+						<uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="EndAddress"
+							placeholder="璇疯緭鍏ョ粓鐐�" ref='midInput' />
 					</uni-forms-item>
-					<uni-forms-item label="缁戝畾璐т綅">
-						<uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="Point"
-							placeholder="璇疯緭鍏ョ粦瀹氳揣浣嶇偣" ref='midInput' />
+					<uni-forms-item label="璧风偣">
+						<uni-easyinput type="text" :focus="istrue" v-model="StartAddress1" placeholder="璇疯緭鍏ヨ捣鐐�"
+							ref='midInput' />
 					</uni-forms-item>
 				</uni-forms>
-				<button @click="Bind" type="primary" size="default" style="margin-top: 2%;">缁戝畾</button>
-				<u-toast ref="BindluToast" />
+				<button @click="CallMateriel" type="primary" size="default" style="margin-top: 2%;">鍛兼枡</button>
+				<u-toast ref="CallMaterieluToast" />
 			</view>
 		</view>
 		<view v-show="current === 1">
 			<view style="padding: 5%;">
 				<uni-forms label-width="120">
-					<uni-forms-item label="缁堢偣">
-						<uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="EndAddress"
-							placeholder="璇疯緭鍏ョ粓鐐�" ref='midInput' />
-					</uni-forms-item>
-				</uni-forms>
-				<button @click="CallMateriel" type="primary" size="default" style="margin-top: 2%;">鍙枡</button>
-				<u-toast ref="CallMaterieluToast" />
-			</view>
-		</view>
-		<view v-show="current === 2">
-			<view style="padding: 5%;">
-				<uni-forms label-width="120">
 					<uni-forms-item label="璧风偣">
-						<uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="StartAddress"
+						<uni-easyinput type="text" :focus="!istrue1" @input="carNoInputChange1" v-model="StartAddress"
 							placeholder="璇疯緭鍏ヨ捣鐐�" ref='midInput' />
 					</uni-forms-item>
+					<uni-forms-item label="缁堢偣">
+						<uni-easyinput type="text" :focus="istrue1" v-model="EndAddress1" placeholder="璇疯緭鍏ョ粓鐐�"
+							ref='midInput' />
+					</uni-forms-item>
 				</uni-forms>
-				<button @click="MaterielCarry" type="primary" size="default" style="margin-top: 2%;">鎼繍</button>
+				<button @click="MaterielCarry" type="primary" size="default" style="margin-top: 2%;">鍙栨枡</button>
 				<u-toast ref="MaterielCarryuToast" />
 			</view>
 		</view>
@@ -51,12 +43,15 @@
 		data() {
 			return {
 				istrue: false,
+				istrue1: false,
 				range: [],
 				EndAddress: "",
+				EndAddress1:"",
+				StartAddress1:"",
 				StartAddress: "",
 				PalletCode: "",
 				Point: "",
-				items: ['璐т綅缁戝畾', '鍙枡', '鎼繍'],
+				items: ['鍛兼枡', '鍙栨枡'],
 				current: 0
 			}
 		},
@@ -65,38 +60,30 @@
 		// },
 		methods: {
 			onClickItem(e) {
-				if (this.current != e.currentIndex) {
+				this.istrue = false;
+				this.istrue1 = false;
+				this.StartAddress = "";
+				this.EndAddress == "";
+				this.StartAddress1 = "";
+				this.EndAddress1 == "";
+				if (this.current !== e.currentIndex) {
 					this.current = e.currentIndex;
+					if (this.current == 2) {
+						this.getData();
+					}
 				}
 			},
-			Bind() {
-				if (this.PalletCode.length == "" || this.Point.length == "") {
-					this.$refs.BindluToast.show({
-						title: "鎵樼洏鏁伴噺璺熺粦瀹氳揣浣嶄笉鑳戒负绌�",
-						type: "error"
-					})
-					return;
-				}
-				// var param = {
-				// 	MainData: {
-				// 		"PalletCode": this.PalletCode,
-				// 		"Point": this.Point
-				// 	},
-				// }
-				this.$u.post('/api/PDA/Bind?qty=' + this.PalletCode + '&point=' + this.Point, {}).then(res => {
-					if (res.status) {
-						this.$refs.BindluToast.show({
-							title: "缁戝畾鎴愬姛",
-							type: "success"
-						})
-						this.Point = "";
-						this.PalletCode = "";
-						this.istrue = false;
-					} else {
-						this.$refs.BindluToast.show({
-							title: res.message,
-							type: "error"
-						})
+			carNoInputChange() {
+				this.$nextTick(function(x) {
+					if (this.EndAddress.length > 0) {
+						this.istrue = true;
+					}
+				})
+			},
+			carNoInputChange1() {
+				this.$nextTick(function(x) {
+					if (this.StartAddress.length > 0) {
+						this.istrue1 = true;
 					}
 				})
 			},
@@ -113,21 +100,23 @@
 				// 		"endPoint": this.EndAddress
 				// 	},
 				// }
-				this.$u.post('/api/PDA/CallMateriel?endPoint=' + this.EndAddress, {}).then(res => {
-					if (res.status) {
-						this.$refs.CallMaterieluToast.show({
-							title: "鍙枡鎴愬姛",
-							type: "success"
-						})
-						this.EndAddress = "";
-						this.istrue = false;
-					} else {
-						this.$refs.CallMaterieluToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				})
+				this.$u.post('/api/PDA/CallMateriel?endPoint=' + this.EndAddress + '&startPoint=' + this.StartAddress1, {})
+					.then(res => {
+						if (res.status) {
+							this.$refs.CallMaterieluToast.show({
+								title: "鍛煎彨Agv閫佹枡鎴愬姛",
+								type: "success"
+							})
+							this.StartAddress1 = "";
+							this.EndAddress = "";
+							this.istrue = false;
+						} else {
+							this.$refs.CallMaterieluToast.show({
+								title: res.message,
+								type: "error"
+							})
+						}
+					})
 			},
 			MaterielCarry() {
 				if (this.StartAddress == "") {
@@ -142,21 +131,23 @@
 				// 		"startPoint": this.StartAddress
 				// 	},
 				// }
-				this.$u.post('/api/PDA/MaterielCarry?startPoint=' + this.StartAddress, {}).then(res => {
-					if (res.status) {
-						this.$refs.MaterielCarryuToast.show({
-							title: "鍛煎彨Agv鎼繍鎴愬姛",
-							type: "success"
-						})
-						this.StartAddress = "";
-						this.istrue = false;
-					} else {
-						this.$refs.MaterielCarryuToast.show({
-							title: res.message,
-							type: "error"
-						})
-					}
-				})
+				this.$u.post('/api/PDA/MaterielCarry?startPoint=' + this.StartAddress + '&endPoint=' + this.EndAddress1, {})
+					.then(res => {
+						if (res.status) {
+							this.$refs.MaterielCarryuToast.show({
+								title: "鍛煎彨Agv鍙栨枡鎴愬姛",
+								type: "success"
+							})
+							this.StartAddress = "";
+							this.EndAddress1 = "";
+							this.istrue = false;
+						} else {
+							this.$refs.MaterielCarryuToast.show({
+								title: res.message,
+								type: "error"
+							})
+						}
+					})
 			},
 		}
 	}

--
Gitblit v1.9.3