From 85d9ca4ec972ce4d020db046d930e8991709ae2d Mon Sep 17 00:00:00 2001
From: huangxiaoqiang <huangxiaoqiang@hnkhzn.com>
Date: 星期一, 03 十一月 2025 17:14:49 +0800
Subject: [PATCH] 1

---
 项目代码/PDA/pages/task/Inbound.vue |  243 +++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 195 insertions(+), 48 deletions(-)

diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/PDA/pages/task/Inbound.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/PDA/pages/task/Inbound.vue"
index 888d8cf..3f0f34d 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/PDA/pages/task/Inbound.vue"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/PDA/pages/task/Inbound.vue"
@@ -6,62 +6,108 @@
 			<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-easyinput type="text" :focus="barcodeFocus" v-model="PalletCode1" placeholder="璇疯緭鍏ユ墭鐩樼紪鐮�"
+							ref='midInput' @input="Changebarcode()"/>
 					</uni-forms-item>
 					<uni-forms-item label="鍏ュ簱璧风偣">
-						<uni-easyinput type="text" :focus="istrue" v-model="SourceAddress"
-							placeholder="璇疯緭鍏ュ叆搴撹捣鐐�" ref='midInput' />
+						<uni-easyinput type="text" :focus="addressFocus" v-model="SourceAddress" placeholder="璇疯緭鍏ュ叆搴撹捣鐐�"
+							ref='midInput' />
 					</uni-forms-item>
-					<uni-forms-item label="鍏ュ簱缁堢偣">
-						<uni-easyinput type="text" :focus="!istrue" @input="carNoInputChange" v-model="TargetAddress"
-							placeholder="璇疯緭鍏ュ叆搴撶粓鐐�" ref='midInput' />
+					<!-- <uni-forms-item label="鍏ュ簱缁堢偣">
+						<uni-easyinput type="text" :focus="istrue" v-model="TargetAddress" placeholder="璇疯緭鍏ュ叆搴撶粓鐐�"
+							ref='midInput' />
+					</uni-forms-item> -->
+					<uni-forms-item label="缁堢偣鍖哄煙">
+						<uni-data-select :focus="!istrue" v-model="AreaId" :localdata="range"
+							placeholder="璇疯緭閫夋嫨鍏ュ簱缁堢偣鍖哄煙"></uni-data-select>
 					</uni-forms-item>
 				</uni-forms>
 				<button @click="InboundTask" type="primary" size="default" style="margin-top: 2%;">鍏ュ簱</button>
-				<u-toast ref="InboundTaskluToast" />
+
 			</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="barcodefocus" @input="inputChangebarcode" v-model="Barcode"
-							placeholder="璇疯緭鍏ユ墭鐩樼紪鐮�" ref='midInput' />
+						<uni-easyinput type="text" :focus="barcodefocus" @input="inputChangebarcode"
+							v-model="PalletCode2" placeholder="璇疯緭鍏ユ墭鐩樼紪鐮�" ref='midInput' />
 					</uni-forms-item>
-					<uni-forms-item label="鍑哄簱璧风偣">
-						<uni-easyinput type="text" :focus="barcodefocus" v-model="StartAddress"
-							placeholder="璇疯緭鍏ュ嚭搴撹捣鐐�" ref='midInput' />
+					<uni-forms-item label="澶栫鏍囩:">
+						<uni-easyinput type="text" placeholder="璇锋壂鎻忓绠辨爣绛�" ref='midInput' :focus="focus" v-model="materSn"
+							@input="snInput" />
 					</uni-forms-item>
-					<uni-forms-item label="鍑哄簱缁堢偣">
-						<uni-easyinput type="text" :focus="barcodefocus" v-model="EndAddress"
-							placeholder="璇疯緭鍏ュ嚭搴撶粓鐐�" ref='midInput' />
-					</uni-forms-item>
+					<view v-if="group.length" class="scan-result">
+						<uni-card v-for="(item, index) in group" :key="item.orderNo">
+							<view class="info-grid">
+								<view class="info-row">
+									<text class="label">璁㈠崟缂栫爜锛�</text>
+									<text>{{ item.orderNo }}</text>
+								</view>
+								<br>
+								<view class="info-row">
+									<text class="label">浠撳簱鍚嶇О锛�</text>
+									<text>{{ item.warehouseName }}</text>
+								</view><br>
+								<view class="info-row">
+									<text class="label">鐗╂枡缂栫爜锛�</text>
+									<text>{{ item.materialNo }}</text>
+								</view><br>
+								<uni-forms-item label="缁勭洏鏁伴噺">
+									<uni-easyinput v-model="item.quantity" type="number" />
+								</uni-forms-item>
+							</view>
+							<uni-icons type="trash" class="delete-icon" @click="removeScanItem(item.orderNo)" />
+						</uni-card>
+					</view>
 				</uni-forms>
