From 4f39dcc195f28fa275fc2d065fbf1bf6a46c21b7 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 17 六月 2025 00:41:18 +0800
Subject: [PATCH] 优化出入库逻辑

---
 代码管理/ZhongHePDA/pages/task/AgvTask.vue |  100 ++++++++++++++-----------------------------------
 1 files changed, 29 insertions(+), 71 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 ec4b025..be438df 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,32 +5,16 @@
 		<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>
-					<uni-forms-item label="缁戝畾璐т綅">
-						<uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="Point"
-							placeholder="璇疯緭鍏ョ粦瀹氳揣浣嶇偣" ref='midInput' />
-					</uni-forms-item>
-				</uni-forms>
-				<button @click="Bind" type="primary" size="default" style="margin-top: 2%;">缁戝畾</button>
-				<u-toast ref="BindluToast" />
-			</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>
+				<button @click="CallMateriel" type="primary" size="default" style="margin-top: 2%;">鍛兼枡</button>
 				<u-toast ref="CallMaterieluToast" />
 			</view>
 		</view>
-		<view v-show="current === 2">
+		<view v-show="current === 1">
 			<view style="padding: 5%;">
 				<uni-forms label-width="120">
 					<uni-forms-item label="璧风偣">
@@ -38,7 +22,7 @@
 							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>
@@ -54,9 +38,9 @@
 				range: [],
 				EndAddress: "",
 				StartAddress: "",
-				PalletCode:"",
-				Point:"",
-				items: ['璐т綅缁戝畾', '鍙枡', '鎼繍'],
+				PalletCode: "",
+				Point: "",
+				items: ['鍛兼枡', '鍙栨枡'],
 				current: 0
 			}
 		},
@@ -65,57 +49,31 @@
 		// },
 		methods: {
 			onClickItem(e) {
-				if (this.current != e.currentIndex) {
+				this.istrue = false;
+				if (this.current !== e.currentIndex) {
 					this.current = e.currentIndex;
-				}
-			},
-			Bind() {
-				if (this.PalletCode.length <= 0&&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/CallMateriel', param).then(res => {
-					if (res.status) {
-						this.$refs.uToast.show({
-							title: "鍛煎彨Agv鎼繍鎴愬姛",
-							type: "success"
-						})
-						this.EndAddress = "";
-						this.istrue = false;
-					} else {
-						this.$refs.BindluToast.show({
-							title: res.message,
-							type: "error"
-						})
+					if (this.current == 2) {
+						this.getData();
 					}
-				})
+				}
 			},
 			CallMateriel() {
-				if (this.EndAddress.length <= 0) {
+				if (this.EndAddress == "") {
 					this.$refs.CallMaterieluToast.show({
 						title: "璇疯緭鍏ョ粓鐐�",
 						type: "error"
 					})
 					return;
 				}
-				var param = {
-					MainData: {
-						"endPoint": this.EndAddress
-					},
-				}
-				this.$u.post('/api/PDA/CallMateriel', param).then(res => {
+				// var param = {
+				// 	MainData: {
+				// 		"endPoint": this.EndAddress
+				// 	},
+				// }
+				this.$u.post('/api/PDA/CallMateriel?endPoint=' + this.EndAddress, {}).then(res => {
 					if (res.status) {
-						this.$refs.uToast.show({
-							title: "鍛煎彨Agv鎼繍鎴愬姛",
+						this.$refs.CallMaterieluToast.show({
+							title: "鍛煎彨Agv閫佹枡鎴愬姛",
 							type: "success"
 						})
 						this.EndAddress = "";
@@ -129,22 +87,22 @@
 				})
 			},
 			MaterielCarry() {
-				if (this.StartAddress.length <= 0) {
+				if (this.StartAddress == "") {
 					this.$refs.MaterielCarryuToast.show({
 						title: "璇疯緭鍏ヨ捣鐐�",
 						type: "error"
 					})
 					return;
 				}
-				var param = {
-					MainData: {
-						"startPoint": this.StartAddress
-					},
-				}
-				this.$u.post('/api/PDA/MaterielCarry', param).then(res => {
+				// var param = {
+				// 	MainData: {
+				// 		"startPoint": this.StartAddress
+				// 	},
+				// }
+				this.$u.post('/api/PDA/MaterielCarry?startPoint=' + this.StartAddress, {}).then(res => {
 					if (res.status) {
-						this.$refs.uToast.show({
-							title: "鍛煎彨Agv鎼繍鎴愬姛",
+						this.$refs.MaterielCarryuToast.show({
+							title: "鍛煎彨Agv鍙栨枡鎴愬姛",
 							type: "success"
 						})
 						this.StartAddress = "";

--
Gitblit v1.9.3