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/basic/cachePoint.vue |  147 +++++++++++++++++++++++++++++++------------------
 1 files changed, 93 insertions(+), 54 deletions(-)

diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/ZhongHePDA/pages/basic/cachePoint.vue" "b/\344\273\243\347\240\201\347\256\241\347\220\206/ZhongHePDA/pages/basic/cachePoint.vue"
index 50e971a..3c44718 100644
--- "a/\344\273\243\347\240\201\347\256\241\347\220\206/ZhongHePDA/pages/basic/cachePoint.vue"
+++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/ZhongHePDA/pages/basic/cachePoint.vue"
@@ -1,36 +1,37 @@
 <template>
 	<view>
-        <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
-        </uni-segmented-control>
-            <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="value"
-                				placeholder="璇疯緭鍏ョ紦瀛樼偣" ref='midInput' />
-                		</uni-forms-item>
-                	</uni-forms>
-                	<button @click="submit" type="primary" size="default" style="margin-top: 2%;">閲婃斁</button>
-                	<u-toast ref="uToast" />
-                </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="value"
-                				placeholder="璇疯緭鍏ョ紦瀛樼偣" ref='midInput' />
-                		</uni-forms-item>
-                	</uni-forms>
-                	<button @click="submit" type="primary" size="default" style="margin-top: 2%;">鎷嗗寘</button>
-                	<u-toast ref="uToast" />
-                </view>
-            </view>
-            <!-- <view v-show="current === 2">
-                閫夐」鍗�3鐨勫唴瀹�
-            </view> -->
-        </view>
-    </view>
+		<uni-segmented-control :current="current" :values="items" @clickItem="onClickItem">
+		</uni-segmented-control>
+		<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="barcodeInput" v-model="Point"
+							placeholder="璇疯緭鍏ョ紦瀛樼偣" ref='midInput' />
+					</uni-forms-item>
+					<uni-forms-item label="鎵樼洏鏁伴噺">
+						<uni-easyinput type="text" :focus="istrue" v-model="PalletCode" 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="value"
+							placeholder="璇疯緭鍏ョ紦瀛樼偣" ref='midInput' />
+					</uni-forms-item>
+				</uni-forms>
+				<button @click="submit" type="primary" size="default" style="margin-top: 2%;">閲婃斁</button>
+				<u-toast ref="BindluToast1" />
+			</view>
+		</view>
+	</view>
+	</view>
 </template>
 
 <script>
@@ -39,8 +40,10 @@
 			return {
 				istrue: false,
 				range: [],
+				PalletCode: "",
+				Point: "",
 				value: "",
-				items: ['閲婃斁缂撳瓨浣�', '鎷嗗寘'],
+				items: ['缁戝畾缂撳瓨鐐�', '閲婃斁缂撳瓨鐐�'], //, '鎷嗗寘'
 				current: 0
 			}
 		},
@@ -48,44 +51,80 @@
 			this.getEndLocations();
 		},
 		methods: {
+			barcodeInput() {
+				this.$nextTick(function(x) {
+					if (this.Point.length > 0) {
+						this.istrue = true;
+					}
+				})
+			},
 			onClickItem(e) {
-			      if (this.current != e.currentIndex) {
-			        this.current = e.currentIndex;
-			      }
-			    },
-			submit() {
-				if (this.value.length <= 0) {
-					this.$refs.uToast.show({
-						title: "璇疯緭鍏ョ紦瀛樼偣",
+				this.istrue = false;
+				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: {
-						matCode: this.value,
-						endPoint: this.value
-					}
-				}
-				this.$u.post('/api/AcrossFloorCarry/AcrossFloorCallMat', param).then(res => {
+				this.$u.post('/api/PDA/Bind?qty=' + this.PalletCode + '&point=' + this.Point, {}).then(res => {
 					if (res.status) {
-						this.$refs.uToast.show({
-							title: "閲婃斁鎴愬姛",
+						this.$refs.BindluToast.show({
+							title: "缁戝畾鎴愬姛",
 							type: "success"
 						})
-						this.carNo = "";
-						this.value = "";
-						this.locationNo = "";
+						this.Point = "";
+						this.PalletCode = "";
 						this.istrue = false;
 					} else {
-						this.$refs.uToast.show({
+						this.$refs.BindluToast.show({
 							title: res.message,
 							type: "error"
 						})
 					}
 				})
 			},
-			
+			submit() {
+				if (this.value == "") {
+					this.$refs.BindluToast1.show({
+						title: "璇疯緭鍏ョ紦瀛樼偣",
+						type: "error"
+					})
+					return;
+				}
+				// var param = {
+				// 	MainData: {
+				// 		matCode: this.value,
+				// 		endPoint: this.value
+				// 	}
+				// }
+				this.$u.post('/api/PDA/AcrossFloorCallMat?Point=' + this.value, {}).then(res => {
+					if (res.status) {
+						this.$refs.BindluToast1.show({
+							title: "閲婃斁鎴愬姛",
+							type: "success"
+						})
+						// this.carNo = "";
+						this.value = "";
+						// this.locationNo = "";
+						this.istrue = false;
+					} else {
+						this.$refs.BindluToast1.show({
+							title: res.message,
+							type: "error"
+						})
+					}
+				})
+			},
+
 		}
 	}
 </script>

--
Gitblit v1.9.3