-				<button @click="OutboundTask" type="primary" size="default" style="margin-top: 2%;">鍑哄簱</button>
-				<u-toast ref="OutboundTaskluToast" />
+				<button @click="GroupPlate" type="primary" size="default" style="margin-top: 2%;">缁勭洏</button>
 			</view>
 		</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="barcodefocus" @input="inputChange" v-model="PalletCode3"
+							placeholder="璇疯緭鍏ユ墭鐩樼紪鐮�" ref='midInput' />
+					</uni-forms-item>
+				</uni-forms>
+				<button @click="SolvePlate" type="primary" size="default" style="margin-top: 2%;">瑙g洏</button>
+			</view>
+		</view>
+		<u-toast ref="luToast" />
 	</view>
 </template>
 
 <script>
+	import {
+		config
+	} from '../../common/config';
+	const innerAudioContext = uni.createInnerAudioContext();
 	export default {
 		data() {
 			return {
+				barcodeFocus:true,
+				focus: false,
 				istrue: false,
+				addressFocus:false,
 				barcodefocus: false,
 				range: [],
-				EndAddress: "",
-				StartAddress: "",
-				Barcode: "",
-				TargetAddress:"",
-				PalletCode: "",
+				group: [],
+				AreaId: 0,
+				quantity: "",
 				SourceAddress: "",
-				items: ['鍏ュ簱', '鍑哄簱'],
+				TargetAddress: "",
+				PalletCode1: "",
+				PalletCode2: "",
+				PalletCode3: "",
+				materSn: "",
+				items: ['鍏ュ簱', '缁勭洏', '瑙g洏'],
 				current: 0
 			}
+		},
+		onLoad(res) {
+			this.range = config.AreaId;
 		},
 		methods: {
 			onClickItem(e) {
@@ -69,69 +115,170 @@
 					this.current = e.currentIndex;
 				}
 			},
+			voiceSpeech(src) {
+				innerAudioContext.src = src; // '../../static/success.mp3';
+				innerAudioContext.play();
+			},
 			InboundTask() {
-				if (this.PalletCode.length <= 0 && this.Point.length) {
-					this.$refs.InboundTaskluToast.show({
+				if (this.PalletCode1.length <= 0 && this.SourceAddress.length) {
+					this.$refs.luToast.show({
 						title: "鎵樼洏缂栫爜璺熺粦瀹氳揣浣嶄笉鑳戒负绌�",
 						type: "error"
 					})
 					return;
 				}
 				var param = {
-					"PalletCode": this.PalletCode,
+					"PalletCode": this.PalletCode1,
 					"Position": this.SourceAddress,
-					"TargetAddress":this.TargetAddress
+					"TargetAddress": this.TargetAddress,
+					"AreaId": this.AreaId,
 				}
-				console.log(param);
-				this.$u.post('/api/Task/RequestTaskAsync', param).then(res => {
+				this.$u.post('/api/Task/RequestInboundTaskAsync', param).then(res => {
 					if (res.status) {
-						this.$refs.InboundTaskluToast.show({
+						this.$refs.luToast.show({
 							title: res.message,
 							type: "success"
 						})
-						this.PalletCode = "";
+						this.PalletCode1 = "";
 						this.SourceAddress = "";
-						this.TargetAddress="";
+						this.TargetAddress = "";
+						this.AreaId = "";
 						this.istrue = false;
 					} else {
-						this.$refs.InboundTaskluToast.show({
+						this.$refs.luToast.show({
 							title: res.message,
 							type: "error"
 						})
 					}
 				})
 			},
-			OutboundTask() {
-				if (this.EndAddress.length <= 0 && this.Barcode.length) {
-					this.$refs.OutboundTaskluToast.show({
+			GroupPlate() {
+				if (this.PalletCode2.length <= 0 && this.InBoundOrder.length) {
+					this.$refs.luToast.show({
 						title: "璇疯緭鍏ヨ捣鐐圭珯鍙�",
 						type: "error"
 					})
 					return;
 				}
 				var param = {
-					"PalletCode": this.Barcode,
-					"Position": this.StartAddress,
-					"TargetAddress":this.EndAddress
+					"PalletCode": this.PalletCode2,
+					"groups": this.group
 				}
-				this.$u.post('/api/Task/RequestOutTaskAsync', param).then(res => {
+				this.$u.post('/api/BoxingInfo/AddGroupPlateAsync', param).then(res => {
 					if (res.status) {
-						this.$refs.OutboundTaskluToast.show({
+						this.$refs.luToast.show({
 							title: res.message,
 							type: "success"
 						})
-						this.Barcode = "";
-						this.EndAddress = "";
-						this.StartAddress="";
+						this.PalletCode2 = "";
+						this.group = [];
 						this.barcodefocus = false;
 					} else {
-						this.$refs.OutboundTaskluToast.show({
+						this.$refs.luToast.show({
 							title: res.message,
 							type: "error"
 						})
 					}
 				})
 			},
+
+			SolvePlate() {
+				if (this.PalletCode3.length <= 0) {
+					this.$refs.luToast.show({
+						title: "璇疯緭鍏ユ墭鐩樻潯鐮�",
+						type: "error"
+					})
+					return;
+				}
+				var param = {
+					"PalletCode": this.PalletCode3,
+				}
+				this.$u.post('/api/StockInfo/DeleteGroupPlateAsync', param).then(res => {
+					if (res.status) {
+						this.$refs.luToast.show({
+							title: res.message,
+							type: "success"
+						})
+						this.PalletCode3 = "";
+						this.barcodefocus = false;
+					} else {
+						this.$refs.luToast.show({
+							title: res.message,
+							type: "error"
+						})
+					}
+				})
+			},
+			updateFocus() {
+				this.$nextTick(() => {
+					this.materSn = '';
+					if (!this.focus) {
+						this.focus = true;
+					}
+				});
+			},
+			snInput() {
+				this.$nextTick(() => {
+					var matObj = {
+						orderNo: this.materSn,
+					}
+					var temp = this.group.find(x => x.orderNo == matObj.orderNo);
+					if (!temp) {
+						this.$u.post('/api/InboundOrder/GetInboundOrderInfo?orderNo=' + this.materSn, "").then(
+							res => {
+								if (res.status) {
+									this.group.push(res.data);
+									setTimeout(this.updateFocus, 200);
+									setTimeout(() => {
+										this.voiceSpeech('../../static/success.mp3');
+									}, 100);
+								} else {
+									this.$refs.luToast.show({
+										title: res.message,
+										type: "error"
+									})
+								}
+							})
+
+					} else {
+						this.$refs.luToast.show({
+							title: "鎵爜閲嶅",
+							type: "error"
+						})
+						setTimeout(this.updateFocus, 200);
+						setTimeout(() => {
+							this.voiceSpeech('../../static/fail.mp3');
+						}, 100);
+					}
+
+				})
+			},
+			Changebarcode() {
+				this.barcodeFocus = false;
+				this.$nextTick(function(x) {
+					if (this.PalletCode1 != '') {
+						this.addressFocus = true;
+					}
+				})
+			},
+			inputChangebarcode() {
+				this.$nextTick(() => {
+					this.$u.post('/api/BoxingInfo/GetPalletCodeInfo?palletCode=' + this.PalletCode2, "").then(
+						res => {
+							if (res.status) {
+								this.group = res.data;
+								console.log(this.group);
+								setTimeout(this.updateFocus, 200);
+								setTimeout(() => {
+									this.voiceSpeech('../../static/success.mp3');
+								}, 100);
+							}
+						})
+				})
+			},
+			removeScanItem(orderNo) {
+				this.group = this.group.filter(item => item.orderNo !== orderNo);
+			}
 		}
 	}
 </script>

--
Gitblit v1.9.3